/* Define Error Codes for Version 2 */
-#define LANGUAGE_NOT_SUPPORTED 1
+#define LANGUAGE_NOT_SUPPORTED 1
#define PARSE_ERROR 2
#define INVALID_REGISTRATION 3
#define SCOPE_NOT_SUPPORTED 4
{
guint16 length;
nstime_t ts;
-
+
proto_tree_add_item(tree, hf_srvloc_authblkv2_bsd, tvb, offset, 2, FALSE);
proto_tree_add_item(tree, hf_srvloc_authblkv2_len, tvb, offset+2, 2, FALSE);
ts.nsecs = 0;
guint8 c_char, c_char1;
guint8 *byte_array;
+ /* XXX - Is this the correct behavior? */
+ if (length < 1)
+ return "";
+
if (endianness) {
byte_array = ep_alloc(length*2 + 1);
for (i = length; i > 0; i--) {
/*
* Format of x-x-x-xxxxxxxx. Each of these entries represents the service binding to UDP, TCP, or IPX.
- * The first digit is the protocol family: 2 for TCP/UPD, 6 for IPX.
- * The second digit is the socket type: 1 for socket stream (TCP), 2 for datagram (UDP and IPX).
- * The third is the protocol: 6 for TCP, 17 for UDP, and 1000 for IPX.
+ * The first digit is the protocol family: 2 for TCP/UPD, 6 for IPX.
+ * The second digit is the socket type: 1 for socket stream (TCP), 2 for datagram (UDP and IPX).
+ * The third is the protocol: 6 for TCP, 17 for UDP, and 1000 for IPX.
* Last is the IP address, in hex, of the interface that is registered (or, in the case of IPX, an IPX network number).
-*/
+*/
static void
attr_list(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int length,
guint16 encoding)
proto_tree_add_text(srvloc_tree, tvb, offset + 10, 2, "Transaction ID: %u",
tvb_get_ntohs(tvb, offset + 10));
/* added echo of XID to info colomn by Greg Morris 0ct 14, 2005 */
- if (check_col(pinfo->cinfo, COL_INFO))
+ if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, ", V1 Transaction ID - %u", tvb_get_ntohs(tvb, offset + 10));
offset += 12;
add_v1_string(srvloc_tree, hf_srvloc_srvreq_predicate, tvb, offset, length, encoding);
offset += length;
break;
-
+
case SRVRPLY:
expert_item = proto_tree_add_item(srvloc_tree, hf_srvloc_error, tvb, offset, 2, FALSE);
expert_status = tvb_get_ntohs(tvb, offset);
if (0xFFFF == length) {
proto_tree_add_uint(srvloc_tree, hf_srvloc_srvtypereq_nameauthlistlenall, tvb, offset, 2, length);
offset += 2;
- }
- else
+ }
+ else
{
proto_tree_add_uint(srvloc_tree, hf_srvloc_srvtypereq_nameauthlistlen, tvb, offset, 2, length);
offset += 2;
next_ext_off);
proto_tree_add_uint(srvloc_tree, hf_srvloc_xid, tvb, offset + 10, 2,
tvb_get_ntohs(tvb, offset + 10));
- if (check_col(pinfo->cinfo, COL_INFO))
+ if (check_col(pinfo->cinfo, COL_INFO))
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_srvreq_slpspi, tvb, offset, length, TRUE);
offset += length;
break;
-
+
case SRVRPLY: /* RFC2608 8.2 */
expert_item = proto_tree_add_item(srvloc_tree, hf_srvloc_error_v2, tvb, offset, 2, FALSE);
expert_status = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(srvloc_tree, hf_srvloc_srvdereg_taglist, tvb, offset, length, TRUE);
offset += length;
break;
-
+
case SRVACK: /* RFC2608 8.4 */
expert_item = proto_tree_add_item(srvloc_tree, hf_srvloc_error_v2, tvb, offset, 2, FALSE);
expert_status = tvb_get_ntohs(tvb, offset);
offset += 2;
attr_list(srvloc_tree, hf_srvloc_attrrply_attrlist, tvb, offset, length, CHARSET_UTF_8);
offset += length;
- count = tvb_get_guint8(tvb, offset);
+ count = tvb_get_guint8(tvb, offset);
proto_tree_add_uint(srvloc_tree, hf_srvloc_attrrply_attrauthcount, tvb, offset, 1, count);
offset += 1;
while (count > 0) {
}
}
break;
-
+
case DAADVERT: /* RCC 2608 8.5 */
expert_item = proto_tree_add_item(srvloc_tree, hf_srvloc_error_v2, tvb, offset, 2, FALSE);
expert_status = tvb_get_ntohs(tvb, offset);
offset += 2;
proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_slpspi, tvb, offset, length, TRUE);
offset += length;
- count = tvb_get_guint8(tvb, offset);
+ count = tvb_get_guint8(tvb, offset);
proto_tree_add_uint(srvloc_tree, hf_srvloc_daadvert_authcount, tvb, offset, 1, count);
offset += 1;
while (count > 0) {
if (check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
-
+
if (tree) {
ti = proto_tree_add_item(tree, proto_srvloc, tvb, 0, -1, FALSE);
srvloc_tree = proto_item_add_subtree(ti, ett_srvloc);
"", HFILL }
},
{&hf_srvloc_xid,
- {"XID", "srvloc.xid",
- FT_UINT24, BASE_DEC, NULL, 0x0,
+ {"XID", "srvloc.xid",
+ FT_UINT24, BASE_DEC, NULL, 0x0,
"Transaction ID", HFILL }
},
{&hf_srvloc_langtag,
- {"Lang Tag", "srvloc.langtag",
- FT_STRING, BASE_NONE, NULL, 0x0,
+ {"Lang Tag", "srvloc.langtag",
+ FT_STRING, BASE_NONE, NULL, 0x0,
"", HFILL }
},
{&hf_srvloc_langtaglen,
- {"Lang Tag Len", "srvloc.langtaglen",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ {"Lang Tag Len", "srvloc.langtaglen",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
"", HFILL }
},
{&hf_srvloc_nextextoff,
- {"Next Extension Offset", "srvloc.nextextoff",
- FT_UINT24, BASE_DEC, NULL, 0x0,
+ {"Next Extension Offset", "srvloc.nextextoff",
+ FT_UINT24, BASE_DEC, NULL, 0x0,
"", HFILL }
},
},
{&hf_srvloc_pktlen,
- {"Packet Length", "srvloc.pktlen",
- FT_UINT24, BASE_DEC, NULL, 0x0,
+ {"Packet Length", "srvloc.pktlen",
+ FT_UINT24, BASE_DEC, NULL, 0x0,
"", HFILL }
},
TFS(&tfs_srvloc_flags_fresh), FLAG_F, "Is this a new registration?", HFILL }},
{&hf_srvloc_flags_v2,
- {"Flags", "srvloc.flags_v2",
- FT_UINT16, BASE_HEX, NULL, 0x0,
+ {"Flags", "srvloc.flags_v2",
+ FT_UINT16, BASE_HEX, NULL, 0x0,
"", HFILL }
},