aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-elcom.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-elcom.c')
-rw-r--r--epan/dissectors/packet-elcom.c112
1 files changed, 56 insertions, 56 deletions
diff --git a/epan/dissectors/packet-elcom.c b/epan/dissectors/packet-elcom.c
index 41c58d4eca..0ead6432dc 100644
--- a/epan/dissectors/packet-elcom.c
+++ b/epan/dissectors/packet-elcom.c
@@ -47,53 +47,55 @@
void proto_register_elcom(void);
void proto_reg_handoff_elcom(void);
-static int proto_elcom = -1;
-static int hf_elcom_response = -1;
-static int hf_elcom_request = -1;
-
-static int hf_elcom_length = -1;
-static int hf_elcom_type = -1;
-
-static int hf_elcom_initiator = -1;
-static int hf_elcom_initiator_endian = -1;
-static int hf_elcom_initiator_ip = -1;
-static int hf_elcom_initiator_port = -1;
-static int hf_elcom_initiator_suff = -1;
-
-static int hf_elcom_responder = -1;
-static int hf_elcom_responder_endian = -1;
-static int hf_elcom_responder_ip = -1;
-static int hf_elcom_responder_port = -1;
-static int hf_elcom_responder_suff = -1;
-
-static int hf_elcom_userdata = -1;
-static int hf_elcom_userdata_length = -1;
-static int hf_elcom_userdata_pduid = -1;
-static int hf_elcom_userdata_version = -1;
-static int hf_elcom_userdata_result = -1;
-static int hf_elcom_userdata_restmark = -1;
-static int hf_elcom_userdata_cf = -1;
-
-static int hf_elcom_datarequest = -1;
-static int hf_elcom_datarequest_grouptype = -1;
-static int hf_elcom_datarequest_result = -1;
-static int hf_elcom_datarequest_groupnumber = -1;
-static int hf_elcom_datarequest_grouppriority = -1;
-static int hf_elcom_datarequest_groupsize = -1;
-static int hf_elcom_datarequest_groupindex1 = -1;
-static int hf_elcom_datarequest_groupindex2 = -1;
-static int hf_elcom_datarequest_oid = -1;
-
-static int hf_elcom_release_reason = -1;
-static int hf_elcom_release_result = -1;
-
-static int hf_elcom_strangeleftover = -1;
-
-static gint ett_elcom = -1;
-static gint ett_elcom_initiator = -1;
-static gint ett_elcom_responder = -1;
-static gint ett_elcom_userdata = -1;
-static gint ett_elcom_datarequest = -1;
+static dissector_handle_t elcom_handle;
+
+static int proto_elcom;
+static int hf_elcom_response;
+static int hf_elcom_request;
+
+static int hf_elcom_length;
+static int hf_elcom_type;
+
+static int hf_elcom_initiator;
+static int hf_elcom_initiator_endian;
+static int hf_elcom_initiator_ip;
+static int hf_elcom_initiator_port;
+static int hf_elcom_initiator_suff;
+
+static int hf_elcom_responder;
+static int hf_elcom_responder_endian;
+static int hf_elcom_responder_ip;
+static int hf_elcom_responder_port;
+static int hf_elcom_responder_suff;
+
+static int hf_elcom_userdata;
+static int hf_elcom_userdata_length;
+static int hf_elcom_userdata_pduid;
+static int hf_elcom_userdata_version;
+static int hf_elcom_userdata_result;
+static int hf_elcom_userdata_restmark;
+static int hf_elcom_userdata_cf;
+
+static int hf_elcom_datarequest;
+static int hf_elcom_datarequest_grouptype;
+static int hf_elcom_datarequest_result;
+static int hf_elcom_datarequest_groupnumber;
+static int hf_elcom_datarequest_grouppriority;
+static int hf_elcom_datarequest_groupsize;
+static int hf_elcom_datarequest_groupindex1;
+static int hf_elcom_datarequest_groupindex2;
+static int hf_elcom_datarequest_oid;
+
+static int hf_elcom_release_reason;
+static int hf_elcom_release_result;
+
+static int hf_elcom_strangeleftover;
+
+static gint ett_elcom;
+static gint ett_elcom_initiator;
+static gint ett_elcom_responder;
+static gint ett_elcom_userdata;
+static gint ett_elcom_datarequest;
static gboolean elcom_show_hex = TRUE;
@@ -155,7 +157,7 @@ static const value_string type_vals[] = {
};
static gint
-dissect_lower_address(proto_item *ti_arg, gint ett_arg,
+dissect_lower_address(wmem_allocator_t *scope, proto_item *ti_arg, gint ett_arg,
tvbuff_t *tvb, gint arg_offset,
int hf_endian, int hf_ip, int hf_port, int hf_suff)
{
@@ -206,7 +208,7 @@ dissect_lower_address(proto_item *ti_arg, gint ett_arg,
offset += 8; /* skip the zero bytes */
/* SUFFIX */
- suffix = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+1, len2, ENC_ASCII);
+ suffix = tvb_get_string_enc(scope, tvb, offset+1, len2, ENC_ASCII);
/* hf_suff FIELDTYPE must be FT_UINT_STRING */
ti = proto_tree_add_item(tree, hf_suff, tvb, offset, 1, ENC_ASCII|ENC_BIG_ENDIAN);
offset += len2+1;
@@ -433,7 +435,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
if (tvb_get_guint8(tvb, 3+1+TOTAL_LEN+LOWADR_LEN) != SUFFIX_LEN) return 2;
/* finally believe that there is valid suffix */
- suffix = tvb_get_string_enc(wmem_packet_scope(), tvb, 3+2+LOWADR_LEN, 2, ENC_ASCII);
+ suffix = tvb_get_string_enc(pinfo->pool, tvb, 3+2+LOWADR_LEN, 2, ENC_ASCII);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s Connect", suffix);
break;
@@ -496,7 +498,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
/* We need the length here, hardcode the LOWADR_LEN = 21 */
ti = proto_tree_add_item(elcom_tree, hf_elcom_initiator, tvb, offset, TOTAL_LEN, ENC_NA);
- offset = dissect_lower_address(ti, ett_elcom_initiator, tvb, offset,
+ offset = dissect_lower_address(pinfo->pool, ti, ett_elcom_initiator, tvb, offset,
hf_elcom_initiator_endian,
hf_elcom_initiator_ip,
hf_elcom_initiator_port,
@@ -505,7 +507,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
return offset;
ti = proto_tree_add_item(elcom_tree, hf_elcom_responder, tvb, offset, TOTAL_LEN, ENC_NA);
- offset = dissect_lower_address(ti, ett_elcom_responder, tvb, offset,
+ offset = dissect_lower_address(pinfo->pool, ti, ett_elcom_responder, tvb, offset,
hf_elcom_responder_endian,
hf_elcom_responder_ip,
hf_elcom_responder_port,
@@ -712,7 +714,7 @@ proto_register_elcom(void)
},
{ &hf_elcom_datarequest_oid,
- { "Obkect Name", "elcom.datarequest.oid",
+ { "Object Name", "elcom.datarequest.oid",
FT_UINT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_elcom_strangeleftover,
@@ -741,14 +743,12 @@ proto_register_elcom(void)
proto_register_field_array(proto_elcom, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ elcom_handle = register_dissector("elcom", dissect_elcom, proto_elcom);
}
void
proto_reg_handoff_elcom(void)
{
- dissector_handle_t elcom_handle;
-
- elcom_handle = create_dissector_handle(dissect_elcom, proto_elcom);
dissector_add_uint_with_preference("tcp.port", TCP_PORT_ELCOM, elcom_handle);
}