Renaming the Logger to Reporter.

Also changing output to not include timestamps when we haven't started
processing packets yet.
This commit is contained in:
Robin Sommer 2011-07-01 09:22:33 -07:00
parent 93894eed9b
commit 66e2c3b623
123 changed files with 722 additions and 713 deletions

View file

@ -13,7 +13,7 @@
#include <arpa/inet.h>
#endif
#include "Logger.h"
#include "Reporter.h"
#include "net_util.h"
// - adapted from tcpdump
@ -230,14 +230,14 @@ uint32 dotted_to_addr(const char* addr_text)
if ( sscanf(addr_text,
"%d.%d.%d.%d", addr+0, addr+1, addr+2, addr+3) != 4 )
{
bro_logger->Error("bad dotted address:", addr_text );
reporter->Error("bad dotted address:", addr_text );
return 0;
}
if ( addr[0] < 0 || addr[1] < 0 || addr[2] < 0 || addr[3] < 0 ||
addr[0] > 255 || addr[1] > 255 || addr[2] > 255 || addr[3] > 255 )
{
bro_logger->Error("bad dotted address:", addr_text);
reporter->Error("bad dotted address:", addr_text);
return 0;
}
@ -254,7 +254,7 @@ uint32* dotted_to_addr6(const char* addr_text)
uint32* addr = new uint32[4];
if ( inet_pton(AF_INET6, addr_text, addr) <= 0 )
{
bro_logger->Error("bad IPv6 address:", addr_text );
reporter->Error("bad IPv6 address:", addr_text );
addr[0] = addr[1] = addr[2] = addr[3] = 0;
}
@ -274,7 +274,7 @@ uint32 to_v4_addr(const uint32* addr)
{
#ifdef BROv6
if ( ! is_v4_addr(addr) )
bro_logger->InternalError("conversion of non-IPv4 address to IPv4 address");
reporter->InternalError("conversion of non-IPv4 address to IPv4 address");
return addr[3];
#else
return addr[0];
@ -285,7 +285,7 @@ uint32 mask_addr(uint32 a, uint32 top_bits_to_keep)
{
if ( top_bits_to_keep > 32 )
{
bro_logger->Error("bad address mask value", top_bits_to_keep);
reporter->Error("bad address mask value", top_bits_to_keep);
return a;
}
@ -324,7 +324,7 @@ const uint32* mask_addr(const uint32* a, uint32 top_bits_to_keep)
if ( top_bits_to_keep == 0 || top_bits_to_keep > max_bits )
{
bro_logger->Error("bad address mask value", top_bits_to_keep);
reporter->Error("bad address mask value", top_bits_to_keep);
return addr;
}