diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-09-19 07:13:52 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-09-19 07:13:52 +0000 |
commit | 3cdebd31db6ee22cae1cf15e8586ed11bbcf1db7 (patch) | |
tree | 26319169014fcb2a4b0f287771f0fb1cbd45707d | |
parent | f9a64fcf9d9f5bc2ebeb8d746dbac46c6bdbdb15 (diff) |
From Mark C. Brown: fix support for nettl NETTL_SUBSYS_NS_LS_ICMP and
NETTL_SUBSYS_NS_LS_ICMPV6 - they don't even have IP headers, so we need
to directly call the ICMP and ICMPv6 dissectors.
svn path=/trunk/; revision=12047
-rw-r--r-- | epan/dissectors/packet-icmpv6.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-ip.c | 1 | ||||
-rw-r--r-- | wiretap/nettl.c | 8 | ||||
-rw-r--r-- | wiretap/wtap.c | 6 | ||||
-rw-r--r-- | wiretap/wtap.h | 4 |
5 files changed, 16 insertions, 4 deletions
diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index 2d62c92a61..dece17b436 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -1652,6 +1652,7 @@ proto_reg_handoff_icmpv6(void) icmpv6_handle = create_dissector_handle(dissect_icmpv6, proto_icmpv6); dissector_add("ip.proto", IP_PROTO_ICMPV6, icmpv6_handle); + dissector_add("wtap_encap", WTAP_ENCAP_RAW_ICMPV6, icmpv6_handle); /* * Get a handle for the IPv6 dissector. diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 7eaad3cf0a..bb4a45090b 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -1894,4 +1894,5 @@ proto_reg_handoff_icmp(void) icmp_handle = create_dissector_handle(dissect_icmp, proto_icmp); dissector_add("ip.proto", IP_PROTO_ICMP, icmp_handle); + dissector_add("wtap_encap", WTAP_ENCAP_RAW_ICMP, icmp_handle); } diff --git a/wiretap/nettl.c b/wiretap/nettl.c index 702b0e8f0e..404c613ab0 100644 --- a/wiretap/nettl.c +++ b/wiretap/nettl.c @@ -311,10 +311,12 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, || (encap[3] == NETTL_SUBSYS_NS_LS_LOOPBACK) || (encap[3] == NETTL_SUBSYS_NS_LS_UDP) || (encap[3] == NETTL_SUBSYS_NS_LS_TCP) - || (encap[3] == NETTL_SUBSYS_NS_LS_ICMP) - || (encap[3] == NETTL_SUBSYS_NS_LS_IPV6) - || (encap[3] == NETTL_SUBSYS_NS_LS_ICMPV6) ) { + || (encap[3] == NETTL_SUBSYS_NS_LS_IPV6)) { phdr->pkt_encap = WTAP_ENCAP_RAW_IP; + } else if (encap[3] == NETTL_SUBSYS_NS_LS_ICMP) { + phdr->pkt_encap = WTAP_ENCAP_RAW_ICMP; + } else if (encap[3] == NETTL_SUBSYS_NS_LS_ICMPV6) { + phdr->pkt_encap = WTAP_ENCAP_RAW_ICMPV6; } else if (encap[3] == NETTL_SUBSYS_PCI_FDDI) { phdr->pkt_encap = WTAP_ENCAP_FDDI; } else if( (encap[3] == NETTL_SUBSYS_PCI_TR) diff --git a/wiretap/wtap.c b/wiretap/wtap.c index dda21fde40..a58e93fc32 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -251,6 +251,12 @@ static const struct encap_type_info { /* WTAP_ENCAP_BACNET_MS_TP */ { "BACnet MS/TP", "bacnet-ms-tp" }, + + /* WTAP_ENCAP_RAW_ICMP */ + { "Raw ICMP", "raw-icmp" }, + + /* WTAP_ENCAP_RAW_ICMPV6 */ + { "Raw ICMPv6", "raw-icmpv6" }, }; /* Name that should be somewhat descriptive. */ diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 2df872017c..d624df981f 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -153,9 +153,11 @@ #define WTAP_ENCAP_SYMANTEC 61 #define WTAP_ENCAP_APPLE_IP_OVER_IEEE1394 62 #define WTAP_ENCAP_BACNET_MS_TP 63 +#define WTAP_ENCAP_RAW_ICMP 64 +#define WTAP_ENCAP_RAW_ICMPV6 65 /* last WTAP_ENCAP_ value + 1 */ -#define WTAP_NUM_ENCAP_TYPES 64 +#define WTAP_NUM_ENCAP_TYPES 66 /* File types that can be read by wiretap. We support writing some many of these file types, too, so we |