mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
Merge branch 'topic/jsiwek/ipv6-ext-headers' of ssh://git.bro-ids.org/bro into topic/jsiwek/ipv6-ext-headers
Conflicts: src/Sessions.cc
This commit is contained in:
commit
d2b59b1cb8
15 changed files with 211 additions and 3 deletions
|
@ -600,8 +600,7 @@ void NetSessions::DoNextPacket(double t, const struct pcap_pkthdr* hdr,
|
|||
if ( ipv6_ext_headers && ip_hdr->NumHeaders() > 1 )
|
||||
{
|
||||
pkt_hdr_val = ip_hdr->BuildPktHdrVal();
|
||||
// [Robin] This should be ipv6_ext_headers, right?
|
||||
conn->Event(new_packet, 0, pkt_hdr_val);
|
||||
conn->Event(ipv6_ext_headers, 0, pkt_hdr_val);
|
||||
}
|
||||
|
||||
if ( new_packet )
|
||||
|
|
32
src/bro.bif
32
src/bro.bif
|
@ -2049,6 +2049,38 @@ function is_v6_addr%(a: addr%): bool
|
|||
#
|
||||
# ===========================================================================
|
||||
|
||||
## Converts the *data* field of :bro:type:`ip6_routing` records that have
|
||||
## *rtype* of 0 into a set of addresses.
|
||||
##
|
||||
## s: The *data* field of an :bro:type:`ip6_routing` record that has
|
||||
## an *rtype* of 0.
|
||||
##
|
||||
## Returns: The set of addresses contained in the routing header data.
|
||||
function routing0_data_to_addrs%(s: string%): addr_set
|
||||
%{
|
||||
BroType* index_type = base_type(TYPE_ADDR);
|
||||
TypeList* set_index = new TypeList(index_type);
|
||||
set_index->Append(index_type);
|
||||
TableVal* tv = new TableVal(new SetType(set_index, 0));
|
||||
|
||||
int len = s->Len();
|
||||
const u_char* bytes = s->Bytes();
|
||||
bytes += 4; // go past 32-bit reserved field
|
||||
len -= 4;
|
||||
if ( ( len % 16 ) != 0 )
|
||||
reporter->Warning("Bad ip6_routing data length: %d", s->Len());
|
||||
|
||||
while ( len > 0 )
|
||||
{
|
||||
IPAddr a(IPAddr::IPv6, (const uint32*) bytes, IPAddr::Network);
|
||||
tv->Assign(new AddrVal(a), 0);
|
||||
bytes += 16;
|
||||
len -= 16;
|
||||
}
|
||||
|
||||
return tv;
|
||||
%}
|
||||
|
||||
## Converts a :bro:type:`addr` to a :bro:type:`index_vec`.
|
||||
##
|
||||
## a: The address to convert into a vector of counts.
|
||||
|
|
|
@ -837,7 +837,7 @@ int main(int argc, char** argv)
|
|||
|
||||
if ( dns_type != DNS_PRIME )
|
||||
net_init(interfaces, read_files, netflows, flow_files,
|
||||
writefile, "tcp or udp or icmp",
|
||||
writefile, "",
|
||||
secondary_path->Filter(), do_watchdog);
|
||||
|
||||
BroFile::SetDefaultRotation(log_rotate_interval, log_max_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue