diff options
author | Michael Mann <mmann78@netscape.net> | 2013-10-27 20:38:42 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-10-27 20:38:42 +0000 |
commit | 8c64c5da892b3861260950d8bd34b6c2f9acd2d4 (patch) | |
tree | f5c414e70579768ac7b32e5e4e1ed488aa3e05b1 /epan/dissectors | |
parent | 63ff652b8e07600ad0c7a350f379cfb9fbbf96ab (diff) |
Remove iplen and iphdrlen from struct _packet_info.
Dissectors should just use (reported) tvb length and taps have other ways to get the data.
svn path=/trunk/; revision=52899
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-coap.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ehs.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-igmp.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-ip.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ipv6.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-udp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-vcdu.c | 2 |
7 files changed, 9 insertions, 13 deletions
diff --git a/epan/dissectors/packet-coap.c b/epan/dissectors/packet-coap.c index 622b43bb89..1e59bab532 100644 --- a/epan/dissectors/packet-coap.c +++ b/epan/dissectors/packet-coap.c @@ -786,7 +786,7 @@ dissect_coap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) /* initialize the CoAP length and the content-Format */ /* * the length of CoAP message is not specified in the CoAP header. - * It has to be from the lower layer. the iplen of packet_info is not accurate. + * It has to be from the lower layer. * Currently, the length is just copied from the reported length of the tvbuffer. */ coap_length = tvb_reported_length(tvb); diff --git a/epan/dissectors/packet-ehs.c b/epan/dissectors/packet-ehs.c index 457567f1e5..75ce039440 100644 --- a/epan/dissectors/packet-ehs.c +++ b/epan/dissectors/packet-ehs.c @@ -867,7 +867,7 @@ aoslos_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, p proto_tree *ehs_data_zone_tree; /* create the data zone tree */ - ehs_data_zone = proto_tree_add_text ( ehs_tree, tvb, *offset, pinfo->iplen - IP_HEADER_LENGTH - *offset, "AOS/LOS Data Zone" ); + ehs_data_zone = proto_tree_add_text ( ehs_tree, tvb, *offset, tvb_reported_length(tvb) - *offset, "AOS/LOS Data Zone" ); ehs_data_zone_tree = proto_item_add_subtree ( ehs_data_zone, ett_ehs_data_zone ); /* since the aos/los EHS packet data zone is well known, format it for display as well @@ -902,7 +902,7 @@ udsm_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, pac int year, jday, hour, minute, second; /* create the data zone tree */ - ehs_data_zone = proto_tree_add_text ( ehs_tree, tvb, *offset, pinfo->iplen - IP_HEADER_LENGTH - *offset, "UDSM Data Zone" ); + ehs_data_zone = proto_tree_add_text ( ehs_tree, tvb, *offset, tvb_reported_length(tvb) - *offset, "UDSM Data Zone" ); ehs_data_zone_tree = proto_item_add_subtree ( ehs_data_zone, ett_ehs_data_zone ); proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_ccsds_vs_bpdu, tvb, *offset, 1, ENC_BIG_ENDIAN ); diff --git a/epan/dissectors/packet-igmp.c b/epan/dissectors/packet-igmp.c index 2e9f3634bd..ff1b230e23 100644 --- a/epan/dissectors/packet-igmp.c +++ b/epan/dissectors/packet-igmp.c @@ -909,7 +909,7 @@ dissect_igmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) switch (type) { case IGMP_V1_HOST_MEMBERSHIP_QUERY: /* 0x11 v1/v2/v3 */ - if ( (pinfo->iplen-pinfo->iphdrlen)>=12 ) { + if ( tvb_reported_length(tvb)>=12 ) { /* version 3 */ offset = dissect_igmp_v3_query(tvb, pinfo, tree, type, offset); } else { @@ -967,7 +967,7 @@ dissect_igmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) break; case IGMP_TYPE_0x25: - if ( (pinfo->iplen-pinfo->iphdrlen)>=8 ) { + if ( tvb_reported_length(tvb)>=8 ) { /* if len of igmp packet>=8 we assume it is MSNIP */ offset = dissect_msnip(tvb, pinfo, parent_tree, offset); } else { diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 93528e3de0..589ba2ba6b 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -2314,8 +2314,6 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) } pinfo->ipproto = iph->ip_p; - pinfo->iplen = iph->ip_len; - pinfo->iphdrlen = hlen; tap_queue_packet(ip_tap, pinfo, iph); /* Skip over header + options */ @@ -2328,14 +2326,14 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) */ save_fragmented = pinfo->fragmented; if (ip_defragment && (iph->ip_off & (IP_MF|IP_OFFSET)) && - tvb_bytes_exist(tvb, offset, pinfo->iplen - pinfo->iphdrlen) && + tvb_bytes_exist(tvb, offset, iph->ip_len - hlen) && ipsum == 0) { ipfd_head = fragment_add_check(&ip_reassembly_table, tvb, offset, pinfo, iph->ip_p ^ iph->ip_id ^ src32 ^ dst32, NULL, (iph->ip_off & IP_OFFSET) * 8, - pinfo->iplen - pinfo->iphdrlen, + iph->ip_len - hlen, iph->ip_off & IP_MF); next_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled IPv4", diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index b99c9594f8..3b7ec41dba 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -2093,8 +2093,6 @@ again: /* collect packet info */ pinfo->ipproto = nxt; - pinfo->iplen = (int)sizeof(ipv6) + plen + offset; - pinfo->iphdrlen = offset; tap_queue_packet(ipv6_tap, pinfo, &ipv6); if (offlg & IP6F_OFF_MASK || (ipv6_reassemble && offlg & IP6F_MORE_FRAG)) { diff --git a/epan/dissectors/packet-udp.c b/epan/dissectors/packet-udp.c index 800feade14..021bb13851 100644 --- a/epan/dissectors/packet-udp.c +++ b/epan/dissectors/packet-udp.c @@ -485,7 +485,7 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto) } } } else { - udph->uh_ulen = pinfo->iplen - pinfo->iphdrlen; + udph->uh_ulen = tvb_reported_length(tvb); udph->uh_sum_cov = tvb_get_ntohs(tvb, offset+4); if (((udph->uh_sum_cov > 0) && (udph->uh_sum_cov < 8)) || (udph->uh_sum_cov > udph->uh_ulen)) { /* Bogus length - it includes the header, so it must be >= 8, and no larger then the IP payload size. */ diff --git a/epan/dissectors/packet-vcdu.c b/epan/dissectors/packet-vcdu.c index b635bb2c63..b9d642a66f 100644 --- a/epan/dissectors/packet-vcdu.c +++ b/epan/dissectors/packet-vcdu.c @@ -402,7 +402,7 @@ dissect_vcdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) new_offset = offset + 2 + new_ptr; packet_boundary = - pinfo->iplen - IP_HEADER_LENGTH - VCDU_HEADER_LENGTH + tvb_reported_length(tvb) - VCDU_HEADER_LENGTH - CCSDS_PRIMARY_HEADER_LENGTH - CCSDS_SECONDARY_HEADER_LENGTH; while ( ((new_offset-offset+2) < packet_boundary) && ((new_offset-offset+2) >= 4) ) |