Merge branch 'topic/jgras/packet-header' of https://github.com/J-Gras/bro

In the merge, I changed IP.cc to use icmp6_hdr for icmpv6 instead of the
icmp* that was used in the patch. While it does not make a difference
for this case, it seems cleaner.

BIT-1570 #merged
This commit is contained in:
Johanna Amann 2016-04-22 16:07:01 -07:00
commit 176bb6ef34
9 changed files with 116 additions and 75 deletions

View file

@ -1,5 +1,9 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include <sys/types.h>
#include <netinet/in.h>
#include <netinet/icmp6.h>
#include "IP.h"
#include "Type.h"
#include "Val.h"
@ -403,6 +407,17 @@ RecordVal* IP_Hdr::BuildPktHdrVal(RecordVal* pkt_hdr, int sindex) const
break;
}
case IPPROTO_ICMPV6:
{
const struct icmp6_hdr* icmpp = (const struct icmp6_hdr*) data;
RecordVal* icmp_hdr = new RecordVal(icmp_hdr_type);
icmp_hdr->Assign(0, new Val(icmpp->icmp6_type, TYPE_COUNT));
pkt_hdr->Assign(sindex + 4, icmp_hdr);
break;
}
default:
{
// This is not a protocol we understand.