2 * Routines for afp packet dissection
3 * Copyright 2002, Didier Gautheron <dgautheron@magic.fr>
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * Copied from README.developer
12 * Copied from packet-dsi.c
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 #include <epan/packet.h>
39 /* #include <epan/strutil.h> */
40 #include <epan/conversation.h>
41 #include <epan/emem.h>
44 #include "packet-afp.h"
46 /* The information in this module (AFP) comes from:
48 AFP 2.1 & 2.2.pdf contained in AppleShare_IP_6.3_SDK
49 available from http://www.apple.com
51 AFP3.0.pdf from http://www.apple.com (still available?)
54 http://developer.apple.com/documentation/Networking/Conceptual/AFP/AFP3_1.pdf
58 http://developer.apple.com/documentation/Networking/Conceptual/AFP/index.html
60 The netatalk source code by Wesley Craig & Adrian Sun
61 http://netatalk.sf.net
63 /* from netatalk/include/afp.h */
64 #define AFPTRANS_NONE 0
65 #define AFPTRANS_DDP (1 << 0)
66 #define AFPTRANS_TCP (1 << 1)
67 #define AFPTRANS_ALL (AFPTRANS_DDP | AFPTRANS_TCP)
69 /* AFP Attention Codes -- 4 bits */
70 #define AFPATTN_SHUTDOWN (1 << 15) /* shutdown/disconnect */
71 #define AFPATTN_CRASH (1 << 14) /* server crashed */
72 #define AFPATTN_MESG (1 << 13) /* server has message */
73 #define AFPATTN_NORECONNECT (1 << 12) /* don't reconnect */
74 /* server notification */
75 #define AFPATTN_NOTIFY (AFPATTN_MESG | AFPATTN_NORECONNECT)
77 /* extended bitmap -- 12 bits. volchanged is only useful w/ a server
78 * notification, and time is only useful for shutdown. */
79 #define AFPATTN_VOLCHANGED (1 << 0) /* volume has changed */
80 #define AFPATTN_TIME(x) ((x) & 0xfff) /* time in minutes */
83 #define AFP_BYTELOCK 1
84 #define AFP_CLOSEVOL 2
85 #define AFP_CLOSEDIR 3
86 #define AFP_CLOSEFORK 4
87 #define AFP_COPYFILE 5
88 #define AFP_CREATEDIR 6
89 #define AFP_CREATEFILE 7
91 #define AFP_ENUMERATE 9
93 #define AFP_FLUSHFORK 11
94 #define AFP_GETFORKPARAM 14
95 #define AFP_GETSRVINFO 15
96 #define AFP_GETSRVPARAM 16
97 #define AFP_GETVOLPARAM 17
99 #define AFP_LOGINCONT 19
100 #define AFP_LOGOUT 20
102 #define AFP_MAPNAME 22
104 #define AFP_OPENVOL 24
105 #define AFP_OPENDIR 25
106 #define AFP_OPENFORK 26
108 #define AFP_RENAME 28
109 #define AFP_SETDIRPARAM 29
110 #define AFP_SETFILEPARAM 30
111 #define AFP_SETFORKPARAM 31
112 #define AFP_SETVOLPARAM 32
114 #define AFP_GETFLDRPARAM 34
115 #define AFP_SETFLDRPARAM 35
116 #define AFP_CHANGEPW 36
117 #define AFP_GETUSERINFO 37
118 #define AFP_GETSRVRMSG 38
119 #define AFP_CREATEID 39
120 #define AFP_DELETEID 40
121 #define AFP_RESOLVEID 41
122 #define AFP_EXCHANGEFILE 42
123 #define AFP_CATSEARCH 43
124 #define AFP_OPENDT 48
125 #define AFP_CLOSEDT 49
126 #define AFP_GETICON 51
127 #define AFP_GTICNINFO 52
128 #define AFP_ADDAPPL 53
129 #define AFP_RMVAPPL 54
130 #define AFP_GETAPPL 55
131 #define AFP_ADDCMT 56
132 #define AFP_RMVCMT 57
133 #define AFP_GETCMT 58
135 #define AFP_ADDICON 192
137 /* AFP 3.0 new calls */
138 #define AFP_BYTELOCK_EXT 59
139 #define AFP_CATSEARCH_EXT 67
140 #define AFP_ENUMERATE_EXT 66
141 #define AFP_READ_EXT 60
142 #define AFP_WRITE_EXT 61
143 #define AFP_LOGIN_EXT 63
144 #define AFP_GETSESSTOKEN 64
145 #define AFP_DISCTOLDSESS 65
147 /* AFP 3.1 new calls */
148 #define AFP_ENUMERATE_EXT2 68
150 /* AFP 3.2 new calls */
151 #define AFP_GETEXTATTR 69
152 #define AFP_SETEXTATTR 70
153 #define AFP_REMOVEATTR 71
154 #define AFP_LISTEXTATTR 72
155 #define AFP_GETACL 73
156 #define AFP_SETACL 74
157 #define AFP_ACCESS 75
159 /* ----------------------------- */
160 static int proto_afp = -1;
161 static int hf_afp_reserved = -1;
163 static int hf_afp_command = -1; /* CommandCode */
164 static int hf_afp_AFPVersion = -1;
165 static int hf_afp_UAM = -1;
166 static int hf_afp_user = -1;
167 static int hf_afp_passwd = -1;
168 static int hf_afp_random = -1;
170 static int hf_afp_response_to = -1;
171 static int hf_afp_time = -1;
172 static int hf_afp_response_in = -1;
174 static int hf_afp_login_flags = -1;
175 static int hf_afp_pad = -1;
177 static int hf_afp_user_type = -1;
178 static int hf_afp_user_len = -1;
179 static int hf_afp_user_name = -1;
181 static int hf_afp_vol_flag_passwd = -1;
182 static int hf_afp_vol_flag_unix_priv = -1;
183 static int hf_afp_server_time = -1;
185 static int hf_afp_vol_bitmap = -1;
186 static int hf_afp_vol_name_offset = -1;
187 static int hf_afp_vol_id = -1;
188 static int hf_afp_vol_attribute = -1;
189 static int hf_afp_vol_name = -1;
190 static int hf_afp_vol_signature = -1;
191 static int hf_afp_vol_creation_date = -1;
192 static int hf_afp_vol_modification_date = -1;
193 static int hf_afp_vol_backup_date = -1;
194 static int hf_afp_vol_bytes_free = -1;
195 static int hf_afp_vol_bytes_total = -1;
196 static int hf_afp_vol_ex_bytes_free = -1;
197 static int hf_afp_vol_ex_bytes_total = -1;
198 static int hf_afp_vol_block_size = -1;
201 static int hf_afp_comment = -1;
202 static int hf_afp_file_creator = -1;
203 static int hf_afp_file_type = -1;
204 static int hf_afp_icon_type = -1;
205 static int hf_afp_icon_length = -1;
206 static int hf_afp_icon_tag = -1;
207 static int hf_afp_icon_index = -1;
208 static int hf_afp_appl_index = -1;
209 static int hf_afp_appl_tag = -1;
211 static int hf_afp_did = -1;
212 static int hf_afp_file_id = -1;
213 static int hf_afp_file_DataForkLen = -1;
214 static int hf_afp_file_RsrcForkLen = -1;
215 static int hf_afp_file_ExtDataForkLen = -1;
216 static int hf_afp_file_ExtRsrcForkLen = -1;
218 static int hf_afp_dir_bitmap = -1;
219 static int hf_afp_dir_offspring = -1;
220 static int hf_afp_dir_OwnerID = -1;
221 static int hf_afp_dir_GroupID = -1;
223 static int hf_afp_file_bitmap = -1;
224 static int hf_afp_req_count = -1;
225 static int hf_afp_start_index = -1;
226 static int hf_afp_start_index32 = -1;
227 static int hf_afp_max_reply_size = -1;
228 static int hf_afp_max_reply_size32 = -1;
229 static int hf_afp_file_flag = -1;
230 static int hf_afp_create_flag = -1;
231 static int hf_afp_struct_size = -1;
232 static int hf_afp_struct_size16 = -1;
234 static int hf_afp_request_bitmap = -1;
236 static int hf_afp_cat_count = -1;
237 static int hf_afp_cat_req_matches = -1;
238 static int hf_afp_cat_position = -1;
240 static int hf_afp_creation_date = -1;
241 static int hf_afp_modification_date = -1;
242 static int hf_afp_backup_date = -1;
243 static int hf_afp_finder_info = -1;
244 static int hf_afp_long_name_offset = -1;
245 static int hf_afp_short_name_offset = -1;
246 static int hf_afp_unicode_name_offset = -1;
247 static int hf_afp_unix_privs_uid = -1;
248 static int hf_afp_unix_privs_gid = -1;
249 static int hf_afp_unix_privs_permissions = -1;
250 static int hf_afp_unix_privs_ua_permissions = -1;
252 static int hf_afp_path_type = -1;
253 static int hf_afp_path_len = -1;
254 static int hf_afp_path_name = -1;
255 static int hf_afp_path_unicode_hint = -1;
256 static int hf_afp_path_unicode_len = -1;
258 static int hf_afp_flag = -1;
259 static int hf_afp_dt_ref = -1;
260 static int hf_afp_ofork = -1;
261 static int hf_afp_ofork_len = -1;
262 static int hf_afp_offset = -1;
263 static int hf_afp_rw_count = -1;
264 static int hf_afp_newline_mask = -1;
265 static int hf_afp_newline_char = -1;
266 static int hf_afp_last_written = -1;
267 static int hf_afp_actual_count = -1;
269 static int hf_afp_fork_type = -1;
270 static int hf_afp_access_mode = -1;
271 static int hf_afp_access_read = -1;
272 static int hf_afp_access_write = -1;
273 static int hf_afp_access_deny_read = -1;
274 static int hf_afp_access_deny_write = -1;
276 static gint hf_afp_lock_op = -1;
277 static gint hf_afp_lock_from = -1;
278 static gint hf_afp_lock_offset = -1;
279 static gint hf_afp_lock_len = -1;
280 static gint hf_afp_lock_range_start = -1;
282 static gint ett_afp = -1;
284 static gint ett_afp_vol_attribute = -1;
285 static gint ett_afp_enumerate = -1;
286 static gint ett_afp_enumerate_line = -1;
287 static gint ett_afp_access_mode = -1;
289 static gint ett_afp_vol_bitmap = -1;
290 static gint ett_afp_dir_bitmap = -1;
291 static gint ett_afp_dir_attribute = -1;
292 static gint ett_afp_file_attribute = -1;
293 static gint ett_afp_file_bitmap = -1;
294 static gint ett_afp_unix_privs = -1;
295 static gint ett_afp_path_name = -1;
296 static gint ett_afp_lock_flags = -1;
297 static gint ett_afp_dir_ar = -1;
299 static gint ett_afp_server_vol = -1;
300 static gint ett_afp_vol_list = -1;
301 static gint ett_afp_vol_flag = -1;
302 static gint ett_afp_cat_search = -1;
303 static gint ett_afp_cat_r_bitmap = -1;
304 static gint ett_afp_cat_spec = -1;
305 static gint ett_afp_vol_did = -1;
307 /* AFP 3.0 parameters */
308 static gint hf_afp_lock_offset64 = -1;
309 static gint hf_afp_lock_len64 = -1;
310 static gint hf_afp_lock_range_start64 = -1;
312 static int hf_afp_offset64 = -1;
313 static int hf_afp_rw_count64 = -1;
314 static int hf_afp_reqcount64 = -1;
316 static int hf_afp_last_written64 = -1;
318 static int hf_afp_ofork_len64 = -1;
319 static int hf_afp_session_token_type = -1;
320 static int hf_afp_session_token_len = -1;
321 static int hf_afp_session_token = -1;
322 static int hf_afp_session_token_timestamp = -1;
326 static int hf_afp_extattr_bitmap = -1;
327 static int hf_afp_extattr_bitmap_NoFollow = -1;
328 static int hf_afp_extattr_bitmap_Create = -1;
329 static int hf_afp_extattr_bitmap_Replace = -1;
330 static int ett_afp_extattr_bitmap = -1;
331 static int hf_afp_extattr_namelen = -1;
332 static int hf_afp_extattr_name = -1;
333 static int hf_afp_extattr_len = -1;
334 static int hf_afp_extattr_data = -1;
335 static int hf_afp_extattr_req_count = -1;
336 static int hf_afp_extattr_start_index = -1;
337 static int hf_afp_extattr_reply_size = -1;
338 static int ett_afp_extattr_names = -1;
340 static int afp_tap = -1;
342 static dissector_handle_t data_handle;
344 static const value_string vol_signature_vals[] = {
346 {2, "Fixed Directory ID"},
347 {3, "Variable Directory ID (deprecated)"},
351 const value_string CommandCode_vals[] = {
352 {AFP_BYTELOCK, "FPByteRangeLock" },
353 {AFP_CLOSEVOL, "FPCloseVol" },
354 {AFP_CLOSEDIR, "FPCloseDir" },
355 {AFP_CLOSEFORK, "FPCloseFork" },
356 {AFP_COPYFILE, "FPCopyFile" },
357 {AFP_CREATEDIR, "FPCreateDir" },
358 {AFP_CREATEFILE, "FPCreateFile" },
359 {AFP_DELETE, "FPDelete" },
360 {AFP_ENUMERATE, "FPEnumerate" },
361 {AFP_FLUSH, "FPFlush" },
362 {AFP_FLUSHFORK, "FPFlushFork" },
363 {AFP_GETFORKPARAM, "FPGetForkParms" },
364 {AFP_GETSRVINFO, "FPGetSrvrInfo" },
365 {AFP_GETSRVPARAM, "FPGetSrvrParms" },
366 {AFP_GETVOLPARAM, "FPGetVolParms" },
367 {AFP_LOGIN, "FPLogin" },
368 {AFP_LOGINCONT, "FPLoginCont" },
369 {AFP_LOGOUT, "FPLogout" },
370 {AFP_MAPID, "FPMapID" },
371 {AFP_MAPNAME, "FPMapName" },
372 {AFP_MOVE, "FPMoveAndRename" },
373 {AFP_OPENVOL, "FPOpenVol" },
374 {AFP_OPENDIR, "FPOpenDir" },
375 {AFP_OPENFORK, "FPOpenFork" },
376 {AFP_READ, "FPRead" },
377 {AFP_RENAME, "FPRename" },
378 {AFP_SETDIRPARAM, "FPSetDirParms" },
379 {AFP_SETFILEPARAM, "FPSetFileParms" },
380 {AFP_SETFORKPARAM, "FPSetForkParms" },
381 {AFP_SETVOLPARAM, "FPSetVolParms" },
382 {AFP_WRITE, "FPWrite" },
383 {AFP_GETFLDRPARAM, "FPGetFileDirParms" },
384 {AFP_SETFLDRPARAM, "FPSetFileDirParms" },
385 {AFP_CHANGEPW, "FPChangePassword" },
386 {AFP_GETUSERINFO, "FPGetUserInfo" },
387 {AFP_GETSRVRMSG, "FPGetSrvrMsg" },
388 {AFP_CREATEID, "FPCreateID" },
389 {AFP_DELETEID, "FPDeleteID" },
390 {AFP_RESOLVEID, "FPResolveID" },
391 {AFP_EXCHANGEFILE, "FPExchangeFiles" },
392 {AFP_CATSEARCH, "FPCatSearch" },
393 {AFP_OPENDT, "FPOpenDT" },
394 {AFP_CLOSEDT, "FPCloseDT" },
395 {AFP_GETICON, "FPGetIcon" },
396 {AFP_GTICNINFO, "FPGetIconInfo" },
397 {AFP_ADDAPPL, "FPAddAPPL" },
398 {AFP_RMVAPPL, "FPRemoveAPPL" },
399 {AFP_GETAPPL, "FPGetAPPL" },
400 {AFP_ADDCMT, "FPAddComment" },
401 {AFP_RMVCMT, "FPRemoveComment" },
402 {AFP_GETCMT, "FPGetComment" },
403 {AFP_BYTELOCK_EXT, "FPByteRangeLockExt" },
404 {AFP_CATSEARCH_EXT, "FPCatSearchExt" },
405 {AFP_ENUMERATE_EXT, "FPEnumerateExt" },
406 {AFP_ENUMERATE_EXT2, "FPEnumerateExt2" },
407 {AFP_READ_EXT, "FPReadExt" },
408 {AFP_WRITE_EXT, "FPWriteExt" },
409 {AFP_LOGIN_EXT, "FPLoginExt" },
410 {AFP_GETSESSTOKEN, "FPGetSessionToken" },
411 {AFP_DISCTOLDSESS, "FPDisconnectOldSession" },
412 {AFP_ZZZ, "FPZzzzz" },
413 {AFP_ADDICON, "FPAddIcon" },
414 {AFP_GETEXTATTR, "FPGetExtAttr" },
415 {AFP_SETEXTATTR, "FPSetExtAttr" },
416 {AFP_REMOVEATTR, "FPRemoveExtAttr" },
417 {AFP_LISTEXTATTR, "FPListExtAttrs" },
418 {AFP_GETACL, "FPGetACL" },
419 {AFP_SETACL, "FPSetACL" },
420 {AFP_ACCESS, "FPAccess" },
424 static const value_string unicode_hint_vals[] = {
426 { 1, "MacJapanese" },
427 { 2, "MacChineseTrad" },
432 { 7, "MacCyrillic" },
433 { 9, "MacDevanagari" },
434 { 10, "MacGurmukhi" },
435 { 11, "MacGujarati" },
437 { 13, "MacBengali" },
440 { 16, "MacKannada" },
441 { 17, "MacMalayalam" },
442 { 18, "MacSinhalese" },
443 { 19, "MacBurmese" },
446 { 22, "MacLaotian" },
447 { 23, "MacGeorgian" },
448 { 24, "MacArmenian" },
449 { 25, "MacChineseSimp" },
450 { 26, "MacTibetan" },
451 { 27, "MacMongolian" },
452 { 28, "MacEthiopic" },
453 { 29, "MacCentralEurRoman" },
454 { 30, "MacVietnamese" },
455 { 31, "MacExtArabic" },
457 { 34, "MacDingbats" },
458 { 35, "MacTurkish" },
459 { 36, "MacCroatian" },
460 { 37, "MacIcelandic" },
461 { 38, "MacRomanian" },
464 { 41, "MacKeyboardGlyphs" },
465 { 126, "MacUnicode" },
467 { 152, "MacUkrainian" },
471 { 256, "UnicodeDefault" },
472 /* { 257, "UnicodeV1_1" }, */
473 { 257, "ISO10646_1993" },
474 { 259, "UnicodeV2_0" },
475 { 259, "UnicodeV2_1" },
476 { 260, "UnicodeV3_0" },
477 { 513, "ISOLatin1" },
478 { 514, "ISOLatin2" },
479 { 515, "ISOLatin3" },
480 { 516, "ISOLatin4" },
481 { 517, "ISOLatinCyrillic" },
482 { 518, "ISOLatinArabic" },
483 { 519, "ISOLatinGreek" },
484 { 520, "ISOLatinHebrew" },
485 { 521, "ISOLatin5" },
486 { 522, "ISOLatin6" },
487 { 525, "ISOLatin7" },
488 { 526, "ISOLatin8" },
489 { 527, "ISOLatin9" },
490 { 1024, "DOSLatinUS" },
491 { 1029, "DOSGreek" },
492 { 1030, "DOSBalticRim" },
493 { 1040, "DOSLatin1" },
494 { 1041, "DOSGreek1" },
495 { 1042, "DOSLatin2" },
496 { 1043, "DOSCyrillic" },
497 { 1044, "DOSTurkish" },
498 { 1045, "DOSPortuguese" },
499 { 1046, "DOSIcelandic" },
500 { 1047, "DOSHebrew" },
501 { 1048, "DOSCanadianFrench" },
502 { 1049, "DOSArabic" },
503 { 1050, "DOSNordic" },
504 { 1051, "DOSRussian" },
505 { 1052, "DOSGreek2" },
507 { 1056, "DOSJapanese" },
508 { 1057, "DOSChineseSimplif" },
509 { 1058, "DOSKorean" },
510 { 1059, "DOSChineseTrad" },
511 { 1280, "WindowsLatin1" },
512 /* { 1280, "WindowsANSI" }, */
513 { 1281, "WindowsLatin2" },
514 { 1282, "WindowsCyrillic" },
515 { 1283, "WindowsGreek" },
516 { 1284, "WindowsLatin5" },
517 { 1285, "WindowsHebrew" },
518 { 1286, "WindowsArabic" },
519 { 1287, "WindowsBalticRim" },
520 { 1288, "WindowsVietnamese" },
521 { 1296, "WindowsKoreanJohab" },
522 { 1536, "US_ASCII" },
523 { 1568, "JIS_X0201_76" },
524 { 1569, "JIS_X0208_83" },
525 { 1570, "JIS_X0208_90" },
530 from Apple AFP3.0.pdf
533 #define kFPVolAttributeBit (1 << 0)
534 #define kFPVolSignatureBit (1 << 1)
535 #define kFPVolCreateDateBit (1 << 2)
536 #define kFPVolModDateBit (1 << 3)
537 #define kFPVolBackupDateBit (1 << 4)
538 #define kFPVolIDBit (1 << 5)
539 #define kFPVolBytesFreeBit (1 << 6)
540 #define kFPVolBytesTotalBit (1 << 7)
541 #define kFPVolNameBit (1 << 8)
542 #define kFPVolExtBytesFreeBit (1 << 9)
543 #define kFPVolExtBytesTotalBit (1 << 10)
544 #define kFPVolBlockSizeBit (1 << 11)
546 static int hf_afp_vol_bitmap_Attributes = -1;
547 static int hf_afp_vol_bitmap_Signature = -1;
548 static int hf_afp_vol_bitmap_CreateDate = -1;
549 static int hf_afp_vol_bitmap_ModDate = -1;
550 static int hf_afp_vol_bitmap_BackupDate = -1;
551 static int hf_afp_vol_bitmap_ID = -1;
552 static int hf_afp_vol_bitmap_BytesFree = -1;
553 static int hf_afp_vol_bitmap_BytesTotal = -1;
554 static int hf_afp_vol_bitmap_Name = -1;
555 static int hf_afp_vol_bitmap_ExtBytesFree = -1;
556 static int hf_afp_vol_bitmap_ExtBytesTotal = -1;
557 static int hf_afp_vol_bitmap_BlockSize = -1;
559 static int hf_afp_vol_attribute_ReadOnly = -1;
560 static int hf_afp_vol_attribute_HasVolumePassword = -1;
561 static int hf_afp_vol_attribute_SupportsFileIDs = -1;
562 static int hf_afp_vol_attribute_SupportsCatSearch = -1;
563 static int hf_afp_vol_attribute_SupportsBlankAccessPrivs = -1;
564 static int hf_afp_vol_attribute_SupportsUnixPrivs = -1;
565 static int hf_afp_vol_attribute_SupportsUTF8Names = -1;
566 static int hf_afp_vol_attribute_NoNetworkUserID = -1;
567 static int hf_afp_vol_attribute_DefaultPrivsFromParent = -1;
568 static int hf_afp_vol_attribute_NoExchangeFiles = -1;
569 static int hf_afp_vol_attribute_SupportsExtAttrs = -1;
570 static int hf_afp_vol_attribute_SupportsACLs = -1;
572 static int hf_afp_dir_bitmap_Attributes = -1;
573 static int hf_afp_dir_bitmap_ParentDirID = -1;
574 static int hf_afp_dir_bitmap_CreateDate = -1;
575 static int hf_afp_dir_bitmap_ModDate = -1;
576 static int hf_afp_dir_bitmap_BackupDate = -1;
577 static int hf_afp_dir_bitmap_FinderInfo = -1;
578 static int hf_afp_dir_bitmap_LongName = -1;
579 static int hf_afp_dir_bitmap_ShortName = -1;
580 static int hf_afp_dir_bitmap_NodeID = -1;
581 static int hf_afp_dir_bitmap_OffspringCount = -1;
582 static int hf_afp_dir_bitmap_OwnerID = -1;
583 static int hf_afp_dir_bitmap_GroupID = -1;
584 static int hf_afp_dir_bitmap_AccessRights = -1;
585 static int hf_afp_dir_bitmap_UTF8Name = -1;
586 static int hf_afp_dir_bitmap_UnixPrivs = -1;
588 static int hf_afp_dir_attribute_Invisible = -1;
589 static int hf_afp_dir_attribute_IsExpFolder = -1;
591 static int hf_afp_dir_attribute_System = -1;
592 static int hf_afp_dir_attribute_Mounted = -1;
593 static int hf_afp_dir_attribute_InExpFolder = -1;
595 static int hf_afp_dir_attribute_BackUpNeeded = -1;
596 static int hf_afp_dir_attribute_RenameInhibit = -1;
597 static int hf_afp_dir_attribute_DeleteInhibit = -1;
598 static int hf_afp_dir_attribute_SetClear = -1;
600 static int hf_afp_file_bitmap_Attributes = -1;
601 static int hf_afp_file_bitmap_ParentDirID = -1;
602 static int hf_afp_file_bitmap_CreateDate = -1;
603 static int hf_afp_file_bitmap_ModDate = -1;
604 static int hf_afp_file_bitmap_BackupDate = -1;
605 static int hf_afp_file_bitmap_FinderInfo = -1;
606 static int hf_afp_file_bitmap_LongName = -1;
607 static int hf_afp_file_bitmap_ShortName = -1;
608 static int hf_afp_file_bitmap_NodeID = -1;
609 static int hf_afp_file_bitmap_DataForkLen = -1;
610 static int hf_afp_file_bitmap_RsrcForkLen = -1;
611 static int hf_afp_file_bitmap_ExtDataForkLen = -1;
612 static int hf_afp_file_bitmap_LaunchLimit = -1;
614 static int hf_afp_file_bitmap_UTF8Name = -1;
615 static int hf_afp_file_bitmap_ExtRsrcForkLen = -1;
616 static int hf_afp_file_bitmap_UnixPrivs = -1;
618 static int hf_afp_file_attribute_Invisible = -1;
619 static int hf_afp_file_attribute_MultiUser = -1;
620 static int hf_afp_file_attribute_System = -1;
621 static int hf_afp_file_attribute_DAlreadyOpen = -1;
622 static int hf_afp_file_attribute_RAlreadyOpen = -1;
623 static int hf_afp_file_attribute_WriteInhibit = -1;
624 static int hf_afp_file_attribute_BackUpNeeded = -1;
625 static int hf_afp_file_attribute_RenameInhibit = -1;
626 static int hf_afp_file_attribute_DeleteInhibit = -1;
627 static int hf_afp_file_attribute_CopyProtect = -1;
628 static int hf_afp_file_attribute_SetClear = -1;
630 static int hf_afp_map_name_type = -1;
631 static int hf_afp_map_name = -1;
632 static int hf_afp_map_id = -1;
633 static int hf_afp_map_id_type = -1;
635 static int hf_afp_request_bitmap_Attributes = -1;
636 static int hf_afp_request_bitmap_ParentDirID = -1;
637 static int hf_afp_request_bitmap_CreateDate = -1;
638 static int hf_afp_request_bitmap_ModDate = -1;
639 static int hf_afp_request_bitmap_BackupDate = -1;
640 static int hf_afp_request_bitmap_FinderInfo = -1;
641 static int hf_afp_request_bitmap_LongName = -1;
642 static int hf_afp_request_bitmap_DataForkLen = -1;
643 static int hf_afp_request_bitmap_OffspringCount = -1;
644 static int hf_afp_request_bitmap_RsrcForkLen = -1;
645 static int hf_afp_request_bitmap_ExtDataForkLen = -1;
646 static int hf_afp_request_bitmap_UTF8Name = -1;
647 static int hf_afp_request_bitmap_ExtRsrcForkLen = -1;
648 static int hf_afp_request_bitmap_PartialNames = -1;
650 static const value_string flag_vals[] = {
655 static const value_string path_type_vals[] = {
658 {3, "Unicode names" },
661 static const value_string map_name_type_vals[] = {
662 {1, "Unicode user name to a user ID" },
663 {2, "Unicode group name to a group ID" },
664 {3, "Macintosh roman user name to a user ID" },
665 {4, "Macintosh roman group name to a group ID" },
666 {5, "Unicode user name to a user UUID" },
667 {6, "Unicode group name to a group UUID" },
670 static const value_string map_id_type_vals[] = {
671 {1, "User ID to a Macintosh roman user name" },
672 {2, "Group ID to a Macintosh roman group name" },
673 {3, "User ID to a unicode user name" },
674 {4, "Group ID to a unicode group name" },
675 {5, "User UUID to a unicode user name" },
676 {6, "Group UUID to a unicode group name" },
680 volume attribute from Apple AFP3.0.pdf
683 #define kReadOnly (1 << 0)
684 #define kHasVolumePassword (1 << 1)
685 #define kSupportsFileIDs (1 << 2)
686 #define kSupportsCatSearch (1 << 3)
687 #define kSupportsBlankAccessPrivs (1 << 4)
688 #define kSupportsUnixPrivs (1 << 5)
689 #define kSupportsUTF8Names (1 << 6)
691 #define kNoNetworkUserIDs (1 << 7)
693 #define kDefaultPrivsFromParent (1 << 8)
694 #define kNoExchangeFiles (1 << 9)
695 #define kSupportsExtAttrs (1 << 10)
696 #define kSupportsACLs (1 << 11)
699 directory bitmap from Apple AFP3.1.pdf
702 #define kFPAttributeBit (1 << 0)
703 #define kFPParentDirIDBit (1 << 1)
704 #define kFPCreateDateBit (1 << 2)
705 #define kFPModDateBit (1 << 3)
706 #define kFPBackupDateBit (1 << 4)
707 #define kFPFinderInfoBit (1 << 5)
708 #define kFPLongNameBit (1 << 6)
709 #define kFPShortNameBit (1 << 7)
710 #define kFPNodeIDBit (1 << 8)
711 #define kFPOffspringCountBit (1 << 9)
712 #define kFPOwnerIDBit (1 << 10)
713 #define kFPGroupIDBit (1 << 11)
714 #define kFPAccessRightsBit (1 << 12)
715 #define kFPUTF8NameBit (1 << 13)
717 /* FIXME AFP3.0 bit 14, AFP3.1 bit 15 */
719 #define kFPUnixPrivsBit (1 << 15)
722 directory Access Rights parameter AFP3.1.pdf
726 #define AR_O_SEARCH (1 << 0) /* owner has search access */
727 #define AR_O_READ (1 << 1) /* owner has read access */
728 #define AR_O_WRITE (1 << 2) /* owner has write access */
730 #define AR_G_SEARCH (1 << 8) /* group has search access */
731 #define AR_G_READ (1 << 9) /* group has read access */
732 #define AR_G_WRITE (1 << 10) /* group has write access */
734 #define AR_E_SEARCH (1 << 16) /* everyone has search access */
735 #define AR_E_READ (1 << 17) /* everyone has read access */
736 #define AR_E_WRITE (1 << 18) /* everyone has write access */
738 #define AR_U_SEARCH (1 << 24) /* user has search access */
739 #define AR_U_READ (1 << 25) /* user has read access */
740 #define AR_U_WRITE (1 << 26) /* user has write access */
742 #define AR_BLANK (1 << 28) /* Blank Access Privileges (use parent dir privileges) */
743 #define AR_U_OWN (1UL << 31) /* user is the owner */
745 static int hf_afp_dir_ar = -1;
746 static int hf_afp_dir_ar_o_search = -1;
747 static int hf_afp_dir_ar_o_read = -1;
748 static int hf_afp_dir_ar_o_write = -1;
749 static int hf_afp_dir_ar_g_search = -1;
750 static int hf_afp_dir_ar_g_read = -1;
751 static int hf_afp_dir_ar_g_write = -1;
752 static int hf_afp_dir_ar_e_search = -1;
753 static int hf_afp_dir_ar_e_read = -1;
754 static int hf_afp_dir_ar_e_write = -1;
755 static int hf_afp_dir_ar_u_search = -1;
756 static int hf_afp_dir_ar_u_read = -1;
757 static int hf_afp_dir_ar_u_write = -1;
758 static int hf_afp_dir_ar_blank = -1;
759 static int hf_afp_dir_ar_u_own = -1;
761 static int hf_afp_user_flag = -1;
762 static int hf_afp_user_ID = -1;
763 static int hf_afp_group_ID = -1;
764 static int hf_afp_UUID = -1;
765 static int hf_afp_GRPUUID = -1;
766 static int hf_afp_user_bitmap = -1;
767 static int hf_afp_user_bitmap_UID = -1;
768 static int hf_afp_user_bitmap_GID = -1;
769 static int hf_afp_user_bitmap_UUID= -1;
771 static gint ett_afp_user_bitmap = -1;
773 static const value_string user_flag_vals[] = {
775 {1, "Default user" },
778 static int hf_afp_message = -1;
779 static int hf_afp_message_type = -1;
780 static int hf_afp_message_bitmap = -1;
781 static int hf_afp_message_bitmap_REQ = -1;
782 static int hf_afp_message_bitmap_UTF = -1;
783 static int hf_afp_message_len = -1;
785 static gint ett_afp_message_bitmap = -1;
787 static const value_string server_message_type[] = {
788 {0, "Login message" },
789 {1, "Server message" },
793 file bitmap AFP3.1.pdf
796 kFPAttributeBit (bit 0)
797 kFPParentDirIDBit (bit 1)
798 kFPCreateDateBit (bit 2)
799 kFPModDateBit (bit 3)
800 kFPBackupDateBit (bit 4)
801 kFPFinderInfoBit (bit 5)
802 kFPLongNameBit (bit 6)
803 kFPShortNameBit (bit 7)
806 kFPUTF8NameBit (bit 13)
809 #define kFPDataForkLenBit (1 << 9)
810 #define kFPRsrcForkLenBit (1 << 10)
811 #define kFPExtDataForkLenBit (1 << 11)
812 #define kFPLaunchLimitBit (1 << 12)
814 #define kFPExtRsrcForkLenBit (1 << 14)
817 file attribute AFP3.1.pdf
820 #define kFPInvisibleBit (1 << 0)
821 #define kFPMultiUserBit (1 << 1)
822 #define kFPSystemBit (1 << 2)
823 #define kFPDAlreadyOpenBit (1 << 3)
824 #define kFPRAlreadyOpenBit (1 << 4)
825 #define kFPWriteInhibitBit (1 << 5)
826 #define kFPBackUpNeededBit (1 << 6)
827 #define kFPRenameInhibitBit (1 << 7)
828 #define kFPDeleteInhibitBit (1 << 8)
829 #define kFPCopyProtectBit (1 << 10)
830 #define kFPSetClearBit (1 << 15)
833 #define kIsExpFolder (1 << 1)
834 #define kMounted (1 << 3)
835 #define kInExpFolder (1 << 4)
837 /* AFP 3.1 getsession token type */
838 #define kLoginWithoutID 0
839 #define kLoginWithID 1
840 #define kReconnWithID 2
841 #define kLoginWithTimeAndID 3
842 #define kReconnWithTimeAndID 4
844 /* modified AFP 3.1 token type cf. page 327 */
845 #define kRecon1Login 5
846 #define kRecon1ReconnectLogin 6
847 #define kRecon1Refresh 7
848 #define kGetKerberosSessionKey 8
850 static const value_string token_type_vals[] = {
851 {kLoginWithoutID, "LoginWithoutID"},
852 {kLoginWithID, "LoginWithID"},
853 {kReconnWithID, "ReconnWithID"},
854 {kLoginWithTimeAndID, "LoginWithTimeAndID"},
855 {kReconnWithTimeAndID, "ReconnWithTimeAndID"},
856 {kRecon1Login, "Recon1Login"},
857 {kRecon1ReconnectLogin, "Recon1ReconnectLogin"},
858 {kRecon1Refresh, "Recon1Refresh"},
859 {kGetKerberosSessionKey, "GetKerberosSessionKey"},
863 /* AFP 3.2 ACL bitmap */
864 #define kFileSec_UUID (1 << 0)
865 #define kFileSec_GRPUUID (1 << 1)
866 #define kFileSec_ACL (1 << 2)
867 #define kFileSec_REMOVEACL (1 << 3)
868 #define kFileSec_Inherit (1 << 4)
870 static int hf_afp_acl_list_bitmap = -1;
871 static int hf_afp_acl_list_bitmap_UUID = -1;
872 static int hf_afp_acl_list_bitmap_GRPUUID = -1;
873 static int hf_afp_acl_list_bitmap_ACL = -1;
874 static int hf_afp_acl_list_bitmap_REMOVEACL = -1;
875 static int hf_afp_acl_list_bitmap_Inherit = -1;
876 static int ett_afp_acl_list_bitmap = -1;
878 static int hf_afp_access_bitmap = -1;
880 static int hf_afp_acl_entrycount = -1;
881 static int hf_afp_acl_flags = -1;
883 static int hf_afp_ace_applicable = -1;
884 static int hf_afp_ace_flags = -1;
885 static int hf_afp_ace_rights = -1;
887 static int ett_afp_ace_flags = -1;
888 static int hf_afp_ace_flags_allow = -1;
889 static int hf_afp_ace_flags_deny = -1;
890 static int hf_afp_ace_flags_inherited = -1;
891 static int hf_afp_ace_flags_fileinherit = -1;
892 static int hf_afp_ace_flags_dirinherit = -1;
893 static int hf_afp_ace_flags_limitinherit= -1;
894 static int hf_afp_ace_flags_onlyinherit = -1;
896 /* AFP 3.2 ACE flags */
897 #define ACE_ALLOW (1 << 0)
898 #define ACE_DENY (1 << 1)
899 #define ACE_INHERITED (1 << 4)
900 #define ACE_FILE_INHERIT (1 << 5)
901 #define ACE_DIR_INHERIT (1 << 6)
902 #define ACE_LIMIT_INHERIT (1 << 7)
903 #define ACE_ONLY_INHERIT (1 << 8)
905 static int ett_afp_ace_entries = -1;
906 static int ett_afp_ace_entry = -1;
908 /* AFP 3.2 ACL access right cf page 248*/
909 #define KAUTH_VNODE_READ_DATA (1 << 1)
910 #define KAUTH_VNODE_LIST_DIRECTORY KAUTH_VNODE_READ_DATA
911 #define KAUTH_VNODE_WRITE_DATA (1 << 2)
912 #define KAUTH_VNODE_ADD_FILE KAUTH_VNODE_WRITE_DATA
913 #define KAUTH_VNODE_EXECUTE (1 << 3)
914 #define KAUTH_VNODE_SEARCH KAUTH_VNODE_EXECUTE
915 #define KAUTH_VNODE_DELETE (1 << 4)
916 #define KAUTH_VNODE_APPEND_DATA (1 << 5)
917 #define KAUTH_VNODE_ADD_SUBDIRECTORY KAUTH_VNODE_APPEND_DATA
918 #define KAUTH_VNODE_DELETE_CHILD (1 << 6)
919 #define KAUTH_VNODE_READ_ATTRIBUTES (1 << 7)
920 #define KAUTH_VNODE_WRITE_ATTRIBUTES (1 << 8)
921 #define KAUTH_VNODE_READ_EXTATTRIBUTES (1 << 9)
922 #define KAUTH_VNODE_WRITE_EXTATTRIBUTES (1 << 10)
923 #define KAUTH_VNODE_READ_SECURITY (1 << 11)
924 #define KAUTH_VNODE_WRITE_SECURITY (1 << 12)
925 #define KAUTH_VNODE_CHANGE_OWNER (1 << 13)
926 #define KAUTH_VNODE_SYNCHRONIZE (1 << 20)
927 #define KAUTH_VNODE_GENERIC_ALL (1 << 21)
928 #define KAUTH_VNODE_GENERIC_EXECUTE (1 << 22)
929 #define KAUTH_VNODE_GENERIC_WRITE (1 << 23)
930 #define KAUTH_VNODE_GENERIC_READ (1 << 24)
933 static int hf_afp_acl_access_bitmap = -1;
934 static int ett_afp_acl_access_bitmap = -1;
935 static int hf_afp_acl_access_bitmap_read_data = -1;
936 static int hf_afp_acl_access_bitmap_write_data = -1;
937 static int hf_afp_acl_access_bitmap_execute = -1;
938 static int hf_afp_acl_access_bitmap_delete = -1;
939 static int hf_afp_acl_access_bitmap_append_data = -1;
940 static int hf_afp_acl_access_bitmap_delete_child= -1;
941 static int hf_afp_acl_access_bitmap_read_attrs = -1;
942 static int hf_afp_acl_access_bitmap_write_attrs = -1;
943 static int hf_afp_acl_access_bitmap_read_extattrs = -1;
944 static int hf_afp_acl_access_bitmap_write_extattrs = -1;
945 static int hf_afp_acl_access_bitmap_read_security = -1;
946 static int hf_afp_acl_access_bitmap_write_security = -1;
947 static int hf_afp_acl_access_bitmap_change_owner = -1;
948 static int hf_afp_acl_access_bitmap_synchronize = -1;
949 static int hf_afp_acl_access_bitmap_generic_all = -1;
950 static int hf_afp_acl_access_bitmap_generic_execute = -1;
951 static int hf_afp_acl_access_bitmap_generic_write = -1;
952 static int hf_afp_acl_access_bitmap_generic_read = -1;
955 #define hash_init_count 20
958 static gint afp_equal (gconstpointer v, gconstpointer v2);
959 static guint afp_hash (gconstpointer v);
962 guint32 conversation;
966 static GHashTable *afp_request_hash = NULL;
968 static guint Vol; /* volume */
969 static guint Did; /* parent directory ID */
972 static gint afp_equal (gconstpointer v, gconstpointer v2)
974 const afp_request_key *val1 = (const afp_request_key*)v;
975 const afp_request_key *val2 = (const afp_request_key*)v2;
977 if (val1->conversation == val2->conversation &&
978 val1->seq == val2->seq) {
984 static guint afp_hash (gconstpointer v)
986 const afp_request_key *afp_key = (const afp_request_key*)v;
990 /* --------------------------
992 #define PAD(x) { proto_tree_add_item(tree, hf_afp_pad, tvb, offset, x, FALSE); offset += x; }
995 decode_vol_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset)
997 proto_tree *sub_tree = NULL;
1001 bitmap = tvb_get_ntohs(tvb, offset);
1003 item = proto_tree_add_item(tree, hf_afp_vol_bitmap, tvb, offset, 2,FALSE);
1004 sub_tree = proto_item_add_subtree(item, ett_afp_vol_bitmap);
1007 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_Attributes, tvb, offset, 2,FALSE);
1008 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_Signature, tvb, offset, 2,FALSE);
1009 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_CreateDate, tvb, offset, 2,FALSE);
1010 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_ModDate, tvb, offset, 2,FALSE);
1011 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_BackupDate, tvb, offset, 2,FALSE);
1012 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_ID, tvb, offset, 2,FALSE);
1013 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_BytesFree, tvb, offset, 2,FALSE);
1014 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_BytesTotal, tvb, offset, 2,FALSE);
1015 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_Name, tvb, offset, 2,FALSE);
1016 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_ExtBytesFree, tvb, offset, 2,FALSE);
1017 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_ExtBytesTotal, tvb, offset, 2,FALSE);
1018 proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_BlockSize , tvb, offset, 2,FALSE);
1023 /* -------------------------- */
1025 decode_vol_attribute (proto_tree *tree, tvbuff_t *tvb, gint offset)
1027 proto_tree *sub_tree = NULL;
1031 bitmap = tvb_get_ntohs(tvb, offset);
1033 item = proto_tree_add_item(tree, hf_afp_vol_attribute, tvb, offset, 2,FALSE);
1034 sub_tree = proto_item_add_subtree(item, ett_afp_vol_attribute);
1036 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_ReadOnly ,tvb, offset, 2,FALSE);
1037 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_HasVolumePassword ,tvb, offset, 2,FALSE);
1038 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsFileIDs ,tvb, offset, 2,FALSE);
1039 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsCatSearch ,tvb, offset, 2,FALSE);
1040 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsBlankAccessPrivs,tvb, offset, 2,FALSE);
1041 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsUnixPrivs ,tvb, offset, 2,FALSE);
1042 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsUTF8Names ,tvb, offset, 2,FALSE);
1043 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_NoNetworkUserID ,tvb, offset, 2,FALSE);
1044 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_DefaultPrivsFromParent ,tvb, offset, 2,FALSE);
1045 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_NoExchangeFiles ,tvb, offset, 2,FALSE);
1046 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsExtAttrs ,tvb, offset, 2,FALSE);
1047 proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsACLs ,tvb, offset, 2,FALSE);
1052 /* --------------------------
1053 cf AFP3.0.pdf page 38
1054 date are number of seconds from 12:00am on 01.01.2000 GMT
1055 backup : 0x8000000 not set
1056 from netatalk adouble.h
1058 #define DATE_NOT_SET 0x80000000
1059 #define AD_DATE_DELTA 946684800
1060 #define AD_DATE_TO_UNIX(x) (x + AD_DATE_DELTA)
1062 print_date(proto_tree *tree,int id, tvbuff_t *tvb, gint offset)
1064 time_t date = tvb_get_ntohl(tvb, offset);
1067 tv.secs = AD_DATE_TO_UNIX(date);
1069 proto_tree_add_time(tree, id, tvb, offset, 4, &tv);
1074 /* -------------------------- */
1076 parse_vol_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 bitmap)
1078 guint16 nameoff = 0;
1080 if ((bitmap & kFPVolAttributeBit)) {
1081 decode_vol_attribute(tree,tvb,offset);
1084 if ((bitmap & kFPVolSignatureBit)) {
1085 proto_tree_add_item(tree, hf_afp_vol_signature,tvb, offset, 2, FALSE);
1088 if ((bitmap & kFPVolCreateDateBit)) {
1089 print_date(tree, hf_afp_vol_creation_date,tvb, offset);
1092 if ((bitmap & kFPVolModDateBit)) {
1093 print_date(tree, hf_afp_vol_modification_date,tvb, offset);
1096 if ((bitmap & kFPVolBackupDateBit)) {
1097 print_date(tree, hf_afp_vol_backup_date,tvb, offset);
1100 if ((bitmap & kFPVolIDBit)) {
1101 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
1104 if ((bitmap & kFPVolBytesFreeBit)) {
1105 proto_tree_add_item(tree, hf_afp_vol_bytes_free,tvb, offset, 4, FALSE);
1108 if ((bitmap & kFPVolBytesTotalBit)) {
1109 proto_tree_add_item(tree, hf_afp_vol_bytes_total,tvb, offset, 4, FALSE);
1112 if ((bitmap & kFPVolNameBit)) {
1113 nameoff = tvb_get_ntohs(tvb, offset);
1114 proto_tree_add_item(tree, hf_afp_vol_name_offset,tvb, offset, 2, FALSE);
1117 if ((bitmap & kFPVolExtBytesFreeBit)) {
1118 proto_tree_add_item(tree, hf_afp_vol_ex_bytes_free,tvb, offset, 8, FALSE);
1121 if ((bitmap & kFPVolExtBytesTotalBit)) {
1122 proto_tree_add_item(tree, hf_afp_vol_ex_bytes_total,tvb, offset, 8, FALSE);
1125 if ((bitmap & kFPVolBlockSizeBit)) {
1126 proto_tree_add_item(tree, hf_afp_vol_block_size,tvb, offset, 4, FALSE);
1132 len = tvb_get_guint8(tvb, offset);
1133 proto_tree_add_item(tree, hf_afp_vol_name, tvb, offset, 1,FALSE);
1140 /* -------------------------- */
1142 decode_file_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset)
1144 proto_tree *sub_tree = NULL;
1148 bitmap = tvb_get_ntohs(tvb, offset);
1150 item = proto_tree_add_item(tree, hf_afp_file_bitmap, tvb, offset, 2,FALSE);
1151 sub_tree = proto_item_add_subtree(item, ett_afp_file_bitmap);
1153 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_Attributes , tvb, offset, 2,FALSE);
1154 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_ParentDirID , tvb, offset, 2,FALSE);
1155 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_CreateDate , tvb, offset, 2,FALSE);
1156 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_ModDate , tvb, offset, 2,FALSE);
1157 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_BackupDate , tvb, offset, 2,FALSE);
1158 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_FinderInfo , tvb, offset, 2,FALSE);
1159 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_LongName , tvb, offset, 2,FALSE);
1160 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_ShortName , tvb, offset, 2,FALSE);
1161 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_NodeID , tvb, offset, 2,FALSE);
1163 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_DataForkLen , tvb, offset, 2,FALSE);
1164 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_RsrcForkLen , tvb, offset, 2,FALSE);
1165 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_ExtDataForkLen , tvb, offset, 2,FALSE);
1166 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_LaunchLimit , tvb, offset, 2,FALSE);
1167 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_UTF8Name , tvb, offset, 2,FALSE);
1169 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_ExtRsrcForkLen , tvb, offset, 2,FALSE);
1170 proto_tree_add_item(sub_tree, hf_afp_file_bitmap_UnixPrivs , tvb, offset, 2,FALSE);
1175 /* -------------------------- */
1177 decode_file_attribute(proto_tree *tree, tvbuff_t *tvb, gint offset, int shared)
1179 proto_tree *sub_tree = NULL;
1183 attribute = tvb_get_ntohs(tvb, offset);
1185 item = proto_tree_add_text(tree, tvb, offset, 2,
1186 "File Attributes: 0x%04x", attribute);
1187 sub_tree = proto_item_add_subtree(item, ett_afp_file_attribute);
1189 proto_tree_add_item(sub_tree, hf_afp_file_attribute_Invisible , tvb, offset, 2,FALSE);
1191 proto_tree_add_item(sub_tree, hf_afp_file_attribute_MultiUser , tvb, offset, 2,FALSE);
1193 proto_tree_add_item(sub_tree, hf_afp_file_attribute_System , tvb, offset, 2,FALSE);
1196 proto_tree_add_item(sub_tree, hf_afp_file_attribute_DAlreadyOpen , tvb, offset, 2,FALSE);
1197 proto_tree_add_item(sub_tree, hf_afp_file_attribute_RAlreadyOpen , tvb, offset, 2,FALSE);
1199 /* writeinhibit is file only but Macs are setting it with FPSetFileDirParms too */
1200 proto_tree_add_item(sub_tree, hf_afp_file_attribute_WriteInhibit , tvb, offset, 2,FALSE);
1201 proto_tree_add_item(sub_tree, hf_afp_file_attribute_BackUpNeeded , tvb, offset, 2,FALSE);
1202 proto_tree_add_item(sub_tree, hf_afp_file_attribute_RenameInhibit, tvb, offset, 2,FALSE);
1203 proto_tree_add_item(sub_tree, hf_afp_file_attribute_DeleteInhibit, tvb, offset, 2,FALSE);
1206 proto_tree_add_item(sub_tree, hf_afp_file_attribute_CopyProtect , tvb, offset, 2,FALSE);
1208 proto_tree_add_item(sub_tree, hf_afp_file_attribute_SetClear , tvb, offset, 2,FALSE);
1214 decode_access_rights (proto_tree *tree, tvbuff_t *tvb, int hf, gint offset)
1216 proto_tree *sub_tree;
1220 item = proto_tree_add_item(tree, hf, tvb, offset, 4, FALSE);
1221 sub_tree = proto_item_add_subtree(item, ett_afp_dir_ar);
1223 proto_tree_add_item(sub_tree, hf_afp_dir_ar_o_search, tvb, offset, 4, FALSE);
1224 proto_tree_add_item(sub_tree, hf_afp_dir_ar_o_read , tvb, offset, 4, FALSE);
1225 proto_tree_add_item(sub_tree, hf_afp_dir_ar_o_write , tvb, offset, 4, FALSE);
1227 proto_tree_add_item(sub_tree, hf_afp_dir_ar_g_search, tvb, offset, 4, FALSE);
1228 proto_tree_add_item(sub_tree, hf_afp_dir_ar_g_read , tvb, offset, 4, FALSE);
1229 proto_tree_add_item(sub_tree, hf_afp_dir_ar_g_write , tvb, offset, 4, FALSE);
1231 proto_tree_add_item(sub_tree, hf_afp_dir_ar_e_search, tvb, offset, 4, FALSE);
1232 proto_tree_add_item(sub_tree, hf_afp_dir_ar_e_read , tvb, offset, 4, FALSE);
1233 proto_tree_add_item(sub_tree, hf_afp_dir_ar_e_write , tvb, offset, 4, FALSE);
1235 proto_tree_add_item(sub_tree, hf_afp_dir_ar_u_search, tvb, offset, 4, FALSE);
1236 proto_tree_add_item(sub_tree, hf_afp_dir_ar_u_read , tvb, offset, 4, FALSE);
1237 proto_tree_add_item(sub_tree, hf_afp_dir_ar_u_write , tvb, offset, 4, FALSE);
1239 proto_tree_add_item(sub_tree, hf_afp_dir_ar_blank , tvb, offset, 4, FALSE);
1240 proto_tree_add_item(sub_tree, hf_afp_dir_ar_u_own , tvb, offset, 4, FALSE);
1245 decode_unix_privs (proto_tree *tree, tvbuff_t *tvb, gint offset)
1247 proto_tree *sub_tree;
1251 item = proto_tree_add_text(tree, tvb, offset, 16,
1253 sub_tree = proto_item_add_subtree(item, ett_afp_unix_privs);
1255 proto_tree_add_item(sub_tree, hf_afp_unix_privs_uid, tvb, offset, 4, FALSE);
1256 proto_tree_add_item(sub_tree, hf_afp_unix_privs_gid, tvb, offset+4, 4, FALSE);
1257 proto_tree_add_item(sub_tree, hf_afp_unix_privs_permissions, tvb, offset+8, 4, FALSE);
1258 decode_access_rights(sub_tree, tvb, hf_afp_unix_privs_ua_permissions, offset+12);
1262 /* -------------------------- */
1264 parse_long_filename(proto_tree *tree, tvbuff_t *tvb, gint offset, gint org_offset)
1270 lnameoff = tvb_get_ntohs(tvb, offset);
1271 proto_tree_add_item(tree, hf_afp_long_name_offset,tvb, offset, 2, FALSE);
1273 tp_ofs = lnameoff +org_offset;
1274 len = tvb_get_guint8(tvb, tp_ofs);
1275 proto_tree_add_item(tree, hf_afp_path_len, tvb, tp_ofs, 1,FALSE);
1277 proto_tree_add_item(tree, hf_afp_path_name, tvb, tp_ofs, len,FALSE);
1283 /* -------------------------- */
1285 parse_UTF8_filename(proto_tree *tree, tvbuff_t *tvb, gint offset, gint org_offset)
1291 unameoff = tvb_get_ntohs(tvb, offset);
1292 proto_tree_add_item(tree, hf_afp_unicode_name_offset,tvb, offset, 2, FALSE);
1295 /* FIXME AFP3.x reuses PDINFO bit for UTF8.
1296 * In enumerate_ext it's pad with 4 bytes, PDINFO was 6 bytes,
1297 * but not in catsearch_ext.
1298 * Last but not least there's a bug in OSX catsearch_ext for spec2
1299 * offset is off by 2 bytes.
1302 tp_ofs = unameoff +org_offset;
1303 if (tp_ofs > offset) {
1306 else if (tp_ofs < offset) {
1309 proto_tree_add_item( tree, hf_afp_path_unicode_hint, tvb, tp_ofs, 4,FALSE);
1312 len = tvb_get_ntohs(tvb, tp_ofs);
1313 proto_tree_add_item( tree, hf_afp_path_unicode_len, tvb, tp_ofs, 2,FALSE);
1316 proto_tree_add_item(tree, hf_afp_path_name, tvb, tp_ofs, len,FALSE);
1322 /* -------------------------- */
1324 parse_file_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 bitmap, int shared)
1326 /* guint16 snameoff = 0; */
1327 gint max_offset = 0;
1329 gint org_offset = offset;
1331 if ((bitmap & kFPAttributeBit)) {
1332 decode_file_attribute(tree, tvb, offset, shared);
1335 if ((bitmap & kFPParentDirIDBit)) {
1336 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
1339 if ((bitmap & kFPCreateDateBit)) {
1340 print_date(tree, hf_afp_creation_date,tvb, offset);
1343 if ((bitmap & kFPModDateBit)) {
1344 print_date(tree, hf_afp_modification_date,tvb, offset);
1347 if ((bitmap & kFPBackupDateBit)) {
1348 print_date(tree, hf_afp_backup_date,tvb, offset);
1351 if ((bitmap & kFPFinderInfoBit)) {
1352 proto_tree_add_item(tree, hf_afp_finder_info,tvb, offset, 32, FALSE);
1355 if ((bitmap & kFPLongNameBit)) {
1358 tp_ofs = parse_long_filename(tree, tvb, offset, org_offset);
1359 max_offset = (tp_ofs >max_offset)?tp_ofs:max_offset;
1364 if ((bitmap & kFPShortNameBit)) {
1365 /* snameoff = tvb_get_ntohs(tvb, offset); */
1366 proto_tree_add_item(tree, hf_afp_short_name_offset,tvb, offset, 2, FALSE);
1369 if ((bitmap & kFPNodeIDBit)) {
1370 proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4,FALSE);
1374 if ((bitmap & kFPDataForkLenBit)) {
1375 proto_tree_add_item(tree, hf_afp_file_DataForkLen, tvb, offset, 4,FALSE);
1379 if ((bitmap & kFPRsrcForkLenBit)) {
1380 proto_tree_add_item(tree, hf_afp_file_RsrcForkLen, tvb, offset, 4,FALSE);
1384 if ((bitmap & kFPExtDataForkLenBit)) {
1385 proto_tree_add_item(tree, hf_afp_file_ExtDataForkLen, tvb, offset, 8,FALSE);
1389 if ((bitmap & kFPLaunchLimitBit)) {
1390 offset += 2; /* ? */
1393 if ((bitmap & kFPUTF8NameBit)) {
1396 tp_ofs = parse_UTF8_filename(tree, tvb, offset, org_offset);
1397 max_offset = (tp_ofs >max_offset)?tp_ofs:max_offset;
1401 if ((bitmap & kFPExtRsrcForkLenBit)) {
1402 proto_tree_add_item(tree, hf_afp_file_ExtRsrcForkLen, tvb, offset, 8,FALSE);
1406 if ((bitmap & kFPUnixPrivsBit)) {
1408 * XXX - the AFP 3.0 spec says this is "Four bytes", but
1409 * also says the privileges are "stored in an FPUnixPrivs
1410 * structure", which is 16 bytes long.
1412 * We assume, for now, that the latter is true.
1414 decode_unix_privs(tree, tvb, offset);
1418 return (max_offset)?max_offset:offset;
1421 /* -------------------------- */
1423 decode_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset)
1425 proto_tree *sub_tree = NULL;
1429 bitmap = tvb_get_ntohs(tvb, offset);
1431 item = proto_tree_add_item(tree, hf_afp_dir_bitmap, tvb, offset, 2,FALSE);
1432 sub_tree = proto_item_add_subtree(item, ett_afp_dir_bitmap);
1435 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_Attributes , tvb, offset, 2,FALSE);
1436 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_ParentDirID , tvb, offset, 2,FALSE);
1437 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_CreateDate , tvb, offset, 2,FALSE);
1438 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_ModDate , tvb, offset, 2,FALSE);
1439 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_BackupDate , tvb, offset, 2,FALSE);
1440 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_FinderInfo , tvb, offset, 2,FALSE);
1441 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_LongName , tvb, offset, 2,FALSE);
1442 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_ShortName , tvb, offset, 2,FALSE);
1443 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_NodeID , tvb, offset, 2,FALSE);
1444 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_OffspringCount , tvb, offset, 2,FALSE);
1445 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_OwnerID , tvb, offset, 2,FALSE);
1446 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_GroupID , tvb, offset, 2,FALSE);
1447 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_AccessRights , tvb, offset, 2,FALSE);
1448 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_UTF8Name , tvb, offset, 2,FALSE);
1449 proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_UnixPrivs , tvb, offset, 2,FALSE);
1454 /* -------------------------- */
1456 decode_dir_attribute(proto_tree *tree, tvbuff_t *tvb, gint offset)
1458 proto_tree *sub_tree = NULL;
1462 attribute = tvb_get_ntohs(tvb, offset);
1464 item = proto_tree_add_text(tree, tvb, offset, 2,
1465 "Directory Attributes: 0x%04x", attribute);
1466 sub_tree = proto_item_add_subtree(item, ett_afp_dir_attribute);
1468 proto_tree_add_item(sub_tree, hf_afp_dir_attribute_Invisible , tvb, offset, 2,FALSE);
1469 proto_tree_add_item(sub_tree, hf_afp_dir_attribute_IsExpFolder , tvb, offset, 2,FALSE);
1470 proto_tree_add_item(sub_tree, hf_afp_dir_attribute_System , tvb, offset, 2,FALSE);
1471 proto_tree_add_item(sub_tree, hf_afp_dir_attribute_Mounted , tvb, offset, 2,FALSE);
1472 proto_tree_add_item(sub_tree, hf_afp_dir_attribute_InExpFolder , tvb, offset, 2,FALSE);
1473 proto_tree_add_item(sub_tree, hf_afp_dir_attribute_BackUpNeeded , tvb, offset, 2,FALSE);
1474 proto_tree_add_item(sub_tree, hf_afp_dir_attribute_RenameInhibit, tvb, offset, 2,FALSE);
1475 proto_tree_add_item(sub_tree, hf_afp_dir_attribute_DeleteInhibit, tvb, offset, 2,FALSE);
1480 /* -------------------------- */
1482 parse_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 bitmap)
1484 /* guint16 snameoff = 0; */
1485 gint max_offset = 0;
1487 gint org_offset = offset;
1489 if ((bitmap & kFPAttributeBit)) {
1490 decode_dir_attribute(tree, tvb, offset);
1493 if ((bitmap & kFPParentDirIDBit)) {
1494 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
1497 if ((bitmap & kFPCreateDateBit)) {
1498 print_date(tree, hf_afp_creation_date,tvb, offset);
1501 if ((bitmap & kFPModDateBit)) {
1502 print_date(tree, hf_afp_modification_date,tvb, offset);
1505 if ((bitmap & kFPBackupDateBit)) {
1506 print_date(tree, hf_afp_backup_date,tvb, offset);
1509 if ((bitmap & kFPFinderInfoBit)) {
1510 proto_tree_add_item(tree, hf_afp_finder_info,tvb, offset, 32, FALSE);
1513 if ((bitmap & kFPLongNameBit)) {
1516 tp_ofs = parse_long_filename(tree, tvb, offset, org_offset);
1517 max_offset = (tp_ofs >max_offset)?tp_ofs:max_offset;
1521 if ((bitmap & kFPShortNameBit)) {
1522 /* snameoff = tvb_get_ntohs(tvb, offset); */
1523 proto_tree_add_item(tree, hf_afp_short_name_offset,tvb, offset, 2, FALSE);
1526 if ((bitmap & kFPNodeIDBit)) {
1527 proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4,FALSE);
1530 if ((bitmap & kFPOffspringCountBit)) {
1531 proto_tree_add_item(tree, hf_afp_dir_offspring, tvb, offset, 2,FALSE);
1532 offset += 2; /* error in AFP3.0.pdf */
1534 if ((bitmap & kFPOwnerIDBit)) {
1535 proto_tree_add_item(tree, hf_afp_dir_OwnerID, tvb, offset, 4, FALSE);
1538 if ((bitmap & kFPGroupIDBit)) {
1539 proto_tree_add_item(tree, hf_afp_dir_GroupID, tvb, offset, 4, FALSE);
1542 if ((bitmap & kFPAccessRightsBit)) {
1543 decode_access_rights(tree, tvb, hf_afp_dir_ar, offset);
1546 if ((bitmap & kFPUTF8NameBit)) {
1549 tp_ofs = parse_UTF8_filename(tree, tvb, offset, org_offset);
1550 max_offset = (tp_ofs >max_offset)?tp_ofs:max_offset;
1553 if ((bitmap & kFPUnixPrivsBit)) {
1555 * XXX - the AFP 3.0 spec says this is "Four bytes", but
1556 * also says the privileges are "stored in an FPUnixPrivs
1557 * structure", which is 16 bytes long.
1559 * We assume, for now, that the latter is true.
1561 decode_unix_privs(tree, tvb, offset);
1564 return (max_offset)?max_offset:offset;
1567 /* -------------------------- */
1569 name_in_bitmap(tvbuff_t *tvb, gint offset, guint16 bitmap, int isdir)
1572 gint org_offset = offset;
1578 if ((bitmap & kFPAttributeBit)) /* 0 */
1580 if ((bitmap & kFPParentDirIDBit)) /* 1 */
1582 if ((bitmap & kFPCreateDateBit)) /* 2 */
1584 if ((bitmap & kFPModDateBit)) /* 3 */
1586 if ((bitmap & kFPBackupDateBit)) /* 4 */
1588 if ((bitmap & kFPFinderInfoBit)) /* 5 */
1591 if ((bitmap & kFPLongNameBit)) { /* 6 */
1592 nameoff = tvb_get_ntohs(tvb, offset);
1594 tp_ofs = nameoff +org_offset;
1595 len = tvb_get_guint8(tvb, tp_ofs);
1597 name = tvb_get_ephemeral_string(tvb, tp_ofs, len);
1603 if ((bitmap & kFPShortNameBit)) /* 7 */
1605 if ((bitmap & kFPNodeIDBit)) /* 8 */
1609 if ((bitmap & kFPOffspringCountBit)) /* 9 */
1611 if ((bitmap & kFPOwnerIDBit)) /* 10*/
1613 if ((bitmap & kFPGroupIDBit)) /* 11*/
1615 if ((bitmap & kFPAccessRightsBit)) /* 12*/
1619 if ((bitmap & kFPDataForkLenBit)) /* 9 */
1621 if ((bitmap & kFPRsrcForkLenBit)) /* 10*/
1623 if ((bitmap & kFPExtDataForkLenBit)) /* 11*/
1625 if ((bitmap & kFPLaunchLimitBit)) /* 12*/
1626 offset += 2; /* FIXME ? */
1629 if ((bitmap & kFPUTF8NameBit)) { /* 13 */
1630 nameoff = tvb_get_ntohs(tvb, offset);
1632 tp_ofs = nameoff +org_offset +4;
1633 len16 = tvb_get_ntohs(tvb, tp_ofs);
1635 name = tvb_get_ephemeral_string(tvb, tp_ofs, len16);
1642 /* -------------------------- */
1644 name_in_dbitmap(tvbuff_t *tvb, gint offset, guint16 bitmap)
1648 name = name_in_bitmap(tvb, offset, bitmap, 1);
1658 /* -------------------------- */
1660 name_in_fbitmap(tvbuff_t *tvb, gint offset, guint16 bitmap)
1664 name = name_in_bitmap(tvb, offset, bitmap, 0);
1674 /* -------------------------- */
1676 decode_vol_did(proto_tree *tree, tvbuff_t *tvb, gint offset)
1678 Vol = tvb_get_ntohs(tvb, offset);
1679 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
1682 Did = tvb_get_ntohl(tvb, offset);
1683 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
1688 /* -------------------------- */
1690 decode_vol_did_file_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset)
1692 offset = decode_vol_did(tree, tvb, offset);
1694 decode_file_bitmap(tree, tvb, offset);
1697 decode_dir_bitmap(tree, tvb, offset);
1703 /* ------------------------ */
1704 static const gchar *
1705 get_name(tvbuff_t *tvb, int offset, int type)
1708 const gchar *string;
1713 len = tvb_get_guint8(tvb, offset);
1715 string = tvb_format_text(tvb,offset, len);
1718 len = tvb_get_ntohs(tvb, offset +4);
1720 string = tvb_format_text(tvb,offset, len);
1723 string = "Unknown type";
1728 /* -------------------------- */
1730 decode_name_label (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const gchar *label)
1736 proto_tree *sub_tree = NULL;
1739 type = tvb_get_guint8(tvb, offset);
1742 len = tvb_get_ntohs(tvb, offset +5);
1746 len = tvb_get_guint8(tvb, offset +1);
1748 name = get_name(tvb, offset +1, type);
1750 if (pinfo && check_col(pinfo->cinfo, COL_INFO)) {
1751 col_append_fstr(pinfo->cinfo, COL_INFO, ": Vol=%u Did=%u", Vol, Did);
1753 col_append_fstr(pinfo->cinfo, COL_INFO, " Name=%s", name);
1758 item = proto_tree_add_text(tree, tvb, offset, len +header, label, name);
1759 sub_tree = proto_item_add_subtree(item, ett_afp_path_name);
1761 proto_tree_add_item( sub_tree, hf_afp_path_type, tvb, offset, 1,FALSE);
1764 proto_tree_add_item( sub_tree, hf_afp_path_unicode_hint, tvb, offset, 4,FALSE);
1766 proto_tree_add_item( sub_tree, hf_afp_path_unicode_len, tvb, offset, 2,FALSE);
1770 proto_tree_add_item( sub_tree, hf_afp_path_len, tvb, offset, 1,FALSE);
1774 proto_tree_add_string(sub_tree, hf_afp_path_name, tvb, offset, len,name);
1782 /* -------------------------- */
1784 decode_name (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset)
1786 return decode_name_label(tree, pinfo, tvb, offset, "Path: %s");
1789 /* -------------------------- */
1791 add_info_fork(tvbuff_t *tvb, packet_info *pinfo, gint offset)
1795 ofork = tvb_get_ntohs(tvb, offset);
1796 if (ofork && check_col(pinfo->cinfo, COL_INFO)) {
1797 col_append_fstr(pinfo->cinfo, COL_INFO, ": Fork=%u", ofork);
1801 /* -------------------------- */
1803 add_info_vol(tvbuff_t *tvb, packet_info *pinfo, gint offset)
1807 vol = tvb_get_ntohs(tvb, offset);
1808 if (check_col(pinfo->cinfo, COL_INFO)) {
1809 col_append_fstr(pinfo->cinfo, COL_INFO, ": Vol=%u", vol);
1813 /* ************************** */
1815 dissect_query_afp_open_vol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
1821 decode_vol_bitmap(tree, tvb, offset);
1824 len = tvb_get_guint8(tvb, offset);
1826 if (check_col(pinfo->cinfo, COL_INFO)) {
1828 rep = get_name(tvb, offset, 2);
1829 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", rep);
1835 proto_tree_add_item(tree, hf_afp_vol_name, tvb, offset, 1,FALSE);
1838 len = tvb_reported_length_remaining(tvb,offset);
1840 /* optionnal password */
1841 proto_tree_add_item(tree, hf_afp_passwd, tvb, offset, 8,FALSE);
1847 /* -------------------------- */
1849 dissect_reply_afp_open_vol(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
1855 bitmap = decode_vol_bitmap(tree, tvb, offset);
1857 offset = parse_vol_bitmap(tree, tvb, offset, bitmap);
1862 /* ************************** */
1864 dissect_reply_afp_get_server_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
1870 proto_tree *sub_tree = NULL;
1871 proto_tree *flag_tree;
1878 print_date(tree, hf_afp_server_time,tvb, offset);
1881 num = tvb_get_guint8(tvb, offset);
1882 item = proto_tree_add_text(tree, tvb, offset, 1, "Volumes : %d", num);
1883 sub_tree = proto_item_add_subtree(item, ett_afp_server_vol);
1886 for (i = 0; i < num; i++) {
1889 item = proto_tree_add_text(sub_tree, tvb, offset, -1,"Volume");
1890 tree = proto_item_add_subtree(item, ett_afp_vol_list);
1892 flag = tvb_get_guint8(tvb, offset);
1894 ti = proto_tree_add_text(tree, tvb, offset , 1,"Flags : 0x%02x", flag);
1895 flag_tree = proto_item_add_subtree(ti, ett_afp_vol_flag);
1896 proto_tree_add_item(flag_tree, hf_afp_vol_flag_passwd, tvb, offset, 1,FALSE);
1897 proto_tree_add_item(flag_tree, hf_afp_vol_flag_unix_priv ,tvb, offset, 1,FALSE);
1900 len = tvb_get_guint8(tvb, offset) +1;
1901 rep = get_name(tvb, offset, 2);
1902 proto_item_set_text(item, "%s", rep);
1903 proto_item_set_len(item, len +1);
1905 proto_tree_add_item(tree, hf_afp_vol_name, tvb, offset, 1,FALSE);
1912 /* **************************
1913 next calls use the same format :
1921 dissect_query_afp_with_vol_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
1928 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
1933 /* ************************** */
1935 dissect_query_afp_open_fork(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
1937 proto_tree *sub_tree = NULL;
1940 proto_tree_add_item(tree, hf_afp_fork_type, tvb, offset, 1,FALSE);
1943 offset = decode_vol_did(tree, tvb, offset);
1945 decode_file_bitmap(tree, tvb, offset);
1948 item = proto_tree_add_item(tree, hf_afp_access_mode, tvb, offset, 2,FALSE);
1949 sub_tree = proto_item_add_subtree(item, ett_afp_access_mode);
1951 proto_tree_add_item(sub_tree, hf_afp_access_read , tvb, offset, 2,FALSE);
1952 proto_tree_add_item(sub_tree, hf_afp_access_write , tvb, offset, 2,FALSE);
1953 proto_tree_add_item(sub_tree, hf_afp_access_deny_read , tvb, offset, 2,FALSE);
1954 proto_tree_add_item(sub_tree, hf_afp_access_deny_write, tvb, offset, 2,FALSE);
1958 offset = decode_name(tree, pinfo, tvb, offset);
1963 /* -------------------------- */
1965 dissect_reply_afp_open_fork(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
1969 f_bitmap = decode_file_bitmap(tree, tvb, offset);
1972 add_info_fork(tvb, pinfo, offset);
1973 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
1976 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
1981 /* ************************** */
1983 dissect_query_afp_enumerate_ext2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
1987 offset = decode_vol_did_file_dir_bitmap(tree, tvb, offset);
1989 proto_tree_add_item(tree, hf_afp_req_count, tvb, offset, 2,FALSE);
1992 proto_tree_add_item(tree, hf_afp_start_index32, tvb, offset, 4,FALSE);
1995 proto_tree_add_item(tree, hf_afp_max_reply_size32, tvb, offset, 4,FALSE);
1998 offset = decode_name(tree, pinfo, tvb, offset);
2003 /* ************************** */
2005 dissect_query_afp_enumerate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2009 offset = decode_vol_did_file_dir_bitmap(tree, tvb, offset);
2011 proto_tree_add_item(tree, hf_afp_req_count, tvb, offset, 2,FALSE);
2014 proto_tree_add_item(tree, hf_afp_start_index, tvb, offset, 2,FALSE);
2017 proto_tree_add_item(tree, hf_afp_max_reply_size, tvb, offset, 2,FALSE);
2020 offset = decode_name(tree, pinfo, tvb, offset);
2025 /* -------------------------- */
2027 loop_record(tvbuff_t *tvb, proto_tree *ptree, gint offset,
2028 int count, guint16 d_bitmap, guint16 f_bitmap, int add, int ext)
2030 proto_tree *tree = NULL;
2039 for (i = 0; i < count; i++) {
2042 size = tvb_get_ntohs(tvb, offset) +add *2;
2046 size = tvb_get_guint8(tvb, offset) +add;
2050 return offset; /* packet is malformed */
2051 flags = tvb_get_guint8(tvb, offset +decal);
2057 name = name_in_dbitmap(tvb, offset +decal, d_bitmap);
2060 name = name_in_fbitmap(tvb, offset +decal, f_bitmap);
2063 item = proto_tree_add_text(ptree, tvb, offset, size, "%s", name);
2066 item = proto_tree_add_text(ptree, tvb, offset, size, "line %d", i+1);
2068 tree = proto_item_add_subtree(item, ett_afp_enumerate_line);
2071 proto_tree_add_item(tree, hf_afp_struct_size16, tvb, offset, 2,FALSE);
2075 proto_tree_add_item(tree, hf_afp_struct_size, tvb, offset, 1,FALSE);
2079 proto_tree_add_item(tree, hf_afp_file_flag, tvb, offset, 1,FALSE);
2085 offset = parse_dir_bitmap(tree, tvb, offset, d_bitmap);
2088 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
2092 offset = org +size; /* play safe */
2096 /* ------------------------- */
2098 reply_enumerate(tvbuff_t *tvb, proto_tree *tree, gint offset, int ext)
2100 proto_tree *sub_tree = NULL;
2106 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2109 d_bitmap = decode_dir_bitmap(tree, tvb, offset);
2112 count = tvb_get_ntohs(tvb, offset);
2114 item = proto_tree_add_item(tree, hf_afp_req_count, tvb, offset, 2,FALSE);
2115 sub_tree = proto_item_add_subtree(item, ett_afp_enumerate);
2119 return loop_record(tvb,sub_tree, offset, count, d_bitmap, f_bitmap,0, ext);
2122 /* ------------------------- */
2124 dissect_reply_afp_enumerate(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2126 return reply_enumerate(tvb, tree, offset, 0);
2129 /* **************************/
2131 dissect_reply_afp_enumerate_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2133 return reply_enumerate(tvb, tree, offset, 1);
2136 /* **************************/
2138 catsearch_spec(tvbuff_t *tvb, proto_tree *ptree, gint offset, int ext, guint32 bitmap, const gchar *label)
2140 proto_tree *tree = NULL;
2148 size = tvb_get_ntohs(tvb, offset) +2;
2151 size = tvb_get_guint8(tvb, offset) +2;
2154 item = proto_tree_add_text(ptree, tvb, offset, size, label);
2155 tree = proto_item_add_subtree(item, ett_afp_cat_spec);
2158 proto_tree_add_item(tree, hf_afp_struct_size16, tvb, offset, 2,FALSE);
2162 proto_tree_add_item(tree, hf_afp_struct_size, tvb, offset, 1,FALSE);
2167 offset = parse_file_bitmap(tree, tvb, offset, (guint16) bitmap,0);
2173 /* ------------------------- */
2175 query_catsearch(tvbuff_t *tvb, proto_tree *ptree, gint offset, int ext)
2177 proto_tree *tree = NULL, *sub_tree;
2187 proto_tree_add_item(ptree, hf_afp_vol_id, tvb, offset, 2,FALSE);
2190 proto_tree_add_item(ptree, hf_afp_cat_req_matches, tvb, offset, 4,FALSE);
2193 proto_tree_add_item(ptree, hf_afp_reserved, tvb, offset, 4,FALSE);
2196 proto_tree_add_item(ptree, hf_afp_cat_position, tvb, offset, 16,FALSE);
2199 f_bitmap = decode_file_bitmap(ptree, tvb, offset);
2202 d_bitmap = decode_dir_bitmap(ptree, tvb, offset);
2205 r_bitmap = tvb_get_ntohl(tvb, offset);
2206 /* Already checked this above: if (ptree) */ {
2207 item = proto_tree_add_item(ptree, hf_afp_file_bitmap, tvb, offset, 4,FALSE);
2208 sub_tree = proto_item_add_subtree(item, ett_afp_cat_r_bitmap);
2210 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_Attributes , tvb, offset, 4,FALSE);
2211 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_ParentDirID , tvb, offset, 4,FALSE);
2212 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_CreateDate , tvb, offset, 4,FALSE);
2213 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_ModDate , tvb, offset, 4,FALSE);
2214 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_BackupDate , tvb, offset, 4,FALSE);
2215 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_FinderInfo , tvb, offset, 4,FALSE);
2216 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_LongName , tvb, offset, 4,FALSE);
2218 if (d_bitmap == 0) {
2219 /* Only for file-only searches */
2220 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_DataForkLen , tvb, offset, 4,FALSE);
2221 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_RsrcForkLen , tvb, offset, 4,FALSE);
2222 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_ExtDataForkLen , tvb, offset, 4,FALSE);
2224 if (f_bitmap == 0) {
2225 /* Only for directory-only searches */
2226 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_OffspringCount , tvb, offset, 4,FALSE);
2229 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_UTF8Name , tvb, offset, 4,FALSE);
2231 if (d_bitmap == 0) {
2232 /* Only for file-only searches */
2233 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_ExtRsrcForkLen , tvb, offset, 4,FALSE);
2235 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_PartialNames , tvb, offset, 4,FALSE);
2240 offset = catsearch_spec(tvb, ptree, offset, ext, r_bitmap, "Spec 1");
2243 offset = catsearch_spec(tvb, ptree, offset, ext, r_bitmap, "Spec 2");
2248 /* ------------------------- */
2250 dissect_query_afp_cat_search(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *ptree, gint offset)
2252 return query_catsearch(tvb, ptree, offset, 0);
2255 /* **************************/
2257 dissect_query_afp_cat_search_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *ptree, gint offset)
2259 return query_catsearch(tvb, ptree, offset, 1);
2263 /* **************************/
2265 reply_catsearch(tvbuff_t *tvb, proto_tree *tree, gint offset, int ext)
2267 proto_tree *sub_tree = NULL;
2273 proto_tree_add_item(tree, hf_afp_cat_position, tvb, offset, 16,FALSE);
2276 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2279 d_bitmap = decode_dir_bitmap(tree, tvb, offset);
2282 count = tvb_get_ntohl(tvb, offset);
2284 item = proto_tree_add_item(tree, hf_afp_cat_count, tvb, offset, 4,FALSE);
2285 sub_tree = proto_item_add_subtree(item, ett_afp_cat_search);
2289 return loop_record(tvb,sub_tree, offset, count, d_bitmap, f_bitmap, 2, ext);
2292 /* -------------------------- */
2294 dissect_reply_afp_cat_search(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2296 return reply_catsearch(tvb, tree, offset, 0);
2299 /* **************************/
2301 dissect_reply_afp_cat_search_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2303 return reply_catsearch(tvb, tree, offset, 1);
2306 /* **************************/
2308 dissect_query_afp_get_vol_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2312 add_info_vol(tvb, pinfo, offset);
2314 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
2317 decode_vol_bitmap(tree, tvb, offset);
2323 /* ------------------------ */
2325 dissect_reply_afp_get_vol_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2329 bitmap = decode_vol_bitmap(tree, tvb, offset);
2332 offset = parse_vol_bitmap(tree, tvb, offset, bitmap);
2337 /* **************************/
2339 dissect_query_afp_set_vol_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2345 add_info_vol(tvb, pinfo, offset);
2346 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
2349 bitmap = decode_vol_bitmap(tree, tvb, offset);
2352 offset = parse_vol_bitmap(tree, tvb, offset, bitmap);
2357 /* ***************************/
2359 decode_uam_parameters(const char *uam, int len_uam, tvbuff_t *tvb, proto_tree *tree, gint offset)
2363 if (!strncasecmp(uam, "Cleartxt passwrd", len_uam)) {
2367 len = 8; /* tvb_strsize(tvb, offset);*/
2368 proto_tree_add_item(tree, hf_afp_passwd, tvb, offset, len,FALSE);
2371 else if (!strncasecmp(uam, "DHCAST128", len_uam)) {
2376 proto_tree_add_item(tree, hf_afp_random, tvb, offset, len,FALSE);
2379 else if (!strncasecmp(uam, "2-Way Randnum exchange", len_uam)) {
2386 /* ---------------- */
2388 dissect_query_afp_login(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2394 len = tvb_get_guint8(tvb, offset);
2395 proto_tree_add_item(tree, hf_afp_AFPVersion, tvb, offset, 1,FALSE);
2397 len_uam = tvb_get_guint8(tvb, offset);
2398 uam = tvb_get_ptr(tvb, offset +1, len_uam);
2399 proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1,FALSE);
2400 offset += len_uam +1;
2402 if (!strncasecmp(uam, "No User Authent", len_uam)) {
2406 len = tvb_get_guint8(tvb, offset);
2407 proto_tree_add_item(tree, hf_afp_user, tvb, offset, 1,FALSE);
2410 return decode_uam_parameters(uam, len_uam, tvb, tree, offset);
2413 /* ***************************/
2415 dissect_query_afp_login_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2422 type = tvb_get_guint8(tvb, offset);
2425 proto_tree_add_item(tree, hf_afp_login_flags, tvb, offset, 2,FALSE);
2428 len = tvb_get_guint8(tvb, offset);
2429 proto_tree_add_item(tree, hf_afp_AFPVersion, tvb, offset, 1,FALSE);
2432 len_uam = tvb_get_guint8(tvb, offset);
2433 uam = tvb_get_ptr(tvb, offset +1, len_uam);
2434 proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1,FALSE);
2435 offset += len_uam +1;
2437 type = tvb_get_guint8(tvb, offset);
2438 proto_tree_add_item(tree, hf_afp_user_type, tvb, offset, 1,FALSE);
2441 len = tvb_get_ntohs(tvb, offset);
2442 proto_tree_add_item(tree, hf_afp_user_len, tvb, offset, 2,FALSE);
2444 proto_tree_add_item(tree, hf_afp_user_name, tvb, offset, len,FALSE);
2447 /* directory service */
2448 type = tvb_get_guint8(tvb, offset);
2449 proto_tree_add_item(tree, hf_afp_path_type, tvb, offset, 1,FALSE);
2451 /* FIXME use 16 bit len + unicode from smb dissector */
2455 len = tvb_get_guint8(tvb, offset);
2456 proto_tree_add_item(tree, hf_afp_path_len, tvb, offset, 1,FALSE);
2458 proto_tree_add_item(tree, hf_afp_path_name, tvb, offset, len,FALSE);
2462 len = tvb_get_ntohs(tvb, offset);
2463 proto_tree_add_item( tree, hf_afp_path_unicode_len, tvb, offset, 2,FALSE);
2465 proto_tree_add_item(tree, hf_afp_path_name, tvb, offset, len,FALSE);
2472 return decode_uam_parameters(uam, len_uam, tvb, tree, offset);
2475 /* ************************** */
2477 dissect_query_afp_write(tvbuff_t *tvb, packet_info *pinfo , proto_tree *tree, gint offset)
2480 gint col_info = check_col(pinfo->cinfo, COL_INFO);
2483 proto_tree_add_item(tree, hf_afp_flag, tvb, offset, 1,FALSE);
2486 add_info_fork(tvb, pinfo, offset);
2487 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
2490 proto_tree_add_item(tree, hf_afp_offset, tvb, offset, 4,FALSE);
2492 param = tvb_get_ntohl(tvb, offset);
2493 col_append_fstr(pinfo->cinfo, COL_INFO, " Offset=%d", param);
2497 proto_tree_add_item(tree, hf_afp_rw_count, tvb, offset, 4,FALSE);
2499 param = tvb_get_ntohl(tvb, offset);
2500 col_append_fstr(pinfo->cinfo, COL_INFO, " Size=%d", param);
2508 dissect_reply_afp_write(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2510 proto_tree_add_item(tree, hf_afp_last_written, tvb, offset, 4, FALSE);
2516 /* ************************** */
2518 dissect_query_afp_write_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2520 proto_tree_add_item(tree, hf_afp_flag, tvb, offset, 1,FALSE);
2523 add_info_fork(tvb, pinfo, offset);
2524 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
2527 proto_tree_add_item(tree, hf_afp_offset64, tvb, offset, 8,FALSE);
2530 proto_tree_add_item(tree, hf_afp_rw_count64, tvb, offset, 8,FALSE);
2537 dissect_reply_afp_write_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2539 proto_tree_add_item(tree, hf_afp_last_written64, tvb, offset, 8, FALSE);
2545 /* ************************** */
2547 dissect_query_afp_read(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2550 gint col_info = check_col(pinfo->cinfo, COL_INFO);
2554 add_info_fork(tvb, pinfo, offset);
2555 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
2558 proto_tree_add_item(tree, hf_afp_offset, tvb, offset, 4,FALSE);
2560 param = tvb_get_ntohl(tvb, offset);
2561 col_append_fstr(pinfo->cinfo, COL_INFO, " Offset=%d", param);
2565 proto_tree_add_item(tree, hf_afp_rw_count, tvb, offset, 4,FALSE);
2567 param = tvb_get_ntohl(tvb, offset);
2568 col_append_fstr(pinfo->cinfo, COL_INFO, " Size=%d", param);
2572 proto_tree_add_item(tree, hf_afp_newline_mask, tvb, offset, 1,FALSE);
2575 proto_tree_add_item(tree, hf_afp_newline_char, tvb, offset, 1,FALSE);
2581 /* ************************** */
2583 dissect_query_afp_read_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2587 add_info_fork(tvb, pinfo, offset);
2588 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
2591 proto_tree_add_item(tree, hf_afp_offset64, tvb, offset, 8,FALSE);
2594 proto_tree_add_item(tree, hf_afp_rw_count64, tvb, offset, 8,FALSE);
2600 /* **************************
2602 query is the same than AFP_FLUSH, AFP_CLOSEVOL
2606 dissect_reply_afp_open_dt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2608 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
2614 /* **************************
2618 dissect_query_afp_close_dt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2621 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
2627 /* **************************
2628 calls using the same format :
2635 dissect_query_afp_with_fork(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2638 add_info_fork(tvb, pinfo, offset);
2639 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
2645 /* ************************** */
2647 dissect_query_afp_get_fldr_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2650 offset = decode_vol_did_file_dir_bitmap(tree, tvb, offset);
2652 offset = decode_name(tree, pinfo, tvb, offset);
2657 /* -------------------------- */
2659 dissect_reply_afp_get_fldr_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2662 guint16 f_bitmap, d_bitmap;
2664 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2667 d_bitmap = decode_dir_bitmap(tree, tvb, offset);
2670 flags = tvb_get_guint8(tvb, offset);
2671 proto_tree_add_item(tree, hf_afp_file_flag, tvb, offset, 1,FALSE);
2675 offset = parse_dir_bitmap(tree, tvb, offset, d_bitmap);
2678 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
2683 /* **************************
2687 dissect_query_afp_set_fldr_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2692 offset = decode_vol_did(tree, tvb, offset);
2694 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2697 offset = decode_name(tree, pinfo, tvb, offset);
2701 /* did:name can be a file or a folder but only the intersection between
2702 * file bitmap and dir bitmap can be set.
2703 * Well it's in afp spec, but clients (Mac) are setting 'file only' bits with this call
2704 * (WriteInhibit for example).
2706 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap, 1);
2711 /* **************************
2715 dissect_query_afp_set_file_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2720 offset = decode_vol_did(tree, tvb, offset);
2722 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2725 offset = decode_name(tree, pinfo, tvb, offset);
2729 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap, 0);
2734 /* **************************
2738 dissect_query_afp_set_dir_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2743 offset = decode_vol_did(tree, tvb, offset);
2745 d_bitmap = decode_dir_bitmap(tree, tvb, offset);
2748 offset = decode_name(tree, pinfo, tvb, offset);
2752 offset = parse_dir_bitmap(tree, tvb, offset, d_bitmap);
2758 /* **************************
2763 dissect_query_afp_create_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2766 offset = decode_vol_did(tree, tvb, offset);
2768 offset = decode_name(tree, pinfo, tvb, offset);
2772 /* --------------------------
2776 dissect_reply_afp_create_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2778 proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4,FALSE);
2784 /* -------------------------- */
2786 dissect_reply_afp_create_dir(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2788 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
2794 /* **************************
2798 dissect_query_afp_delete_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2801 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
2803 proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4,FALSE);
2809 /* **************************
2810 same reply as get_fork_param
2813 dissect_query_afp_resolve_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2816 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
2818 proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4,FALSE);
2821 decode_file_bitmap(tree, tvb, offset);
2827 /* ************************** */
2829 dissect_query_afp_get_fork_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2833 add_info_fork(tvb, pinfo, offset);
2834 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
2837 decode_file_bitmap(tree, tvb, offset);
2842 /* -------------------------- */
2844 dissect_reply_afp_get_fork_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2848 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2851 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
2856 /* ************************** */
2858 dissect_query_afp_set_fork_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2864 add_info_fork(tvb, pinfo, offset);
2865 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
2868 bitmap = decode_file_bitmap(tree, tvb, offset);
2871 if ((bitmap & kFPExtDataForkLenBit) || (bitmap & kFPExtRsrcForkLenBit)) {
2872 proto_tree_add_item(tree, hf_afp_ofork_len64, tvb, offset, 8, FALSE);
2876 proto_tree_add_item(tree, hf_afp_ofork_len, tvb, offset, 4,FALSE);
2877 if (check_col(pinfo->cinfo, COL_INFO)) {
2878 param = tvb_get_ntohl(tvb, offset);
2879 col_append_fstr(pinfo->cinfo, COL_INFO, " Size=%d", param);
2886 /* ************************** */
2888 dissect_query_afp_move(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2892 offset = decode_vol_did(tree, tvb, offset);
2894 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
2897 offset = decode_name_label(tree, pinfo, tvb, offset, "Source path: %s");
2898 offset = decode_name_label(tree, NULL, tvb, offset, "Dest dir: %s");
2899 offset = decode_name_label(tree, NULL, tvb, offset, "New name: %s");
2904 /* ************************** */
2906 dissect_query_afp_exchange_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2910 offset = decode_vol_did(tree, tvb, offset);
2912 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
2915 offset = decode_name_label(tree, pinfo, tvb, offset, "Source path: %s");
2916 offset = decode_name_label(tree, NULL, tvb, offset, "Dest path: %s");
2920 /* ************************** */
2922 dissect_query_afp_copy_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2924 proto_tree *sub_tree = NULL;
2929 item = proto_tree_add_text(tree, tvb, offset, 6,"Source volume");
2930 sub_tree = proto_item_add_subtree(item, ett_afp_vol_did);
2932 offset = decode_vol_did(sub_tree, tvb, offset);
2935 item = proto_tree_add_text(tree, tvb, offset, 6,"Dest volume");
2936 sub_tree = proto_item_add_subtree(item, ett_afp_vol_did);
2938 offset = decode_vol_did(sub_tree, tvb, offset);
2940 offset = decode_name_label(tree, pinfo, tvb, offset, "Source path: %s");
2941 offset = decode_name_label(tree, NULL, tvb, offset, "Dest dir: %s");
2942 offset = decode_name_label(tree, NULL, tvb, offset, "New name: %s");
2947 /* ************************** */
2949 dissect_query_afp_rename(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
2953 offset = decode_vol_did(tree, tvb, offset);
2955 offset = decode_name_label(tree, pinfo, tvb, offset, "Old name: %s");
2956 offset = decode_name_label(tree, NULL, tvb, offset, "New name: %s");
2961 /* ************************** */
2963 dissect_query_afp_byte_lock(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2965 proto_tree *sub_tree = NULL;
2969 flag = tvb_get_guint8(tvb, offset);
2971 item = proto_tree_add_text(tree, tvb, offset, 1, "Flags: 0x%02x", flag);
2972 sub_tree = proto_item_add_subtree(item, ett_afp_lock_flags);
2975 proto_tree_add_item(sub_tree, hf_afp_lock_op, tvb, offset, 1,FALSE);
2976 proto_tree_add_item(sub_tree, hf_afp_lock_from, tvb, offset, 1,FALSE);
2979 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
2982 proto_tree_add_item(tree, hf_afp_lock_offset, tvb, offset, 4,FALSE);
2985 proto_tree_add_item(tree, hf_afp_lock_len, tvb, offset, 4,FALSE);
2990 /* -------------------------- */
2992 dissect_reply_afp_byte_lock(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
2994 proto_tree_add_item(tree, hf_afp_lock_range_start, tvb, offset, 4,FALSE);
3000 /* ************************** */
3002 dissect_query_afp_byte_lock_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3004 proto_tree *sub_tree = NULL;
3008 flag = tvb_get_guint8(tvb, offset);
3010 item = proto_tree_add_text(tree, tvb, offset, 1, "Flags: 0x%02x", flag);
3011 sub_tree = proto_item_add_subtree(item, ett_afp_lock_flags);
3014 proto_tree_add_item(sub_tree, hf_afp_lock_op, tvb, offset, 1,FALSE);
3015 proto_tree_add_item(sub_tree, hf_afp_lock_from, tvb, offset, 1,FALSE);
3018 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
3021 proto_tree_add_item(tree, hf_afp_lock_offset64, tvb, offset, 8,FALSE);
3024 proto_tree_add_item(tree, hf_afp_lock_len64, tvb, offset, 8,FALSE);
3029 /* -------------------------- */
3031 dissect_reply_afp_byte_lock_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3033 proto_tree_add_item(tree, hf_afp_lock_range_start64, tvb, offset, 8,FALSE);
3039 /* ************************** */
3041 dissect_query_afp_add_cmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3046 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
3049 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
3052 offset = decode_name(tree, pinfo, tvb, offset);
3057 len = tvb_get_guint8(tvb, offset);
3058 proto_tree_add_item(tree, hf_afp_comment, tvb, offset, 1,FALSE);
3065 /* ************************** */
3067 dissect_query_afp_get_cmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3071 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
3074 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
3077 offset = decode_name(tree, pinfo, tvb, offset);
3081 /* -------------------------- */
3083 dissect_reply_afp_get_cmt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3087 len = tvb_get_guint8(tvb, offset);
3088 proto_tree_add_item(tree, hf_afp_comment, tvb, offset, 1,FALSE);
3094 /* ************************** */
3096 dissect_query_afp_get_icon(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3100 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
3102 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
3105 proto_tree_add_item(tree, hf_afp_file_type, tvb, offset, 4,FALSE);
3108 proto_tree_add_item(tree, hf_afp_icon_type, tvb, offset, 1,FALSE);
3112 proto_tree_add_item(tree, hf_afp_icon_length, tvb, offset, 2,FALSE);
3118 /* ************************** */
3120 dissect_query_afp_get_icon_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3124 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
3126 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
3129 proto_tree_add_item(tree, hf_afp_icon_index, tvb, offset, 2,FALSE);
3135 /* -------------------------- */
3137 dissect_reply_afp_get_icon_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3140 proto_tree_add_item(tree, hf_afp_icon_tag, tvb, offset, 4,FALSE);
3143 proto_tree_add_item(tree, hf_afp_file_type, tvb, offset, 4,FALSE);
3146 proto_tree_add_item(tree, hf_afp_icon_type, tvb, offset, 1,FALSE);
3150 proto_tree_add_item(tree, hf_afp_icon_length, tvb, offset, 2,FALSE);
3156 /* ************************** */
3158 dissect_query_afp_add_icon(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3162 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
3164 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
3167 proto_tree_add_item(tree, hf_afp_file_type, tvb, offset, 4,FALSE);
3170 proto_tree_add_item(tree, hf_afp_icon_type, tvb, offset, 1,FALSE);
3174 proto_tree_add_item(tree, hf_afp_icon_tag, tvb, offset, 4,FALSE);
3177 proto_tree_add_item(tree, hf_afp_icon_length, tvb, offset, 2,FALSE);
3183 /* **************************
3187 decode_dt_did(proto_tree *tree, tvbuff_t *tvb, gint offset)
3189 /* FIXME it's not volume but dt cf decode_name*/
3190 Vol = tvb_get_ntohs(tvb, offset);
3191 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
3194 Did = tvb_get_ntohl(tvb, offset);
3195 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
3200 /* -------------------------- */
3202 dissect_query_afp_add_appl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3206 offset = decode_dt_did(tree, tvb, offset);
3208 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
3211 proto_tree_add_item(tree, hf_afp_appl_tag, tvb, offset, 4,FALSE);
3214 offset = decode_name(tree, pinfo, tvb, offset);
3219 /* **************************
3223 dissect_query_afp_rmv_appl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3227 offset = decode_dt_did(tree, tvb, offset);
3229 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
3232 offset = decode_name(tree, pinfo, tvb, offset);
3237 /* ************************** */
3239 dissect_query_afp_get_appl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3243 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
3246 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
3249 proto_tree_add_item(tree, hf_afp_appl_index, tvb, offset, 2,FALSE);
3252 decode_file_bitmap(tree, tvb, offset);
3258 /* -------------------------- */
3260 dissect_reply_afp_get_appl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3262 proto_tree_add_item(tree, hf_afp_appl_tag, tvb, offset, 4,FALSE);
3268 /* ************************** */
3270 dissect_query_afp_create_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3272 proto_tree_add_item(tree, hf_afp_create_flag, tvb, offset, 1,FALSE);
3275 offset = decode_vol_did(tree, tvb, offset);
3277 offset = decode_name(tree, pinfo, tvb, offset);
3282 /* ************************** */
3284 dissect_query_afp_map_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3288 type = tvb_get_guint8(tvb, offset);
3289 proto_tree_add_item(tree, hf_afp_map_id_type, tvb, offset, 1,FALSE);
3293 proto_tree_add_item(tree, hf_afp_map_id, tvb, offset, 4,FALSE);
3297 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16,FALSE);
3304 /* -------------------------- */
3306 dissect_reply_afp_map_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3310 len = tvb_get_guint8(tvb, offset);
3311 /* for type 3 and 4 len is 16 bits but we don't keep the type from the request
3312 * XXX assume name < 256, ie the first byte is zero.
3315 gint remain = tvb_reported_length_remaining(tvb,offset);
3316 if (remain && remain == (len = tvb_get_guint8(tvb, offset +1)) +2) {
3324 proto_tree_add_item(tree, hf_afp_map_name, tvb, offset, 1,FALSE);
3329 /* ************************** */
3331 dissect_query_afp_map_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3334 proto_tree_add_item(tree, hf_afp_map_name_type, tvb, offset, 1,FALSE);
3337 len = tvb_get_guint8(tvb, offset);
3338 proto_tree_add_item(tree, hf_afp_map_name, tvb, offset, 1,FALSE);
3344 /* -------------------------- */
3346 dissect_reply_afp_map_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3350 /* We don't keep the type from the request */
3351 /* If remain == 16, assume UUID */
3352 remain = tvb_reported_length_remaining(tvb,0);
3354 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16, FALSE);
3358 proto_tree_add_item(tree, hf_afp_map_id, tvb, offset, 4, FALSE);
3365 /* ************************** */
3367 dissect_query_afp_disconnect_old_session(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3373 proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2,FALSE);
3376 len = tvb_get_ntohl(tvb, offset);
3377 proto_tree_add_item(tree, hf_afp_session_token_len, tvb, offset, 4,FALSE);
3380 proto_tree_add_item(tree, hf_afp_session_token, tvb, offset, len,FALSE);
3386 /* ************************** */
3388 dissect_query_afp_get_session_token(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3394 token = tvb_get_ntohs(tvb, offset);
3395 proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2,FALSE);
3397 if (token == kLoginWithoutID || token == kGetKerberosSessionKey) /* 0 || 8 */
3400 len = tvb_get_ntohl(tvb, offset);
3401 proto_tree_add_item(tree, hf_afp_session_token_len, tvb, offset, 4,FALSE);
3405 case kLoginWithTimeAndID:
3406 case kReconnWithTimeAndID:
3407 proto_tree_add_item(tree, hf_afp_session_token_timestamp, tvb, offset, 4,FALSE);
3411 proto_tree_add_item(tree, hf_afp_session_token, tvb, offset, len,FALSE);
3417 /* -------------------------- */
3419 dissect_reply_afp_get_session_token(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3424 /* FIXME spec and capture disagree : or it's 4 bytes with no token type, or it's 2 bytes */
3426 /* [cm]: FIXME continued: Since size is set to 4, this test is never true.
3428 proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2,FALSE);
3432 len = tvb_get_ntohl(tvb, offset);
3433 proto_tree_add_item(tree, hf_afp_session_token_len, tvb, offset, size,FALSE);
3436 proto_tree_add_item(tree, hf_afp_session_token, tvb, offset, len,FALSE);
3442 /* ************************** */
3444 dissect_query_afp_get_server_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3448 proto_tree_add_item(tree, hf_afp_message_type, tvb, offset, 2, FALSE);
3452 proto_tree *sub_tree;
3455 item = proto_tree_add_item(tree, hf_afp_message_bitmap, tvb, offset, 2, FALSE);
3456 sub_tree = proto_item_add_subtree(item, ett_afp_message_bitmap);
3457 proto_tree_add_item(sub_tree, hf_afp_message_bitmap_REQ, tvb, offset, 2,FALSE);
3458 proto_tree_add_item(sub_tree, hf_afp_message_bitmap_UTF, tvb, offset, 2,FALSE);
3465 /* ************************** */
3467 dissect_reply_afp_get_server_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3472 /* FIXME: APF 3.1 specs also specify a long reply format, yet unused */
3474 proto_tree_add_item(tree, hf_afp_message_type, tvb, offset, 2, FALSE);
3477 bitmap = tvb_get_ntohs(tvb, offset);
3479 proto_tree *sub_tree;
3482 item = proto_tree_add_item(tree, hf_afp_message_bitmap, tvb, offset, 2, FALSE);
3483 sub_tree = proto_item_add_subtree(item, ett_afp_message_bitmap);
3484 proto_tree_add_item(sub_tree, hf_afp_message_bitmap_REQ, tvb, offset, 2,FALSE);
3485 proto_tree_add_item(sub_tree, hf_afp_message_bitmap_UTF, tvb, offset, 2,FALSE);
3489 /* FIXME: Not in the specs, but for UTF8 message length is 2 bytes */
3490 if ((bitmap & 3) == 3) {
3491 len = tvb_get_ntohs(tvb, offset);
3492 proto_tree_add_item(tree, hf_afp_message_len, tvb, offset, 2,FALSE);
3495 else if ((bitmap & 1)) {
3496 len = tvb_get_guint8(tvb, offset);
3497 proto_tree_add_item(tree, hf_afp_message_len, tvb, offset, 1,FALSE);
3502 proto_tree_add_item(tree, hf_afp_message, tvb, offset, len ,FALSE);
3509 /* ************************** */
3511 dissect_query_afp_get_user_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3514 proto_tree_add_item(tree, hf_afp_user_flag, tvb, offset, 1,FALSE);
3517 proto_tree_add_item(tree, hf_afp_user_ID, tvb, offset, 4,FALSE);
3521 proto_tree *sub_tree;
3524 item = proto_tree_add_item(tree, hf_afp_user_bitmap, tvb, offset, 2,FALSE);
3525 sub_tree = proto_item_add_subtree(item, ett_afp_user_bitmap);
3526 proto_tree_add_item(sub_tree, hf_afp_user_bitmap_UID, tvb, offset, 2,FALSE);
3527 proto_tree_add_item(sub_tree, hf_afp_user_bitmap_GID, tvb, offset, 2,FALSE);
3528 proto_tree_add_item(sub_tree, hf_afp_user_bitmap_UUID, tvb, offset, 2,FALSE);
3535 /* -------------------------- */
3537 dissect_reply_afp_get_user_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3541 bitmap = tvb_get_ntohs(tvb, offset);
3543 proto_tree *sub_tree;
3546 item = proto_tree_add_item(tree, hf_afp_user_bitmap, tvb, offset, 2,FALSE);
3547 sub_tree = proto_item_add_subtree(item, ett_afp_user_bitmap);
3548 proto_tree_add_item(sub_tree, hf_afp_user_bitmap_UID, tvb, offset, 2,FALSE);
3549 proto_tree_add_item(sub_tree, hf_afp_user_bitmap_GID, tvb, offset, 2,FALSE);
3550 proto_tree_add_item(sub_tree, hf_afp_user_bitmap_UUID, tvb, offset, 2,FALSE);
3555 proto_tree_add_item(tree, hf_afp_user_ID, tvb, offset, 4,FALSE);
3560 proto_tree_add_item(tree, hf_afp_group_ID, tvb, offset, 4,FALSE);
3565 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16,FALSE);
3572 /* ************************** */
3574 decode_attr_name (proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, gint offset, const gchar *label)
3581 len = tvb_get_ntohs(tvb, offset);
3585 proto_tree *sub_tree;
3588 name = tvb_format_text(tvb,offset+2, len);
3589 item = proto_tree_add_text(tree, tvb, offset, len + 2, label, name);
3590 sub_tree = proto_item_add_subtree(item, ett_afp_extattr_names);
3592 proto_tree_add_item(sub_tree, hf_afp_extattr_namelen, tvb, offset, 2,FALSE);
3593 proto_tree_add_item(sub_tree, hf_afp_extattr_name, tvb, offset +2, len, FALSE);
3600 /* ************************** */
3602 decode_attr_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset)
3606 proto_tree *sub_tree;
3609 item = proto_tree_add_item(tree, hf_afp_extattr_bitmap, tvb, offset, 2,FALSE);
3610 sub_tree = proto_item_add_subtree(item, ett_afp_extattr_bitmap);
3611 proto_tree_add_item(sub_tree, hf_afp_extattr_bitmap_NoFollow, tvb, offset, 2,FALSE);
3612 proto_tree_add_item(sub_tree, hf_afp_extattr_bitmap_Create, tvb, offset, 2,FALSE);
3613 proto_tree_add_item(sub_tree, hf_afp_extattr_bitmap_Replace, tvb, offset, 2,FALSE);
3619 /* ************************** */
3621 dissect_query_afp_get_ext_attr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3624 offset = decode_vol_did(tree, tvb, offset);
3626 offset = decode_attr_bitmap(tree, tvb, offset);
3629 proto_tree_add_item(tree, hf_afp_offset64, tvb, offset, 8,FALSE);
3631 /* 8byte reqcount */
3632 proto_tree_add_item(tree, hf_afp_reqcount64, tvb, offset, 8,FALSE);
3636 proto_tree_add_item(tree, hf_afp_extattr_reply_size, tvb, offset, 4, FALSE);
3639 offset = decode_name(tree, pinfo, tvb, offset);
3641 offset = decode_attr_name(tree, pinfo, tvb, offset, "Attribute: %s");
3646 /* -------------------------- */
3648 dissect_reply_afp_get_ext_attr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3653 offset = decode_attr_bitmap(tree, tvb, offset);
3655 len = tvb_get_ntohl(tvb, offset);
3656 proto_tree_add_item(tree, hf_afp_extattr_len, tvb, offset, 4,FALSE);
3659 remain = tvb_reported_length_remaining(tvb, offset);
3660 if (len && remain >= len ) {
3661 proto_tree_add_item(tree, hf_afp_extattr_data, tvb, offset, len, FALSE);
3668 /* ************************** */
3670 dissect_query_afp_set_ext_attr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3675 offset = decode_vol_did(tree, tvb, offset);
3677 offset = decode_attr_bitmap(tree, tvb, offset);
3680 proto_tree_add_item(tree, hf_afp_offset64, tvb, offset, 8,FALSE);
3683 offset = decode_name(tree, pinfo, tvb, offset);
3685 offset = decode_attr_name(tree, pinfo, tvb, offset, "Attribute: %s");
3687 len = tvb_get_ntohl(tvb, offset);
3688 proto_tree_add_item(tree, hf_afp_extattr_len, tvb, offset, 4,FALSE);
3691 proto_tree_add_item(tree, hf_afp_extattr_data, tvb, offset, len, FALSE);
3697 /* ************************** */
3699 dissect_query_afp_list_ext_attrs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3702 offset = decode_vol_did(tree, tvb, offset);
3704 /* for this command only kXAttrNoFollow is valid */
3705 offset = decode_attr_bitmap(tree, tvb, offset);
3707 proto_tree_add_item(tree, hf_afp_extattr_req_count, tvb, offset, 2, FALSE);
3710 proto_tree_add_item(tree, hf_afp_extattr_start_index, tvb, offset, 4, FALSE);
3713 proto_tree_add_item(tree, hf_afp_extattr_reply_size, tvb, offset, 4, FALSE);
3716 offset = decode_name(tree, pinfo, tvb, offset);
3721 /* -------------------------- */
3723 dissect_reply_afp_list_ext_attrs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3726 proto_tree *sub_tree;
3730 offset = decode_attr_bitmap(tree, tvb, offset);
3732 length = tvb_get_ntohl(tvb, offset);
3733 proto_tree_add_item(tree, hf_afp_extattr_reply_size, tvb, offset, 4, FALSE);
3736 /* If reply_size was 0 on request, server only reports the size of
3737 the entries without actually adding any entries */
3738 remain = tvb_reported_length_remaining(tvb, offset);
3739 if (remain >= length) {
3741 item = proto_tree_add_text(tree, tvb, offset, remain , "Attributes");
3742 sub_tree = proto_item_add_subtree(item, ett_afp_extattr_names);
3743 while ( remain > 0) {
3744 tvb_get_ephemeral_stringz(tvb, offset, &length);
3745 proto_tree_add_item(sub_tree, hf_afp_extattr_name, tvb, offset, length, FALSE);
3755 /* ************************** */
3757 dissect_query_afp_remove_ext_attr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3760 offset = decode_vol_did(tree, tvb, offset);
3762 offset = decode_attr_bitmap(tree, tvb, offset);
3764 offset = decode_name(tree, pinfo, tvb, offset);
3766 offset = decode_attr_name(tree, pinfo, tvb, offset, "Attribute: %s");
3771 /* ************************** */
3773 decode_acl_access_bitmap(tvbuff_t *tvb, proto_tree *tree, gint offset)
3777 bitmap = tvb_get_ntohl(tvb, offset);
3779 proto_tree *sub_tree;
3782 item = proto_tree_add_item(tree, hf_afp_acl_access_bitmap, tvb, offset, 4, FALSE);
3783 sub_tree = proto_item_add_subtree(item, ett_afp_acl_access_bitmap);
3785 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_read_data , tvb, offset, 4,FALSE);
3786 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_write_data , tvb, offset, 4,FALSE);
3787 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_execute , tvb, offset, 4,FALSE);
3788 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_delete , tvb, offset, 4,FALSE);
3789 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_append_data , tvb, offset, 4,FALSE);
3790 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_delete_child, tvb, offset, 4,FALSE);
3791 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_read_attrs , tvb, offset, 4,FALSE);
3792 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_write_attrs , tvb, offset, 4,FALSE);
3793 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_read_extattrs , tvb, offset, 4,FALSE);
3794 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_write_extattrs, tvb, offset, 4,FALSE);
3795 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_read_security , tvb, offset, 4,FALSE);
3796 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_write_security, tvb, offset, 4,FALSE);
3797 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_change_owner , tvb, offset, 4,FALSE);
3798 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_synchronize , tvb, offset, 4,FALSE);
3799 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_generic_all , tvb, offset, 4,FALSE);
3800 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_generic_execute, tvb, offset, 4,FALSE);
3801 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_generic_write , tvb, offset, 4,FALSE);
3802 proto_tree_add_item(sub_tree, hf_afp_acl_access_bitmap_generic_read , tvb, offset, 4,FALSE);
3808 /* ************************** */
3810 dissect_query_afp_access(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3813 offset = decode_vol_did(tree, tvb, offset);
3815 proto_tree_add_item(tree, hf_afp_access_bitmap, tvb, offset, 2, FALSE);
3818 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16, FALSE);
3821 decode_acl_access_bitmap(tvb, tree, offset);
3824 offset = decode_name(tree, pinfo, tvb, offset);
3829 /* ************************** */
3831 decode_acl_list_bitmap(tvbuff_t *tvb, proto_tree *tree, gint offset)
3835 bitmap = tvb_get_ntohs(tvb, offset);
3837 proto_tree *sub_tree;
3840 item = proto_tree_add_item(tree, hf_afp_acl_list_bitmap, tvb, offset, 2,FALSE);
3841 sub_tree = proto_item_add_subtree(item, ett_afp_acl_list_bitmap);
3842 proto_tree_add_item(sub_tree, hf_afp_acl_list_bitmap_UUID, tvb, offset, 2,FALSE);
3843 proto_tree_add_item(sub_tree, hf_afp_acl_list_bitmap_GRPUUID, tvb, offset, 2,FALSE);
3844 proto_tree_add_item(sub_tree, hf_afp_acl_list_bitmap_ACL, tvb, offset, 2,FALSE);
3845 proto_tree_add_item(sub_tree, hf_afp_acl_list_bitmap_REMOVEACL, tvb, offset, 2,FALSE);
3846 proto_tree_add_item(sub_tree, hf_afp_acl_list_bitmap_Inherit, tvb, offset, 2,FALSE);
3853 /* ************************** */
3855 decode_ace_flags_bitmap(tvbuff_t *tvb, proto_tree *tree, gint offset)
3859 bitmap = tvb_get_ntohl(tvb, offset);
3861 proto_tree *sub_tree;
3864 item = proto_tree_add_item(tree, hf_afp_ace_flags, tvb, offset, 4,FALSE);
3865 sub_tree = proto_item_add_subtree(item, ett_afp_ace_flags);
3866 proto_tree_add_item(sub_tree, hf_afp_ace_flags_allow, tvb, offset, 4,FALSE);
3867 proto_tree_add_item(sub_tree, hf_afp_ace_flags_deny, tvb, offset, 4,FALSE);
3868 proto_tree_add_item(sub_tree, hf_afp_ace_flags_inherited, tvb, offset, 4,FALSE);
3869 proto_tree_add_item(sub_tree, hf_afp_ace_flags_fileinherit, tvb, offset, 4,FALSE);
3870 proto_tree_add_item(sub_tree, hf_afp_ace_flags_dirinherit, tvb, offset, 4,FALSE);
3871 proto_tree_add_item(sub_tree, hf_afp_ace_flags_limitinherit, tvb, offset, 4,FALSE);
3872 proto_tree_add_item(sub_tree, hf_afp_ace_flags_onlyinherit, tvb, offset, 4,FALSE);
3879 decode_kauth_ace(tvbuff_t *tvb, proto_tree *tree, gint offset)
3881 /* FIXME: preliminary decoding... */
3883 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16,FALSE);
3886 decode_ace_flags_bitmap(tvb, tree, offset);
3889 decode_acl_access_bitmap(tvb, tree, offset);
3899 decode_kauth_acl(tvbuff_t *tvb, proto_tree *tree, gint offset)
3903 proto_tree *sub_tree;
3904 proto_tree *ace_tree;
3907 /* FIXME: preliminary decoding... */
3908 entries = tvb_get_ntohl(tvb, offset);
3910 item = proto_tree_add_text(tree, tvb, offset, 4, "ACEs : %d", entries);
3911 sub_tree = proto_item_add_subtree(item, ett_afp_ace_entries);
3914 proto_tree_add_item(tree, hf_afp_acl_flags, tvb, offset, 4,FALSE);
3917 for (i = 0; i < entries; i++) {
3918 item = proto_tree_add_text(sub_tree, tvb, offset, 24, "ACE: %u", i);
3919 ace_tree = proto_item_add_subtree(item, ett_afp_ace_entry);
3921 offset = decode_kauth_ace(tvb, ace_tree, offset);
3928 decode_uuid_acl(tvbuff_t *tvb, proto_tree *tree, gint offset, guint16 bitmap)
3933 if ((bitmap & kFileSec_UUID)) {
3934 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16, FALSE);
3938 if ((bitmap & kFileSec_GRPUUID)) {
3939 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16, FALSE);
3943 if ((bitmap & kFileSec_ACL)) {
3944 offset = decode_kauth_acl(tvb, tree, offset);
3950 /* ************************** */
3952 dissect_query_afp_set_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3957 offset = decode_vol_did(tree, tvb, offset);
3959 bitmap = decode_acl_list_bitmap(tvb, tree, offset);
3962 offset = decode_name(tree, pinfo, tvb, offset);
3964 offset = decode_uuid_acl(tvb, tree, offset, bitmap);
3969 /* ************************** */
3971 dissect_query_afp_get_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
3974 offset = decode_vol_did(tree, tvb, offset);
3976 decode_acl_list_bitmap(tvb, tree, offset);
3979 proto_tree_add_item(tree, hf_afp_max_reply_size32, tvb, offset, 4,FALSE);
3982 offset = decode_name(tree, pinfo, tvb, offset);
3987 /* -------------------------- */
3989 dissect_reply_afp_get_acl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
3993 bitmap = decode_acl_list_bitmap(tvb, tree, offset);
3996 offset = decode_uuid_acl(tvb, tree, offset, bitmap);
4001 /* ************************** */
4003 dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
4005 struct aspinfo *aspinfo = pinfo->private_data;
4006 proto_tree *afp_tree = NULL;
4008 conversation_t *conversation;
4010 afp_request_key request_key, *new_request_key;
4011 afp_request_val *request_val;
4015 int len = tvb_reported_length_remaining(tvb,0);
4016 gint col_info = check_col(pinfo->cinfo, COL_INFO);
4018 if (check_col(pinfo->cinfo, COL_PROTOCOL))
4019 col_set_str(pinfo->cinfo, COL_PROTOCOL, "AFP");
4021 col_clear(pinfo->cinfo, COL_INFO);
4023 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype,
4024 pinfo->srcport, pinfo->destport, 0);
4026 if (conversation == NULL)
4028 conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
4029 pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
4032 request_key.conversation = conversation->index;
4033 request_key.seq = aspinfo->seq;
4035 request_val = (afp_request_val *) g_hash_table_lookup(
4036 afp_request_hash, &request_key);
4038 if (!request_val && !aspinfo->reply) {
4039 afp_command = tvb_get_guint8(tvb, offset);
4040 new_request_key = se_alloc(sizeof(afp_request_key));
4041 *new_request_key = request_key;
4043 request_val = se_alloc(sizeof(afp_request_val));
4044 request_val->command = afp_command;
4045 request_val->frame_req = pinfo->fd->num;
4046 request_val->frame_res = 0;
4047 request_val->req_time=pinfo->fd->abs_ts;
4049 g_hash_table_insert(afp_request_hash, new_request_key,
4053 if (!request_val) { /* missing request */
4055 col_add_fstr(pinfo->cinfo, COL_INFO, "[Reply without query?]");
4059 afp_command = request_val->command;
4061 col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
4062 val_to_str(afp_command, CommandCode_vals,
4063 "Unknown command (%u)"),
4064 aspinfo->reply ? "reply" : "request");
4065 if (aspinfo->reply && aspinfo->code != 0) {
4066 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s (%d)",
4067 val_to_str(aspinfo->code, asp_error_vals,
4068 "Unknown error (%u)"), aspinfo->code);
4074 ti = proto_tree_add_item(tree, proto_afp, tvb, offset, -1,FALSE);
4075 afp_tree = proto_item_add_subtree(ti, ett_afp);
4077 if (!aspinfo->reply) {
4079 proto_tree_add_uint(afp_tree, hf_afp_command, tvb,offset, 1, afp_command);
4080 if (afp_command != tvb_get_guint8(tvb, offset))
4082 /* we have the same conversation for different connections eg:
4083 * ip1:2048 --> ip2:548
4084 * ip1:2048 --> ip2:548 <RST>
4086 * ip1:2048 --> ip2:548 <SYN> use the same port but it's a new session!
4089 col_add_fstr(pinfo->cinfo, COL_INFO,
4090 "[Error!IP port reused, you need to split the capture file]");
4096 * Put in a field for the frame number of the frame to which
4097 * this is a response if we know that frame number (i.e.,
4100 if (request_val->frame_res != 0) {
4101 ti = proto_tree_add_uint(afp_tree, hf_afp_response_in,
4102 tvb, 0, 0, request_val->frame_res);
4103 PROTO_ITEM_SET_GENERATED(ti);
4107 switch(afp_command) {
4109 offset = dissect_query_afp_byte_lock(tvb, pinfo, afp_tree, offset);break;
4110 case AFP_BYTELOCK_EXT:
4111 offset = dissect_query_afp_byte_lock_ext(tvb, pinfo, afp_tree, offset);break;
4112 case AFP_OPENDT: /* same as close vol */
4115 offset = dissect_query_afp_with_vol_id(tvb, pinfo, afp_tree, offset);break;
4117 /* offset = dissect_query_afp_close_dir(tvb, pinfo, afp_tree, offset);break; */
4120 offset = dissect_query_afp_close_dt(tvb, pinfo, afp_tree, offset);break;
4121 case AFP_FLUSHFORK: /* same packet as closefork */
4123 offset = dissect_query_afp_with_fork(tvb, pinfo, afp_tree, offset);break;
4125 offset = dissect_query_afp_copy_file(tvb, pinfo, afp_tree, offset);break;
4126 case AFP_CREATEFILE:
4127 offset = dissect_query_afp_create_file(tvb, pinfo, afp_tree, offset);break;
4128 case AFP_DISCTOLDSESS:
4129 offset = dissect_query_afp_disconnect_old_session(tvb, pinfo, afp_tree, offset);break;
4130 case AFP_ENUMERATE_EXT2:
4131 offset = dissect_query_afp_enumerate_ext2(tvb, pinfo, afp_tree, offset);break;
4132 case AFP_ENUMERATE_EXT:
4134 offset = dissect_query_afp_enumerate(tvb, pinfo, afp_tree, offset);break;
4135 case AFP_GETFORKPARAM:
4136 offset = dissect_query_afp_get_fork_param(tvb, pinfo, afp_tree, offset);break;
4137 case AFP_GETSESSTOKEN:
4138 offset = dissect_query_afp_get_session_token(tvb, pinfo, afp_tree, offset);break;
4139 case AFP_GETUSERINFO:
4140 offset = dissect_query_afp_get_user_info(tvb, pinfo, afp_tree, offset);break;
4141 case AFP_GETSRVINFO:
4142 /* offset = dissect_query_afp_get_server_info(tvb, pinfo, afp_tree, offset);break; */
4143 case AFP_GETSRVPARAM:
4144 break; /* no parameters */
4145 case AFP_GETVOLPARAM:
4146 offset = dissect_query_afp_get_vol_param(tvb, pinfo, afp_tree, offset);break;
4148 offset = dissect_query_afp_login_ext(tvb, pinfo, afp_tree, offset);break;
4150 offset = dissect_query_afp_login(tvb, pinfo, afp_tree, offset);break;
4155 offset = dissect_query_afp_map_id(tvb, pinfo, afp_tree, offset);break;
4157 offset = dissect_query_afp_map_name(tvb, pinfo, afp_tree, offset);break;
4159 offset = dissect_query_afp_move(tvb, pinfo, afp_tree, offset);break;
4161 offset = dissect_query_afp_open_vol(tvb, pinfo, afp_tree, offset);break;
4165 offset = dissect_query_afp_open_fork(tvb, pinfo, afp_tree, offset);break;
4167 offset = dissect_query_afp_read(tvb, pinfo, afp_tree, offset);break;
4169 offset = dissect_query_afp_read_ext(tvb, pinfo, afp_tree, offset);break;
4171 offset = dissect_query_afp_rename(tvb, pinfo, afp_tree, offset);break;
4172 case AFP_SETDIRPARAM:
4173 offset = dissect_query_afp_set_dir_param(tvb, pinfo, afp_tree, offset);break;
4174 case AFP_SETFILEPARAM:
4175 offset = dissect_query_afp_set_file_param(tvb, pinfo, afp_tree, offset);break;
4176 case AFP_SETFORKPARAM:
4177 offset = dissect_query_afp_set_fork_param(tvb, pinfo, afp_tree, offset);break;
4178 case AFP_SETVOLPARAM:
4179 offset = dissect_query_afp_set_vol_param(tvb, pinfo, afp_tree, offset);break;
4181 offset = dissect_query_afp_write(tvb, pinfo, afp_tree, offset);break;
4183 offset = dissect_query_afp_write_ext(tvb, pinfo, afp_tree, offset);break;
4184 case AFP_GETFLDRPARAM:
4185 offset = dissect_query_afp_get_fldr_param(tvb, pinfo, afp_tree, offset);break;
4186 case AFP_SETFLDRPARAM:
4187 offset = dissect_query_afp_set_fldr_param(tvb, pinfo, afp_tree, offset);break;
4190 case AFP_GETSRVRMSG:
4191 offset = dissect_query_afp_get_server_message(tvb, pinfo, afp_tree, offset);break;
4192 case AFP_DELETE: /* same as create_id */
4195 offset = dissect_query_afp_create_id(tvb, pinfo, afp_tree, offset);break;
4197 offset = dissect_query_afp_delete_id(tvb, pinfo, afp_tree, offset);break;
4199 offset = dissect_query_afp_resolve_id(tvb, pinfo, afp_tree, offset);break;
4200 case AFP_EXCHANGEFILE:
4201 offset = dissect_query_afp_exchange_file(tvb, pinfo, afp_tree, offset);break;
4202 case AFP_CATSEARCH_EXT:
4203 offset = dissect_query_afp_cat_search_ext(tvb, pinfo, afp_tree, offset);break;
4205 offset = dissect_query_afp_cat_search(tvb, pinfo, afp_tree, offset);break;
4207 offset = dissect_query_afp_get_icon(tvb, pinfo, afp_tree, offset);break;
4209 offset = dissect_query_afp_get_icon_info(tvb, pinfo, afp_tree, offset);break;
4211 offset = dissect_query_afp_add_appl(tvb, pinfo, afp_tree, offset);break;
4213 offset = dissect_query_afp_rmv_appl(tvb, pinfo, afp_tree, offset);break;
4215 offset = dissect_query_afp_get_appl(tvb, pinfo, afp_tree, offset);break;
4217 offset = dissect_query_afp_add_cmt(tvb, pinfo, afp_tree, offset);break;
4218 case AFP_RMVCMT: /* same as get_cmt */
4220 offset = dissect_query_afp_get_cmt(tvb, pinfo, afp_tree, offset);break;
4222 offset = dissect_query_afp_add_icon(tvb, pinfo, afp_tree, offset);break;
4223 case AFP_GETEXTATTR:
4224 offset = dissect_query_afp_get_ext_attr(tvb, pinfo, afp_tree, offset);break;
4225 case AFP_SETEXTATTR:
4226 offset = dissect_query_afp_set_ext_attr(tvb, pinfo, afp_tree, offset);break;
4227 case AFP_LISTEXTATTR:
4228 offset = dissect_query_afp_list_ext_attrs(tvb, pinfo, afp_tree, offset);break;
4229 case AFP_REMOVEATTR:
4230 offset = dissect_query_afp_remove_ext_attr(tvb, pinfo, afp_tree, offset);break;
4232 offset = dissect_query_afp_get_acl(tvb, pinfo, afp_tree, offset);break;
4234 offset = dissect_query_afp_set_acl(tvb, pinfo, afp_tree, offset);break;
4236 offset = dissect_query_afp_access(tvb, pinfo, afp_tree, offset);break;
4240 proto_tree_add_uint(afp_tree, hf_afp_command, tvb, 0, 0, afp_command);
4243 * Put in fields for the frame with the response to this
4244 * frame - if we know the frame number (i.e., it's not 0).
4246 if (request_val->frame_req != 0) {
4247 ti = proto_tree_add_uint(afp_tree, hf_afp_response_to,
4248 tvb, 0, 0, request_val->frame_req);
4249 PROTO_ITEM_SET_GENERATED(ti);
4250 nstime_delta(&delta_ts, &pinfo->fd->abs_ts, &request_val->req_time);
4251 ti = proto_tree_add_time(afp_tree, hf_afp_time, tvb,
4253 PROTO_ITEM_SET_GENERATED(ti);
4257 * Set "frame_res" if it's not already known.
4259 if (request_val->frame_res == 0)
4260 request_val->frame_res = pinfo->fd->num;
4263 * Tap the packet before the dissectors are called so we
4264 * still get the tap listener called even if there is an
4267 tap_queue_packet(afp_tap, pinfo, request_val);
4270 /* for some calls if the reply is an error there's no data
4275 switch(afp_command) {
4277 offset = dissect_reply_afp_byte_lock(tvb, pinfo, afp_tree, offset);break;
4278 case AFP_BYTELOCK_EXT:
4279 offset = dissect_reply_afp_byte_lock_ext(tvb, pinfo, afp_tree, offset);break;
4280 case AFP_ENUMERATE_EXT2:
4281 case AFP_ENUMERATE_EXT:
4282 offset = dissect_reply_afp_enumerate_ext(tvb, pinfo, afp_tree, offset);break;
4284 offset = dissect_reply_afp_enumerate(tvb, pinfo, afp_tree, offset);break;
4286 offset = dissect_reply_afp_open_vol(tvb, pinfo, afp_tree, offset);break;
4288 offset = dissect_reply_afp_open_fork(tvb, pinfo, afp_tree, offset);break;
4290 case AFP_GETFORKPARAM:
4291 offset =dissect_reply_afp_get_fork_param(tvb, pinfo, afp_tree, offset);break;
4292 case AFP_GETUSERINFO:
4293 offset = dissect_reply_afp_get_user_info(tvb, pinfo, afp_tree, offset);break;
4294 case AFP_GETSRVPARAM:
4295 offset = dissect_reply_afp_get_server_param(tvb, pinfo, afp_tree, offset);break;
4296 case AFP_GETSRVRMSG:
4297 offset = dissect_reply_afp_get_server_message(tvb, pinfo, afp_tree, offset);break;
4299 offset = dissect_reply_afp_create_dir(tvb, pinfo, afp_tree, offset);break;
4301 offset = dissect_reply_afp_map_id(tvb, pinfo, afp_tree, offset);break;
4303 offset = dissect_reply_afp_map_name(tvb, pinfo, afp_tree, offset);break;
4304 case AFP_MOVE: /* same as create_id */
4306 offset = dissect_reply_afp_create_id(tvb, pinfo, afp_tree, offset);break;
4307 case AFP_GETSESSTOKEN:
4308 offset = dissect_reply_afp_get_session_token(tvb, pinfo, afp_tree, offset);break;
4309 case AFP_GETVOLPARAM:
4310 offset = dissect_reply_afp_get_vol_param(tvb, pinfo, afp_tree, offset);break;
4311 case AFP_GETFLDRPARAM:
4312 offset = dissect_reply_afp_get_fldr_param(tvb, pinfo, afp_tree, offset);break;
4314 offset = dissect_reply_afp_open_dt(tvb, pinfo, afp_tree, offset);break;
4315 case AFP_CATSEARCH_EXT:
4316 offset = dissect_reply_afp_cat_search_ext(tvb, pinfo, afp_tree, offset);break;
4318 offset = dissect_reply_afp_cat_search(tvb, pinfo, afp_tree, offset);break;
4320 offset = dissect_reply_afp_get_icon_info(tvb, pinfo, afp_tree, offset);break;
4322 offset = dissect_reply_afp_get_appl(tvb, pinfo, afp_tree, offset);break;
4324 offset = dissect_reply_afp_get_cmt(tvb, pinfo, afp_tree, offset);break;
4326 offset = dissect_reply_afp_write(tvb, pinfo, afp_tree, offset);break;
4328 offset = dissect_reply_afp_write_ext(tvb, pinfo, afp_tree, offset);break;
4329 case AFP_GETEXTATTR:
4330 offset = dissect_reply_afp_get_ext_attr(tvb, pinfo, afp_tree, offset);break;
4331 case AFP_LISTEXTATTR:
4332 offset = dissect_reply_afp_list_ext_attrs(tvb, pinfo, afp_tree, offset);break;
4334 offset = dissect_reply_afp_get_acl(tvb, pinfo, afp_tree, offset);break;
4337 if (tree && offset < len) {
4338 call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1),
4343 static void afp_reinit( void)
4346 if (afp_request_hash)
4347 g_hash_table_destroy(afp_request_hash);
4349 afp_request_hash = g_hash_table_new(afp_hash, afp_equal);
4354 proto_register_afp(void)
4357 static hf_register_info hf[] = {
4359 { "Command", "afp.command",
4360 FT_UINT8, BASE_DEC, VALS(CommandCode_vals), 0x0,
4361 "AFP function", HFILL }},
4365 FT_NONE, BASE_NONE, NULL, 0,
4366 "Pad Byte", HFILL }},
4368 { &hf_afp_AFPVersion,
4369 { "AFP Version", "afp.AFPVersion",
4370 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
4371 "Client AFP version", HFILL }},
4375 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
4376 "User Authentication Method", HFILL }},
4379 { "User", "afp.user",
4380 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
4383 { &hf_afp_user_type,
4384 { "Type", "afp.user_type",
4385 FT_UINT8, BASE_HEX, VALS(path_type_vals), 0,
4386 "Type of user name", HFILL }},
4388 { "Len", "afp.user_len",
4389 FT_UINT16, BASE_DEC, NULL, 0x0,
4390 "User name length (unicode)", HFILL }},
4391 { &hf_afp_user_name,
4392 { "User", "afp.user_name",
4393 FT_STRING, BASE_NONE, NULL, 0x0,
4394 "User name (unicode)", HFILL }},
4397 { "Password", "afp.passwd",
4398 FT_STRINGZ, BASE_NONE, NULL, 0x0,
4399 "Password", HFILL }},
4402 { "Random number", "afp.random",
4403 FT_BYTES, BASE_HEX, NULL, 0x0,
4404 "UAM random number", HFILL }},
4406 { &hf_afp_response_to,
4407 { "Response to", "afp.response_to",
4408 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
4409 "This packet is a response to the packet in this frame", HFILL }},
4412 { "Time from request", "afp.time",
4413 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
4414 "Time between Request and Response for AFP cmds", HFILL }},
4416 { &hf_afp_response_in,
4417 { "Response in", "afp.response_in",
4418 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
4419 "The response to this packet is in this packet", HFILL }},
4421 { &hf_afp_login_flags,
4422 { "Flags", "afp.afp_login_flags",
4423 FT_UINT16, BASE_HEX, NULL, 0 /* 0x0FFF*/,
4424 "Login flags", HFILL }},
4426 { &hf_afp_vol_bitmap,
4427 { "Bitmap", "afp.vol_bitmap",
4428 FT_UINT16, BASE_HEX, NULL, 0 /* 0x0FFF*/,
4429 "Volume bitmap", HFILL }},
4431 { &hf_afp_vol_bitmap_Attributes,
4432 { "Attributes", "afp.vol_bitmap.attributes",
4433 FT_BOOLEAN, 16, NULL, kFPVolAttributeBit,
4434 "Volume attributes", HFILL }},
4436 { &hf_afp_vol_attribute,
4437 { "Attributes", "afp.vol_attributes",
4438 FT_UINT16, BASE_HEX, NULL, 0,
4439 "Volume attributes", HFILL }},
4441 { &hf_afp_vol_attribute_ReadOnly,
4442 { "Read only", "afp.vol_attribute.read_only",
4443 FT_BOOLEAN, 16, NULL, kReadOnly,
4444 "Read only volume", HFILL }},
4446 { &hf_afp_vol_attribute_HasVolumePassword,
4447 { "Volume password", "afp.vol_attribute.passwd",
4448 FT_BOOLEAN, 16, NULL, kHasVolumePassword,
4449 "Has a volume password", HFILL }},
4451 { &hf_afp_vol_attribute_SupportsFileIDs,
4452 { "File IDs", "afp.vol_attribute.fileIDs",
4453 FT_BOOLEAN, 16, NULL, kSupportsFileIDs,
4454 "Supports file IDs", HFILL }},
4456 { &hf_afp_vol_attribute_SupportsCatSearch,
4457 { "Catalog search", "afp.vol_attribute.cat_search",
4458 FT_BOOLEAN, 16, NULL, kSupportsCatSearch,
4459 "Supports catalog search operations", HFILL }},
4461 { &hf_afp_vol_attribute_SupportsBlankAccessPrivs,
4462 { "Blank access privileges", "afp.vol_attribute.blank_access_privs",
4463 FT_BOOLEAN, 16, NULL, kSupportsBlankAccessPrivs,
4464 "Supports blank access privileges", HFILL }},
4466 { &hf_afp_vol_attribute_SupportsUnixPrivs,
4467 { "UNIX access privileges", "afp.vol_attribute.unix_privs",
4468 FT_BOOLEAN, 16, NULL, kSupportsUnixPrivs,
4469 "Supports UNIX access privileges", HFILL }},
4471 { &hf_afp_vol_attribute_SupportsUTF8Names,
4472 { "UTF-8 names", "afp.vol_attribute.utf8_names",
4473 FT_BOOLEAN, 16, NULL, kSupportsUTF8Names,
4474 "Supports UTF-8 names", HFILL }},
4476 { &hf_afp_vol_attribute_NoNetworkUserID,
4477 { "No Network User ID", "afp.vol_attribute.network_user_id",
4478 FT_BOOLEAN, 16, NULL, kNoNetworkUserIDs,
4479 "No Network User ID", HFILL }},
4481 { &hf_afp_vol_attribute_DefaultPrivsFromParent,
4482 { "Inherit parent privileges", "afp.vol_attribute.inherit_parent_privs",
4483 FT_BOOLEAN, 16, NULL, kDefaultPrivsFromParent,
4484 "Inherit parent privileges", HFILL }},
4486 { &hf_afp_vol_attribute_NoExchangeFiles,
4487 { "No exchange files", "afp.vol_attribute.no_exchange_files",
4488 FT_BOOLEAN, 16, NULL, kNoExchangeFiles,
4489 "Exchange files not supported", HFILL }},
4491 { &hf_afp_vol_attribute_SupportsExtAttrs,
4492 { "Extended Attributes", "afp.vol_attribute.extended_attributes",
4493 FT_BOOLEAN, 16, NULL, kSupportsExtAttrs,
4494 "Supports Extended Attributes", HFILL }},
4496 { &hf_afp_vol_attribute_SupportsACLs,
4497 { "ACLs", "afp.vol_attribute.acls",
4498 FT_BOOLEAN, 16, NULL, kSupportsACLs,
4499 "Supports access control lists", HFILL }},
4501 { &hf_afp_vol_bitmap_Signature,
4502 { "Signature", "afp.vol_bitmap.signature",
4503 FT_BOOLEAN, 16, NULL, kFPVolSignatureBit,
4504 "Volume signature", HFILL }},
4506 { &hf_afp_vol_bitmap_CreateDate,
4507 { "Creation date", "afp.vol_bitmap.create_date",
4508 FT_BOOLEAN, 16, NULL, kFPVolCreateDateBit,
4509 "Volume creation date", HFILL }},
4511 { &hf_afp_vol_bitmap_ModDate,
4512 { "Modification date", "afp.vol_bitmap.mod_date",
4513 FT_BOOLEAN, 16, NULL, kFPVolModDateBit,
4514 "Volume modification date", HFILL }},
4516 { &hf_afp_vol_bitmap_BackupDate,
4517 { "Backup date", "afp.vol_bitmap.backup_date",
4518 FT_BOOLEAN, 16, NULL, kFPVolBackupDateBit,
4519 "Volume backup date", HFILL }},
4521 { &hf_afp_vol_bitmap_ID,
4522 { "ID", "afp.vol_bitmap.id",
4523 FT_BOOLEAN, 16, NULL, kFPVolIDBit,
4524 "Volume ID", HFILL }},
4526 { &hf_afp_vol_bitmap_BytesFree,
4527 { "Bytes free", "afp.vol_bitmap.bytes_free",
4528 FT_BOOLEAN, 16, NULL, kFPVolBytesFreeBit,
4529 "Volume free bytes", HFILL }},
4531 { &hf_afp_vol_bitmap_BytesTotal,
4532 { "Bytes total", "afp.vol_bitmap.bytes_total",
4533 FT_BOOLEAN, 16, NULL, kFPVolBytesTotalBit,
4534 "Volume total bytes", HFILL }},
4536 { &hf_afp_vol_bitmap_Name,
4537 { "Name", "afp.vol_bitmap.name",
4538 FT_BOOLEAN, 16, NULL, kFPVolNameBit,
4539 "Volume name", HFILL }},
4541 { &hf_afp_vol_bitmap_ExtBytesFree,
4542 { "Extended bytes free", "afp.vol_bitmap.ex_bytes_free",
4543 FT_BOOLEAN, 16, NULL, kFPVolExtBytesFreeBit,
4544 "Volume extended (>2GB) free bytes", HFILL }},
4546 { &hf_afp_vol_bitmap_ExtBytesTotal,
4547 { "Extended bytes total", "afp.vol_bitmap.ex_bytes_total",
4548 FT_BOOLEAN, 16, NULL, kFPVolExtBytesTotalBit,
4549 "Volume extended (>2GB) total bytes", HFILL }},
4551 { &hf_afp_vol_bitmap_BlockSize,
4552 { "Block size", "afp.vol_bitmap.block_size",
4553 FT_BOOLEAN, 16, NULL, kFPVolBlockSizeBit,
4554 "Volume block size", HFILL }},
4556 { &hf_afp_dir_bitmap_Attributes,
4557 { "Attributes", "afp.dir_bitmap.attributes",
4558 FT_BOOLEAN, 16, NULL, kFPAttributeBit,
4559 "Return attributes if directory", HFILL }},
4561 { &hf_afp_dir_bitmap_ParentDirID,
4562 { "DID", "afp.dir_bitmap.did",
4563 FT_BOOLEAN, 16, NULL, kFPParentDirIDBit,
4564 "Return parent directory ID if directory", HFILL }},
4566 { &hf_afp_dir_bitmap_CreateDate,
4567 { "Creation date", "afp.dir_bitmap.create_date",
4568 FT_BOOLEAN, 16, NULL, kFPCreateDateBit,
4569 "Return creation date if directory", HFILL }},
4571 { &hf_afp_dir_bitmap_ModDate,
4572 { "Modification date", "afp.dir_bitmap.mod_date",
4573 FT_BOOLEAN, 16, NULL, kFPModDateBit,
4574 "Return modification date if directory", HFILL }},
4576 { &hf_afp_dir_bitmap_BackupDate,
4577 { "Backup date", "afp.dir_bitmap.backup_date",
4578 FT_BOOLEAN, 16, NULL, kFPBackupDateBit,
4579 "Return backup date if directory", HFILL }},
4581 { &hf_afp_dir_bitmap_FinderInfo,
4582 { "Finder info", "afp.dir_bitmap.finder_info",
4583 FT_BOOLEAN, 16, NULL, kFPFinderInfoBit,
4584 "Return finder info if directory", HFILL }},
4586 { &hf_afp_dir_bitmap_LongName,
4587 { "Long name", "afp.dir_bitmap.long_name",
4588 FT_BOOLEAN, 16, NULL, kFPLongNameBit,
4589 "Return long name if directory", HFILL }},
4591 { &hf_afp_dir_bitmap_ShortName,
4592 { "Short name", "afp.dir_bitmap.short_name",
4593 FT_BOOLEAN, 16, NULL, kFPShortNameBit,
4594 "Return short name if directory", HFILL }},
4596 { &hf_afp_dir_bitmap_NodeID,
4597 { "File ID", "afp.dir_bitmap.fid",
4598 FT_BOOLEAN, 16, NULL, kFPNodeIDBit,
4599 "Return file ID if directory", HFILL }},
4601 { &hf_afp_dir_bitmap_OffspringCount,
4602 { "Offspring count", "afp.dir_bitmap.offspring_count",
4603 FT_BOOLEAN, 16, NULL, kFPOffspringCountBit,
4604 "Return offspring count if directory", HFILL }},
4606 { &hf_afp_dir_bitmap_OwnerID,
4607 { "Owner id", "afp.dir_bitmap.owner_id",
4608 FT_BOOLEAN, 16, NULL, kFPOwnerIDBit,
4609 "Return owner id if directory", HFILL }},
4611 { &hf_afp_dir_bitmap_GroupID,
4612 { "Group id", "afp.dir_bitmap.group_id",
4613 FT_BOOLEAN, 16, NULL, kFPGroupIDBit,
4614 "Return group id if directory", HFILL }},
4616 { &hf_afp_dir_bitmap_AccessRights,
4617 { "Access rights", "afp.dir_bitmap.access_rights",
4618 FT_BOOLEAN, 16, NULL, kFPAccessRightsBit,
4619 "Return access rights if directory", HFILL }},
4621 { &hf_afp_dir_bitmap_UTF8Name,
4622 { "UTF-8 name", "afp.dir_bitmap.UTF8_name",
4623 FT_BOOLEAN, 16, NULL, kFPUTF8NameBit,
4624 "Return UTF-8 name if diectory", HFILL }},
4626 { &hf_afp_dir_bitmap_UnixPrivs,
4627 { "UNIX privileges", "afp.dir_bitmap.unix_privs",
4628 FT_BOOLEAN, 16, NULL, kFPUnixPrivsBit,
4629 "Return UNIX privileges if directory", HFILL }},
4631 { &hf_afp_dir_attribute_Invisible,
4632 { "Invisible", "afp.dir_attribute.invisible",
4633 FT_BOOLEAN, 16, NULL, kFPInvisibleBit,
4634 "Directory is not visible", HFILL }},
4636 { &hf_afp_dir_attribute_IsExpFolder,
4637 { "Share point", "afp.dir_attribute.share",
4638 FT_BOOLEAN, 16, NULL, kFPMultiUserBit,
4639 "Directory is a share point", HFILL }},
4641 { &hf_afp_dir_attribute_System,
4642 { "System", "afp.dir_attribute.system",
4643 FT_BOOLEAN, 16, NULL, kFPSystemBit,
4644 "Directory is a system directory", HFILL }},
4646 { &hf_afp_dir_attribute_Mounted,
4647 { "Mounted", "afp.dir_attribute.mounted",
4648 FT_BOOLEAN, 16, NULL, kFPDAlreadyOpenBit,
4649 "Directory is mounted", HFILL }},
4651 { &hf_afp_dir_attribute_InExpFolder,
4652 { "Shared area", "afp.dir_attribute.in_exported_folder",
4653 FT_BOOLEAN, 16, NULL, kFPRAlreadyOpenBit,
4654 "Directory is in a shared area", HFILL }},
4656 { &hf_afp_dir_attribute_BackUpNeeded,
4657 { "Backup needed", "afp.dir_attribute.backup_needed",
4658 FT_BOOLEAN, 16, NULL, kFPBackUpNeededBit,
4659 "Directory needs to be backed up", HFILL }},
4661 { &hf_afp_dir_attribute_RenameInhibit,
4662 { "Rename inhibit", "afp.dir_attribute.rename_inhibit",
4663 FT_BOOLEAN, 16, NULL, kFPRenameInhibitBit,
4664 "Rename inhibit", HFILL }},
4666 { &hf_afp_dir_attribute_DeleteInhibit,
4667 { "Delete inhibit", "afp.dir_attribute.delete_inhibit",
4668 FT_BOOLEAN, 16, NULL, kFPDeleteInhibitBit,
4669 "Delete inhibit", HFILL }},
4671 { &hf_afp_dir_attribute_SetClear,
4672 { "Set", "afp.dir_attribute.set_clear",
4673 FT_BOOLEAN, 16, NULL, kFPSetClearBit,
4674 "Clear/set attribute", HFILL }},
4676 { &hf_afp_file_bitmap_Attributes,
4677 { "Attributes", "afp.file_bitmap.attributes",
4678 FT_BOOLEAN, 16, NULL, kFPAttributeBit,
4679 "Return attributes if file", HFILL }},
4681 { &hf_afp_file_bitmap_ParentDirID,
4682 { "DID", "afp.file_bitmap.did",
4683 FT_BOOLEAN, 16, NULL, kFPParentDirIDBit,
4684 "Return parent directory ID if file", HFILL }},
4686 { &hf_afp_file_bitmap_CreateDate,
4687 { "Creation date", "afp.file_bitmap.create_date",
4688 FT_BOOLEAN, 16, NULL, kFPCreateDateBit,
4689 "Return creation date if file", HFILL }},
4691 { &hf_afp_file_bitmap_ModDate,
4692 { "Modification date", "afp.file_bitmap.mod_date",
4693 FT_BOOLEAN, 16, NULL, kFPModDateBit,
4694 "Return modification date if file", HFILL }},
4696 { &hf_afp_file_bitmap_BackupDate,
4697 { "Backup date", "afp.file_bitmap.backup_date",
4698 FT_BOOLEAN, 16, NULL, kFPBackupDateBit,
4699 "Return backup date if file", HFILL }},
4701 { &hf_afp_file_bitmap_FinderInfo,
4702 { "Finder info", "afp.file_bitmap.finder_info",
4703 FT_BOOLEAN, 16, NULL, kFPFinderInfoBit,
4704 "Return finder info if file", HFILL }},
4706 { &hf_afp_file_bitmap_LongName,
4707 { "Long name", "afp.file_bitmap.long_name",
4708 FT_BOOLEAN, 16, NULL, kFPLongNameBit,
4709 "Return long name if file", HFILL }},
4711 { &hf_afp_file_bitmap_ShortName,
4712 { "Short name", "afp.file_bitmap.short_name",
4713 FT_BOOLEAN, 16, NULL, kFPShortNameBit,
4714 "Return short name if file", HFILL }},
4716 { &hf_afp_file_bitmap_NodeID,
4717 { "File ID", "afp.file_bitmap.fid",
4718 FT_BOOLEAN, 16, NULL, kFPNodeIDBit,
4719 "Return file ID if file", HFILL }},
4721 { &hf_afp_file_bitmap_DataForkLen,
4722 { "Data fork size", "afp.file_bitmap.data_fork_len",
4723 FT_BOOLEAN, 16, NULL, kFPDataForkLenBit,
4724 "Return data fork size if file", HFILL }},
4726 { &hf_afp_file_bitmap_RsrcForkLen,
4727 { "Resource fork size", "afp.file_bitmap.resource_fork_len",
4728 FT_BOOLEAN, 16, NULL, kFPRsrcForkLenBit,
4729 "Return resource fork size if file", HFILL }},
4731 { &hf_afp_file_bitmap_ExtDataForkLen,
4732 { "Extended data fork size", "afp.file_bitmap.ex_data_fork_len",
4733 FT_BOOLEAN, 16, NULL, kFPExtDataForkLenBit,
4734 "Return extended (>2GB) data fork size if file", HFILL }},
4736 { &hf_afp_file_bitmap_LaunchLimit,
4737 { "Launch limit", "afp.file_bitmap.launch_limit",
4738 FT_BOOLEAN, 16, NULL, kFPLaunchLimitBit,
4739 "Return launch limit if file", HFILL }},
4741 { &hf_afp_file_bitmap_UTF8Name,
4742 { "UTF-8 name", "afp.file_bitmap.UTF8_name",
4743 FT_BOOLEAN, 16, NULL, kFPUTF8NameBit,
4744 "Return UTF-8 name if file", HFILL }},
4746 { &hf_afp_file_bitmap_ExtRsrcForkLen,
4747 { "Extended resource fork size", "afp.file_bitmap.ex_resource_fork_len",
4748 FT_BOOLEAN, 16, NULL, kFPExtRsrcForkLenBit,
4749 "Return extended (>2GB) resource fork size if file", HFILL }},
4751 { &hf_afp_file_bitmap_UnixPrivs,
4752 { "UNIX privileges", "afp.file_bitmap.unix_privs",
4753 FT_BOOLEAN, 16, NULL, kFPUnixPrivsBit,
4754 "Return UNIX privileges if file", HFILL }},
4757 { &hf_afp_file_attribute_Invisible,
4758 { "Invisible", "afp.file_attribute.invisible",
4759 FT_BOOLEAN, 16, NULL, kFPInvisibleBit,
4760 "File is not visible", HFILL }},
4762 { &hf_afp_file_attribute_MultiUser,
4763 { "Multi user", "afp.file_attribute.multi_user",
4764 FT_BOOLEAN, 16, NULL, kFPMultiUserBit,
4765 "multi user", HFILL }},
4767 { &hf_afp_file_attribute_System,
4768 { "System", "afp.file_attribute.system",
4769 FT_BOOLEAN, 16, NULL, kFPSystemBit,
4770 "File is a system file", HFILL }},
4772 { &hf_afp_file_attribute_DAlreadyOpen,
4773 { "Data fork open", "afp.file_attribute.df_open",
4774 FT_BOOLEAN, 16, NULL, kFPDAlreadyOpenBit,
4775 "Data fork already open", HFILL }},
4777 { &hf_afp_file_attribute_RAlreadyOpen,
4778 { "Resource fork open", "afp.file_attribute.rf_open",
4779 FT_BOOLEAN, 16, NULL, kFPRAlreadyOpenBit,
4780 "Resource fork already open", HFILL }},
4782 { &hf_afp_file_attribute_WriteInhibit,
4783 { "Write inhibit", "afp.file_attribute.write_inhibit",
4784 FT_BOOLEAN, 16, NULL, kFPWriteInhibitBit,
4785 "Write inhibit", HFILL }},
4787 { &hf_afp_file_attribute_BackUpNeeded,
4788 { "Backup needed", "afp.file_attribute.backup_needed",
4789 FT_BOOLEAN, 16, NULL, kFPBackUpNeededBit,
4790 "File needs to be backed up", HFILL }},
4792 { &hf_afp_file_attribute_RenameInhibit,
4793 { "Rename inhibit", "afp.file_attribute.rename_inhibit",
4794 FT_BOOLEAN, 16, NULL, kFPRenameInhibitBit,
4795 "rename inhibit", HFILL }},
4797 { &hf_afp_file_attribute_DeleteInhibit,
4798 { "Delete inhibit", "afp.file_attribute.delete_inhibit",
4799 FT_BOOLEAN, 16, NULL, kFPDeleteInhibitBit,
4800 "delete inhibit", HFILL }},
4802 { &hf_afp_file_attribute_CopyProtect,
4803 { "Copy protect", "afp.file_attribute.copy_protect",
4804 FT_BOOLEAN, 16, NULL, kFPCopyProtectBit,
4805 "copy protect", HFILL }},
4807 { &hf_afp_file_attribute_SetClear,
4808 { "Set", "afp.file_attribute.set_clear",
4809 FT_BOOLEAN, 16, NULL, kFPSetClearBit,
4810 "Clear/set attribute", HFILL }},
4814 { "Volume", "afp.vol_name",
4815 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
4816 "Volume name", HFILL }},
4818 { &hf_afp_vol_flag_passwd,
4819 { "Password", "afp.vol_flag_passwd",
4820 FT_BOOLEAN, 8, NULL, 1,
4821 "Volume is password-protected", HFILL }},
4823 { &hf_afp_vol_flag_unix_priv,
4824 { "Unix privs", "afp.vol_flag_unix_priv",
4825 FT_BOOLEAN, 8, NULL, 2,
4826 "Volume has unix privileges", HFILL }},
4829 { "Volume id", "afp.vol_id",
4830 FT_UINT16, BASE_DEC, NULL, 0x0,
4831 "Volume id", HFILL }},
4833 { &hf_afp_vol_signature,
4834 { "Signature", "afp.vol_signature",
4835 FT_UINT16, BASE_DEC, VALS(vol_signature_vals), 0x0,
4836 "Volume signature", HFILL }},
4838 { &hf_afp_vol_name_offset,
4839 { "Volume name offset","afp.vol_name_offset",
4840 FT_UINT16, BASE_DEC, NULL, 0x0,
4841 "Volume name offset in packet", HFILL }},
4843 { &hf_afp_vol_creation_date,
4844 { "Creation date", "afp.vol_creation_date",
4845 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
4846 "Volume creation date", HFILL }},
4848 { &hf_afp_vol_modification_date,
4849 { "Modification date", "afp.vol_modification_date",
4850 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
4851 "Volume modification date", HFILL }},
4853 { &hf_afp_vol_backup_date,
4854 { "Backup date", "afp.vol_backup_date",
4855 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
4856 "Volume backup date", HFILL }},
4858 { &hf_afp_vol_bytes_free,
4859 { "Bytes free", "afp.vol_bytes_free",
4860 FT_UINT32, BASE_DEC, NULL, 0x0,
4861 "Free space", HFILL }},
4863 { &hf_afp_vol_bytes_total,
4864 { "Bytes total", "afp.vol_bytes_total",
4865 FT_UINT32, BASE_DEC, NULL, 0x0,
4866 "Volume size", HFILL }},
4868 { &hf_afp_vol_ex_bytes_free,
4869 { "Extended bytes free", "afp.vol_ex_bytes_free",
4870 FT_UINT64, BASE_DEC, NULL, 0x0,
4871 "Extended (>2GB) free space", HFILL }},
4873 { &hf_afp_vol_ex_bytes_total,
4874 { "Extended bytes total", "afp.vol_ex_bytes_total",
4875 FT_UINT64, BASE_DEC, NULL, 0x0,
4876 "Extended (>2GB) volume size", HFILL }},
4878 { &hf_afp_vol_block_size,
4879 { "Block size", "afp.vol_block_size",
4880 FT_UINT32, BASE_DEC, NULL, 0x0,
4881 "Volume block size", HFILL }},
4885 FT_UINT32, BASE_DEC, NULL, 0x0,
4886 "Parent directory ID", HFILL }},
4888 { &hf_afp_dir_bitmap,
4889 { "Directory bitmap", "afp.dir_bitmap",
4890 FT_UINT16, BASE_HEX, NULL, 0x0,
4891 "Directory bitmap", HFILL }},
4893 { &hf_afp_dir_offspring,
4894 { "Offspring", "afp.dir_offspring",
4895 FT_UINT16, BASE_DEC, NULL, 0x0,
4896 "Directory offspring", HFILL }},
4898 { &hf_afp_dir_OwnerID,
4899 { "Owner ID", "afp.dir_owner_id",
4900 FT_INT32, BASE_DEC, NULL, 0x0,
4901 "Directory owner ID", HFILL }},
4903 { &hf_afp_dir_GroupID,
4904 { "Group ID", "afp.dir_group_id",
4905 FT_INT32, BASE_DEC, NULL, 0x0,
4906 "Directory group ID", HFILL }},
4908 { &hf_afp_creation_date,
4909 { "Creation date", "afp.creation_date",
4910 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
4911 "Creation date", HFILL }},
4913 { &hf_afp_modification_date,
4914 { "Modification date", "afp.modification_date",
4915 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
4916 "Modification date", HFILL }},
4918 { &hf_afp_backup_date,
4919 { "Backup date", "afp.backup_date",
4920 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
4921 "Backup date", HFILL }},
4923 { &hf_afp_finder_info,
4924 { "Finder info", "afp.finder_info",
4925 FT_BYTES, BASE_HEX, NULL, 0x0,
4926 "Finder info", HFILL }},
4928 { &hf_afp_long_name_offset,
4929 { "Long name offset", "afp.long_name_offset",
4930 FT_UINT16, BASE_DEC, NULL, 0x0,
4931 "Long name offset in packet", HFILL }},
4933 { &hf_afp_short_name_offset,
4934 { "Short name offset", "afp.short_name_offset",
4935 FT_UINT16, BASE_DEC, NULL, 0x0,
4936 "Short name offset in packet", HFILL }},
4938 { &hf_afp_unicode_name_offset,
4939 { "Unicode name offset", "afp.unicode_name_offset",
4940 FT_UINT16, BASE_DEC, NULL, 0x0,
4941 "Unicode name offset in packet", HFILL }},
4943 { &hf_afp_unix_privs_uid,
4944 { "UID", "afp.unix_privs.uid",
4945 FT_UINT32, BASE_DEC, NULL, 0x0,
4946 "User ID", HFILL }},
4948 { &hf_afp_unix_privs_gid,
4949 { "GID", "afp.unix_privs.gid",
4950 FT_UINT32, BASE_DEC, NULL, 0x0,
4951 "Group ID", HFILL }},
4953 { &hf_afp_unix_privs_permissions,
4954 { "Permissions", "afp.unix_privs.permissions",
4955 FT_UINT32, BASE_OCT, NULL, 0x0,
4956 "Permissions", HFILL }},
4958 { &hf_afp_unix_privs_ua_permissions,
4959 { "User's access rights", "afp.unix_privs.ua_permissions",
4960 FT_UINT32, BASE_HEX, NULL, 0x0,
4961 "User's access rights", HFILL }},
4964 { "File ID", "afp.file_id",
4965 FT_UINT32, BASE_DEC, NULL, 0x0,
4966 "File/directory ID", HFILL }},
4968 { &hf_afp_file_DataForkLen,
4969 { "Data fork size", "afp.data_fork_len",
4970 FT_UINT32, BASE_DEC, NULL, 0x0,
4971 "Data fork size", HFILL }},
4973 { &hf_afp_file_RsrcForkLen,
4974 { "Resource fork size", "afp.resource_fork_len",
4975 FT_UINT32, BASE_DEC, NULL, 0x0,
4976 "Resource fork size", HFILL }},
4978 { &hf_afp_file_ExtDataForkLen,
4979 { "Extended data fork size", "afp.ext_data_fork_len",
4980 FT_UINT64, BASE_DEC, NULL, 0x0,
4981 "Extended (>2GB) data fork length", HFILL }},
4983 { &hf_afp_file_ExtRsrcForkLen,
4984 { "Extended resource fork size", "afp.ext_resource_fork_len",
4985 FT_UINT64, BASE_DEC, NULL, 0x0,
4986 "Extended (>2GB) resource fork length", HFILL }},
4988 { &hf_afp_file_bitmap,
4989 { "File bitmap", "afp.file_bitmap",
4990 FT_UINT16, BASE_HEX, NULL, 0x0,
4991 "File bitmap", HFILL }},
4993 { &hf_afp_req_count,
4994 { "Req count", "afp.req_count",
4995 FT_UINT16, BASE_DEC, NULL, 0x0,
4996 "Maximum number of structures returned", HFILL }},
4998 { &hf_afp_start_index,
4999 { "Start index", "afp.start_index",
5000 FT_UINT16, BASE_DEC, NULL, 0x0,
5001 "First structure returned", HFILL }},
5003 { &hf_afp_max_reply_size,
5004 { "Reply size", "afp.reply_size",
5005 FT_UINT16, BASE_DEC, NULL, 0x0,
5006 "Reply size", HFILL }},
5008 { &hf_afp_start_index32,
5009 { "Start index", "afp.start_index32",
5010 FT_UINT32, BASE_DEC, NULL, 0x0,
5011 "First structure returned", HFILL }},
5013 { &hf_afp_max_reply_size32,
5014 { "Reply size", "afp.reply_size32",
5015 FT_UINT32, BASE_DEC, NULL, 0x0,
5016 "Reply size", HFILL }},
5018 { &hf_afp_file_flag,
5019 { "Dir", "afp.file_flag",
5020 FT_BOOLEAN, 8, NULL, 0x80,
5021 "Is a dir", HFILL }},
5023 { &hf_afp_create_flag,
5024 { "Hard create", "afp.create_flag",
5025 FT_BOOLEAN, 8, NULL, 0x80,
5026 "Soft/hard create file", HFILL }},
5028 { &hf_afp_request_bitmap_Attributes,
5029 { "Attributes", "afp.request_bitmap.attributes",
5030 FT_BOOLEAN, 32, NULL, kFPAttributeBit,
5031 "Search attributes", HFILL }},
5033 { &hf_afp_request_bitmap_ParentDirID,
5034 { "DID", "afp.request_bitmap.did",
5035 FT_BOOLEAN, 32, NULL, kFPParentDirIDBit,
5036 "Search parent directory ID", HFILL }},
5038 { &hf_afp_request_bitmap_CreateDate,
5039 { "Creation date", "afp.request_bitmap.create_date",
5040 FT_BOOLEAN, 32, NULL, kFPCreateDateBit,
5041 "Search creation date", HFILL }},
5043 { &hf_afp_request_bitmap_ModDate,
5044 { "Modification date", "afp.request_bitmap.mod_date",
5045 FT_BOOLEAN, 32, NULL, kFPModDateBit,
5046 "Search modification date", HFILL }},
5048 { &hf_afp_request_bitmap_BackupDate,
5049 { "Backup date", "afp.request_bitmap.backup_date",
5050 FT_BOOLEAN, 32, NULL, kFPBackupDateBit,
5051 "Search backup date", HFILL }},
5053 { &hf_afp_request_bitmap_FinderInfo,
5054 { "Finder info", "afp.request_bitmap.finder_info",
5055 FT_BOOLEAN, 32, NULL, kFPFinderInfoBit,
5056 "Search finder info", HFILL }},
5058 { &hf_afp_request_bitmap_LongName,
5059 { "Long name", "afp.request_bitmap.long_name",
5060 FT_BOOLEAN, 32, NULL, kFPLongNameBit,
5061 "Search long name", HFILL }},
5063 { &hf_afp_request_bitmap_DataForkLen,
5064 { "Data fork size", "afp.request_bitmap.data_fork_len",
5065 FT_BOOLEAN, 32, NULL, kFPDataForkLenBit,
5066 "Search data fork size", HFILL }},
5068 { &hf_afp_request_bitmap_OffspringCount,
5069 { "Offspring count", "afp.request_bitmap.offspring_count",
5070 FT_BOOLEAN, 32, NULL, kFPOffspringCountBit,
5071 "Search offspring count", HFILL }},
5073 { &hf_afp_request_bitmap_RsrcForkLen,
5074 { "Resource fork size", "afp.request_bitmap.resource_fork_len",
5075 FT_BOOLEAN, 32, NULL, kFPRsrcForkLenBit,
5076 "Search resource fork size", HFILL }},
5078 { &hf_afp_request_bitmap_ExtDataForkLen,
5079 { "Extended data fork size", "afp.request_bitmap.ex_data_fork_len",
5080 FT_BOOLEAN, 32, NULL, kFPExtDataForkLenBit,
5081 "Search extended (>2GB) data fork size", HFILL }},
5083 { &hf_afp_request_bitmap_UTF8Name,
5084 { "UTF-8 name", "afp.request_bitmap.UTF8_name",
5085 FT_BOOLEAN, 32, NULL, kFPUTF8NameBit,
5086 "Search UTF-8 name", HFILL }},
5088 { &hf_afp_request_bitmap_ExtRsrcForkLen,
5089 { "Extended resource fork size", "afp.request_bitmap.ex_resource_fork_len",
5090 FT_BOOLEAN, 32, NULL, kFPExtRsrcForkLenBit,
5091 "Search extended (>2GB) resource fork size", HFILL }},
5093 { &hf_afp_request_bitmap_PartialNames,
5094 { "Match on partial names", "afp.request_bitmap.partial_names",
5095 FT_BOOLEAN, 32, NULL, 0x80000000,
5096 "Match on partial names", HFILL }},
5098 { &hf_afp_request_bitmap,
5099 { "Request bitmap", "afp.request_bitmap",
5100 FT_UINT32, BASE_HEX, NULL, 0x0,
5101 "Request bitmap", HFILL }},
5103 { &hf_afp_struct_size,
5104 { "Struct size", "afp.struct_size",
5105 FT_UINT8, BASE_DEC, NULL,0,
5106 "Sizeof of struct", HFILL }},
5108 { &hf_afp_struct_size16,
5109 { "Struct size", "afp.struct_size16",
5110 FT_UINT16, BASE_DEC, NULL,0,
5111 "Sizeof of struct", HFILL }},
5114 { "From", "afp.flag",
5115 FT_UINT8, BASE_HEX, VALS(flag_vals), 0x80,
5116 "Offset is relative to start/end of the fork", HFILL }},
5119 { "DT ref", "afp.dt_ref",
5120 FT_UINT16, BASE_DEC, NULL, 0x0,
5121 "Desktop database reference num", HFILL }},
5124 { "Fork", "afp.ofork",
5125 FT_UINT16, BASE_DEC, NULL, 0x0,
5126 "Open fork reference number", HFILL }},
5129 { "Offset", "afp.offset",
5130 FT_INT32, BASE_DEC, NULL, 0x0,
5134 { "Count", "afp.rw_count",
5135 FT_INT32, BASE_DEC, NULL, 0x0,
5136 "Number of bytes to be read/written", HFILL }},
5138 { &hf_afp_newline_mask,
5139 { "Newline mask", "afp.newline_mask",
5140 FT_UINT8, BASE_HEX, NULL, 0x0,
5141 "Value to AND bytes with when looking for newline", HFILL }},
5143 { &hf_afp_newline_char,
5144 { "Newline char", "afp.newline_char",
5145 FT_UINT8, BASE_HEX, NULL, 0x0,
5146 "Value to compare ANDed bytes with when looking for newline", HFILL }},
5148 { &hf_afp_last_written,
5149 { "Last written", "afp.last_written",
5150 FT_UINT32, BASE_DEC, NULL, 0x0,
5151 "Offset of the last byte written", HFILL }},
5153 { &hf_afp_actual_count,
5154 { "Count", "afp.actual_count",
5155 FT_INT32, BASE_DEC, NULL, 0x0,
5156 "Number of bytes returned by read/write", HFILL }},
5158 { &hf_afp_ofork_len,
5159 { "New length", "afp.ofork_len",
5160 FT_INT32, BASE_DEC, NULL, 0x0,
5161 "New length", HFILL }},
5163 { &hf_afp_path_type,
5164 { "Type", "afp.path_type",
5165 FT_UINT8, BASE_HEX, VALS(path_type_vals), 0,
5166 "Type of names", HFILL }},
5169 { "Len", "afp.path_len",
5170 FT_UINT8, BASE_DEC, NULL, 0x0,
5171 "Path length", HFILL }},
5173 { &hf_afp_path_unicode_len,
5174 { "Len", "afp.path_unicode_len",
5175 FT_UINT16, BASE_DEC, NULL, 0x0,
5176 "Path length (unicode)", HFILL }},
5178 { &hf_afp_path_unicode_hint,
5179 { "Unicode hint", "afp.path_unicode_hint",
5180 FT_UINT32, BASE_HEX, VALS(unicode_hint_vals), 0x0,
5181 "Unicode hint", HFILL }},
5183 { &hf_afp_path_name,
5184 { "Name", "afp.path_name",
5185 FT_STRING, BASE_NONE, NULL, 0x0,
5186 "Path name", HFILL }},
5188 { &hf_afp_fork_type,
5189 { "Resource fork", "afp.fork_type",
5190 FT_BOOLEAN, 8, NULL, 0x80,
5191 "Data/resource fork", HFILL }},
5193 { &hf_afp_access_mode,
5194 { "Access mode", "afp.access",
5195 FT_UINT8, BASE_HEX, NULL, 0x0,
5196 "Fork access mode", HFILL }},
5198 { &hf_afp_access_read,
5199 { "Read", "afp.access.read",
5200 FT_BOOLEAN, 8, NULL, 1,
5201 "Open for reading", HFILL }},
5203 { &hf_afp_access_write,
5204 { "Write", "afp.access.write",
5205 FT_BOOLEAN, 8, NULL, 2,
5206 "Open for writing", HFILL }},
5208 { &hf_afp_access_deny_read,
5209 { "Deny read", "afp.access.deny_read",
5210 FT_BOOLEAN, 8, NULL, 0x10,
5211 "Deny read", HFILL }},
5213 { &hf_afp_access_deny_write,
5214 { "Deny write", "afp.access.deny_write",
5215 FT_BOOLEAN, 8, NULL, 0x20,
5216 "Deny write", HFILL }},
5219 { "Comment", "afp.comment",
5220 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
5221 "File/folder comment", HFILL }},
5223 { &hf_afp_file_creator,
5224 { "File creator", "afp.file_creator",
5225 FT_STRING, BASE_NONE, NULL, 0x0,
5226 "File creator", HFILL }},
5228 { &hf_afp_file_type,
5229 { "File type", "afp.file_type",
5230 FT_STRING, BASE_NONE, NULL, 0x0,
5231 "File type", HFILL }},
5233 { &hf_afp_icon_type,
5234 { "Icon type", "afp.icon_type",
5235 FT_UINT8, BASE_HEX, NULL , 0,
5236 "Icon type", HFILL }},
5238 { &hf_afp_icon_length,
5239 { "Size", "afp.icon_length",
5240 FT_UINT16, BASE_DEC, NULL, 0x0,
5241 "Size for icon bitmap", HFILL }},
5243 { &hf_afp_icon_index,
5244 { "Index", "afp.icon_index",
5245 FT_UINT16, BASE_DEC, NULL, 0x0,
5246 "Icon index in desktop database", HFILL }},
5249 { "Tag", "afp.icon_tag",
5250 FT_UINT32, BASE_HEX, NULL, 0x0,
5251 "Icon tag", HFILL }},
5253 { &hf_afp_appl_index,
5254 { "Index", "afp.appl_index",
5255 FT_UINT16, BASE_DEC, NULL, 0x0,
5256 "Application index", HFILL }},
5259 { "Tag", "afp.appl_tag",
5260 FT_UINT32, BASE_HEX, NULL, 0x0,
5261 "Application tag", HFILL }},
5264 { "unlock", "afp.lock_op",
5265 FT_BOOLEAN, 8, NULL, 0x1,
5266 "Lock/unlock op", HFILL }},
5268 { &hf_afp_lock_from,
5269 { "End", "afp.lock_from",
5270 FT_BOOLEAN, 8, NULL, 0x80,
5271 "Offset is relative to the end of the fork", HFILL }},
5273 { &hf_afp_lock_offset,
5274 { "Offset", "afp.lock_offset",
5275 FT_INT32, BASE_DEC, NULL, 0x0,
5276 "First byte to be locked", HFILL }},
5279 { "Length", "afp.lock_len",
5280 FT_INT32, BASE_DEC, NULL, 0x0,
5281 "Number of bytes to be locked/unlocked", HFILL }},
5283 { &hf_afp_lock_range_start,
5284 { "Start", "afp.lock_range_start",
5285 FT_INT32, BASE_DEC, NULL, 0x0,
5286 "First byte locked/unlocked", HFILL }},
5289 { "Access rights", "afp.dir_ar",
5290 FT_UINT32, BASE_HEX, NULL, 0x0,
5291 "Directory access rights", HFILL }},
5293 { &hf_afp_dir_ar_o_search,
5294 { "Owner has search access", "afp.dir_ar.o_search",
5295 FT_BOOLEAN, 32, NULL, AR_O_SEARCH,
5296 "Owner has search access", HFILL }},
5298 { &hf_afp_dir_ar_o_read,
5299 { "Owner has read access", "afp.dir_ar.o_read",
5300 FT_BOOLEAN, 32, NULL, AR_O_READ,
5301 "Owner has read access", HFILL }},
5303 { &hf_afp_dir_ar_o_write,
5304 { "Owner has write access", "afp.dir_ar.o_write",
5305 FT_BOOLEAN, 32, NULL, AR_O_WRITE,
5306 "Gwner has write access", HFILL }},
5308 { &hf_afp_dir_ar_g_search,
5309 { "Group has search access", "afp.dir_ar.g_search",
5310 FT_BOOLEAN, 32, NULL, AR_G_SEARCH,
5311 "Group has search access", HFILL }},
5313 { &hf_afp_dir_ar_g_read,
5314 { "Group has read access", "afp.dir_ar.g_read",
5315 FT_BOOLEAN, 32, NULL, AR_G_READ,
5316 "Group has read access", HFILL }},
5318 { &hf_afp_dir_ar_g_write,
5319 { "Group has write access", "afp.dir_ar.g_write",
5320 FT_BOOLEAN, 32, NULL, AR_G_WRITE,
5321 "Group has write access", HFILL }},
5323 { &hf_afp_dir_ar_e_search,
5324 { "Everyone has search access", "afp.dir_ar.e_search",
5325 FT_BOOLEAN, 32, NULL, AR_E_SEARCH,
5326 "Everyone has search access", HFILL }},
5328 { &hf_afp_dir_ar_e_read,
5329 { "Everyone has read access", "afp.dir_ar.e_read",
5330 FT_BOOLEAN, 32, NULL, AR_E_READ,
5331 "Everyone has read access", HFILL }},
5333 { &hf_afp_dir_ar_e_write,
5334 { "Everyone has write access", "afp.dir_ar.e_write",
5335 FT_BOOLEAN, 32, NULL, AR_E_WRITE,
5336 "Everyone has write access", HFILL }},
5338 { &hf_afp_dir_ar_u_search,
5339 { "User has search access", "afp.dir_ar.u_search",
5340 FT_BOOLEAN, 32, NULL, AR_U_SEARCH,
5341 "User has search access", HFILL }},
5343 { &hf_afp_dir_ar_u_read,
5344 { "User has read access", "afp.dir_ar.u_read",
5345 FT_BOOLEAN, 32, NULL, AR_U_READ,
5346 "User has read access", HFILL }},
5348 { &hf_afp_dir_ar_u_write,
5349 { "User has write access", "afp.dir_ar.u_write",
5350 FT_BOOLEAN, 32, NULL, AR_U_WRITE,
5351 "User has write access", HFILL }},
5353 { &hf_afp_dir_ar_blank,
5354 { "Blank access right", "afp.dir_ar.blank",
5355 FT_BOOLEAN, 32, NULL, AR_BLANK,
5356 "Blank access right", HFILL }},
5358 { &hf_afp_dir_ar_u_own,
5359 { "User is the owner", "afp.dir_ar.u_owner",
5360 FT_BOOLEAN, 32, NULL, AR_U_OWN,
5361 "Current user is the directory owner", HFILL }},
5363 { &hf_afp_server_time,
5364 { "Server time", "afp.server_time",
5365 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
5366 "Server time", HFILL }},
5368 { &hf_afp_cat_req_matches,
5369 { "Max answers", "afp.cat_req_matches",
5370 FT_INT32, BASE_DEC, NULL, 0x0,
5371 "Maximum number of matches to return.", HFILL }},
5374 { "Reserved", "afp.reserved",
5375 FT_BYTES, BASE_HEX, NULL, 0x0,
5376 "Reserved", HFILL }},
5378 { &hf_afp_cat_count,
5379 { "Cat count", "afp.cat_count",
5380 FT_UINT32, BASE_DEC, NULL, 0x0,
5381 "Number of structures returned", HFILL }},
5383 { &hf_afp_cat_position,
5384 { "Position", "afp.cat_position",
5385 FT_BYTES, BASE_HEX, NULL, 0x0,
5386 "Reserved", HFILL }},
5389 { &hf_afp_map_name_type,
5390 { "Type", "afp.map_name_type",
5391 FT_UINT8, BASE_DEC, VALS(map_name_type_vals), 0x0,
5392 "Map name type", HFILL }},
5394 { &hf_afp_map_id_type,
5395 { "Type", "afp.map_id_type",
5396 FT_UINT8, BASE_DEC, VALS(map_id_type_vals), 0x0,
5397 "Map ID type", HFILL }},
5400 { "ID", "afp.map_id",
5401 FT_UINT32, BASE_DEC, NULL, 0x0,
5402 "User/Group ID", HFILL }},
5405 { "Name", "afp.map_name",
5406 FT_UINT_STRING, BASE_NONE, NULL, 0x0,
5407 "User/Group name", HFILL }},
5410 { &hf_afp_lock_offset64,
5411 { "Offset", "afp.lock_offset64",
5412 FT_INT64, BASE_DEC, NULL, 0x0,
5413 "First byte to be locked (64 bits)", HFILL }},
5415 { &hf_afp_lock_len64,
5416 { "Length", "afp.lock_len64",
5417 FT_INT64, BASE_DEC, NULL, 0x0,
5418 "Number of bytes to be locked/unlocked (64 bits)", HFILL }},
5420 { &hf_afp_lock_range_start64,
5421 { "Start", "afp.lock_range_start64",
5422 FT_INT64, BASE_DEC, NULL, 0x0,
5423 "First byte locked/unlocked (64 bits)", HFILL }},
5426 { "Offset", "afp.offset64",
5427 FT_INT64, BASE_DEC, NULL, 0x0,
5428 "Offset (64 bits)", HFILL }},
5430 { &hf_afp_rw_count64,
5431 { "Count", "afp.rw_count64",
5432 FT_INT64, BASE_DEC, NULL, 0x0,
5433 "Number of bytes to be read/written (64 bits)", HFILL }},
5435 { &hf_afp_last_written64,
5436 { "Last written", "afp.last_written64",
5437 FT_UINT64, BASE_DEC, NULL, 0x0,
5438 "Offset of the last byte written (64 bits)", HFILL }},
5440 { &hf_afp_ofork_len64,
5441 { "New length", "afp.ofork_len64",
5442 FT_INT64, BASE_DEC, NULL, 0x0,
5443 "New length (64 bits)", HFILL }},
5445 { &hf_afp_session_token_type,
5446 { "Type", "afp.session_token_type",
5447 FT_UINT16, BASE_HEX, VALS(token_type_vals), 0x0,
5448 "Session token type", HFILL }},
5450 /* FIXME FT_UINT32 in specs */
5451 { &hf_afp_session_token_len,
5452 { "Len", "afp.session_token_len",
5453 FT_UINT32, BASE_DEC, NULL, 0x0,
5454 "Session token length", HFILL }},
5456 { &hf_afp_session_token_timestamp,
5457 { "Time stamp", "afp.session_token_timestamp",
5458 FT_UINT32, BASE_HEX, NULL, 0x0,
5459 "Session time stamp", HFILL }},
5461 { &hf_afp_session_token,
5462 { "Token", "afp.session_token",
5463 FT_BYTES, BASE_HEX, NULL, 0x0,
5464 "Session token", HFILL }},
5466 { &hf_afp_user_flag,
5467 { "Flag", "afp.user_flag",
5468 FT_UINT8, BASE_HEX, VALS(user_flag_vals), 0x01,
5469 "User Info flag", HFILL }},
5472 { "User ID", "afp.user_ID",
5473 FT_UINT32, BASE_DEC, NULL, 0x0,
5474 "User ID", HFILL }},
5477 { "Group ID", "afp.group_ID",
5478 FT_UINT32, BASE_DEC, NULL, 0x0,
5479 "Group ID", HFILL }},
5482 { "UUID", "afp.uuid",
5483 FT_BYTES, BASE_HEX, NULL, 0x0,
5487 { "GRPUUID", "afp.grpuuid",
5488 FT_BYTES, BASE_HEX, NULL, 0x0,
5489 "Group UUID", HFILL }},
5491 { &hf_afp_user_bitmap,
5492 { "Bitmap", "afp.user_bitmap",
5493 FT_UINT16, BASE_HEX, NULL, 0,
5494 "User Info bitmap", HFILL }},
5496 { &hf_afp_user_bitmap_UID,
5497 { "User ID", "afp.user_bitmap.UID",
5498 FT_BOOLEAN, 16, NULL, 0x01,
5499 "User ID", HFILL }},
5501 { &hf_afp_user_bitmap_GID,
5502 { "Primary group ID", "afp.user_bitmap.GID",
5503 FT_BOOLEAN, 16, NULL, 0x02,
5504 "Primary group ID", HFILL }},
5506 { &hf_afp_user_bitmap_UUID,
5507 { "UUID", "afp.user_bitmap.UUID",
5508 FT_BOOLEAN, 16, NULL, 0x04,
5511 { &hf_afp_message_type,
5512 { "Type", "afp.message_type",
5513 FT_UINT16, BASE_HEX, VALS(server_message_type), 0,
5514 "Type of server message", HFILL }},
5516 { &hf_afp_message_bitmap,
5517 { "Bitmap", "afp.message_bitmap",
5518 FT_UINT16, BASE_HEX, NULL, 0,
5519 "Message bitmap", HFILL }},
5521 { &hf_afp_message_bitmap_REQ,
5522 { "Request message", "afp.message_bitmap.requested",
5523 FT_BOOLEAN, 16, NULL, 0x01,
5524 "Message Requested", HFILL }},
5526 { &hf_afp_message_bitmap_UTF,
5527 { "Message is UTF8", "afp.message_bitmap.utf8",
5528 FT_BOOLEAN, 16, NULL, 0x02,
5529 "Message is UTF8", HFILL }},
5531 { &hf_afp_message_len,
5532 { "Len", "afp.message_length",
5533 FT_UINT32, BASE_DEC, NULL, 0x0,
5534 "Message length", HFILL }},
5537 { "Message", "afp.message",
5538 FT_STRING, BASE_NONE, NULL, 0x0,
5539 "Message", HFILL }},
5541 { &hf_afp_reqcount64,
5542 { "Count", "afp.reqcount64",
5543 FT_INT64, BASE_DEC, NULL, 0x0,
5544 "Request Count (64 bits)", HFILL }},
5546 { &hf_afp_extattr_bitmap,
5547 { "Bitmap", "afp.extattr_bitmap",
5548 FT_UINT16, BASE_HEX, NULL, 0,
5549 "Extended attributes bitmap", HFILL }},
5551 { &hf_afp_extattr_bitmap_NoFollow,
5552 { "No follow symlinks", "afp.extattr_bitmap.nofollow",
5553 FT_BOOLEAN, 16, NULL, 0x01,
5554 "Do not follow symlink", HFILL }},
5556 { &hf_afp_extattr_bitmap_Create,
5557 { "Create", "afp.extattr_bitmap.create",
5558 FT_BOOLEAN, 16, NULL, 0x02,
5559 "Create extended attribute", HFILL }},
5561 { &hf_afp_extattr_bitmap_Replace,
5562 { "Replace", "afp.extattr_bitmap.replace",
5563 FT_BOOLEAN, 16, NULL, 0x04,
5564 "Replace extended attribute", HFILL }},
5566 { &hf_afp_extattr_namelen,
5567 { "Length", "afp.extattr.namelen",
5568 FT_UINT16, BASE_DEC, NULL, 0x0,
5569 "Extended attribute name length", HFILL }},
5571 { &hf_afp_extattr_name,
5572 { "Name", "afp.extattr.name",
5573 FT_STRING, BASE_NONE, NULL, 0x0,
5574 "Extended attribute name", HFILL }},
5576 { &hf_afp_extattr_len,
5577 { "Length", "afp.extattr.len",
5578 FT_UINT32, BASE_DEC, NULL, 0x0,
5579 "Extended attribute length", HFILL }},
5581 { &hf_afp_extattr_data,
5582 { "Data", "afp.extattr.data",
5583 FT_BYTES, BASE_HEX, NULL, 0x0,
5584 "Extendend attribute data", HFILL }},
5586 { &hf_afp_extattr_req_count,
5587 { "Request Count", "afp.extattr.req_count",
5588 FT_UINT16, BASE_DEC, NULL, 0x0,
5589 "Request Count.", HFILL }},
5591 { &hf_afp_extattr_start_index,
5592 { "Index", "afp.extattr.start_index",
5593 FT_UINT32, BASE_DEC, NULL, 0x0,
5594 "Start index", HFILL }},
5596 { &hf_afp_extattr_reply_size,
5597 { "Reply size", "afp.extattr.reply_size",
5598 FT_UINT32, BASE_DEC, NULL, 0x0,
5599 "Reply size", HFILL }},
5601 /* ACL control list bitmap */
5602 { &hf_afp_access_bitmap,
5603 { "Bitmap", "afp.access_bitmap",
5604 FT_UINT16, BASE_HEX, NULL, 0,
5605 "Bitmap (reserved)", HFILL }},
5607 { &hf_afp_acl_list_bitmap,
5608 { "ACL bitmap", "afp.acl_list_bitmap",
5609 FT_UINT16, BASE_HEX, NULL, 0,
5610 "ACL control list bitmap", HFILL }},
5612 { &hf_afp_acl_list_bitmap_UUID,
5613 { "UUID", "afp.acl_list_bitmap.UUID",
5614 FT_BOOLEAN, 16, NULL, kFileSec_UUID,
5615 "User UUID", HFILL }},
5617 { &hf_afp_acl_list_bitmap_GRPUUID,
5618 { "GRPUUID", "afp.acl_list_bitmap.GRPUUID",
5619 FT_BOOLEAN, 16, NULL, kFileSec_GRPUUID,
5620 "Group UUID", HFILL }},
5622 { &hf_afp_acl_list_bitmap_ACL,
5623 { "ACL", "afp.acl_list_bitmap.ACL",
5624 FT_BOOLEAN, 16, NULL, kFileSec_ACL,
5627 { &hf_afp_acl_list_bitmap_REMOVEACL,
5628 { "Remove ACL", "afp.acl_list_bitmap.REMOVEACL",
5629 FT_BOOLEAN, 16, NULL, kFileSec_REMOVEACL,
5630 "Remove ACL", HFILL }},
5632 { &hf_afp_acl_list_bitmap_Inherit,
5633 { "Inherit", "afp.acl_list_bitmap.Inherit",
5634 FT_BOOLEAN, 16, NULL, kFileSec_Inherit,
5635 "Inherit ACL", HFILL }},
5637 { &hf_afp_acl_entrycount,
5638 { "Count", "afp.acl_entrycount",
5639 FT_UINT32, BASE_HEX, NULL, 0,
5640 "Number of ACL entries", HFILL }},
5642 { &hf_afp_acl_flags,
5643 { "ACL flags", "afp.acl_flags",
5644 FT_UINT32, BASE_HEX, NULL, 0,
5645 "ACL flags", HFILL }},
5647 { &hf_afp_ace_applicable,
5648 { "ACE", "afp.ace_applicable",
5649 FT_BYTES, BASE_HEX, NULL, 0x0,
5650 "ACE applicable", HFILL }},
5652 { &hf_afp_ace_rights,
5653 { "Rights", "afp.ace_rights",
5654 FT_UINT32, BASE_HEX, NULL, 0,
5655 "ACE flags", HFILL }},
5657 { &hf_afp_acl_access_bitmap,
5658 { "Bitmap", "afp.acl_access_bitmap",
5659 FT_UINT32, BASE_HEX, NULL, 0,
5660 "ACL access bitmap", HFILL }},
5662 { &hf_afp_acl_access_bitmap_read_data,
5663 { "Read/List", "afp.acl_access_bitmap.read_data",
5664 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_READ_DATA,
5665 "Read data / list directory", HFILL }},
5667 { &hf_afp_acl_access_bitmap_write_data,
5668 { "Write/Add file", "afp.acl_access_bitmap.write_data",
5669 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_WRITE_DATA,
5670 "Write data to a file / add a file to a directory", HFILL }},
5672 { &hf_afp_acl_access_bitmap_execute,
5673 { "Execute/Search", "afp.acl_access_bitmap.execute",
5674 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_EXECUTE,
5675 "Execute a program", HFILL }},
5677 { &hf_afp_acl_access_bitmap_delete,
5678 { "Delete", "afp.acl_access_bitmap.delete",
5679 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_DELETE,
5682 { &hf_afp_acl_access_bitmap_append_data,
5683 { "Append data/create subdir", "afp.acl_access_bitmap.append_data",
5684 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_APPEND_DATA,
5685 "Append data to a file / create a subdirectory", HFILL }},
5687 { &hf_afp_acl_access_bitmap_delete_child,
5688 { "Delete dir", "afp.acl_access_bitmap.delete_child",
5689 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_DELETE_CHILD,
5690 "Delete directory", HFILL }},
5692 { &hf_afp_acl_access_bitmap_read_attrs,
5693 { "Read attributes", "afp.acl_access_bitmap.read_attrs",
5694 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_READ_ATTRIBUTES,
5695 "Read attributes", HFILL }},
5697 { &hf_afp_acl_access_bitmap_write_attrs,
5698 { "Write attributes", "afp.acl_access_bitmap.write_attrs",
5699 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_WRITE_ATTRIBUTES,
5700 "Write attributes", HFILL }},
5702 { &hf_afp_acl_access_bitmap_read_extattrs,
5703 { "Read extended attributes", "afp.acl_access_bitmap.read_extattrs",
5704 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_READ_EXTATTRIBUTES,
5705 "Read extended attributes", HFILL }},
5707 { &hf_afp_acl_access_bitmap_write_extattrs,
5708 { "Write extended attributes", "afp.acl_access_bitmap.write_extattrs",
5709 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_WRITE_EXTATTRIBUTES,
5710 "Write extended attributes", HFILL }},
5712 { &hf_afp_acl_access_bitmap_read_security,
5713 { "Read security", "afp.acl_access_bitmap.read_security",
5714 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_READ_SECURITY,
5715 "Read access rights", HFILL }},
5717 { &hf_afp_acl_access_bitmap_write_security,
5718 { "Write security", "afp.acl_access_bitmap.write_security",
5719 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_WRITE_SECURITY,
5720 "Write access rights", HFILL }},
5722 { &hf_afp_acl_access_bitmap_change_owner,
5723 { "Change owner", "afp.acl_access_bitmap.change_owner",
5724 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_CHANGE_OWNER,
5725 "Change owner", HFILL }},
5727 { &hf_afp_acl_access_bitmap_synchronize,
5728 { "Synchronize", "afp.acl_access_bitmap.synchronize",
5729 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_SYNCHRONIZE,
5730 "Synchronize", HFILL }},
5732 { &hf_afp_acl_access_bitmap_generic_all,
5733 { "Generic all", "afp.acl_access_bitmap.generic_all",
5734 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_GENERIC_ALL,
5735 "Generic all", HFILL }},
5737 { &hf_afp_acl_access_bitmap_generic_execute,
5738 { "Generic execute", "afp.acl_access_bitmap.generic_execute",
5739 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_GENERIC_EXECUTE,
5740 "Generic execute", HFILL }},
5742 { &hf_afp_acl_access_bitmap_generic_write,
5743 { "Generic write", "afp.acl_access_bitmap.generic_write",
5744 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_GENERIC_WRITE,
5745 "Generic write", HFILL }},
5747 { &hf_afp_acl_access_bitmap_generic_read,
5748 { "Generic read", "afp.acl_access_bitmap.generic_read",
5749 FT_BOOLEAN, 32, NULL, KAUTH_VNODE_GENERIC_READ,
5750 "Generic read", HFILL }},
5752 { &hf_afp_ace_flags,
5753 { "Flags", "afp.ace_flags",
5754 FT_UINT32, BASE_HEX, NULL, 0,
5755 "ACE flags", HFILL }},
5757 { &hf_afp_ace_flags_allow,
5758 { "Allow", "afp.ace_flags.allow",
5759 FT_BOOLEAN, 32, NULL, ACE_ALLOW,
5760 "Allow rule", HFILL }},
5762 { &hf_afp_ace_flags_deny,
5763 { "Deny", "afp.ace_flags.deny",
5764 FT_BOOLEAN, 32, NULL, ACE_DENY,
5765 "Deny rule", HFILL }},
5767 { &hf_afp_ace_flags_inherited,
5768 { "Inherited", "afp.ace_flags.inherited",
5769 FT_BOOLEAN, 32, NULL, ACE_INHERITED,
5770 "Inherited", HFILL }},
5772 { &hf_afp_ace_flags_fileinherit,
5773 { "File inherit", "afp.ace_flags.file_inherit",
5774 FT_BOOLEAN, 32, NULL, ACE_FILE_INHERIT,
5775 "File inherit", HFILL }},
5777 { &hf_afp_ace_flags_dirinherit,
5778 { "Dir inherit", "afp.ace_flags.directory_inherit",
5779 FT_BOOLEAN, 32, NULL, ACE_DIR_INHERIT,
5780 "Dir inherit", HFILL }},
5782 { &hf_afp_ace_flags_limitinherit,
5783 { "Limit inherit", "afp.ace_flags.limit_inherit",
5784 FT_BOOLEAN, 32, NULL, ACE_LIMIT_INHERIT,
5785 "Limit inherit", HFILL }},
5787 { &hf_afp_ace_flags_onlyinherit,
5788 { "Only inherit", "afp.ace_flags.only_inherit",
5789 FT_BOOLEAN, 32, NULL, ACE_ONLY_INHERIT,
5790 "Only inherit", HFILL }},
5793 static gint *ett[] = {
5795 &ett_afp_server_vol,
5798 &ett_afp_vol_bitmap,
5799 &ett_afp_vol_attribute,
5800 &ett_afp_dir_bitmap,
5801 &ett_afp_file_bitmap,
5802 &ett_afp_unix_privs,
5804 &ett_afp_enumerate_line,
5805 &ett_afp_access_mode,
5806 &ett_afp_dir_attribute,
5807 &ett_afp_file_attribute,
5809 &ett_afp_lock_flags,
5811 &ett_afp_cat_search,
5812 &ett_afp_cat_r_bitmap,
5815 &ett_afp_user_bitmap,
5816 &ett_afp_message_bitmap,
5817 &ett_afp_extattr_bitmap,
5818 &ett_afp_extattr_names,
5819 &ett_afp_acl_list_bitmap,
5820 &ett_afp_acl_access_bitmap,
5821 &ett_afp_ace_entries,
5826 proto_afp = proto_register_protocol("Apple Filing Protocol", "AFP", "afp");
5827 proto_register_field_array(proto_afp, hf, array_length(hf));
5828 proto_register_subtree_array(ett, array_length(ett));
5830 register_init_routine(afp_reinit);
5832 register_dissector("afp", dissect_afp, proto_afp);
5833 data_handle = find_dissector("data");
5835 afp_tap = register_tap("afp");
5839 proto_reg_handoff_afp(void)
5841 data_handle = find_dissector("data");
5844 /* -------------------------------