Don't pass "tvb_reported_length_remaining(tvb, offset)" as the fourth
authorGuy Harris <guy@alum.mit.edu>
Thu, 30 May 2002 01:56:55 +0000 (01:56 -0000)
committerGuy Harris <guy@alum.mit.edu>
Thu, 30 May 2002 01:56:55 +0000 (01:56 -0000)
argument to "tvb_new_subset()" - just use -1 if the subset tvbuff is to
run to the end of the parent tvbuff.

svn path=/trunk/; revision=5597

14 files changed:
packet-bpdu.c
packet-cdp.c
packet-chdlc.c
packet-clnp.c
packet-dsi.c
packet-http.c
packet-icap.c
packet-ieee80211.c
packet-ip.c
packet-ipp.c
packet-rtp.c
packet-snmp.c
packet-tns.c
packet-vines.c

index e0fa8e4dff60c59106ccc4d2e872e330f18f3955..fd339d997210e42066f5178c36602490467af0b3 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-bpdu.c
  * Routines for BPDU (Spanning Tree Protocol) disassembly
  *
- * $Id: packet-bpdu.c,v 1.35 2002/03/31 21:33:51 guy Exp $
+ * $Id: packet-bpdu.c,v 1.36 2002/05/30 01:56:54 guy Exp $
  *
  * Copyright 1999 Christophe Tronche <ch.tronche@computer.org>
  * 
@@ -313,7 +313,9 @@ dissect_bpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                       bpdu_type);
 
            if (bpdu_type != BPDU_TYPE_CONF && bpdu_type != BPDU_TYPE_RST) {
-             call_dissector(data_handle,tvb_new_subset(tvb, BPDU_TYPE + 1,-1,tvb_reported_length_remaining(tvb,BPDU_TYPE + 1)), pinfo, tree);
+             call_dissector(data_handle,
+                            tvb_new_subset(tvb, BPDU_TYPE + 1, -1, -1),
+                            pinfo, tree);
              return;
            }
 
index af2f7edde5adfa508671082fbc4e0c8288634d8c..714bbe01b455f9cfbb45f8a7aa8461ed940ebe5a 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for the disassembly of the "Cisco Discovery Protocol"
  * (c) Copyright Hannes R. Boehm <hannes@boehm.org>
  *
- * $Id: packet-cdp.c,v 1.44 2002/01/24 09:20:47 guy Exp $
+ * $Id: packet-cdp.c,v 1.45 2002/05/30 01:56:54 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -356,7 +356,8 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                offset += length;
            }
        }
-       call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, cdp_tree);
+       call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo,
+                       cdp_tree);
     }
 }
 
index b1e141c4efeeb06ac318d0f6cde215249c9e035e..1ba74eaaec1d38cba79c45a8fb06aa51fbe9c264 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-chdlc.c
  * Routines for Cisco HDLC packet disassembly
  *
- * $Id: packet-chdlc.c,v 1.12 2002/04/13 09:22:39 guy Exp $
+ * $Id: packet-chdlc.c,v 1.13 2002/05/30 01:56:54 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -280,7 +280,8 @@ dissect_slarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
       col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown packet type 0x%08X", code);
     if (tree) {
       proto_tree_add_uint(slarp_tree, hf_slarp_ptype, tvb, 0, 4, code);
-      call_dissector(data_handle,tvb_new_subset(tvb, 4,-1,tvb_reported_length_remaining(tvb,4)), pinfo, slarp_tree);
+      call_dissector(data_handle, tvb_new_subset(tvb, 4, -1, -1), pinfo,
+                    slarp_tree);
     }
     break;
   }
index 9f3362447767204a41b024d6d36a555a7b334d4d..1d5ccd8c05c6d4c780ef14e0f1f1291b07507c2c 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-clnp.c
  * Routines for ISO/OSI network and transport protocol packet disassembly
  *
