From Didier Gautheron:
[obnox/wireshark/wip.git] / plugins / docsis / packet-uccreq.c
index 681dad7655f46bd6f5a64686e8d65cc3135d1501..ba5aa253841a00caef586900a825bb242cfc327b 100644 (file)
@@ -4,8 +4,8 @@
  *
  * $Id$
  *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * 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 */
@@ -55,7 +45,7 @@ dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 {
 
   proto_item *it;
-  proto_tree *uccreq_tree;
+  proto_tree *uccreq_tree = NULL;
   guint8 chid;
   tvbuff_t *next_tvb;
 
@@ -78,10 +68,10 @@ dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
       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, -1, -1);
-      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);
 
 
 }
@@ -89,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.
@@ -103,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}
      },
   };