aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-3com-njack.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-3com-njack.c')
-rw-r--r--epan/dissectors/packet-3com-njack.c61
1 files changed, 31 insertions, 30 deletions
diff --git a/epan/dissectors/packet-3com-njack.c b/epan/dissectors/packet-3com-njack.c
index 371b96999d..84b475a9c5 100644
--- a/epan/dissectors/packet-3com-njack.c
+++ b/epan/dissectors/packet-3com-njack.c
@@ -45,42 +45,44 @@ Specs:
void proto_register_njack(void);
void proto_reg_handoff_njack(void);
+static dissector_handle_t njack_handle;
+
/* protocol handles */
-static int proto_njack = -1;
+static int proto_njack;
/* ett handles */
-static int ett_njack = -1;
-static int ett_njack_tlv_header = -1;
+static int ett_njack;
+static int ett_njack_tlv_header;
/* hf elements */
-static int hf_njack_magic = -1;
-static int hf_njack_type = -1;
+static int hf_njack_magic;
+static int hf_njack_type;
/* type set/get response */
-static int hf_njack_tlv_length = -1;
-static int hf_njack_tlv_data = -1;
-static int hf_njack_tlv_version = -1;
-static int hf_njack_tlv_type = -1;
-static int hf_njack_tlv_typeip = -1;
-static int hf_njack_tlv_devicemac = -1;
-static int hf_njack_tlv_snmpwrite = -1;
-static int hf_njack_tlv_dhcpcontrol = -1;
-static int hf_njack_tlv_typestring = -1;
+static int hf_njack_tlv_length;
+static int hf_njack_tlv_data;
+static int hf_njack_tlv_version;
+static int hf_njack_tlv_type;
+static int hf_njack_tlv_typeip;
+static int hf_njack_tlv_devicemac;
+static int hf_njack_tlv_snmpwrite;
+static int hf_njack_tlv_dhcpcontrol;
+static int hf_njack_tlv_typestring;
/* 1st TAB */
-static int hf_njack_tlv_countermode = -1;
-static int hf_njack_tlv_scheduling = -1;
-static int hf_njack_tlv_addtagscheme = -1;
-static int hf_njack_tlv_portingressmode = -1;
-static int hf_njack_tlv_maxframesize = -1;
-static int hf_njack_tlv_powerforwarding = -1;
+static int hf_njack_tlv_countermode;
+static int hf_njack_tlv_scheduling;
+static int hf_njack_tlv_addtagscheme;
+static int hf_njack_tlv_portingressmode;
+static int hf_njack_tlv_maxframesize;
+static int hf_njack_tlv_powerforwarding;
/* type 07: set */
-static int hf_njack_set_length = -1;
-static int hf_njack_set_salt = -1;
-static int hf_njack_set_authdata = -1;
+static int hf_njack_set_length;
+static int hf_njack_set_salt;
+static int hf_njack_set_authdata;
/* type 08: set result */
-static int hf_njack_setresult = -1;
+static int hf_njack_setresult;
/* type 0b: get */
/* type 0c: get response */
-static int hf_njack_getresp_unknown1 = -1;
+static int hf_njack_getresp_unknown1;
#define PROTO_SHORT_NAME "NJACK"
#define PROTO_LONG_NAME "3com Network Jack"
@@ -471,7 +473,7 @@ dissect_tlvs(tvbuff_t *tvb, proto_tree *njack_tree, guint32 offset)
case NJACK_CMD_PRODUCTNAME:
case NJACK_CMD_SERIALNO:
proto_tree_add_item(tlv_tree, hf_njack_tlv_typestring,
- tvb, offset, tlv_length, ENC_ASCII|ENC_NA);
+ tvb, offset, tlv_length, ENC_ASCII);
offset += tlv_length;
break;
case NJACK_CMD_PORT1:
@@ -574,7 +576,7 @@ dissect_njack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
njack_tree = proto_item_add_subtree(ti, ett_njack);
proto_tree_add_item(njack_tree, hf_njack_magic, tvb, offset, 5,
- ENC_ASCII|ENC_NA);
+ ENC_ASCII);
offset += 5;
proto_tree_add_item(njack_tree, hf_njack_type, tvb, offset, 1,
@@ -771,14 +773,13 @@ proto_register_njack(void)
proto_njack = proto_register_protocol(PROTO_LONG_NAME, PROTO_SHORT_NAME, "njack");
proto_register_field_array(proto_njack, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ njack_handle = register_dissector("njack", dissect_njack_static, proto_njack);
}
void
proto_reg_handoff_njack(void)
{
- dissector_handle_t njack_handle;
-
- njack_handle = create_dissector_handle(dissect_njack_static, proto_njack);
dissector_add_uint_range_with_preference("udp.port", NJACK_PORT_RANGE, njack_handle);
/* dissector_add_uint_with_preference("tcp.port", PORT_NJACK_PC, njack_handle); */
/* dissector_add_uint_with_preference("tcp.port", PORT_NJACK_SWITCH, njack_handle); */