From Didier Gautheron:
[obnox/wireshark/wip.git] / plugins / docsis / packet-uccreq.c
index e33734068deffe1d1d49318fe0a60003fd98f2cd..ba5aa253841a00caef586900a825bb242cfc327b 100644 (file)
@@ -1,9 +1,11 @@
 /* packet-uccreq.c
  * Routines for Upstream Channel Change Request dissection
- * Copyright 2002, Anand V. Narwani <anarwani@cisco.com>
+ * Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
  *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * $Id$
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  *
  * This program is free software; you can redistribute it and/or
 # include "config.h"
 #endif
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "plugins/plugin_api.h"
-#include "plugins/plugin_api_defs.h"
-#include "moduleinfo.h"
-
-#include <gmodule.h>
-
 #include <epan/packet.h>
 
 /* Initialize the protocol and registered fields */
@@ -53,13 +45,11 @@ dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 {
 
   proto_item *it;
-  proto_tree *uccreq_tree;
-  guint16 tlv_data_len;
+  proto_tree *uccreq_tree = NULL;
   guint8 chid;
   tvbuff_t *next_tvb;
 
   chid = tvb_get_guint8 (tvb, 0);
-  tlv_data_len = tvb_length_remaining (tvb, 1);
 
   if (check_col (pinfo->cinfo, COL_INFO))
     {
@@ -72,17 +62,16 @@ dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
   if (tree)
     {
       it =
-       proto_tree_add_protocol_format (tree, proto_docsis_uccreq, tvb, 0,
-                                       tvb_length_remaining (tvb, 0),
+       proto_tree_add_protocol_format (tree, proto_docsis_uccreq, tvb, 0, -1,
                                        "UCC Request");
       uccreq_tree = proto_item_add_subtree (it, ett_docsis_uccreq);
       proto_tree_add_item (uccreq_tree, hf_docsis_uccreq_upchid, tvb, 0, 1,
                           FALSE);
 
-      /* call dissector for Appendix C TLV's */
-      next_tvb = tvb_new_subset (tvb, 1, tlv_data_len, tlv_data_len);
-      call_dissector (docsis_tlv_handle, next_tvb, pinfo, uccreq_tree);
     }
+    /* call dissector for Appendix C TLV's */
+    next_tvb = tvb_new_subset_remaining (tvb, 1);
+    call_dissector (docsis_tlv_handle, next_tvb, pinfo, uccreq_tree);
 
 
 }
@@ -90,7 +79,7 @@ dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 
 
 
-/* Register the protocol with Ethereal */
+/* Register the protocol with Wireshark */
 
 /* this format is require because a script is used to build the C function
    that calls all the protocol registration.
@@ -104,14 +93,14 @@ proto_register_docsis_uccreq (void)
 /* Setup list of header fields  See Section 1.6.1 for details*/
   static hf_register_info hf[] = {
     {&hf_docsis_uccreq,
-     {"Upstream Channel Change Request", "docsis.uccreq",
-      FT_BYTES, BASE_HEX, NULL, 0x0,
-      "Upstream Channel Change Request", HFILL}
+     {"Upstream Channel Change Request", "docsis_uccreq",
+      FT_BYTES, BASE_NONE, NULL, 0x0,
+      NULL, HFILL}
      },
     {&hf_docsis_uccreq_upchid,
-     {"Upstream Channel Id", "docsis.uccreq.upchid",
+     {"Upstream Channel Id", "docsis_uccreq.upchid",
       FT_UINT8, BASE_DEC, NULL, 0x0,
-      "Upstream Channel Id", HFILL}
+      NULL, HFILL}
      },
   };