diff options
Diffstat (limited to 'epan/dissectors/packet-srvloc.c')
-rw-r--r-- | epan/dissectors/packet-srvloc.c | 315 |
1 files changed, 157 insertions, 158 deletions
diff --git a/epan/dissectors/packet-srvloc.c b/epan/dissectors/packet-srvloc.c index e8887394c4..8e789c0ab2 100644 --- a/epan/dissectors/packet-srvloc.c +++ b/epan/dissectors/packet-srvloc.c @@ -22,7 +22,6 @@ #include "config.h" -#include <stdio.h> /* for sscanf() */ #include <stdlib.h> /* for strtoul() */ #include <epan/packet.h> @@ -33,132 +32,135 @@ void proto_register_srvloc(void); void proto_reg_handoff_srvloc(void); +static dissector_handle_t srvloc_handle; +static dissector_handle_t srvloc_tcp_handle; + static gboolean srvloc_desegment = TRUE; -static int proto_srvloc = -1; -static int hf_srvloc_version = -1; -static int hf_srvloc_function = -1; -static int hf_srvloc_pktlen = -1; -static int hf_srvloc_xid = -1; -static int hf_srvloc_langtaglen = -1; -static int hf_srvloc_langtag = -1; -static int hf_srvloc_nextextoff = -1; -static int hf_srvloc_flags_v1 = -1; -static int hf_srvloc_flags_v1_overflow = -1; -static int hf_srvloc_flags_v1_monolingual = -1; -static int hf_srvloc_flags_v1_url_auth = -1; -static int hf_srvloc_flags_v1_attribute_auth = -1; -static int hf_srvloc_flags_v1_fresh = -1; -static int hf_srvloc_error = -1; -static int hf_srvloc_flags_v2 = -1; -static int hf_srvloc_flags_v2_overflow = -1; -static int hf_srvloc_flags_v2_fresh = -1; -static int hf_srvloc_flags_v2_reqmulti = -1; -static int hf_srvloc_error_v2 = -1; -static int hf_srvloc_daadvert_timestamp = -1; -static int hf_srvloc_daadvert_urllen = -1; -static int hf_srvloc_daadvert_url = -1; -static int hf_srvloc_daadvert_scopelistlen = -1; -static int hf_srvloc_daadvert_scopelist = -1; -static int hf_srvloc_daadvert_attrlistlen = -1; -static int hf_srvloc_daadvert_attrlist = -1; -static int hf_srvloc_daadvert_slpspilen = -1; -static int hf_srvloc_daadvert_slpspi = -1; -static int hf_srvloc_daadvert_authcount = -1; -static int hf_srvloc_srvreq_prlistlen = -1; -static int hf_srvloc_srvreq_prlist = -1; -static int hf_srvloc_srvreq_srvtypelen = -1; -static int hf_srvloc_srvreq_srvtypelist = -1; -static int hf_srvloc_srvreq_scopelistlen = -1; -static int hf_srvloc_srvreq_scopelist = -1; -static int hf_srvloc_srvreq_predicatelen = -1; -static int hf_srvloc_srvreq_predicate = -1; -static int hf_srvloc_srvreq_slpspilen = -1; -static int hf_srvloc_srvreq_slpspi = -1; -static int hf_srvloc_srvrply_urlcount = -1; -static int hf_srvloc_srvreg_attrlistlen = -1; -static int hf_srvloc_srvreg_attrlist = -1; -static int hf_srvloc_srvreg_attrauthcount = -1; -static int hf_srvloc_srvreg_srvtypelen = -1; -static int hf_srvloc_srvreg_srvtype = -1; -static int hf_srvloc_srvreg_scopelistlen = -1; -static int hf_srvloc_srvreg_scopelist = -1; -static int hf_srvloc_srvdereg_scopelistlen = -1; -static int hf_srvloc_srvdereg_scopelist = -1; -static int hf_srvloc_srvdereg_taglistlen = -1; -static int hf_srvloc_srvdereg_taglist = -1; -static int hf_srvloc_attrreq_prlistlen = -1; -static int hf_srvloc_attrreq_prlist = -1; -static int hf_srvloc_attrreq_urllen = -1; -static int hf_srvloc_attrreq_url = -1; -static int hf_srvloc_attrreq_scopelistlen = -1; -static int hf_srvloc_attrreq_scopelist = -1; -static int hf_srvloc_attrreq_attrlistlen = -1; -static int hf_srvloc_attrreq_attrlist = -1; -static int hf_srvloc_attrreq_taglistlen = -1; -static int hf_srvloc_attrreq_taglist = -1; -static int hf_srvloc_attrreq_slpspilen = -1; -static int hf_srvloc_attrreq_slpspi = -1; -static int hf_srvloc_attrrply_attrlistlen = -1; -static int hf_srvloc_attrrply_attrlist = -1; -static int hf_srvloc_attrrply_attrauthcount = -1; -static int hf_srvloc_srvtypereq_prlistlen = -1; -static int hf_srvloc_srvtypereq_prlist = -1; -static int hf_srvloc_srvtypereq_nameauthlistlen = -1; -static int hf_srvloc_srvtypereq_nameauthlistlenall = -1; -static int hf_srvloc_srvtypereq_nameauthlist = -1; -static int hf_srvloc_srvtypereq_scopelistlen = -1; -static int hf_srvloc_srvtypereq_scopelist = -1; -static int hf_srvloc_srvtyperply_srvtypelen = -1; -static int hf_srvloc_srvtyperply_srvtype = -1; -static int hf_srvloc_srvtyperply_srvtypelistlen = -1; -static int hf_srvloc_srvtyperply_srvtypelist = -1; -static int hf_srvloc_saadvert_urllen = -1; -static int hf_srvloc_saadvert_url = -1; -static int hf_srvloc_saadvert_scopelistlen = -1; -static int hf_srvloc_saadvert_scopelist = -1; -static int hf_srvloc_saadvert_attrlistlen = -1; -static int hf_srvloc_saadvert_attrlist = -1; -static int hf_srvloc_saadvert_authcount = -1; -static int hf_srvloc_authblkv2_bsd = -1; -static int hf_srvloc_authblkv2_len = -1; -static int hf_srvloc_authblkv2_timestamp = -1; -static int hf_srvloc_authblkv2_slpspilen = -1; -static int hf_srvloc_authblkv2_slpspi = -1; -static int hf_srvloc_url_reserved = -1; -static int hf_srvloc_url_lifetime = -1; -static int hf_srvloc_url_urllen = -1; -static int hf_srvloc_url_url = -1; -static int hf_srvloc_url_numauths = -1; -static int hf_srvloc_add_ref_ip = -1; -static int hf_srvloc_srvrply_svcname = -1; +static int proto_srvloc; +static int hf_srvloc_version; +static int hf_srvloc_function; +static int hf_srvloc_pktlen; +static int hf_srvloc_xid; +static int hf_srvloc_langtaglen; +static int hf_srvloc_langtag; +static int hf_srvloc_nextextoff; +static int hf_srvloc_flags_v1; +static int hf_srvloc_flags_v1_overflow; +static int hf_srvloc_flags_v1_monolingual; +static int hf_srvloc_flags_v1_url_auth; +static int hf_srvloc_flags_v1_attribute_auth; +static int hf_srvloc_flags_v1_fresh; +static int hf_srvloc_error; +static int hf_srvloc_flags_v2; +static int hf_srvloc_flags_v2_overflow; +static int hf_srvloc_flags_v2_fresh; +static int hf_srvloc_flags_v2_reqmulti; +static int hf_srvloc_error_v2; +static int hf_srvloc_daadvert_timestamp; +static int hf_srvloc_daadvert_urllen; +static int hf_srvloc_daadvert_url; +static int hf_srvloc_daadvert_scopelistlen; +static int hf_srvloc_daadvert_scopelist; +static int hf_srvloc_daadvert_attrlistlen; +static int hf_srvloc_daadvert_attrlist; +static int hf_srvloc_daadvert_slpspilen; +static int hf_srvloc_daadvert_slpspi; +static int hf_srvloc_daadvert_authcount; +static int hf_srvloc_srvreq_prlistlen; +static int hf_srvloc_srvreq_prlist; +static int hf_srvloc_srvreq_srvtypelen; +static int hf_srvloc_srvreq_srvtypelist; +static int hf_srvloc_srvreq_scopelistlen; +static int hf_srvloc_srvreq_scopelist; +static int hf_srvloc_srvreq_predicatelen; +static int hf_srvloc_srvreq_predicate; +static int hf_srvloc_srvreq_slpspilen; +static int hf_srvloc_srvreq_slpspi; +static int hf_srvloc_srvrply_urlcount; +static int hf_srvloc_srvreg_attrlistlen; +static int hf_srvloc_srvreg_attrlist; +static int hf_srvloc_srvreg_attrauthcount; +static int hf_srvloc_srvreg_srvtypelen; +static int hf_srvloc_srvreg_srvtype; +static int hf_srvloc_srvreg_scopelistlen; +static int hf_srvloc_srvreg_scopelist; +static int hf_srvloc_srvdereg_scopelistlen; +static int hf_srvloc_srvdereg_scopelist; +static int hf_srvloc_srvdereg_taglistlen; +static int hf_srvloc_srvdereg_taglist; +static int hf_srvloc_attrreq_prlistlen; +static int hf_srvloc_attrreq_prlist; +static int hf_srvloc_attrreq_urllen; +static int hf_srvloc_attrreq_url; +static int hf_srvloc_attrreq_scopelistlen; +static int hf_srvloc_attrreq_scopelist; +static int hf_srvloc_attrreq_attrlistlen; +static int hf_srvloc_attrreq_attrlist; +static int hf_srvloc_attrreq_taglistlen; +static int hf_srvloc_attrreq_taglist; +static int hf_srvloc_attrreq_slpspilen; +static int hf_srvloc_attrreq_slpspi; +static int hf_srvloc_attrrply_attrlistlen; +static int hf_srvloc_attrrply_attrlist; +static int hf_srvloc_attrrply_attrauthcount; +static int hf_srvloc_srvtypereq_prlistlen; +static int hf_srvloc_srvtypereq_prlist; +static int hf_srvloc_srvtypereq_nameauthlistlen; +static int hf_srvloc_srvtypereq_nameauthlistlenall; +static int hf_srvloc_srvtypereq_nameauthlist; +static int hf_srvloc_srvtypereq_scopelistlen; +static int hf_srvloc_srvtypereq_scopelist; +static int hf_srvloc_srvtyperply_srvtypelen; +static int hf_srvloc_srvtyperply_srvtype; +static int hf_srvloc_srvtyperply_srvtypelistlen; +static int hf_srvloc_srvtyperply_srvtypelist; +static int hf_srvloc_saadvert_urllen; +static int hf_srvloc_saadvert_url; +static int hf_srvloc_saadvert_scopelistlen; +static int hf_srvloc_saadvert_scopelist; +static int hf_srvloc_saadvert_attrlistlen; +static int hf_srvloc_saadvert_attrlist; +static int hf_srvloc_saadvert_authcount; +static int hf_srvloc_authblkv2_bsd; +static int hf_srvloc_authblkv2_len; +static int hf_srvloc_authblkv2_timestamp; +static int hf_srvloc_authblkv2_slpspilen; +static int hf_srvloc_authblkv2_slpspi; +static int hf_srvloc_url_reserved; +static int hf_srvloc_url_lifetime; +static int hf_srvloc_url_urllen; +static int hf_srvloc_url_url; +static int hf_srvloc_url_numauths; +static int hf_srvloc_add_ref_ip; +static int hf_srvloc_srvrply_svcname; /* Generated from convert_proto_tree_add_text.pl */ -static int hf_srvloc_timestamp = -1; -static int hf_srvloc_authentication_block = -1; -static int hf_srvloc_transaction_id = -1; -static int hf_srvloc_block_structure_descriptor = -1; -static int hf_srvloc_communication_type = -1; -static int hf_srvloc_language = -1; -static int hf_srvloc_socket = -1; -static int hf_srvloc_encoding = -1; -static int hf_srvloc_node = -1; -static int hf_srvloc_item = -1; -static int hf_srvloc_service_type = -1; -static int hf_srvloc_network = -1; -static int hf_srvloc_service_type_count = -1; -static int hf_srvloc_dialect = -1; -static int hf_srvloc_authenticator_length = -1; -static int hf_srvloc_protocol = -1; -static int hf_srvloc_port = -1; - - -static gint ett_srvloc = -1; -static gint ett_srvloc_attr = -1; -static gint ett_srvloc_flags = -1; - -static expert_field ei_srvloc_error = EI_INIT; -static expert_field ei_srvloc_error_v2 = EI_INIT; -static expert_field ei_srvloc_function_unknown = EI_INIT; -static expert_field ei_srvloc_malformed = EI_INIT; +static int hf_srvloc_timestamp; +static int hf_srvloc_authentication_block; +static int hf_srvloc_transaction_id; +static int hf_srvloc_block_structure_descriptor; +static int hf_srvloc_communication_type; +static int hf_srvloc_language; +static int hf_srvloc_socket; +static int hf_srvloc_encoding; +static int hf_srvloc_node; +static int hf_srvloc_item; +static int hf_srvloc_service_type; +static int hf_srvloc_network; +static int hf_srvloc_service_type_count; +static int hf_srvloc_dialect; +static int hf_srvloc_authenticator_length; +static int hf_srvloc_protocol; +static int hf_srvloc_port; + + +static gint ett_srvloc; +static gint ett_srvloc_attr; +static gint ett_srvloc_flags; + +static expert_field ei_srvloc_error; +static expert_field ei_srvloc_error_v2; +static expert_field ei_srvloc_function_unknown; +static expert_field ei_srvloc_malformed; static const true_false_string tfs_srvloc_flags_overflow = { "Message will not fit in datagram", @@ -377,7 +379,7 @@ dissect_authblk_v2(tvbuff_t *tvb, int offset, proto_tree *tree) length = tvb_get_ntohs(tvb, offset + 8); proto_tree_add_uint(tree, hf_srvloc_authblkv2_slpspilen, tvb, offset + 8, 2, length); offset += 10; - proto_tree_add_item(tree, hf_srvloc_authblkv2_slpspi, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(tree, hf_srvloc_authblkv2_slpspi, tvb, offset, length, ENC_ASCII); offset += length; /* add code in here to handle Structured Authentication Block */ return offset; @@ -585,7 +587,6 @@ attr_list(proto_tree *tree, packet_info* pinfo, int hf, tvbuff_t *tvb, int offse { byte_value = unicode_to_bytes(tvb, foffset+2, 16, FALSE); /* IPX Network Address */ prot = (guint32)strtoul(byte_value, NULL, 16); - sscanf(byte_value,"%x",&prot); ti = proto_tree_add_uint(srvloc_tree, hf_srvloc_network, tvb, foffset+2, 4, prot); proto_item_set_len(ti, 16); byte_value = unicode_to_bytes(tvb, foffset+18, 24, FALSE); /* IPX Node Address */ @@ -765,7 +766,7 @@ dissect_url_entry_v2(tvbuff_t *tvb, int offset, proto_tree *tree) proto_tree_add_uint(tree, hf_srvloc_url_urllen, tvb, offset, 2, url_len); offset += 2; - proto_tree_add_item(tree, hf_srvloc_url_url, tvb, offset, url_len, ENC_ASCII|ENC_NA); + proto_tree_add_item(tree, hf_srvloc_url_url, tvb, offset, url_len, ENC_ASCII); offset += url_len; num_auths = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_srvloc_url_numauths, tvb, offset, 1, @@ -1043,7 +1044,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ col_append_fstr(pinfo->cinfo, COL_INFO, ", V2 XID - %u", tvb_get_ntohs(tvb, offset + 10)); lang_tag_len = tvb_get_ntohs(tvb, offset + 12); proto_tree_add_uint(srvloc_tree, hf_srvloc_langtaglen, tvb, offset + 12, 2, lang_tag_len); - proto_tree_add_item(srvloc_tree, hf_srvloc_langtag, tvb, offset + 14, lang_tag_len, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_langtag, tvb, offset + 14, lang_tag_len, ENC_ASCII); offset += 14+lang_tag_len; switch (function) { @@ -1053,35 +1054,35 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreq_prlistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_prlist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_prlist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreq_srvtypelen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_srvtypelist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_srvtypelist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreq_scopelistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_scopelist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_scopelist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreq_predicatelen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_predicate, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_predicate, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreq_slpspilen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_slpspi, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_slpspi, tvb, offset, length, ENC_ASCII); offset += length; } break; @@ -1108,14 +1109,14 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreg_srvtypelen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvreg_srvtype, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvreg_srvtype, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreg_scopelistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvreg_scopelist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvreg_scopelist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); @@ -1139,7 +1140,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_srvdereg_scopelistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvdereg_scopelist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvdereg_scopelist, tvb, offset, length, ENC_ASCII); offset += length; } offset = dissect_url_entry_v2(tvb, offset, srvloc_tree); @@ -1147,7 +1148,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_srvdereg_taglistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvdereg_taglist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvdereg_taglist, tvb, offset, length, ENC_ASCII); offset += length; } break; @@ -1166,35 +1167,35 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_attrreq_prlistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_prlist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_prlist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_attrreq_urllen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_url, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_url, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_attrreq_scopelistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_scopelist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_scopelist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_attrreq_taglistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_taglist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_taglist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_attrreq_slpspilen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_slpspi, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_slpspi, tvb, offset, length, ENC_ASCII); offset += length; } break; @@ -1236,28 +1237,28 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_daadvert_urllen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_url, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_url, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_daadvert_scopelistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_scopelist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_scopelist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_daadvert_attrlistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_attrlist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_attrlist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_daadvert_slpspilen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_slpspi, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_slpspi, tvb, offset, length, ENC_ASCII); offset += length; } count = tvb_get_guint8(tvb, offset); @@ -1274,7 +1275,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_srvtypereq_prlistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvtypereq_prlist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvtypereq_prlist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); @@ -1285,7 +1286,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_srvtypereq_nameauthlistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvtypereq_nameauthlist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvtypereq_nameauthlist, tvb, offset, length, ENC_ASCII); offset += length; } } @@ -1293,7 +1294,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_srvtypereq_scopelistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvtypereq_scopelist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvtypereq_scopelist, tvb, offset, length, ENC_ASCII); offset += length; } break; @@ -1309,7 +1310,7 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_srvtyperply_srvtypelistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_srvtyperply_srvtypelist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_srvtyperply_srvtypelist, tvb, offset, length, ENC_ASCII); offset += length; } break; @@ -1319,21 +1320,21 @@ dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ proto_tree_add_uint(srvloc_tree, hf_srvloc_saadvert_urllen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_saadvert_url, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_saadvert_url, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_saadvert_scopelistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_saadvert_scopelist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_saadvert_scopelist, tvb, offset, length, ENC_ASCII); offset += length; } length = tvb_get_ntohs(tvb, offset); proto_tree_add_uint(srvloc_tree, hf_srvloc_saadvert_attrlistlen, tvb, offset, 2, length); offset += 2; if (length) { - proto_tree_add_item(srvloc_tree, hf_srvloc_saadvert_attrlist, tvb, offset, length, ENC_ASCII|ENC_NA); + proto_tree_add_item(srvloc_tree, hf_srvloc_saadvert_attrlist, tvb, offset, length, ENC_ASCII); offset += length; } count = tvb_get_guint8(tvb, offset); @@ -1858,6 +1859,8 @@ proto_register_srvloc(void) "SRVLOC", "srvloc"); proto_register_field_array(proto_srvloc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + srvloc_handle = register_dissector("srvloc", dissect_srvloc, proto_srvloc); + srvloc_tcp_handle = register_dissector("srvloc.tcp", dissect_srvloc_tcp, proto_srvloc); expert_srvloc = expert_register_protocol(proto_srvloc); expert_register_field_array(expert_srvloc, ei, array_length(ei)); srvloc_module = prefs_register_protocol(proto_srvloc, NULL); @@ -1871,11 +1874,7 @@ proto_register_srvloc(void) void proto_reg_handoff_srvloc(void) { - dissector_handle_t srvloc_handle, srvloc_tcp_handle; - srvloc_handle = create_dissector_handle(dissect_srvloc, proto_srvloc); dissector_add_uint_with_preference("udp.port", UDP_PORT_SRVLOC, srvloc_handle); - srvloc_tcp_handle = create_dissector_handle(dissect_srvloc_tcp, - proto_srvloc); dissector_add_uint_with_preference("tcp.port", TCP_PORT_SRVLOC, srvloc_tcp_handle); } |