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
This commit is contained in:
Guy Harris 2004-09-19 07:13:52 +00:00
parent f9a64fcf9d
commit 3cdebd31db
5 changed files with 16 additions and 4 deletions

View File

@ -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.

View File

@ -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);
}

View File

@ -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)

View File

@ -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. */

View File

@ -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