From Didier Gautheron:
[obnox/wireshark/wip.git] / plugins / docsis / packet-regrsp.c
index be5fc425442c1105340aa3565619590873961d9d..e647c798166149983c5e41f01be7d27d68e63c7f 100644 (file)
@@ -2,10 +2,10 @@
  * Routines for Registration Response Message dissection
  * Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
  *
- * $Id: packet-regrsp.c,v 1.7 2003/12/13 03:18:38 guy Exp $
+ * $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 "plugins/plugin_api.h"
-#include "plugins/plugin_api_defs.h"
-#include "moduleinfo.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gmodule.h>
-
 #include <epan/packet.h>
 
 /* Initialize the protocol and registered fields */
@@ -59,7 +49,7 @@ dissect_regrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 {
 
   proto_item *it;
-  proto_tree *regrsp_tree;
+  proto_tree *regrsp_tree = NULL;
   guint16 sid;
   guint8 response;
   tvbuff_t *next_tvb;
@@ -85,14 +75,14 @@ dissect_regrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
                           FALSE);
       proto_tree_add_item (regrsp_tree, hf_docsis_regrsp_response, tvb, 2, 1,
                           FALSE);
-      /* Call Dissector for Appendix C TLV's */
-      next_tvb = tvb_new_subset (tvb, 3, -1, -1);
-      call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrsp_tree);
     }
+    /* Call Dissector for Appendix C TLV's */
+    next_tvb = tvb_new_subset_remaining (tvb, 3);
+    call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrsp_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.
@@ -106,19 +96,19 @@ proto_register_docsis_regrsp (void)
 /* Setup list of header fields  See Section 1.6.1 for details*/
   static hf_register_info hf[] = {
     {&hf_docsis_regrsp,
-     {"Registration Response", "docsis.regrsp",
-      FT_BYTES, BASE_HEX, NULL, 0x0,
+     {"Registration Response", "docsis_regrsp",
+      FT_BYTES, BASE_NONE, NULL, 0x0,
       "Registration Request", HFILL}
      },
     {&hf_docsis_regrsp_sid,
-     {"Service Identifier", "docsis.regrsp.sid",
+     {"Service Identifier", "docsis_regrsp.sid",
       FT_UINT16, BASE_DEC, NULL, 0x0,
-      "Service Identifier", HFILL}
+      NULL, HFILL}
      },
     {&hf_docsis_regrsp_response,
-     {"Response Code", "docsis.regrsp.respnse",
+     {"Response Code", "docsis_regrsp.respnse",
       FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
-      "Response Code", HFILL}
+      NULL, HFILL}
      },
   };