Don't let the user specify a maximum capture file size if they're not
[obnox/wireshark/wip.git] / packet-q2931.c
index 06aa06b6bf0f08086267a7b25295da10f9165e22..a862cec4415b0e4f7bc829898a139f4992e53347 100644 (file)
@@ -2,12 +2,11 @@
  * Routines for Q.2931 frame disassembly
  * Guy Harris <guy@alum.mit.edu>
  *
- * $Id: packet-q2931.c,v 1.18 2001/06/18 02:17:50 guy Exp $
+ * $Id: packet-q2931.c,v 1.20 2001/12/10 00:25:32 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
  * Copyright 1998
- *
  * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -1974,7 +1973,6 @@ static void
 dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
        int             offset = 0;
-       guint           reported_length;
        proto_tree      *q2931_tree = NULL;
        proto_item      *ti;
        proto_tree      *ext_tree;
@@ -1989,8 +1987,8 @@ dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        int             codeset;
        gboolean        non_locking_shift;
 
-       if (check_col(pinfo->fd, COL_PROTOCOL))
-               col_set_str(pinfo->fd, COL_PROTOCOL, "Q.2931");
+       if (check_col(pinfo->cinfo, COL_PROTOCOL))
+               col_set_str(pinfo->cinfo, COL_PROTOCOL, "Q.2931");
 
        if (tree) {
                ti = proto_tree_add_item(tree, proto_q2931, tvb, offset,
@@ -2012,8 +2010,8 @@ dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                offset += call_ref_len;
        }
        message_type = tvb_get_guint8(tvb, offset);
-       if (check_col(pinfo->fd, COL_INFO)) {
-               col_add_str(pinfo->fd, COL_INFO,
+       if (check_col(pinfo->cinfo, COL_INFO)) {
+               col_add_str(pinfo->cinfo, COL_INFO,
                    val_to_str(message_type, q2931_message_type_vals,
                      "Unknown message type (0x%02X)"));
        }
@@ -2045,8 +2043,7 @@ dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         */
        codeset = 0;    /* start out in codeset 0 */
        non_locking_shift = TRUE;
-       reported_length = tvb_reported_length(tvb);
-       while (offset < reported_length) {
+       while (tvb_reported_length_remaining(tvb, offset) > 0) {
                info_element = tvb_get_guint8(tvb, offset);
                info_element_ext = tvb_get_guint8(tvb, offset + 1);
                info_element_len = tvb_get_ntohs(tvb, offset + 2);