From Didier Gautheron:
[obnox/wireshark/wip.git] / plugins / docsis / packet-dsaack.c
index a79fd302df4c470fa2ecd7071a77d3687bec09f1..098ee786abc2fe42ca1dce214b243264ad6efad9 100644 (file)
 # include "config.h"
 #endif
 
-#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 */
@@ -56,7 +48,7 @@ dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 {
 
   proto_item *it;
-  proto_tree *dsaack_tree;
+  proto_tree *dsaack_tree = NULL;
   guint16 transid;
   guint8 response;
   tvbuff_t *next_tvb;
@@ -82,11 +74,11 @@ dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
                           FALSE);
       proto_tree_add_item (dsaack_tree, hf_docsis_dsaack_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, dsaack_tree);
     }
+
+  /* Call Dissector for Appendix C TLV's */
+  next_tvb = tvb_new_subset_remaining (tvb, 3);
+  call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsaack_tree);
 }
 
 
@@ -106,19 +98,19 @@ proto_register_docsis_dsaack (void)
 /* Setup list of header fields  See Section 1.6.1 for details*/
   static hf_register_info hf[] = {
     {&hf_docsis_dsaack,
-     {"Dynamic Service Add Ack", "docsis.dsaack",
-      FT_BYTES, BASE_HEX, NULL, 0x0,
+     {"Dynamic Service Add Ack", "docsis_dsaack",
+      FT_BYTES, BASE_NONE, NULL, 0x0,
       "Dynamic Service Add Request", HFILL}
      },
     {&hf_docsis_dsaack_tranid,
-     {"Transaction Id", "docsis.dsaack.tranid",
+     {"Transaction Id", "docsis_dsaack.tranid",
       FT_UINT16, BASE_DEC, NULL, 0x0,
       "Service Identifier", HFILL}
      },
     {&hf_docsis_dsaack_response,
-     {"Confirmation Code", "docsis.dsaack.confcode",
+     {"Confirmation Code", "docsis_dsaack.confcode",
       FT_UINT8, BASE_DEC, VALS (docsis_conf_code), 0x0,
-      "Confirmation Code", HFILL}
+      NULL, HFILL}
      },
   };