- * $Id: packet-clnp.c,v 1.54 2002/04/30 23:56:58 guy Exp $
+ * $Id: packet-clnp.c,v 1.55 2002/05/30 01:56:54 guy Exp $
  * Laurent Deniel <deniel@worldnet.fr>
  * Ralf Schneider <Ralf.Schneider@t-online.de>
  *
@@ -716,7 +716,7 @@ static int osi_decode_DR(tvbuff_t *tvb, int offset,
   offset += li + 1;
 
   /* User data */
-  call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree);
+  call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
   offset += tvb_length_remaining(tvb, offset);
      /* we dissected all of the containing PDU */
 
@@ -1087,7 +1087,7 @@ static int osi_decode_CC(tvbuff_t *tvb, int offset,
   offset += li;
 
   /* User data */
-  call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree);
+  call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
   offset += tvb_length_remaining(tvb, offset);
      /* we dissected all of the containing PDU */
 
@@ -1480,7 +1480,8 @@ static gboolean dissect_ositp_internal(tvbuff_t *tvb, packet_info *pinfo,
       if (check_col(pinfo->cinfo, COL_INFO))
         col_append_str(pinfo->cinfo, COL_INFO, "Length indicator is zero");
       if (!first_tpdu)
-        call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree);
+        call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1),
+                       pinfo, tree);
       return found_ositp;
     }
 
@@ -1533,7 +1534,8 @@ static gboolean dissect_ositp_internal(tvbuff_t *tvb, packet_info *pinfo,
 
     if (new_offset == -1) { /* incorrect TPDU */
       if (!first_tpdu)
-        call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree);
+        call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1),
+                       pinfo, tree);
       break;
     }
 
@@ -1949,7 +1951,8 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     /* As we haven't reassembled anything, we haven't changed "pi", so
        we don't have to restore it. */
-    call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree);
+    call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo,
+                   tree);
     pinfo->fragmented = save_fragmented;
     return;
   }
index f265b4fc1abb8bdacac601ed8a6a0ea34b5b6573..c39499925f3585a66b53aac86e51bfb390a767c6 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for dsi packet dissection
  * Copyright 2001, Randy McEoin <rmceoin@pe.com>
  *
- * $Id: packet-dsi.c,v 1.21 2002/05/10 23:20:38 guy Exp $
+ * $Id: packet-dsi.c,v 1.22 2002/05/30 01:56:54 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -539,7 +539,9 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                break;
        default:
                if (tree) {     
-                       call_dissector(data_handle,tvb_new_subset(tvb, DSI_BLOCKSIZ,-1,tvb_reported_length_remaining(tvb,DSI_BLOCKSIZ)), pinfo, dsi_tree); 
+                       call_dissector(data_handle,
+                           tvb_new_subset(tvb, DSI_BLOCKSIZ, -1, -1),
+                           pinfo, dsi_tree);
                }
                break;
        }
index 25410fb747e727b8927d7a22fcd14549aad02949..dafa4703787b29eb23ed6710703b7f5acbd60c50 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Guy Harris <guy@alum.mit.edu>
  *
- * $Id: packet-http.c,v 1.47 2002/04/01 21:12:30 guy Exp $
+ * $Id: packet-http.c,v 1.48 2002/05/30 01:56:54 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -280,8 +280,11 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                         */
                        if (ti != NULL)
                                proto_item_set_len(ti, offset);
-               } else
-                       call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, http_tree);
+               } else {
+                       call_dissector(data_handle,
+                           tvb_new_subset(tvb, offset, -1, -1), pinfo,
+                           http_tree);
+               }
        }
 }
 
index fec2d350569dd76529cc5990350795a333ea6c99..056cf8aac1d57f37d2d927e0c795946f1f75a458 100644 (file)
@@ -226,7 +226,8 @@ is_icap_header:
 
        datalen = tvb_length_remaining(tvb, offset);
        if (datalen > 0) {
-               call_dissector(data_handle,tvb_new_subset(tvb, offset, -1, tvb_reported_length_remaining(tvb,offset)), pinfo, icap_tree);
+               call_dissector(data_handle,
+                   tvb_new_subset(tvb, offset, -1, -1), pinfo, icap_tree);
        }
 }
 
