2 * Routines for afp packet dissection
3 * Copyright 2002, Didier Gautheron <dgautheron@magic.fr>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * Copied from README.developer
10 * Copied from packet-dsi.c
12 * SPDX-License-Identifier: GPL-2.0-or-later
18 #include <epan/packet.h>
19 #include <epan/exceptions.h>
20 #include <epan/to_str.h>
21 #include <epan/conversation.h>
22 #include <epan/prefs.h>
24 #include <epan/srt_table.h>
25 #include <epan/expert.h>
27 #include "packet-afp.h"
29 /* The information in this module (AFP) comes from:
31 AFP 2.1 & 2.2 documentation, in PDF form, at
33 http://mirror.informatimago.com/next/developer.apple.com/documentation/macos8/pdf/ASAppleTalkFiling2.1_2.2.pdf
37 http://developer.apple.com/DOCUMENTATION/macos8/pdf/ASAppleTalkFiling2.1_2.2.pdf
39 AFP3.0.pdf from http://www.apple.com (still available?)
41 AFP 3.1 programming guide, in PDF form, at
43 https://web.archive.org/web/20040721011424/http://developer.apple.com/documentation/Networking/Conceptual/AFP/AFP3_1.pdf
47 https://web.archive.org/web/20041010010846/http://developer.apple.com/documentation/Networking/Conceptual/AFP/index.html
49 AFP 3.2 programming guide, in PDF form, at
51 https://web.archive.org/web/20060207231337/http://developer.apple.com/documentation/Networking/Conceptual/AFP/AFP3_1.pdf
55 https://web.archive.org/web/20080514131536/http://developer.apple.com/documentation/Networking/Conceptual/AFP/Introduction/chapter_1_section_1.html
57 AFP 3.x specification, as of 2012, in PDF form, at
58 https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.363.9481&rep=rep1&type=pdf
60 Current AFP 3.x programming guide, in HTML form, at
61 https://developer.apple.com/library/archive/documentation/Networking/Conceptual/AFP/Introduction/Introduction.html
63 The netatalk source code by Wesley Craig & Adrian Sun
64 http://netatalk.sf.net
66 XXX - distinguish between UTF-8 and Mac proprietary encodings for strings?
67 Does that need a preference in case we didn't see the client and server
70 /* Forward declarations */
71 void proto_register_afp(void);
72 void proto_reg_handoff_afp(void);
74 /* from netatalk/include/afp.h */
75 #define AFPTRANS_NONE 0
76 #define AFPTRANS_DDP (1U << 0)
77 #define AFPTRANS_TCP (1U << 1)
78 #define AFPTRANS_ALL (AFPTRANS_DDP | AFPTRANS_TCP)
80 /* AFP Attention Codes -- 4 bits */
81 #define AFPATTN_SHUTDOWN (1U << 15) /* shutdown/disconnect */
82 #define AFPATTN_CRASH (1U << 14) /* server crashed */
83 #define AFPATTN_MESG (1U << 13) /* server has message */
84 #define AFPATTN_NORECONNECT (1U << 12) /* don't reconnect */
85 /* server notification */
86 #define AFPATTN_NOTIFY (AFPATTN_MESG | AFPATTN_NORECONNECT)
88 /* extended bitmap -- 12 bits. volchanged is only useful w/ a server
89 * notification, and time is only useful for shutdown. */
90 #define AFPATTN_VOLCHANGED (1U << 0) /* volume has changed */
91 #define AFPATTN_TIME(x) ((x) & 0xfff) /* time in minutes */
94 #define AFP_BYTELOCK 1
95 #define AFP_CLOSEVOL 2
96 #define AFP_CLOSEDIR 3
97 #define AFP_CLOSEFORK 4
98 #define AFP_COPYFILE 5
99 #define AFP_CREATEDIR 6
100 #define AFP_CREATEFILE 7
102 #define AFP_ENUMERATE 9
104 #define AFP_FLUSHFORK 11
105 #define AFP_GETFORKPARAM 14
106 #define AFP_GETSRVINFO 15
107 #define AFP_GETSRVPARAM 16
108 #define AFP_GETVOLPARAM 17
110 #define AFP_LOGINCONT 19
111 #define AFP_LOGOUT 20
113 #define AFP_MAPNAME 22
115 #define AFP_OPENVOL 24
116 #define AFP_OPENDIR 25
117 #define AFP_OPENFORK 26
119 #define AFP_RENAME 28
120 #define AFP_SETDIRPARAM 29
121 #define AFP_SETFILEPARAM 30
122 #define AFP_SETFORKPARAM 31
123 #define AFP_SETVOLPARAM 32
125 #define AFP_GETFLDRPARAM 34
126 #define AFP_SETFLDRPARAM 35
127 #define AFP_CHANGEPW 36
128 #define AFP_GETUSERINFO 37
129 #define AFP_GETSRVRMSG 38
130 #define AFP_CREATEID 39
131 #define AFP_DELETEID 40
132 #define AFP_RESOLVEID 41
133 #define AFP_EXCHANGEFILE 42
134 #define AFP_CATSEARCH 43
135 #define AFP_OPENDT 48
136 #define AFP_CLOSEDT 49
137 #define AFP_GETICON 51
138 #define AFP_GTICNINFO 52
139 #define AFP_ADDAPPL 53
140 #define AFP_RMVAPPL 54
141 #define AFP_GETAPPL 55
142 #define AFP_ADDCMT 56
143 #define AFP_RMVCMT 57
144 #define AFP_GETCMT 58
147 #define AFP_ADDICON 192
149 /* AFP 3.0 new calls */
150 #define AFP_BYTELOCK_EXT 59
151 #define AFP_READ_EXT 60
152 #define AFP_WRITE_EXT 61
153 #define AFP_LOGIN_EXT 63
154 #define AFP_GETSESSTOKEN 64
155 #define AFP_DISCTOLDSESS 65
156 #define AFP_ENUMERATE_EXT 66
157 #define AFP_CATSEARCH_EXT 67
159 /* AFP 3.1 new calls */
160 #define AFP_ENUMERATE_EXT2 68
162 /* AFP 3.2 new calls */
163 #define AFP_GETEXTATTR 69
164 #define AFP_SETEXTATTR 70
165 #define AFP_REMOVEATTR 71
166 #define AFP_LISTEXTATTR 72
167 #define AFP_GETACL 73
168 #define AFP_SETACL 74
169 #define AFP_ACCESS 75
171 /* AFP 3.2 calls added in 10.5 */
172 #define AFP_SPOTLIGHTRPC 76
173 #define AFP_SYNCDIR 78
174 #define AFP_SYNCFORK 79
176 /* FPSpotlightRPC subcommand codes */
177 #define SPOTLIGHT_CMD_GET_VOLPATH 4
178 #define SPOTLIGHT_CMD_GET_VOLID 2
179 #define SPOTLIGHT_CMD_GET_THREE 3
181 /* Spotlight epoch is UNIX epoch minus SPOTLIGHT_TIME_DELTA */
182 #define SPOTLIGHT_TIME_DELTA UINT64_C(280878921600)
184 /* ----------------------------- */
185 static int proto_afp
;
186 static int hf_afp_reserved
;
187 static int hf_afp_unknown
;
189 static int hf_afp_command
; /* CommandCode */
190 static int hf_afp_Version
;
191 static int hf_afp_UAM
;
192 static int hf_afp_user
;
193 static int hf_afp_passwd
;
194 static int hf_afp_random
;
196 static int hf_afp_response_to
;
197 static int hf_afp_time
;
198 static int hf_afp_response_in
;
200 static int hf_afp_login_flags
;
201 static int hf_afp_pad
;
203 static int hf_afp_user_type
;
204 static int hf_afp_user_len
;
205 static int hf_afp_user_name
;
207 static int hf_afp_vol_flag
;
208 static int hf_afp_vol_flag_passwd
;
209 static int hf_afp_vol_flag_has_config
;
210 static int hf_afp_server_time
;
212 static int hf_afp_vol_bitmap
;
213 static int hf_afp_vol_name_offset
;
214 static int hf_afp_vol_id
;
215 static int hf_afp_vol_attribute
;
216 static int hf_afp_vol_name
;
217 static int hf_afp_vol_signature
;
218 static int hf_afp_vol_creation_date
;
219 static int hf_afp_vol_modification_date
;
220 static int hf_afp_vol_backup_date
;
221 static int hf_afp_vol_bytes_free
;
222 static int hf_afp_vol_bytes_total
;
223 static int hf_afp_vol_ex_bytes_free
;
224 static int hf_afp_vol_ex_bytes_total
;
225 static int hf_afp_vol_block_size
;
228 static int hf_afp_comment
;
229 static int hf_afp_file_creator
;
230 static int hf_afp_file_type
;
231 static int hf_afp_icon_type
;
232 static int hf_afp_icon_length
;
233 static int hf_afp_icon_tag
;
234 static int hf_afp_icon_index
;
235 static int hf_afp_appl_index
;
236 static int hf_afp_appl_tag
;
238 static int hf_afp_did
;
239 static int hf_afp_file_id
;
240 static int hf_afp_file_DataForkLen
;
241 static int hf_afp_file_RsrcForkLen
;
242 static int hf_afp_file_ExtDataForkLen
;
243 static int hf_afp_file_ExtRsrcForkLen
;
245 static int hf_afp_dir_bitmap
;
246 static int hf_afp_dir_offspring
;
247 static int hf_afp_dir_OwnerID
;
248 static int hf_afp_dir_GroupID
;
250 static int hf_afp_req_count
;
251 static int hf_afp_start_index
;
252 static int hf_afp_start_index32
;
253 static int hf_afp_max_reply_size
;
254 static int hf_afp_max_reply_size32
;
255 static int hf_afp_file_flag
;
256 static int hf_afp_create_flag
;
257 static int hf_afp_struct_size
;
258 static int hf_afp_struct_size16
;
260 static int hf_afp_cat_count
;
261 static int hf_afp_cat_req_matches
;
262 static int hf_afp_cat_position
;
264 static int hf_afp_creation_date
;
265 static int hf_afp_modification_date
;
266 static int hf_afp_backup_date
;
267 static int hf_afp_finder_info
;
268 static int hf_afp_long_name_offset
;
269 static int hf_afp_short_name_offset
;
270 static int hf_afp_unicode_name_offset
;
271 static int hf_afp_unix_privs_uid
;
272 static int hf_afp_unix_privs_gid
;
273 static int hf_afp_unix_privs_permissions
;
274 static int hf_afp_unix_privs_ua_permissions
;
276 static int hf_afp_path_type
;
277 static int hf_afp_path_len
;
278 static int hf_afp_path_name
;
279 static int hf_afp_path_unicode_hint
;
280 static int hf_afp_path_unicode_len
;
282 static int hf_afp_flag
;
283 static int hf_afp_dt_ref
;
284 static int hf_afp_ofork
;
285 static int hf_afp_ofork_len
;
286 static int hf_afp_offset
;
287 static int hf_afp_rw_count
;
288 static int hf_afp_newline_mask
;
289 static int hf_afp_newline_char
;
290 static int hf_afp_last_written
;
292 static int hf_afp_fork_type
;
293 static int hf_afp_access_mode
;
294 static int hf_afp_access_read
;
295 static int hf_afp_access_write
;
296 static int hf_afp_access_deny_read
;
297 static int hf_afp_access_deny_write
;
299 static int hf_afp_lock_op
;
300 static int hf_afp_lock_from
;
301 static int hf_afp_lock_offset
;
302 static int hf_afp_lock_len
;
303 static int hf_afp_lock_range_start
;
307 static int ett_afp_vol_attribute
;
308 static int ett_afp_enumerate
;
309 static int ett_afp_enumerate_line
;
310 static int ett_afp_access_mode
;
312 static int ett_afp_vol_bitmap
;
313 static int ett_afp_dir_bitmap
;
314 static int ett_afp_dir_attribute
;
315 static int ett_afp_file_attribute
;
316 static int ett_afp_file_bitmap
;
317 static int ett_afp_unix_privs
;
318 static int ett_afp_path_name
;
319 static int ett_afp_lock_flags
;
320 static int ett_afp_dir_ar
;
322 static int ett_afp_server_vol
;
323 static int ett_afp_vol_list
;
324 static int ett_afp_vol_flag
;
325 static int ett_afp_cat_search
;
326 static int ett_afp_cat_r_bitmap
;
327 static int ett_afp_cat_spec
;
328 static int ett_afp_vol_did
;
330 /* AFP 3.0 parameters */
331 static int hf_afp_lock_offset64
;
332 static int hf_afp_lock_len64
;
333 static int hf_afp_lock_range_start64
;
335 static int hf_afp_offset64
;
336 static int hf_afp_rw_count64
;
337 static int hf_afp_reqcount64
;
339 static int hf_afp_last_written64
;
341 static int hf_afp_ofork_len64
;
342 static int hf_afp_session_token_type
;
343 static int hf_afp_session_token_len
;
344 static int hf_afp_session_token
;
345 static int hf_afp_session_token_timestamp
;
349 static int hf_afp_extattr_bitmap
;
350 static int hf_afp_extattr_bitmap_NoFollow
;
351 static int hf_afp_extattr_bitmap_Create
;
352 static int hf_afp_extattr_bitmap_Replace
;
353 static int ett_afp_extattr_bitmap
;
354 static int hf_afp_extattr_namelen
;
355 static int hf_afp_extattr_name
;
356 static int hf_afp_extattr_len
;
357 static int hf_afp_extattr_data
;
358 static int hf_afp_extattr_req_count
;
359 static int hf_afp_extattr_start_index
;
360 static int hf_afp_extattr_reply_size
;
361 static int ett_afp_extattr_names
;
363 static expert_field ei_afp_subquery_count_over_safety_limit
;
364 static expert_field ei_afp_subquery_count_over_query_count
;
365 static expert_field ei_afp_abnormal_num_subqueries
;
366 static expert_field ei_afp_too_many_acl_entries
;
367 static expert_field ei_afp_ip_port_reused
;
368 static expert_field ei_afp_toc_offset
;
373 static dissector_handle_t spotlight_handle
;
375 static const value_string vol_signature_vals
[] = {
377 {2, "Fixed Directory ID"},
378 {3, "Variable Directory ID (deprecated)"},
382 static const value_string CommandCode_vals
[] = {
383 {AFP_BYTELOCK
, "FPByteRangeLock" },
384 {AFP_CLOSEVOL
, "FPCloseVol" },
385 {AFP_CLOSEDIR
, "FPCloseDir" },
386 {AFP_CLOSEFORK
, "FPCloseFork" },
387 {AFP_COPYFILE
, "FPCopyFile" },
388 {AFP_CREATEDIR
, "FPCreateDir" },
389 {AFP_CREATEFILE
, "FPCreateFile" },
390 {AFP_DELETE
, "FPDelete" },
391 {AFP_ENUMERATE
, "FPEnumerate" },
392 {AFP_FLUSH
, "FPFlush" },
393 {AFP_FLUSHFORK
, "FPFlushFork" },
394 {AFP_GETFORKPARAM
, "FPGetForkParms" },
395 {AFP_GETSRVINFO
, "FPGetSrvrInfo" },
396 {AFP_GETSRVPARAM
, "FPGetSrvrParms" },
397 {AFP_GETVOLPARAM
, "FPGetVolParms" },
398 {AFP_LOGIN
, "FPLogin" },
399 {AFP_LOGINCONT
, "FPLoginCont" },
400 {AFP_LOGOUT
, "FPLogout" },
401 {AFP_MAPID
, "FPMapID" },
402 {AFP_MAPNAME
, "FPMapName" },
403 {AFP_MOVE
, "FPMoveAndRename" },
404 {AFP_OPENVOL
, "FPOpenVol" },
405 {AFP_OPENDIR
, "FPOpenDir" },
406 {AFP_OPENFORK
, "FPOpenFork" },
407 {AFP_READ
, "FPRead" },
408 {AFP_RENAME
, "FPRename" },
409 {AFP_SETDIRPARAM
, "FPSetDirParms" },
410 {AFP_SETFILEPARAM
, "FPSetFileParms" },
411 {AFP_SETFORKPARAM
, "FPSetForkParms" },
412 {AFP_SETVOLPARAM
, "FPSetVolParms" },
413 {AFP_WRITE
, "FPWrite" },
414 {AFP_GETFLDRPARAM
, "FPGetFileDirParms" },
415 {AFP_SETFLDRPARAM
, "FPSetFileDirParms" },
416 {AFP_CHANGEPW
, "FPChangePassword" },
417 {AFP_GETUSERINFO
, "FPGetUserInfo" },
418 {AFP_GETSRVRMSG
, "FPGetSrvrMsg" },
419 {AFP_CREATEID
, "FPCreateID" },
420 {AFP_DELETEID
, "FPDeleteID" },
421 {AFP_RESOLVEID
, "FPResolveID" },
422 {AFP_EXCHANGEFILE
, "FPExchangeFiles" },
423 {AFP_CATSEARCH
, "FPCatSearch" },
424 {AFP_OPENDT
, "FPOpenDT" },
425 {AFP_CLOSEDT
, "FPCloseDT" },
426 {AFP_GETICON
, "FPGetIcon" },
427 {AFP_GTICNINFO
, "FPGetIconInfo" },
428 {AFP_ADDAPPL
, "FPAddAPPL" },
429 {AFP_RMVAPPL
, "FPRemoveAPPL" },
430 {AFP_GETAPPL
, "FPGetAPPL" },
431 {AFP_ADDCMT
, "FPAddComment" },
432 {AFP_RMVCMT
, "FPRemoveComment" },
433 {AFP_GETCMT
, "FPGetComment" },
434 {AFP_BYTELOCK_EXT
, "FPByteRangeLockExt" },
435 {AFP_READ_EXT
, "FPReadExt" },
436 {AFP_WRITE_EXT
, "FPWriteExt" },
437 {AFP_LOGIN_EXT
, "FPLoginExt" },
438 {AFP_GETSESSTOKEN
, "FPGetSessionToken" },
439 {AFP_DISCTOLDSESS
, "FPDisconnectOldSession" },
440 {AFP_ENUMERATE_EXT
, "FPEnumerateExt" },
441 {AFP_CATSEARCH_EXT
, "FPCatSearchExt" },
442 {AFP_ENUMERATE_EXT2
, "FPEnumerateExt2" },
443 {AFP_GETEXTATTR
, "FPGetExtAttr" },
444 {AFP_SETEXTATTR
, "FPSetExtAttr" },
445 {AFP_REMOVEATTR
, "FPRemoveExtAttr" },
446 {AFP_LISTEXTATTR
, "FPListExtAttrs" },
447 {AFP_GETACL
, "FPGetACL" },
448 {AFP_SETACL
, "FPSetACL" },
449 {AFP_ACCESS
, "FPAccess" },
450 {AFP_SPOTLIGHTRPC
, "FPSpotlightRPC" },
451 {AFP_SYNCDIR
, "FPSyncDir" },
452 {AFP_SYNCFORK
, "FPSyncFork" },
453 {AFP_ZZZ
, "FPZzzzz" },
454 {AFP_ADDICON
, "FPAddIcon" },
457 value_string_ext CommandCode_vals_ext
= VALUE_STRING_EXT_INIT(CommandCode_vals
);
459 static const value_string unicode_hint_vals
[] = {
461 { 1, "MacJapanese" },
462 { 2, "MacChineseTrad" },
467 { 7, "MacCyrillic" },
468 { 9, "MacDevanagari" },
469 { 10, "MacGurmukhi" },
470 { 11, "MacGujarati" },
472 { 13, "MacBengali" },
475 { 16, "MacKannada" },
476 { 17, "MacMalayalam" },
477 { 18, "MacSinhalese" },
478 { 19, "MacBurmese" },
481 { 22, "MacLaotian" },
482 { 23, "MacGeorgian" },
483 { 24, "MacArmenian" },
484 { 25, "MacChineseSimp" },
485 { 26, "MacTibetan" },
486 { 27, "MacMongolian" },
487 { 28, "MacEthiopic" },
488 { 29, "MacCentralEurRoman" },
489 { 30, "MacVietnamese" },
490 { 31, "MacExtArabic" },
492 { 34, "MacDingbats" },
493 { 35, "MacTurkish" },
494 { 36, "MacCroatian" },
495 { 37, "MacIcelandic" },
496 { 38, "MacRomanian" },
499 { 41, "MacKeyboardGlyphs" },
500 { 126, "MacUnicode" },
502 { 152, "MacUkrainian" },
506 { 256, "UnicodeDefault" },
507 /* ?? { 257, "UnicodeV1_1" }, */
508 { 257, "ISO10646_1993" },
509 { 259, "UnicodeV2_0" },
510 /* ?? { 259, "UnicodeV2_1" }, */
511 { 260, "UnicodeV3_0" },
512 { 513, "ISOLatin1" },
513 { 514, "ISOLatin2" },
514 { 515, "ISOLatin3" },
515 { 516, "ISOLatin4" },
516 { 517, "ISOLatinCyrillic" },
517 { 518, "ISOLatinArabic" },
518 { 519, "ISOLatinGreek" },
519 { 520, "ISOLatinHebrew" },
520 { 521, "ISOLatin5" },
521 { 522, "ISOLatin6" },
522 { 525, "ISOLatin7" },
523 { 526, "ISOLatin8" },
524 { 527, "ISOLatin9" },
525 { 1024, "DOSLatinUS" },
526 { 1029, "DOSGreek" },
527 { 1030, "DOSBalticRim" },
528 { 1040, "DOSLatin1" },
529 { 1041, "DOSGreek1" },
530 { 1042, "DOSLatin2" },
531 { 1043, "DOSCyrillic" },
532 { 1044, "DOSTurkish" },
533 { 1045, "DOSPortuguese" },
534 { 1046, "DOSIcelandic" },
535 { 1047, "DOSHebrew" },
536 { 1048, "DOSCanadianFrench" },
537 { 1049, "DOSArabic" },
538 { 1050, "DOSNordic" },
539 { 1051, "DOSRussian" },
540 { 1052, "DOSGreek2" },
542 { 1056, "DOSJapanese" },
543 { 1057, "DOSChineseSimplif" },
544 { 1058, "DOSKorean" },
545 { 1059, "DOSChineseTrad" },
546 { 1280, "WindowsLatin1" },
547 /* { 1280, "WindowsANSI" }, */
548 { 1281, "WindowsLatin2" },
549 { 1282, "WindowsCyrillic" },
550 { 1283, "WindowsGreek" },
551 { 1284, "WindowsLatin5" },
552 { 1285, "WindowsHebrew" },
553 { 1286, "WindowsArabic" },
554 { 1287, "WindowsBalticRim" },
555 { 1288, "WindowsVietnamese" },
556 { 1296, "WindowsKoreanJohab" },
557 { 1536, "US_ASCII" },
558 { 1568, "JIS_X0201_76" },
559 { 1569, "JIS_X0208_83" },
560 { 1570, "JIS_X0208_90" },
563 static value_string_ext unicode_hint_vals_ext
= VALUE_STRING_EXT_INIT(unicode_hint_vals
);
566 from Apple AFP3.0.pdf
569 #define kFPVolAttributeBit (1U << 0)
570 #define kFPVolSignatureBit (1U << 1)
571 #define kFPVolCreateDateBit (1U << 2)
572 #define kFPVolModDateBit (1U << 3)
573 #define kFPVolBackupDateBit (1U << 4)
574 #define kFPVolIDBit (1U << 5)
575 #define kFPVolBytesFreeBit (1U << 6)
576 #define kFPVolBytesTotalBit (1U << 7)
577 #define kFPVolNameBit (1U << 8)
578 #define kFPVolExtBytesFreeBit (1U << 9)
579 #define kFPVolExtBytesTotalBit (1U << 10)
580 #define kFPVolBlockSizeBit (1U << 11)
582 static int hf_afp_vol_bitmap_Attributes
;
583 static int hf_afp_vol_bitmap_Signature
;
584 static int hf_afp_vol_bitmap_CreateDate
;
585 static int hf_afp_vol_bitmap_ModDate
;
586 static int hf_afp_vol_bitmap_BackupDate
;
587 static int hf_afp_vol_bitmap_ID
;
588 static int hf_afp_vol_bitmap_BytesFree
;
589 static int hf_afp_vol_bitmap_BytesTotal
;
590 static int hf_afp_vol_bitmap_Name
;
591 static int hf_afp_vol_bitmap_ExtBytesFree
;
592 static int hf_afp_vol_bitmap_ExtBytesTotal
;
593 static int hf_afp_vol_bitmap_BlockSize
;
595 static int hf_afp_vol_attribute_ReadOnly
;
596 static int hf_afp_vol_attribute_HasVolumePassword
;
597 static int hf_afp_vol_attribute_SupportsFileIDs
;
598 static int hf_afp_vol_attribute_SupportsCatSearch
;
599 static int hf_afp_vol_attribute_SupportsBlankAccessPrivs
;
600 static int hf_afp_vol_attribute_SupportsUnixPrivs
;
601 static int hf_afp_vol_attribute_SupportsUTF8Names
;
602 static int hf_afp_vol_attribute_NoNetworkUserID
;
603 static int hf_afp_vol_attribute_DefaultPrivsFromParent
;
604 static int hf_afp_vol_attribute_NoExchangeFiles
;
605 static int hf_afp_vol_attribute_SupportsExtAttrs
;
606 static int hf_afp_vol_attribute_SupportsACLs
;
607 static int hf_afp_vol_attribute_CaseSensitive
;
608 static int hf_afp_vol_attribute_SupportsTMLockSteal
;
610 static int hf_afp_dir_bitmap_Attributes
;
611 static int hf_afp_dir_bitmap_ParentDirID
;
612 static int hf_afp_dir_bitmap_CreateDate
;
613 static int hf_afp_dir_bitmap_ModDate
;
614 static int hf_afp_dir_bitmap_BackupDate
;
615 static int hf_afp_dir_bitmap_FinderInfo
;
616 static int hf_afp_dir_bitmap_LongName
;
617 static int hf_afp_dir_bitmap_ShortName
;
618 static int hf_afp_dir_bitmap_NodeID
;
619 static int hf_afp_dir_bitmap_OffspringCount
;
620 static int hf_afp_dir_bitmap_OwnerID
;
621 static int hf_afp_dir_bitmap_GroupID
;
622 static int hf_afp_dir_bitmap_AccessRights
;
623 static int hf_afp_dir_bitmap_UTF8Name
;
624 static int hf_afp_dir_bitmap_UnixPrivs
;
626 static int hf_afp_dir_attribute
;
627 static int hf_afp_dir_attribute_Invisible
;
628 static int hf_afp_dir_attribute_IsExpFolder
;
629 static int hf_afp_dir_attribute_System
;
630 static int hf_afp_dir_attribute_Mounted
;
631 static int hf_afp_dir_attribute_InExpFolder
;
632 static int hf_afp_dir_attribute_BackUpNeeded
;
633 static int hf_afp_dir_attribute_RenameInhibit
;
634 static int hf_afp_dir_attribute_DeleteInhibit
;
636 static int hf_afp_file_bitmap
;
637 static int hf_afp_file_bitmap_Attributes
;
638 static int hf_afp_file_bitmap_ParentDirID
;
639 static int hf_afp_file_bitmap_CreateDate
;
640 static int hf_afp_file_bitmap_ModDate
;
641 static int hf_afp_file_bitmap_BackupDate
;
642 static int hf_afp_file_bitmap_FinderInfo
;
643 static int hf_afp_file_bitmap_LongName
;
644 static int hf_afp_file_bitmap_ShortName
;
645 static int hf_afp_file_bitmap_NodeID
;
646 static int hf_afp_file_bitmap_DataForkLen
;
647 static int hf_afp_file_bitmap_RsrcForkLen
;
648 static int hf_afp_file_bitmap_ExtDataForkLen
;
649 static int hf_afp_file_bitmap_LaunchLimit
;
651 static int hf_afp_file_bitmap_UTF8Name
;
652 static int hf_afp_file_bitmap_ExtRsrcForkLen
;
653 static int hf_afp_file_bitmap_UnixPrivs
;
655 static int hf_afp_file_attribute
;
656 static int hf_afp_file_attribute_Invisible
;
657 static int hf_afp_file_attribute_MultiUser
;
658 static int hf_afp_file_attribute_System
;
659 static int hf_afp_file_attribute_DAlreadyOpen
;
660 static int hf_afp_file_attribute_RAlreadyOpen
;
661 static int hf_afp_file_attribute_WriteInhibit
;
662 static int hf_afp_file_attribute_BackUpNeeded
;
663 static int hf_afp_file_attribute_RenameInhibit
;
664 static int hf_afp_file_attribute_DeleteInhibit
;
665 static int hf_afp_file_attribute_CopyProtect
;
666 static int hf_afp_file_attribute_SetClear
;
668 static int hf_afp_map_name_type
;
669 static int hf_afp_map_name
;
670 static int hf_afp_map_id
;
671 static int hf_afp_map_id_type
;
672 static int hf_afp_map_id_reply_type
;
674 /* catsearch stuff */
675 static int hf_afp_request_bitmap
;
676 static int hf_afp_request_bitmap_Attributes
;
677 static int hf_afp_request_bitmap_ParentDirID
;
678 static int hf_afp_request_bitmap_CreateDate
;
679 static int hf_afp_request_bitmap_ModDate
;
680 static int hf_afp_request_bitmap_BackupDate
;
681 static int hf_afp_request_bitmap_FinderInfo
;
682 static int hf_afp_request_bitmap_LongName
;
683 static int hf_afp_request_bitmap_DataForkLen
;
684 static int hf_afp_request_bitmap_OffspringCount
;
685 static int hf_afp_request_bitmap_RsrcForkLen
;
686 static int hf_afp_request_bitmap_ExtDataForkLen
;
687 static int hf_afp_request_bitmap_UTF8Name
;
688 static int hf_afp_request_bitmap_ExtRsrcForkLen
;
689 static int hf_afp_request_bitmap_PartialNames
;
691 /* Spotlight stuff */
692 static int ett_afp_spotlight_queries
;
693 static int ett_afp_spotlight_query_line
;
694 static int ett_afp_spotlight_query
;
695 static int ett_afp_spotlight_data
;
696 static int ett_afp_spotlight_toc
;
698 static int hf_afp_spotlight_request_flags
;
699 static int hf_afp_spotlight_request_command
;
700 static int hf_afp_spotlight_request_reserved
;
701 static int hf_afp_spotlight_reply_reserved
;
702 static int hf_afp_spotlight_volpath_server
;
703 static int hf_afp_spotlight_volpath_client
;
704 static int hf_afp_spotlight_returncode
;
705 static int hf_afp_spotlight_volflags
;
706 static int hf_afp_spotlight_reqlen
;
707 static int hf_afp_spotlight_uuid
;
708 static int hf_afp_spotlight_date
;
710 /* Status stuff from ASP or DSI */
711 static int ett_afp_status
;
712 static int ett_afp_uams
;
713 static int ett_afp_vers
;
714 static int ett_afp_server_addr
;
715 static int ett_afp_server_addr_line
;
716 static int ett_afp_directory
;
717 static int ett_afp_utf8_name
;
718 static int ett_afp_status_server_flag
;
720 static const value_string flag_vals
[] = {
725 static const value_string path_type_vals
[] = {
728 {3, "Unicode names" },
731 static const value_string map_name_type_vals
[] = {
732 {1, "Unicode user name to a user ID" },
733 {2, "Unicode group name to a group ID" },
734 {3, "Macintosh roman user name to a user ID" },
735 {4, "Macintosh roman group name to a group ID" },
736 {5, "Unicode user name to a user UUID" },
737 {6, "Unicode group name to a group UUID" },
739 static value_string_ext map_name_type_vals_ext
= VALUE_STRING_EXT_INIT(map_name_type_vals
);
741 static const value_string map_id_type_vals
[] = {
742 {1, "User ID to a Macintosh roman user name" },
743 {2, "Group ID to a Macintosh roman group name" },
744 {3, "User ID to a unicode user name" },
745 {4, "Group ID to a unicode group name" },
746 {5, "User UUID to a unicode user name" },
747 {6, "Group UUID to a unicode group name" },
749 static value_string_ext map_id_type_vals_ext
= VALUE_STRING_EXT_INIT(map_id_type_vals
);
751 /* map_id subfunctions 5,6: reply type */
752 static const value_string map_id_reply_type_vals
[] = {
758 volume attribute from Apple AFP3.0.pdf
761 #define kReadOnly (1U << 0)
762 #define kHasVolumePassword (1U << 1)
763 #define kSupportsFileIDs (1U << 2)
764 #define kSupportsCatSearch (1U << 3)
765 #define kSupportsBlankAccessPrivs (1U << 4)
766 #define kSupportsUnixPrivs (1U << 5)
767 #define kSupportsUTF8Names (1U << 6)
769 #define kNoNetworkUserIDs (1U << 7)
771 #define kDefaultPrivsFromParent (1U << 8)
772 #define kNoExchangeFiles (1U << 9)
773 #define kSupportsExtAttrs (1U << 10)
774 #define kSupportsACLs (1U << 11)
776 #define kCaseSensitive (1U << 12)
777 #define kSupportsTMLockSteal (1U << 13)
780 directory bitmap from Apple AFP3.1.pdf
783 #define kFPAttributeBit (1U << 0)
784 #define kFPParentDirIDBit (1U << 1)
785 #define kFPCreateDateBit (1U << 2)
786 #define kFPModDateBit (1U << 3)
787 #define kFPBackupDateBit (1U << 4)
788 #define kFPFinderInfoBit (1U << 5)
789 #define kFPLongNameBit (1U << 6)
790 #define kFPShortNameBit (1U << 7)
791 #define kFPNodeIDBit (1U << 8)
792 #define kFPOffspringCountBit (1U << 9)
793 #define kFPOwnerIDBit (1U << 10)
794 #define kFPGroupIDBit (1U << 11)
795 #define kFPAccessRightsBit (1U << 12)
796 #define kFPUTF8NameBit (1U << 13)
798 /* FIXME AFP3.0 bit 14, AFP3.1 bit 15 */
800 #define kFPUnixPrivsBit (1U << 15)
803 directory Access Rights parameter AFP3.1.pdf
807 #define AR_O_SEARCH (1U << 0) /* owner has search access */
808 #define AR_O_READ (1U << 1) /* owner has read access */
809 #define AR_O_WRITE (1U << 2) /* owner has write access */
811 #define AR_G_SEARCH (1U << 8) /* group has search access */
812 #define AR_G_READ (1U << 9) /* group has read access */
813 #define AR_G_WRITE (1U << 10) /* group has write access */
815 #define AR_E_SEARCH (1U << 16) /* everyone has search access */
816 #define AR_E_READ (1U << 17) /* everyone has read access */
817 #define AR_E_WRITE (1U << 18) /* everyone has write access */
819 #define AR_U_SEARCH (1U << 24) /* user has search access */
820 #define AR_U_READ (1U << 25) /* user has read access */
821 #define AR_U_WRITE (1U << 26) /* user has write access */
823 #define AR_BLANK (1U << 28) /* Blank Access Privileges (use parent dir privileges) */
824 #define AR_U_OWN (1U << 31) /* user is the owner */
826 static int hf_afp_dir_ar
;
827 static int hf_afp_dir_ar_o_search
;
828 static int hf_afp_dir_ar_o_read
;
829 static int hf_afp_dir_ar_o_write
;
830 static int hf_afp_dir_ar_g_search
;
831 static int hf_afp_dir_ar_g_read
;
832 static int hf_afp_dir_ar_g_write
;
833 static int hf_afp_dir_ar_e_search
;
834 static int hf_afp_dir_ar_e_read
;
835 static int hf_afp_dir_ar_e_write
;
836 static int hf_afp_dir_ar_u_search
;
837 static int hf_afp_dir_ar_u_read
;
838 static int hf_afp_dir_ar_u_write
;
839 static int hf_afp_dir_ar_blank
;
840 static int hf_afp_dir_ar_u_own
;
842 static int hf_afp_user_flag
;
843 static int hf_afp_user_ID
;
844 static int hf_afp_group_ID
;
845 static int hf_afp_UUID
;
846 static int hf_afp_GRPUUID
;
847 static int hf_afp_user_bitmap
;
848 static int hf_afp_user_bitmap_UID
;
849 static int hf_afp_user_bitmap_GID
;
850 static int hf_afp_user_bitmap_UUID
;
852 static int ett_afp_user_bitmap
;
854 static const value_string user_flag_vals
[] = {
856 {1, "Default user" },
859 static int hf_afp_message
;
860 static int hf_afp_message_type
;
861 static int hf_afp_message_bitmap
;
862 static int hf_afp_message_bitmap_REQ
;
863 static int hf_afp_message_bitmap_UTF
;
864 static int hf_afp_message_len
;
866 static int ett_afp_message_bitmap
;
868 static const value_string server_message_type
[] = {
869 {0, "Login message" },
870 {1, "Server message" },
874 file bitmap AFP3.1.pdf
877 kFPAttributeBit (bit 0)
878 kFPParentDirIDBit (bit 1)
879 kFPCreateDateBit (bit 2)
880 kFPModDateBit (bit 3)
881 kFPBackupDateBit (bit 4)
882 kFPFinderInfoBit (bit 5)
883 kFPLongNameBit (bit 6)
884 kFPShortNameBit (bit 7)
887 kFPUTF8NameBit (bit 13)
890 #define kFPDataForkLenBit (1U << 9)
891 #define kFPRsrcForkLenBit (1U << 10)
892 #define kFPExtDataForkLenBit (1U << 11)
893 #define kFPLaunchLimitBit (1U << 12)
895 #define kFPExtRsrcForkLenBit (1U << 14)
898 file attribute AFP3.1.pdf
901 #define kFPInvisibleBit (1U << 0)
902 #define kFPMultiUserBit (1U << 1)
903 #define kFPSystemBit (1U << 2)
904 #define kFPDAlreadyOpenBit (1U << 3)
905 #define kFPRAlreadyOpenBit (1U << 4)
906 #define kFPWriteInhibitBit (1U << 5)
907 #define kFPBackUpNeededBit (1U << 6)
908 #define kFPRenameInhibitBit (1U << 7)
909 #define kFPDeleteInhibitBit (1U << 8)
910 #define kFPCopyProtectBit (1U << 10)
911 #define kFPSetClearBit (1U << 15)
914 #define kIsExpFolder (1U << 1)
915 #define kMounted (1U << 3)
916 #define kInExpFolder (1U << 4)
918 /* AFP 3.1 getsession token type */
919 #define kLoginWithoutID 0
920 #define kLoginWithID 1
921 #define kReconnWithID 2
922 #define kLoginWithTimeAndID 3
923 #define kReconnWithTimeAndID 4
925 /* modified AFP 3.1 token type cf. page 327 */
926 #define kRecon1Login 5
927 #define kRecon1ReconnectLogin 6
928 #define kRecon1Refresh 7
929 #define kGetKerberosSessionKey 8
931 static const value_string token_type_vals
[] = {
932 {kLoginWithoutID
, "LoginWithoutID"},
933 {kLoginWithID
, "LoginWithID"},
934 {kReconnWithID
, "ReconnWithID"},
935 {kLoginWithTimeAndID
, "LoginWithTimeAndID"},
936 {kReconnWithTimeAndID
, "ReconnWithTimeAndID"},
937 {kRecon1Login
, "Recon1Login"},
938 {kRecon1ReconnectLogin
, "Recon1ReconnectLogin"},
939 {kRecon1Refresh
, "Recon1Refresh"},
940 {kGetKerberosSessionKey
, "GetKerberosSessionKey"},
943 static value_string_ext token_type_vals_ext
= VALUE_STRING_EXT_INIT(token_type_vals
);
945 /* AFP 3.2 ACL bitmap */
946 #define kFileSec_UUID (1U << 0)
947 #define kFileSec_GRPUUID (1U << 1)
948 #define kFileSec_ACL (1U << 2)
949 #define kFileSec_REMOVEACL (1U << 3)
950 #define kFileSec_Inherit (1U << 4)
952 static int hf_afp_acl_list_bitmap
;
953 static int hf_afp_acl_list_bitmap_UUID
;
954 static int hf_afp_acl_list_bitmap_GRPUUID
;
955 static int hf_afp_acl_list_bitmap_ACL
;
956 static int hf_afp_acl_list_bitmap_REMOVEACL
;
957 static int hf_afp_acl_list_bitmap_Inherit
;
958 static int ett_afp_acl_list_bitmap
;
960 static int hf_afp_access_bitmap
;
962 static int hf_afp_acl_entrycount
;
963 static int hf_afp_acl_flags
;
965 static int hf_afp_ace_flags
;
967 static int ett_afp_ace_flags
;
968 static int hf_afp_ace_flags_allow
;
969 static int hf_afp_ace_flags_deny
;
970 static int hf_afp_ace_flags_inherited
;
971 static int hf_afp_ace_flags_fileinherit
;
972 static int hf_afp_ace_flags_dirinherit
;
973 static int hf_afp_ace_flags_limitinherit
;
974 static int hf_afp_ace_flags_onlyinherit
;
976 /* AFP 3.2 ACE flags */
977 #define ACE_ALLOW (1U << 0)
978 #define ACE_DENY (1U << 1)
979 #define ACE_INHERITED (1U << 4)
980 #define ACE_FILE_INHERIT (1U << 5)
981 #define ACE_DIR_INHERIT (1U << 6)
982 #define ACE_LIMIT_INHERIT (1U << 7)
983 #define ACE_ONLY_INHERIT (1U << 8)
985 static int ett_afp_ace_entries
;
986 static int ett_afp_ace_entry
;
988 /* AFP 3.2 ACL access right cf page 248*/
989 #define KAUTH_VNODE_READ_DATA (1U << 1)
990 #define KAUTH_VNODE_LIST_DIRECTORY KAUTH_VNODE_READ_DATA
991 #define KAUTH_VNODE_WRITE_DATA (1U << 2)
992 #define KAUTH_VNODE_ADD_FILE KAUTH_VNODE_WRITE_DATA
993 #define KAUTH_VNODE_EXECUTE (1U << 3)
994 #define KAUTH_VNODE_SEARCH KAUTH_VNODE_EXECUTE
995 #define KAUTH_VNODE_DELETE (1U << 4)
996 #define KAUTH_VNODE_APPEND_DATA (1U << 5)
997 #define KAUTH_VNODE_ADD_SUBDIRECTORY KAUTH_VNODE_APPEND_DATA
998 #define KAUTH_VNODE_DELETE_CHILD (1U << 6)
999 #define KAUTH_VNODE_READ_ATTRIBUTES (1U << 7)
1000 #define KAUTH_VNODE_WRITE_ATTRIBUTES (1U << 8)
1001 #define KAUTH_VNODE_READ_EXTATTRIBUTES (1U << 9)
1002 #define KAUTH_VNODE_WRITE_EXTATTRIBUTES (1U << 10)
1003 #define KAUTH_VNODE_READ_SECURITY (1U << 11)
1004 #define KAUTH_VNODE_WRITE_SECURITY (1U << 12)
1005 #define KAUTH_VNODE_CHANGE_OWNER (1U << 13)
1006 #define KAUTH_VNODE_SYNCHRONIZE (1U << 20)
1007 #define KAUTH_VNODE_GENERIC_ALL (1U << 21)
1008 #define KAUTH_VNODE_GENERIC_EXECUTE (1U << 22)
1009 #define KAUTH_VNODE_GENERIC_WRITE (1U << 23)
1010 #define KAUTH_VNODE_GENERIC_READ (1U << 24)
1013 static int hf_afp_acl_access_bitmap
;
1014 static int ett_afp_acl_access_bitmap
;
1015 static int hf_afp_acl_access_bitmap_read_data
;
1016 static int hf_afp_acl_access_bitmap_write_data
;
1017 static int hf_afp_acl_access_bitmap_execute
;
1018 static int hf_afp_acl_access_bitmap_delete
;
1019 static int hf_afp_acl_access_bitmap_append_data
;
1020 static int hf_afp_acl_access_bitmap_delete_child
;
1021 static int hf_afp_acl_access_bitmap_read_attrs
;
1022 static int hf_afp_acl_access_bitmap_write_attrs
;
1023 static int hf_afp_acl_access_bitmap_read_extattrs
;
1024 static int hf_afp_acl_access_bitmap_write_extattrs
;
1025 static int hf_afp_acl_access_bitmap_read_security
;
1026 static int hf_afp_acl_access_bitmap_write_security
;
1027 static int hf_afp_acl_access_bitmap_change_owner
;
1028 static int hf_afp_acl_access_bitmap_synchronize
;
1029 static int hf_afp_acl_access_bitmap_generic_all
;
1030 static int hf_afp_acl_access_bitmap_generic_execute
;
1031 static int hf_afp_acl_access_bitmap_generic_write
;
1032 static int hf_afp_acl_access_bitmap_generic_read
;
1034 /* Status stuff from ASP or DSI */
1035 static int hf_afp_server_name
;
1036 static int hf_afp_utf8_server_name_len
;
1037 static int hf_afp_utf8_server_name
;
1038 static int hf_afp_server_type
;
1039 static int hf_afp_server_vers
;
1040 static int hf_afp_server_uams
;
1041 static int hf_afp_server_icon
;
1042 static int hf_afp_server_directory
;
1044 static int hf_afp_server_flag
;
1045 static int hf_afp_server_flag_copyfile
;
1046 static int hf_afp_server_flag_passwd
;
1047 static int hf_afp_server_flag_no_save_passwd
;
1048 static int hf_afp_server_flag_srv_msg
;
1049 static int hf_afp_server_flag_srv_sig
;
1050 static int hf_afp_server_flag_tcpip
;
1051 static int hf_afp_server_flag_notify
;
1052 static int hf_afp_server_flag_reconnect
;
1053 static int hf_afp_server_flag_directory
;
1054 static int hf_afp_server_flag_utf8_name
;
1055 static int hf_afp_server_flag_uuid
;
1056 static int hf_afp_server_flag_ext_sleep
;
1057 static int hf_afp_server_flag_fast_copy
;
1058 static int hf_afp_server_signature
;
1060 static int hf_afp_server_addr_len
;
1061 static int hf_afp_server_addr_type
;
1062 static int hf_afp_server_addr_value
;
1064 /* Generated from convert_proto_tree_add_text.pl */
1065 static int hf_afp_int64
;
1066 static int hf_afp_float
;
1067 static int hf_afp_unknown16
;
1068 static int hf_afp_unknown32
;
1069 static int hf_afp_cnid
;
1070 static int hf_afp_null
;
1071 static int hf_afp_string
;
1072 static int hf_afp_utf_16_string
;
1073 static int hf_afp_bool
;
1074 static int hf_afp_query_type
;
1075 static int hf_afp_toc_offset
;
1076 static int hf_afp_toc_entry
;
1077 static int hf_afp_endianness
;
1078 static int hf_afp_query_len
;
1079 static int hf_afp_num_toc_entries
;
1080 static int hf_afp_machine_offset
;
1081 static int hf_afp_version_offset
;
1082 static int hf_afp_uams_offset
;
1083 static int hf_afp_icon_offset
;
1084 static int hf_afp_signature_offset
;
1085 static int hf_afp_network_address_offset
;
1086 static int hf_afp_directory_services_offset
;
1087 static int hf_afp_utf8_server_name_offset
;
1089 static const value_string afp_server_addr_type_vals
[] = {
1091 {2, "IP+port address" },
1092 {3, "DDP address" },
1094 {5, "IP+port ssh tunnel" },
1095 {6, "IP6 address" },
1096 {7, "IP6+port address" },
1098 value_string_ext afp_server_addr_type_vals_ext
= VALUE_STRING_EXT_INIT(afp_server_addr_type_vals
);
1100 #define AFP_NUM_PROCEDURES 256
1103 afpstat_init(struct register_srt
* srt _U_
, GArray
* srt_array
)
1105 srt_stat_table
*afp_srt_table
;
1108 afp_srt_table
= init_srt_table("AFP Commands", NULL
, srt_array
, AFP_NUM_PROCEDURES
, NULL
, "afp.command", NULL
);
1109 for (i
= 0; i
< AFP_NUM_PROCEDURES
; i
++)
1111 char* tmp_str
= val_to_str_ext_wmem(NULL
, i
, &CommandCode_vals_ext
, "Unknown(%u)");
1112 init_srt_table_row(afp_srt_table
, i
, tmp_str
);
1113 wmem_free(NULL
, tmp_str
);
1117 static tap_packet_status
1118 afpstat_packet(void *pss
, packet_info
*pinfo
, epan_dissect_t
*edt _U_
, const void *prv
, tap_flags_t flags _U_
)
1121 srt_stat_table
*afp_srt_table
;
1122 srt_data_t
*data
= (srt_data_t
*)pss
;
1123 const afp_request_val
*request_val
= (const afp_request_val
*)prv
;
1125 /* if we haven't seen the request, just ignore it */
1127 return TAP_PACKET_DONT_REDRAW
;
1130 afp_srt_table
= g_array_index(data
->srt_array
, srt_stat_table
*, i
);
1132 add_srt_table_data(afp_srt_table
, request_val
->command
, &request_val
->req_time
, pinfo
);
1134 return TAP_PACKET_REDRAW
;
1139 #define hash_init_count 20
1141 /* Forward declarations */
1143 /* Hash functions */
1144 static int afp_equal (const void *v
, const void *v2
);
1145 static unsigned afp_hash (const void *v
);
1148 uint32_t conversation
;
1152 static wmem_map_t
*afp_request_hash
;
1154 static unsigned Vol
; /* volume */
1155 static unsigned Did
; /* parent directory ID */
1158 * Returns the UTF-16 byte order, as an ENC_xxx_ENDIAN value,
1159 * by checking the 2-byte byte order mark.
1160 * If there is no byte order mark, 0xFFFFFFFF is returned.
1163 spotlight_get_utf16_string_byte_order(tvbuff_t
*tvb
, int offset
, int query_length
, unsigned encoding
) {
1164 unsigned byte_order
;
1166 /* check for byte order mark */
1167 byte_order
= 0xFFFFFFFF;
1168 if (query_length
>= 2) {
1169 uint16_t byte_order_mark
;
1170 byte_order_mark
= tvb_get_uint16(tvb
, offset
, encoding
);
1172 if (byte_order_mark
== 0xFFFE) {
1173 byte_order
= ENC_BIG_ENDIAN
;
1175 else if (byte_order_mark
== 0xFEFF) {
1176 byte_order
= ENC_LITTLE_ENDIAN
;
1183 /* Hash Functions */
1184 static int afp_equal (const void *v
, const void *v2
)
1186 const afp_request_key
*val1
= (const afp_request_key
*)v
;
1187 const afp_request_key
*val2
= (const afp_request_key
*)v2
;
1189 if (val1
->conversation
== val2
->conversation
&&
1190 val1
->tid
== val2
->tid
) {
1196 static unsigned afp_hash (const void *v
)
1198 const afp_request_key
*afp_key
= (const afp_request_key
*)v
;
1199 return afp_key
->tid
;
1202 /* --------------------------
1204 #define PAD(x) { proto_tree_add_item(tree, hf_afp_pad, tvb, offset, x, ENC_NA); offset += x; }
1207 decode_vol_bitmap (proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
1210 static int * const bitmaps
[] = {
1211 &hf_afp_vol_bitmap_Attributes
,
1212 &hf_afp_vol_bitmap_Signature
,
1213 &hf_afp_vol_bitmap_CreateDate
,
1214 &hf_afp_vol_bitmap_ModDate
,
1215 &hf_afp_vol_bitmap_BackupDate
,
1216 &hf_afp_vol_bitmap_ID
,
1217 &hf_afp_vol_bitmap_BytesFree
,
1218 &hf_afp_vol_bitmap_BytesTotal
,
1219 &hf_afp_vol_bitmap_Name
,
1220 &hf_afp_vol_bitmap_ExtBytesFree
,
1221 &hf_afp_vol_bitmap_ExtBytesTotal
,
1222 &hf_afp_vol_bitmap_BlockSize
,
1226 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_vol_bitmap
,
1227 ett_afp_vol_bitmap
, bitmaps
, ENC_BIG_ENDIAN
);
1228 bitmap
= tvb_get_ntohs(tvb
, offset
);
1233 /* -------------------------- */
1235 decode_vol_attribute (proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
1238 static int * const bitmaps
[] = {
1239 &hf_afp_vol_attribute_ReadOnly
,
1240 &hf_afp_vol_attribute_HasVolumePassword
,
1241 &hf_afp_vol_attribute_SupportsFileIDs
,
1242 &hf_afp_vol_attribute_SupportsCatSearch
,
1243 &hf_afp_vol_attribute_SupportsBlankAccessPrivs
,
1244 &hf_afp_vol_attribute_SupportsUnixPrivs
,
1245 &hf_afp_vol_attribute_SupportsUTF8Names
,
1246 &hf_afp_vol_attribute_NoNetworkUserID
,
1247 &hf_afp_vol_attribute_DefaultPrivsFromParent
,
1248 &hf_afp_vol_attribute_NoExchangeFiles
,
1249 &hf_afp_vol_attribute_SupportsExtAttrs
,
1250 &hf_afp_vol_attribute_SupportsACLs
,
1251 &hf_afp_vol_attribute_CaseSensitive
,
1252 &hf_afp_vol_attribute_SupportsTMLockSteal
,
1256 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_vol_attribute
,
1257 ett_afp_vol_attribute
, bitmaps
, ENC_BIG_ENDIAN
);
1258 bitmap
= tvb_get_ntohs(tvb
, offset
);
1263 /* --------------------------
1264 cf AFP3.0.pdf page 38
1265 date are number of seconds from 12:00am on 01.01.2000 GMT
1266 backup : 0x8000000 not set
1267 from netatalk adouble.h
1269 #define DATE_NOT_SET 0x80000000
1270 #define AD_DATE_DELTA 946684800
1271 #define AD_DATE_TO_UNIX(x) (x + AD_DATE_DELTA)
1273 print_date(proto_tree
*tree
,int id
, tvbuff_t
*tvb
, int offset
)
1275 time_t date
= tvb_get_ntohl(tvb
, offset
);
1278 tv
.secs
= AD_DATE_TO_UNIX(date
);
1280 proto_tree_add_time(tree
, id
, tvb
, offset
, 4, &tv
);
1283 /* -------------------------- */
1285 parse_vol_bitmap (proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, uint16_t bitmap
)
1287 uint16_t nameoff
= 0;
1289 if ((bitmap
& kFPVolAttributeBit
)) {
1290 decode_vol_attribute(tree
,tvb
,offset
);
1293 if ((bitmap
& kFPVolSignatureBit
)) {
1294 proto_tree_add_item(tree
, hf_afp_vol_signature
,tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1297 if ((bitmap
& kFPVolCreateDateBit
)) {
1298 print_date(tree
, hf_afp_vol_creation_date
,tvb
, offset
);
1301 if ((bitmap
& kFPVolModDateBit
)) {
1302 print_date(tree
, hf_afp_vol_modification_date
,tvb
, offset
);
1305 if ((bitmap
& kFPVolBackupDateBit
)) {
1306 print_date(tree
, hf_afp_vol_backup_date
,tvb
, offset
);
1309 if ((bitmap
& kFPVolIDBit
)) {
1310 proto_tree_add_item(tree
, hf_afp_vol_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1313 if ((bitmap
& kFPVolBytesFreeBit
)) {
1314 proto_tree_add_item(tree
, hf_afp_vol_bytes_free
,tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1317 if ((bitmap
& kFPVolBytesTotalBit
)) {
1318 proto_tree_add_item(tree
, hf_afp_vol_bytes_total
,tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1321 if ((bitmap
& kFPVolNameBit
)) {
1322 nameoff
= tvb_get_ntohs(tvb
, offset
);
1323 proto_tree_add_item(tree
, hf_afp_vol_name_offset
,tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1326 if ((bitmap
& kFPVolExtBytesFreeBit
)) {
1327 proto_tree_add_item(tree
, hf_afp_vol_ex_bytes_free
,tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1330 if ((bitmap
& kFPVolExtBytesTotalBit
)) {
1331 proto_tree_add_item(tree
, hf_afp_vol_ex_bytes_total
,tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1334 if ((bitmap
& kFPVolBlockSizeBit
)) {
1335 proto_tree_add_item(tree
, hf_afp_vol_block_size
,tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1341 len
= tvb_get_uint8(tvb
, offset
);
1342 proto_tree_add_item(tree
, hf_afp_vol_name
, tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
);
1349 /* -------------------------- */
1351 decode_file_bitmap (proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
1354 static int * const bitmaps
[] = {
1355 &hf_afp_file_bitmap_Attributes
,
1356 &hf_afp_file_bitmap_ParentDirID
,
1357 &hf_afp_file_bitmap_CreateDate
,
1358 &hf_afp_file_bitmap_ModDate
,
1359 &hf_afp_file_bitmap_BackupDate
,
1360 &hf_afp_file_bitmap_FinderInfo
,
1361 &hf_afp_file_bitmap_LongName
,
1362 &hf_afp_file_bitmap_ShortName
,
1363 &hf_afp_file_bitmap_NodeID
,
1364 &hf_afp_file_bitmap_DataForkLen
,
1365 &hf_afp_file_bitmap_RsrcForkLen
,
1366 &hf_afp_file_bitmap_ExtDataForkLen
,
1367 &hf_afp_file_bitmap_LaunchLimit
,
1368 &hf_afp_file_bitmap_UTF8Name
,
1369 &hf_afp_file_bitmap_ExtRsrcForkLen
,
1370 &hf_afp_file_bitmap_UnixPrivs
,
1374 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_file_bitmap
,
1375 ett_afp_file_bitmap
, bitmaps
, ENC_BIG_ENDIAN
);
1376 bitmap
= tvb_get_ntohs(tvb
, offset
);
1381 /* -------------------------- */
1383 decode_file_attribute(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, int shared
)
1386 static int * const not_shared_attr
[] = {
1387 &hf_afp_file_attribute_Invisible
,
1388 &hf_afp_file_attribute_MultiUser
,
1389 &hf_afp_file_attribute_System
,
1390 &hf_afp_file_attribute_DAlreadyOpen
,
1391 &hf_afp_file_attribute_RAlreadyOpen
,
1392 /* writeinhibit is file only but Macs are setting it with FPSetFileDirParms too */
1393 &hf_afp_file_attribute_WriteInhibit
,
1394 &hf_afp_file_attribute_BackUpNeeded
,
1395 &hf_afp_file_attribute_RenameInhibit
,
1396 &hf_afp_file_attribute_DeleteInhibit
,
1397 &hf_afp_file_attribute_CopyProtect
,
1398 &hf_afp_file_attribute_SetClear
,
1402 static int * const shared_attr
[] = {
1403 &hf_afp_file_attribute_Invisible
,
1404 &hf_afp_file_attribute_System
,
1405 &hf_afp_file_attribute_WriteInhibit
,
1406 &hf_afp_file_attribute_BackUpNeeded
,
1407 &hf_afp_file_attribute_RenameInhibit
,
1408 &hf_afp_file_attribute_DeleteInhibit
,
1409 &hf_afp_file_attribute_SetClear
,
1415 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_file_attribute
,
1416 ett_afp_file_attribute
, not_shared_attr
, ENC_BIG_ENDIAN
);
1420 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_file_attribute
,
1421 ett_afp_file_attribute
, shared_attr
, ENC_BIG_ENDIAN
);
1424 attribute
= tvb_get_ntohs(tvb
, offset
);
1429 decode_access_rights (proto_tree
*tree
, tvbuff_t
*tvb
, int hf
, int offset
)
1431 static int * const rights
[] = {
1432 &hf_afp_dir_ar_o_search
,
1433 &hf_afp_dir_ar_o_read
,
1434 &hf_afp_dir_ar_o_write
,
1435 &hf_afp_dir_ar_g_search
,
1436 &hf_afp_dir_ar_g_read
,
1437 &hf_afp_dir_ar_g_write
,
1438 &hf_afp_dir_ar_e_search
,
1439 &hf_afp_dir_ar_e_read
,
1440 &hf_afp_dir_ar_e_write
,
1441 &hf_afp_dir_ar_u_search
,
1442 &hf_afp_dir_ar_u_read
,
1443 &hf_afp_dir_ar_u_write
,
1444 &hf_afp_dir_ar_blank
,
1445 &hf_afp_dir_ar_u_own
,
1449 proto_tree_add_bitmask(tree
, tvb
, offset
, hf
,
1450 ett_afp_dir_ar
, rights
, ENC_BIG_ENDIAN
);
1454 decode_unix_privs (proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
1456 proto_tree
*sub_tree
;
1459 sub_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, 16, ett_afp_unix_privs
, NULL
,
1462 proto_tree_add_item(sub_tree
, hf_afp_unix_privs_uid
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1463 proto_tree_add_item(sub_tree
, hf_afp_unix_privs_gid
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
1464 proto_tree_add_item(sub_tree
, hf_afp_unix_privs_permissions
, tvb
, offset
+8, 4, ENC_BIG_ENDIAN
);
1465 decode_access_rights(sub_tree
, tvb
, hf_afp_unix_privs_ua_permissions
, offset
+12);
1469 /* -------------------------- */
1471 parse_long_filename(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, int org_offset
)
1477 lnameoff
= tvb_get_ntohs(tvb
, offset
);
1478 proto_tree_add_item(tree
, hf_afp_long_name_offset
,tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1480 tp_ofs
= lnameoff
+org_offset
;
1481 len
= tvb_get_uint8(tvb
, tp_ofs
);
1482 proto_tree_add_item(tree
, hf_afp_path_len
, tvb
, tp_ofs
, 1, ENC_BIG_ENDIAN
);
1484 proto_tree_add_item(tree
, hf_afp_path_name
, tvb
, tp_ofs
, len
, ENC_UTF_8
);
1490 /* -------------------------- */
1492 parse_UTF8_filename(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, int org_offset
)
1498 unameoff
= tvb_get_ntohs(tvb
, offset
);
1499 proto_tree_add_item(tree
, hf_afp_unicode_name_offset
,tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1502 /* FIXME AFP3.x reuses PDINFO bit for UTF8.
1503 * In enumerate_ext it's pad with 4 bytes, PDINFO was 6 bytes,
1504 * but not in catsearch_ext.
1505 * Last but not least there's a bug in OSX catsearch_ext for spec2
1506 * offset is off by 2 bytes.
1509 tp_ofs
= unameoff
+org_offset
;
1510 if (tp_ofs
> offset
) {
1513 else if (tp_ofs
< offset
) {
1516 proto_tree_add_item( tree
, hf_afp_path_unicode_hint
, tvb
, tp_ofs
, 4, ENC_BIG_ENDIAN
);
1519 len
= tvb_get_ntohs(tvb
, tp_ofs
);
1520 proto_tree_add_item( tree
, hf_afp_path_unicode_len
, tvb
, tp_ofs
, 2, ENC_BIG_ENDIAN
);
1523 proto_tree_add_item(tree
, hf_afp_path_name
, tvb
, tp_ofs
, len
, ENC_UTF_8
);
1529 /* -------------------------- */
1531 parse_file_bitmap (proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, uint16_t bitmap
, int shared
)
1533 /* uint16_t snameoff = 0; */
1536 int org_offset
= offset
;
1538 if ((bitmap
& kFPAttributeBit
)) {
1539 decode_file_attribute(tree
, tvb
, offset
, shared
);
1542 if ((bitmap
& kFPParentDirIDBit
)) {
1543 proto_tree_add_item(tree
, hf_afp_did
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1546 if ((bitmap
& kFPCreateDateBit
)) {
1547 print_date(tree
, hf_afp_creation_date
,tvb
, offset
);
1550 if ((bitmap
& kFPModDateBit
)) {
1551 print_date(tree
, hf_afp_modification_date
,tvb
, offset
);
1554 if ((bitmap
& kFPBackupDateBit
)) {
1555 print_date(tree
, hf_afp_backup_date
,tvb
, offset
);
1558 if ((bitmap
& kFPFinderInfoBit
)) {
1559 proto_tree_add_item(tree
, hf_afp_finder_info
,tvb
, offset
, 32, ENC_NA
);
1562 if ((bitmap
& kFPLongNameBit
)) {
1565 tp_ofs
= parse_long_filename(tree
, tvb
, offset
, org_offset
);
1566 max_offset
= (tp_ofs
>max_offset
)?tp_ofs
:max_offset
;
1571 if ((bitmap
& kFPShortNameBit
)) {
1572 /* snameoff = tvb_get_ntohs(tvb, offset); */
1573 proto_tree_add_item(tree
, hf_afp_short_name_offset
,tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1576 if ((bitmap
& kFPNodeIDBit
)) {
1577 proto_tree_add_item(tree
, hf_afp_file_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1581 if ((bitmap
& kFPDataForkLenBit
)) {
1582 proto_tree_add_item(tree
, hf_afp_file_DataForkLen
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1586 if ((bitmap
& kFPRsrcForkLenBit
)) {
1587 proto_tree_add_item(tree
, hf_afp_file_RsrcForkLen
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1591 if ((bitmap
& kFPExtDataForkLenBit
)) {
1592 proto_tree_add_item(tree
, hf_afp_file_ExtDataForkLen
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1596 if ((bitmap
& kFPLaunchLimitBit
)) {
1597 offset
+= 2; /* ? */
1600 if ((bitmap
& kFPUTF8NameBit
)) {
1603 tp_ofs
= parse_UTF8_filename(tree
, tvb
, offset
, org_offset
);
1604 max_offset
= (tp_ofs
>max_offset
)?tp_ofs
:max_offset
;
1608 if ((bitmap
& kFPExtRsrcForkLenBit
)) {
1609 proto_tree_add_item(tree
, hf_afp_file_ExtRsrcForkLen
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1613 if ((bitmap
& kFPUnixPrivsBit
)) {
1615 * XXX - the AFP 3.0 spec says this is "Four bytes", but
1616 * also says the privileges are "stored in an FPUnixPrivs
1617 * structure", which is 16 bytes long.
1619 * We assume, for now, that the latter is true.
1621 decode_unix_privs(tree
, tvb
, offset
);
1625 return (max_offset
)?max_offset
:offset
;
1628 /* -------------------------- */
1630 decode_dir_bitmap (proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
1633 static int * const bitmaps
[] = {
1634 &hf_afp_dir_bitmap_Attributes
,
1635 &hf_afp_dir_bitmap_ParentDirID
,
1636 &hf_afp_dir_bitmap_CreateDate
,
1637 &hf_afp_dir_bitmap_ModDate
,
1638 &hf_afp_dir_bitmap_BackupDate
,
1639 &hf_afp_dir_bitmap_FinderInfo
,
1640 &hf_afp_dir_bitmap_LongName
,
1641 &hf_afp_dir_bitmap_ShortName
,
1642 &hf_afp_dir_bitmap_NodeID
,
1643 &hf_afp_dir_bitmap_OffspringCount
,
1644 &hf_afp_dir_bitmap_OwnerID
,
1645 &hf_afp_dir_bitmap_GroupID
,
1646 &hf_afp_dir_bitmap_AccessRights
,
1647 &hf_afp_dir_bitmap_UTF8Name
,
1648 &hf_afp_dir_bitmap_UnixPrivs
,
1652 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_dir_bitmap
,
1653 ett_afp_dir_bitmap
, bitmaps
, ENC_BIG_ENDIAN
);
1654 bitmap
= tvb_get_ntohs(tvb
, offset
);
1659 /* -------------------------- */
1661 decode_dir_attribute(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
1664 static int * const attributes
[] = {
1665 &hf_afp_dir_attribute_Invisible
,
1666 &hf_afp_dir_attribute_IsExpFolder
,
1667 &hf_afp_dir_attribute_System
,
1668 &hf_afp_dir_attribute_Mounted
,
1669 &hf_afp_dir_attribute_InExpFolder
,
1670 &hf_afp_dir_attribute_BackUpNeeded
,
1671 &hf_afp_dir_attribute_RenameInhibit
,
1672 &hf_afp_dir_attribute_DeleteInhibit
,
1676 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_dir_attribute
,
1677 ett_afp_dir_attribute
, attributes
, ENC_BIG_ENDIAN
);
1678 attribute
= tvb_get_ntohs(tvb
, offset
);
1683 /* -------------------------- */
1685 parse_dir_bitmap (proto_tree
*tree
, tvbuff_t
*tvb
, int offset
, uint16_t bitmap
)
1687 /* uint16_t snameoff = 0; */
1690 int org_offset
= offset
;
1692 if ((bitmap
& kFPAttributeBit
)) {
1693 decode_dir_attribute(tree
, tvb
, offset
);
1696 if ((bitmap
& kFPParentDirIDBit
)) {
1697 proto_tree_add_item(tree
, hf_afp_did
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1700 if ((bitmap
& kFPCreateDateBit
)) {
1701 print_date(tree
, hf_afp_creation_date
,tvb
, offset
);
1704 if ((bitmap
& kFPModDateBit
)) {
1705 print_date(tree
, hf_afp_modification_date
,tvb
, offset
);
1708 if ((bitmap
& kFPBackupDateBit
)) {
1709 print_date(tree
, hf_afp_backup_date
,tvb
, offset
);
1712 if ((bitmap
& kFPFinderInfoBit
)) {
1713 proto_tree_add_item(tree
, hf_afp_finder_info
,tvb
, offset
, 32, ENC_NA
);
1716 if ((bitmap
& kFPLongNameBit
)) {
1719 tp_ofs
= parse_long_filename(tree
, tvb
, offset
, org_offset
);
1720 max_offset
= (tp_ofs
>max_offset
)?tp_ofs
:max_offset
;
1724 if ((bitmap
& kFPShortNameBit
)) {
1725 /* snameoff = tvb_get_ntohs(tvb, offset); */
1726 proto_tree_add_item(tree
, hf_afp_short_name_offset
,tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1729 if ((bitmap
& kFPNodeIDBit
)) {
1730 proto_tree_add_item(tree
, hf_afp_file_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1733 if ((bitmap
& kFPOffspringCountBit
)) {
1734 proto_tree_add_item(tree
, hf_afp_dir_offspring
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1735 offset
+= 2; /* error in AFP3.0.pdf */
1737 if ((bitmap
& kFPOwnerIDBit
)) {
1738 proto_tree_add_item(tree
, hf_afp_dir_OwnerID
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1741 if ((bitmap
& kFPGroupIDBit
)) {
1742 proto_tree_add_item(tree
, hf_afp_dir_GroupID
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1745 if ((bitmap
& kFPAccessRightsBit
)) {
1746 decode_access_rights(tree
, tvb
, hf_afp_dir_ar
, offset
);
1749 if ((bitmap
& kFPUTF8NameBit
)) {
1752 tp_ofs
= parse_UTF8_filename(tree
, tvb
, offset
, org_offset
);
1753 max_offset
= (tp_ofs
>max_offset
)?tp_ofs
:max_offset
;
1756 if ((bitmap
& kFPUnixPrivsBit
)) {
1758 * XXX - the AFP 3.0 spec says this is "Four bytes", but
1759 * also says the privileges are "stored in an FPUnixPrivs
1760 * structure", which is 16 bytes long.
1762 * We assume, for now, that the latter is true.
1764 decode_unix_privs(tree
, tvb
, offset
);
1767 return (max_offset
)?max_offset
:offset
;
1770 /* -------------------------- */
1772 name_in_bitmap(wmem_allocator_t
*scope
, tvbuff_t
*tvb
, int offset
, uint16_t bitmap
, int isdir
)
1775 int org_offset
= offset
;
1781 if ((bitmap
& kFPAttributeBit
)) /* 0 */
1783 if ((bitmap
& kFPParentDirIDBit
)) /* 1 */
1785 if ((bitmap
& kFPCreateDateBit
)) /* 2 */
1787 if ((bitmap
& kFPModDateBit
)) /* 3 */
1789 if ((bitmap
& kFPBackupDateBit
)) /* 4 */
1791 if ((bitmap
& kFPFinderInfoBit
)) /* 5 */
1794 if ((bitmap
& kFPLongNameBit
)) { /* 6 */
1795 nameoff
= tvb_get_ntohs(tvb
, offset
);
1797 tp_ofs
= nameoff
+org_offset
;
1798 len
= tvb_get_uint8(tvb
, tp_ofs
);
1800 /* XXX - code page,, e.g. Mac{Roman,Japanese,etc.} */
1801 name
= tvb_get_string_enc(scope
, tvb
, tp_ofs
, len
, ENC_ASCII
|ENC_NA
);
1807 if ((bitmap
& kFPShortNameBit
)) /* 7 */
1809 if ((bitmap
& kFPNodeIDBit
)) /* 8 */
1813 if ((bitmap
& kFPOffspringCountBit
)) /* 9 */
1815 if ((bitmap
& kFPOwnerIDBit
)) /* 10*/
1817 if ((bitmap
& kFPGroupIDBit
)) /* 11*/
1819 if ((bitmap
& kFPAccessRightsBit
)) /* 12*/
1823 if ((bitmap
& kFPDataForkLenBit
)) /* 9 */
1825 if ((bitmap
& kFPRsrcForkLenBit
)) /* 10*/
1827 if ((bitmap
& kFPExtDataForkLenBit
)) /* 11*/
1829 if ((bitmap
& kFPLaunchLimitBit
)) /* 12*/
1830 offset
+= 2; /* FIXME ? */
1833 if ((bitmap
& kFPUTF8NameBit
)) { /* 13 */
1834 nameoff
= tvb_get_ntohs(tvb
, offset
);
1836 tp_ofs
= nameoff
+org_offset
+4;
1837 len16
= tvb_get_ntohs(tvb
, tp_ofs
);
1839 name
= tvb_get_string_enc(scope
, tvb
, tp_ofs
, len16
, ENC_UTF_8
|ENC_NA
);
1846 /* -------------------------- */
1848 name_in_dbitmap(wmem_allocator_t
*scope
, tvbuff_t
*tvb
, int offset
, uint16_t bitmap
)
1852 name
= name_in_bitmap(scope
, tvb
, offset
, bitmap
, 1);
1862 /* -------------------------- */
1864 name_in_fbitmap(wmem_allocator_t
*scope
, tvbuff_t
*tvb
, int offset
, uint16_t bitmap
)
1868 name
= name_in_bitmap(scope
, tvb
, offset
, bitmap
, 0);
1878 /* -------------------------- */
1880 decode_vol(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
1882 Vol
= tvb_get_ntohs(tvb
, offset
);
1883 proto_tree_add_item(tree
, hf_afp_vol_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1887 /* -------------------------- */
1889 decode_vol_did(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
1891 Vol
= tvb_get_ntohs(tvb
, offset
);
1892 proto_tree_add_item(tree
, hf_afp_vol_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1895 Did
= tvb_get_ntohl(tvb
, offset
);
1896 proto_tree_add_item(tree
, hf_afp_did
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1901 /* -------------------------- */
1903 decode_vol_did_file_dir_bitmap (proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
1905 offset
= decode_vol_did(tree
, tvb
, offset
);
1907 decode_file_bitmap(tree
, tvb
, offset
);
1910 decode_dir_bitmap(tree
, tvb
, offset
);
1916 /* ------------------------ */
1918 get_name(wmem_allocator_t
*scope
, tvbuff_t
*tvb
, int offset
, int type
)
1926 len
= tvb_get_uint8(tvb
, offset
);
1928 string
= tvb_format_text(scope
, tvb
,offset
, len
);
1931 len
= tvb_get_ntohs(tvb
, offset
+4);
1933 string
= tvb_format_text(scope
, tvb
,offset
, len
);
1936 string
= "Unknown type";
1941 /* -------------------------- */
1943 decode_name_label (proto_tree
*tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
, const char *label
, bool add_info
)
1949 proto_tree
*sub_tree
= NULL
;
1951 type
= tvb_get_uint8(tvb
, offset
);
1954 len
= tvb_get_ntohs(tvb
, offset
+5);
1958 len
= tvb_get_uint8(tvb
, offset
+1);
1960 name
= get_name(pinfo
->pool
, tvb
, offset
+1, type
);
1963 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ": Vol=%u Did=%u", Vol
, Did
);
1965 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Name=%s", name
);
1970 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, len
+header
,
1971 ett_afp_path_name
, NULL
, label
, name
);
1973 proto_tree_add_item( sub_tree
, hf_afp_path_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1976 proto_tree_add_item( sub_tree
, hf_afp_path_unicode_hint
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1978 proto_tree_add_item( sub_tree
, hf_afp_path_unicode_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1982 proto_tree_add_item( sub_tree
, hf_afp_path_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1986 proto_tree_add_string(sub_tree
, hf_afp_path_name
, tvb
, offset
, len
,name
);
1994 /* -------------------------- */
1996 decode_name (proto_tree
*tree
, packet_info
*pinfo
, tvbuff_t
*tvb
, int offset
)
1998 return decode_name_label(tree
, pinfo
, tvb
, offset
, "Path: %s", true);
2001 /* -------------------------- */
2003 add_info_fork(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
)
2007 ofork
= tvb_get_ntohs(tvb
, offset
);
2009 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ": Fork=%u", ofork
);
2013 /* -------------------------- */
2015 add_info_vol(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
)
2019 vol
= tvb_get_ntohs(tvb
, offset
);
2020 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ": Vol=%u", vol
);
2023 /* ************************** */
2025 dissect_query_afp_open_vol(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2032 decode_vol_bitmap(tree
, tvb
, offset
);
2035 len
= tvb_get_uint8(tvb
, offset
);
2037 rep
= get_name(pinfo
->pool
, tvb
, offset
, 2);
2038 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ": %s", rep
);
2043 proto_tree_add_item(tree
, hf_afp_vol_name
, tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
);
2046 len
= tvb_reported_length_remaining(tvb
,offset
);
2048 /* optional password */
2049 proto_tree_add_item(tree
, hf_afp_passwd
, tvb
, offset
, 8, ENC_UTF_8
|ENC_NA
);
2055 /* -------------------------- */
2057 dissect_reply_afp_open_vol(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2063 bitmap
= decode_vol_bitmap(tree
, tvb
, offset
);
2065 offset
= parse_vol_bitmap(tree
, tvb
, offset
, bitmap
);
2070 /* ************************** */
2072 dissect_reply_afp_get_server_param(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2077 proto_tree
*sub_tree
;
2080 static int * const flags
[] = {
2081 &hf_afp_vol_flag_passwd
,
2082 &hf_afp_vol_flag_has_config
,
2089 print_date(tree
, hf_afp_server_time
,tvb
, offset
);
2092 num
= tvb_get_uint8(tvb
, offset
);
2093 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 1,
2094 ett_afp_server_vol
, NULL
, "Volumes : %d", num
);
2097 for (i
= 0; i
< num
; i
++) {
2100 tree
= proto_tree_add_subtree(sub_tree
, tvb
, offset
, -1,
2101 ett_afp_vol_list
, NULL
, "Volume");
2103 item
= proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_vol_flag
,
2104 ett_afp_vol_flag
, flags
, ENC_BIG_ENDIAN
);
2107 len
= tvb_get_uint8(tvb
, offset
) +1;
2108 rep
= get_name(pinfo
->pool
, tvb
, offset
, 2);
2109 proto_item_set_text(item
, "%s", rep
);
2110 proto_item_set_len(item
, len
+1);
2112 proto_tree_add_item(tree
, hf_afp_vol_name
, tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
);
2119 /* **************************
2120 next calls use the same format :
2128 dissect_query_afp_with_vol_id(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2135 proto_tree_add_item(tree
, hf_afp_vol_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2140 /* ************************** */
2142 dissect_query_afp_open_fork(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2144 static int * const access
[] = {
2145 &hf_afp_access_read
,
2146 &hf_afp_access_write
,
2147 &hf_afp_access_deny_read
,
2148 &hf_afp_access_deny_write
,
2152 proto_tree_add_item(tree
, hf_afp_fork_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2155 offset
= decode_vol_did(tree
, tvb
, offset
);
2157 decode_file_bitmap(tree
, tvb
, offset
);
2159 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_access_mode
,
2160 ett_afp_access_mode
, access
, ENC_BIG_ENDIAN
);
2163 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
2168 /* -------------------------- */
2170 dissect_reply_afp_open_fork(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2174 f_bitmap
= decode_file_bitmap(tree
, tvb
, offset
);
2177 add_info_fork(tvb
, pinfo
, offset
);
2178 proto_tree_add_item(tree
, hf_afp_ofork
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2181 offset
= parse_file_bitmap(tree
, tvb
, offset
, f_bitmap
,0);
2186 /* ************************** */
2188 dissect_query_afp_enumerate_ext2(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2192 offset
= decode_vol_did_file_dir_bitmap(tree
, tvb
, offset
);
2194 proto_tree_add_item(tree
, hf_afp_req_count
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2197 proto_tree_add_item(tree
, hf_afp_start_index32
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2200 proto_tree_add_item(tree
, hf_afp_max_reply_size32
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2203 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
2208 /* ************************** */
2210 dissect_query_afp_enumerate(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2214 offset
= decode_vol_did_file_dir_bitmap(tree
, tvb
, offset
);
2216 proto_tree_add_item(tree
, hf_afp_req_count
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2219 proto_tree_add_item(tree
, hf_afp_start_index
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2222 proto_tree_add_item(tree
, hf_afp_max_reply_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2225 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
2230 /* -------------------------- */
2232 loop_record(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*ptree
, int offset
,
2233 int count
, uint16_t d_bitmap
, uint16_t f_bitmap
, int add
, int ext
)
2235 proto_tree
*tree
= NULL
;
2243 for (i
= 0; i
< count
; i
++) {
2246 size
= tvb_get_ntohs(tvb
, offset
) +add
*2;
2250 size
= tvb_get_uint8(tvb
, offset
) +add
;
2254 return offset
; /* packet is malformed */
2255 flags
= tvb_get_uint8(tvb
, offset
+decal
);
2261 name
= name_in_dbitmap(pinfo
->pool
, tvb
, offset
+decal
, d_bitmap
);
2264 name
= name_in_fbitmap(pinfo
->pool
, tvb
, offset
+decal
, f_bitmap
);
2267 tree
= proto_tree_add_subtree(ptree
, tvb
, offset
, size
,
2268 ett_afp_enumerate_line
, NULL
, (const char*)name
);
2271 tree
= proto_tree_add_subtree_format(ptree
, tvb
, offset
, size
,
2272 ett_afp_enumerate_line
, NULL
, "line %d", i
+1);
2276 proto_tree_add_item(tree
, hf_afp_struct_size16
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2280 proto_tree_add_item(tree
, hf_afp_struct_size
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2284 proto_tree_add_item(tree
, hf_afp_file_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2290 offset
= parse_dir_bitmap(tree
, tvb
, offset
, d_bitmap
);
2293 offset
= parse_file_bitmap(tree
, tvb
, offset
, f_bitmap
,0);
2297 offset
= org
+size
; /* play safe */
2301 /* ------------------------- */
2303 reply_enumerate(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
, int ext
)
2305 proto_tree
*sub_tree
= NULL
;
2311 f_bitmap
= decode_file_bitmap(tree
, tvb
, offset
);
2314 d_bitmap
= decode_dir_bitmap(tree
, tvb
, offset
);
2317 count
= tvb_get_ntohs(tvb
, offset
);
2319 item
= proto_tree_add_item(tree
, hf_afp_req_count
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2320 sub_tree
= proto_item_add_subtree(item
, ett_afp_enumerate
);
2324 return loop_record(tvb
, pinfo
, sub_tree
, offset
, count
, d_bitmap
, f_bitmap
,0, ext
);
2327 /* ------------------------- */
2329 dissect_reply_afp_enumerate(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2331 return reply_enumerate(tvb
, pinfo
, tree
, offset
, 0);
2334 /* **************************/
2336 dissect_reply_afp_enumerate_ext(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2338 return reply_enumerate(tvb
, pinfo
, tree
, offset
, 1);
2341 /* **************************/
2343 catsearch_spec(tvbuff_t
*tvb
, proto_tree
*ptree
, int offset
, int ext
, uint32_t r_bitmap
, const char *label
)
2352 size
= tvb_get_ntohs(tvb
, offset
) +2;
2355 size
= tvb_get_uint8(tvb
, offset
) +2;
2358 tree
= proto_tree_add_subtree(ptree
, tvb
, offset
, size
, ett_afp_cat_spec
, NULL
, label
);
2361 proto_tree_add_item(tree
, hf_afp_struct_size16
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2365 proto_tree_add_item(tree
, hf_afp_struct_size
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2370 /* AFP 3.1 spec pdf: The low-order word of ReqBitmap is equivalent to the
2371 File and Directory bitmaps used by the FPGetFileDirParms command. */
2372 parse_file_bitmap(tree
, tvb
, offset
, (uint16_t) r_bitmap
,0);
2378 /* ------------------------- */
2380 query_catsearch(tvbuff_t
*tvb
, proto_tree
*ptree
, int offset
, int ext
)
2382 proto_tree
*tree
= NULL
, *sub_tree
;
2392 proto_tree_add_item(ptree
, hf_afp_vol_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2395 proto_tree_add_item(ptree
, hf_afp_cat_req_matches
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2398 proto_tree_add_item(ptree
, hf_afp_reserved
, tvb
, offset
, 4, ENC_NA
);
2401 proto_tree_add_item(ptree
, hf_afp_cat_position
, tvb
, offset
, 16, ENC_NA
);
2404 f_bitmap
= decode_file_bitmap(ptree
, tvb
, offset
);
2407 d_bitmap
= decode_dir_bitmap(ptree
, tvb
, offset
);
2410 r_bitmap
= tvb_get_ntohl(tvb
, offset
);
2411 /* Already checked this above: if (ptree) */ {
2412 item
= proto_tree_add_item(ptree
, hf_afp_request_bitmap
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2413 sub_tree
= proto_item_add_subtree(item
, ett_afp_cat_r_bitmap
);
2415 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_Attributes
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2416 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_ParentDirID
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2417 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_CreateDate
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2418 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_ModDate
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2419 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_BackupDate
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2420 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_FinderInfo
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2421 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_LongName
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2423 if (d_bitmap
== 0) {
2424 /* Only for file-only searches */
2425 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_DataForkLen
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2426 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_RsrcForkLen
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2427 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_ExtDataForkLen
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2429 if (f_bitmap
== 0) {
2430 /* Only for directory-only searches */
2431 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_OffspringCount
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2434 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_UTF8Name
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2436 if (d_bitmap
== 0) {
2437 /* Only for file-only searches */
2438 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_ExtRsrcForkLen
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2440 proto_tree_add_item(sub_tree
, hf_afp_request_bitmap_PartialNames
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2445 offset
= catsearch_spec(tvb
, ptree
, offset
, ext
, r_bitmap
, "Spec 1");
2448 offset
= catsearch_spec(tvb
, ptree
, offset
, ext
, r_bitmap
, "Spec 2");
2453 /* ------------------------- */
2455 dissect_query_afp_cat_search(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*ptree
, int offset
)
2457 return query_catsearch(tvb
, ptree
, offset
, 0);
2460 /* **************************/
2462 dissect_query_afp_cat_search_ext(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*ptree
, int offset
)
2464 return query_catsearch(tvb
, ptree
, offset
, 1);
2468 /* **************************/
2470 reply_catsearch(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
, int ext
)
2472 proto_tree
*sub_tree
= NULL
;
2478 proto_tree_add_item(tree
, hf_afp_cat_position
, tvb
, offset
, 16, ENC_NA
);
2481 f_bitmap
= decode_file_bitmap(tree
, tvb
, offset
);
2484 d_bitmap
= decode_dir_bitmap(tree
, tvb
, offset
);
2487 count
= tvb_get_ntohl(tvb
, offset
);
2489 item
= proto_tree_add_item(tree
, hf_afp_cat_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2490 sub_tree
= proto_item_add_subtree(item
, ett_afp_cat_search
);
2494 return loop_record(tvb
, pinfo
, sub_tree
, offset
, count
, d_bitmap
, f_bitmap
, 2, ext
);
2497 /* -------------------------- */
2499 dissect_reply_afp_cat_search(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2501 return reply_catsearch(tvb
, pinfo
, tree
, offset
, 0);
2504 /* **************************/
2506 dissect_reply_afp_cat_search_ext(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2508 return reply_catsearch(tvb
, pinfo
, tree
, offset
, 1);
2511 /* **************************/
2513 dissect_query_afp_get_vol_param(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2517 add_info_vol(tvb
, pinfo
, offset
);
2519 proto_tree_add_item(tree
, hf_afp_vol_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2522 decode_vol_bitmap(tree
, tvb
, offset
);
2528 /* ------------------------ */
2530 dissect_reply_afp_get_vol_param(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2534 bitmap
= decode_vol_bitmap(tree
, tvb
, offset
);
2537 offset
= parse_vol_bitmap(tree
, tvb
, offset
, bitmap
);
2542 /* **************************/
2544 dissect_query_afp_set_vol_param(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2550 add_info_vol(tvb
, pinfo
, offset
);
2551 proto_tree_add_item(tree
, hf_afp_vol_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2554 bitmap
= decode_vol_bitmap(tree
, tvb
, offset
);
2557 offset
= parse_vol_bitmap(tree
, tvb
, offset
, bitmap
);
2562 /* ***************************/
2564 decode_uam_parameters(const char *uam
, int len_uam
, tvbuff_t
*tvb
, proto_tree
*tree
, int offset
)
2568 if (!g_ascii_strncasecmp(uam
, "Cleartxt passwrd", len_uam
)) {
2572 len
= 8; /* tvb_strsize(tvb, offset);*/
2573 proto_tree_add_item(tree
, hf_afp_passwd
, tvb
, offset
, len
, ENC_UTF_8
|ENC_NA
);
2576 else if (!g_ascii_strncasecmp(uam
, "DHCAST128", len_uam
)) {
2581 proto_tree_add_item(tree
, hf_afp_random
, tvb
, offset
, len
, ENC_NA
);
2584 else if (!g_ascii_strncasecmp(uam
, "2-Way Randnum exchange", len_uam
)) {
2591 /* ---------------- */
2593 dissect_query_afp_login(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2599 len
= tvb_get_uint8(tvb
, offset
);
2600 proto_tree_add_item(tree
, hf_afp_Version
, tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
);
2602 len_uam
= tvb_get_uint8(tvb
, offset
);
2603 uam
= (const char *)tvb_get_string_enc(pinfo
->pool
, tvb
, offset
+1, len_uam
, ENC_UTF_8
|ENC_NA
);
2604 proto_tree_add_item(tree
, hf_afp_UAM
, tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
);
2605 offset
+= len_uam
+1;
2607 if (!g_ascii_strncasecmp(uam
, "No User Authent", len_uam
)) {
2611 len
= tvb_get_uint8(tvb
, offset
);
2612 proto_tree_add_item(tree
, hf_afp_user
, tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
);
2615 return decode_uam_parameters(uam
, len_uam
, tvb
, tree
, offset
);
2618 /* ***************************/
2620 dissect_query_afp_login_ext(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2628 proto_tree_add_item(tree
, hf_afp_login_flags
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2631 len
= tvb_get_uint8(tvb
, offset
);
2632 proto_tree_add_item(tree
, hf_afp_Version
, tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
);
2635 len_uam
= tvb_get_uint8(tvb
, offset
);
2636 uam
= (const char*)tvb_get_string_enc(pinfo
->pool
, tvb
, offset
+1, len_uam
, ENC_UTF_8
|ENC_NA
);
2637 proto_tree_add_item(tree
, hf_afp_UAM
, tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
);
2638 offset
+= len_uam
+1;
2640 proto_tree_add_item(tree
, hf_afp_user_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2643 len
= tvb_get_ntohs(tvb
, offset
);
2644 proto_tree_add_item(tree
, hf_afp_user_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2646 proto_tree_add_item(tree
, hf_afp_user_name
, tvb
, offset
, len
, ENC_UTF_8
);
2649 /* directory service */
2650 path_type
= tvb_get_uint8(tvb
, offset
);
2651 proto_tree_add_item(tree
, hf_afp_path_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2653 /* FIXME use 16 bit len + unicode from smb dissector */
2654 switch (path_type
) {
2657 len
= tvb_get_uint8(tvb
, offset
);
2658 proto_tree_add_item(tree
, hf_afp_path_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2660 proto_tree_add_item(tree
, hf_afp_path_name
, tvb
, offset
, len
, ENC_UTF_8
);
2664 len
= tvb_get_ntohs(tvb
, offset
);
2665 proto_tree_add_item( tree
, hf_afp_path_unicode_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2667 proto_tree_add_item(tree
, hf_afp_path_name
, tvb
, offset
, len
, ENC_UTF_8
);
2674 return decode_uam_parameters(uam
, len_uam
, tvb
, tree
, offset
);
2677 /* ************************** */
2679 dissect_query_afp_write(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2684 proto_tree_add_item(tree
, hf_afp_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2687 add_info_fork(tvb
, pinfo
, offset
);
2688 proto_tree_add_item(tree
, hf_afp_ofork
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2691 proto_tree_add_item(tree
, hf_afp_offset
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2692 param
= tvb_get_ntohl(tvb
, offset
);
2693 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Offset=%d", param
);
2696 proto_tree_add_item(tree
, hf_afp_rw_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2697 param
= tvb_get_ntohl(tvb
, offset
);
2698 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Size=%d", param
);
2705 dissect_reply_afp_write(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2707 proto_tree_add_item(tree
, hf_afp_last_written
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2713 /* ************************** */
2715 dissect_query_afp_write_ext(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2717 proto_tree_add_item(tree
, hf_afp_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2720 add_info_fork(tvb
, pinfo
, offset
);
2721 proto_tree_add_item(tree
, hf_afp_ofork
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2724 proto_tree_add_item(tree
, hf_afp_offset64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
2727 proto_tree_add_item(tree
, hf_afp_rw_count64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
2734 dissect_reply_afp_write_ext(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2736 proto_tree_add_item(tree
, hf_afp_last_written64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
2742 /* ************************** */
2744 dissect_query_afp_read(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2750 add_info_fork(tvb
, pinfo
, offset
);
2751 proto_tree_add_item(tree
, hf_afp_ofork
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2754 proto_tree_add_item(tree
, hf_afp_offset
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2755 param
= tvb_get_ntohl(tvb
, offset
);
2756 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Offset=%d", param
);
2759 proto_tree_add_item(tree
, hf_afp_rw_count
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2760 param
= tvb_get_ntohl(tvb
, offset
);
2761 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Size=%d", param
);
2764 proto_tree_add_item(tree
, hf_afp_newline_mask
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2767 proto_tree_add_item(tree
, hf_afp_newline_char
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2773 /* ************************** */
2775 dissect_query_afp_read_ext(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2779 add_info_fork(tvb
, pinfo
, offset
);
2780 proto_tree_add_item(tree
, hf_afp_ofork
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2783 proto_tree_add_item(tree
, hf_afp_offset64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
2786 proto_tree_add_item(tree
, hf_afp_rw_count64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
2792 /* **************************
2794 query is the same than AFP_FLUSH, AFP_CLOSEVOL
2798 dissect_reply_afp_open_dt(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2800 proto_tree_add_item(tree
, hf_afp_dt_ref
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2806 /* **************************
2810 dissect_query_afp_close_dt(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2813 proto_tree_add_item(tree
, hf_afp_dt_ref
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2819 /* **************************
2820 calls using the same format :
2828 dissect_query_afp_with_fork(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2831 add_info_fork(tvb
, pinfo
, offset
);
2832 proto_tree_add_item(tree
, hf_afp_ofork
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2838 /* ************************** */
2840 dissect_query_afp_get_fldr_param(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2843 offset
= decode_vol_did_file_dir_bitmap(tree
, tvb
, offset
);
2845 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
2850 /* -------------------------- */
2852 dissect_reply_afp_get_fldr_param(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2855 uint16_t f_bitmap
, d_bitmap
;
2857 f_bitmap
= decode_file_bitmap(tree
, tvb
, offset
);
2860 d_bitmap
= decode_dir_bitmap(tree
, tvb
, offset
);
2863 flags
= tvb_get_uint8(tvb
, offset
);
2864 proto_tree_add_item(tree
, hf_afp_file_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
2868 offset
= parse_dir_bitmap(tree
, tvb
, offset
, d_bitmap
);
2871 offset
= parse_file_bitmap(tree
, tvb
, offset
, f_bitmap
,0);
2876 /* **************************
2880 dissect_query_afp_set_fldr_param(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2885 offset
= decode_vol_did(tree
, tvb
, offset
);
2887 f_bitmap
= decode_file_bitmap(tree
, tvb
, offset
);
2890 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
2894 /* did:name can be a file or a folder but only the intersection between
2895 * file bitmap and dir bitmap can be set.
2896 * Well it's in afp spec, but clients (Mac) are setting 'file only' bits with this call
2897 * (WriteInhibit for example).
2899 offset
= parse_file_bitmap(tree
, tvb
, offset
, f_bitmap
, 1);
2904 /* **************************
2908 dissect_query_afp_set_file_param(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2913 offset
= decode_vol_did(tree
, tvb
, offset
);
2915 f_bitmap
= decode_file_bitmap(tree
, tvb
, offset
);
2918 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
2922 offset
= parse_file_bitmap(tree
, tvb
, offset
, f_bitmap
, 0);
2927 /* **************************
2931 dissect_query_afp_set_dir_param(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2936 offset
= decode_vol_did(tree
, tvb
, offset
);
2938 d_bitmap
= decode_dir_bitmap(tree
, tvb
, offset
);
2941 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
2945 offset
= parse_dir_bitmap(tree
, tvb
, offset
, d_bitmap
);
2951 /* **************************
2956 dissect_query_afp_create_id(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
2959 offset
= decode_vol_did(tree
, tvb
, offset
);
2961 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
2965 /* --------------------------
2969 dissect_reply_afp_create_id(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2971 proto_tree_add_item(tree
, hf_afp_file_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2977 /* -------------------------- */
2979 dissect_reply_afp_create_dir(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2981 proto_tree_add_item(tree
, hf_afp_did
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
2987 /* **************************
2991 dissect_query_afp_delete_id(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
2994 proto_tree_add_item(tree
, hf_afp_vol_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
2996 proto_tree_add_item(tree
, hf_afp_file_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3002 /* **************************
3003 same reply as get_fork_param
3006 dissect_query_afp_resolve_id(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3009 proto_tree_add_item(tree
, hf_afp_vol_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3011 proto_tree_add_item(tree
, hf_afp_file_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3014 decode_file_bitmap(tree
, tvb
, offset
);
3020 /* ************************** */
3022 dissect_query_afp_get_fork_param(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3026 add_info_fork(tvb
, pinfo
, offset
);
3027 proto_tree_add_item(tree
, hf_afp_ofork
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3030 decode_file_bitmap(tree
, tvb
, offset
);
3035 /* -------------------------- */
3037 dissect_reply_afp_get_fork_param(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3041 f_bitmap
= decode_file_bitmap(tree
, tvb
, offset
);
3044 offset
= parse_file_bitmap(tree
, tvb
, offset
, f_bitmap
,0);
3049 /* ************************** */
3051 dissect_query_afp_set_fork_param(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3057 add_info_fork(tvb
, pinfo
, offset
);
3058 proto_tree_add_item(tree
, hf_afp_ofork
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3061 bitmap
= decode_file_bitmap(tree
, tvb
, offset
);
3064 if ((bitmap
& kFPExtDataForkLenBit
) || (bitmap
& kFPExtRsrcForkLenBit
)) {
3065 proto_tree_add_item(tree
, hf_afp_ofork_len64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3069 proto_tree_add_item(tree
, hf_afp_ofork_len
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3070 param
= tvb_get_ntohl(tvb
, offset
);
3071 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Size=%d", param
);
3077 /* ************************** */
3079 dissect_query_afp_move(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3083 offset
= decode_vol_did(tree
, tvb
, offset
);
3085 proto_tree_add_item(tree
, hf_afp_did
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3088 offset
= decode_name_label(tree
, pinfo
, tvb
, offset
, "Source path: %s", true);
3089 offset
= decode_name_label(tree
, pinfo
, tvb
, offset
, "Dest dir: %s", false);
3090 offset
= decode_name_label(tree
, pinfo
, tvb
, offset
, "New name: %s", false);
3095 /* ************************** */
3097 dissect_query_afp_exchange_file(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3101 offset
= decode_vol_did(tree
, tvb
, offset
);
3103 proto_tree_add_item(tree
, hf_afp_did
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3106 offset
= decode_name_label(tree
, pinfo
, tvb
, offset
, "Source path: %s", true);
3107 offset
= decode_name_label(tree
, pinfo
, tvb
, offset
, "Dest path: %s", false);
3111 /* ************************** */
3113 dissect_query_afp_copy_file(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3115 proto_tree
*sub_tree
;
3118 sub_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, 6, ett_afp_vol_did
, NULL
, "Source volume");
3120 offset
= decode_vol_did(sub_tree
, tvb
, offset
);
3122 sub_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, 6, ett_afp_vol_did
, NULL
, "Dest volume");
3124 offset
= decode_vol_did(sub_tree
, tvb
, offset
);
3126 offset
= decode_name_label(tree
, pinfo
, tvb
, offset
, "Source path: %s", true);
3127 offset
= decode_name_label(tree
, pinfo
, tvb
, offset
, "Dest dir: %s", false);
3128 offset
= decode_name_label(tree
, pinfo
, tvb
, offset
, "New name: %s", false);
3133 /* ************************** */
3135 dissect_query_afp_rename(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3139 offset
= decode_vol_did(tree
, tvb
, offset
);
3141 offset
= decode_name_label(tree
, pinfo
, tvb
, offset
, "Old name: %s", true);
3142 offset
= decode_name_label(tree
, pinfo
, tvb
, offset
, "New name: %s", false);
3147 /* ************************** */
3149 dissect_query_afp_byte_lock(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3151 proto_tree
*sub_tree
;
3154 flag
= tvb_get_uint8(tvb
, offset
);
3155 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 1,
3156 ett_afp_lock_flags
, NULL
, "Flags: 0x%02x", flag
);
3158 proto_tree_add_item(sub_tree
, hf_afp_lock_op
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3159 proto_tree_add_item(sub_tree
, hf_afp_lock_from
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3162 proto_tree_add_item(tree
, hf_afp_ofork
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3165 proto_tree_add_item(tree
, hf_afp_lock_offset
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3168 proto_tree_add_item(tree
, hf_afp_lock_len
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3173 /* -------------------------- */
3175 dissect_reply_afp_byte_lock(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3177 proto_tree_add_item(tree
, hf_afp_lock_range_start
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3183 /* ************************** */
3185 dissect_query_afp_byte_lock_ext(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3187 proto_tree
*sub_tree
;
3190 flag
= tvb_get_uint8(tvb
, offset
);
3191 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 1,
3192 ett_afp_lock_flags
, NULL
, "Flags: 0x%02x", flag
);
3194 proto_tree_add_item(sub_tree
, hf_afp_lock_op
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3195 proto_tree_add_item(sub_tree
, hf_afp_lock_from
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3198 proto_tree_add_item(tree
, hf_afp_ofork
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3201 proto_tree_add_item(tree
, hf_afp_lock_offset64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3204 proto_tree_add_item(tree
, hf_afp_lock_len64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3209 /* -------------------------- */
3211 dissect_reply_afp_byte_lock_ext(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3213 proto_tree_add_item(tree
, hf_afp_lock_range_start64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3219 /* ************************** */
3221 dissect_query_afp_add_cmt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3226 proto_tree_add_item(tree
, hf_afp_dt_ref
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3229 proto_tree_add_item(tree
, hf_afp_did
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3232 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
3237 len
= tvb_get_uint8(tvb
, offset
);
3238 proto_tree_add_item(tree
, hf_afp_comment
, tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
);
3245 /* ************************** */
3247 dissect_query_afp_get_cmt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3251 proto_tree_add_item(tree
, hf_afp_dt_ref
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3254 proto_tree_add_item(tree
, hf_afp_did
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3257 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
3261 /* -------------------------- */
3263 dissect_reply_afp_get_cmt(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3267 len
= tvb_get_uint8(tvb
, offset
);
3268 proto_tree_add_item(tree
, hf_afp_comment
, tvb
, offset
, 1, ENC_UTF_8
|ENC_BIG_ENDIAN
);
3274 /* ************************** */
3276 dissect_query_afp_get_icon(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3280 proto_tree_add_item(tree
, hf_afp_dt_ref
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3282 proto_tree_add_item(tree
, hf_afp_file_creator
, tvb
, offset
, 4, ENC_UTF_8
);
3285 proto_tree_add_item(tree
, hf_afp_file_type
, tvb
, offset
, 4, ENC_ASCII
);
3288 proto_tree_add_item(tree
, hf_afp_icon_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3292 proto_tree_add_item(tree
, hf_afp_icon_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3298 /* ************************** */
3300 dissect_query_afp_get_icon_info(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3304 proto_tree_add_item(tree
, hf_afp_dt_ref
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3306 proto_tree_add_item(tree
, hf_afp_file_creator
, tvb
, offset
, 4, ENC_ASCII
);
3309 proto_tree_add_item(tree
, hf_afp_icon_index
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3315 /* -------------------------- */
3317 dissect_reply_afp_get_icon_info(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3320 proto_tree_add_item(tree
, hf_afp_icon_tag
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3323 proto_tree_add_item(tree
, hf_afp_file_type
, tvb
, offset
, 4, ENC_ASCII
);
3326 proto_tree_add_item(tree
, hf_afp_icon_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3330 proto_tree_add_item(tree
, hf_afp_icon_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3336 /* ************************** */
3338 dissect_query_afp_add_icon(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3342 proto_tree_add_item(tree
, hf_afp_dt_ref
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3344 proto_tree_add_item(tree
, hf_afp_file_creator
, tvb
, offset
, 4, ENC_ASCII
);
3347 proto_tree_add_item(tree
, hf_afp_file_type
, tvb
, offset
, 4, ENC_ASCII
);
3350 proto_tree_add_item(tree
, hf_afp_icon_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3354 proto_tree_add_item(tree
, hf_afp_icon_tag
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3357 proto_tree_add_item(tree
, hf_afp_icon_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3363 /* **************************
3367 decode_dt_did(proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
3369 /* FIXME it's not volume but dt cf decode_name*/
3370 Vol
= tvb_get_ntohs(tvb
, offset
);
3371 proto_tree_add_item(tree
, hf_afp_dt_ref
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3374 Did
= tvb_get_ntohl(tvb
, offset
);
3375 proto_tree_add_item(tree
, hf_afp_did
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3380 /* -------------------------- */
3382 dissect_query_afp_add_appl(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3386 offset
= decode_dt_did(tree
, tvb
, offset
);
3388 proto_tree_add_item(tree
, hf_afp_file_creator
, tvb
, offset
, 4, ENC_ASCII
);
3391 proto_tree_add_item(tree
, hf_afp_appl_tag
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3394 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
3399 /* **************************
3403 dissect_query_afp_rmv_appl(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3407 offset
= decode_dt_did(tree
, tvb
, offset
);
3409 proto_tree_add_item(tree
, hf_afp_file_creator
, tvb
, offset
, 4, ENC_ASCII
);
3412 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
3417 /* ************************** */
3419 dissect_query_afp_get_appl(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3423 proto_tree_add_item(tree
, hf_afp_dt_ref
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3426 proto_tree_add_item(tree
, hf_afp_file_creator
, tvb
, offset
, 4, ENC_ASCII
);
3429 proto_tree_add_item(tree
, hf_afp_appl_index
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3432 decode_file_bitmap(tree
, tvb
, offset
);
3438 /* -------------------------- */
3440 dissect_reply_afp_get_appl(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3442 proto_tree_add_item(tree
, hf_afp_appl_tag
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3448 /* ************************** */
3450 dissect_query_afp_create_file(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3452 proto_tree_add_item(tree
, hf_afp_create_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3455 offset
= decode_vol_did(tree
, tvb
, offset
);
3457 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
3462 /* ************************** */
3464 dissect_query_afp_map_id(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3468 type
= tvb_get_uint8(tvb
, offset
);
3469 proto_tree_add_item(tree
, hf_afp_map_id_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3473 proto_tree_add_item(tree
, hf_afp_map_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3477 proto_tree_add_item(tree
, hf_afp_UUID
, tvb
, offset
, 16, ENC_BIG_ENDIAN
);
3484 /* -------------------------- */
3486 dissect_reply_afp_map_id(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3491 len
= tvb_get_uint8(tvb
, offset
);
3492 /* for type 3 and 4 len is 16 bits but we don't keep the type from the request
3493 * XXX assume name < 256, ie the first byte is zero.
3496 len
= tvb_get_uint8(tvb
, offset
+1);
3499 * Assume it's kUserUUIDToUTF8Name or
3500 * kGroupUUIDToUTF8Name.
3502 proto_tree_add_item(tree
, hf_afp_map_id_reply_type
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3505 proto_tree_add_item(tree
, hf_afp_map_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3509 len
= tvb_get_uint8(tvb
, offset
+1);
3513 int remain
= tvb_reported_length_remaining(tvb
,offset
);
3514 if (remain
== len
+2) {
3525 proto_tree_add_item(tree
, hf_afp_map_name
, tvb
, offset
, size
, ENC_ASCII
|ENC_BIG_ENDIAN
);
3528 proto_tree_add_item(tree
, hf_afp_unknown
, tvb
, offset
, len
, ENC_NA
);
3530 offset
+= len
+size
;
3534 /* ************************** */
3536 dissect_query_afp_map_name(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3542 type
= tvb_get_uint8(tvb
, offset
);
3543 proto_tree_add_item(tree
, hf_afp_map_name_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3549 * Maps to UUID, UTF-8 string
3551 * XXX - the spec doesn't say the string length is 2 bytes
3555 len
= tvb_get_ntohs(tvb
, offset
);
3558 /* Maps to UID/GID */
3560 len
= tvb_get_uint8(tvb
, offset
);
3563 proto_tree_add_item(tree
, hf_afp_map_name
, tvb
, offset
, size
, ENC_ASCII
|ENC_BIG_ENDIAN
);
3564 offset
+= len
+size
;
3569 /* -------------------------- */
3571 dissect_reply_afp_map_name(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3575 /* We don't keep the type from the request */
3576 /* If remain == 16, assume UUID */
3577 remain
= tvb_reported_length(tvb
);
3579 proto_tree_add_item(tree
, hf_afp_UUID
, tvb
, offset
, 16, ENC_BIG_ENDIAN
);
3583 proto_tree_add_item(tree
, hf_afp_map_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3590 /* ************************** */
3592 dissect_query_afp_disconnect_old_session(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3598 proto_tree_add_item(tree
, hf_afp_session_token_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3601 proto_tree_add_item_ret_uint(tree
, hf_afp_session_token_len
,
3602 tvb
, offset
, 4, ENC_BIG_ENDIAN
, &token_len
);
3605 if ((uint32_t)offset
+ token_len
> INT_MAX
)
3608 proto_tree_add_item(tree
, hf_afp_session_token
,
3609 tvb
, offset
, (int)token_len
, ENC_NA
);
3610 offset
+= (int)token_len
;
3615 /* ************************** */
3617 dissect_query_afp_get_session_token(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3624 token
= tvb_get_ntohs(tvb
, offset
);
3625 proto_tree_add_item(tree
, hf_afp_session_token_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3627 if (token
== kLoginWithoutID
|| token
== kGetKerberosSessionKey
) /* 0 || 8 */
3630 proto_tree_add_item_ret_uint(tree
, hf_afp_session_token_len
,
3631 tvb
, offset
, 4, ENC_BIG_ENDIAN
, &token_len
);
3634 if (token
==kLoginWithTimeAndID
|| token
==kReconnWithTimeAndID
) {
3635 proto_tree_add_item(tree
, hf_afp_session_token_timestamp
,
3636 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3640 if ((uint32_t)offset
+ token_len
> INT_MAX
)
3643 proto_tree_add_item(tree
, hf_afp_session_token
,
3644 tvb
, offset
, (int)token_len
, ENC_NA
);
3645 offset
+= (int)token_len
;
3650 /* -------------------------- */
3652 dissect_reply_afp_get_session_token(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3657 /* FIXME spec and capture disagree : or it's 4 bytes with no token type, or it's 2 bytes */
3659 /* [cm]: FIXME continued: Since size is set to 4, this test is never true.
3661 proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2, ENC_BIG_ENDIAN);
3665 proto_tree_add_item_ret_uint(tree
, hf_afp_session_token_len
,
3666 tvb
, offset
, size
, ENC_BIG_ENDIAN
, &token_len
);
3669 if ((uint32_t)offset
+ token_len
> INT_MAX
)
3672 proto_tree_add_item(tree
, hf_afp_session_token
,
3673 tvb
, offset
, (int)token_len
, ENC_NA
);
3674 offset
+= (int)token_len
;
3679 /* ************************** */
3680 static int * const afp_message_bitmaps
[] = {
3681 &hf_afp_message_bitmap_REQ
,
3682 &hf_afp_message_bitmap_UTF
,
3687 dissect_query_afp_get_server_message(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3691 proto_tree_add_item(tree
, hf_afp_message_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3694 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_message_bitmap
,
3695 ett_afp_message_bitmap
, afp_message_bitmaps
, ENC_BIG_ENDIAN
);
3701 /* ************************** */
3703 dissect_reply_afp_get_server_message(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3708 /* FIXME: APF 3.1 specs also specify a long reply format, yet unused */
3710 proto_tree_add_item(tree
, hf_afp_message_type
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3713 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_message_bitmap
,
3714 ett_afp_message_bitmap
, afp_message_bitmaps
, ENC_BIG_ENDIAN
);
3715 bitmap
= tvb_get_ntohs(tvb
, offset
);
3719 * XXX - the spec says that the 0x01 bit indicates whether
3720 * the ServerMessage field contains a server message or a login
3723 if (bitmap
& 0x02) {
3724 /* Message is UTF-8, and message length is 2 bytes */
3725 len
= tvb_get_ntohs(tvb
, offset
);
3726 proto_tree_add_item(tree
, hf_afp_message_len
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3729 proto_tree_add_item(tree
, hf_afp_message
, tvb
, offset
, len
, ENC_UTF_8
);
3734 * Message is not UTF-8, and message length is 1 byte.
3736 * Is the message in some Mac encoding? Always Mac Roman,
3737 * or possibly some other encoding for other locales?
3739 len
= tvb_get_uint8(tvb
, offset
);
3740 proto_tree_add_item(tree
, hf_afp_message_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3743 proto_tree_add_item(tree
, hf_afp_message
, tvb
, offset
, len
, ENC_ASCII
);
3751 /* ************************** */
3752 static int * const afp_user_bitmaps
[] = {
3753 &hf_afp_user_bitmap_UID
,
3754 &hf_afp_user_bitmap_GID
,
3755 &hf_afp_user_bitmap_UUID
,
3760 dissect_query_afp_get_user_info(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3763 proto_tree_add_item(tree
, hf_afp_user_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
3766 proto_tree_add_item(tree
, hf_afp_user_ID
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3769 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_user_bitmap
,
3770 ett_afp_user_bitmap
, afp_user_bitmaps
, ENC_BIG_ENDIAN
);
3776 /* -------------------------- */
3778 dissect_reply_afp_get_user_info(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3782 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_user_bitmap
,
3783 ett_afp_user_bitmap
, afp_user_bitmaps
, ENC_BIG_ENDIAN
);
3784 bitmap
= tvb_get_ntohs(tvb
, offset
);
3788 proto_tree_add_item(tree
, hf_afp_user_ID
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3793 proto_tree_add_item(tree
, hf_afp_group_ID
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3798 proto_tree_add_item(tree
, hf_afp_UUID
, tvb
, offset
, 16, ENC_BIG_ENDIAN
);
3805 /* ************************** */
3807 decode_attr_name (proto_tree
*tree
, packet_info
*pinfo _U_
, tvbuff_t
*tvb
, int offset
, const char *label
)
3814 len
= tvb_get_ntohs(tvb
, offset
);
3818 proto_tree
*sub_tree
;
3820 name
= tvb_format_text(pinfo
->pool
, tvb
,offset
+2, len
);
3821 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, len
+ 2,
3822 ett_afp_extattr_names
, NULL
, label
, name
);
3824 proto_tree_add_item(sub_tree
, hf_afp_extattr_namelen
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3825 proto_tree_add_item(sub_tree
, hf_afp_extattr_name
, tvb
, offset
+2, len
, ENC_UTF_8
);
3832 /* ************************** */
3834 decode_attr_bitmap (proto_tree
*tree
, tvbuff_t
*tvb
, int offset
)
3836 static int * const bitmaps
[] = {
3837 &hf_afp_extattr_bitmap_NoFollow
,
3838 &hf_afp_extattr_bitmap_Create
,
3839 &hf_afp_extattr_bitmap_Replace
,
3843 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_extattr_bitmap
,
3844 ett_afp_extattr_bitmap
, bitmaps
, ENC_BIG_ENDIAN
);
3849 /* ************************** */
3851 dissect_query_afp_get_ext_attr(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3854 offset
= decode_vol_did(tree
, tvb
, offset
);
3856 offset
= decode_attr_bitmap(tree
, tvb
, offset
);
3859 proto_tree_add_item(tree
, hf_afp_offset64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3861 /* 8byte reqcount */
3862 proto_tree_add_item(tree
, hf_afp_reqcount64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3866 proto_tree_add_item(tree
, hf_afp_extattr_reply_size
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3869 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
3871 offset
= decode_attr_name(tree
, pinfo
, tvb
, offset
, "Attribute: %s");
3876 /* -------------------------- */
3878 dissect_reply_afp_get_ext_attr(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3880 uint32_t extattr_len
;
3882 offset
= decode_attr_bitmap(tree
, tvb
, offset
);
3884 proto_tree_add_item_ret_uint(tree
, hf_afp_extattr_len
,
3885 tvb
, offset
, 4, ENC_BIG_ENDIAN
, &extattr_len
);
3888 if ((uint32_t)offset
+ extattr_len
> INT_MAX
)
3891 proto_tree_add_item(tree
, hf_afp_extattr_data
,
3892 tvb
, offset
, (int)extattr_len
, ENC_NA
);
3893 offset
+= (int)extattr_len
;
3898 /* ************************** */
3900 dissect_query_afp_set_ext_attr(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3905 offset
= decode_vol_did(tree
, tvb
, offset
);
3907 offset
= decode_attr_bitmap(tree
, tvb
, offset
);
3910 proto_tree_add_item(tree
, hf_afp_offset64
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
3913 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
3915 offset
= decode_attr_name(tree
, pinfo
, tvb
, offset
, "Attribute: %s");
3917 proto_tree_add_item_ret_uint(tree
, hf_afp_extattr_len
, tvb
, offset
, 4, ENC_BIG_ENDIAN
, &len
);
3920 proto_tree_add_item(tree
, hf_afp_extattr_data
, tvb
, offset
, len
, ENC_NA
);
3926 /* ************************** */
3928 dissect_query_afp_list_ext_attrs(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3931 offset
= decode_vol_did(tree
, tvb
, offset
);
3933 /* for this command only kXAttrNoFollow is valid */
3934 offset
= decode_attr_bitmap(tree
, tvb
, offset
);
3936 proto_tree_add_item(tree
, hf_afp_extattr_req_count
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
3939 proto_tree_add_item(tree
, hf_afp_extattr_start_index
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3942 proto_tree_add_item(tree
, hf_afp_extattr_reply_size
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
3945 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
3950 /* -------------------------- */
3952 dissect_reply_afp_list_ext_attrs(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
3954 proto_tree
*sub_tree
;
3955 unsigned len_field
= 0;
3959 offset
= decode_attr_bitmap(tree
, tvb
, offset
);
3961 proto_tree_add_item_ret_uint(tree
, hf_afp_extattr_reply_size
,
3962 tvb
, offset
, 4, ENC_BIG_ENDIAN
, &len_field
);
3964 if (len_field
> INT_MAX
) {
3965 /* XXX - add expert info */
3969 /* If reply_size was 0 on request, server only reports the size of
3970 the entries without actually adding any entries */
3971 remain
= tvb_reported_length_remaining(tvb
, offset
);
3972 if (remain
< (int)len_field
)
3975 sub_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, remain
,
3976 ett_afp_extattr_names
, NULL
, "Attributes");
3977 while (remain
> 0) {
3978 length
= (int)tvb_strsize(tvb
, offset
);
3980 proto_tree_add_item(sub_tree
, hf_afp_extattr_name
, tvb
, offset
, length
, ENC_UTF_8
);
3988 /* ************************** */
3990 dissect_query_afp_remove_ext_attr(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
3993 offset
= decode_vol_did(tree
, tvb
, offset
);
3995 offset
= decode_attr_bitmap(tree
, tvb
, offset
);
3997 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
3999 offset
= decode_attr_name(tree
, pinfo
, tvb
, offset
, "Attribute: %s");
4004 /* ************************** */
4006 decode_acl_access_bitmap(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
)
4009 static int * const bitmaps
[] = {
4010 &hf_afp_acl_access_bitmap_read_data
,
4011 &hf_afp_acl_access_bitmap_write_data
,
4012 &hf_afp_acl_access_bitmap_execute
,
4013 &hf_afp_acl_access_bitmap_delete
,
4014 &hf_afp_acl_access_bitmap_append_data
,
4015 &hf_afp_acl_access_bitmap_delete_child
,
4016 &hf_afp_acl_access_bitmap_read_attrs
,
4017 &hf_afp_acl_access_bitmap_write_attrs
,
4018 &hf_afp_acl_access_bitmap_read_extattrs
,
4019 &hf_afp_acl_access_bitmap_write_extattrs
,
4020 &hf_afp_acl_access_bitmap_read_security
,
4021 &hf_afp_acl_access_bitmap_write_security
,
4022 &hf_afp_acl_access_bitmap_change_owner
,
4023 &hf_afp_acl_access_bitmap_synchronize
,
4024 &hf_afp_acl_access_bitmap_generic_all
,
4025 &hf_afp_acl_access_bitmap_generic_execute
,
4026 &hf_afp_acl_access_bitmap_generic_write
,
4027 &hf_afp_acl_access_bitmap_generic_read
,
4031 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_acl_access_bitmap
,
4032 ett_afp_acl_access_bitmap
, bitmaps
, ENC_BIG_ENDIAN
);
4033 bitmap
= tvb_get_ntohl(tvb
, offset
);
4038 /* ************************** */
4040 dissect_query_afp_access(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
4043 offset
= decode_vol_did(tree
, tvb
, offset
);
4045 proto_tree_add_item(tree
, hf_afp_access_bitmap
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4048 proto_tree_add_item(tree
, hf_afp_UUID
, tvb
, offset
, 16, ENC_BIG_ENDIAN
);
4051 decode_acl_access_bitmap(tvb
, tree
, offset
);
4054 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
4059 /* ************************** */
4061 dissect_query_afp_with_did(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
4064 offset
= decode_vol_did(tree
, tvb
, offset
);
4066 proto_tree_add_item(tree
, hf_afp_did
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4072 /* ************************** */
4074 #define SQ_TYPE_NULL 0x0000
4075 #define SQ_TYPE_COMPLEX 0x0200
4076 #define SQ_TYPE_INT64 0x8400
4077 #define SQ_TYPE_BOOL 0x0100
4078 #define SQ_TYPE_FLOAT 0x8500
4079 #define SQ_TYPE_DATA 0x0700
4080 #define SQ_TYPE_CNIDS 0x8700
4081 #define SQ_TYPE_UUID 0x0e00
4082 #define SQ_TYPE_DATE 0x8600
4084 #define SQ_CPX_TYPE_ARRAY 0x0a00
4085 #define SQ_CPX_TYPE_STRING 0x0c00
4086 #define SQ_CPX_TYPE_UTF16_STRING 0x1c00
4087 #define SQ_CPX_TYPE_DICT 0x0d00
4088 #define SQ_CPX_TYPE_CNIDS 0x1a00
4089 #define SQ_CPX_TYPE_FILEMETA 0x1b00
4091 #define SUBQ_SAFETY_LIM 20
4094 spotlight_int64(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, unsigned encoding
)
4097 uint64_t query_data64
;
4099 query_data64
= tvb_get_uint64(tvb
, offset
, encoding
);
4100 count
= (unsigned)(query_data64
>> 32);
4103 for (i
= 0; i
< count
; i
++) {
4104 proto_tree_add_item(tree
, hf_afp_int64
, tvb
, offset
, 8, encoding
);
4112 spotlight_date(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
, unsigned encoding
)
4115 uint64_t query_data64
;
4118 query_data64
= tvb_get_uint64(tvb
, offset
, encoding
);
4119 count
= (unsigned)(query_data64
>> 32);
4122 if (count
> SUBQ_SAFETY_LIM
) {
4123 expert_add_info_format(pinfo
, tree
, &ei_afp_subquery_count_over_safety_limit
,
4124 "Subquery count (%d) > safety limit (%d)", count
, SUBQ_SAFETY_LIM
);
4128 for (i
= 0; i
< count
; i
++) {
4129 query_data64
= tvb_get_uint64(tvb
, offset
, encoding
) >> 24;
4130 t
.secs
= (time_t)(query_data64
- SPOTLIGHT_TIME_DELTA
);
4132 proto_tree_add_time(tree
, hf_afp_spotlight_date
, tvb
, offset
, 8, &t
);
4140 spotlight_uuid(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, unsigned encoding
)
4143 uint64_t query_data64
;
4145 query_data64
= tvb_get_uint64(tvb
, offset
, encoding
);
4146 count
= (unsigned)(query_data64
>> 32);
4149 for (i
= 0; i
< count
; i
++) {
4150 proto_tree_add_item(tree
, hf_afp_spotlight_uuid
, tvb
, offset
, 16, ENC_BIG_ENDIAN
);
4158 spotlight_float(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, unsigned encoding
)
4161 uint64_t query_data64
;
4163 query_data64
= tvb_get_uint64(tvb
, offset
, encoding
);
4164 count
= (unsigned)(query_data64
>> 32);
4167 for (i
= 0; i
< count
; i
++) {
4168 proto_tree_add_item(tree
, hf_afp_float
, tvb
, offset
, 8, encoding
);
4176 spotlight_CNID_array(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
, unsigned encoding
)
4179 uint64_t query_data64
;
4183 query_data64
= tvb_get_uint64(tvb
, offset
, encoding
);
4184 count
= (unsigned)(query_data64
& 0xffff);
4185 unknown1
= (query_data64
& 0xffff0000) >> 16;
4186 unknown2
= (uint32_t)(query_data64
>> 32);
4188 proto_tree_add_uint(tree
, hf_afp_unknown16
, tvb
, offset
+ 2, 2, unknown1
);
4189 proto_tree_add_uint(tree
, hf_afp_unknown32
, tvb
, offset
+ 4, 4, unknown2
);
4194 proto_tree_add_item(tree
, hf_afp_cnid
, tvb
, offset
, 8, encoding
);
4201 static const val64_string qtype_string_values
[] = {
4202 {SQ_TYPE_NULL
, "null" },
4203 {SQ_TYPE_COMPLEX
, "complex"},
4204 {SQ_TYPE_INT64
, "int64" },
4205 {SQ_TYPE_BOOL
, "bool"},
4206 {SQ_TYPE_FLOAT
, "float" },
4207 {SQ_TYPE_DATA
, "data"},
4208 {SQ_TYPE_CNIDS
, "CNIDs" },
4212 static const val64_string cpx_qtype_string_values
[] = {
4213 {SQ_CPX_TYPE_ARRAY
, "array" },
4214 {SQ_CPX_TYPE_STRING
, "string"},
4215 {SQ_CPX_TYPE_UTF16_STRING
, "utf-16 string" },
4216 {SQ_CPX_TYPE_DICT
, "dictionary"},
4217 {SQ_CPX_TYPE_CNIDS
, "CNIDs" },
4218 {SQ_CPX_TYPE_FILEMETA
, "FileMeta"},
4223 // NOLINTNEXTLINE(misc-no-recursion)
4224 spotlight_dissect_query_loop(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
,
4225 uint64_t cpx_query_type
, int count
, int toc_offset
, unsigned encoding
)
4230 uint64_t query_data64
;
4232 uint64_t query_type
;
4233 uint64_t complex_query_type
;
4234 unsigned byte_order
;
4236 tvbuff_t
*spotlight_tvb
;
4239 proto_item
*item_query
;
4240 proto_tree
*sub_tree
;
4243 * This loops through a possibly nested query data structure.
4244 * The outermost one is always without count and called from
4245 * dissect_spotlight() with count = prefs.gui_max_tree_depth
4246 * thus the while (...) loop terminates if (offset >= toc_offset).
4247 * If nested structures are found, these will have an encoded element
4248 * count which is used in a recursive call to
4249 * spotlight_dissect_query_loop as count parameter, thus in this case
4250 * the while (...) loop will terminate when count reaches 0.
4252 while ((offset
< (toc_offset
- 8)) && (count
> 0)) {
4253 query_data64
= tvb_get_uint64(tvb
, offset
, encoding
);
4254 query_length
= ((int)query_data64
& 0xffff) * 8;
4255 if (query_length
== 0) {
4256 /* XXX - report this as an error */
4259 query_type
= (query_data64
& 0xffff0000) >> 16;
4261 switch (query_type
) {
4262 case SQ_TYPE_COMPLEX
:
4263 toc_index
= (int)((query_data64
>> 32) - 1);
4264 query_data64
= tvb_get_uint64(tvb
, toc_offset
+ toc_index
* 8, encoding
);
4265 complex_query_type
= (query_data64
& 0xffff0000) >> 16;
4267 switch (complex_query_type
) {
4268 case SQ_CPX_TYPE_ARRAY
:
4269 case SQ_CPX_TYPE_DICT
:
4270 subquery_count
= (int)(query_data64
>> 32);
4271 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, query_length
,
4272 ett_afp_spotlight_query_line
, NULL
,
4273 "%s, toc index: %u, children: %u",
4274 val64_to_str_const(complex_query_type
, cpx_qtype_string_values
, "Unknown"),
4278 case SQ_CPX_TYPE_STRING
:
4280 query_data64
= tvb_get_uint64(tvb
, offset
+ 8, encoding
);
4281 query_length
= ((int)query_data64
& 0xffff) * 8;
4282 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, query_length
+ 8,
4283 ett_afp_spotlight_query_line
, NULL
,
4284 "%s, toc index: %u, string: '%s'",
4285 val64_to_str_const(complex_query_type
, cpx_qtype_string_values
, "Unknown"),
4287 tvb_get_string_enc(pinfo
->pool
, tvb
, offset
+ 16, query_length
- 8, ENC_UTF_8
|ENC_NA
));
4289 case SQ_CPX_TYPE_UTF16_STRING
:
4291 * This is an UTF-16 string.
4292 * Dissections show the typical byte order mark 0xFFFE or 0xFEFF, respectively.
4293 * However the existence of such a mark can not be assumed.
4294 * If the mark is missing, big endian encoding is assumed.
4295 * XXX - assume the encoding given by "encoding"?
4299 query_data64
= tvb_get_uint64(tvb
, offset
+ 8, encoding
);
4300 query_length
= ((int)query_data64
& 0xffff) * 8;
4302 byte_order
= spotlight_get_utf16_string_byte_order(tvb
, offset
+ 16, query_length
- 8, encoding
);
4303 if (byte_order
== 0xFFFFFFFF) {
4304 byte_order
= ENC_BIG_ENDIAN
;
4305 mark_exists
= false;
4309 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, query_length
+ 8,
4310 ett_afp_spotlight_query_line
, NULL
,
4311 "%s, toc index: %u, utf-16 string: '%s'",
4312 val64_to_str_const(complex_query_type
, cpx_qtype_string_values
, "Unknown"),
4314 tvb_get_string_enc(pinfo
->pool
, tvb
, offset
+ (mark_exists
? 18 : 16),
4315 query_length
- (mark_exists
? 10 : 8), ENC_UTF_16
| byte_order
));
4319 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, query_length
,
4320 ett_afp_spotlight_query_line
, NULL
,
4321 "type: %s (%s), toc index: %u, children: %u",
4322 val64_to_str_const(query_type
, qtype_string_values
, "Unknown"),
4323 val64_to_str_const(complex_query_type
, cpx_qtype_string_values
, "Unknown"),
4330 offset
= spotlight_dissect_query_loop(tvb
, pinfo
, sub_tree
, offset
, complex_query_type
, subquery_count
, toc_offset
, encoding
);
4334 subquery_count
= (int)(query_data64
>> 32);
4335 if (subquery_count
> count
) {
4336 item_query
= proto_tree_add_item(tree
, hf_afp_null
, tvb
, offset
, query_length
, ENC_NA
);
4337 expert_add_info_format(pinfo
, item_query
, &ei_afp_subquery_count_over_query_count
,
4338 "Subquery count (%d) > query count (%d)", subquery_count
, count
);
4340 } else if (subquery_count
> 20) {
4341 item_query
= proto_tree_add_item(tree
, hf_afp_null
, tvb
, offset
, query_length
, ENC_NA
);
4342 expert_add_info_format(pinfo
, item_query
, &ei_afp_abnormal_num_subqueries
,
4343 "Abnormal number of subqueries (%d)", subquery_count
);
4344 count
-= subquery_count
;
4346 for (i
= 0; i
< subquery_count
; i
++, count
--)
4347 proto_tree_add_item(tree
, hf_afp_null
, tvb
, offset
, query_length
, encoding
);
4349 offset
+= query_length
;
4352 proto_tree_add_uint64_format_value(tree
, hf_afp_bool
, tvb
, offset
, query_length
, (query_data64
>> 32), "%s", (query_data64
>> 32) ? "true" : "false");
4354 offset
+= query_length
;
4357 sub_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, 8, ett_afp_spotlight_query_line
, NULL
, "int64");
4358 j
= spotlight_int64(tvb
, sub_tree
, offset
, encoding
);
4360 offset
+= query_length
;
4363 sub_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, 8, ett_afp_spotlight_query_line
, NULL
, "UUID");
4364 j
= spotlight_uuid(tvb
, sub_tree
, offset
, encoding
);
4366 offset
+= query_length
;
4369 sub_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, 8, ett_afp_spotlight_query_line
, NULL
, "float");
4370 j
= spotlight_float(tvb
, sub_tree
, offset
, encoding
);
4372 offset
+= query_length
;
4375 switch (cpx_query_type
) {
4376 case SQ_CPX_TYPE_STRING
:
4377 str_tmp
= (char*)tvb_get_string_enc(pinfo
->pool
, tvb
, offset
+ 8, query_length
- 8, ENC_UTF_8
|ENC_NA
);
4378 proto_tree_add_string(tree
, hf_afp_string
, tvb
, offset
, query_length
, str_tmp
);
4380 case SQ_CPX_TYPE_UTF16_STRING
: {
4381 /* description see above */
4382 byte_order
= spotlight_get_utf16_string_byte_order(tvb
, offset
+ 16, query_length
- 8, encoding
);
4383 if (byte_order
== 0xFFFFFFFF) {
4384 byte_order
= ENC_BIG_ENDIAN
;
4385 mark_exists
= false;
4389 str_tmp
= (char*)tvb_get_string_enc(pinfo
->pool
, tvb
, offset
+ (mark_exists
? 10 : 8),
4390 query_length
- (mark_exists
? 10 : 8), ENC_UTF_16
| byte_order
);
4391 proto_tree_add_string(tree
, hf_afp_utf_16_string
, tvb
, offset
, query_length
, str_tmp
);
4394 case SQ_CPX_TYPE_FILEMETA
:
4395 sub_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, query_length
,
4396 ett_afp_spotlight_query_line
, &item_query
, "filemeta");
4397 if (query_length
<= 8) {
4398 proto_item_append_text(item_query
, " (empty)");
4400 spotlight_tvb
= tvb_new_subset_length(tvb
, offset
+8, query_length
);
4401 call_dissector(spotlight_handle
, spotlight_tvb
, pinfo
, sub_tree
);
4406 offset
+= query_length
;
4409 sub_tree
= proto_tree_add_subtree(tree
, tvb
, offset
, query_length
,
4410 ett_afp_spotlight_query_line
, &item_query
, "CNID Array");
4411 if (query_length
<= 8) {
4412 proto_item_append_text(item_query
, " (empty)");
4414 spotlight_CNID_array(tvb
, sub_tree
, offset
+ 8, encoding
);
4417 offset
+= query_length
;
4420 if ((j
= spotlight_date(tvb
, pinfo
, tree
, offset
, encoding
)) == -1)
4423 offset
+= query_length
;
4426 proto_tree_add_string(tree
, hf_afp_query_type
, tvb
, offset
, query_length
, val64_to_str_const(query_type
, qtype_string_values
, "Unknown"));
4428 offset
+= query_length
;
4436 static const val64_string endian_vals
[] = {
4437 {0, "Little Endian" },
4442 dissect_spotlight(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
4447 uint64_t toc_offset
;
4452 proto_tree
*sub_tree_queries
;
4453 proto_tree
*sub_tree_toc
;
4456 if (strncmp((char*)tvb_get_string_enc(pinfo
->pool
, tvb
, offset
, 8, ENC_UTF_8
|ENC_NA
), "md031234", 8) == 0)
4457 encoding
= ENC_BIG_ENDIAN
;
4459 encoding
= ENC_LITTLE_ENDIAN
;
4460 proto_tree_add_uint64(tree
, hf_afp_endianness
, tvb
, offset
, 8, (encoding
== ENC_BIG_ENDIAN
));
4463 toc_offset
= (tvb_get_uint64(tvb
, offset
, encoding
) >> 32) * 8;
4464 if (toc_offset
< 8) {
4465 ti
= proto_tree_add_uint64(tree
, hf_afp_toc_offset
, tvb
, offset
, 8, toc_offset
);
4466 expert_add_info_format(pinfo
, ti
, &ei_afp_toc_offset
, "%" PRIu64
" < 8 (bogus)", toc_offset
);
4467 return tvb_captured_length(tvb
);
4470 if (offset
+ toc_offset
+ 8 > INT_MAX
) {
4471 ti
= proto_tree_add_uint64(tree
, hf_afp_toc_offset
, tvb
, offset
, 8, toc_offset
);
4472 expert_add_info_format(pinfo
, ti
, &ei_afp_toc_offset
, "%" PRIu64
" > %u (bogus)", toc_offset
, INT_MAX
- 8 - offset
);
4473 return tvb_captured_length(tvb
);
4475 querylen
= (tvb_get_uint64(tvb
, offset
, encoding
) & 0xffffffff) * 8;
4477 ti
= proto_tree_add_uint64(tree
, hf_afp_toc_offset
, tvb
, offset
, 8, toc_offset
);
4478 expert_add_info_format(pinfo
, ti
, &ei_afp_toc_offset
, "%" PRIu64
" Bytes, Query length: %" PRIu64
" < 8 (bogus)",
4479 toc_offset
, querylen
);
4480 return tvb_captured_length(tvb
);
4483 if (querylen
> INT_MAX
) {
4484 ti
= proto_tree_add_uint64(tree
, hf_afp_toc_offset
, tvb
, offset
, 8, toc_offset
);
4485 expert_add_info_format(pinfo
, ti
, &ei_afp_toc_offset
, "%" PRIu64
" Bytes, Query length: %" PRIu64
" > %u (bogus)",
4486 toc_offset
, querylen
, INT_MAX
);
4487 return tvb_captured_length(tvb
);
4489 proto_tree_add_uint64(tree
, hf_afp_toc_offset
, tvb
, offset
, 8, toc_offset
);
4490 proto_tree_add_uint64(tree
, hf_afp_query_len
, tvb
, offset
, 8, querylen
);
4493 toc_entries
= (int)(tvb_get_uint64(tvb
, offset
+ (int)toc_offset
, encoding
) & 0xffff);
4495 sub_tree_queries
= proto_tree_add_subtree(tree
, tvb
, offset
, (int)toc_offset
,
4496 ett_afp_spotlight_queries
, NULL
,
4497 "Spotlight RPC data");
4500 offset
= spotlight_dissect_query_loop(tvb
, pinfo
, sub_tree_queries
, offset
, SQ_CPX_TYPE_ARRAY
, prefs
.gui_max_tree_depth
, offset
+ (int)toc_offset
+ 8, encoding
);
4503 sub_tree_toc
= proto_tree_add_subtree_format(tree
, tvb
, offset
,
4504 (int)querylen
- (int)toc_offset
,
4505 ett_afp_spotlight_toc
, &ti
,
4506 "Complex types ToC (%u entries)",
4508 if (toc_entries
< 1) {
4509 proto_item_append_text(ti
, " (%u < 1 - bogus)", toc_entries
);
4510 return tvb_captured_length(tvb
);
4512 proto_item_append_text(ti
, " (%u entries)", toc_entries
);
4515 proto_tree_add_uint(sub_tree_toc
, hf_afp_num_toc_entries
, tvb
, offset
, 2, toc_entries
);
4516 proto_tree_add_item(sub_tree_toc
, hf_afp_unknown16
, tvb
, offset
+ 2, 2, ENC_BIG_ENDIAN
);
4517 proto_tree_add_item(sub_tree_toc
, hf_afp_unknown32
, tvb
, offset
+ 4, 4, ENC_BIG_ENDIAN
);
4520 for (i
= 0; i
< toc_entries
; i
++, offset
+= 8) {
4521 toc_entry
= tvb_get_uint64(tvb
, offset
, encoding
);
4522 switch((toc_entry
& 0xffff0000) >> 16)
4524 case SQ_CPX_TYPE_ARRAY
:
4525 case SQ_CPX_TYPE_DICT
:
4526 proto_tree_add_uint64_format(sub_tree_toc
, hf_afp_toc_entry
, tvb
, offset
, 8, toc_entry
,
4527 "%u: count: %" PRIu64
", type: %s, offset: %" PRIu64
,
4528 i
+1, toc_entry
>> 32, val64_to_str_const((toc_entry
& 0xffff0000) >> 16, cpx_qtype_string_values
, "Unknown"),
4529 (toc_entry
& 0xffff) * 8);
4531 case SQ_CPX_TYPE_STRING
:
4532 case SQ_CPX_TYPE_UTF16_STRING
:
4533 proto_tree_add_uint64_format(sub_tree_toc
, hf_afp_toc_entry
, tvb
, offset
, 8, toc_entry
,
4534 "%u: pad byte count: %" PRIx64
", type: %s, offset: %" PRIu64
,
4535 i
+1, 8 - (toc_entry
>> 32), val64_to_str_const((toc_entry
& 0xffff0000) >> 16, cpx_qtype_string_values
, "Unknown"),
4536 (toc_entry
& 0xffff) * 8);
4539 proto_tree_add_uint64_format(sub_tree_toc
, hf_afp_toc_entry
, tvb
, offset
, 8, toc_entry
,
4540 "%u: unknown: 0x%08" PRIx64
", type: %s, offset: %" PRIu64
,
4541 i
+1, toc_entry
>> 32, val64_to_str_const((toc_entry
& 0xffff0000) >> 16, cpx_qtype_string_values
, "Unknown"),
4542 (toc_entry
& 0xffff) * 8);
4550 dissect_query_afp_spotlight(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
, afp_request_val
*request_val
)
4553 tvbuff_t
*spotlight_tvb
;
4556 offset
= decode_vol(tree
, tvb
, offset
);
4558 proto_tree_add_item(tree
, hf_afp_spotlight_request_flags
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4561 proto_tree_add_item(tree
, hf_afp_spotlight_request_command
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4564 proto_tree_add_item(tree
, hf_afp_spotlight_request_reserved
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4567 switch (request_val
->spotlight_req_command
) {
4569 case SPOTLIGHT_CMD_GET_VOLPATH
:
4570 tvb_get_stringz_enc(pinfo
->pool
, tvb
, offset
, &len
, ENC_UTF_8
|ENC_NA
);
4571 proto_tree_add_item(tree
, hf_afp_spotlight_volpath_client
, tvb
, offset
, len
, ENC_UTF_8
);
4575 case SPOTLIGHT_CMD_GET_VOLID
:
4579 case SPOTLIGHT_CMD_GET_THREE
:
4580 proto_tree_add_item(tree
, hf_afp_spotlight_volflags
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4583 proto_tree_add_item(tree
, hf_afp_spotlight_reqlen
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4586 spotlight_tvb
= tvb_new_subset_remaining(tvb
, offset
);
4587 offset
+= call_dissector(spotlight_handle
, spotlight_tvb
, pinfo
, tree
);
4593 /* ************************** */
4595 decode_acl_list_bitmap(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
)
4598 static int * const bitmaps
[] = {
4599 &hf_afp_acl_list_bitmap_UUID
,
4600 &hf_afp_acl_list_bitmap_GRPUUID
,
4601 &hf_afp_acl_list_bitmap_ACL
,
4602 &hf_afp_acl_list_bitmap_REMOVEACL
,
4603 &hf_afp_acl_list_bitmap_Inherit
,
4607 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_acl_list_bitmap
,
4608 ett_afp_acl_list_bitmap
, bitmaps
, ENC_BIG_ENDIAN
);
4609 bitmap
= tvb_get_ntohs(tvb
, offset
);
4614 /* ************************** */
4616 decode_ace_flags_bitmap(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
)
4620 static int * const bitmaps
[] = {
4621 &hf_afp_ace_flags_allow
,
4622 &hf_afp_ace_flags_deny
,
4623 &hf_afp_ace_flags_inherited
,
4624 &hf_afp_ace_flags_fileinherit
,
4625 &hf_afp_ace_flags_dirinherit
,
4626 &hf_afp_ace_flags_limitinherit
,
4627 &hf_afp_ace_flags_onlyinherit
,
4631 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_afp_ace_flags
,
4632 ett_afp_ace_flags
, bitmaps
, ENC_BIG_ENDIAN
);
4633 bitmap
= tvb_get_ntohl(tvb
, offset
);
4639 decode_kauth_ace(tvbuff_t
*tvb
, proto_tree
*tree
, int offset
)
4641 /* FIXME: preliminary decoding... */
4643 proto_tree_add_item(tree
, hf_afp_UUID
, tvb
, offset
, 16, ENC_BIG_ENDIAN
);
4646 decode_ace_flags_bitmap(tvb
, tree
, offset
);
4649 decode_acl_access_bitmap(tvb
, tree
, offset
);
4658 #define AFP_MAX_ACL_ENTRIES 500 /* Arbitrary. */
4660 decode_kauth_acl(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
4662 uint32_t num_entries
, i
;
4663 proto_tree
*sub_tree
, *ace_tree
;
4666 item
= proto_tree_add_item_ret_uint(tree
, hf_afp_acl_entrycount
,
4667 tvb
, offset
, 4, ENC_BIG_ENDIAN
, &num_entries
);
4668 sub_tree
= proto_item_add_subtree(item
, ett_afp_ace_entries
);
4671 proto_tree_add_item(tree
, hf_afp_acl_flags
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4674 if (num_entries
> AFP_MAX_ACL_ENTRIES
) {
4675 expert_add_info_format(pinfo
, item
, &ei_afp_too_many_acl_entries
,
4676 "Too many ACL entries (%u). Stopping dissection.",
4681 for (i
= 0; i
< num_entries
; i
++) {
4682 ace_tree
= proto_tree_add_subtree_format(sub_tree
, tvb
, offset
, 24, ett_afp_ace_entry
, NULL
, "ACE: %u", i
);
4683 offset
= decode_kauth_ace(tvb
, ace_tree
, offset
);
4690 decode_uuid_acl(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
, uint16_t bitmap
)
4695 if ((bitmap
& kFileSec_UUID
)) {
4696 proto_tree_add_item(tree
, hf_afp_UUID
, tvb
, offset
, 16, ENC_BIG_ENDIAN
);
4700 if ((bitmap
& kFileSec_GRPUUID
)) {
4701 proto_tree_add_item(tree
, hf_afp_GRPUUID
, tvb
, offset
, 16, ENC_BIG_ENDIAN
);
4705 if ((bitmap
& kFileSec_ACL
)) {
4706 offset
= decode_kauth_acl(tvb
, pinfo
, tree
, offset
);
4712 /* ************************** */
4714 dissect_query_afp_set_acl(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
4719 offset
= decode_vol_did(tree
, tvb
, offset
);
4721 bitmap
= decode_acl_list_bitmap(tvb
, tree
, offset
);
4724 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
4726 offset
= decode_uuid_acl(tvb
, pinfo
, tree
, offset
, bitmap
);
4731 /* ************************** */
4733 dissect_query_afp_get_acl(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
4736 offset
= decode_vol_did(tree
, tvb
, offset
);
4738 decode_acl_list_bitmap(tvb
, tree
, offset
);
4741 proto_tree_add_item(tree
, hf_afp_max_reply_size32
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4744 offset
= decode_name(tree
, pinfo
, tvb
, offset
);
4749 /* -------------------------- */
4751 dissect_reply_afp_get_acl(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
4755 bitmap
= decode_acl_list_bitmap(tvb
, tree
, offset
);
4758 offset
= decode_uuid_acl(tvb
, pinfo
, tree
, offset
, bitmap
);
4763 /* ************************** */
4765 dissect_reply_afp_spotlight(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
, afp_request_val
*request_val
)
4768 tvbuff_t
*spotlight_tvb
;
4770 switch (request_val
->spotlight_req_command
) {
4772 case SPOTLIGHT_CMD_GET_VOLPATH
:
4773 proto_tree_add_item(tree
, hf_afp_vol_id
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4776 proto_tree_add_item(tree
, hf_afp_spotlight_reply_reserved
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4779 tvb_get_stringz_enc(pinfo
->pool
, tvb
, offset
, &len
, ENC_UTF_8
|ENC_NA
);
4780 proto_tree_add_item(tree
, hf_afp_spotlight_volpath_server
, tvb
, offset
, len
, ENC_UTF_8
);
4784 case SPOTLIGHT_CMD_GET_VOLID
:
4785 proto_tree_add_item(tree
, hf_afp_spotlight_volflags
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4789 case SPOTLIGHT_CMD_GET_THREE
:
4790 proto_tree_add_item(tree
, hf_afp_spotlight_returncode
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
4793 spotlight_tvb
= tvb_new_subset_remaining(tvb
, offset
);
4794 offset
+= call_dissector(spotlight_handle
, spotlight_tvb
, pinfo
, tree
);
4800 /* -----------------------------
4801 from netatalk/etc/afpd/status.c
4805 #define AFPSRVRINFO_COPY (1<<0) /* supports copyfile */
4806 #define AFPSRVRINFO_PASSWD (1<<1) /* supports change password */
4807 #define AFPSRVRINFO_NOSAVEPASSWD (1<<2) /* don't allow save password */
4808 #define AFPSRVRINFO_SRVMSGS (1<<3) /* supports server messages */
4809 #define AFPSRVRINFO_SRVSIGNATURE (1<<4) /* supports server signature */
4810 #define AFPSRVRINFO_TCPIP (1<<5) /* supports tcpip */
4811 #define AFPSRVRINFO_SRVNOTIFY (1<<6) /* supports server notifications */
4812 #define AFPSRVRINFO_SRVRECONNECT (1<<7) /* supports reconnect */
4813 #define AFPSRVRINFO_SRVDIRECTORY (1<<8) /* supports directory services */
4814 #define AFPSRVRINFO_SRVUTF8 (1<<9) /* supports UTF8 names AFP 3.1 */
4815 #define AFPSRVRINFO_UUID (1<<10) /* supports UUIDs AFP 3.2 */
4816 #define AFPSRVRINFO_EXT_SLEEP (1<<11) /* supports extended sleep, AFP 3.3 */
4817 #define AFPSRVRINFO_FASTBOZO (1<<15) /* fast copying */
4819 #define AFPSTATUS_MACHOFF 0
4820 #define AFPSTATUS_VERSOFF 2
4821 #define AFPSTATUS_UAMSOFF 4
4822 #define AFPSTATUS_ICONOFF 6
4823 #define AFPSTATUS_FLAGOFF 8
4824 #define AFPSTATUS_PRELEN 10
4825 #define AFPSTATUS_POSTLEN 4
4826 #define AFPSTATUS_LEN (AFPSTATUS_PRELEN + AFPSTATUS_POSTLEN)
4828 #define INET6_ADDRLEN 16
4831 dissect_afp_server_status(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
4834 proto_tree
*sub_tree
;
4837 uint8_t server_name_len
;
4838 uint16_t sign_ofs
= 0;
4839 uint16_t adr_ofs
= 0;
4840 uint16_t dir_ofs
= 0;
4841 uint16_t utf_ofs
= 0;
4842 int variable_data_offset
;
4847 static int * const flags
[] = {
4848 &hf_afp_server_flag_copyfile
,
4849 &hf_afp_server_flag_passwd
,
4850 &hf_afp_server_flag_no_save_passwd
,
4851 &hf_afp_server_flag_srv_msg
,
4852 &hf_afp_server_flag_srv_sig
,
4853 &hf_afp_server_flag_tcpip
,
4854 &hf_afp_server_flag_notify
,
4855 &hf_afp_server_flag_reconnect
,
4856 &hf_afp_server_flag_directory
,
4857 &hf_afp_server_flag_utf8_name
,
4858 &hf_afp_server_flag_uuid
,
4859 &hf_afp_server_flag_ext_sleep
,
4860 &hf_afp_server_flag_fast_copy
,
4864 tree
= proto_tree_add_subtree(tree
, tvb
, offset
, -1, ett_afp_status
, NULL
, "Get Status");
4866 proto_tree_add_item(tree
, hf_afp_machine_offset
, tvb
, AFPSTATUS_MACHOFF
, 2, ENC_BIG_ENDIAN
);
4868 proto_tree_add_item(tree
, hf_afp_version_offset
, tvb
, AFPSTATUS_VERSOFF
, 2, ENC_BIG_ENDIAN
);
4870 proto_tree_add_item(tree
, hf_afp_uams_offset
, tvb
, AFPSTATUS_UAMSOFF
, 2, ENC_BIG_ENDIAN
);
4872 proto_tree_add_item(tree
, hf_afp_icon_offset
, tvb
, AFPSTATUS_ICONOFF
, 2, ENC_BIG_ENDIAN
);
4874 flag
= tvb_get_ntohs(tvb
, AFPSTATUS_FLAGOFF
);
4876 proto_tree_add_bitmask(tree
, tvb
, AFPSTATUS_FLAGOFF
, hf_afp_server_flag
,
4877 ett_afp_status_server_flag
, flags
, ENC_BIG_ENDIAN
);
4879 offset
= AFPSTATUS_PRELEN
;
4880 server_name_len
= tvb_get_uint8(tvb
, offset
);
4881 proto_tree_add_item(tree
, hf_afp_server_name
, tvb
, offset
, 1, ENC_ASCII
|ENC_BIG_ENDIAN
);
4882 offset
+= 1 + server_name_len
; /* 1 for the length byte */
4884 if ((flag
& AFPSRVRINFO_SRVSIGNATURE
)) {
4887 sign_ofs
= tvb_get_ntohs(tvb
, offset
);
4888 proto_tree_add_item(tree
, hf_afp_signature_offset
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4892 if ((flag
& AFPSRVRINFO_TCPIP
)) {
4895 adr_ofs
= tvb_get_ntohs(tvb
, offset
);
4896 proto_tree_add_item(tree
, hf_afp_network_address_offset
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4900 if ((flag
& AFPSRVRINFO_SRVDIRECTORY
)) {
4903 dir_ofs
= tvb_get_ntohs(tvb
, offset
);
4904 proto_tree_add_item(tree
, hf_afp_directory_services_offset
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4908 if ((flag
& AFPSRVRINFO_SRVUTF8
)) {
4911 utf_ofs
= tvb_get_ntohs(tvb
, offset
);
4912 proto_tree_add_item(tree
, hf_afp_utf8_server_name_offset
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
4917 * XXX - should also check for overlap between "variable data" fields;
4918 * that requires keeping all the offsets and lengths and checking
4919 * against all the ones we've dissected so far.
4921 * XXX - should report an error if there's overlap, rather than
4922 * just ignoring the field.
4924 variable_data_offset
= offset
;
4925 offset
= tvb_get_ntohs(tvb
, AFPSTATUS_MACHOFF
);
4927 if (offset
>= variable_data_offset
) {
4928 proto_tree_add_item(tree
, hf_afp_server_type
, tvb
, offset
, 1, ENC_ASCII
|ENC_BIG_ENDIAN
);
4932 offset
= tvb_get_ntohs(tvb
, AFPSTATUS_VERSOFF
);
4934 if (offset
>= variable_data_offset
) {
4935 nbe
= tvb_get_uint8(tvb
, offset
);
4936 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 1,
4937 ett_afp_vers
, NULL
, "Version list: %u", nbe
);
4939 for (i
= 0; i
< nbe
; i
++) {
4940 len
= tvb_get_uint8(tvb
, offset
);
4941 proto_tree_add_item(sub_tree
, hf_afp_server_vers
, tvb
, offset
, 1, ENC_ASCII
|ENC_BIG_ENDIAN
);
4947 offset
= tvb_get_ntohs(tvb
, AFPSTATUS_UAMSOFF
);
4949 if (offset
>= variable_data_offset
) {
4950 nbe
= tvb_get_uint8(tvb
, offset
);
4951 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 1,
4952 ett_afp_uams
, NULL
, "UAMS list: %u", nbe
);
4954 for (i
= 0; i
< nbe
; i
++) {
4955 len
= tvb_get_uint8(tvb
, offset
);
4956 proto_tree_add_item(sub_tree
, hf_afp_server_uams
, tvb
, offset
, 1, ENC_ASCII
|ENC_BIG_ENDIAN
);
4962 offset
= tvb_get_ntohs(tvb
, AFPSTATUS_ICONOFF
);
4964 if (offset
>= variable_data_offset
)
4965 proto_tree_add_item(tree
, hf_afp_server_icon
, tvb
, offset
, 256, ENC_NA
);
4968 if ((flag
& AFPSRVRINFO_SRVSIGNATURE
)) {
4969 if (sign_ofs
>= variable_data_offset
)
4970 proto_tree_add_item(tree
, hf_afp_server_signature
, tvb
, sign_ofs
, 16, ENC_NA
);
4973 if ((flag
& AFPSRVRINFO_TCPIP
)) {
4974 if (adr_ofs
>= variable_data_offset
) {
4975 proto_tree
*adr_tree
;
4982 nbe
= tvb_get_uint8(tvb
, offset
);
4983 adr_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 1,
4984 ett_afp_server_addr
, NULL
, "Address list: %d", nbe
);
4986 for (i
= 0; i
< nbe
; i
++) {
4989 len
= tvb_get_uint8(tvb
, offset
);
4990 type
= tvb_get_uint8(tvb
, offset
+1);
4993 sub_tree
= proto_tree_add_subtree_format(adr_tree
, tvb
, offset
, len
, ett_afp_server_addr_line
, NULL
, "IP: %s", tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+2));
4995 case 2: /* IP + port */
4996 port
= tvb_get_ntohs(tvb
, offset
+6);
4997 sub_tree
= proto_tree_add_subtree_format(adr_tree
, tvb
, offset
, len
,
4998 ett_afp_server_addr_line
, NULL
,
4999 "IP: %s:%d", tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+2), port
);
5001 case 3: /* DDP, atalk_addr_to_str want host order not network */
5002 net
= tvb_get_ntohs(tvb
, offset
+2);
5003 node
= tvb_get_uint8(tvb
, offset
+4);
5004 port
= tvb_get_uint8(tvb
, offset
+5);
5005 sub_tree
= proto_tree_add_subtree_format(adr_tree
, tvb
, offset
, len
,
5006 ett_afp_server_addr_line
, NULL
,
5007 "DDP: %u.%u:%u", net
, node
, port
);
5010 case 5: /* SSH tunnel */
5012 * The AFP specifcation says of
5013 * the SSH tunnel type:
5015 * IP address (four bytes) with port
5016 * number (2 bytes). If this tag is
5017 * present and the client is so
5018 * configured, the client attempts
5019 * to build a Secure Shell (SSH)
5020 * tunnel between itself and the
5021 * server and tries to connect
5022 * through it. This functionality
5025 * and, in the only place I've seen
5026 * it, it was like DNS.
5028 * So we treat it as DNS.
5030 * XXX - should we treat it as
5031 * IP+port if this is transported
5032 * over ASP rather DSI? The old
5033 * ASP code to dissect this
5034 * dissected it as IP+port.
5037 /* XXX - internationalized DNS? */
5038 tmp
= tvb_get_string_enc(pinfo
->pool
, tvb
, offset
+2, len
-2, ENC_ASCII
|ENC_NA
);
5039 sub_tree
= proto_tree_add_subtree_format(adr_tree
, tvb
, offset
, len
, ett_afp_server_addr_line
, NULL
, "%s: %s", (type
==4)?"DNS":"IP (SSH tunnel)", tmp
);
5043 sub_tree
= proto_tree_add_subtree(adr_tree
, tvb
, offset
, len
,
5044 ett_afp_server_addr_line
, NULL
, "Malformed DNS address");
5048 sub_tree
= proto_tree_add_subtree_format(adr_tree
, tvb
, offset
, len
, ett_afp_server_addr_line
, NULL
, "IPv6: %s", tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
+2));
5050 case 7: /* IP6 + 2bytes port */
5051 port
= tvb_get_ntohs(tvb
, offset
+ 2+INET6_ADDRLEN
);
5052 sub_tree
= proto_tree_add_subtree_format(adr_tree
, tvb
, offset
, len
,
5053 ett_afp_server_addr_line
, NULL
,
5054 "IPv6: %s:%d", tvb_ip6_to_str(pinfo
->pool
, tvb
, offset
+2), port
);
5057 sub_tree
= proto_tree_add_subtree_format(adr_tree
, tvb
, offset
, len
, ett_afp_server_addr_line
, NULL
, "Unknown type: %u", type
);
5061 proto_tree_add_item(sub_tree
, hf_afp_server_addr_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
5063 proto_tree_add_item(sub_tree
, hf_afp_server_addr_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
5065 proto_tree_add_item(sub_tree
, hf_afp_server_addr_value
,tvb
, offset
, len
, ENC_NA
);
5071 if ((flag
& AFPSRVRINFO_SRVDIRECTORY
)) {
5072 if (dir_ofs
>= variable_data_offset
) {
5074 nbe
= tvb_get_uint8(tvb
, offset
);
5075 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, 1,
5076 ett_afp_directory
, NULL
, "Directory services list: %d", nbe
);
5078 for (i
= 0; i
< nbe
; i
++) {
5079 len
= tvb_get_uint8(tvb
, offset
);
5080 proto_tree_add_item(sub_tree
, hf_afp_server_directory
, tvb
, offset
, 1, ENC_ASCII
|ENC_BIG_ENDIAN
);
5086 if ((flag
& AFPSRVRINFO_SRVUTF8
)) {
5087 if (utf_ofs
>= variable_data_offset
) {
5092 ulen
= tvb_get_ntohs(tvb
, offset
);
5093 tmp
= (char*)tvb_get_string_enc(pinfo
->pool
, tvb
, offset
+ 2, ulen
, ENC_UTF_8
|ENC_NA
);
5094 sub_tree
= proto_tree_add_subtree_format(tree
, tvb
, offset
, ulen
+ 2,
5095 ett_afp_utf8_name
, NULL
, "UTF-8 server name: %s", tmp
);
5096 proto_tree_add_uint(sub_tree
, hf_afp_utf8_server_name_len
, tvb
, offset
, 2, ulen
);
5098 proto_tree_add_string(sub_tree
, hf_afp_utf8_server_name
, tvb
, offset
, ulen
, tmp
);
5106 /* ************************** */
5108 dissect_afp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data
)
5110 struct atp_asp_dsi_info
*atp_asp_dsi_info
= (struct atp_asp_dsi_info
*)data
;
5111 proto_tree
*afp_tree
= NULL
;
5113 conversation_t
*conversation
;
5115 afp_request_key request_key
, *new_request_key
;
5116 afp_request_val
*request_val
;
5117 uint8_t afp_command
;
5121 /* Reject the packet if data is NULL */
5125 len
= tvb_reported_length(tvb
);
5126 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "AFP");
5127 col_clear(pinfo
->cinfo
, COL_INFO
);
5129 conversation
= find_or_create_conversation(pinfo
);
5131 request_key
.conversation
= conversation
->conv_index
;
5132 request_key
.tid
= atp_asp_dsi_info
->tid
;
5134 request_val
= (afp_request_val
*) wmem_map_lookup(
5135 afp_request_hash
, &request_key
);
5137 if (!request_val
&& !atp_asp_dsi_info
->reply
) {
5138 afp_command
= tvb_get_uint8(tvb
, offset
);
5139 new_request_key
= wmem_new(wmem_file_scope(), afp_request_key
);
5140 *new_request_key
= request_key
;
5142 request_val
= wmem_new(wmem_file_scope(), afp_request_val
);
5143 request_val
->command
= afp_command
;
5145 if (afp_command
== AFP_SPOTLIGHTRPC
)
5146 request_val
->spotlight_req_command
= tvb_get_ntohl(tvb
, offset
+ 2 + 2 + 4);
5148 request_val
->spotlight_req_command
= -1;
5150 request_val
->frame_req
= pinfo
->num
;
5151 request_val
->frame_res
= 0;
5152 request_val
->req_time
=pinfo
->abs_ts
;
5154 wmem_map_insert(afp_request_hash
, new_request_key
,
5158 if (!request_val
) { /* missing request */
5159 col_set_str(pinfo
->cinfo
, COL_INFO
, "[Reply without query?]");
5160 return tvb_captured_length(tvb
);
5163 afp_command
= request_val
->command
;
5164 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "%s %s",
5165 val_to_str_ext(afp_command
, &CommandCode_vals_ext
,
5166 "Unknown command (%u)"),
5167 atp_asp_dsi_info
->reply
? "reply" : "request");
5168 if (atp_asp_dsi_info
->reply
&& atp_asp_dsi_info
->code
!= 0) {
5169 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ": %s (%d)",
5170 val_to_str_ext(atp_asp_dsi_info
->code
, &asp_error_vals_ext
,
5171 "Unknown error (%u)"), atp_asp_dsi_info
->code
);
5174 ti
= proto_tree_add_item(tree
, proto_afp
, tvb
, offset
, -1, ENC_NA
);
5175 afp_tree
= proto_item_add_subtree(ti
, ett_afp
);
5177 if (!atp_asp_dsi_info
->reply
) {
5179 ti
= proto_tree_add_uint(afp_tree
, hf_afp_command
, tvb
,offset
, 1, afp_command
);
5180 if (afp_command
!= tvb_get_uint8(tvb
, offset
)) {
5181 /* we have the same conversation for different connections eg:
5182 * ip1:2048 --> ip2:548
5183 * ip1:2048 --> ip2:548 <RST>
5185 * ip1:2048 --> ip2:548 <SYN> use the same port but it's a new session!
5187 col_set_str(pinfo
->cinfo
, COL_INFO
,
5188 "[Error!IP port reused, you need to split the capture file]");
5189 expert_add_info(pinfo
, ti
, &ei_afp_ip_port_reused
);
5190 return tvb_captured_length(tvb
);
5194 * Put in a field for the frame number of the frame to which
5195 * this is a response if we know that frame number (i.e.,
5198 if (request_val
->frame_res
!= 0) {
5199 ti
= proto_tree_add_uint(afp_tree
, hf_afp_response_in
,
5200 tvb
, 0, 0, request_val
->frame_res
);
5201 proto_item_set_generated(ti
);
5205 switch (afp_command
) {
5207 offset
= dissect_query_afp_byte_lock(tvb
, pinfo
, afp_tree
, offset
);
5209 case AFP_BYTELOCK_EXT
:
5210 offset
= dissect_query_afp_byte_lock_ext(tvb
, pinfo
, afp_tree
, offset
);
5212 case AFP_OPENDT
: /* same as close vol */
5215 offset
= dissect_query_afp_with_vol_id(tvb
, pinfo
, afp_tree
, offset
);
5218 /* offset = dissect_query_afp_close_dir(tvb, pinfo, afp_tree, offset); */
5221 offset
= dissect_query_afp_close_dt(tvb
, pinfo
, afp_tree
, offset
);
5223 case AFP_FLUSHFORK
: /* same packet as closefork */
5226 offset
= dissect_query_afp_with_fork(tvb
, pinfo
, afp_tree
, offset
);
5229 offset
= dissect_query_afp_copy_file(tvb
, pinfo
, afp_tree
, offset
);
5231 case AFP_CREATEFILE
:
5232 offset
= dissect_query_afp_create_file(tvb
, pinfo
, afp_tree
, offset
);
5234 case AFP_DISCTOLDSESS
:
5235 offset
= dissect_query_afp_disconnect_old_session(tvb
, pinfo
, afp_tree
, offset
);
5237 case AFP_ENUMERATE_EXT2
:
5238 offset
= dissect_query_afp_enumerate_ext2(tvb
, pinfo
, afp_tree
, offset
);
5240 case AFP_ENUMERATE_EXT
:
5242 offset
= dissect_query_afp_enumerate(tvb
, pinfo
, afp_tree
, offset
);
5244 case AFP_GETFORKPARAM
:
5245 offset
= dissect_query_afp_get_fork_param(tvb
, pinfo
, afp_tree
, offset
);
5247 case AFP_GETSESSTOKEN
:
5248 offset
= dissect_query_afp_get_session_token(tvb
, pinfo
, afp_tree
, offset
);
5250 case AFP_GETUSERINFO
:
5251 offset
= dissect_query_afp_get_user_info(tvb
, pinfo
, afp_tree
, offset
);
5253 case AFP_GETSRVINFO
:
5254 /* offset = dissect_query_afp_get_server_info(tvb, pinfo, afp_tree, offset); */
5256 case AFP_GETSRVPARAM
:
5257 break; /* no parameters */
5258 case AFP_GETVOLPARAM
:
5259 offset
= dissect_query_afp_get_vol_param(tvb
, pinfo
, afp_tree
, offset
);
5262 offset
= dissect_query_afp_login_ext(tvb
, pinfo
, afp_tree
, offset
);
5265 offset
= dissect_query_afp_login(tvb
, pinfo
, afp_tree
, offset
);
5271 offset
= dissect_query_afp_map_id(tvb
, pinfo
, afp_tree
, offset
);
5274 offset
= dissect_query_afp_map_name(tvb
, pinfo
, afp_tree
, offset
);
5277 offset
= dissect_query_afp_move(tvb
, pinfo
, afp_tree
, offset
);
5280 offset
= dissect_query_afp_open_vol(tvb
, pinfo
, afp_tree
, offset
);
5285 offset
= dissect_query_afp_open_fork(tvb
, pinfo
, afp_tree
, offset
);
5288 offset
= dissect_query_afp_read(tvb
, pinfo
, afp_tree
, offset
);
5291 offset
= dissect_query_afp_read_ext(tvb
, pinfo
, afp_tree
, offset
);
5294 offset
= dissect_query_afp_rename(tvb
, pinfo
, afp_tree
, offset
);
5296 case AFP_SETDIRPARAM
:
5297 offset
= dissect_query_afp_set_dir_param(tvb
, pinfo
, afp_tree
, offset
);
5299 case AFP_SETFILEPARAM
:
5300 offset
= dissect_query_afp_set_file_param(tvb
, pinfo
, afp_tree
, offset
);
5302 case AFP_SETFORKPARAM
:
5303 offset
= dissect_query_afp_set_fork_param(tvb
, pinfo
, afp_tree
, offset
);
5305 case AFP_SETVOLPARAM
:
5306 offset
= dissect_query_afp_set_vol_param(tvb
, pinfo
, afp_tree
, offset
);
5309 offset
= dissect_query_afp_write(tvb
, pinfo
, afp_tree
, offset
);
5312 offset
= dissect_query_afp_write_ext(tvb
, pinfo
, afp_tree
, offset
);
5314 case AFP_GETFLDRPARAM
:
5315 offset
= dissect_query_afp_get_fldr_param(tvb
, pinfo
, afp_tree
, offset
);
5317 case AFP_SETFLDRPARAM
:
5318 offset
= dissect_query_afp_set_fldr_param(tvb
, pinfo
, afp_tree
, offset
);
5322 case AFP_GETSRVRMSG
:
5323 offset
= dissect_query_afp_get_server_message(tvb
, pinfo
, afp_tree
, offset
);
5325 case AFP_DELETE
: /* same as create_id */
5328 offset
= dissect_query_afp_create_id(tvb
, pinfo
, afp_tree
, offset
);
5331 offset
= dissect_query_afp_delete_id(tvb
, pinfo
, afp_tree
, offset
);
5334 offset
= dissect_query_afp_resolve_id(tvb
, pinfo
, afp_tree
, offset
);
5336 case AFP_EXCHANGEFILE
:
5337 offset
= dissect_query_afp_exchange_file(tvb
, pinfo
, afp_tree
, offset
);
5339 case AFP_CATSEARCH_EXT
:
5340 offset
= dissect_query_afp_cat_search_ext(tvb
, pinfo
, afp_tree
, offset
);
5343 offset
= dissect_query_afp_cat_search(tvb
, pinfo
, afp_tree
, offset
);
5346 offset
= dissect_query_afp_get_icon(tvb
, pinfo
, afp_tree
, offset
);
5349 offset
= dissect_query_afp_get_icon_info(tvb
, pinfo
, afp_tree
, offset
);
5352 offset
= dissect_query_afp_add_appl(tvb
, pinfo
, afp_tree
, offset
);
5355 offset
= dissect_query_afp_rmv_appl(tvb
, pinfo
, afp_tree
, offset
);
5358 offset
= dissect_query_afp_get_appl(tvb
, pinfo
, afp_tree
, offset
);
5361 offset
= dissect_query_afp_add_cmt(tvb
, pinfo
, afp_tree
, offset
);
5363 case AFP_RMVCMT
: /* same as get_cmt */
5365 offset
= dissect_query_afp_get_cmt(tvb
, pinfo
, afp_tree
, offset
);
5368 offset
= dissect_query_afp_add_icon(tvb
, pinfo
, afp_tree
, offset
);
5370 case AFP_GETEXTATTR
:
5371 offset
= dissect_query_afp_get_ext_attr(tvb
, pinfo
, afp_tree
, offset
);
5373 case AFP_SETEXTATTR
:
5374 offset
= dissect_query_afp_set_ext_attr(tvb
, pinfo
, afp_tree
, offset
);
5376 case AFP_LISTEXTATTR
:
5377 offset
= dissect_query_afp_list_ext_attrs(tvb
, pinfo
, afp_tree
, offset
);
5379 case AFP_REMOVEATTR
:
5380 offset
= dissect_query_afp_remove_ext_attr(tvb
, pinfo
, afp_tree
, offset
);
5383 offset
= dissect_query_afp_get_acl(tvb
, pinfo
, afp_tree
, offset
);
5386 offset
= dissect_query_afp_set_acl(tvb
, pinfo
, afp_tree
, offset
);
5389 offset
= dissect_query_afp_access(tvb
, pinfo
, afp_tree
, offset
);
5392 offset
= dissect_query_afp_with_did(tvb
, pinfo
, afp_tree
, offset
);
5394 case AFP_SPOTLIGHTRPC
:
5395 offset
= dissect_query_afp_spotlight(tvb
, pinfo
, afp_tree
, offset
, request_val
);
5400 proto_tree_add_uint(afp_tree
, hf_afp_command
, tvb
, 0, 0, afp_command
);
5403 * Put in fields for the frame with the response to this
5404 * frame - if we know the frame number (i.e., it's not 0).
5406 if (request_val
->frame_req
!= 0) {
5407 ti
= proto_tree_add_uint(afp_tree
, hf_afp_response_to
,
5408 tvb
, 0, 0, request_val
->frame_req
);
5409 proto_item_set_generated(ti
);
5410 nstime_delta(&delta_ts
, &pinfo
->abs_ts
, &request_val
->req_time
);
5411 ti
= proto_tree_add_time(afp_tree
, hf_afp_time
, tvb
,
5413 proto_item_set_generated(ti
);
5417 * Set "frame_res" if it's not already known.
5419 if (request_val
->frame_res
== 0)
5420 request_val
->frame_res
= pinfo
->num
;
5423 * Tap the packet before the dissectors are called so we
5424 * still get the tap listener called even if there is an
5427 tap_queue_packet(afp_tap
, pinfo
, request_val
);
5430 /* for some calls if the reply is an error there's no data
5432 return tvb_captured_length(tvb
);
5435 switch (afp_command
) {
5437 offset
= dissect_reply_afp_byte_lock(tvb
, pinfo
, afp_tree
, offset
);
5439 case AFP_BYTELOCK_EXT
:
5440 offset
= dissect_reply_afp_byte_lock_ext(tvb
, pinfo
, afp_tree
, offset
);
5442 case AFP_ENUMERATE_EXT2
:
5443 case AFP_ENUMERATE_EXT
:
5444 offset
= dissect_reply_afp_enumerate_ext(tvb
, pinfo
, afp_tree
, offset
);
5447 offset
= dissect_reply_afp_enumerate(tvb
, pinfo
, afp_tree
, offset
);
5450 offset
= dissect_reply_afp_open_vol(tvb
, pinfo
, afp_tree
, offset
);
5453 offset
= dissect_reply_afp_open_fork(tvb
, pinfo
, afp_tree
, offset
);
5456 case AFP_GETFORKPARAM
:
5457 offset
= dissect_reply_afp_get_fork_param(tvb
, pinfo
, afp_tree
, offset
);
5459 case AFP_GETUSERINFO
:
5460 offset
= dissect_reply_afp_get_user_info(tvb
, pinfo
, afp_tree
, offset
);
5462 case AFP_GETSRVPARAM
:
5463 offset
= dissect_reply_afp_get_server_param(tvb
, pinfo
, afp_tree
, offset
);
5465 case AFP_GETSRVRMSG
:
5466 offset
= dissect_reply_afp_get_server_message(tvb
, pinfo
, afp_tree
, offset
);
5469 offset
= dissect_reply_afp_create_dir(tvb
, pinfo
, afp_tree
, offset
);
5472 offset
= dissect_reply_afp_map_id(tvb
, pinfo
, afp_tree
, offset
);
5475 offset
= dissect_reply_afp_map_name(tvb
, pinfo
, afp_tree
, offset
);
5477 case AFP_MOVE
: /* same as create_id */
5479 offset
= dissect_reply_afp_create_id(tvb
, pinfo
, afp_tree
, offset
);
5481 case AFP_GETSESSTOKEN
:
5482 offset
= dissect_reply_afp_get_session_token(tvb
, pinfo
, afp_tree
, offset
);
5484 case AFP_GETVOLPARAM
:
5485 offset
= dissect_reply_afp_get_vol_param(tvb
, pinfo
, afp_tree
, offset
);
5487 case AFP_GETFLDRPARAM
:
5488 offset
= dissect_reply_afp_get_fldr_param(tvb
, pinfo
, afp_tree
, offset
);
5491 offset
= dissect_reply_afp_open_dt(tvb
, pinfo
, afp_tree
, offset
);
5493 case AFP_CATSEARCH_EXT
:
5494 offset
= dissect_reply_afp_cat_search_ext(tvb
, pinfo
, afp_tree
, offset
);
5497 offset
= dissect_reply_afp_cat_search(tvb
, pinfo
, afp_tree
, offset
);
5500 offset
= dissect_reply_afp_get_icon_info(tvb
, pinfo
, afp_tree
, offset
);
5503 offset
= dissect_reply_afp_get_appl(tvb
, pinfo
, afp_tree
, offset
);
5506 offset
= dissect_reply_afp_get_cmt(tvb
, pinfo
, afp_tree
, offset
);
5509 offset
= dissect_reply_afp_write(tvb
, pinfo
, afp_tree
, offset
);
5512 offset
= dissect_reply_afp_write_ext(tvb
, pinfo
, afp_tree
, offset
);
5514 case AFP_GETEXTATTR
:
5515 offset
= dissect_reply_afp_get_ext_attr(tvb
, pinfo
, afp_tree
, offset
);
5517 case AFP_LISTEXTATTR
:
5518 offset
= dissect_reply_afp_list_ext_attrs(tvb
, pinfo
, afp_tree
, offset
);
5521 offset
= dissect_reply_afp_get_acl(tvb
, pinfo
, afp_tree
, offset
);
5523 case AFP_SPOTLIGHTRPC
:
5524 offset
= dissect_reply_afp_spotlight(tvb
, pinfo
, afp_tree
, offset
, request_val
);
5529 call_data_dissector(tvb_new_subset_remaining(tvb
, offset
),
5533 return tvb_captured_length(tvb
);
5537 proto_register_afp(void)
5540 static hf_register_info hf
[] = {
5542 { "Command", "afp.command",
5543 FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &CommandCode_vals_ext
, 0x0,
5544 "AFP function", HFILL
}},
5548 FT_NONE
, BASE_NONE
, NULL
, 0,
5549 "Pad Byte", HFILL
}},
5552 { "AFP Version", "afp.Version",
5553 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
5554 "Client AFP version", HFILL
}},
5558 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
5559 "User Authentication Method", HFILL
}},
5562 { "User", "afp.user",
5563 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
5566 { &hf_afp_user_type
,
5567 { "Type", "afp.user_type",
5568 FT_UINT8
, BASE_HEX
, VALS(path_type_vals
), 0,
5569 "Type of user name", HFILL
}},
5571 { "Len", "afp.user_len",
5572 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
5573 "User name length (unicode)", HFILL
}},
5574 { &hf_afp_user_name
,
5575 { "User", "afp.user_name",
5576 FT_STRING
, BASE_NONE
, NULL
, 0x0,
5577 "User name (unicode)", HFILL
}},
5580 { "Password", "afp.passwd",
5581 FT_STRINGZPAD
, BASE_NONE
, NULL
, 0x0,
5585 { "Random number", "afp.random",
5586 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
5587 "UAM random number", HFILL
}},
5589 { &hf_afp_response_to
,
5590 { "Response to", "afp.response_to",
5591 FT_FRAMENUM
, BASE_NONE
, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST
), 0x0,
5592 "This packet is a response to the packet in this frame", HFILL
}},
5595 { "Time from request", "afp.time",
5596 FT_RELATIVE_TIME
, BASE_NONE
, NULL
, 0x0,
5597 "Time between Request and Response for AFP cmds", HFILL
}},
5599 { &hf_afp_response_in
,
5600 { "Response in", "afp.response_in",
5601 FT_FRAMENUM
, BASE_NONE
, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE
), 0x0,
5602 "The response to this packet is in this packet", HFILL
}},
5604 { &hf_afp_login_flags
,
5605 { "Flags", "afp.login_flags",
5606 FT_UINT16
, BASE_HEX
, NULL
, 0 /* 0x0FFF*/,
5607 "Login flags", HFILL
}},
5609 { &hf_afp_vol_bitmap
,
5610 { "Bitmap", "afp.vol_bitmap",
5611 FT_UINT16
, BASE_HEX
, NULL
, 0 /* 0x0FFF*/,
5612 "Volume bitmap", HFILL
}},
5614 { &hf_afp_vol_bitmap_Attributes
,
5615 { "Attributes", "afp.vol_bitmap.attributes",
5616 FT_BOOLEAN
, 16, NULL
, kFPVolAttributeBit
,
5617 "Volume attributes", HFILL
}},
5619 { &hf_afp_vol_attribute
,
5620 { "Attributes", "afp.vol_attributes",
5621 FT_UINT16
, BASE_HEX
, NULL
, 0,
5622 "Volume attributes", HFILL
}},
5624 { &hf_afp_vol_attribute_ReadOnly
,
5625 { "Read only", "afp.vol_attribute.read_only",
5626 FT_BOOLEAN
, 16, NULL
, kReadOnly
,
5627 "Read only volume", HFILL
}},
5629 { &hf_afp_vol_attribute_HasVolumePassword
,
5630 { "Volume password", "afp.vol_attribute.passwd",
5631 FT_BOOLEAN
, 16, NULL
, kHasVolumePassword
,
5632 "Has a volume password", HFILL
}},
5634 { &hf_afp_vol_attribute_SupportsFileIDs
,
5635 { "File IDs", "afp.vol_attribute.fileIDs",
5636 FT_BOOLEAN
, 16, NULL
, kSupportsFileIDs
,
5637 "Supports file IDs", HFILL
}},
5639 { &hf_afp_vol_attribute_SupportsCatSearch
,
5640 { "Catalog search", "afp.vol_attribute.cat_search",
5641 FT_BOOLEAN
, 16, NULL
, kSupportsCatSearch
,
5642 "Supports catalog search operations", HFILL
}},
5644 { &hf_afp_vol_attribute_SupportsBlankAccessPrivs
,
5645 { "Blank access privileges", "afp.vol_attribute.blank_access_privs",
5646 FT_BOOLEAN
, 16, NULL
, kSupportsBlankAccessPrivs
,
5647 "Supports blank access privileges", HFILL
}},
5649 { &hf_afp_vol_attribute_SupportsUnixPrivs
,
5650 { "UNIX access privileges", "afp.vol_attribute.unix_privs",
5651 FT_BOOLEAN
, 16, NULL
, kSupportsUnixPrivs
,
5652 "Supports UNIX access privileges", HFILL
}},
5654 { &hf_afp_vol_attribute_SupportsUTF8Names
,
5655 { "UTF-8 names", "afp.vol_attribute.utf8_names",
5656 FT_BOOLEAN
, 16, NULL
, kSupportsUTF8Names
,
5657 "Supports UTF-8 names", HFILL
}},
5659 { &hf_afp_vol_attribute_NoNetworkUserID
,
5660 { "No Network User ID", "afp.vol_attribute.network_user_id",
5661 FT_BOOLEAN
, 16, NULL
, kNoNetworkUserIDs
,
5664 { &hf_afp_vol_attribute_DefaultPrivsFromParent
,
5665 { "Inherit parent privileges", "afp.vol_attribute.inherit_parent_privs",
5666 FT_BOOLEAN
, 16, NULL
, kDefaultPrivsFromParent
,
5669 { &hf_afp_vol_attribute_NoExchangeFiles
,
5670 { "No exchange files", "afp.vol_attribute.no_exchange_files",
5671 FT_BOOLEAN
, 16, NULL
, kNoExchangeFiles
,
5672 "Exchange files not supported", HFILL
}},
5674 { &hf_afp_vol_attribute_SupportsExtAttrs
,
5675 { "Extended Attributes", "afp.vol_attribute.extended_attributes",
5676 FT_BOOLEAN
, 16, NULL
, kSupportsExtAttrs
,
5677 "Supports Extended Attributes", HFILL
}},
5679 { &hf_afp_vol_attribute_SupportsACLs
,
5680 { "ACLs", "afp.vol_attribute.acls",
5681 FT_BOOLEAN
, 16, NULL
, kSupportsACLs
,
5682 "Supports access control lists", HFILL
}},
5684 { &hf_afp_vol_attribute_CaseSensitive
,
5685 { "Case sensitive", "afp.vol_attribute.case_sensitive",
5686 FT_BOOLEAN
, 16, NULL
, kCaseSensitive
,
5687 "Supports case-sensitive filenames", HFILL
}},
5689 { &hf_afp_vol_attribute_SupportsTMLockSteal
,
5690 { "TM lock steal", "afp.vol_attribute.TM_lock_steal",
5691 FT_BOOLEAN
, 16, NULL
, kSupportsTMLockSteal
,
5692 "Supports Time Machine lock stealing", HFILL
}},
5694 { &hf_afp_vol_bitmap_Signature
,
5695 { "Signature", "afp.vol_bitmap.signature",
5696 FT_BOOLEAN
, 16, NULL
, kFPVolSignatureBit
,
5697 "Volume signature", HFILL
}},
5699 { &hf_afp_vol_bitmap_CreateDate
,
5700 { "Creation date", "afp.vol_bitmap.create_date",
5701 FT_BOOLEAN
, 16, NULL
, kFPVolCreateDateBit
,
5702 "Volume creation date", HFILL
}},
5704 { &hf_afp_vol_bitmap_ModDate
,
5705 { "Modification date", "afp.vol_bitmap.mod_date",
5706 FT_BOOLEAN
, 16, NULL
, kFPVolModDateBit
,
5707 "Volume modification date", HFILL
}},
5709 { &hf_afp_vol_bitmap_BackupDate
,
5710 { "Backup date", "afp.vol_bitmap.backup_date",
5711 FT_BOOLEAN
, 16, NULL
, kFPVolBackupDateBit
,
5712 "Volume backup date", HFILL
}},
5714 { &hf_afp_vol_bitmap_ID
,
5715 { "ID", "afp.vol_bitmap.id",
5716 FT_BOOLEAN
, 16, NULL
, kFPVolIDBit
,
5717 "Volume ID", HFILL
}},
5719 { &hf_afp_vol_bitmap_BytesFree
,
5720 { "Bytes free", "afp.vol_bitmap.bytes_free",
5721 FT_BOOLEAN
, 16, NULL
, kFPVolBytesFreeBit
,
5722 "Volume free bytes", HFILL
}},
5724 { &hf_afp_vol_bitmap_BytesTotal
,
5725 { "Bytes total", "afp.vol_bitmap.bytes_total",
5726 FT_BOOLEAN
, 16, NULL
, kFPVolBytesTotalBit
,
5727 "Volume total bytes", HFILL
}},
5729 { &hf_afp_vol_bitmap_Name
,
5730 { "Name", "afp.vol_bitmap.name",
5731 FT_BOOLEAN
, 16, NULL
, kFPVolNameBit
,
5732 "Volume name", HFILL
}},
5734 { &hf_afp_vol_bitmap_ExtBytesFree
,
5735 { "Extended bytes free", "afp.vol_bitmap.ex_bytes_free",
5736 FT_BOOLEAN
, 16, NULL
, kFPVolExtBytesFreeBit
,
5737 "Volume extended (>2GB) free bytes", HFILL
}},
5739 { &hf_afp_vol_bitmap_ExtBytesTotal
,
5740 { "Extended bytes total", "afp.vol_bitmap.ex_bytes_total",
5741 FT_BOOLEAN
, 16, NULL
, kFPVolExtBytesTotalBit
,
5742 "Volume extended (>2GB) total bytes", HFILL
}},
5744 { &hf_afp_vol_bitmap_BlockSize
,
5745 { "Block size", "afp.vol_bitmap.block_size",
5746 FT_BOOLEAN
, 16, NULL
, kFPVolBlockSizeBit
,
5747 "Volume block size", HFILL
}},
5749 { &hf_afp_dir_bitmap_Attributes
,
5750 { "Attributes", "afp.dir_bitmap.attributes",
5751 FT_BOOLEAN
, 16, NULL
, kFPAttributeBit
,
5752 "Return attributes if directory", HFILL
}},
5754 { &hf_afp_dir_bitmap_ParentDirID
,
5755 { "DID", "afp.dir_bitmap.did",
5756 FT_BOOLEAN
, 16, NULL
, kFPParentDirIDBit
,
5757 "Return parent directory ID if directory", HFILL
}},
5759 { &hf_afp_dir_bitmap_CreateDate
,
5760 { "Creation date", "afp.dir_bitmap.create_date",
5761 FT_BOOLEAN
, 16, NULL
, kFPCreateDateBit
,
5762 "Return creation date if directory", HFILL
}},
5764 { &hf_afp_dir_bitmap_ModDate
,
5765 { "Modification date", "afp.dir_bitmap.mod_date",
5766 FT_BOOLEAN
, 16, NULL
, kFPModDateBit
,
5767 "Return modification date if directory", HFILL
}},
5769 { &hf_afp_dir_bitmap_BackupDate
,
5770 { "Backup date", "afp.dir_bitmap.backup_date",
5771 FT_BOOLEAN
, 16, NULL
, kFPBackupDateBit
,
5772 "Return backup date if directory", HFILL
}},
5774 { &hf_afp_dir_bitmap_FinderInfo
,
5775 { "Finder info", "afp.dir_bitmap.finder_info",
5776 FT_BOOLEAN
, 16, NULL
, kFPFinderInfoBit
,
5777 "Return finder info if directory", HFILL
}},
5779 { &hf_afp_dir_bitmap_LongName
,
5780 { "Long name", "afp.dir_bitmap.long_name",
5781 FT_BOOLEAN
, 16, NULL
, kFPLongNameBit
,
5782 "Return long name if directory", HFILL
}},
5784 { &hf_afp_dir_bitmap_ShortName
,
5785 { "Short name", "afp.dir_bitmap.short_name",
5786 FT_BOOLEAN
, 16, NULL
, kFPShortNameBit
,
5787 "Return short name if directory", HFILL
}},
5789 { &hf_afp_dir_bitmap_NodeID
,
5790 { "File ID", "afp.dir_bitmap.fid",
5791 FT_BOOLEAN
, 16, NULL
, kFPNodeIDBit
,
5792 "Return file ID if directory", HFILL
}},
5794 { &hf_afp_dir_bitmap_OffspringCount
,
5795 { "Offspring count", "afp.dir_bitmap.offspring_count",
5796 FT_BOOLEAN
, 16, NULL
, kFPOffspringCountBit
,
5797 "Return offspring count if directory", HFILL
}},
5799 { &hf_afp_dir_bitmap_OwnerID
,
5800 { "Owner id", "afp.dir_bitmap.owner_id",
5801 FT_BOOLEAN
, 16, NULL
, kFPOwnerIDBit
,
5802 "Return owner id if directory", HFILL
}},
5804 { &hf_afp_dir_bitmap_GroupID
,
5805 { "Group id", "afp.dir_bitmap.group_id",
5806 FT_BOOLEAN
, 16, NULL
, kFPGroupIDBit
,
5807 "Return group id if directory", HFILL
}},
5809 { &hf_afp_dir_bitmap_AccessRights
,
5810 { "Access rights", "afp.dir_bitmap.access_rights",
5811 FT_BOOLEAN
, 16, NULL
, kFPAccessRightsBit
,
5812 "Return access rights if directory", HFILL
}},
5814 { &hf_afp_dir_bitmap_UTF8Name
,
5815 { "UTF-8 name", "afp.dir_bitmap.UTF8_name",
5816 FT_BOOLEAN
, 16, NULL
, kFPUTF8NameBit
,
5817 "Return UTF-8 name if directory", HFILL
}},
5819 { &hf_afp_dir_bitmap_UnixPrivs
,
5820 { "UNIX privileges", "afp.dir_bitmap.unix_privs",
5821 FT_BOOLEAN
, 16, NULL
, kFPUnixPrivsBit
,
5822 "Return UNIX privileges if directory", HFILL
}},
5824 { &hf_afp_dir_attribute
,
5825 { "Directory Attributes", "afp.dir_attribute",
5826 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
5829 { &hf_afp_dir_attribute_Invisible
,
5830 { "Invisible", "afp.dir_attribute.invisible",
5831 FT_BOOLEAN
, 16, NULL
, kFPInvisibleBit
,
5832 "Directory is not visible", HFILL
}},
5834 { &hf_afp_dir_attribute_IsExpFolder
,
5835 { "Share point", "afp.dir_attribute.share",
5836 FT_BOOLEAN
, 16, NULL
, kFPMultiUserBit
,
5837 "Directory is a share point", HFILL
}},
5839 { &hf_afp_dir_attribute_System
,
5840 { "System", "afp.dir_attribute.system",
5841 FT_BOOLEAN
, 16, NULL
, kFPSystemBit
,
5842 "Directory is a system directory", HFILL
}},
5844 { &hf_afp_dir_attribute_Mounted
,
5845 { "Mounted", "afp.dir_attribute.mounted",
5846 FT_BOOLEAN
, 16, NULL
, kFPDAlreadyOpenBit
,
5847 "Directory is mounted", HFILL
}},
5849 { &hf_afp_dir_attribute_InExpFolder
,
5850 { "Shared area", "afp.dir_attribute.in_exported_folder",
5851 FT_BOOLEAN
, 16, NULL
, kFPRAlreadyOpenBit
,
5852 "Directory is in a shared area", HFILL
}},
5854 { &hf_afp_dir_attribute_BackUpNeeded
,
5855 { "Backup needed", "afp.dir_attribute.backup_needed",
5856 FT_BOOLEAN
, 16, NULL
, kFPBackUpNeededBit
,
5857 "Directory needs to be backed up", HFILL
}},
5859 { &hf_afp_dir_attribute_RenameInhibit
,
5860 { "Rename inhibit", "afp.dir_attribute.rename_inhibit",
5861 FT_BOOLEAN
, 16, NULL
, kFPRenameInhibitBit
,
5864 { &hf_afp_dir_attribute_DeleteInhibit
,
5865 { "Delete inhibit", "afp.dir_attribute.delete_inhibit",
5866 FT_BOOLEAN
, 16, NULL
, kFPDeleteInhibitBit
,
5869 { &hf_afp_file_bitmap
,
5870 { "File bitmap", "afp.file_bitmap",
5871 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
5874 { &hf_afp_file_bitmap_Attributes
,
5875 { "Attributes", "afp.file_bitmap.attributes",
5876 FT_BOOLEAN
, 16, NULL
, kFPAttributeBit
,
5877 "Return attributes if file", HFILL
}},
5879 { &hf_afp_file_bitmap_ParentDirID
,
5880 { "DID", "afp.file_bitmap.did",
5881 FT_BOOLEAN
, 16, NULL
, kFPParentDirIDBit
,
5882 "Return parent directory ID if file", HFILL
}},
5884 { &hf_afp_file_bitmap_CreateDate
,
5885 { "Creation date", "afp.file_bitmap.create_date",
5886 FT_BOOLEAN
, 16, NULL
, kFPCreateDateBit
,
5887 "Return creation date if file", HFILL
}},
5889 { &hf_afp_file_bitmap_ModDate
,
5890 { "Modification date", "afp.file_bitmap.mod_date",
5891 FT_BOOLEAN
, 16, NULL
, kFPModDateBit
,
5892 "Return modification date if file", HFILL
}},
5894 { &hf_afp_file_bitmap_BackupDate
,
5895 { "Backup date", "afp.file_bitmap.backup_date",
5896 FT_BOOLEAN
, 16, NULL
, kFPBackupDateBit
,
5897 "Return backup date if file", HFILL
}},
5899 { &hf_afp_file_bitmap_FinderInfo
,
5900 { "Finder info", "afp.file_bitmap.finder_info",
5901 FT_BOOLEAN
, 16, NULL
, kFPFinderInfoBit
,
5902 "Return finder info if file", HFILL
}},
5904 { &hf_afp_file_bitmap_LongName
,
5905 { "Long name", "afp.file_bitmap.long_name",
5906 FT_BOOLEAN
, 16, NULL
, kFPLongNameBit
,
5907 "Return long name if file", HFILL
}},
5909 { &hf_afp_file_bitmap_ShortName
,
5910 { "Short name", "afp.file_bitmap.short_name",
5911 FT_BOOLEAN
, 16, NULL
, kFPShortNameBit
,
5912 "Return short name if file", HFILL
}},
5914 { &hf_afp_file_bitmap_NodeID
,
5915 { "File ID", "afp.file_bitmap.fid",
5916 FT_BOOLEAN
, 16, NULL
, kFPNodeIDBit
,
5917 "Return file ID if file", HFILL
}},
5919 { &hf_afp_file_bitmap_DataForkLen
,
5920 { "Data fork size", "afp.file_bitmap.data_fork_len",
5921 FT_BOOLEAN
, 16, NULL
, kFPDataForkLenBit
,
5922 "Return data fork size if file", HFILL
}},
5924 { &hf_afp_file_bitmap_RsrcForkLen
,
5925 { "Resource fork size", "afp.file_bitmap.resource_fork_len",
5926 FT_BOOLEAN
, 16, NULL
, kFPRsrcForkLenBit
,
5927 "Return resource fork size if file", HFILL
}},
5929 { &hf_afp_file_bitmap_ExtDataForkLen
,
5930 { "Extended data fork size", "afp.file_bitmap.ex_data_fork_len",
5931 FT_BOOLEAN
, 16, NULL
, kFPExtDataForkLenBit
,
5932 "Return extended (>2GB) data fork size if file", HFILL
}},
5934 { &hf_afp_file_bitmap_LaunchLimit
,
5935 { "Launch limit", "afp.file_bitmap.launch_limit",
5936 FT_BOOLEAN
, 16, NULL
, kFPLaunchLimitBit
,
5937 "Return launch limit if file", HFILL
}},
5939 { &hf_afp_file_bitmap_UTF8Name
,
5940 { "UTF-8 name", "afp.file_bitmap.UTF8_name",
5941 FT_BOOLEAN
, 16, NULL
, kFPUTF8NameBit
,
5942 "Return UTF-8 name if file", HFILL
}},
5944 { &hf_afp_file_bitmap_ExtRsrcForkLen
,
5945 { "Extended resource fork size", "afp.file_bitmap.ex_resource_fork_len",
5946 FT_BOOLEAN
, 16, NULL
, kFPExtRsrcForkLenBit
,
5947 "Return extended (>2GB) resource fork size if file", HFILL
}},
5949 { &hf_afp_file_bitmap_UnixPrivs
,
5950 { "UNIX privileges", "afp.file_bitmap.unix_privs",
5951 FT_BOOLEAN
, 16, NULL
, kFPUnixPrivsBit
,
5952 "Return UNIX privileges if file", HFILL
}},
5955 { &hf_afp_file_attribute
,
5956 { "File Attributes", "afp.file_attribute",
5957 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
5960 { &hf_afp_file_attribute_Invisible
,
5961 { "Invisible", "afp.file_attribute.invisible",
5962 FT_BOOLEAN
, 16, NULL
, kFPInvisibleBit
,
5963 "File is not visible", HFILL
}},
5965 { &hf_afp_file_attribute_MultiUser
,
5966 { "Multi user", "afp.file_attribute.multi_user",
5967 FT_BOOLEAN
, 16, NULL
, kFPMultiUserBit
,
5970 { &hf_afp_file_attribute_System
,
5971 { "System", "afp.file_attribute.system",
5972 FT_BOOLEAN
, 16, NULL
, kFPSystemBit
,
5973 "File is a system file", HFILL
}},
5975 { &hf_afp_file_attribute_DAlreadyOpen
,
5976 { "Data fork open", "afp.file_attribute.df_open",
5977 FT_BOOLEAN
, 16, NULL
, kFPDAlreadyOpenBit
,
5978 "Data fork already open", HFILL
}},
5980 { &hf_afp_file_attribute_RAlreadyOpen
,
5981 { "Resource fork open", "afp.file_attribute.rf_open",
5982 FT_BOOLEAN
, 16, NULL
, kFPRAlreadyOpenBit
,
5983 "Resource fork already open", HFILL
}},
5985 { &hf_afp_file_attribute_WriteInhibit
,
5986 { "Write inhibit", "afp.file_attribute.write_inhibit",
5987 FT_BOOLEAN
, 16, NULL
, kFPWriteInhibitBit
,
5990 { &hf_afp_file_attribute_BackUpNeeded
,
5991 { "Backup needed", "afp.file_attribute.backup_needed",
5992 FT_BOOLEAN
, 16, NULL
, kFPBackUpNeededBit
,
5993 "File needs to be backed up", HFILL
}},
5995 { &hf_afp_file_attribute_RenameInhibit
,
5996 { "Rename inhibit", "afp.file_attribute.rename_inhibit",
5997 FT_BOOLEAN
, 16, NULL
, kFPRenameInhibitBit
,
6000 { &hf_afp_file_attribute_DeleteInhibit
,
6001 { "Delete inhibit", "afp.file_attribute.delete_inhibit",
6002 FT_BOOLEAN
, 16, NULL
, kFPDeleteInhibitBit
,
6005 { &hf_afp_file_attribute_CopyProtect
,
6006 { "Copy protect", "afp.file_attribute.copy_protect",
6007 FT_BOOLEAN
, 16, NULL
, kFPCopyProtectBit
,
6010 { &hf_afp_file_attribute_SetClear
,
6011 { "Set", "afp.file_attribute.set_clear",
6012 FT_BOOLEAN
, 16, NULL
, kFPSetClearBit
,
6013 "Clear/set attribute", HFILL
}},
6017 { "Volume", "afp.vol_name",
6018 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
6019 "Volume name", HFILL
}},
6022 { "Flags", "afp.vol_flag",
6023 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6026 { &hf_afp_vol_flag_passwd
,
6027 { "Password", "afp.vol_flag_passwd",
6028 FT_BOOLEAN
, 8, NULL
, 128,
6029 "Volume is password-protected", HFILL
}},
6031 { &hf_afp_vol_flag_has_config
,
6032 { "Has config", "afp.vol_flag_has_config",
6033 FT_BOOLEAN
, 8, NULL
, 1,
6034 "Volume has Apple II config info", HFILL
}},
6037 { "Volume id", "afp.vol_id",
6038 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6041 { &hf_afp_vol_signature
,
6042 { "Signature", "afp.vol_signature",
6043 FT_UINT16
, BASE_DEC
, VALS(vol_signature_vals
), 0x0,
6044 "Volume signature", HFILL
}},
6046 { &hf_afp_vol_name_offset
,
6047 { "Volume name offset","afp.vol_name_offset",
6048 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6049 "Volume name offset in packet", HFILL
}},
6051 { &hf_afp_vol_creation_date
,
6052 { "Creation date", "afp.vol_creation_date",
6053 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0,
6054 "Volume creation date", HFILL
}},
6056 { &hf_afp_vol_modification_date
,
6057 { "Modification date", "afp.vol_modification_date",
6058 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0,
6059 "Volume modification date", HFILL
}},
6061 { &hf_afp_vol_backup_date
,
6062 { "Backup date", "afp.vol_backup_date",
6063 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0,
6064 "Volume backup date", HFILL
}},
6066 { &hf_afp_vol_bytes_free
,
6067 { "Bytes free", "afp.vol_bytes_free",
6068 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6069 "Free space", HFILL
}},
6071 { &hf_afp_vol_bytes_total
,
6072 { "Bytes total", "afp.vol_bytes_total",
6073 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6074 "Volume size", HFILL
}},
6076 { &hf_afp_vol_ex_bytes_free
,
6077 { "Extended bytes free", "afp.vol_ex_bytes_free",
6078 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
6079 "Extended (>2GB) free space", HFILL
}},
6081 { &hf_afp_vol_ex_bytes_total
,
6082 { "Extended bytes total", "afp.vol_ex_bytes_total",
6083 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
6084 "Extended (>2GB) volume size", HFILL
}},
6086 { &hf_afp_vol_block_size
,
6087 { "Block size", "afp.vol_block_size",
6088 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6089 "Volume block size", HFILL
}},
6093 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6094 "Parent directory ID", HFILL
}},
6096 { &hf_afp_dir_bitmap
,
6097 { "Directory bitmap", "afp.dir_bitmap",
6098 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
6101 { &hf_afp_dir_offspring
,
6102 { "Offspring", "afp.dir_offspring",
6103 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6104 "Directory offspring", HFILL
}},
6106 { &hf_afp_dir_OwnerID
,
6107 { "Owner ID", "afp.dir_owner_id",
6108 FT_INT32
, BASE_DEC
, NULL
, 0x0,
6109 "Directory owner ID", HFILL
}},
6111 { &hf_afp_dir_GroupID
,
6112 { "Group ID", "afp.dir_group_id",
6113 FT_INT32
, BASE_DEC
, NULL
, 0x0,
6114 "Directory group ID", HFILL
}},
6116 { &hf_afp_creation_date
,
6117 { "Creation date", "afp.creation_date",
6118 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0,
6121 { &hf_afp_modification_date
,
6122 { "Modification date", "afp.modification_date",
6123 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0,
6126 { &hf_afp_backup_date
,
6127 { "Backup date", "afp.backup_date",
6128 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0,
6131 { &hf_afp_finder_info
,
6132 { "Finder info", "afp.finder_info",
6133 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
6136 { &hf_afp_long_name_offset
,
6137 { "Long name offset", "afp.long_name_offset",
6138 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6139 "Long name offset in packet", HFILL
}},
6141 { &hf_afp_short_name_offset
,
6142 { "Short name offset", "afp.short_name_offset",
6143 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6144 "Short name offset in packet", HFILL
}},
6146 { &hf_afp_unicode_name_offset
,
6147 { "Unicode name offset", "afp.unicode_name_offset",
6148 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6149 "Unicode name offset in packet", HFILL
}},
6151 { &hf_afp_unix_privs_uid
,
6152 { "UID", "afp.unix_privs.uid",
6153 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6154 "User ID", HFILL
}},
6156 { &hf_afp_unix_privs_gid
,
6157 { "GID", "afp.unix_privs.gid",
6158 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6159 "Group ID", HFILL
}},
6161 { &hf_afp_unix_privs_permissions
,
6162 { "Permissions", "afp.unix_privs.permissions",
6163 FT_UINT32
, BASE_OCT
, NULL
, 0x0,
6166 { &hf_afp_unix_privs_ua_permissions
,
6167 { "User's access rights", "afp.unix_privs.ua_permissions",
6168 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
6172 { "File ID", "afp.file_id",
6173 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6174 "File/directory ID", HFILL
}},
6176 { &hf_afp_file_DataForkLen
,
6177 { "Data fork size", "afp.data_fork_len",
6178 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6181 { &hf_afp_file_RsrcForkLen
,
6182 { "Resource fork size", "afp.resource_fork_len",
6183 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6186 { &hf_afp_file_ExtDataForkLen
,
6187 { "Extended data fork size", "afp.ext_data_fork_len",
6188 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
6189 "Extended (>2GB) data fork length", HFILL
}},
6191 { &hf_afp_file_ExtRsrcForkLen
,
6192 { "Extended resource fork size", "afp.ext_resource_fork_len",
6193 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
6194 "Extended (>2GB) resource fork length", HFILL
}},
6196 { &hf_afp_req_count
,
6197 { "Req count", "afp.req_count",
6198 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6199 "Maximum number of structures returned", HFILL
}},
6201 { &hf_afp_start_index
,
6202 { "Start index", "afp.start_index",
6203 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6204 "First structure returned", HFILL
}},
6206 { &hf_afp_max_reply_size
,
6207 { "Reply size", "afp.reply_size",
6208 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6211 { &hf_afp_start_index32
,
6212 { "Start index", "afp.start_index32",
6213 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6214 "First structure returned", HFILL
}},
6216 { &hf_afp_max_reply_size32
,
6217 { "Reply size", "afp.reply_size32",
6218 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6221 { &hf_afp_file_flag
,
6222 { "Dir", "afp.file_flag",
6223 FT_BOOLEAN
, 8, NULL
, 0x80,
6224 "Is a dir", HFILL
}},
6226 { &hf_afp_create_flag
,
6227 { "Hard create", "afp.create_flag",
6228 FT_BOOLEAN
, 8, NULL
, 0x80,
6229 "Soft/hard create file", HFILL
}},
6231 { &hf_afp_request_bitmap
,
6232 { "Request Bitmap", "afp.request_bitmap",
6233 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
6236 { &hf_afp_request_bitmap_Attributes
,
6237 { "Attributes", "afp.request_bitmap.attributes",
6238 FT_BOOLEAN
, 32, NULL
, kFPAttributeBit
,
6239 "Search attributes", HFILL
}},
6241 { &hf_afp_request_bitmap_ParentDirID
,
6242 { "DID", "afp.request_bitmap.did",
6243 FT_BOOLEAN
, 32, NULL
, kFPParentDirIDBit
,
6244 "Search parent directory ID", HFILL
}},
6246 { &hf_afp_request_bitmap_CreateDate
,
6247 { "Creation date", "afp.request_bitmap.create_date",
6248 FT_BOOLEAN
, 32, NULL
, kFPCreateDateBit
,
6249 "Search creation date", HFILL
}},
6251 { &hf_afp_request_bitmap_ModDate
,
6252 { "Modification date", "afp.request_bitmap.mod_date",
6253 FT_BOOLEAN
, 32, NULL
, kFPModDateBit
,
6254 "Search modification date", HFILL
}},
6256 { &hf_afp_request_bitmap_BackupDate
,
6257 { "Backup date", "afp.request_bitmap.backup_date",
6258 FT_BOOLEAN
, 32, NULL
, kFPBackupDateBit
,
6259 "Search backup date", HFILL
}},
6261 { &hf_afp_request_bitmap_FinderInfo
,
6262 { "Finder info", "afp.request_bitmap.finder_info",
6263 FT_BOOLEAN
, 32, NULL
, kFPFinderInfoBit
,
6264 "Search finder info", HFILL
}},
6266 { &hf_afp_request_bitmap_LongName
,
6267 { "Long name", "afp.request_bitmap.long_name",
6268 FT_BOOLEAN
, 32, NULL
, kFPLongNameBit
,
6269 "Search long name", HFILL
}},
6271 { &hf_afp_request_bitmap_DataForkLen
,
6272 { "Data fork size", "afp.request_bitmap.data_fork_len",
6273 FT_BOOLEAN
, 32, NULL
, kFPDataForkLenBit
,
6274 "Search data fork size", HFILL
}},
6276 { &hf_afp_request_bitmap_OffspringCount
,
6277 { "Offspring count", "afp.request_bitmap.offspring_count",
6278 FT_BOOLEAN
, 32, NULL
, kFPOffspringCountBit
,
6279 "Search offspring count", HFILL
}},
6281 { &hf_afp_request_bitmap_RsrcForkLen
,
6282 { "Resource fork size", "afp.request_bitmap.resource_fork_len",
6283 FT_BOOLEAN
, 32, NULL
, kFPRsrcForkLenBit
,
6284 "Search resource fork size", HFILL
}},
6286 { &hf_afp_request_bitmap_ExtDataForkLen
,
6287 { "Extended data fork size", "afp.request_bitmap.ex_data_fork_len",
6288 FT_BOOLEAN
, 32, NULL
, kFPExtDataForkLenBit
,
6289 "Search extended (>2GB) data fork size", HFILL
}},
6291 { &hf_afp_request_bitmap_UTF8Name
,
6292 { "UTF-8 name", "afp.request_bitmap.UTF8_name",
6293 FT_BOOLEAN
, 32, NULL
, kFPUTF8NameBit
,
6294 "Search UTF-8 name", HFILL
}},
6296 { &hf_afp_request_bitmap_ExtRsrcForkLen
,
6297 { "Extended resource fork size", "afp.request_bitmap.ex_resource_fork_len",
6298 FT_BOOLEAN
, 32, NULL
, kFPExtRsrcForkLenBit
,
6299 "Search extended (>2GB) resource fork size", HFILL
}},
6301 { &hf_afp_request_bitmap_PartialNames
,
6302 { "Match on partial names", "afp.request_bitmap.partial_names",
6303 FT_BOOLEAN
, 32, NULL
, 0x80000000,
6306 { &hf_afp_struct_size
,
6307 { "Struct size", "afp.struct_size",
6308 FT_UINT8
, BASE_DEC
, NULL
,0,
6309 "Sizeof of struct", HFILL
}},
6311 { &hf_afp_struct_size16
,
6312 { "Struct size", "afp.struct_size16",
6313 FT_UINT16
, BASE_DEC
, NULL
,0,
6314 "Sizeof of struct", HFILL
}},
6317 { "From", "afp.flag",
6318 FT_UINT8
, BASE_HEX
, VALS(flag_vals
), 0x80,
6319 "Offset is relative to start/end of the fork", HFILL
}},
6322 { "DT ref", "afp.dt_ref",
6323 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6324 "Desktop database reference num", HFILL
}},
6327 { "Fork", "afp.ofork",
6328 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6329 "Open fork reference number", HFILL
}},
6332 { "Offset", "afp.offset",
6333 FT_INT32
, BASE_DEC
, NULL
, 0x0,
6337 { "Count", "afp.rw_count",
6338 FT_INT32
, BASE_DEC
, NULL
, 0x0,
6339 "Number of bytes to be read/written", HFILL
}},
6341 { &hf_afp_newline_mask
,
6342 { "Newline mask", "afp.newline_mask",
6343 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6344 "Value to AND bytes with when looking for newline", HFILL
}},
6346 { &hf_afp_newline_char
,
6347 { "Newline char", "afp.newline_char",
6348 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
6349 "Value to compare ANDed bytes with when looking for newline", HFILL
}},
6351 { &hf_afp_last_written
,
6352 { "Last written", "afp.last_written",
6353 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6354 "Offset of the last byte written", HFILL
}},
6356 { &hf_afp_ofork_len
,
6357 { "New length", "afp.ofork_len",
6358 FT_INT32
, BASE_DEC
, NULL
, 0x0,
6361 { &hf_afp_path_type
,
6362 { "Type", "afp.path_type",
6363 FT_UINT8
, BASE_HEX
, VALS(path_type_vals
), 0,
6364 "Type of names", HFILL
}},
6367 { "Len", "afp.path_len",
6368 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
6369 "Path length", HFILL
}},
6371 { &hf_afp_path_unicode_len
,
6372 { "Len", "afp.path_unicode_len",
6373 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6374 "Path length (unicode)", HFILL
}},
6376 { &hf_afp_path_unicode_hint
,
6377 { "Unicode hint", "afp.path_unicode_hint",
6378 FT_UINT32
, BASE_HEX
|BASE_EXT_STRING
, &unicode_hint_vals_ext
, 0x0,
6381 { &hf_afp_path_name
,
6382 { "Name", "afp.path_name",
6383 FT_STRING
, BASE_NONE
, NULL
, 0x0,
6384 "Path name", HFILL
}},
6386 { &hf_afp_fork_type
,
6387 { "Resource fork", "afp.fork_type",
6388 FT_BOOLEAN
, 8, NULL
, 0x80,
6389 "Data/resource fork", HFILL
}},
6391 { &hf_afp_access_mode
,
6392 { "Access mode", "afp.access",
6393 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
6394 "Fork access mode", HFILL
}},
6396 { &hf_afp_access_read
,
6397 { "Read", "afp.access.read",
6398 FT_BOOLEAN
, 16, NULL
, 0x0001,
6399 "Open for reading", HFILL
}},
6401 { &hf_afp_access_write
,
6402 { "Write", "afp.access.write",
6403 FT_BOOLEAN
, 16, NULL
, 0x0002,
6404 "Open for writing", HFILL
}},
6406 { &hf_afp_access_deny_read
,
6407 { "Deny read", "afp.access.deny_read",
6408 FT_BOOLEAN
, 16, NULL
, 0x0010,
6411 { &hf_afp_access_deny_write
,
6412 { "Deny write", "afp.access.deny_write",
6413 FT_BOOLEAN
, 16, NULL
, 0x0020,
6417 { "Comment", "afp.comment",
6418 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
6419 "File/folder comment", HFILL
}},
6422 * XXX - should this be a type that's displayed as
6423 * text if it's all printable ASCII and hex otherwise,
6424 * or something such as that?
6426 { &hf_afp_file_creator
,
6427 { "File creator", "afp.file_creator",
6428 FT_STRING
, BASE_NONE
, NULL
, 0x0,
6432 * XXX - should this be a type that's displayed as
6433 * text if it's all printable ASCII and hex otherwise,
6434 * or something such as that?
6436 { &hf_afp_file_type
,
6437 { "File type", "afp.file_type",
6438 FT_STRING
, BASE_NONE
, NULL
, 0x0,
6441 { &hf_afp_icon_type
,
6442 { "Icon type", "afp.icon_type",
6443 FT_UINT8
, BASE_HEX
, NULL
, 0,
6446 { &hf_afp_icon_length
,
6447 { "Size", "afp.icon_length",
6448 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6449 "Size for icon bitmap", HFILL
}},
6451 { &hf_afp_icon_index
,
6452 { "Index", "afp.icon_index",
6453 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6454 "Icon index in desktop database", HFILL
}},
6457 { "Tag", "afp.icon_tag",
6458 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
6459 "Icon tag", HFILL
}},
6461 { &hf_afp_appl_index
,
6462 { "Index", "afp.appl_index",
6463 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6464 "Application index", HFILL
}},
6467 { "Tag", "afp.appl_tag",
6468 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
6469 "Application tag", HFILL
}},
6472 { "unlock", "afp.lock_op",
6473 FT_BOOLEAN
, 8, NULL
, 0x1,
6474 "Lock/unlock op", HFILL
}},
6476 { &hf_afp_lock_from
,
6477 { "End", "afp.lock_from",
6478 FT_BOOLEAN
, 8, NULL
, 0x80,
6479 "Offset is relative to the end of the fork", HFILL
}},
6481 { &hf_afp_lock_offset
,
6482 { "Offset", "afp.lock_offset",
6483 FT_INT32
, BASE_DEC
, NULL
, 0x0,
6484 "First byte to be locked", HFILL
}},
6487 { "Length", "afp.lock_len",
6488 FT_INT32
, BASE_DEC
, NULL
, 0x0,
6489 "Number of bytes to be locked/unlocked", HFILL
}},
6491 { &hf_afp_lock_range_start
,
6492 { "Start", "afp.lock_range_start",
6493 FT_INT32
, BASE_DEC
, NULL
, 0x0,
6494 "First byte locked/unlocked", HFILL
}},
6497 { "Access rights", "afp.dir_ar",
6498 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
6499 "Directory access rights", HFILL
}},
6501 { &hf_afp_dir_ar_o_search
,
6502 { "Owner has search access", "afp.dir_ar.o_search",
6503 FT_BOOLEAN
, 32, NULL
, AR_O_SEARCH
,
6506 { &hf_afp_dir_ar_o_read
,
6507 { "Owner has read access", "afp.dir_ar.o_read",
6508 FT_BOOLEAN
, 32, NULL
, AR_O_READ
,
6511 { &hf_afp_dir_ar_o_write
,
6512 { "Owner has write access", "afp.dir_ar.o_write",
6513 FT_BOOLEAN
, 32, NULL
, AR_O_WRITE
,
6516 { &hf_afp_dir_ar_g_search
,
6517 { "Group has search access", "afp.dir_ar.g_search",
6518 FT_BOOLEAN
, 32, NULL
, AR_G_SEARCH
,
6521 { &hf_afp_dir_ar_g_read
,
6522 { "Group has read access", "afp.dir_ar.g_read",
6523 FT_BOOLEAN
, 32, NULL
, AR_G_READ
,
6526 { &hf_afp_dir_ar_g_write
,
6527 { "Group has write access", "afp.dir_ar.g_write",
6528 FT_BOOLEAN
, 32, NULL
, AR_G_WRITE
,
6531 { &hf_afp_dir_ar_e_search
,
6532 { "Everyone has search access", "afp.dir_ar.e_search",
6533 FT_BOOLEAN
, 32, NULL
, AR_E_SEARCH
,
6536 { &hf_afp_dir_ar_e_read
,
6537 { "Everyone has read access", "afp.dir_ar.e_read",
6538 FT_BOOLEAN
, 32, NULL
, AR_E_READ
,
6541 { &hf_afp_dir_ar_e_write
,
6542 { "Everyone has write access", "afp.dir_ar.e_write",
6543 FT_BOOLEAN
, 32, NULL
, AR_E_WRITE
,
6546 { &hf_afp_dir_ar_u_search
,
6547 { "User has search access", "afp.dir_ar.u_search",
6548 FT_BOOLEAN
, 32, NULL
, AR_U_SEARCH
,
6551 { &hf_afp_dir_ar_u_read
,
6552 { "User has read access", "afp.dir_ar.u_read",
6553 FT_BOOLEAN
, 32, NULL
, AR_U_READ
,
6556 { &hf_afp_dir_ar_u_write
,
6557 { "User has write access", "afp.dir_ar.u_write",
6558 FT_BOOLEAN
, 32, NULL
, AR_U_WRITE
,
6561 { &hf_afp_dir_ar_blank
,
6562 { "Blank access right", "afp.dir_ar.blank",
6563 FT_BOOLEAN
, 32, NULL
, AR_BLANK
,
6566 { &hf_afp_dir_ar_u_own
,
6567 { "User is the owner", "afp.dir_ar.u_owner",
6568 FT_BOOLEAN
, 32, NULL
, AR_U_OWN
,
6569 "Current user is the directory owner", HFILL
}},
6571 { &hf_afp_server_time
,
6572 { "Server time", "afp.server_time",
6573 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0,
6576 { &hf_afp_cat_req_matches
,
6577 { "Max answers", "afp.cat_req_matches",
6578 FT_INT32
, BASE_DEC
, NULL
, 0x0,
6579 "Maximum number of matches to return.", HFILL
}},
6582 { "Reserved", "afp.reserved",
6583 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
6586 { &hf_afp_cat_count
,
6587 { "Cat count", "afp.cat_count",
6588 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6589 "Number of structures returned", HFILL
}},
6591 { &hf_afp_cat_position
,
6592 { "Position", "afp.cat_position",
6593 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
6594 "Catalog position", HFILL
}},
6596 { &hf_afp_map_name_type
,
6597 { "Type", "afp.map_name_type",
6598 FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &map_name_type_vals_ext
, 0x0,
6599 "Map name type", HFILL
}},
6601 { &hf_afp_map_id_type
,
6602 { "Type", "afp.map_id_type",
6603 FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &map_id_type_vals_ext
, 0x0,
6604 "Map ID type", HFILL
}},
6607 { "ID", "afp.map_id",
6608 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6609 "User/Group ID", HFILL
}},
6611 { &hf_afp_map_id_reply_type
,
6612 { "Reply type", "afp.map_id_reply_type",
6613 FT_UINT32
, BASE_DEC
, VALS(map_id_reply_type_vals
), 0x0,
6614 "Map ID reply type", HFILL
}},
6617 { "Name", "afp.map_name",
6618 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
6619 "User/Group name", HFILL
}},
6622 { &hf_afp_lock_offset64
,
6623 { "Offset", "afp.lock_offset64",
6624 FT_INT64
, BASE_DEC
, NULL
, 0x0,
6625 "First byte to be locked (64 bits)", HFILL
}},
6627 { &hf_afp_lock_len64
,
6628 { "Length", "afp.lock_len64",
6629 FT_INT64
, BASE_DEC
, NULL
, 0x0,
6630 "Number of bytes to be locked/unlocked (64 bits)", HFILL
}},
6632 { &hf_afp_lock_range_start64
,
6633 { "Start", "afp.lock_range_start64",
6634 FT_INT64
, BASE_DEC
, NULL
, 0x0,
6635 "First byte locked/unlocked (64 bits)", HFILL
}},
6638 { "Offset", "afp.offset64",
6639 FT_INT64
, BASE_DEC
, NULL
, 0x0,
6640 "Offset (64 bits)", HFILL
}},
6642 { &hf_afp_rw_count64
,
6643 { "Count", "afp.rw_count64",
6644 FT_INT64
, BASE_DEC
, NULL
, 0x0,
6645 "Number of bytes to be read/written (64 bits)", HFILL
}},
6647 { &hf_afp_last_written64
,
6648 { "Last written", "afp.last_written64",
6649 FT_UINT64
, BASE_DEC
, NULL
, 0x0,
6650 "Offset of the last byte written (64 bits)", HFILL
}},
6652 { &hf_afp_ofork_len64
,
6653 { "New length", "afp.ofork_len64",
6654 FT_INT64
, BASE_DEC
, NULL
, 0x0,
6655 "New length (64 bits)", HFILL
}},
6657 { &hf_afp_session_token_type
,
6658 { "Type", "afp.session_token_type",
6659 FT_UINT16
, BASE_HEX
|BASE_EXT_STRING
, &token_type_vals_ext
, 0x0,
6660 "Session token type", HFILL
}},
6662 /* FIXME FT_UINT32 in specs */
6663 { &hf_afp_session_token_len
,
6664 { "Len", "afp.session_token_len",
6665 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6666 "Session token length", HFILL
}},
6668 { &hf_afp_session_token_timestamp
,
6669 { "Time stamp", "afp.session_token_timestamp",
6670 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
6671 "Session time stamp", HFILL
}},
6673 { &hf_afp_session_token
,
6674 { "Token", "afp.session_token",
6675 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
6676 "Session token", HFILL
}},
6678 { &hf_afp_user_flag
,
6679 { "Flag", "afp.user_flag",
6680 FT_UINT8
, BASE_HEX
, VALS(user_flag_vals
), 0x01,
6681 "User Info flag", HFILL
}},
6684 { "User ID", "afp.user_ID",
6685 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6689 { "Group ID", "afp.group_ID",
6690 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6694 { "UUID", "afp.uuid",
6695 FT_GUID
, BASE_NONE
, NULL
, 0x0,
6699 { "GRPUUID", "afp.grpuuid",
6700 FT_GUID
, BASE_NONE
, NULL
, 0x0,
6701 "Group UUID", HFILL
}},
6703 { &hf_afp_user_bitmap
,
6704 { "Bitmap", "afp.user_bitmap",
6705 FT_UINT16
, BASE_HEX
, NULL
, 0,
6706 "User Info bitmap", HFILL
}},
6708 { &hf_afp_user_bitmap_UID
,
6709 { "User ID", "afp.user_bitmap.UID",
6710 FT_BOOLEAN
, 16, NULL
, 0x0001,
6713 { &hf_afp_user_bitmap_GID
,
6714 { "Primary group ID", "afp.user_bitmap.GID",
6715 FT_BOOLEAN
, 16, NULL
, 0x0002,
6718 { &hf_afp_user_bitmap_UUID
,
6719 { "UUID", "afp.user_bitmap.UUID",
6720 FT_BOOLEAN
, 16, NULL
, 0x0004,
6723 { &hf_afp_message_type
,
6724 { "Type", "afp.message_type",
6725 FT_UINT16
, BASE_HEX
, VALS(server_message_type
), 0,
6726 "Type of server message", HFILL
}},
6728 { &hf_afp_message_bitmap
,
6729 { "Bitmap", "afp.message_bitmap",
6730 FT_UINT16
, BASE_HEX
, NULL
, 0,
6731 "Message bitmap", HFILL
}},
6734 * XXX - in the reply, this indicates whether the message
6735 * is a server message or a login message.
6737 { &hf_afp_message_bitmap_REQ
,
6738 { "Request message", "afp.message_bitmap.requested",
6739 FT_BOOLEAN
, 16, NULL
, 0x0001,
6740 "Message Requested", HFILL
}},
6742 { &hf_afp_message_bitmap_UTF
,
6743 { "Message is UTF-8", "afp.message_bitmap.utf8",
6744 FT_BOOLEAN
, 16, NULL
, 0x0002,
6747 { &hf_afp_message_len
,
6748 { "Len", "afp.message_length",
6749 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6750 "Message length", HFILL
}},
6753 { "Message", "afp.message",
6754 FT_STRING
, BASE_NONE
, NULL
, 0x0,
6757 { &hf_afp_reqcount64
,
6758 { "Count", "afp.reqcount64",
6759 FT_INT64
, BASE_DEC
, NULL
, 0x0,
6760 "Request Count (64 bits)", HFILL
}},
6762 { &hf_afp_extattr_bitmap
,
6763 { "Bitmap", "afp.extattr_bitmap",
6764 FT_UINT16
, BASE_HEX
, NULL
, 0,
6765 "Extended attributes bitmap", HFILL
}},
6767 { &hf_afp_extattr_bitmap_NoFollow
,
6768 { "No follow symlinks", "afp.extattr_bitmap.nofollow",
6769 FT_BOOLEAN
, 16, NULL
, 0x0001,
6770 "Do not follow symlink", HFILL
}},
6772 { &hf_afp_extattr_bitmap_Create
,
6773 { "Create", "afp.extattr_bitmap.create",
6774 FT_BOOLEAN
, 16, NULL
, 0x0002,
6775 "Create extended attribute", HFILL
}},
6777 { &hf_afp_extattr_bitmap_Replace
,
6778 { "Replace", "afp.extattr_bitmap.replace",
6779 FT_BOOLEAN
, 16, NULL
, 0x0004,
6780 "Replace extended attribute", HFILL
}},
6782 { &hf_afp_extattr_namelen
,
6783 { "Length", "afp.extattr.namelen",
6784 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6785 "Extended attribute name length", HFILL
}},
6787 { &hf_afp_extattr_name
,
6788 { "Name", "afp.extattr.name",
6789 FT_STRING
, BASE_NONE
, NULL
, 0x0,
6790 "Extended attribute name", HFILL
}},
6792 { &hf_afp_extattr_len
,
6793 { "Length", "afp.extattr.len",
6794 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6795 "Extended attribute length", HFILL
}},
6797 { &hf_afp_extattr_data
,
6798 { "Data", "afp.extattr.data",
6799 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
6800 "Extended attribute data", HFILL
}},
6802 { &hf_afp_extattr_req_count
,
6803 { "Request Count", "afp.extattr.req_count",
6804 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
6805 "Request Count.", HFILL
}},
6807 { &hf_afp_extattr_start_index
,
6808 { "Index", "afp.extattr.start_index",
6809 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6810 "Start index", HFILL
}},
6812 { &hf_afp_extattr_reply_size
,
6813 { "Reply size", "afp.extattr.reply_size",
6814 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
6817 /* ACL control list bitmap */
6818 { &hf_afp_access_bitmap
,
6819 { "Bitmap", "afp.access_bitmap",
6820 FT_UINT16
, BASE_HEX
, NULL
, 0,
6821 "Bitmap (reserved)", HFILL
}},
6823 { &hf_afp_acl_list_bitmap
,
6824 { "ACL bitmap", "afp.acl_list_bitmap",
6825 FT_UINT16
, BASE_HEX
, NULL
, 0,
6826 "ACL control list bitmap", HFILL
}},
6828 { &hf_afp_acl_list_bitmap_UUID
,
6829 { "UUID", "afp.acl_list_bitmap.UUID",
6830 FT_BOOLEAN
, 16, NULL
, kFileSec_UUID
,
6831 "User UUID", HFILL
}},
6833 { &hf_afp_acl_list_bitmap_GRPUUID
,
6834 { "GRPUUID", "afp.acl_list_bitmap.GRPUUID",
6835 FT_BOOLEAN
, 16, NULL
, kFileSec_GRPUUID
,
6836 "Group UUID", HFILL
}},
6838 { &hf_afp_acl_list_bitmap_ACL
,
6839 { "ACL", "afp.acl_list_bitmap.ACL",
6840 FT_BOOLEAN
, 16, NULL
, kFileSec_ACL
,
6843 { &hf_afp_acl_list_bitmap_REMOVEACL
,
6844 { "Remove ACL", "afp.acl_list_bitmap.REMOVEACL",
6845 FT_BOOLEAN
, 16, NULL
, kFileSec_REMOVEACL
,
6848 { &hf_afp_acl_list_bitmap_Inherit
,
6849 { "Inherit", "afp.acl_list_bitmap.Inherit",
6850 FT_BOOLEAN
, 16, NULL
, kFileSec_Inherit
,
6851 "Inherit ACL", HFILL
}},
6853 { &hf_afp_acl_entrycount
,
6854 { "ACEs count", "afp.acl_entrycount",
6855 FT_UINT32
, BASE_HEX
, NULL
, 0,
6856 "Number of ACL entries", HFILL
}},
6858 { &hf_afp_acl_flags
,
6859 { "ACL flags", "afp.acl_flags",
6860 FT_UINT32
, BASE_HEX
, NULL
, 0,
6863 { &hf_afp_acl_access_bitmap
,
6864 { "Bitmap", "afp.acl_access_bitmap",
6865 FT_UINT32
, BASE_HEX
, NULL
, 0,
6866 "ACL access bitmap", HFILL
}},
6868 { &hf_afp_acl_access_bitmap_read_data
,
6869 { "Read/List", "afp.acl_access_bitmap.read_data",
6870 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_READ_DATA
,
6871 "Read data / list directory", HFILL
}},
6873 { &hf_afp_acl_access_bitmap_write_data
,
6874 { "Write/Add file", "afp.acl_access_bitmap.write_data",
6875 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_WRITE_DATA
,
6876 "Write data to a file / add a file to a directory", HFILL
}},
6878 { &hf_afp_acl_access_bitmap_execute
,
6879 { "Execute/Search", "afp.acl_access_bitmap.execute",
6880 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_EXECUTE
,
6881 "Execute a program", HFILL
}},
6883 { &hf_afp_acl_access_bitmap_delete
,
6884 { "Delete", "afp.acl_access_bitmap.delete",
6885 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_DELETE
,
6888 { &hf_afp_acl_access_bitmap_append_data
,
6889 { "Append data/create subdir", "afp.acl_access_bitmap.append_data",
6890 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_APPEND_DATA
,
6891 "Append data to a file / create a subdirectory", HFILL
}},
6893 { &hf_afp_acl_access_bitmap_delete_child
,
6894 { "Delete dir", "afp.acl_access_bitmap.delete_child",
6895 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_DELETE_CHILD
,
6896 "Delete directory", HFILL
}},
6898 { &hf_afp_acl_access_bitmap_read_attrs
,
6899 { "Read attributes", "afp.acl_access_bitmap.read_attrs",
6900 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_READ_ATTRIBUTES
,
6903 { &hf_afp_acl_access_bitmap_write_attrs
,
6904 { "Write attributes", "afp.acl_access_bitmap.write_attrs",
6905 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_WRITE_ATTRIBUTES
,
6908 { &hf_afp_acl_access_bitmap_read_extattrs
,
6909 { "Read extended attributes", "afp.acl_access_bitmap.read_extattrs",
6910 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_READ_EXTATTRIBUTES
,
6913 { &hf_afp_acl_access_bitmap_write_extattrs
,
6914 { "Write extended attributes", "afp.acl_access_bitmap.write_extattrs",
6915 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_WRITE_EXTATTRIBUTES
,
6918 { &hf_afp_acl_access_bitmap_read_security
,
6919 { "Read security", "afp.acl_access_bitmap.read_security",
6920 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_READ_SECURITY
,
6921 "Read access rights", HFILL
}},
6923 { &hf_afp_acl_access_bitmap_write_security
,
6924 { "Write security", "afp.acl_access_bitmap.write_security",
6925 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_WRITE_SECURITY
,
6926 "Write access rights", HFILL
}},
6928 { &hf_afp_acl_access_bitmap_change_owner
,
6929 { "Change owner", "afp.acl_access_bitmap.change_owner",
6930 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_CHANGE_OWNER
,
6933 { &hf_afp_acl_access_bitmap_synchronize
,
6934 { "Synchronize", "afp.acl_access_bitmap.synchronize",
6935 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_SYNCHRONIZE
,
6938 { &hf_afp_acl_access_bitmap_generic_all
,
6939 { "Generic all", "afp.acl_access_bitmap.generic_all",
6940 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_GENERIC_ALL
,
6943 { &hf_afp_acl_access_bitmap_generic_execute
,
6944 { "Generic execute", "afp.acl_access_bitmap.generic_execute",
6945 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_GENERIC_EXECUTE
,
6948 { &hf_afp_acl_access_bitmap_generic_write
,
6949 { "Generic write", "afp.acl_access_bitmap.generic_write",
6950 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_GENERIC_WRITE
,
6953 { &hf_afp_acl_access_bitmap_generic_read
,
6954 { "Generic read", "afp.acl_access_bitmap.generic_read",
6955 FT_BOOLEAN
, 32, NULL
, KAUTH_VNODE_GENERIC_READ
,
6958 { &hf_afp_ace_flags
,
6959 { "Flags", "afp.ace_flags",
6960 FT_UINT32
, BASE_HEX
, NULL
, 0,
6961 "ACE flags", HFILL
}},
6963 { &hf_afp_ace_flags_allow
,
6964 { "Allow", "afp.ace_flags.allow",
6965 FT_BOOLEAN
, 32, NULL
, ACE_ALLOW
,
6966 "Allow rule", HFILL
}},
6968 { &hf_afp_ace_flags_deny
,
6969 { "Deny", "afp.ace_flags.deny",
6970 FT_BOOLEAN
, 32, NULL
, ACE_DENY
,
6971 "Deny rule", HFILL
}},
6973 { &hf_afp_ace_flags_inherited
,
6974 { "Inherited", "afp.ace_flags.inherited",
6975 FT_BOOLEAN
, 32, NULL
, ACE_INHERITED
,
6978 { &hf_afp_ace_flags_fileinherit
,
6979 { "File inherit", "afp.ace_flags.file_inherit",
6980 FT_BOOLEAN
, 32, NULL
, ACE_FILE_INHERIT
,
6983 { &hf_afp_ace_flags_dirinherit
,
6984 { "Dir inherit", "afp.ace_flags.directory_inherit",
6985 FT_BOOLEAN
, 32, NULL
, ACE_DIR_INHERIT
,
6988 { &hf_afp_ace_flags_limitinherit
,
6989 { "Limit inherit", "afp.ace_flags.limit_inherit",
6990 FT_BOOLEAN
, 32, NULL
, ACE_LIMIT_INHERIT
,
6993 { &hf_afp_ace_flags_onlyinherit
,
6994 { "Only inherit", "afp.ace_flags.only_inherit",
6995 FT_BOOLEAN
, 32, NULL
, ACE_ONLY_INHERIT
,
6998 { &hf_afp_spotlight_request_flags
,
6999 { "Flags", "afp.spotlight.flags",
7000 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
7001 "Spotlight RPC Flags", HFILL
}},
7003 { &hf_afp_spotlight_request_command
,
7004 { "Command", "afp.spotlight.command",
7005 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
7006 "Spotlight RPC Command", HFILL
}},
7008 { &hf_afp_spotlight_request_reserved
,
7009 { "Reserved", "afp.spotlight.reserved",
7010 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
7011 "Spotlight RPC Padding", HFILL
}},
7013 { &hf_afp_spotlight_reply_reserved
,
7014 { "Reserved", "afp.spotlight.reserved",
7015 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
7016 "Spotlight RPC Padding", HFILL
}},
7018 { &hf_afp_spotlight_volpath_client
,
7019 { "Client's volume path", "afp.spotlight.volpath_client",
7020 FT_STRING
, BASE_NONE
, NULL
, 0x0,
7023 { &hf_afp_spotlight_volpath_server
,
7024 { "Server's volume path", "afp.spotlight.volpath_server",
7025 FT_STRING
, BASE_NONE
, NULL
, 0x0,
7026 "Servers's volume path", HFILL
}},
7028 { &hf_afp_spotlight_returncode
,
7029 { "Return code", "afp.spotlight.return",
7030 FT_INT32
, BASE_DEC
, NULL
, 0x0,
7033 { &hf_afp_spotlight_volflags
,
7034 { "Volume flags", "afp.spotlight.volflags",
7035 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
7038 { &hf_afp_spotlight_reqlen
,
7039 { "Length", "afp.spotlight.reqlen",
7040 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
7043 { &hf_afp_spotlight_uuid
,
7044 { "UUID", "afp.spotlight.uuid",
7045 FT_GUID
, BASE_NONE
, NULL
, 0x0,
7048 { &hf_afp_spotlight_date
,
7049 { "Date", "afp.spotlight.date",
7050 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_LOCAL
, NULL
, 0x0,
7054 { "Unknown parameter", "afp.unknown_bytes",
7055 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
7058 /* Status stuff from ASP or DSI */
7059 { &hf_afp_utf8_server_name_len
,
7060 { "UTF-8 server name length", "afp.utf8_server_name_len",
7061 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
7064 { &hf_afp_utf8_server_name
,
7065 { "UTF-8 server name", "afp.utf8_server_name",
7066 FT_STRING
, BASE_NONE
, NULL
, 0x0,
7069 { &hf_afp_server_name
,
7070 { "Server name", "afp.server_name",
7071 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
7074 { &hf_afp_server_type
,
7075 { "Server type", "afp.server_type",
7076 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
7079 { &hf_afp_server_vers
,
7080 { "AFP version", "afp.server_vers",
7081 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
7084 { &hf_afp_server_uams
,
7085 { "UAM", "afp.server_uams",
7086 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
7089 { &hf_afp_server_icon
,
7090 { "Icon bitmap", "afp.server_icon",
7091 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
7092 "Server icon bitmap", HFILL
}},
7094 { &hf_afp_server_directory
,
7095 { "Directory service", "afp.server_directory",
7096 FT_UINT_STRING
, BASE_NONE
, NULL
, 0x0,
7097 "Server directory service", HFILL
}},
7099 { &hf_afp_server_signature
,
7100 { "Server signature", "afp.server_signature",
7101 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
7104 { &hf_afp_server_flag
,
7105 { "Flag", "afp.server_flag",
7106 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
7107 "Server capabilities flag", HFILL
}},
7108 { &hf_afp_server_flag_copyfile
,
7109 { "Support copyfile", "afp.server_flag.copyfile",
7110 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_COPY
,
7111 "Server support copyfile", HFILL
}},
7112 { &hf_afp_server_flag_passwd
,
7113 { "Support change password", "afp.server_flag.passwd",
7114 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_PASSWD
,
7115 "Server support change password", HFILL
}},
7116 { &hf_afp_server_flag_no_save_passwd
,
7117 { "Don't allow save password", "afp.server_flag.no_save_passwd",
7118 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_NOSAVEPASSWD
,
7120 { &hf_afp_server_flag_srv_msg
,
7121 { "Support server message", "afp.server_flag.srv_msg",
7122 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_SRVMSGS
,
7124 { &hf_afp_server_flag_srv_sig
,
7125 { "Support server signature", "afp.server_flag.srv_sig",
7126 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_SRVSIGNATURE
,
7128 { &hf_afp_server_flag_tcpip
,
7129 { "Support TCP/IP", "afp.server_flag.tcpip",
7130 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_TCPIP
,
7131 "Server support TCP/IP", HFILL
}},
7132 { &hf_afp_server_flag_notify
,
7133 { "Support server notifications", "afp.server_flag.notify",
7134 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_SRVNOTIFY
,
7136 { &hf_afp_server_flag_reconnect
,
7137 { "Support server reconnect", "afp.server_flag.reconnect",
7138 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_SRVRECONNECT
,
7140 { &hf_afp_server_flag_directory
,
7141 { "Support directory services", "afp.server_flag.directory",
7142 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_SRVDIRECTORY
,
7143 "Server support directory services", HFILL
}},
7144 { &hf_afp_server_flag_utf8_name
,
7145 { "Support UTF-8 server name", "afp.server_flag.utf8_name",
7146 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_SRVUTF8
,
7147 "Server support UTF-8 server name", HFILL
}},
7148 { &hf_afp_server_flag_uuid
,
7149 { "Support UUIDs", "afp.server_flag.uuids",
7150 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_UUID
,
7151 "Server supports UUIDs", HFILL
}},
7152 { &hf_afp_server_flag_ext_sleep
,
7153 { "Support extended sleep", "afp.server_flag.ext_sleep",
7154 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_EXT_SLEEP
,
7155 "Server supports extended sleep", HFILL
}},
7156 { &hf_afp_server_flag_fast_copy
,
7157 { "Support fast copy", "afp.server_flag.fast_copy",
7158 FT_BOOLEAN
, 16, NULL
, AFPSRVRINFO_FASTBOZO
,
7159 "Server support fast copy", HFILL
}},
7162 { &hf_afp_server_addr_len
,
7163 { "Length", "afp.server_addr.len",
7164 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
7165 "Address length.", HFILL
}},
7167 { &hf_afp_server_addr_type
,
7168 { "Type", "afp.server_addr.type",
7169 FT_UINT8
, BASE_DEC
|BASE_EXT_STRING
, &afp_server_addr_type_vals_ext
, 0x0,
7170 "Address type.", HFILL
}},
7172 { &hf_afp_server_addr_value
,
7173 { "Value", "afp.server_addr.value",
7174 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
7175 "Address value", HFILL
}},
7177 /* Generated from convert_proto_tree_add_text.pl */
7178 { &hf_afp_int64
, { "int64", "afp.int64", FT_UINT64
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
7179 { &hf_afp_float
, { "float", "afp.float", FT_DOUBLE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7180 { &hf_afp_unknown16
, { "unknown1", "afp.unknown", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
7181 { &hf_afp_unknown32
, { "unknown2", "afp.unknown", FT_UINT32
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
7182 { &hf_afp_cnid
, { "CNID", "afp.cnid", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7183 { &hf_afp_null
, { "null", "afp.null", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7184 { &hf_afp_string
, { "string", "afp.string", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7185 { &hf_afp_utf_16_string
, { "utf-16 string", "afp.utf_16_string", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7186 { &hf_afp_bool
, { "bool", "afp.bool", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7187 { &hf_afp_query_type
, { "type", "afp.query_type", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
7188 { &hf_afp_toc_offset
, { "ToC Offset", "afp.toc_offset", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7189 { &hf_afp_toc_entry
, { "ToC Entry", "afp.toc_entry", FT_UINT64
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
7190 { &hf_afp_endianness
, { "Endianness", "afp.endianness", FT_UINT64
, BASE_HEX
| BASE_VAL64_STRING
, VALS64(endian_vals
), 0x0, NULL
, HFILL
}},
7191 { &hf_afp_query_len
, { "Query length", "afp.query_len", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7192 { &hf_afp_num_toc_entries
, { "Number of entries", "afp.num_toc_entries", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7193 { &hf_afp_machine_offset
, { "Machine offset", "afp.machine_offset", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7194 { &hf_afp_version_offset
, { "Version offset", "afp.version_offset", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7195 { &hf_afp_uams_offset
, { "UAMS offset", "afp.uams_offset", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7196 { &hf_afp_icon_offset
, { "Icon offset", "afp.icon_offset", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7197 { &hf_afp_signature_offset
, { "Signature offset", "afp.signature_offset", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7198 { &hf_afp_network_address_offset
, { "Network address offset", "afp.network_address_offset", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7199 { &hf_afp_directory_services_offset
, { "Directory services offset", "afp.directory_services_offset", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7200 { &hf_afp_utf8_server_name_offset
, { "UTF-8 server name offset", "afp.utf8_server_name_offset", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
7203 static int *ett
[] = {
7205 &ett_afp_server_vol
,
7208 &ett_afp_vol_bitmap
,
7209 &ett_afp_vol_attribute
,
7210 &ett_afp_dir_bitmap
,
7211 &ett_afp_file_bitmap
,
7212 &ett_afp_unix_privs
,
7214 &ett_afp_enumerate_line
,
7215 &ett_afp_access_mode
,
7216 &ett_afp_dir_attribute
,
7217 &ett_afp_file_attribute
,
7219 &ett_afp_lock_flags
,
7221 &ett_afp_cat_search
,
7222 &ett_afp_cat_r_bitmap
,
7225 &ett_afp_user_bitmap
,
7226 &ett_afp_message_bitmap
,
7227 &ett_afp_extattr_bitmap
,
7228 &ett_afp_extattr_names
,
7229 &ett_afp_acl_list_bitmap
,
7230 &ett_afp_acl_access_bitmap
,
7231 &ett_afp_ace_entries
,
7234 &ett_afp_spotlight_queries
,
7235 &ett_afp_spotlight_query_line
,
7236 &ett_afp_spotlight_query
,
7237 &ett_afp_spotlight_data
,
7238 &ett_afp_spotlight_toc
,
7240 /* Status stuff from ASP or DSI */
7242 &ett_afp_status_server_flag
,
7245 &ett_afp_server_addr
,
7246 &ett_afp_server_addr_line
,
7251 static ei_register_info ei
[] = {
7252 { &ei_afp_subquery_count_over_safety_limit
, { "afp.subquery_count_over_safety_limit", PI_MALFORMED
, PI_ERROR
, "Subquery count > safety limit", EXPFILL
}},
7253 { &ei_afp_subquery_count_over_query_count
, { "afp.subquery_count_over_query_count", PI_MALFORMED
, PI_ERROR
, "Subquery count > query count", EXPFILL
}},
7254 { &ei_afp_abnormal_num_subqueries
, { "afp.abnormal_num_subqueries", PI_PROTOCOL
, PI_WARN
, "Abnormal number of subqueries", EXPFILL
}},
7255 { &ei_afp_too_many_acl_entries
, { "afp.too_many_acl_entries", PI_UNDECODED
, PI_WARN
, "Too many ACL entries", EXPFILL
}},
7256 { &ei_afp_ip_port_reused
, { "afp.ip_port_reused", PI_SEQUENCE
, PI_WARN
, "IP port reused, you need to split the capture file", EXPFILL
}},
7257 { &ei_afp_toc_offset
, { "afp.toc_offset.bogus", PI_PROTOCOL
, PI_WARN
, "ToC offset bogus", EXPFILL
}},
7259 expert_module_t
* expert_afp
;
7261 proto_afp
= proto_register_protocol("Apple Filing Protocol", "AFP", "afp");
7262 proto_register_field_array(proto_afp
, hf
, array_length(hf
));
7263 proto_register_subtree_array(ett
, array_length(ett
));
7264 expert_afp
= expert_register_protocol(proto_afp
);
7265 expert_register_field_array(expert_afp
, ei
, array_length(ei
));
7267 afp_request_hash
= wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), afp_hash
, afp_equal
);
7269 register_dissector("afp", dissect_afp
, proto_afp
);
7270 register_dissector("afp_server_status", dissect_afp_server_status
,
7272 register_dissector("afp_spotlight", dissect_spotlight
, proto_afp
);
7274 afp_tap
= register_tap("afp");
7276 register_srt_table(proto_afp
, NULL
, 1, afpstat_packet
, afpstat_init
, NULL
);
7280 proto_reg_handoff_afp(void)
7282 spotlight_handle
= find_dissector_add_dependency("afp_spotlight", proto_afp
);
7285 /* -------------------------------
7290 * Editor modelines - https://www.wireshark.org/tools/modelines.html
7295 * indent-tabs-mode: t
7298 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
7299 * :indentSize=8:tabSize=8:noTabs=false: