Prepare for handling DLT_IPV4 and DLT_IPV6.

svn path=/trunk/; revision=35223
This commit is contained in:
Jaap Keuter 2010-12-19 18:46:08 +00:00
parent 9347f11d41
commit 7e16ec5b99
4 changed files with 24 additions and 2 deletions

View File

@ -120,6 +120,14 @@ dissect_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(fh_tree, tvb, 0, 0, "No link information available");
}
if (pinfo->fd->lnk_t == WTAP_ENCAP_RAW_IP4) {
call_dissector(ip_handle, tvb, pinfo, tree);
}
else if (pinfo->fd->lnk_t == WTAP_ENCAP_RAW_IP6) {
call_dissector(ipv6_handle, tvb, pinfo, tree);
}
else
/* So far, the only time we get raw connection types are with Linux and
* Irix PPP connections. We can't tell what type of data is coming down
* the line, so our safest bet is IP. - GCC
@ -198,4 +206,6 @@ proto_reg_handoff_raw(void)
ppp_hdlc_handle = find_dissector("ppp_hdlc");
raw_handle = create_dissector_handle(dissect_raw, proto_raw);
dissector_add("wtap_encap", WTAP_ENCAP_RAW_IP, raw_handle);
dissector_add("wtap_encap", WTAP_ENCAP_RAW_IP4, raw_handle);
dissector_add("wtap_encap", WTAP_ENCAP_RAW_IP6, raw_handle);
}

View File

@ -358,6 +358,10 @@ static const struct {
{ 226, WTAP_ENCAP_IPNET },
/* SocketCAN frame */
{ 227, WTAP_ENCAP_SOCKETCAN },
/* Raw IPv4 */
{ 228, WTAP_ENCAP_RAW_IP4 },
/* Raw IPv6 */
{ 229, WTAP_ENCAP_RAW_IP6 },
/* IEEE 802.15.4 Wireless PAN no fcs */
{ 230, WTAP_ENCAP_IEEE802_15_4_NOFCS },

View File

@ -479,7 +479,13 @@ static struct encap_type_info encap_table_base[] = {
{ "IEEE 802.15.4 Wireless PAN with FCS not present", "wpan-nofcs" },
/* WTAP_ENCAP_RAW_IPFIX */
{ "IPFIX", "ipfix" }
{ "IPFIX", "ipfix" },
/* WTAP_ENCAP_RAW_IP4 */
{ "Raw IPv4", "rawip4" },
/* WTAP_ENCAP_RAW_IP6 */
{ "Raw IPv6", "rawip6" }
};
gint wtap_num_encap_types = sizeof(encap_table_base) / sizeof(struct encap_type_info);

View File

@ -216,8 +216,10 @@ extern "C" {
#define WTAP_ENCAP_IPNET 124
#define WTAP_ENCAP_SOCKETCAN 125
#define WTAP_ENCAP_IEEE802_11_NETMON_RADIO 126
#define WTAP_ENCAP_IEEE802_15_4_NOFCS 127
#define WTAP_ENCAP_IEEE802_15_4_NOFCS 127
#define WTAP_ENCAP_RAW_IPFIX 128
#define WTAP_ENCAP_RAW_IP4 129
#define WTAP_ENCAP_RAW_IP6 130
#define WTAP_NUM_ENCAP_TYPES wtap_get_num_encap_types()