Move IP Addr/Prefix/Header classes into namespaces

This commit is contained in:
Tim Wojtulewicz 2020-07-16 16:26:22 -07:00
parent 35c61697d9
commit 25c0fc7ab2
100 changed files with 495 additions and 460 deletions

View file

@ -14,7 +14,7 @@ PacketFilter::PacketFilter(bool arg_default)
dst_filter.SetDeleteFunction(PacketFilter::DeleteFilter);
}
void PacketFilter::AddSrc(const IPAddr& src, uint32_t tcp_flags, double probability)
void PacketFilter::AddSrc(const zeek::IPAddr& src, uint32_t tcp_flags, double probability)
{
Filter* f = new Filter;
f->tcp_flags = tcp_flags;
@ -32,7 +32,7 @@ void PacketFilter::AddSrc(zeek::Val* src, uint32_t tcp_flags, double probability
delete prev;
}
void PacketFilter::AddDst(const IPAddr& dst, uint32_t tcp_flags, double probability)
void PacketFilter::AddDst(const zeek::IPAddr& dst, uint32_t tcp_flags, double probability)
{
Filter* f = new Filter;
f->tcp_flags = tcp_flags;
@ -50,7 +50,7 @@ void PacketFilter::AddDst(zeek::Val* dst, uint32_t tcp_flags, double probability
delete prev;
}
bool PacketFilter::RemoveSrc(const IPAddr& src)
bool PacketFilter::RemoveSrc(const zeek::IPAddr& src)
{
auto f = static_cast<Filter*>(src_filter.Remove(src, 128));
delete f;
@ -64,7 +64,7 @@ bool PacketFilter::RemoveSrc(zeek::Val* src)
return f != nullptr;
}
bool PacketFilter::RemoveDst(const IPAddr& dst)
bool PacketFilter::RemoveDst(const zeek::IPAddr& dst)
{
auto f = static_cast<Filter*>(dst_filter.Remove(dst, 128));
delete f;
@ -78,7 +78,7 @@ bool PacketFilter::RemoveDst(zeek::Val* dst)
return f != nullptr;
}
bool PacketFilter::Match(const IP_Hdr* ip, int len, int caplen)
bool PacketFilter::Match(const zeek::IP_Hdr* ip, int len, int caplen)
{
Filter* f = (Filter*) src_filter.Lookup(ip->SrcAddr(), 128);
if ( f )
@ -91,8 +91,8 @@ bool PacketFilter::Match(const IP_Hdr* ip, int len, int caplen)
return default_match;
}
bool PacketFilter::MatchFilter(const Filter& f, const IP_Hdr& ip,
int len, int caplen)
bool PacketFilter::MatchFilter(const Filter& f, const zeek::IP_Hdr& ip,
int len, int caplen)
{
if ( ip.NextProto() == IPPROTO_TCP && f.tcp_flags )
{