index 99aef128e30a8c841e83ce816f9410545e849d63..74a4f4d7fe8e18cd47e6bc7e041e2cb380e5c082 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright 2000, Axis Communications AB 
  * Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
  *
- * $Id: packet-ieee80211.c,v 1.61 2002/05/01 07:21:19 guy Exp $
+ * $Id: packet-ieee80211.c,v 1.62 2002/05/30 01:56:54 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1607,7 +1607,9 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo,
            cap_len -= 4 - (pkt_len - cap_len);
          pkt_len -= 4;
          if (cap_len > 0 && pkt_len > 0)
-           call_dissector(data_handle,tvb_new_subset(tvb, hdr_len + 4, -1,tvb_reported_length_remaining(tvb,hdr_len + 4)),pinfo, tree);
+           call_dissector(data_handle,
+                          tvb_new_subset(tvb, hdr_len + 4, -1, -1),
+                          pinfo, tree);
        }
        return;
     }
index 681f73f94080438f7b57d166cb33fe0f567495d5..105ac5411f71e22f27f1d68c481ae5f869e7afa4 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-ip.c
  * Routines for IP and miscellaneous IP protocol packet disassembly
  *
- * $Id: packet-ip.c,v 1.165 2002/03/31 21:43:51 guy Exp $
+ * $Id: packet-ip.c,v 1.166 2002/05/30 01:56:55 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1104,7 +1104,8 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     if (check_col(pinfo->cinfo, COL_INFO))
       col_add_fstr(pinfo->cinfo, COL_INFO, "Fragmented IP protocol (proto=%s 0x%02x, off=%u)",
        ipprotostr(iph.ip_p), iph.ip_p, (iph.ip_off & IP_OFFSET) * 8);
-    call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree);
+    call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo,
+                   tree);
     pinfo->fragmented = save_fragmented;
     return;
   }
@@ -1576,7 +1577,8 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
       case ICMP_ECHOREPLY:
       case ICMP_ECHO:
-       call_dissector(data_handle,tvb_new_subset(tvb, 8,-1,tvb_reported_length_remaining(tvb,8)), pinfo, icmp_tree);
+       call_dissector(data_handle, tvb_new_subset(tvb, 8, -1, -1), pinfo,
+                      icmp_tree);
        break;
 
       case ICMP_RTRADVERT:
@@ -1593,7 +1595,8 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                dissect_mip_extensions(tvb, 8 + i*8, icmp_tree);
          }
        } else
-         call_dissector(data_handle,tvb_new_subset(tvb, 8,-1,tvb_reported_length_remaining(tvb,8)), pinfo, icmp_tree);
+         call_dissector(data_handle, tvb_new_subset(tvb, 8, -1, -1), pinfo,
+                        icmp_tree);
        break;
 
       case ICMP_TSTAMP:
index a9992437cf27f620e23ed7f940f94aeb5c4dd8b8..1d775143fb59585ab2ec7d88a86115903045bcea 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Guy Harris <guy@alum.mit.edu>
  *
- * $Id: packet-ipp.c,v 1.30 2002/03/31 22:12:45 guy Exp $
+ * $Id: packet-ipp.c,v 1.31 2002/05/30 01:56:55 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -230,8 +230,11 @@ dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
                offset = parse_attributes(tvb, offset, ipp_tree);
 
-               if (tvb_offset_exists(tvb, offset))
-                       call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, ipp_tree);
+               if (tvb_offset_exists(tvb, offset)) {
+                       call_dissector(data_handle,
+                           tvb_new_subset(tvb, offset, -1, -1), pinfo,
+                           ipp_tree);
+               }
        }
 }
 
index 724dec55ef3ab6f28a7c7cf6cd8ec7466110a0c4..be37628d792a5225ea2799cd9cd8f51f5f276149 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright 2000, Philips Electronics N.V.
  * Written by Andreas Sikkema <andreas.sikkema@philips.com>
  *
