2 * Routines for SRVLOC (Service Location Protocol) packet dissection
3 * Copyright 1999, James Coe <jammer@cin.net>
4 * Copyright 2002, Brad Hards
6 * NOTE: This is Alpha software not all features have been verified yet.
7 * In particular I have not had an opportunity to see how it
8 * responds to SRVLOC over TCP.
10 * $Id: packet-srvloc.c,v 1.34 2002/10/02 08:57:32 sahlberg Exp $
12 * Ethereal - Network traffic analyzer
13 * By Gerald Combs <gerald@ethereal.com>
14 * Copyright 1998 Gerald Combs
16 * Service Location Protocol is RFC 2165
17 * Service Location Protocol Version 2 is RFC 2608
18 * - partial support by Brad Hards <bradh@frogmouth.net>
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version 2
23 * of the License, or (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
46 #include <epan/packet.h>
47 #include <epan/strutil.h>
49 static int proto_srvloc = -1;
50 static int hf_srvloc_version = -1;
51 static int hf_srvloc_function = -1;
52 static int hf_srvloc_pktlen = -1;
53 static int hf_srvloc_xid = -1;
54 static int hf_srvloc_langtaglen = -1;
55 static int hf_srvloc_langtag = -1;
56 static int hf_srvloc_nextextoff = -1;
57 static int hf_srvloc_flags = -1;
58 static int hf_srvloc_error = -1;
59 static int hf_srvloc_flags_v2 = -1;
60 static int hf_srvloc_flags_v2_overflow = -1;
61 static int hf_srvloc_flags_v2_fresh = -1;
62 static int hf_srvloc_flags_v2_reqmulti = -1;
63 static int hf_srvloc_error_v2 = -1;
64 static int hf_srvloc_daadvert_timestamp = -1;
65 static int hf_srvloc_daadvert_urllen = -1;
66 static int hf_srvloc_daadvert_url = -1;
67 static int hf_srvloc_daadvert_scopelistlen = -1;
68 static int hf_srvloc_daadvert_scopelist = -1;
69 static int hf_srvloc_daadvert_attrlistlen = -1;
70 static int hf_srvloc_daadvert_attrlist = -1;
71 static int hf_srvloc_daadvert_slpspilen = -1;
72 static int hf_srvloc_daadvert_slpspi = -1;
73 static int hf_srvloc_daadvert_authcount = -1;
74 static int hf_srvloc_srvreq_prlistlen = -1;
75 static int hf_srvloc_srvreq_prlist = -1;
76 static int hf_srvloc_srvreq_srvtypelen = -1;
77 static int hf_srvloc_srvreq_srvtypelist = -1;
78 static int hf_srvloc_srvreq_scopelistlen = -1;
79 static int hf_srvloc_srvreq_scopelist = -1;
80 static int hf_srvloc_srvreq_predicatelen = -1;
81 static int hf_srvloc_srvreq_predicate = -1;
82 static int hf_srvloc_srvreq_slpspilen = -1;
83 static int hf_srvloc_srvreq_slpspi = -1;
84 static int hf_srvloc_srvrply_urlcount = -1;
85 static int hf_srvloc_srvreg_attrlistlen = -1;
86 static int hf_srvloc_srvreg_attrlist = -1;
87 static int hf_srvloc_srvreg_attrauthcount = -1;
88 static int hf_srvloc_srvreg_srvtypelen = -1;
89 static int hf_srvloc_srvreg_srvtype = -1;
90 static int hf_srvloc_srvreg_scopelistlen = -1;
91 static int hf_srvloc_srvreg_scopelist = -1;
92 static int hf_srvloc_srvdereg_scopelistlen = -1;
93 static int hf_srvloc_srvdereg_scopelist = -1;
94 static int hf_srvloc_srvdereg_taglistlen = -1;
95 static int hf_srvloc_srvdereg_taglist = -1;
96 static int hf_srvloc_attrreq_prlistlen = -1;
97 static int hf_srvloc_attrreq_prlist = -1;
98 static int hf_srvloc_attrreq_urllen = -1;
99 static int hf_srvloc_attrreq_url = -1;
100 static int hf_srvloc_attrreq_scopelistlen = -1;
101 static int hf_srvloc_attrreq_scopelist = -1;
102 static int hf_srvloc_attrreq_taglistlen = -1;
103 static int hf_srvloc_attrreq_taglist = -1;
104 static int hf_srvloc_attrreq_slpspilen = -1;
105 static int hf_srvloc_attrreq_slpspi = -1;
106 static int hf_srvloc_attrrply_attrlistlen = -1;
107 static int hf_srvloc_attrrply_attrlist = -1;
108 static int hf_srvloc_attrrply_attrauthcount = -1;
109 static int hf_srvloc_srvtypereq_prlistlen = -1;
110 static int hf_srvloc_srvtypereq_prlist = -1;
111 static int hf_srvloc_srvtypereq_authlistlen = -1;
112 static int hf_srvloc_srvtypereq_authlist = -1;
113 static int hf_srvloc_srvtypereq_scopelistlen = -1;
114 static int hf_srvloc_srvtypereq_scopelist = -1;
115 static int hf_srvloc_srvtyperply_len = -1;
116 static int hf_srvloc_srvtyperply_type = -1;
117 static int hf_srvloc_saadvert_urllen = -1;
118 static int hf_srvloc_saadvert_url = -1;
119 static int hf_srvloc_saadvert_scopelistlen = -1;
120 static int hf_srvloc_saadvert_scopelist = -1;
121 static int hf_srvloc_saadvert_attrlistlen = -1;
122 static int hf_srvloc_saadvert_attrlist = -1;
123 static int hf_srvloc_saadvert_authcount = -1;
124 static int hf_srvloc_authblkv2_bsd = -1;
125 static int hf_srvloc_authblkv2_len = -1;
126 static int hf_srvloc_authblkv2_timestamp = -1;
127 static int hf_srvloc_authblkv2_slpspilen = -1;
128 static int hf_srvloc_authblkv2_slpspi = -1;
129 static int hf_srvloc_url_reserved = -1;
130 static int hf_srvloc_url_lifetime = -1;
131 static int hf_srvloc_url_urllen = -1;
132 static int hf_srvloc_url_url = -1;
133 static int hf_srvloc_url_numauths = -1;
136 static gint ett_srvloc = -1;
137 static gint ett_srvloc_flags = -1;
140 static const true_false_string tfs_srvloc_flags_v2_overflow = {
141 "Message will not fit in datagram",
142 "Message will fit in a datagram"
144 static const true_false_string tfs_srvloc_flags_v2_fresh = {
145 "New Service Registration",
146 "Not a new Service Registration"
148 static const true_false_string tfs_srvloc_flags_v2_reqmulti = {
149 "Multicast (or broadcast) request",
150 "Not multicast or broadcast"
154 #define TCP_PORT_SRVLOC 427
155 #define UDP_PORT_SRVLOC 427
157 /* Define function types */
167 #define SRVTYPERQST 9
168 #define SRVTYPERPLY 10
169 #define SAADVERT 11 /* SLPv2, section 8 */
171 /* Create protocol header structure */
173 /* bradh: looks like never used. */
174 /* bradh: comment it out for now since it doesn't work for v2
187 /* List to resolve function numbers to names */
189 static const value_string srvloc_functions[] = {
190 { SRVREQ, "Service Request" },
191 { SRVRPLY, "Service Reply" },
192 { SRVREG, "Service Registration" },
193 { SRVDEREG, "Service Deregister" },
194 { SRVACK, "Service Acknowledge" },
195 { ATTRRQST, "Attribute Request" },
196 { ATTRRPLY, "Attribute Reply" },
197 { DAADVERT, "DA Advertisement" },
198 { SRVTYPERQST, "Service Type Request" },
199 { SRVTYPERPLY, "Service Type Reply" },
200 { SAADVERT, "SA Advertisement" }, /* v2 only */
204 /* List to resolve flag values to names */
207 /* Define flag masks */
215 /* it all changes for Version 2 */
216 #define FLAG_O_V2 0x8000
217 #define FLAG_F_V2 0x4000
218 #define FLAG_R_V2 0x2000
220 /* Define Error Codes - Version 1*/
223 #define LANG_NOT_SPTD 1
224 #define PROT_PARSE_ERR 2
226 #define SCOPE_NOT_SPTD 4
227 #define CHRSET_NOT_UND 5
228 #define AUTH_ABSENT 6
229 #define AUTH_FAILED 7
231 /* List to resolve error codes to names */
233 static const value_string srvloc_errs[] = {
234 { SUCCESS, "No Error" },
235 { LANG_NOT_SPTD, "Language not supported" },
236 { PROT_PARSE_ERR, "Protocol parse error" },
237 { INVLD_REG, "Invalid registration" },
238 { SCOPE_NOT_SPTD, "Scope not supported" },
239 { CHRSET_NOT_UND, "Character set not understood" },
240 { AUTH_ABSENT, "Authentication absent" },
241 { AUTH_FAILED, "Authentication failed" },
245 /* Define Error Codes for Version 2 */
247 #define LANGUAGE_NOT_SUPPORTED 1
248 #define PARSE_ERROR 2
249 #define INVALID_REGISTRATION 3
250 #define SCOPE_NOT_SUPPORTED 4
251 #define AUTHENTICATION_UNKNOWN 5
252 #define AUTHENTICATION_ABSENT 6
253 #define AUTHENTICATION_FAILED 7
254 #define VER_NOT_SUPPORTED 9
255 #define INTERNAL_ERROR 10
256 #define DA_BUSY_NOW 11
257 #define OPTION_NOT_UNDERSTOOD 12
258 #define INVALID_UPDATE 13
259 #define MSG_NOT_SUPPORTED 14
260 #define REFRESH_REJECTED 15
262 static const value_string srvloc_errs_v2[] = {
263 { SUCCESS, "No Error" },
264 { LANGUAGE_NOT_SUPPORTED, "No data in the requested language" },
265 { PARSE_ERROR, "The message fails to obey SLP syntax." },
266 { INVALID_REGISTRATION, "The SrvReg has problems" },
267 { SCOPE_NOT_SUPPORTED, "Scope list not supported" },
268 { AUTHENTICATION_UNKNOWN, "Unsupported SLP SPI." },
269 { AUTHENTICATION_ABSENT, "URL and ATTR authentication not provided"},
270 { AUTHENTICATION_FAILED, "Authentication error"},
271 { VER_NOT_SUPPORTED, "Unsupported version number in message header" },
272 { INTERNAL_ERROR, "The DA (or SA) is too sick to respond" },
273 { DA_BUSY_NOW, "UA or SA SHOULD retry" },
274 { OPTION_NOT_UNDERSTOOD, "Unknown option from the mandatory range"},
275 { INVALID_UPDATE, "Invalid SrvReg" },
276 { MSG_NOT_SUPPORTED, "No support for AttrRqst or SrvTypeRqst" },
277 { REFRESH_REJECTED, "SrvReg sent too soon"},
282 * Character encodings.
283 * This is a small subset of what's in
285 * http://www.isi.edu/in-notes/iana/assignments/character-sets
287 * XXX - we should do something useful with this, i.e. properly
288 * handle strings based on the character set they're in.
290 * XXX - what does "properly handle strings" mean? How do we know
291 * what character set the terminal can handle (for tty-based code)
292 * or the GUI can handle (for GUI code)?
294 * XXX - the Ethereal core really should be what does all the
295 * character set handling for strings, and it should be stuck with
296 * the task of figuring out how to properly handle them.
298 #define CHARSET_ASCII 3
299 #define CHARSET_ISO_10646_UTF_1 27
300 #define CHARSET_ISO_646_BASIC 28
301 #define CHARSET_ISO_646_IRV 30
302 #define CHARSET_ISO_8859_1 4
303 #define CHARSET_ISO_10646_UCS_2 1000 /* a/k/a Unicode */
304 #define CHARSET_UTF_7 1012
305 #define CHARSET_UTF_8 106
307 static const value_string charsets[] = {
308 { CHARSET_ASCII, "US-ASCII" },
309 { CHARSET_ISO_10646_UTF_1, "ISO 10646 UTF-1" },
310 { CHARSET_ISO_646_BASIC, "ISO 646 basic:1983" },
311 { CHARSET_ISO_646_IRV, "ISO 646 IRV:1983" },
312 { CHARSET_ISO_8859_1, "ISO 8859-1" },
313 { CHARSET_ISO_10646_UCS_2, "Unicode" },
314 { CHARSET_UTF_7, "UTF-7" },
315 { CHARSET_UTF_8, "UTF-8" },
320 dissect_authblk(tvbuff_t *tvb, int offset, proto_tree *tree)
327 seconds = tvb_get_ntohl(tvb, offset) - 2208988800ul;
328 stamp = gmtime(&seconds);
330 floatsec = stamp->tm_sec + tvb_get_ntohl(tvb, offset + 4) / 4294967296.0;
331 proto_tree_add_text(tree, tvb, offset, 8,
332 "Timestamp: %04d-%02d-%02d %02d:%02d:%07.4f UTC",
333 stamp->tm_year + 1900, stamp->tm_mon + 1,
334 stamp->tm_mday, stamp->tm_hour, stamp->tm_min,
337 proto_tree_add_text(tree, tvb, offset, 8, "Timestamp not representable");
339 proto_tree_add_text(tree, tvb, offset + 8, 2, "Block Structure Desciptor: %u",
340 tvb_get_ntohs(tvb, offset + 8));
341 length = tvb_get_ntohs(tvb, offset + 10);
342 proto_tree_add_text(tree, tvb, offset + 10, 2, "Authenticator length: %u",
345 proto_tree_add_text(tree, tvb, offset, length, "Authentication block: %s",
346 tvb_format_text(tvb, offset, length));
351 /* SLPv2 version - Needs to be fixed to match RFC2608 sect 9.2*/
353 dissect_authblk_v2(tvbuff_t *tvb, int offset, proto_tree *tree)
357 proto_tree_add_item(tree, hf_srvloc_authblkv2_bsd, tvb, offset, 2, FALSE);
358 proto_tree_add_item(tree, hf_srvloc_authblkv2_len, tvb, offset+2, 2, FALSE);
359 proto_tree_add_item(tree, hf_srvloc_authblkv2_timestamp, tvb, offset+4, 4, FALSE);
360 length = tvb_get_ntohs(tvb, offset + 8);
361 proto_tree_add_uint(tree, hf_srvloc_authblkv2_slpspilen, tvb, offset + 8, 2, length);
363 proto_tree_add_item(tree, hf_srvloc_authblkv2_slpspi, tvb, offset, length, TRUE);
365 /* add code in here to handle Structured Authentication Block */
370 dissect_attrauthblk_v2(tvbuff_t *tvb, int offset, proto_tree *tree)
372 tvb=tvb; tree=tree; /* silence gcc for now */
373 /* add code in here to handle attribute authentication */
378 dissect_url_entry(tvbuff_t *tvb, int offset, proto_tree *tree)
385 reserved = tvb_get_guint8(tvb, offset);
386 proto_tree_add_uint(tree, hf_srvloc_url_reserved, tvb, offset, 1,
389 lifetime = tvb_get_ntohs(tvb, offset);
390 proto_tree_add_uint(tree, hf_srvloc_url_lifetime, tvb, offset, 2,
393 url_len = tvb_get_ntohs(tvb, offset);
394 proto_tree_add_uint(tree, hf_srvloc_url_urllen, tvb, offset, 2,
397 proto_tree_add_item(tree, hf_srvloc_url_url, tvb, offset, url_len, TRUE);
399 num_auths = tvb_get_guint8(tvb, offset);
400 proto_tree_add_uint(tree, hf_srvloc_url_numauths, tvb, offset, 1,
403 while (num_auths > 0) {
404 offset = dissect_authblk_v2(tvb, offset, tree);
410 /* Packet dissection routine called by tcp & udp when port 427 detected */
413 dissect_srvloc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
417 proto_tree *srvloc_tree, *srvloc_flags;
421 guint32 length; /* three bytes needed for v2 */
422 guint16 flags; /* two byes needed for v2 */
424 guint32 next_ext_off; /* three bytes, v2 only */
425 guint16 lang_tag_len;
428 if (check_col(pinfo->cinfo, COL_PROTOCOL))
429 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SRVLOC");
431 if (check_col(pinfo->cinfo, COL_INFO))
432 col_clear(pinfo->cinfo, COL_INFO);
434 version = tvb_get_guint8(tvb, offset);
435 function = tvb_get_guint8(tvb, offset + 1);
437 if (check_col(pinfo->cinfo, COL_INFO))
438 col_add_str(pinfo->cinfo, COL_INFO,
439 val_to_str(function, srvloc_functions, "Unknown Function (%u)"));
442 ti = proto_tree_add_item(tree, proto_srvloc, tvb, offset, -1, FALSE);
443 srvloc_tree = proto_item_add_subtree(ti, ett_srvloc);
445 proto_tree_add_uint(srvloc_tree, hf_srvloc_version, tvb, offset, 1,
447 proto_tree_add_uint(srvloc_tree, hf_srvloc_function, tvb, offset + 1, 1,
450 length = tvb_get_ntohs(tvb, offset + 2);
451 proto_tree_add_text(srvloc_tree, tvb, offset + 2, 2, "Length: %u",
453 flags = tvb_get_guint8(tvb, offset + 4);
454 tf = proto_tree_add_uint(srvloc_tree, hf_srvloc_flags, tvb, offset + 4, 1,
456 srvloc_flags = proto_item_add_subtree(tf, ett_srvloc_flags);
457 proto_tree_add_text(srvloc_flags, tvb, offset + 4, 0, "Overflow %d... .xxx", (flags & FLAG_O) >> 7 );
458 proto_tree_add_text(srvloc_flags, tvb, offset + 4, 0, "Monolingual .%d.. .xxx", (flags & FLAG_M) >> 6 );
459 proto_tree_add_text(srvloc_flags, tvb, offset + 4, 0, "URL Authentication Present ..%d. .xxx", (flags & FLAG_U) >> 5 );
460 proto_tree_add_text(srvloc_flags, tvb, offset + 4, 0, "Attribute Authentication Present ...%d .xxx", (flags & FLAG_A) >> 4 );
461 proto_tree_add_text(srvloc_flags, tvb, offset + 4, 0, "Fresh Service Entry .... %dxxx", (flags & FLAG_F) >> 3 );
462 proto_tree_add_text(srvloc_tree, tvb, offset + 5, 1, "Dialect: %u",
463 tvb_get_guint8(tvb, offset + 5));
464 proto_tree_add_text(srvloc_tree, tvb, offset + 6, 2, "Language: %s",
465 tvb_format_text(tvb, offset + 6, 2));
466 encoding = tvb_get_ntohs(tvb, offset + 8);
467 proto_tree_add_text(srvloc_tree, tvb, offset + 8, 2, "Encoding: %u (%s)",
469 val_to_str(encoding, charsets, "Unknown"));
470 proto_tree_add_text(srvloc_tree, tvb, offset + 10, 2, "Transaction ID: %u",
471 tvb_get_ntohs(tvb, offset + 10));
476 proto_tree_add_text(srvloc_tree, tvb, offset, 0, "Service Request");
477 length = tvb_get_ntohs(tvb, offset);
478 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Previous Response List Length: %u",
481 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Previous Response List: %s",
482 tvb_format_text(tvb, offset, length));
484 length = tvb_get_ntohs(tvb, offset);
485 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Predicate length: %u",
488 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Predicate: %s",
489 tvb_format_text(tvb, offset, length));
494 proto_tree_add_text(srvloc_tree, tvb, offset, 0, "Service Reply");
495 proto_tree_add_item(srvloc_tree, hf_srvloc_error, tvb, offset, 2, FALSE);
497 count = tvb_get_ntohs(tvb, offset);
498 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "URL Count: %u",
502 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "URL lifetime: %u",
503 tvb_get_ntohs(tvb, offset));
505 length = tvb_get_ntohs(tvb, offset);
506 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "URL length: %u",
509 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Service URL: %s",
510 tvb_format_text(tvb, offset, length));
512 if ( (flags & FLAG_U) == FLAG_U )
513 offset = dissect_authblk(tvb, offset, srvloc_tree);
519 proto_tree_add_text(srvloc_tree, tvb, offset, 0, "Service Registration");
520 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "URL lifetime: %u",
521 tvb_get_ntohs(tvb, offset));
523 length = tvb_get_ntohs(tvb, offset);
524 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "URL length: %u",
527 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Service URL: %s",
528 tvb_format_text(tvb, offset, length));
530 if ( (flags & FLAG_U) == FLAG_U )
531 offset = dissect_authblk(tvb, offset, srvloc_tree);
532 length = tvb_get_ntohs(tvb, offset);
533 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Attribute List length: %u",
536 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Attribute List: %s",
537 tvb_format_text(tvb, offset, length));
539 if ( (flags & FLAG_A) == FLAG_A )
540 offset = dissect_authblk(tvb, offset, srvloc_tree);
544 proto_tree_add_text(srvloc_tree, tvb, offset, 0, "Service Deregister");
545 length = tvb_get_ntohs(tvb, offset);
546 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "URL length: %u",
549 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Service URL: %s",
550 tvb_format_text(tvb, offset, length));
552 if ( (flags & FLAG_U) == FLAG_U )
553 offset = dissect_authblk(tvb, offset, srvloc_tree);
554 length = tvb_get_ntohs(tvb, offset);
555 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Attribute List length: %u",
558 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Attribute List: %s",
559 tvb_format_text(tvb, offset, length));
561 if ( (flags & FLAG_A) == FLAG_A )
562 offset = dissect_authblk(tvb, offset, srvloc_tree);
566 proto_tree_add_text(srvloc_tree, tvb, offset, 0, "Service Acknowledge");
567 proto_tree_add_item(srvloc_tree, hf_srvloc_error, tvb, offset, 2, FALSE);
572 proto_tree_add_text(srvloc_tree, tvb, offset, 0, "Attribute Request");
573 length = tvb_get_ntohs(tvb, offset);
574 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Previous Response List Length: %u",
577 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Previous Response List: %s",
578 tvb_format_text(tvb, offset, length));
580 length = tvb_get_ntohs(tvb, offset);
581 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "URL length: %u",
584 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Service URL: %s",
585 tvb_format_text(tvb, offset, length));
587 length = tvb_get_ntohs(tvb, offset);
588 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Scope List Length: %u",
591 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Scope Response List: %s",
592 tvb_format_text(tvb, offset, length));
594 length = tvb_get_ntohs(tvb, offset);
595 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Attribute List length: %u",
598 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Attribute List: %s",
599 tvb_format_text(tvb, offset, length));
604 proto_tree_add_text(srvloc_tree, tvb, offset, 0, "Attribute Reply");
605 proto_tree_add_item(srvloc_tree, hf_srvloc_error_v2, tvb, offset, 2, FALSE);
607 length = tvb_get_ntohs(tvb, offset);
608 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Attribute List length: %u",
611 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Attribute List: %s",
612 tvb_format_text(tvb, offset, length));
614 if ( (flags & FLAG_A) == FLAG_A )
615 offset = dissect_authblk(tvb, offset, srvloc_tree);
619 proto_tree_add_text(srvloc_tree, tvb, offset, 0, "DA Advertisement");
620 proto_tree_add_item(srvloc_tree, hf_srvloc_error, tvb, offset, 2, FALSE);
622 length = tvb_get_ntohs(tvb, offset);
623 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "URL length: %u",
626 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Service URL: %s",
627 tvb_format_text(tvb, offset, length));
629 length = tvb_get_ntohs(tvb, offset);
630 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Scope List Length: %u",
633 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Scope Response List: %s",
634 tvb_format_text(tvb, offset, length));
639 proto_tree_add_text(srvloc_tree, tvb, offset, 0, "Service Type Request");
640 length = tvb_get_ntohs(tvb, offset);
641 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Previous Response List Length: %u",
644 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Previous Response List: %s",
645 tvb_format_text(tvb, offset, length));
647 length = tvb_get_ntohs(tvb, offset);
648 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Naming Authority List length: %u",
651 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Naming Authority List: %s",
652 tvb_format_text(tvb, offset, length));
654 length = tvb_get_ntohs(tvb, offset);
655 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Scope List Length: %u",
658 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Scope Response List: %s",
659 tvb_format_text(tvb, offset, length));
664 proto_tree_add_text(srvloc_tree, tvb, offset, 0, "Service Type Reply");
665 proto_tree_add_item(srvloc_tree, hf_srvloc_error, tvb, offset, 2, FALSE);
667 count = tvb_get_ntohs(tvb, offset);
668 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Service Type Count: %u",
672 length = tvb_get_ntohs(tvb, offset);
673 proto_tree_add_text(srvloc_tree, tvb, offset, 2, "Service Type List length: %u",
676 proto_tree_add_text(srvloc_tree, tvb, offset, length, "Service Type List: %s",
677 tvb_format_text(tvb, offset, length));
684 proto_tree_add_text(srvloc_tree, tvb, offset, -1, "Unknown Function Type");
687 else { /* Version 2 */
688 length = tvb_get_ntoh24(tvb, offset + 2);
689 proto_tree_add_uint(srvloc_tree, hf_srvloc_pktlen, tvb, offset + 2, 3,
691 flags = tvb_get_ntohs(tvb, offset + 5);
692 tf = proto_tree_add_uint(srvloc_tree, hf_srvloc_flags_v2, tvb, offset + 5, 2,
694 srvloc_flags = proto_item_add_subtree(tf, ett_srvloc_flags);
695 proto_tree_add_boolean(srvloc_flags, hf_srvloc_flags_v2_overflow,
696 tvb, offset+5, 1, flags);
697 proto_tree_add_boolean(srvloc_flags, hf_srvloc_flags_v2_fresh,
698 tvb, offset+5, 1, flags);
699 proto_tree_add_boolean(srvloc_flags, hf_srvloc_flags_v2_reqmulti,
700 tvb, offset+5, 1, flags);
702 next_ext_off = tvb_get_ntoh24(tvb, offset + 7);
703 proto_tree_add_uint(srvloc_tree, hf_srvloc_nextextoff, tvb, offset + 7, 3,
705 proto_tree_add_uint(srvloc_tree, hf_srvloc_xid, tvb, offset + 10, 3,
706 tvb_get_ntohs(tvb, offset + 10));
707 lang_tag_len = tvb_get_ntohs(tvb, offset + 12);
708 proto_tree_add_uint(srvloc_tree, hf_srvloc_langtaglen, tvb, offset + 12, 2, lang_tag_len);
709 proto_tree_add_item(srvloc_tree, hf_srvloc_langtag, tvb, offset + 14, lang_tag_len, TRUE);
710 offset += 14+lang_tag_len;
713 case SRVREQ: /* RFC2608 8.1 */
714 length = tvb_get_ntohs(tvb, offset);
715 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreq_prlistlen, tvb, offset, 2, length);
717 proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_prlist, tvb, offset, length, TRUE);
719 length = tvb_get_ntohs(tvb, offset);
720 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreq_srvtypelen, tvb, offset, 2, length);
722 proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_srvtypelist, tvb, offset, length, TRUE);
724 length = tvb_get_ntohs(tvb, offset);
725 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreq_scopelistlen, tvb, offset, 2, length);
727 proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_scopelist, tvb, offset, length, TRUE);
729 length = tvb_get_ntohs(tvb, offset);
730 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreq_predicatelen, tvb, offset, 2, length);
732 proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_predicate, tvb, offset, length, TRUE);
734 length = tvb_get_ntohs(tvb, offset);
735 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreq_slpspilen, tvb, offset, 2, length);
737 proto_tree_add_item(srvloc_tree, hf_srvloc_srvreq_slpspi, tvb, offset, length, TRUE);
741 case SRVRPLY: /* RFC2608 8.2 */
742 proto_tree_add_item(srvloc_tree, hf_srvloc_error_v2, tvb, offset, 2, FALSE);
744 count = tvb_get_ntohs(tvb, offset);
745 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvrply_urlcount, tvb, offset, 2, count);
748 offset = dissect_url_entry(tvb, offset, srvloc_tree);
753 case SRVREG: /* RFC2608 8.3 */
754 offset = dissect_url_entry(tvb, offset, srvloc_tree);
755 length = tvb_get_ntohs(tvb, offset);
756 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreg_srvtypelen, tvb, offset, 2, length);
758 proto_tree_add_item(srvloc_tree, hf_srvloc_srvreg_srvtype, tvb, offset, length, TRUE);
760 length = tvb_get_ntohs(tvb, offset);
761 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreg_scopelistlen, tvb, offset, 2, length);
763 proto_tree_add_item(srvloc_tree, hf_srvloc_srvreg_scopelist, tvb, offset, length, TRUE);
765 length = tvb_get_ntohs(tvb, offset);
766 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreg_attrlistlen, tvb, offset, 2, length);
768 proto_tree_add_item(srvloc_tree, hf_srvloc_srvreg_attrlist, tvb, offset, length, TRUE);
770 count = tvb_get_guint8(tvb, offset);
771 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvreg_attrauthcount, tvb, offset, 1, count);
774 offset = dissect_attrauthblk_v2(tvb, offset, srvloc_tree);
779 case SRVDEREG: /* RFC2608 10.6 */
780 length = tvb_get_ntohs(tvb, offset);
781 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvdereg_scopelistlen, tvb, offset, 2, length);
783 proto_tree_add_item(srvloc_tree, hf_srvloc_srvdereg_scopelist, tvb, offset, length, TRUE);
785 offset = dissect_url_entry(tvb, offset, srvloc_tree);
786 length = tvb_get_ntohs(tvb, offset);
787 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvdereg_taglistlen, tvb, offset, 2, length);
789 proto_tree_add_item(srvloc_tree, hf_srvloc_srvdereg_taglist, tvb, offset, length, TRUE);
793 case SRVACK: /* RFC2608 8.4 */
794 proto_tree_add_item(srvloc_tree, hf_srvloc_error_v2, tvb, offset, 2, FALSE);
798 case ATTRRQST: /* RFC2608 10.3*/
799 length = tvb_get_ntohs(tvb, offset);
800 proto_tree_add_uint(srvloc_tree, hf_srvloc_attrreq_prlistlen, tvb, offset, 2, length);
802 proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_prlist, tvb, offset, length, TRUE);
804 length = tvb_get_ntohs(tvb, offset);
805 proto_tree_add_uint(srvloc_tree, hf_srvloc_attrreq_urllen, tvb, offset, 2, length);
807 proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_url, tvb, offset, length, TRUE);
809 length = tvb_get_ntohs(tvb, offset);
810 proto_tree_add_uint(srvloc_tree, hf_srvloc_attrreq_scopelistlen, tvb, offset, 2, length);
812 proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_scopelist, tvb, offset, length, TRUE);
814 length = tvb_get_ntohs(tvb, offset);
815 proto_tree_add_uint(srvloc_tree, hf_srvloc_attrreq_taglistlen, tvb, offset, 2, length);
817 proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_taglist, tvb, offset, length, TRUE);
819 length = tvb_get_ntohs(tvb, offset);
820 proto_tree_add_uint(srvloc_tree, hf_srvloc_attrreq_slpspilen, tvb, offset, 2, length);
822 proto_tree_add_item(srvloc_tree, hf_srvloc_attrreq_slpspi, tvb, offset, length, TRUE);
826 case ATTRRPLY: /* RFC2608 10.4 */
827 proto_tree_add_item(srvloc_tree, hf_srvloc_error_v2, tvb, offset, 2, FALSE);
829 length = tvb_get_ntohs(tvb, offset);
830 proto_tree_add_uint(srvloc_tree, hf_srvloc_attrrply_attrlistlen, tvb, offset, 2, length);
832 proto_tree_add_item(srvloc_tree, hf_srvloc_attrrply_attrlist, tvb, offset, length, TRUE);
834 count = tvb_get_guint8(tvb, offset);
835 proto_tree_add_uint(srvloc_tree, hf_srvloc_attrrply_attrauthcount, tvb, offset, 1, count);
838 offset = dissect_attrauthblk_v2(tvb, offset, srvloc_tree);
843 case DAADVERT: /* RCC 2608 8.5 */
844 proto_tree_add_item(srvloc_tree, hf_srvloc_error_v2, tvb, offset, 2, FALSE);
847 ts.secs = tvb_get_ntohl(tvb, offset);
848 proto_tree_add_time(srvloc_tree, hf_srvloc_daadvert_timestamp, tvb, offset, 4,
851 length = tvb_get_ntohs(tvb, offset);
852 proto_tree_add_uint(srvloc_tree, hf_srvloc_daadvert_urllen, tvb, offset, 2, length);
854 proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_url, tvb, offset, length, TRUE);
856 length = tvb_get_ntohs(tvb, offset);
857 proto_tree_add_uint(srvloc_tree, hf_srvloc_daadvert_scopelistlen, tvb, offset, 2, length);
859 proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_scopelist, tvb, offset, length, TRUE);
861 length = tvb_get_ntohs(tvb, offset);
862 proto_tree_add_uint(srvloc_tree, hf_srvloc_daadvert_attrlistlen, tvb, offset, 2, length);
864 proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_attrlist, tvb, offset, length, TRUE);
866 length = tvb_get_ntohs(tvb, offset);
867 proto_tree_add_uint(srvloc_tree, hf_srvloc_daadvert_slpspilen, tvb, offset, 2, length);
869 proto_tree_add_item(srvloc_tree, hf_srvloc_daadvert_slpspi, tvb, offset, length, TRUE);
871 count = tvb_get_guint8(tvb, offset);
872 proto_tree_add_uint(srvloc_tree, hf_srvloc_daadvert_authcount, tvb, offset, 1, count);
875 offset = dissect_authblk_v2(tvb, offset, srvloc_tree);
880 case SRVTYPERQST: /* RFC2608 10.1 */
881 length = tvb_get_ntohs(tvb, offset);
882 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvtypereq_prlistlen, tvb, offset, 2, length);
884 proto_tree_add_item(srvloc_tree, hf_srvloc_srvtypereq_prlist, tvb, offset, length, TRUE);
886 length = tvb_get_ntohs(tvb, offset);
887 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvtypereq_authlistlen, tvb, offset, 2, length);
889 proto_tree_add_item(srvloc_tree, hf_srvloc_srvtypereq_authlist, tvb, offset, length, TRUE);
891 length = tvb_get_ntohs(tvb, offset);
892 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvtypereq_scopelistlen, tvb, offset, 2, length);
894 proto_tree_add_item(srvloc_tree, hf_srvloc_srvtypereq_scopelist, tvb, offset, length, TRUE);
898 case SRVTYPERPLY: /* rfc2608 10.2 */
899 proto_tree_add_item(srvloc_tree, hf_srvloc_error_v2, tvb, offset, 2, FALSE);
901 length = tvb_get_ntohs(tvb, offset);
902 proto_tree_add_uint(srvloc_tree, hf_srvloc_srvtyperply_len, tvb, offset, 2, length);
904 proto_tree_add_item(srvloc_tree, hf_srvloc_srvtyperply_type, tvb, offset, length, TRUE);
907 case SAADVERT: /* rfc2608 10.2 */
908 length = tvb_get_ntohs(tvb, offset);
909 proto_tree_add_uint(srvloc_tree, hf_srvloc_saadvert_urllen, tvb, offset, 2,
912 proto_tree_add_item(srvloc_tree, hf_srvloc_saadvert_url, tvb, offset, length, TRUE);
914 proto_tree_add_uint(srvloc_tree, hf_srvloc_saadvert_scopelistlen, tvb, offset, 2, length);
916 proto_tree_add_item(srvloc_tree, hf_srvloc_saadvert_scopelist, tvb, offset, length, TRUE);
918 length = tvb_get_ntohs(tvb, offset);
919 proto_tree_add_uint(srvloc_tree, hf_srvloc_saadvert_attrlistlen, tvb, offset, 2, length);
921 proto_tree_add_item(srvloc_tree, hf_srvloc_saadvert_attrlist, tvb, offset, length, TRUE);
923 count = tvb_get_guint8(tvb, offset);
924 proto_tree_add_uint(srvloc_tree, hf_srvloc_saadvert_authcount, tvb, offset, 1, length);
927 offset = dissect_authblk_v2(tvb, offset, srvloc_tree);
933 proto_tree_add_text(srvloc_tree, tvb, offset, -1, "Unknown Function Type");
939 /* Register protocol with Ethereal. */
942 proto_register_srvloc(void)
944 static hf_register_info hf[] = {
945 /* Helper functions for the Version 1 Header*/
947 {"Error Code", "srvloc.err",
948 FT_UINT16, BASE_DEC, VALS(srvloc_errs), 0x0,
952 /* Helper function for the Version 2 Header */
953 {&hf_srvloc_error_v2,
954 {"Error Code", "srvloc.errv2",
955 FT_UINT16, BASE_DEC, VALS(srvloc_errs_v2), 0x0,
959 {"XID", "srvloc.xid",
960 FT_UINT24, BASE_DEC, NULL, 0x0,
961 "Transaction ID", HFILL }
964 {"Lang Tag", "srvloc.langtag",
965 FT_STRING, BASE_DEC, NULL, 0x0,
968 {&hf_srvloc_langtaglen,
969 {"Lang Tag Len", "srvloc.langtaglen",
970 FT_UINT16, BASE_DEC, NULL, 0x0,
973 {&hf_srvloc_nextextoff,
974 {"Next Extension Offset", "srvloc.nextextoff",
975 FT_UINT24, BASE_DEC, NULL, 0x0,
978 /* Helper functions for URL parsing - Version 2 */
979 {&hf_srvloc_url_reserved,
980 {"Reserved", "srvloc.url.reserved",
981 FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL }
983 {&hf_srvloc_url_lifetime,
984 {"Lifetime", "srvloc.url.lifetime",
985 FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }
987 {&hf_srvloc_url_urllen,
988 {"URL Length", "srvloc.url.urllen",
989 FT_UINT16, BASE_DEC, NULL, 0x0, "", HFILL }
992 {"URL", "srvloc.url.url",
993 FT_STRING, BASE_DEC, NULL, 0x0, "", HFILL }
995 {&hf_srvloc_url_numauths,
996 {"Num Auths", "srvloc.url.numauths",
997 FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL }
1000 /* Helper functions for the common header fields */
1001 {&hf_srvloc_function,
1002 {"Function", "srvloc.function",
1003 FT_UINT8, BASE_DEC, VALS(srvloc_functions), 0x0,
1008 {"Packet Length", "srvloc.pktlen",
1009 FT_UINT24, BASE_DEC, NULL, 0x0,
1013 { &hf_srvloc_version,
1014 { "Version", "srvloc.version",
1015 FT_UINT8, BASE_DEC, NULL, 0x0,
1020 {"Flags", "srvloc.flags",
1021 FT_UINT8, BASE_HEX, NULL, 0x0,
1025 {&hf_srvloc_flags_v2,
1026 {"Flags", "srvloc.flags_v2",
1027 FT_UINT16, BASE_HEX, NULL, 0x0,
1031 { &hf_srvloc_flags_v2_overflow,
1032 { "Overflow", "srvloc.flags_v2.overflow.", FT_BOOLEAN, 16,
1033 TFS(&tfs_srvloc_flags_v2_overflow), 0x8000, "Can whole packet fit into a datagram?", HFILL }},
1035 { &hf_srvloc_flags_v2_fresh,
1036 { "Fresh Registration", "srvloc.flags_v2.fresh.", FT_BOOLEAN, 16,
1037 TFS(&tfs_srvloc_flags_v2_fresh), 0x4000, "Is this a new registration?", HFILL }},
1039 { &hf_srvloc_flags_v2_reqmulti,
1040 { "Multicast requested", "srvloc.flags_v2.reqmulti.", FT_BOOLEAN, 16,
1041 TFS(&tfs_srvloc_flags_v2_reqmulti), 0x2000, "Do we want multicast?", HFILL }},
1043 /* collection of helper functions for dissect_authblk_v2 */
1044 { &hf_srvloc_authblkv2_bsd,
1045 { "BSD", "srvloc.authblkv2_bsd", FT_UINT16, BASE_HEX, NULL, 0x0,
1046 "Block Structure Descriptor", HFILL}
1048 { &hf_srvloc_authblkv2_len,
1049 { "Length", "srvloc.authblkv2_len", FT_UINT16, BASE_DEC, NULL, 0x0,
1050 "Length of Authentication Block", HFILL}
1052 { &hf_srvloc_authblkv2_timestamp,
1053 { "Timestamp", "srvloc.authblkv2.timestamp", FT_ABSOLUTE_TIME, BASE_NONE,
1054 NULL, 0, "Timestamp on Authentication Block", HFILL }
1056 { &hf_srvloc_authblkv2_slpspilen,
1057 { "SLP SPI Length", "srvloc.authblkv2.slpspilen", FT_UINT16, BASE_DEC, NULL, 0x0,
1058 "Length of the SLP SPI", HFILL}
1060 { &hf_srvloc_authblkv2_slpspi,
1061 { "SLP SPI", "srvloc.authblkv2.slpspi", FT_STRING, BASE_DEC, NULL, 0x0,
1065 /* collection of helper functions for Service Request */
1066 { &hf_srvloc_srvreq_prlistlen,
1067 { "PR List Length", "srvloc.srvreq.prlistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1068 "Length of Previous Response List", HFILL}
1070 { &hf_srvloc_srvreq_prlist,
1071 { "PR List", "srvloc.srvreq.prlist", FT_STRING, BASE_DEC, NULL, 0x0,
1072 "Previous Response List", HFILL}
1074 { &hf_srvloc_srvreq_srvtypelen,
1075 { "Service Type Length", "srvloc.srvreq.srvtypelen", FT_UINT16, BASE_DEC, NULL, 0x0,
1076 "Length of Service Type List", HFILL}
1078 { &hf_srvloc_srvreq_srvtypelist,
1079 { "Service Type List", "srvloc.srvreq.srvtypelist", FT_STRING, BASE_DEC, NULL, 0x0,
1082 { &hf_srvloc_srvreq_scopelistlen,
1083 { "Scope List Length", "srvloc.srvreq.scopelistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1084 "Length of the Scope List", HFILL}
1086 { &hf_srvloc_srvreq_scopelist,
1087 { "Scope List", "srvloc.srvreq.scopelist", FT_STRING, BASE_DEC, NULL, 0x0,
1090 { &hf_srvloc_srvreq_predicatelen,
1091 { "Predicate Length", "srvloc.srvreq.predicatelen", FT_UINT16, BASE_DEC, NULL, 0x0,
1092 "Length of the Predicate", HFILL}
1094 { &hf_srvloc_srvreq_predicate,
1095 { "Predicate", "srvloc.srvreq.predicate", FT_STRING, BASE_DEC, NULL, 0x0,
1098 { &hf_srvloc_srvreq_slpspilen,
1099 { "SLP SPI Length", "srvloc.srvreq.slpspilen", FT_UINT16, BASE_DEC, NULL, 0x0,
1100 "Length of the SLP SPI", HFILL}
1102 { &hf_srvloc_srvreq_slpspi,
1103 { "SLP SPI", "srvloc.srvreq.slpspi", FT_STRING, BASE_DEC, NULL, 0x0,
1107 /* Helper function for Service Request */
1108 { &hf_srvloc_srvrply_urlcount,
1109 { "Number of URLs", "srvloc.srvreq.urlcount", FT_UINT16, BASE_DEC, NULL, 0x0,
1113 /* Helper functions for Service Registration */
1114 { &hf_srvloc_srvreg_srvtypelen,
1115 { "Service Type Length", "srvloc.srvreq.srvtypelen", FT_UINT16, BASE_DEC, NULL, 0x0,
1118 { &hf_srvloc_srvreg_srvtype,
1119 { "Service Type", "srvloc.srvreq.srvtype", FT_STRING, BASE_DEC, NULL, 0x0,
1122 { &hf_srvloc_srvreg_scopelistlen,
1123 { "Scope List Length", "srvloc.srvreq.scopelistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1126 { &hf_srvloc_srvreg_scopelist,
1127 { "Scope List", "srvloc.srvreq.scopelist", FT_STRING, BASE_DEC, NULL, 0x0,
1130 { &hf_srvloc_srvreg_attrlistlen,
1131 { "Attribute List Length", "srvloc.srvreq.attrlistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1134 { &hf_srvloc_srvreg_attrlist,
1135 { "Attribute List", "srvloc.srvreq.attrlist", FT_STRING, BASE_DEC, NULL, 0x0,
1138 { &hf_srvloc_srvreg_attrauthcount,
1139 { "Attr Auths", "srvloc.srvreq.attrauthcount", FT_UINT8, BASE_DEC, NULL, 0x0,
1140 "Number of Attribute Authentication Blocks", HFILL}
1143 /* Helper functions for Service Deregistration */
1144 { &hf_srvloc_srvdereg_scopelistlen,
1145 { "Scope List Length", "srvloc.srvdereq.scopelistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1148 { &hf_srvloc_srvdereg_scopelist,
1149 { "Scope List", "srvloc.srvdereq.scopelist", FT_STRING, BASE_DEC, NULL, 0x0,
1152 { &hf_srvloc_srvdereg_taglistlen,
1153 { "Tag List Length", "srvloc.srvdereq.taglistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1156 { &hf_srvloc_srvdereg_taglist,
1157 { "Tag List", "srvloc.srvdereq.taglist", FT_STRING, BASE_DEC, NULL, 0x0,
1162 /* collection of helper functions for Attribute Request */
1163 { &hf_srvloc_attrreq_prlistlen,
1164 { "PR List Length", "srvloc.attrreq.prlistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1165 "Length of Previous Response List", HFILL}
1167 { &hf_srvloc_attrreq_prlist,
1168 { "PR List", "srvloc.attrreq.prlist", FT_STRING, BASE_DEC, NULL, 0x0,
1169 "Previous Response List", HFILL}
1171 { &hf_srvloc_attrreq_urllen,
1172 { "URL Length", "srvloc.attrreq.urllen", FT_UINT16, BASE_DEC, NULL, 0x0,
1175 { &hf_srvloc_attrreq_url,
1176 { "URL", "srvloc.attrreq.url", FT_STRING, BASE_DEC, NULL, 0x0,
1177 "URL of service", HFILL}
1179 { &hf_srvloc_attrreq_scopelistlen,
1180 { "Scope List Length", "srvloc.attrreq.scopelistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1181 "Length of the Scope List", HFILL}
1183 { &hf_srvloc_attrreq_scopelist,
1184 { "Scope List", "srvloc.attrreq.scopelist", FT_STRING, BASE_DEC, NULL, 0x0,
1187 { &hf_srvloc_attrreq_taglistlen,
1188 { "Tag List Length", "srvloc.attrreq.taglistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1191 { &hf_srvloc_attrreq_taglist,
1192 { "Tag List", "srvloc.attrreq.taglist", FT_STRING, BASE_DEC, NULL, 0x0,
1195 { &hf_srvloc_attrreq_slpspilen,
1196 { "SLP SPI Length", "svrloc.attrreq.slpspilen", FT_UINT16, BASE_DEC, NULL, 0x0,
1197 "Length of the SLP SPI", HFILL}
1199 { &hf_srvloc_attrreq_slpspi,
1200 { "SLP SPI", "srvloc.attrreq.slpspi", FT_STRING, BASE_DEC, NULL, 0x0,
1204 /* collection of helper functions for Attribute Reply */
1205 { &hf_srvloc_attrrply_attrlistlen,
1206 { "Attribute List Length", "srvloc.attrrply.attrlistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1207 "Length of Attribute List", HFILL}
1209 { &hf_srvloc_attrrply_attrlist,
1210 { "Attribute Reply", "srvloc.attrrply.attrlist", FT_STRING, BASE_DEC, NULL, 0x0,
1213 { &hf_srvloc_attrrply_attrauthcount,
1214 { "Attr Auths", "srvloc.srvreq.attrauthcount", FT_UINT8, BASE_DEC, NULL, 0x0,
1215 "Number of Attribute Authentication Blocks", HFILL}
1218 /* collection of helper functions for DA Advertisement */
1219 { &hf_srvloc_daadvert_timestamp,
1220 { "DAADVERT Timestamp", "srvloc.daadvert.timestamp", FT_ABSOLUTE_TIME, BASE_NONE,
1221 NULL, 0, "Timestamp on DA Advert", HFILL }
1223 { &hf_srvloc_daadvert_urllen,
1224 { "URL Length", "srvloc.daadvert.urllen", FT_UINT16, BASE_DEC, NULL, 0x0,
1227 { &hf_srvloc_daadvert_url,
1228 { "URL", "srvloc.daadvert.url", FT_STRING, BASE_DEC, NULL, 0x0,
1231 { &hf_srvloc_daadvert_scopelistlen,
1232 { "Scope List Length", "srvloc.daadvert.scopelistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1233 "Length of the Scope List", HFILL}
1235 { &hf_srvloc_daadvert_scopelist,
1236 { "Scope List", "srvloc.daadvert.scopelist", FT_STRING, BASE_DEC, NULL, 0x0,
1239 { &hf_srvloc_daadvert_attrlistlen,
1240 { "Attribute List Length", "srvloc.daadvert.attrlistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1243 { &hf_srvloc_daadvert_attrlist,
1244 { "Attribute List", "srvloc.daadvert.attrlist", FT_STRING, BASE_DEC, NULL, 0x0,
1247 { &hf_srvloc_daadvert_slpspilen,
1248 { "SLP SPI Length", "svrloc.daadvert.slpspilen", FT_UINT16, BASE_DEC, NULL, 0x0,
1249 "Length of the SLP SPI", HFILL}
1251 { &hf_srvloc_daadvert_slpspi,
1252 { "SLP SPI", "srvloc.daadvert.slpspi", FT_STRING, BASE_DEC, NULL, 0x0,
1255 { &hf_srvloc_daadvert_authcount,
1256 { "Auths", "srvloc.daadvert.authcount", FT_UINT8, BASE_DEC, NULL, 0x0,
1257 "Number of Authentication Blocks", HFILL}
1260 /* collection of helper functions for Service Type Request */
1261 { &hf_srvloc_srvtypereq_prlistlen,
1262 { "PR List Length", "srvloc.srvtypereq.prlistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1263 "Length of Previous Response List", HFILL}
1265 { &hf_srvloc_srvtypereq_prlist,
1266 { "PR List", "srvloc.srvtypereq.prlist", FT_STRING, BASE_DEC, NULL, 0x0,
1267 "Previous Response List", HFILL}
1269 { &hf_srvloc_srvtypereq_authlistlen,
1270 { "Naming Authority List Length", "srvloc.srvtypereq.nameauthlistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1271 "Length of the Naming Authority List", HFILL}
1273 { &hf_srvloc_srvtypereq_authlist,
1274 { "Naming Authority List", "srvloc.srvtypereq.nameauthlist", FT_STRING, BASE_DEC, NULL, 0x0,
1277 { &hf_srvloc_srvtypereq_scopelistlen,
1278 { "Scope List Length", "srvloc.srvtypereq.scopelistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1279 "Length of the Scope List", HFILL}
1281 { &hf_srvloc_srvtypereq_scopelist,
1282 { "Scope List", "srvloc.srvtypereq.scopelist", FT_STRING, BASE_DEC, NULL, 0x0,
1286 /* collection of helper functions for Service Type Replies */
1287 { &hf_srvloc_srvtyperply_len,
1288 { "Service Length", "srvloc.srvtypereq.len", FT_UINT16, BASE_DEC, NULL, 0x0,
1289 "Length of the Scope List", HFILL}
1291 { &hf_srvloc_srvtyperply_type,
1292 { "Service", "srvloc.srvtyperply.type", FT_STRING, BASE_DEC, NULL, 0x0,
1296 /* collection of helper functions for SA Advertisement */
1297 { &hf_srvloc_saadvert_urllen,
1298 { "URL Length", "srvloc.saadvert.urllen", FT_UINT16, BASE_DEC, NULL, 0x0,
1301 { &hf_srvloc_saadvert_url,
1302 { "URL", "srvloc.saadvert.url", FT_STRING, BASE_DEC, NULL, 0x0,
1305 { &hf_srvloc_saadvert_scopelistlen,
1306 { "Scope List Length", "srvloc.saadvert.scopelistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1307 "Length of the Scope List", HFILL}
1309 { &hf_srvloc_saadvert_scopelist,
1310 { "Scope List", "srvloc.saadvert.scopelist", FT_STRING, BASE_DEC, NULL, 0x0,
1313 { &hf_srvloc_saadvert_attrlistlen,
1314 { "Attribute List Length", "srvloc.saadvert.attrlistlen", FT_UINT16, BASE_DEC, NULL, 0x0,
1317 { &hf_srvloc_saadvert_attrlist,
1318 { "Attribute List", "srvloc.saadvert.attrlist", FT_STRING, BASE_DEC, NULL, 0x0,
1321 { &hf_srvloc_saadvert_authcount,
1322 { "Auths", "srvloc.saadvert.authcount", FT_UINT8, BASE_DEC, NULL, 0x0,
1323 "Number of Authentication Blocks", HFILL}
1328 static gint *ett[] = {
1333 proto_srvloc = proto_register_protocol("Service Location Protocol",
1334 "SRVLOC", "srvloc");
1335 proto_register_field_array(proto_srvloc, hf, array_length(hf));
1336 proto_register_subtree_array(ett, array_length(ett));
1340 proto_reg_handoff_srvloc(void)
1342 dissector_handle_t srvloc_handle;
1344 srvloc_handle = create_dissector_handle(dissect_srvloc, proto_srvloc);
1345 dissector_add("tcp.port", TCP_PORT_SRVLOC, srvloc_handle);
1346 dissector_add("udp.port", UDP_PORT_SRVLOC, srvloc_handle);