As suggested by Kovarththanan Rajaratnam in https://bugs.wireshark.org/bugzilla/show_...
[obnox/wireshark/wip.git] / plugins / docsis / packet-bpkmrsp.c
index ee2ad21aad4f207da4db02e9a94fd8da39019781..c92e5f2bce846f1fa41983421fe7ae80e038a403 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 */
@@ -83,12 +75,8 @@ dissect_bpkmrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 
   code = tvb_get_guint8 (tvb, 0);
 
-  if (check_col (pinfo->cinfo, COL_INFO))
-    {
-      col_clear (pinfo->cinfo, COL_INFO);
-      col_add_fstr (pinfo->cinfo, COL_INFO, "BPKM Response (%s)",
-                   val_to_str (code, code_field_vals, "%s"));
-    }
+  col_add_fstr (pinfo->cinfo, COL_INFO, "BPKM Response (%s)",
+           val_to_str (code, code_field_vals, "Unknown code %u"));
 
   if (tree)
     {
@@ -105,17 +93,14 @@ dissect_bpkmrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
     }
 
   /* Code to Call subdissector */
-  attrs_tvb = tvb_new_subset (tvb, 4, -1, -1);
+  attrs_tvb = tvb_new_subset_remaining (tvb, 4);
   call_dissector (attrs_handle, attrs_tvb, pinfo, 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.
@@ -129,24 +114,24 @@ proto_register_docsis_bpkmrsp (void)
 /* Setup list of header fields  See Section 1.6.1 for details*/
   static hf_register_info hf[] = {
     {&hf_docsis_bpkmrsp,
-     {"BPKM Response Message", "docsis.bpkmrsp",
-      FT_BYTES, BASE_HEX, NULL, 0x0,
-      "BPKM Response Message", HFILL}
+     {"BPKM Response Message", "docsis_bpkmrsp",
+      FT_BYTES, BASE_NONE, NULL, 0x0,
+      NULL, HFILL}
      },
     {&hf_docsis_bpkmrsp_code,
-     {"BPKM Code", "docsis.bpkmrsp.code",
+     {"BPKM Code", "docsis_bpkmrsp.code",
       FT_UINT8, BASE_DEC, VALS (code_field_vals), 0x0,
       "BPKM Response Message", HFILL}
      },
     {&hf_docsis_bpkmrsp_ident,
-     {"BPKM Identifier", "docsis.bpkmrsp.ident",
+     {"BPKM Identifier", "docsis_bpkmrsp.ident",
       FT_UINT8, BASE_DEC, NULL, 0x0,
-      "BPKM Identifier", HFILL}
+      NULL, HFILL}
      },
     {&hf_docsis_bpkmrsp_length,
-     {"BPKM Length", "docsis.bpkmrsp.length",
+     {"BPKM Length", "docsis_bpkmrsp.length",
       FT_UINT16, BASE_DEC, NULL, 0x0,
-      "BPKM Length", HFILL}
+      NULL, HFILL}
      },
   };