- * $Id: packet-rtp.c,v 1.33 2002/01/24 09:20:51 guy Exp $
+ * $Id: packet-rtp.c,v 1.34 2002/05/30 01:56:55 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -493,7 +493,9 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
                                 */
                                proto_tree_add_text(rtp_tree, tvb, 0, 0,
                                    "Frame has padding, but not all the frame data was captured");
-                               call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, rtp_tree);
+                               call_dissector(data_handle,
+                                   tvb_new_subset(tvb, offset, -1, -1),
+                                   pinfo, rtp_tree);
                                return;
                        }
 
index 0f343e1ca166167ba79740acd021522f5f280a0b..052642af9fb043f62db72163c4ac4c01f205c8bf 100644 (file)
@@ -8,7 +8,7 @@
  *
  * See RFCs 1905, 1906, 1909, and 1910 for SNMPv2u.
  *
- * $Id: packet-snmp.c,v 1.92 2002/04/08 01:55:05 guy Exp $
+ * $Id: packet-snmp.c,v 1.93 2002/05/30 01:56:55 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -441,7 +441,8 @@ dissect_snmp_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        if (tree != NULL) {
                proto_tree_add_text(tree, tvb, offset, 0, "%s", message);
-               call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree);
+               call_dissector(data_handle,
+                   tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
        }
 }
 
index 70e5ef35beb97b99b2660da8a76760971c1dfb09..4b552252f9e728036501a8bc0fb0d2aee19df8f9 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-tns.c
  * Routines for Oracle TNS packet dissection
  *
- * $Id: packet-tns.c,v 1.29 2002/02/01 04:34:15 gram Exp $
+ * $Id: packet-tns.c,v 1.30 2002/05/30 01:56:55 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -224,7 +224,8 @@ static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
        
        if ( data_tree )
        {
-               call_dissector(data_handle,tvb_new_subset(tvb,offset,-1,tvb_reported_length_remaining(tvb,offset)),pinfo,data_tree);
+               call_dissector(data_handle,
+                   tvb_new_subset(tvb, offset, -1, -1), pinfo, data_tree);
        }
 
        return;
@@ -804,7 +805,10 @@ dissect_tns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                        dissect_tns_data(tvb,offset,pinfo,tree,tns_tree);
                        break;
                default:
-                       call_dissector(data_handle,tvb_new_subset(tvb,offset,-1,tvb_reported_length_remaining(tvb,offset)),pinfo,tns_tree);
+                       call_dissector(data_handle,
+                           tvb_new_subset(tvb, offset, -1, -1), pinfo,
+                           tns_tree);
+                       break;
        }
 }
 
index e70845e3bfff2786cc145532503e5236a80ba49c..e27a5b72aab4cdb158189b4e35be89b1e3176a0c 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-vines.c
  * Routines for Banyan VINES protocol packet disassembly
  *
- * $Id: packet-vines.c,v 1.40 2002/04/24 06:03:34 guy Exp $
+ * $Id: packet-vines.c,v 1.41 2002/05/30 01:56:55 guy Exp $
  *
  * Don Lafontaine <lafont02@cn.ca>
  *
@@ -314,7 +314,7 @@ dissect_vines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        next_tvb = tvb_new_subset(tvb, offset, -1, -1);
        if (!dissector_try_port(vines_dissector_table, viph.vip_proto,
            next_tvb, pinfo, tree))
-               call_dissector(data_handle,next_tvb, pinfo, tree);
+               call_dissector(data_handle, next_tvb, pinfo, tree);
 }
 
 void
@@ -455,7 +455,8 @@ dissect_vines_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                    "Window: 0x%04x", viph.vspp_win);
        }
        offset += 16; /* sizeof SPP */
-       call_dissector(data_handle,tvb_new_subset(tvb, offset,-1,tvb_reported_length_remaining(tvb,offset)), pinfo, tree);
+       call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1),
+           pinfo, tree);
 }
 
 void