Bug Summary

File:builds/wireshark/wireshark/epan/dissectors/packet-afp.c
Warning:line 1493, column 3
Value stored to 'offset' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name packet-afp.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -fno-delete-null-pointer-checks -mframe-pointer=all -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -ffloat16-excess-precision=fast -fbfloat16-excess-precision=fast -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/builds/wireshark/wireshark/build -fcoverage-compilation-dir=/builds/wireshark/wireshark/build -resource-dir /usr/lib/llvm-22/lib/clang/22 -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /builds/wireshark/wireshark/epan/dissectors -isystem /builds/wireshark/wireshark/build/epan/dissectors -isystem /usr/include/mit-krb5 -isystem /usr/include/libxml2 -isystem /builds/wireshark/wireshark/epan -D CARES_NO_DEPRECATED -D G_DISABLE_DEPRECATED -D G_DISABLE_SINGLE_INCLUDES -D WS_BUILD_DLL -D WS_DEBUG -D WS_DEBUG_UTF_8 -I /builds/wireshark/wireshark/build -I /builds/wireshark/wireshark -I /builds/wireshark/wireshark/include -D _GLIBCXX_ASSERTIONS -internal-isystem /usr/lib/llvm-22/lib/clang/22/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/16/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fmacro-prefix-map=/builds/wireshark/wireshark/= -fmacro-prefix-map=/builds/wireshark/wireshark/build/= -fmacro-prefix-map=../= -Wno-format-nonliteral -std=gnu17 -ferror-limit 19 -fvisibility=hidden -fwrapv -fwrapv-pointer -fstrict-flex-arrays=3 -stack-protector 2 -fstack-clash-protection -fcf-protection=full -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fexceptions -fcolor-diagnostics -analyzer-output=html -faddrsig -fdwarf2-cfi-asm -o /builds/wireshark/wireshark/sbout/2026-06-29-100418-3576-1 -x c /builds/wireshark/wireshark/epan/dissectors/packet-afp.c
1/* packet-afp.c
2 * Routines for afp packet dissection
3 * Copyright 2002, Didier Gautheron <dgautheron@magic.fr>
4 *
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
8 *
9 * Copied from README.developer
10 * Copied from packet-dsi.c
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 */
14
15#include "config.h"
16
17
18#include <epan/packet.h>
19#include <epan/exceptions.h>
20#include <epan/to_str.h>
21#include <epan/conversation.h>
22#include <epan/prefs.h>
23#include <epan/tap.h>
24#include <epan/srt_table.h>
25#include <epan/expert.h>
26#include <wsutil/epochs.h>
27
28#include "packet-afp.h"
29
30/* The information in this module (AFP) comes from:
31
32 AFP 2.1 & 2.2 documentation, in PDF form, at
33
34http://mirror.informatimago.com/next/developer.apple.com/documentation/macos8/pdf/ASAppleTalkFiling2.1_2.2.pdf
35
36 formerly at
37
38http://developer.apple.com/DOCUMENTATION/macos8/pdf/ASAppleTalkFiling2.1_2.2.pdf
39
40 AFP3.0.pdf from http://www.apple.com (still available?)
41
42 AFP 3.1 programming guide, in PDF form, at
43
44https://web.archive.org/web/20040721011424/http://developer.apple.com/documentation/Networking/Conceptual/AFP/AFP3_1.pdf
45
46 and, in HTML form, at
47
48https://web.archive.org/web/20041010010846/http://developer.apple.com/documentation/Networking/Conceptual/AFP/index.html
49
50 AFP 3.2 programming guide, in PDF form, at
51
52https://web.archive.org/web/20060207231337/http://developer.apple.com/documentation/Networking/Conceptual/AFP/AFP3_1.pdf
53
54 and, in HTML form, at
55
56https://web.archive.org/web/20080514131536/http://developer.apple.com/documentation/Networking/Conceptual/AFP/Introduction/chapter_1_section_1.html
57
58 AFP 3.x specification, as of 2012, in PDF form, at
59https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.363.9481&rep=rep1&type=pdf
60
61 Current AFP 3.x programming guide, in HTML form, at
62https://developer.apple.com/library/archive/documentation/Networking/Conceptual/AFP/Introduction/Introduction.html
63
64 The netatalk source code by Wesley Craig & Adrian Sun
65 http://netatalk.sf.net
66
67 XXX - distinguish between UTF-8 and Mac proprietary encodings for strings?
68 Does that need a preference in case we didn't see the client and server
69 negotiate that?
70*/
71/* Forward declarations */
72void proto_register_afp(void);
73void proto_reg_handoff_afp(void);
74
75/* from netatalk/include/afp.h */
76#define AFPTRANS_NONE0 0
77#define AFPTRANS_DDP(1U << 0) (1U << 0)
78#define AFPTRANS_TCP(1U << 1) (1U << 1)
79#define AFPTRANS_ALL((1U << 0) | (1U << 1)) (AFPTRANS_DDP(1U << 0) | AFPTRANS_TCP(1U << 1))
80
81/* AFP Attention Codes -- 4 bits */
82#define AFPATTN_SHUTDOWN(1U << 15) (1U << 15) /* shutdown/disconnect */
83#define AFPATTN_CRASH(1U << 14) (1U << 14) /* server crashed */
84#define AFPATTN_MESG(1U << 13) (1U << 13) /* server has message */
85#define AFPATTN_NORECONNECT(1U << 12) (1U << 12) /* don't reconnect */
86/* server notification */
87#define AFPATTN_NOTIFY((1U << 13) | (1U << 12)) (AFPATTN_MESG(1U << 13) | AFPATTN_NORECONNECT(1U << 12))
88
89/* extended bitmap -- 12 bits. volchanged is only useful w/ a server
90 * notification, and time is only useful for shutdown. */
91#define AFPATTN_VOLCHANGED(1U << 0) (1U << 0) /* volume has changed */
92#define AFPATTN_TIME(x)((x) & 0xfff) ((x) & 0xfff) /* time in minutes */
93
94/* AFP functions */
95#define AFP_BYTELOCK1 1
96#define AFP_CLOSEVOL2 2
97#define AFP_CLOSEDIR3 3
98#define AFP_CLOSEFORK4 4
99#define AFP_COPYFILE5 5
100#define AFP_CREATEDIR6 6
101#define AFP_CREATEFILE7 7
102#define AFP_DELETE8 8
103#define AFP_ENUMERATE9 9
104#define AFP_FLUSH10 10
105#define AFP_FLUSHFORK11 11
106#define AFP_GETFORKPARAM14 14
107#define AFP_GETSRVINFO15 15
108#define AFP_GETSRVPARAM16 16
109#define AFP_GETVOLPARAM17 17
110#define AFP_LOGIN18 18
111#define AFP_LOGINCONT19 19
112#define AFP_LOGOUT20 20
113#define AFP_MAPID21 21
114#define AFP_MAPNAME22 22
115#define AFP_MOVE23 23
116#define AFP_OPENVOL24 24
117#define AFP_OPENDIR25 25
118#define AFP_OPENFORK26 26
119#define AFP_READ27 27
120#define AFP_RENAME28 28
121#define AFP_SETDIRPARAM29 29
122#define AFP_SETFILEPARAM30 30
123#define AFP_SETFORKPARAM31 31
124#define AFP_SETVOLPARAM32 32
125#define AFP_WRITE33 33
126#define AFP_GETFLDRPARAM34 34
127#define AFP_SETFLDRPARAM35 35
128#define AFP_CHANGEPW36 36
129#define AFP_GETUSERINFO37 37
130#define AFP_GETSRVRMSG38 38
131#define AFP_CREATEID39 39
132#define AFP_DELETEID40 40
133#define AFP_RESOLVEID41 41
134#define AFP_EXCHANGEFILE42 42
135#define AFP_CATSEARCH43 43
136#define AFP_OPENDT48 48
137#define AFP_CLOSEDT49 49
138#define AFP_GETICON51 51
139#define AFP_GTICNINFO52 52
140#define AFP_ADDAPPL53 53
141#define AFP_RMVAPPL54 54
142#define AFP_GETAPPL55 55
143#define AFP_ADDCMT56 56
144#define AFP_RMVCMT57 57
145#define AFP_GETCMT58 58
146
147#define AFP_ZZZ122 122
148#define AFP_ADDICON192 192
149
150/* AFP 3.0 new calls */
151#define AFP_BYTELOCK_EXT59 59
152#define AFP_READ_EXT60 60
153#define AFP_WRITE_EXT61 61
154#define AFP_LOGIN_EXT63 63
155#define AFP_GETSESSTOKEN64 64
156#define AFP_DISCTOLDSESS65 65
157#define AFP_ENUMERATE_EXT66 66
158#define AFP_CATSEARCH_EXT67 67
159
160/* AFP 3.1 new calls */
161#define AFP_ENUMERATE_EXT268 68
162
163/* AFP 3.2 new calls */
164#define AFP_GETEXTATTR69 69
165#define AFP_SETEXTATTR70 70
166#define AFP_REMOVEATTR71 71
167#define AFP_LISTEXTATTR72 72
168#define AFP_GETACL73 73
169#define AFP_SETACL74 74
170#define AFP_ACCESS75 75
171
172/* AFP 3.2 calls added in 10.5 */
173#define AFP_SPOTLIGHTRPC76 76
174#define AFP_SYNCDIR78 78
175#define AFP_SYNCFORK79 79
176
177/* FPSpotlightRPC subcommand codes */
178#define SPOTLIGHT_CMD_GET_VOLPATH4 4
179#define SPOTLIGHT_CMD_GET_VOLID2 2
180#define SPOTLIGHT_CMD_GET_THREE3 3
181
182/* Spotlight epoch is UNIX epoch minus SPOTLIGHT_TIME_DELTA */
183#define SPOTLIGHT_TIME_DELTA280878921600UL UINT64_C(280878921600)280878921600UL
184
185/* ----------------------------- */
186static int proto_afp;
187static int hf_afp_reserved;
188static int hf_afp_unknown;
189
190static int hf_afp_command; /* CommandCode */
191static int hf_afp_Version;
192static int hf_afp_UAM;
193static int hf_afp_user;
194static int hf_afp_passwd;
195static int hf_afp_random;
196
197static int hf_afp_response_to;
198static int hf_afp_time;
199static int hf_afp_response_in;
200
201static int hf_afp_login_flags;
202static int hf_afp_pad;
203
204static int hf_afp_user_type;
205static int hf_afp_user_len;
206static int hf_afp_user_name;
207
208static int hf_afp_vol_flag;
209static int hf_afp_vol_flag_passwd;
210static int hf_afp_vol_flag_has_config;
211static int hf_afp_server_time;
212
213static int hf_afp_vol_bitmap;
214static int hf_afp_vol_name_offset;
215static int hf_afp_vol_id;
216static int hf_afp_vol_attribute;
217static int hf_afp_vol_name;
218static int hf_afp_vol_signature;
219static int hf_afp_vol_creation_date;
220static int hf_afp_vol_modification_date;
221static int hf_afp_vol_backup_date;
222static int hf_afp_vol_bytes_free;
223static int hf_afp_vol_bytes_total;
224static int hf_afp_vol_ex_bytes_free;
225static int hf_afp_vol_ex_bytes_total;
226static int hf_afp_vol_block_size;
227
228/* desktop stuff */
229static int hf_afp_comment;
230static int hf_afp_file_creator;
231static int hf_afp_file_type;
232static int hf_afp_icon_type;
233static int hf_afp_icon_length;
234static int hf_afp_icon_tag;
235static int hf_afp_icon_index;
236static int hf_afp_appl_index;
237static int hf_afp_appl_tag;
238
239static int hf_afp_did;
240static int hf_afp_file_id;
241static int hf_afp_file_DataForkLen;
242static int hf_afp_file_RsrcForkLen;
243static int hf_afp_file_ExtDataForkLen;
244static int hf_afp_file_ExtRsrcForkLen;
245
246static int hf_afp_dir_bitmap;
247static int hf_afp_dir_offspring;
248static int hf_afp_dir_OwnerID;
249static int hf_afp_dir_GroupID;
250
251static int hf_afp_req_count;
252static int hf_afp_start_index;
253static int hf_afp_start_index32;
254static int hf_afp_max_reply_size;
255static int hf_afp_max_reply_size32;
256static int hf_afp_file_flag;
257static int hf_afp_create_flag;
258static int hf_afp_struct_size;
259static int hf_afp_struct_size16;
260
261static int hf_afp_cat_count;
262static int hf_afp_cat_req_matches;
263static int hf_afp_cat_position;
264
265static int hf_afp_creation_date;
266static int hf_afp_modification_date;
267static int hf_afp_backup_date;
268static int hf_afp_finder_info;
269static int hf_afp_long_name_offset;
270static int hf_afp_prodos_info;
271static int hf_afp_prodos_type;
272static int hf_afp_prodos_auxtype;
273static int hf_afp_short_name_offset;
274static int hf_afp_unicode_name_offset;
275static int hf_afp_unix_privs_uid;
276static int hf_afp_unix_privs_gid;
277static int hf_afp_unix_privs_permissions;
278static int hf_afp_unix_privs_ua_permissions;
279
280static int hf_afp_path_type;
281static int hf_afp_path_len;
282static int hf_afp_path_name;
283static int hf_afp_path_unicode_hint;
284static int hf_afp_path_unicode_len;
285
286static int hf_afp_flag;
287static int hf_afp_dt_ref;
288static int hf_afp_ofork;
289static int hf_afp_ofork_len;
290static int hf_afp_offset;
291static int hf_afp_rw_count;
292static int hf_afp_newline_mask;
293static int hf_afp_newline_char;
294static int hf_afp_last_written;
295
296static int hf_afp_fork_type;
297static int hf_afp_access_mode;
298static int hf_afp_access_read;
299static int hf_afp_access_write;
300static int hf_afp_access_deny_read;
301static int hf_afp_access_deny_write;
302
303static int hf_afp_lock_op;
304static int hf_afp_lock_from;
305static int hf_afp_lock_offset;
306static int hf_afp_lock_len;
307static int hf_afp_lock_range_start;
308
309static int ett_afp;
310
311static int ett_afp_vol_attribute;
312static int ett_afp_enumerate;
313static int ett_afp_enumerate_line;
314static int ett_afp_access_mode;
315
316static int ett_afp_vol_bitmap;
317static int ett_afp_dir_bitmap;
318static int ett_afp_dir_attribute;
319static int ett_afp_file_attribute;
320static int ett_afp_file_bitmap;
321static int ett_afp_unix_privs;
322static int ett_afp_path_name;
323static int ett_afp_lock_flags;
324static int ett_afp_dir_ar;
325static int ett_afp_prodos_info;
326
327static int ett_afp_server_vol;
328static int ett_afp_vol_list;
329static int ett_afp_vol_flag;
330static int ett_afp_cat_search;
331static int ett_afp_cat_r_bitmap;
332static int ett_afp_cat_spec;
333static int ett_afp_vol_did;
334
335/* AFP 3.0 parameters */
336static int hf_afp_lock_offset64;
337static int hf_afp_lock_len64;
338static int hf_afp_lock_range_start64;
339
340static int hf_afp_offset64;
341static int hf_afp_rw_count64;
342static int hf_afp_reqcount64;
343
344static int hf_afp_last_written64;
345
346static int hf_afp_ofork_len64;
347static int hf_afp_session_token_type;
348static int hf_afp_session_token_len;
349static int hf_afp_session_token;
350static int hf_afp_session_token_timestamp;
351
352/* AFP 3.2 */
353
354static int hf_afp_extattr_bitmap;
355static int hf_afp_extattr_bitmap_NoFollow;
356static int hf_afp_extattr_bitmap_Create;
357static int hf_afp_extattr_bitmap_Replace;
358static int ett_afp_extattr_bitmap;
359static int hf_afp_extattr_namelen;
360static int hf_afp_extattr_name;
361static int hf_afp_extattr_len;
362static int hf_afp_extattr_data;
363static int hf_afp_extattr_req_count;
364static int hf_afp_extattr_start_index;
365static int hf_afp_extattr_reply_size;
366static int ett_afp_extattr_names;
367
368static expert_field ei_afp_subquery_count_over_safety_limit;
369static expert_field ei_afp_subquery_count_over_query_count;
370static expert_field ei_afp_abnormal_num_subqueries;
371static expert_field ei_afp_too_many_acl_entries;
372static expert_field ei_afp_ip_port_reused;
373static expert_field ei_afp_toc_offset;
374
375
376static int afp_tap;
377
378static dissector_handle_t spotlight_handle;
379
380static const value_string vol_signature_vals[] = {
381 {1, "Flat"},
382 {2, "Fixed Directory ID"},
383 {3, "Variable Directory ID (deprecated)"},
384 {0, NULL((void*)0) }
385};
386
387static const value_string CommandCode_vals[] = {
388 {AFP_BYTELOCK1, "FPByteRangeLock" },
389 {AFP_CLOSEVOL2, "FPCloseVol" },
390 {AFP_CLOSEDIR3, "FPCloseDir" },
391 {AFP_CLOSEFORK4, "FPCloseFork" },
392 {AFP_COPYFILE5, "FPCopyFile" },
393 {AFP_CREATEDIR6, "FPCreateDir" },
394 {AFP_CREATEFILE7, "FPCreateFile" },
395 {AFP_DELETE8, "FPDelete" },
396 {AFP_ENUMERATE9, "FPEnumerate" },
397 {AFP_FLUSH10, "FPFlush" },
398 {AFP_FLUSHFORK11, "FPFlushFork" },
399 {AFP_GETFORKPARAM14, "FPGetForkParms" },
400 {AFP_GETSRVINFO15, "FPGetSrvrInfo" },
401 {AFP_GETSRVPARAM16, "FPGetSrvrParms" },
402 {AFP_GETVOLPARAM17, "FPGetVolParms" },
403 {AFP_LOGIN18, "FPLogin" },
404 {AFP_LOGINCONT19, "FPLoginCont" },
405 {AFP_LOGOUT20, "FPLogout" },
406 {AFP_MAPID21, "FPMapID" },
407 {AFP_MAPNAME22, "FPMapName" },
408 {AFP_MOVE23, "FPMoveAndRename" },
409 {AFP_OPENVOL24, "FPOpenVol" },
410 {AFP_OPENDIR25, "FPOpenDir" },
411 {AFP_OPENFORK26, "FPOpenFork" },
412 {AFP_READ27, "FPRead" },
413 {AFP_RENAME28, "FPRename" },
414 {AFP_SETDIRPARAM29, "FPSetDirParms" },
415 {AFP_SETFILEPARAM30, "FPSetFileParms" },
416 {AFP_SETFORKPARAM31, "FPSetForkParms" },
417 {AFP_SETVOLPARAM32, "FPSetVolParms" },
418 {AFP_WRITE33, "FPWrite" },
419 {AFP_GETFLDRPARAM34, "FPGetFileDirParms" },
420 {AFP_SETFLDRPARAM35, "FPSetFileDirParms" },
421 {AFP_CHANGEPW36, "FPChangePassword" },
422 {AFP_GETUSERINFO37, "FPGetUserInfo" },
423 {AFP_GETSRVRMSG38, "FPGetSrvrMsg" },
424 {AFP_CREATEID39, "FPCreateID" },
425 {AFP_DELETEID40, "FPDeleteID" },
426 {AFP_RESOLVEID41, "FPResolveID" },
427 {AFP_EXCHANGEFILE42, "FPExchangeFiles" },
428 {AFP_CATSEARCH43, "FPCatSearch" },
429 {AFP_OPENDT48, "FPOpenDT" },
430 {AFP_CLOSEDT49, "FPCloseDT" },
431 {AFP_GETICON51, "FPGetIcon" },
432 {AFP_GTICNINFO52, "FPGetIconInfo" },
433 {AFP_ADDAPPL53, "FPAddAPPL" },
434 {AFP_RMVAPPL54, "FPRemoveAPPL" },
435 {AFP_GETAPPL55, "FPGetAPPL" },
436 {AFP_ADDCMT56, "FPAddComment" },
437 {AFP_RMVCMT57, "FPRemoveComment" },
438 {AFP_GETCMT58, "FPGetComment" },
439 {AFP_BYTELOCK_EXT59, "FPByteRangeLockExt" },
440 {AFP_READ_EXT60, "FPReadExt" },
441 {AFP_WRITE_EXT61, "FPWriteExt" },
442 {AFP_LOGIN_EXT63, "FPLoginExt" },
443 {AFP_GETSESSTOKEN64, "FPGetSessionToken" },
444 {AFP_DISCTOLDSESS65, "FPDisconnectOldSession" },
445 {AFP_ENUMERATE_EXT66, "FPEnumerateExt" },
446 {AFP_CATSEARCH_EXT67, "FPCatSearchExt" },
447 {AFP_ENUMERATE_EXT268, "FPEnumerateExt2" },
448 {AFP_GETEXTATTR69, "FPGetExtAttr" },
449 {AFP_SETEXTATTR70, "FPSetExtAttr" },
450 {AFP_REMOVEATTR71, "FPRemoveExtAttr" },
451 {AFP_LISTEXTATTR72, "FPListExtAttrs" },
452 {AFP_GETACL73, "FPGetACL" },
453 {AFP_SETACL74, "FPSetACL" },
454 {AFP_ACCESS75, "FPAccess" },
455 {AFP_SPOTLIGHTRPC76, "FPSpotlightRPC" },
456 {AFP_SYNCDIR78, "FPSyncDir" },
457 {AFP_SYNCFORK79, "FPSyncFork" },
458 {AFP_ZZZ122, "FPZzzzz" },
459 {AFP_ADDICON192, "FPAddIcon" },
460 {0, NULL((void*)0) }
461};
462static value_string_ext CommandCode_vals_ext = VALUE_STRING_EXT_INIT(CommandCode_vals){ _try_val_to_str_ext_init, 0, (sizeof (CommandCode_vals) / sizeof
((CommandCode_vals)[0]))-1, CommandCode_vals, "CommandCode_vals"
, ((void*)0) }
;
463
464static const value_string unicode_hint_vals[] = {
465 { 0, "MacRoman" },
466 { 1, "MacJapanese" },
467 { 2, "MacChineseTrad" },
468 { 3, "MacKorean" },
469 { 4, "MacArabic" },
470 { 5, "MacHebrew" },
471 { 6, "MacGreek" },
472 { 7, "MacCyrillic" },
473 { 9, "MacDevanagari" },
474 { 10, "MacGurmukhi" },
475 { 11, "MacGujarati" },
476 { 12, "MacOriya" },
477 { 13, "MacBengali" },
478 { 14, "MacTamil" },
479 { 15, "MacTelugu" },
480 { 16, "MacKannada" },
481 { 17, "MacMalayalam" },
482 { 18, "MacSinhalese" },
483 { 19, "MacBurmese" },
484 { 20, "MacKhmer" },
485 { 21, "MacThai" },
486 { 22, "MacLaotian" },
487 { 23, "MacGeorgian" },
488 { 24, "MacArmenian" },
489 { 25, "MacChineseSimp" },
490 { 26, "MacTibetan" },
491 { 27, "MacMongolian" },
492 { 28, "MacEthiopic" },
493 { 29, "MacCentralEurRoman" },
494 { 30, "MacVietnamese" },
495 { 31, "MacExtArabic" },
496 { 33, "MacSymbol" },
497 { 34, "MacDingbats" },
498 { 35, "MacTurkish" },
499 { 36, "MacCroatian" },
500 { 37, "MacIcelandic" },
501 { 38, "MacRomanian" },
502 { 39, "MacCeltic" },
503 { 40, "MacGaelic" },
504 { 41, "MacKeyboardGlyphs" },
505 { 126, "MacUnicode" },
506 { 140, "MacFarsi" },
507 { 152, "MacUkrainian" },
508 { 236, "MacInuit" },
509 { 252, "MacVT100" },
510 { 255, "MacHFS" },
511 { 256, "UnicodeDefault" },
512/* ?? { 257, "UnicodeV1_1" }, */
513 { 257, "ISO10646_1993" },
514 { 259, "UnicodeV2_0" },
515/* ?? { 259, "UnicodeV2_1" }, */
516 { 260, "UnicodeV3_0" },
517 { 513, "ISOLatin1" },
518 { 514, "ISOLatin2" },
519 { 515, "ISOLatin3" },
520 { 516, "ISOLatin4" },
521 { 517, "ISOLatinCyrillic" },
522 { 518, "ISOLatinArabic" },
523 { 519, "ISOLatinGreek" },
524 { 520, "ISOLatinHebrew" },
525 { 521, "ISOLatin5" },
526 { 522, "ISOLatin6" },
527 { 525, "ISOLatin7" },
528 { 526, "ISOLatin8" },
529 { 527, "ISOLatin9" },
530 { 1024, "DOSLatinUS" },
531 { 1029, "DOSGreek" },
532 { 1030, "DOSBalticRim" },
533 { 1040, "DOSLatin1" },
534 { 1041, "DOSGreek1" },
535 { 1042, "DOSLatin2" },
536 { 1043, "DOSCyrillic" },
537 { 1044, "DOSTurkish" },
538 { 1045, "DOSPortuguese" },
539 { 1046, "DOSIcelandic" },
540 { 1047, "DOSHebrew" },
541 { 1048, "DOSCanadianFrench" },
542 { 1049, "DOSArabic" },
543 { 1050, "DOSNordic" },
544 { 1051, "DOSRussian" },
545 { 1052, "DOSGreek2" },
546 { 1053, "DOSThai" },
547 { 1056, "DOSJapanese" },
548 { 1057, "DOSChineseSimplif" },
549 { 1058, "DOSKorean" },
550 { 1059, "DOSChineseTrad" },
551 { 1280, "WindowsLatin1" },
552/* { 1280, "WindowsANSI" }, */
553 { 1281, "WindowsLatin2" },
554 { 1282, "WindowsCyrillic" },
555 { 1283, "WindowsGreek" },
556 { 1284, "WindowsLatin5" },
557 { 1285, "WindowsHebrew" },
558 { 1286, "WindowsArabic" },
559 { 1287, "WindowsBalticRim" },
560 { 1288, "WindowsVietnamese" },
561 { 1296, "WindowsKoreanJohab" },
562 { 1536, "US_ASCII" },
563 { 1568, "JIS_X0201_76" },
564 { 1569, "JIS_X0208_83" },
565 { 1570, "JIS_X0208_90" },
566 { 0, NULL((void*)0) }
567};
568static value_string_ext unicode_hint_vals_ext = VALUE_STRING_EXT_INIT(unicode_hint_vals){ _try_val_to_str_ext_init, 0, (sizeof (unicode_hint_vals) / sizeof
((unicode_hint_vals)[0]))-1, unicode_hint_vals, "unicode_hint_vals"
, ((void*)0) }
;
569
570/* volume bitmap
571 from Apple AFP3.0.pdf
572 Table 1-2 p. 20
573*/
574#define kFPVolAttributeBit(1U << 0) (1U << 0)
575#define kFPVolSignatureBit(1U << 1) (1U << 1)
576#define kFPVolCreateDateBit(1U << 2) (1U << 2)
577#define kFPVolModDateBit(1U << 3) (1U << 3)
578#define kFPVolBackupDateBit(1U << 4) (1U << 4)
579#define kFPVolIDBit(1U << 5) (1U << 5)
580#define kFPVolBytesFreeBit(1U << 6) (1U << 6)
581#define kFPVolBytesTotalBit(1U << 7) (1U << 7)
582#define kFPVolNameBit(1U << 8) (1U << 8)
583#define kFPVolExtBytesFreeBit(1U << 9) (1U << 9)
584#define kFPVolExtBytesTotalBit(1U << 10) (1U << 10)
585#define kFPVolBlockSizeBit(1U << 11) (1U << 11)
586
587static int hf_afp_vol_bitmap_Attributes;
588static int hf_afp_vol_bitmap_Signature;
589static int hf_afp_vol_bitmap_CreateDate;
590static int hf_afp_vol_bitmap_ModDate;
591static int hf_afp_vol_bitmap_BackupDate;
592static int hf_afp_vol_bitmap_ID;
593static int hf_afp_vol_bitmap_BytesFree;
594static int hf_afp_vol_bitmap_BytesTotal;
595static int hf_afp_vol_bitmap_Name;
596static int hf_afp_vol_bitmap_ExtBytesFree;
597static int hf_afp_vol_bitmap_ExtBytesTotal;
598static int hf_afp_vol_bitmap_BlockSize;
599
600static int hf_afp_vol_attribute_ReadOnly;
601static int hf_afp_vol_attribute_HasVolumePassword;
602static int hf_afp_vol_attribute_SupportsFileIDs;
603static int hf_afp_vol_attribute_SupportsCatSearch;
604static int hf_afp_vol_attribute_SupportsBlankAccessPrivs;
605static int hf_afp_vol_attribute_SupportsUnixPrivs;
606static int hf_afp_vol_attribute_SupportsUTF8Names;
607static int hf_afp_vol_attribute_NoNetworkUserID;
608static int hf_afp_vol_attribute_DefaultPrivsFromParent;
609static int hf_afp_vol_attribute_NoExchangeFiles;
610static int hf_afp_vol_attribute_SupportsExtAttrs;
611static int hf_afp_vol_attribute_SupportsACLs;
612static int hf_afp_vol_attribute_CaseSensitive;
613static int hf_afp_vol_attribute_SupportsTMLockSteal;
614
615static int hf_afp_dir_bitmap_Attributes;
616static int hf_afp_dir_bitmap_ParentDirID;
617static int hf_afp_dir_bitmap_CreateDate;
618static int hf_afp_dir_bitmap_ModDate;
619static int hf_afp_dir_bitmap_BackupDate;
620static int hf_afp_dir_bitmap_FinderInfo;
621static int hf_afp_dir_bitmap_LongName;
622static int hf_afp_dir_bitmap_ShortName;
623static int hf_afp_dir_bitmap_NodeID;
624static int hf_afp_dir_bitmap_OffspringCount;
625static int hf_afp_dir_bitmap_OwnerID;
626static int hf_afp_dir_bitmap_GroupID;
627static int hf_afp_dir_bitmap_AccessRights;
628static int hf_afp_dir_bitmap_UTF8Name;
629static int hf_afp_dir_bitmap_UnixPrivs;
630
631static int hf_afp_dir_attribute;
632static int hf_afp_dir_attribute_Invisible;
633static int hf_afp_dir_attribute_IsExpFolder;
634static int hf_afp_dir_attribute_System;
635static int hf_afp_dir_attribute_Mounted;
636static int hf_afp_dir_attribute_InExpFolder;
637static int hf_afp_dir_attribute_BackUpNeeded;
638static int hf_afp_dir_attribute_RenameInhibit;
639static int hf_afp_dir_attribute_DeleteInhibit;
640
641static int hf_afp_file_bitmap;
642static int hf_afp_file_bitmap_Attributes;
643static int hf_afp_file_bitmap_ParentDirID;
644static int hf_afp_file_bitmap_CreateDate;
645static int hf_afp_file_bitmap_ModDate;
646static int hf_afp_file_bitmap_BackupDate;
647static int hf_afp_file_bitmap_FinderInfo;
648static int hf_afp_file_bitmap_LongName;
649static int hf_afp_file_bitmap_ShortName;
650static int hf_afp_file_bitmap_NodeID;
651static int hf_afp_file_bitmap_DataForkLen;
652static int hf_afp_file_bitmap_RsrcForkLen;
653static int hf_afp_file_bitmap_ExtDataForkLen;
654static int hf_afp_file_bitmap_LaunchLimit;
655
656static int hf_afp_file_bitmap_UTF8Name;
657static int hf_afp_file_bitmap_ExtRsrcForkLen;
658static int hf_afp_file_bitmap_UnixPrivs;
659
660static int hf_afp_file_attribute;
661static int hf_afp_file_attribute_Invisible;
662static int hf_afp_file_attribute_MultiUser;
663static int hf_afp_file_attribute_System;
664static int hf_afp_file_attribute_DAlreadyOpen;
665static int hf_afp_file_attribute_RAlreadyOpen;
666static int hf_afp_file_attribute_WriteInhibit;
667static int hf_afp_file_attribute_BackUpNeeded;
668static int hf_afp_file_attribute_RenameInhibit;
669static int hf_afp_file_attribute_DeleteInhibit;
670static int hf_afp_file_attribute_CopyProtect;
671static int hf_afp_file_attribute_SetClear;
672
673static int hf_afp_map_name_type;
674static int hf_afp_map_name;
675static int hf_afp_map_id;
676static int hf_afp_map_id_type;
677static int hf_afp_map_id_reply_type;
678
679/* catsearch stuff */
680static int hf_afp_request_bitmap;
681static int hf_afp_request_bitmap_Attributes;
682static int hf_afp_request_bitmap_ParentDirID;
683static int hf_afp_request_bitmap_CreateDate;
684static int hf_afp_request_bitmap_ModDate;
685static int hf_afp_request_bitmap_BackupDate;
686static int hf_afp_request_bitmap_FinderInfo;
687static int hf_afp_request_bitmap_LongName;
688static int hf_afp_request_bitmap_DataForkLen;
689static int hf_afp_request_bitmap_OffspringCount;
690static int hf_afp_request_bitmap_RsrcForkLen;
691static int hf_afp_request_bitmap_ExtDataForkLen;
692static int hf_afp_request_bitmap_UTF8Name;
693static int hf_afp_request_bitmap_ExtRsrcForkLen;
694static int hf_afp_request_bitmap_PartialNames;
695
696/* Spotlight stuff */
697static int ett_afp_spotlight_queries;
698static int ett_afp_spotlight_query_line;
699static int ett_afp_spotlight_query;
700static int ett_afp_spotlight_data;
701static int ett_afp_spotlight_toc;
702
703static int hf_afp_spotlight_request_flags;
704static int hf_afp_spotlight_request_command;
705static int hf_afp_spotlight_request_reserved;
706static int hf_afp_spotlight_reply_reserved;
707static int hf_afp_spotlight_volpath_server;
708static int hf_afp_spotlight_volpath_client;
709static int hf_afp_spotlight_returncode;
710static int hf_afp_spotlight_volflags;
711static int hf_afp_spotlight_reqlen;
712static int hf_afp_spotlight_uuid;
713static int hf_afp_spotlight_date;
714
715/* Status stuff from ASP or DSI */
716static int ett_afp_status;
717static int ett_afp_uams;
718static int ett_afp_vers;
719static int ett_afp_server_addr;
720static int ett_afp_server_addr_line;
721static int ett_afp_directory;
722static int ett_afp_utf8_name;
723static int ett_afp_status_server_flag;
724
725static const value_string flag_vals[] = {
726 {0, "Start" },
727 {1, "End" },
728 {0, NULL((void*)0) } };
729
730static const value_string path_type_vals[] = {
731 {1, "Short names" },
732 {2, "Long names" },
733 {3, "Unicode names" },
734 {0, NULL((void*)0) } };
735
736static const value_string map_name_type_vals[] = {
737 {1, "Unicode user name to a user ID" },
738 {2, "Unicode group name to a group ID" },
739 {3, "Macintosh roman user name to a user ID" },
740 {4, "Macintosh roman group name to a group ID" },
741 {5, "Unicode user name to a user UUID" },
742 {6, "Unicode group name to a group UUID" },
743 {0, NULL((void*)0) } };
744static value_string_ext map_name_type_vals_ext = VALUE_STRING_EXT_INIT(map_name_type_vals){ _try_val_to_str_ext_init, 0, (sizeof (map_name_type_vals) /
sizeof ((map_name_type_vals)[0]))-1, map_name_type_vals, "map_name_type_vals"
, ((void*)0) }
;
745
746static const value_string map_id_type_vals[] = {
747 {1, "User ID to a Macintosh roman user name" },
748 {2, "Group ID to a Macintosh roman group name" },
749 {3, "User ID to a unicode user name" },
750 {4, "Group ID to a unicode group name" },
751 {5, "User UUID to a unicode user name" },
752 {6, "Group UUID to a unicode group name" },
753 {0, NULL((void*)0) } };
754static value_string_ext map_id_type_vals_ext = VALUE_STRING_EXT_INIT(map_id_type_vals){ _try_val_to_str_ext_init, 0, (sizeof (map_id_type_vals) / sizeof
((map_id_type_vals)[0]))-1, map_id_type_vals, "map_id_type_vals"
, ((void*)0) }
;
755
756/* map_id subfunctions 5,6: reply type */
757static const value_string map_id_reply_type_vals[] = {
758 {1, "user name" },
759 {2, "group name" },
760 {0, NULL((void*)0) } };
761
762/*
763 volume attribute from Apple AFP3.0.pdf
764 Table 1-3 p. 22
765*/
766#define kReadOnly(1U << 0) (1U << 0)
767#define kHasVolumePassword(1U << 1) (1U << 1)
768#define kSupportsFileIDs(1U << 2) (1U << 2)
769#define kSupportsCatSearch(1U << 3) (1U << 3)
770#define kSupportsBlankAccessPrivs(1U << 4) (1U << 4)
771#define kSupportsUnixPrivs(1U << 5) (1U << 5)
772#define kSupportsUTF8Names(1U << 6) (1U << 6)
773/* AFP3.1 */
774#define kNoNetworkUserIDs(1U << 7) (1U << 7)
775/* AFP3.2 */
776#define kDefaultPrivsFromParent(1U << 8) (1U << 8)
777#define kNoExchangeFiles(1U << 9) (1U << 9)
778#define kSupportsExtAttrs(1U << 10) (1U << 10)
779#define kSupportsACLs(1U << 11) (1U << 11)
780/* AFP3.2+ */
781#define kCaseSensitive(1U << 12) (1U << 12)
782#define kSupportsTMLockSteal(1U << 13) (1U << 13)
783
784/*
785 directory bitmap from Apple AFP3.1.pdf
786 Table 1-5 pp. 25-26
787*/
788#define kFPAttributeBit(1U << 0) (1U << 0)
789#define kFPParentDirIDBit(1U << 1) (1U << 1)
790#define kFPCreateDateBit(1U << 2) (1U << 2)
791#define kFPModDateBit(1U << 3) (1U << 3)
792#define kFPBackupDateBit(1U << 4) (1U << 4)
793#define kFPFinderInfoBit(1U << 5) (1U << 5)
794#define kFPLongNameBit(1U << 6) (1U << 6)
795#define kFPShortNameBit(1U << 7) (1U << 7)
796#define kFPNodeIDBit(1U << 8) (1U << 8)
797#define kFPOffspringCountBit(1U << 9) (1U << 9)
798#define kFPOwnerIDBit(1U << 10) (1U << 10)
799#define kFPGroupIDBit(1U << 11) (1U << 11)
800#define kFPAccessRightsBit(1U << 12) (1U << 12)
801#define kFPUTF8NameBit(1U << 13) (1U << 13)
802
803/* FIXME AFP3.0 bit 14, AFP3.1 bit 15 */
804
805#define kFPUnixPrivsBit(1U << 15) (1U << 15)
806
807/*
808 directory Access Rights parameter AFP3.1.pdf
809 table 1-7 p. 28
810*/
811
812#define AR_O_SEARCH(1U << 0) (1U << 0) /* owner has search access */
813#define AR_O_READ(1U << 1) (1U << 1) /* owner has read access */
814#define AR_O_WRITE(1U << 2) (1U << 2) /* owner has write access */
815
816#define AR_G_SEARCH(1U << 8) (1U << 8) /* group has search access */
817#define AR_G_READ(1U << 9) (1U << 9) /* group has read access */
818#define AR_G_WRITE(1U << 10) (1U << 10) /* group has write access */
819
820#define AR_E_SEARCH(1U << 16) (1U << 16) /* everyone has search access */
821#define AR_E_READ(1U << 17) (1U << 17) /* everyone has read access */
822#define AR_E_WRITE(1U << 18) (1U << 18) /* everyone has write access */
823
824#define AR_U_SEARCH(1U << 24) (1U << 24) /* user has search access */
825#define AR_U_READ(1U << 25) (1U << 25) /* user has read access */
826#define AR_U_WRITE(1U << 26) (1U << 26) /* user has write access */
827
828#define AR_BLANK(1U << 28) (1U << 28) /* Blank Access Privileges (use parent dir privileges) */
829#define AR_U_OWN(1U << 31) (1U << 31) /* user is the owner */
830
831static int hf_afp_dir_ar;
832static int hf_afp_dir_ar_o_search;
833static int hf_afp_dir_ar_o_read;
834static int hf_afp_dir_ar_o_write;
835static int hf_afp_dir_ar_g_search;
836static int hf_afp_dir_ar_g_read;
837static int hf_afp_dir_ar_g_write;
838static int hf_afp_dir_ar_e_search;
839static int hf_afp_dir_ar_e_read;
840static int hf_afp_dir_ar_e_write;
841static int hf_afp_dir_ar_u_search;
842static int hf_afp_dir_ar_u_read;
843static int hf_afp_dir_ar_u_write;
844static int hf_afp_dir_ar_blank;
845static int hf_afp_dir_ar_u_own;
846
847static int hf_afp_user_flag;
848static int hf_afp_user_ID;
849static int hf_afp_group_ID;
850static int hf_afp_UUID;
851static int hf_afp_GRPUUID;
852static int hf_afp_user_bitmap;
853static int hf_afp_user_bitmap_UID;
854static int hf_afp_user_bitmap_GID;
855static int hf_afp_user_bitmap_UUID;
856
857static int ett_afp_user_bitmap;
858
859static const value_string user_flag_vals[] = {
860 {0, "Use user ID" },
861 {1, "Default user" },
862 {0, NULL((void*)0) } };
863
864static int hf_afp_message;
865static int hf_afp_message_type;
866static int hf_afp_message_bitmap;
867static int hf_afp_message_bitmap_REQ;
868static int hf_afp_message_bitmap_UTF;
869static int hf_afp_message_len;
870
871static int ett_afp_message_bitmap;
872
873static const value_string server_message_type[] = {
874 {0, "Login message" },
875 {1, "Server message" },
876 {0, NULL((void*)0) } };
877
878/*
879 file bitmap AFP3.1.pdf
880 Table 1-8 p. 29
881same as dir
882kFPAttributeBit (bit 0)
883kFPParentDirIDBit (bit 1)
884kFPCreateDateBit (bit 2)
885kFPModDateBit (bit 3)
886kFPBackupDateBit (bit 4)
887kFPFinderInfoBit (bit 5)
888kFPLongNameBit (bit 6)
889kFPShortNameBit (bit 7)
890kFPNodeIDBit (bit 8)
891
892kFPUTF8NameBit (bit 13)
893*/
894
895#define kFPDataForkLenBit(1U << 9) (1U << 9)
896#define kFPRsrcForkLenBit(1U << 10) (1U << 10)
897#define kFPExtDataForkLenBit(1U << 11) (1U << 11)
898#define kFPLaunchLimitBit(1U << 12) (1U << 12)
899
900#define kFPExtRsrcForkLenBit(1U << 14) (1U << 14)
901
902/*
903 file attribute AFP3.1.pdf
904 Table 1-9 pp. 29-31
905*/
906#define kFPInvisibleBit(1U << 0) (1U << 0)
907#define kFPMultiUserBit(1U << 1) (1U << 1)
908#define kFPSystemBit(1U << 2) (1U << 2)
909#define kFPDAlreadyOpenBit(1U << 3) (1U << 3)
910#define kFPRAlreadyOpenBit(1U << 4) (1U << 4)
911#define kFPWriteInhibitBit(1U << 5) (1U << 5)
912#define kFPBackUpNeededBit(1U << 6) (1U << 6)
913#define kFPRenameInhibitBit(1U << 7) (1U << 7)
914#define kFPDeleteInhibitBit(1U << 8) (1U << 8)
915#define kFPCopyProtectBit(1U << 10) (1U << 10)
916#define kFPSetClearBit(1U << 15) (1U << 15)
917
918/* dir attribute */
919#define kIsExpFolder(1U << 1) (1U << 1)
920#define kMounted(1U << 3) (1U << 3)
921#define kInExpFolder(1U << 4) (1U << 4)
922
923/* AFP 3.1 getsession token type */
924#define kLoginWithoutID0 0
925#define kLoginWithID1 1
926#define kReconnWithID2 2
927#define kLoginWithTimeAndID3 3
928#define kReconnWithTimeAndID4 4
929
930/* modified AFP 3.1 token type cf. page 327 */
931#define kRecon1Login5 5
932#define kRecon1ReconnectLogin6 6
933#define kRecon1Refresh7 7
934#define kGetKerberosSessionKey8 8
935
936static const value_string token_type_vals[] = {
937 {kLoginWithoutID0, "LoginWithoutID"},
938 {kLoginWithID1, "LoginWithID"},
939 {kReconnWithID2, "ReconnWithID"},
940 {kLoginWithTimeAndID3, "LoginWithTimeAndID"},
941 {kReconnWithTimeAndID4, "ReconnWithTimeAndID"},
942 {kRecon1Login5, "Recon1Login"},
943 {kRecon1ReconnectLogin6, "Recon1ReconnectLogin"},
944 {kRecon1Refresh7, "Recon1Refresh"},
945 {kGetKerberosSessionKey8, "GetKerberosSessionKey"},
946
947 {0, NULL((void*)0) } };
948static value_string_ext token_type_vals_ext = VALUE_STRING_EXT_INIT(token_type_vals){ _try_val_to_str_ext_init, 0, (sizeof (token_type_vals) / sizeof
((token_type_vals)[0]))-1, token_type_vals, "token_type_vals"
, ((void*)0) }
;
949
950/* AFP 3.2 ACL bitmap */
951#define kFileSec_UUID(1U << 0) (1U << 0)
952#define kFileSec_GRPUUID(1U << 1) (1U << 1)
953#define kFileSec_ACL(1U << 2) (1U << 2)
954#define kFileSec_REMOVEACL(1U << 3) (1U << 3)
955#define kFileSec_Inherit(1U << 4) (1U << 4)
956
957static int hf_afp_acl_list_bitmap;
958static int hf_afp_acl_list_bitmap_UUID;
959static int hf_afp_acl_list_bitmap_GRPUUID;
960static int hf_afp_acl_list_bitmap_ACL;
961static int hf_afp_acl_list_bitmap_REMOVEACL;
962static int hf_afp_acl_list_bitmap_Inherit;
963static int ett_afp_acl_list_bitmap;
964
965static int hf_afp_access_bitmap;
966
967static int hf_afp_acl_entrycount;
968static int hf_afp_acl_flags;
969
970static int hf_afp_ace_flags;
971
972static int ett_afp_ace_flags;
973static int hf_afp_ace_flags_allow;
974static int hf_afp_ace_flags_deny;
975static int hf_afp_ace_flags_inherited;
976static int hf_afp_ace_flags_fileinherit;
977static int hf_afp_ace_flags_dirinherit;
978static int hf_afp_ace_flags_limitinherit;
979static int hf_afp_ace_flags_onlyinherit;
980
981/* AFP 3.2 ACE flags */
982#define ACE_ALLOW(1U << 0) (1U << 0)
983#define ACE_DENY(1U << 1) (1U << 1)
984#define ACE_INHERITED(1U << 4) (1U << 4)
985#define ACE_FILE_INHERIT(1U << 5) (1U << 5)
986#define ACE_DIR_INHERIT(1U << 6) (1U << 6)
987#define ACE_LIMIT_INHERIT(1U << 7) (1U << 7)
988#define ACE_ONLY_INHERIT(1U << 8) (1U << 8)
989
990static int ett_afp_ace_entries;
991static int ett_afp_ace_entry;
992
993/* AFP 3.2 ACL access right cf page 248*/
994#define KAUTH_VNODE_READ_DATA(1U << 1) (1U << 1)
995#define KAUTH_VNODE_LIST_DIRECTORY(1U << 1) KAUTH_VNODE_READ_DATA(1U << 1)
996#define KAUTH_VNODE_WRITE_DATA(1U << 2) (1U << 2)
997#define KAUTH_VNODE_ADD_FILE(1U << 2) KAUTH_VNODE_WRITE_DATA(1U << 2)
998#define KAUTH_VNODE_EXECUTE(1U << 3) (1U << 3)
999#define KAUTH_VNODE_SEARCH(1U << 3) KAUTH_VNODE_EXECUTE(1U << 3)
1000#define KAUTH_VNODE_DELETE(1U << 4) (1U << 4)
1001#define KAUTH_VNODE_APPEND_DATA(1U << 5) (1U << 5)
1002#define KAUTH_VNODE_ADD_SUBDIRECTORY(1U << 5) KAUTH_VNODE_APPEND_DATA(1U << 5)
1003#define KAUTH_VNODE_DELETE_CHILD(1U << 6) (1U << 6)
1004#define KAUTH_VNODE_READ_ATTRIBUTES(1U << 7) (1U << 7)
1005#define KAUTH_VNODE_WRITE_ATTRIBUTES(1U << 8) (1U << 8)
1006#define KAUTH_VNODE_READ_EXTATTRIBUTES(1U << 9) (1U << 9)
1007#define KAUTH_VNODE_WRITE_EXTATTRIBUTES(1U << 10) (1U << 10)
1008#define KAUTH_VNODE_READ_SECURITY(1U << 11) (1U << 11)
1009#define KAUTH_VNODE_WRITE_SECURITY(1U << 12) (1U << 12)
1010#define KAUTH_VNODE_CHANGE_OWNER(1U << 13) (1U << 13)
1011#define KAUTH_VNODE_SYNCHRONIZE(1U << 20) (1U << 20)
1012#define KAUTH_VNODE_GENERIC_ALL(1U << 21) (1U << 21)
1013#define KAUTH_VNODE_GENERIC_EXECUTE(1U << 22) (1U << 22)
1014#define KAUTH_VNODE_GENERIC_WRITE(1U << 23) (1U << 23)
1015#define KAUTH_VNODE_GENERIC_READ(1U << 24) (1U << 24)
1016
1017
1018static int hf_afp_acl_access_bitmap;
1019static int ett_afp_acl_access_bitmap;
1020static int hf_afp_acl_access_bitmap_read_data;
1021static int hf_afp_acl_access_bitmap_write_data;
1022static int hf_afp_acl_access_bitmap_execute;
1023static int hf_afp_acl_access_bitmap_delete;
1024static int hf_afp_acl_access_bitmap_append_data;
1025static int hf_afp_acl_access_bitmap_delete_child;
1026static int hf_afp_acl_access_bitmap_read_attrs;
1027static int hf_afp_acl_access_bitmap_write_attrs;
1028static int hf_afp_acl_access_bitmap_read_extattrs;
1029static int hf_afp_acl_access_bitmap_write_extattrs;
1030static int hf_afp_acl_access_bitmap_read_security;
1031static int hf_afp_acl_access_bitmap_write_security;
1032static int hf_afp_acl_access_bitmap_change_owner;
1033static int hf_afp_acl_access_bitmap_synchronize;
1034static int hf_afp_acl_access_bitmap_generic_all;
1035static int hf_afp_acl_access_bitmap_generic_execute;
1036static int hf_afp_acl_access_bitmap_generic_write;
1037static int hf_afp_acl_access_bitmap_generic_read;
1038
1039/* Status stuff from ASP or DSI */
1040static int hf_afp_server_name;
1041static int hf_afp_utf8_server_name_len;
1042static int hf_afp_utf8_server_name;
1043static int hf_afp_server_type;
1044static int hf_afp_server_vers;
1045static int hf_afp_server_uams;
1046static int hf_afp_server_icon;
1047static int hf_afp_server_directory;
1048
1049static int hf_afp_server_flag;
1050static int hf_afp_server_flag_copyfile;
1051static int hf_afp_server_flag_passwd;
1052static int hf_afp_server_flag_no_save_passwd;
1053static int hf_afp_server_flag_srv_msg;
1054static int hf_afp_server_flag_srv_sig;
1055static int hf_afp_server_flag_tcpip;
1056static int hf_afp_server_flag_notify;
1057static int hf_afp_server_flag_reconnect;
1058static int hf_afp_server_flag_directory;
1059static int hf_afp_server_flag_utf8_name;
1060static int hf_afp_server_flag_uuid;
1061static int hf_afp_server_flag_ext_sleep;
1062static int hf_afp_server_flag_fast_copy;
1063static int hf_afp_server_signature;
1064
1065static int hf_afp_server_addr_len;
1066static int hf_afp_server_addr_type;
1067static int hf_afp_server_addr_value;
1068
1069/* Generated from convert_proto_tree_add_text.pl */
1070static int hf_afp_int64;
1071static int hf_afp_float;
1072static int hf_afp_unknown16;
1073static int hf_afp_unknown32;
1074static int hf_afp_cnid;
1075static int hf_afp_null;
1076static int hf_afp_string;
1077static int hf_afp_utf_16_string;
1078static int hf_afp_bool;
1079static int hf_afp_query_type;
1080static int hf_afp_toc_offset;
1081static int hf_afp_toc_entry;
1082static int hf_afp_endianness;
1083static int hf_afp_query_len;
1084static int hf_afp_num_toc_entries;
1085static int hf_afp_machine_offset;
1086static int hf_afp_version_offset;
1087static int hf_afp_uams_offset;
1088static int hf_afp_icon_offset;
1089static int hf_afp_signature_offset;
1090static int hf_afp_network_address_offset;
1091static int hf_afp_directory_services_offset;
1092static int hf_afp_utf8_server_name_offset;
1093
1094static const value_string afp_server_addr_type_vals[] = {
1095 {1, "IP address" },
1096 {2, "IP+port address" },
1097 {3, "DDP address" },
1098 {4, "DNS name" },
1099 {5, "IP+port ssh tunnel" },
1100 {6, "IP6 address" },
1101 {7, "IP6+port address" },
1102 {0, NULL((void*)0) } };
1103static value_string_ext afp_server_addr_type_vals_ext = VALUE_STRING_EXT_INIT(afp_server_addr_type_vals){ _try_val_to_str_ext_init, 0, (sizeof (afp_server_addr_type_vals
) / sizeof ((afp_server_addr_type_vals)[0]))-1, afp_server_addr_type_vals
, "afp_server_addr_type_vals", ((void*)0) }
;
1104
1105#define AFP_NUM_PROCEDURES256 256
1106
1107static void
1108afpstat_init(struct register_srt* srt _U___attribute__((unused)), GArray* srt_array)
1109{
1110 srt_stat_table *afp_srt_table;
1111 uint32_t i;
1112
1113 afp_srt_table = init_srt_table("AFP Commands", NULL((void*)0), srt_array, AFP_NUM_PROCEDURES256, NULL((void*)0), "afp.command", NULL((void*)0));
1114 for (i = 0; i < AFP_NUM_PROCEDURES256; i++)
1115 {
1116 char* tmp_str = val_to_str_ext(NULL((void*)0), i, &CommandCode_vals_ext, "Unknown(%u)");
1117 init_srt_table_row(afp_srt_table, i, tmp_str);
1118 wmem_free(NULL((void*)0), tmp_str);
1119 }
1120}
1121
1122static tap_packet_status
1123afpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U___attribute__((unused)), const void *prv, tap_flags_t flags _U___attribute__((unused)))
1124{
1125 unsigned i = 0;
1126 srt_stat_table *afp_srt_table;
1127 srt_data_t *data = (srt_data_t *)pss;
1128 const afp_request_val *request_val = (const afp_request_val *)prv;
1129
1130 /* if we haven't seen the request, just ignore it */
1131 if (!request_val) {
1132 return TAP_PACKET_DONT_REDRAW;
1133 }
1134
1135 afp_srt_table = g_array_index(data->srt_array, srt_stat_table*, i)(((srt_stat_table**) (void *) (data->srt_array)->data) [
(i)])
;
1136
1137 add_srt_table_data(afp_srt_table, request_val->command, &request_val->req_time, pinfo);
1138
1139 return TAP_PACKET_REDRAW;
1140}
1141
1142
1143
1144#define hash_init_count20 20
1145
1146/* Forward declarations */
1147
1148/* Hash functions */
1149static int afp_equal (const void *v, const void *v2);
1150static unsigned afp_hash (const void *v);
1151
1152typedef struct {
1153 uint32_t conversation;
1154 uint16_t tid;
1155} afp_request_key;
1156
1157static wmem_map_t *afp_request_hash;
1158
1159static unsigned Vol; /* volume */
1160static unsigned Did; /* parent directory ID */
1161
1162/* Hash Functions */
1163static int afp_equal (const void *v, const void *v2)
1164{
1165 const afp_request_key *val1 = (const afp_request_key*)v;
1166 const afp_request_key *val2 = (const afp_request_key*)v2;
1167
1168 if (val1->conversation == val2->conversation &&
1169 val1->tid == val2->tid) {
1170 return 1;
1171 }
1172 return 0;
1173}
1174
1175static unsigned afp_hash (const void *v)
1176{
1177 const afp_request_key *afp_key = (const afp_request_key*)v;
1178 return afp_key->tid;
1179}
1180
1181/* --------------------------
1182*/
1183#define PAD(x){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, x, 0x00000000
); offset += x; }
{ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, x, ENC_NA0x00000000); offset += x; }
1184
1185static uint16_t
1186decode_vol_bitmap (proto_tree *tree, tvbuff_t *tvb, int offset)
1187{
1188 uint16_t bitmap;
1189 static int * const bitmaps[] = {
1190 &hf_afp_vol_bitmap_Attributes,
1191 &hf_afp_vol_bitmap_Signature,
1192 &hf_afp_vol_bitmap_CreateDate,
1193 &hf_afp_vol_bitmap_ModDate,
1194 &hf_afp_vol_bitmap_BackupDate,
1195 &hf_afp_vol_bitmap_ID,
1196 &hf_afp_vol_bitmap_BytesFree,
1197 &hf_afp_vol_bitmap_BytesTotal,
1198 &hf_afp_vol_bitmap_Name,
1199 &hf_afp_vol_bitmap_ExtBytesFree,
1200 &hf_afp_vol_bitmap_ExtBytesTotal,
1201 &hf_afp_vol_bitmap_BlockSize,
1202 NULL((void*)0)
1203 };
1204
1205 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_vol_bitmap,
1206 ett_afp_vol_bitmap, bitmaps, ENC_BIG_ENDIAN0x00000000);
1207 bitmap = tvb_get_ntohs(tvb, offset);
1208
1209 return bitmap;
1210}
1211
1212/* -------------------------- */
1213static uint16_t
1214decode_vol_attribute (proto_tree *tree, tvbuff_t *tvb, int offset)
1215{
1216 uint16_t bitmap;
1217 static int * const bitmaps[] = {
1218 &hf_afp_vol_attribute_ReadOnly,
1219 &hf_afp_vol_attribute_HasVolumePassword,
1220 &hf_afp_vol_attribute_SupportsFileIDs,
1221 &hf_afp_vol_attribute_SupportsCatSearch,
1222 &hf_afp_vol_attribute_SupportsBlankAccessPrivs,
1223 &hf_afp_vol_attribute_SupportsUnixPrivs,
1224 &hf_afp_vol_attribute_SupportsUTF8Names,
1225 &hf_afp_vol_attribute_NoNetworkUserID,
1226 &hf_afp_vol_attribute_DefaultPrivsFromParent,
1227 &hf_afp_vol_attribute_NoExchangeFiles,
1228 &hf_afp_vol_attribute_SupportsExtAttrs,
1229 &hf_afp_vol_attribute_SupportsACLs,
1230 &hf_afp_vol_attribute_CaseSensitive,
1231 &hf_afp_vol_attribute_SupportsTMLockSteal,
1232 NULL((void*)0)
1233 };
1234
1235 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_vol_attribute,
1236 ett_afp_vol_attribute, bitmaps, ENC_BIG_ENDIAN0x00000000);
1237 bitmap = tvb_get_ntohs(tvb, offset);
1238
1239 return bitmap;
1240}
1241
1242/* --------------------------
1243 cf AFP3.0.pdf page 38
1244 date are number of seconds from 12:00am on 01.01.2000 GMT
1245 backup : 0x8000000 not set
1246 from netatalk adouble.h
1247*/
1248#define DATE_NOT_SET0x80000000 0x80000000
1249#define AD_DATE_DELTA((3*365 + 366)*7 + 2*365)*24*3600UL EPOCH_DELTA_2000_01_01_00_00_00_UTC((3*365 + 366)*7 + 2*365)*24*3600UL
1250#define AD_DATE_TO_UNIX(x)(x + ((3*365 + 366)*7 + 2*365)*24*3600UL) (x + AD_DATE_DELTA((3*365 + 366)*7 + 2*365)*24*3600UL)
1251static void
1252print_date(proto_tree *tree,int id, tvbuff_t *tvb, int offset)
1253{
1254 time_t date = tvb_get_ntohl(tvb, offset);
1255 nstime_t tv;
1256
1257 tv.secs = AD_DATE_TO_UNIX(date)(date + ((3*365 + 366)*7 + 2*365)*24*3600UL);
1258 tv.nsecs = 0;
1259 proto_tree_add_time(tree, id, tvb, offset, 4, &tv);
1260}
1261
1262/* -------------------------- */
1263static int
1264parse_vol_bitmap (proto_tree *tree, tvbuff_t *tvb, int offset, uint16_t bitmap)
1265{
1266 uint16_t nameoff = 0;
1267
1268 if ((bitmap & kFPVolAttributeBit(1U << 0))) {
1269 decode_vol_attribute(tree,tvb,offset);
1270 offset += 2;
1271 }
1272 if ((bitmap & kFPVolSignatureBit(1U << 1))) {
1273 proto_tree_add_item(tree, hf_afp_vol_signature,tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1274 offset += 2;
1275 }
1276 if ((bitmap & kFPVolCreateDateBit(1U << 2))) {
1277 print_date(tree, hf_afp_vol_creation_date,tvb, offset);
1278 offset += 4;
1279 }
1280 if ((bitmap & kFPVolModDateBit(1U << 3))) {
1281 print_date(tree, hf_afp_vol_modification_date,tvb, offset);
1282 offset += 4;
1283 }
1284 if ((bitmap & kFPVolBackupDateBit(1U << 4))) {
1285 print_date(tree, hf_afp_vol_backup_date,tvb, offset);
1286 offset += 4;
1287 }
1288 if ((bitmap & kFPVolIDBit(1U << 5))) {
1289 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1290 offset += 2;
1291 }
1292 if ((bitmap & kFPVolBytesFreeBit(1U << 6))) {
1293 proto_tree_add_item(tree, hf_afp_vol_bytes_free,tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1294 offset += 4;
1295 }
1296 if ((bitmap & kFPVolBytesTotalBit(1U << 7))) {
1297 proto_tree_add_item(tree, hf_afp_vol_bytes_total,tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1298 offset += 4;
1299 }
1300 if ((bitmap & kFPVolNameBit(1U << 8))) {
1301 proto_tree_add_item_ret_uint16(tree, hf_afp_vol_name_offset,tvb, offset, 2, ENC_BIG_ENDIAN0x00000000, &nameoff);
1302 offset += 2;
1303 }
1304 if ((bitmap & kFPVolExtBytesFreeBit(1U << 9))) {
1305 proto_tree_add_item(tree, hf_afp_vol_ex_bytes_free,tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
1306 offset += 8;
1307 }
1308 if ((bitmap & kFPVolExtBytesTotalBit(1U << 10))) {
1309 proto_tree_add_item(tree, hf_afp_vol_ex_bytes_total,tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
1310 offset += 8;
1311 }
1312 if ((bitmap & kFPVolBlockSizeBit(1U << 11))) {
1313 proto_tree_add_item(tree, hf_afp_vol_block_size,tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1314 offset += 4;
1315 }
1316 if (nameoff) {
1317 uint8_t len;
1318 /* TODO: this doesn't look right! */
1319 len = tvb_get_uint8(tvb, offset);
1320 proto_tree_add_item(tree, hf_afp_vol_name, tvb, offset, 1, ENC_UTF_80x00000002|ENC_BIG_ENDIAN0x00000000);
1321 offset += len +1;
1322
1323 }
1324 return offset;
1325}
1326
1327/* -------------------------- */
1328static uint16_t
1329decode_file_bitmap (proto_tree *tree, tvbuff_t *tvb, int offset)
1330{
1331 uint16_t bitmap;
1332 static int * const bitmaps[] = {
1333 &hf_afp_file_bitmap_Attributes,
1334 &hf_afp_file_bitmap_ParentDirID,
1335 &hf_afp_file_bitmap_CreateDate,
1336 &hf_afp_file_bitmap_ModDate,
1337 &hf_afp_file_bitmap_BackupDate,
1338 &hf_afp_file_bitmap_FinderInfo,
1339 &hf_afp_file_bitmap_LongName,
1340 &hf_afp_file_bitmap_ShortName,
1341 &hf_afp_file_bitmap_NodeID,
1342 &hf_afp_file_bitmap_DataForkLen,
1343 &hf_afp_file_bitmap_RsrcForkLen,
1344 &hf_afp_file_bitmap_ExtDataForkLen,
1345 &hf_afp_file_bitmap_LaunchLimit,
1346 &hf_afp_file_bitmap_UTF8Name,
1347 &hf_afp_file_bitmap_ExtRsrcForkLen,
1348 &hf_afp_file_bitmap_UnixPrivs,
1349 NULL((void*)0)
1350 };
1351
1352 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_file_bitmap,
1353 ett_afp_file_bitmap, bitmaps, ENC_BIG_ENDIAN0x00000000);
1354 bitmap = tvb_get_ntohs(tvb, offset);
1355
1356 return bitmap;
1357}
1358
1359/* -------------------------- */
1360static uint16_t
1361decode_file_attribute(proto_tree *tree, tvbuff_t *tvb, int offset, int shared)
1362{
1363 uint16_t attribute;
1364 static int * const not_shared_attr[] = {
1365 &hf_afp_file_attribute_Invisible,
1366 &hf_afp_file_attribute_MultiUser,
1367 &hf_afp_file_attribute_System,
1368 &hf_afp_file_attribute_DAlreadyOpen,
1369 &hf_afp_file_attribute_RAlreadyOpen,
1370 /* writeinhibit is file only but Macs are setting it with FPSetFileDirParms too */
1371 &hf_afp_file_attribute_WriteInhibit,
1372 &hf_afp_file_attribute_BackUpNeeded,
1373 &hf_afp_file_attribute_RenameInhibit,
1374 &hf_afp_file_attribute_DeleteInhibit,
1375 &hf_afp_file_attribute_CopyProtect,
1376 &hf_afp_file_attribute_SetClear,
1377 NULL((void*)0)
1378 };
1379
1380 static int * const shared_attr[] = {
1381 &hf_afp_file_attribute_Invisible,
1382 &hf_afp_file_attribute_System,
1383 &hf_afp_file_attribute_WriteInhibit,
1384 &hf_afp_file_attribute_BackUpNeeded,
1385 &hf_afp_file_attribute_RenameInhibit,
1386 &hf_afp_file_attribute_DeleteInhibit,
1387 &hf_afp_file_attribute_SetClear,
1388 NULL((void*)0)
1389 };
1390
1391 if (!shared)
1392 {
1393 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_file_attribute,
1394 ett_afp_file_attribute, not_shared_attr, ENC_BIG_ENDIAN0x00000000);
1395 }
1396 else
1397 {
1398 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_file_attribute,
1399 ett_afp_file_attribute, shared_attr, ENC_BIG_ENDIAN0x00000000);
1400 }
1401
1402 attribute = tvb_get_ntohs(tvb, offset);
1403 return attribute;
1404}
1405
1406static void
1407decode_access_rights (proto_tree *tree, tvbuff_t *tvb, int hf, int offset)
1408{
1409 static int * const rights[] = {
1410 &hf_afp_dir_ar_o_search,
1411 &hf_afp_dir_ar_o_read,
1412 &hf_afp_dir_ar_o_write,
1413 &hf_afp_dir_ar_g_search,
1414 &hf_afp_dir_ar_g_read,
1415 &hf_afp_dir_ar_g_write,
1416 &hf_afp_dir_ar_e_search,
1417 &hf_afp_dir_ar_e_read,
1418 &hf_afp_dir_ar_e_write,
1419 &hf_afp_dir_ar_u_search,
1420 &hf_afp_dir_ar_u_read,
1421 &hf_afp_dir_ar_u_write,
1422 &hf_afp_dir_ar_blank,
1423 &hf_afp_dir_ar_u_own,
1424 NULL((void*)0)
1425 };
1426
1427 proto_tree_add_bitmask(tree, tvb, offset, hf,
1428 ett_afp_dir_ar, rights, ENC_BIG_ENDIAN0x00000000);
1429}
1430
1431static void
1432decode_unix_privs (proto_tree *tree, tvbuff_t *tvb, int offset)
1433{
1434 proto_tree *sub_tree;
1435
1436 if (tree) {
1437 sub_tree = proto_tree_add_subtree(tree, tvb, offset, 16, ett_afp_unix_privs, NULL((void*)0),
1438 "UNIX privileges");
1439
1440 proto_tree_add_item(sub_tree, hf_afp_unix_privs_uid, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1441 proto_tree_add_item(sub_tree, hf_afp_unix_privs_gid, tvb, offset+4, 4, ENC_BIG_ENDIAN0x00000000);
1442 proto_tree_add_item(sub_tree, hf_afp_unix_privs_permissions, tvb, offset+8, 4, ENC_BIG_ENDIAN0x00000000);
1443 decode_access_rights(sub_tree, tvb, hf_afp_unix_privs_ua_permissions, offset+12);
1444 }
1445}
1446
1447/* -------------------------- */
1448static int
1449parse_long_filename(proto_tree *tree, tvbuff_t *tvb, int offset, int org_offset)
1450{
1451 uint16_t lnameoff;
1452 int tp_ofs = 0;
1453 uint8_t len;
1454
1455 lnameoff = tvb_get_ntohs(tvb, offset);
1456 proto_tree_add_item(tree, hf_afp_long_name_offset,tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1457 if (lnameoff) {
1458 tp_ofs = lnameoff +org_offset;
1459 proto_tree_add_item_ret_uint8(tree, hf_afp_path_len, tvb, tp_ofs, 1, ENC_BIG_ENDIAN0x00000000, &len);
1460 tp_ofs++;
1461 proto_tree_add_item(tree, hf_afp_path_name, tvb, tp_ofs, len, ENC_UTF_80x00000002);
1462 tp_ofs += len;
1463 }
1464 return tp_ofs;
1465}
1466
1467/* -------------------------- */
1468static int
1469parse_UTF8_filename(proto_tree *tree, tvbuff_t *tvb, int offset, int org_offset)
1470{
1471 uint16_t unameoff;
1472 int tp_ofs = 0;
1473 uint16_t len;
1474
1475 unameoff = tvb_get_ntohs(tvb, offset);
1476 /* Check for and process the AFP 2.x ProDOS info block if found.
1477 * We detect this by looking for a value of 0 or any value greater
1478 * than 255, which is an implausible offset for a UTF-8 filename.
1479 */
1480 if (unameoff == 0 || unameoff > 255) {
1481 proto_item *ti, *hidden_item;
1482 ti = proto_tree_add_item(tree, hf_afp_prodos_info, tvb, offset, 6, ENC_NA0x00000000);
1483 proto_tree* sub_tree = NULL((void*)0);
1484 sub_tree = proto_item_add_subtree(ti, ett_afp_prodos_info);
1485 proto_tree_add_item(sub_tree, hf_afp_prodos_type, tvb, offset, 1, ENC_NA0x00000000);
1486 offset += 1;
1487 hidden_item = proto_tree_add_item(sub_tree, hf_afp_pad, tvb, offset, 1, ENC_NA0x00000000);
1488 offset += 1;
1489 proto_item_set_hidden(hidden_item); /* hide one byte pad */
1490 proto_tree_add_item(sub_tree, hf_afp_prodos_auxtype, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1491 offset += 2;
1492 hidden_item = proto_tree_add_item(sub_tree, hf_afp_pad, tvb, offset, 2, ENC_NA0x00000000);
1493 offset += 2;
Value stored to 'offset' is never read
1494 proto_item_set_hidden(hidden_item); /* hide two byte pad */
1495 return tp_ofs;
1496 }
1497 /* Otherwise, it is an AFP 3.x UTF-8 name offset. */
1498 proto_tree_add_item(tree, hf_afp_unicode_name_offset,tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1499 offset += 2;
1500 if (unameoff) {
1501 /* FIXME AFP3.x reuses PDINFO bit for UTF8.
1502 * In enumerate_ext it's pad with 4 bytes, PDINFO was 6 bytes,
1503 * but not in catsearch_ext.
1504 * Last but not least there's a bug in OSX catsearch_ext for spec2
1505 * offset is off by 2 bytes.
1506 */
1507
1508 tp_ofs = unameoff +org_offset;
1509 if (tp_ofs > offset) {
1510 PAD(4){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 4, 0x00000000
); offset += 4; }
;
1511 }
1512 else if (tp_ofs < offset) {
1513 tp_ofs = offset;
1514 }
1515 proto_tree_add_item( tree, hf_afp_path_unicode_hint, tvb, tp_ofs, 4, ENC_BIG_ENDIAN0x00000000);
1516 tp_ofs += 4;
1517
1518 len = tvb_get_ntohs(tvb, tp_ofs);
1519 proto_tree_add_item( tree, hf_afp_path_unicode_len, tvb, tp_ofs, 2, ENC_BIG_ENDIAN0x00000000);
1520 tp_ofs += 2;
1521
1522 proto_tree_add_item(tree, hf_afp_path_name, tvb, tp_ofs, len, ENC_UTF_80x00000002);
1523 tp_ofs += len;
1524 }
1525 return tp_ofs;
1526}
1527
1528/* -------------------------- */
1529static int
1530parse_file_bitmap (proto_tree *tree, tvbuff_t *tvb, int offset, uint16_t bitmap, int shared)
1531{
1532 /* uint16_t snameoff = 0; */
1533 int max_offset = 0;
1534
1535 int org_offset = offset;
1536
1537 if ((bitmap & kFPAttributeBit(1U << 0))) {
1538 decode_file_attribute(tree, tvb, offset, shared);
1539 offset += 2;
1540 }
1541 if ((bitmap & kFPParentDirIDBit(1U << 1))) {
1542 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1543 offset += 4;
1544 }
1545 if ((bitmap & kFPCreateDateBit(1U << 2))) {
1546 print_date(tree, hf_afp_creation_date,tvb, offset);
1547 offset += 4;
1548 }
1549 if ((bitmap & kFPModDateBit(1U << 3))) {
1550 print_date(tree, hf_afp_modification_date,tvb, offset);
1551 offset += 4;
1552 }
1553 if ((bitmap & kFPBackupDateBit(1U << 4))) {
1554 print_date(tree, hf_afp_backup_date,tvb, offset);
1555 offset += 4;
1556 }
1557 if ((bitmap & kFPFinderInfoBit(1U << 5))) {
1558 proto_tree_add_item(tree, hf_afp_finder_info,tvb, offset, 32, ENC_NA0x00000000);
1559 offset += 32;
1560 }
1561 if ((bitmap & kFPLongNameBit(1U << 6))) {
1562 int tp_ofs;
1563
1564 tp_ofs = parse_long_filename(tree, tvb, offset, org_offset);
1565 max_offset = (tp_ofs >max_offset)?tp_ofs:max_offset;
1566
1567 offset += 2;
1568
1569 }
1570 if ((bitmap & kFPShortNameBit(1U << 7))) {
1571 /* snameoff = tvb_get_ntohs(tvb, offset); */
1572 proto_tree_add_item(tree, hf_afp_short_name_offset,tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1573 offset += 2;
1574 }
1575 if ((bitmap & kFPNodeIDBit(1U << 8))) {
1576 proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1577 offset += 4;
1578 }
1579
1580 if ((bitmap & kFPDataForkLenBit(1U << 9))) {
1581 proto_tree_add_item(tree, hf_afp_file_DataForkLen, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1582 offset += 4;
1583 }
1584
1585 if ((bitmap & kFPRsrcForkLenBit(1U << 10))) {
1586 proto_tree_add_item(tree, hf_afp_file_RsrcForkLen, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1587 offset += 4;
1588 }
1589
1590 if ((bitmap & kFPExtDataForkLenBit(1U << 11))) {
1591 proto_tree_add_item(tree, hf_afp_file_ExtDataForkLen, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
1592 offset += 8;
1593 }
1594
1595 if ((bitmap & kFPLaunchLimitBit(1U << 12))) {
1596 offset += 2; /* ? */
1597 }
1598
1599 if ((bitmap & kFPUTF8NameBit(1U << 13))) {
1600 int tp_ofs;
1601
1602 tp_ofs = parse_UTF8_filename(tree, tvb, offset, org_offset);
1603 max_offset = (tp_ofs >max_offset)?tp_ofs:max_offset;
1604 offset += 6;
1605 }
1606
1607 if ((bitmap & kFPExtRsrcForkLenBit(1U << 14))) {
1608 proto_tree_add_item(tree, hf_afp_file_ExtRsrcForkLen, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
1609 offset += 8;
1610 }
1611
1612 if ((bitmap & kFPUnixPrivsBit(1U << 15))) {
1613 /*
1614 * XXX - the AFP 3.0 spec says this is "Four bytes", but
1615 * also says the privileges are "stored in an FPUnixPrivs
1616 * structure", which is 16 bytes long.
1617 *
1618 * We assume, for now, that the latter is true.
1619 */
1620 decode_unix_privs(tree, tvb, offset);
1621 offset += 16;
1622 }
1623
1624 return (max_offset)?max_offset:offset;
1625}
1626
1627/* -------------------------- */
1628static uint16_t
1629decode_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, int offset)
1630{
1631 uint16_t bitmap;
1632 static int * const bitmaps[] = {
1633 &hf_afp_dir_bitmap_Attributes,
1634 &hf_afp_dir_bitmap_ParentDirID,
1635 &hf_afp_dir_bitmap_CreateDate,
1636 &hf_afp_dir_bitmap_ModDate,
1637 &hf_afp_dir_bitmap_BackupDate,
1638 &hf_afp_dir_bitmap_FinderInfo,
1639 &hf_afp_dir_bitmap_LongName,
1640 &hf_afp_dir_bitmap_ShortName,
1641 &hf_afp_dir_bitmap_NodeID,
1642 &hf_afp_dir_bitmap_OffspringCount,
1643 &hf_afp_dir_bitmap_OwnerID,
1644 &hf_afp_dir_bitmap_GroupID,
1645 &hf_afp_dir_bitmap_AccessRights,
1646 &hf_afp_dir_bitmap_UTF8Name,
1647 &hf_afp_dir_bitmap_UnixPrivs,
1648 NULL((void*)0)
1649 };
1650
1651 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_dir_bitmap,
1652 ett_afp_dir_bitmap, bitmaps, ENC_BIG_ENDIAN0x00000000);
1653 bitmap = tvb_get_ntohs(tvb, offset);
1654
1655 return bitmap;
1656}
1657
1658/* -------------------------- */
1659static uint16_t
1660decode_dir_attribute(proto_tree *tree, tvbuff_t *tvb, int offset)
1661{
1662 uint16_t attribute;
1663 static int * const attributes[] = {
1664 &hf_afp_dir_attribute_Invisible,
1665 &hf_afp_dir_attribute_IsExpFolder,
1666 &hf_afp_dir_attribute_System,
1667 &hf_afp_dir_attribute_Mounted,
1668 &hf_afp_dir_attribute_InExpFolder,
1669 &hf_afp_dir_attribute_BackUpNeeded,
1670 &hf_afp_dir_attribute_RenameInhibit,
1671 &hf_afp_dir_attribute_DeleteInhibit,
1672 NULL((void*)0)
1673 };
1674
1675 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_dir_attribute,
1676 ett_afp_dir_attribute, attributes, ENC_BIG_ENDIAN0x00000000);
1677 attribute = tvb_get_ntohs(tvb, offset);
1678
1679 return attribute;
1680}
1681
1682/* -------------------------- */
1683static int
1684parse_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, int offset, uint16_t bitmap)
1685{
1686 /* uint16_t snameoff = 0; */
1687 int max_offset = 0;
1688
1689 int org_offset = offset;
1690
1691 if ((bitmap & kFPAttributeBit(1U << 0))) {
1692 decode_dir_attribute(tree, tvb, offset);
1693 offset += 2;
1694 }
1695 if ((bitmap & kFPParentDirIDBit(1U << 1))) {
1696 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1697 offset += 4;
1698 }
1699 if ((bitmap & kFPCreateDateBit(1U << 2))) {
1700 print_date(tree, hf_afp_creation_date,tvb, offset);
1701 offset += 4;
1702 }
1703 if ((bitmap & kFPModDateBit(1U << 3))) {
1704 print_date(tree, hf_afp_modification_date,tvb, offset);
1705 offset += 4;
1706 }
1707 if ((bitmap & kFPBackupDateBit(1U << 4))) {
1708 print_date(tree, hf_afp_backup_date,tvb, offset);
1709 offset += 4;
1710 }
1711 if ((bitmap & kFPFinderInfoBit(1U << 5))) {
1712 proto_tree_add_item(tree, hf_afp_finder_info,tvb, offset, 32, ENC_NA0x00000000);
1713 offset += 32;
1714 }
1715 if ((bitmap & kFPLongNameBit(1U << 6))) {
1716 int tp_ofs;
1717
1718 tp_ofs = parse_long_filename(tree, tvb, offset, org_offset);
1719 max_offset = (tp_ofs >max_offset)?tp_ofs:max_offset;
1720
1721 offset += 2;
1722 }
1723 if ((bitmap & kFPShortNameBit(1U << 7))) {
1724 /* snameoff = tvb_get_ntohs(tvb, offset); */
1725 proto_tree_add_item(tree, hf_afp_short_name_offset,tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1726 offset += 2;
1727 }
1728 if ((bitmap & kFPNodeIDBit(1U << 8))) {
1729 proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1730 offset += 4;
1731 }
1732 if ((bitmap & kFPOffspringCountBit(1U << 9))) {
1733 proto_tree_add_item(tree, hf_afp_dir_offspring, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1734 offset += 2; /* error in AFP3.0.pdf */
1735 }
1736 if ((bitmap & kFPOwnerIDBit(1U << 10))) {
1737 proto_tree_add_item(tree, hf_afp_dir_OwnerID, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1738 offset += 4;
1739 }
1740 if ((bitmap & kFPGroupIDBit(1U << 11))) {
1741 proto_tree_add_item(tree, hf_afp_dir_GroupID, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1742 offset += 4;
1743 }
1744 if ((bitmap & kFPAccessRightsBit(1U << 12))) {
1745 decode_access_rights(tree, tvb, hf_afp_dir_ar, offset);
1746 offset += 4;
1747 }
1748 if ((bitmap & kFPUTF8NameBit(1U << 13))) {
1749 int tp_ofs;
1750
1751 tp_ofs = parse_UTF8_filename(tree, tvb, offset, org_offset);
1752 max_offset = (tp_ofs >max_offset)?tp_ofs:max_offset;
1753 offset += 6;
1754 }
1755 if ((bitmap & kFPUnixPrivsBit(1U << 15))) {
1756 /*
1757 * XXX - the AFP 3.0 spec says this is "Four bytes", but
1758 * also says the privileges are "stored in an FPUnixPrivs
1759 * structure", which is 16 bytes long.
1760 *
1761 * We assume, for now, that the latter is true.
1762 */
1763 decode_unix_privs(tree, tvb, offset);
1764 offset += 16;
1765 }
1766 return (max_offset)?max_offset:offset;
1767}
1768
1769/* -------------------------- */
1770static uint8_t *
1771name_in_bitmap(wmem_allocator_t *scope, tvbuff_t *tvb, int offset, uint16_t bitmap, int isdir)
1772{
1773 uint8_t *name;
1774 int org_offset = offset;
1775 uint16_t nameoff;
1776 uint8_t len;
1777 uint16_t len16;
1778 int tp_ofs;
1779
1780 if ((bitmap & kFPAttributeBit(1U << 0))) /* 0 */
1781 offset += 2;
1782 if ((bitmap & kFPParentDirIDBit(1U << 1))) /* 1 */
1783 offset += 4;
1784 if ((bitmap & kFPCreateDateBit(1U << 2))) /* 2 */
1785 offset += 4;
1786 if ((bitmap & kFPModDateBit(1U << 3))) /* 3 */
1787 offset += 4;
1788 if ((bitmap & kFPBackupDateBit(1U << 4))) /* 4 */
1789 offset += 4;
1790 if ((bitmap & kFPFinderInfoBit(1U << 5))) /* 5 */
1791 offset += 32;
1792
1793 if ((bitmap & kFPLongNameBit(1U << 6))) { /* 6 */
1794 nameoff = tvb_get_ntohs(tvb, offset);
1795 if (nameoff) {
1796 tp_ofs = nameoff +org_offset;
1797 len = tvb_get_uint8(tvb, tp_ofs);
1798 tp_ofs++;
1799 /* XXX - code page,, e.g. Mac{Roman,Japanese,etc.} */
1800 name = tvb_get_string_enc(scope, tvb, tp_ofs, len, ENC_ASCII0x00000000|ENC_NA0x00000000);
1801 return name;
1802 }
1803 offset += 2;
1804 }
1805
1806 if ((bitmap & kFPShortNameBit(1U << 7))) /* 7 */
1807 offset += 2;
1808 if ((bitmap & kFPNodeIDBit(1U << 8))) /* 8 */
1809 offset += 4;
1810
1811 if (isdir) {
1812 if ((bitmap & kFPOffspringCountBit(1U << 9))) /* 9 */
1813 offset += 2;
1814 if ((bitmap & kFPOwnerIDBit(1U << 10))) /* 10*/
1815 offset += 4;
1816 if ((bitmap & kFPGroupIDBit(1U << 11))) /* 11*/
1817 offset += 4;
1818 if ((bitmap & kFPAccessRightsBit(1U << 12))) /* 12*/
1819 offset += 4;
1820 }
1821 else {
1822 if ((bitmap & kFPDataForkLenBit(1U << 9))) /* 9 */
1823 offset += 4;
1824 if ((bitmap & kFPRsrcForkLenBit(1U << 10))) /* 10*/
1825 offset += 4;
1826 if ((bitmap & kFPExtDataForkLenBit(1U << 11))) /* 11*/
1827 offset += 8;
1828 if ((bitmap & kFPLaunchLimitBit(1U << 12))) /* 12*/
1829 offset += 2; /* FIXME ? */
1830 }
1831
1832 if ((bitmap & kFPUTF8NameBit(1U << 13))) { /* 13 */
1833 nameoff = tvb_get_ntohs(tvb, offset);
1834 if (nameoff) {
1835 tp_ofs = nameoff +org_offset +4;
1836 len16 = tvb_get_ntohs(tvb, tp_ofs);
1837 tp_ofs += 2;
1838 name = tvb_get_string_enc(scope, tvb, tp_ofs, len16, ENC_UTF_80x00000002|ENC_NA0x00000000);
1839 return name;
1840 }
1841 }
1842 return NULL((void*)0);
1843}
1844
1845/* -------------------------- */
1846static uint8_t *
1847name_in_dbitmap(wmem_allocator_t *scope, tvbuff_t *tvb, int offset, uint16_t bitmap)
1848{
1849 uint8_t *name;
1850
1851 name = name_in_bitmap(scope, tvb, offset, bitmap, 1);
1852 if (name != NULL((void*)0))
1853 return name;
1854 /*
1855 check UTF8 name
1856 */
1857
1858 return name;
1859}
1860
1861/* -------------------------- */
1862static uint8_t *
1863name_in_fbitmap(wmem_allocator_t *scope, tvbuff_t *tvb, int offset, uint16_t bitmap)
1864{
1865 uint8_t *name;
1866
1867 name = name_in_bitmap(scope, tvb, offset, bitmap, 0);
1868 if (name != NULL((void*)0))
1869 return name;
1870 /*
1871 check UTF8 name
1872 */
1873
1874 return name;
1875}
1876
1877/* -------------------------- */
1878static int
1879decode_vol(proto_tree *tree, tvbuff_t *tvb, int offset)
1880{
1881 Vol = tvb_get_ntohs(tvb, offset);
1882 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1883 return offset + 2;
1884}
1885
1886/* -------------------------- */
1887static int
1888decode_vol_did(proto_tree *tree, tvbuff_t *tvb, int offset)
1889{
1890 Vol = tvb_get_ntohs(tvb, offset);
1891 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1892 offset += 2;
1893
1894 Did = tvb_get_ntohl(tvb, offset);
1895 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1896 offset += 4;
1897 return offset;
1898}
1899
1900/* -------------------------- */
1901static int
1902decode_vol_did_file_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, int offset)
1903{
1904 offset = decode_vol_did(tree, tvb, offset);
1905
1906 decode_file_bitmap(tree, tvb, offset);
1907 offset += 2;
1908
1909 decode_dir_bitmap(tree, tvb, offset);
1910 offset += 2;
1911
1912 return offset;
1913}
1914
1915/* ------------------------ */
1916static const char *
1917get_name(wmem_allocator_t *scope, tvbuff_t *tvb, int offset, int type)
1918{
1919 int len;
1920 const char *string;
1921
1922 switch (type) {
1923 case 1:
1924 case 2:
1925 len = tvb_get_uint8(tvb, offset);
1926 offset++;
1927 string = tvb_format_text(scope, tvb,offset, len);
1928 break;
1929 case 3:
1930 len = tvb_get_ntohs(tvb, offset +4);
1931 offset += 6;
1932 string = tvb_format_text(scope, tvb,offset, len);
1933 break;
1934 default:
1935 string = "Unknown type";
1936 break;
1937 }
1938 return string;
1939}
1940/* -------------------------- */
1941static int
1942decode_name_label (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, const char *label, bool_Bool add_info)
1943{
1944 int len;
1945 int header;
1946 const char *name;
1947 uint8_t type;
1948 proto_tree *sub_tree = NULL((void*)0);
1949
1950 type = tvb_get_uint8(tvb, offset);
1951 if (type == 3) {
1952 header = 7;
1953 len = tvb_get_ntohs(tvb, offset +5);
1954 }
1955 else {
1956 header = 2;
1957 len = tvb_get_uint8(tvb, offset +1);
1958 }
1959 name = get_name(pinfo->pool, tvb, offset +1, type);
1960
1961 if (add_info) {
1962 col_append_fstr(pinfo->cinfo, COL_INFO, ": Vol=%u Did=%u", Vol, Did);
1963 if (len) {
1964 col_append_fstr(pinfo->cinfo, COL_INFO, " Name=%s", name);
1965 }
1966 }
1967
1968 if (tree) {
1969 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, len +header,
1970 ett_afp_path_name, NULL((void*)0), label, name);
1971
1972 proto_tree_add_item( sub_tree, hf_afp_path_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1973 offset++;
1974 if (type == 3) {
1975 proto_tree_add_item( sub_tree, hf_afp_path_unicode_hint, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
1976 offset += 4;
1977 proto_tree_add_item( sub_tree, hf_afp_path_unicode_len, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
1978 offset += 2;
1979 }
1980 else {
1981 proto_tree_add_item( sub_tree, hf_afp_path_len, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
1982 offset++;
1983 }
1984
1985 proto_tree_add_string(sub_tree, hf_afp_path_name, tvb, offset, len,name);
1986 }
1987 else
1988 offset += header;
1989
1990 return offset +len;
1991}
1992
1993/* -------------------------- */
1994static int
1995decode_name (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
1996{
1997 return decode_name_label(tree, pinfo, tvb, offset, "Path: %s", true1);
1998}
1999
2000/* -------------------------- */
2001static void
2002add_info_fork(tvbuff_t *tvb, packet_info *pinfo, int offset)
2003{
2004 uint16_t ofork;
2005
2006 ofork = tvb_get_ntohs(tvb, offset);
2007 if (ofork) {
2008 col_append_fstr(pinfo->cinfo, COL_INFO, ": Fork=%u", ofork);
2009 }
2010}
2011
2012/* -------------------------- */
2013static void
2014add_info_vol(tvbuff_t *tvb, packet_info *pinfo, int offset)
2015{
2016 uint16_t vol;
2017
2018 vol = tvb_get_ntohs(tvb, offset);
2019 col_append_fstr(pinfo->cinfo, COL_INFO, ": Vol=%u", vol);
2020}
2021
2022/* ************************** */
2023static int
2024dissect_query_afp_open_vol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2025{
2026 int len;
2027 const char *rep;
2028
2029 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2030
2031 decode_vol_bitmap(tree, tvb, offset);
2032 offset += 2;
2033
2034 len = tvb_get_uint8(tvb, offset);
2035
2036 rep = get_name(pinfo->pool, tvb, offset, 2);
2037 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", rep);
2038
2039 if (!tree)
2040 return offset;
2041
2042 proto_tree_add_item(tree, hf_afp_vol_name, tvb, offset, 1, ENC_UTF_80x00000002|ENC_BIG_ENDIAN0x00000000);
2043 offset += len +1;
2044
2045 len = tvb_reported_length_remaining(tvb,offset);
2046 if (len >= 8) {
2047 /* optional password */
2048 proto_tree_add_item(tree, hf_afp_passwd, tvb, offset, 8, ENC_UTF_80x00000002|ENC_NA0x00000000);
2049 offset += 8;
2050 }
2051 return offset;
2052}
2053
2054/* -------------------------- */
2055static int
2056dissect_reply_afp_open_vol(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2057{
2058 uint16_t bitmap;
2059
2060 if (!tree)
2061 return offset;
2062 bitmap = decode_vol_bitmap(tree, tvb, offset);
2063 offset += 2;
2064 offset = parse_vol_bitmap(tree, tvb, offset, bitmap);
2065
2066 return offset;
2067}
2068
2069/* ************************** */
2070static int
2071dissect_reply_afp_get_server_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2072{
2073 uint8_t num;
2074 uint8_t len;
2075 uint8_t i;
2076 proto_tree *sub_tree;
2077 proto_item *item;
2078
2079 static int * const flags[] = {
2080 &hf_afp_vol_flag_passwd,
2081 &hf_afp_vol_flag_has_config,
2082 NULL((void*)0)
2083 };
2084
2085 if (!tree)
2086 return offset;
2087
2088 print_date(tree, hf_afp_server_time,tvb, offset);
2089 offset += 4;
2090
2091 num = tvb_get_uint8(tvb, offset);
2092 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1,
2093 ett_afp_server_vol, NULL((void*)0), "Volumes : %d", num);
2094 offset++;
2095
2096 for (i = 0; i < num; i++) {
2097 const char *rep;
2098
2099 tree = proto_tree_add_subtree(sub_tree, tvb, offset, -1,
2100 ett_afp_vol_list, NULL((void*)0), "Volume");
2101
2102 item = proto_tree_add_bitmask(tree, tvb, offset, hf_afp_vol_flag,
2103 ett_afp_vol_flag, flags, ENC_BIG_ENDIAN0x00000000);
2104 offset++;
2105
2106 len = tvb_get_uint8(tvb, offset) +1;
2107 rep = get_name(pinfo->pool, tvb, offset, 2);
2108 proto_item_set_text(item, "%s", rep);
2109 proto_item_set_len(item, len +1);
2110
2111 proto_tree_add_item(tree, hf_afp_vol_name, tvb, offset, 1, ENC_UTF_80x00000002|ENC_BIG_ENDIAN0x00000000);
2112
2113 offset += len;
2114 }
2115 return offset;
2116}
2117
2118/* **************************
2119 next calls use the same format :
2120 1 pad byte
2121 volume id
2122 AFP_FLUSH
2123 AFP_CLOSEVOL
2124 AFP_OPENDT
2125*/
2126static int
2127dissect_query_afp_with_vol_id(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2128{
2129
2130 if (!tree)
2131 return offset;
2132 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2133
2134 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2135 offset += 2;
2136 return offset;
2137}
2138
2139/* ************************** */
2140static int
2141dissect_query_afp_open_fork(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2142{
2143 static int * const access[] = {
2144 &hf_afp_access_read,
2145 &hf_afp_access_write,
2146 &hf_afp_access_deny_read,
2147 &hf_afp_access_deny_write,
2148 NULL((void*)0)
2149 };
2150
2151 proto_tree_add_item(tree, hf_afp_fork_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2152 offset++;
2153
2154 offset = decode_vol_did(tree, tvb, offset);
2155
2156 decode_file_bitmap(tree, tvb, offset);
2157 offset += 2;
2158 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_access_mode,
2159 ett_afp_access_mode, access, ENC_BIG_ENDIAN0x00000000);
2160 offset += 2;
2161
2162 offset = decode_name(tree, pinfo, tvb, offset);
2163
2164 return offset;
2165}
2166
2167/* -------------------------- */
2168static int
2169dissect_reply_afp_open_fork(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2170{
2171 uint16_t f_bitmap;
2172
2173 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2174 offset += 2;
2175
2176 add_info_fork(tvb, pinfo, offset);
2177 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2178 offset += 2;
2179
2180 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
2181
2182 return offset;
2183}
2184
2185/* ************************** */
2186static int
2187dissect_query_afp_enumerate_ext2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2188{
2189
2190 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2191 offset = decode_vol_did_file_dir_bitmap(tree, tvb, offset);
2192
2193 proto_tree_add_item(tree, hf_afp_req_count, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2194 offset += 2;
2195
2196 proto_tree_add_item(tree, hf_afp_start_index32, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2197 offset += 4;
2198
2199 proto_tree_add_item(tree, hf_afp_max_reply_size32, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2200 offset += 4;
2201
2202 offset = decode_name(tree, pinfo, tvb, offset);
2203
2204 return offset;
2205}
2206
2207/* ************************** */
2208static int
2209dissect_query_afp_enumerate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2210{
2211
2212 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2213 offset = decode_vol_did_file_dir_bitmap(tree, tvb, offset);
2214
2215 proto_tree_add_item(tree, hf_afp_req_count, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2216 offset += 2;
2217
2218 proto_tree_add_item(tree, hf_afp_start_index, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2219 offset += 2;
2220
2221 proto_tree_add_item(tree, hf_afp_max_reply_size, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2222 offset += 2;
2223
2224 offset = decode_name(tree, pinfo, tvb, offset);
2225
2226 return offset;
2227}
2228
2229/* -------------------------- */
2230static int
2231loop_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ptree, int offset,
2232 int count, uint16_t d_bitmap, uint16_t f_bitmap, int add, int ext)
2233{
2234 proto_tree *tree = NULL((void*)0);
2235 uint8_t *name;
2236 uint8_t flags;
2237 unsigned size;
2238 int org;
2239 int i;
2240 int decal;
2241
2242 for (i = 0; i < count; i++) {
2243 org = offset;
2244 if (ext) {
2245 size = tvb_get_ntohs(tvb, offset) +add *2;
2246 decal = 2;
2247 }
2248 else {
2249 size = tvb_get_uint8(tvb, offset) +add;
2250 decal = 1;
2251 }
2252 if (!size)
2253 return offset; /* packet is malformed */
2254 flags = tvb_get_uint8(tvb, offset +decal);
2255
2256 decal += (ext)?2:1;
2257
2258 if (ptree) {
2259 if (flags) {
2260 name = name_in_dbitmap(pinfo->pool, tvb, offset +decal, d_bitmap);
2261 }
2262 else {
2263 name = name_in_fbitmap(pinfo->pool, tvb, offset +decal, f_bitmap);
2264 }
2265 if (name) {
2266 tree = proto_tree_add_subtree(ptree, tvb, offset, size,
2267 ett_afp_enumerate_line, NULL((void*)0), (const char*)name);
2268 }
2269 else {
2270 tree = proto_tree_add_subtree_format(ptree, tvb, offset, size,
2271 ett_afp_enumerate_line, NULL((void*)0), "line %d", i+1);
2272 }
2273 }
2274 if (ext) {
2275 proto_tree_add_item(tree, hf_afp_struct_size16, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2276 offset += 2;
2277 }
2278 else {
2279 proto_tree_add_item(tree, hf_afp_struct_size, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2280 offset++;
2281 }
2282
2283 proto_tree_add_item(tree, hf_afp_file_flag, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2284 offset++;
2285 if (ext) {
2286 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2287 }
2288 if (flags) {
2289 offset = parse_dir_bitmap(tree, tvb, offset, d_bitmap);
2290 }
2291 else {
2292 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
2293 }
2294 if ((offset & 1))
2295 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2296 offset = org +size; /* play safe */
2297 }
2298 return offset;
2299}
2300/* ------------------------- */
2301static int
2302reply_enumerate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int ext)
2303{
2304 proto_tree *sub_tree = NULL((void*)0);
2305 proto_item *item;
2306 int count;
2307 uint16_t f_bitmap;
2308 uint16_t d_bitmap;
2309
2310 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2311 offset += 2;
2312
2313 d_bitmap = decode_dir_bitmap(tree, tvb, offset);
2314 offset += 2;
2315
2316 count = tvb_get_ntohs(tvb, offset);
2317 if (tree) {
2318 item = proto_tree_add_item(tree, hf_afp_req_count, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2319 sub_tree = proto_item_add_subtree(item, ett_afp_enumerate);
2320 }
2321 offset += 2;
2322
2323 return loop_record(tvb, pinfo, sub_tree, offset, count, d_bitmap, f_bitmap,0, ext);
2324}
2325
2326/* ------------------------- */
2327static int
2328dissect_reply_afp_enumerate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2329{
2330 return reply_enumerate(tvb, pinfo, tree, offset, 0);
2331}
2332
2333/* **************************/
2334static int
2335dissect_reply_afp_enumerate_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2336{
2337 return reply_enumerate(tvb, pinfo, tree, offset, 1);
2338}
2339
2340/* **************************/
2341static int
2342catsearch_spec(tvbuff_t *tvb, proto_tree *ptree, int offset, int ext, uint32_t r_bitmap, const char *label)
2343{
2344 proto_tree *tree;
2345 uint16_t size;
2346 int org;
2347
2348 org = offset;
2349
2350 if (ext) {
2351 size = tvb_get_ntohs(tvb, offset) +2;
2352 }
2353 else {
2354 size = tvb_get_uint8(tvb, offset) +2;
2355 }
2356
2357 tree = proto_tree_add_subtree(ptree, tvb, offset, size, ett_afp_cat_spec, NULL((void*)0), label);
2358
2359 if (ext) {
2360 proto_tree_add_item(tree, hf_afp_struct_size16, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2361 offset += 2;
2362 }
2363 else {
2364 proto_tree_add_item(tree, hf_afp_struct_size, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2365 offset++;
2366 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2367 }
2368
2369 /* AFP 3.1 spec pdf: The low-order word of ReqBitmap is equivalent to the
2370 File and Directory bitmaps used by the FPGetFileDirParms command. */
2371 parse_file_bitmap(tree, tvb, offset, (uint16_t) r_bitmap,0);
2372 offset = org +size;
2373
2374 return offset;
2375}
2376
2377/* ------------------------- */
2378static int
2379query_catsearch(tvbuff_t *tvb, proto_tree *ptree, int offset, int ext)
2380{
2381 proto_tree *tree = NULL((void*)0), *sub_tree;
2382 proto_item *item;
2383 uint16_t f_bitmap;
2384 uint16_t d_bitmap;
2385 uint32_t r_bitmap;
2386
2387 if (!ptree)
2388 return offset;
2389 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2390
2391 proto_tree_add_item(ptree, hf_afp_vol_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2392 offset += 2;
2393
2394 proto_tree_add_item(ptree, hf_afp_cat_req_matches, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2395 offset += 4;
2396
2397 proto_tree_add_item(ptree, hf_afp_reserved, tvb, offset, 4, ENC_NA0x00000000);
2398 offset += 4;
2399
2400 proto_tree_add_item(ptree, hf_afp_cat_position, tvb, offset, 16, ENC_NA0x00000000);
2401 offset += 16;
2402
2403 f_bitmap = decode_file_bitmap(ptree, tvb, offset);
2404 offset += 2;
2405
2406 d_bitmap = decode_dir_bitmap(ptree, tvb, offset);
2407 offset += 2;
2408
2409 r_bitmap = tvb_get_ntohl(tvb, offset);
2410 /* Already checked this above: if (ptree) */ {
2411 item = proto_tree_add_item(ptree, hf_afp_request_bitmap, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2412 sub_tree = proto_item_add_subtree(item, ett_afp_cat_r_bitmap);
2413
2414 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_Attributes , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2415 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_ParentDirID, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2416 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_CreateDate , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2417 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_ModDate , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2418 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_BackupDate , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2419 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_FinderInfo , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2420 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_LongName , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2421
2422 if (d_bitmap == 0) {
2423 /* Only for file-only searches */
2424 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_DataForkLen , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2425 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_RsrcForkLen , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2426 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_ExtDataForkLen , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2427 }
2428 if (f_bitmap == 0) {
2429 /* Only for directory-only searches */
2430 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_OffspringCount , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2431 }
2432
2433 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_UTF8Name , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2434
2435 if (d_bitmap == 0) {
2436 /* Only for file-only searches */
2437 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_ExtRsrcForkLen , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2438 }
2439 proto_tree_add_item(sub_tree, hf_afp_request_bitmap_PartialNames , tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2440 }
2441 offset += 4;
2442
2443 /* spec 1 */
2444 offset = catsearch_spec(tvb, ptree, offset, ext, r_bitmap, "Spec 1");
2445
2446 /* spec 2 */
2447 offset = catsearch_spec(tvb, ptree, offset, ext, r_bitmap, "Spec 2");
2448
2449 return offset;
2450}
2451
2452/* ------------------------- */
2453static int
2454dissect_query_afp_cat_search(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *ptree, int offset)
2455{
2456 return query_catsearch(tvb, ptree, offset, 0);
2457
2458}
2459/* **************************/
2460static int
2461dissect_query_afp_cat_search_ext(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *ptree, int offset)
2462{
2463 return query_catsearch(tvb, ptree, offset, 1);
2464
2465}
2466
2467/* **************************/
2468static int
2469reply_catsearch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int ext)
2470{
2471 proto_tree *sub_tree = NULL((void*)0);
2472 proto_item *item;
2473 uint16_t f_bitmap;
2474 uint16_t d_bitmap;
2475 int count;
2476
2477 proto_tree_add_item(tree, hf_afp_cat_position, tvb, offset, 16, ENC_NA0x00000000);
2478 offset += 16;
2479
2480 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2481 offset += 2;
2482
2483 d_bitmap = decode_dir_bitmap(tree, tvb, offset);
2484 offset += 2;
2485
2486 count = tvb_get_ntohl(tvb, offset);
2487 if (tree) {
2488 item = proto_tree_add_item(tree, hf_afp_cat_count, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2489 sub_tree = proto_item_add_subtree(item, ett_afp_cat_search);
2490 }
2491 offset += 4;
2492
2493 return loop_record(tvb, pinfo, sub_tree, offset, count, d_bitmap, f_bitmap, 2, ext);
2494}
2495
2496/* -------------------------- */
2497static int
2498dissect_reply_afp_cat_search(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2499{
2500 return reply_catsearch(tvb, pinfo, tree, offset, 0);
2501}
2502
2503/* **************************/
2504static int
2505dissect_reply_afp_cat_search_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2506{
2507 return reply_catsearch(tvb, pinfo, tree, offset, 1);
2508}
2509
2510/* **************************/
2511static int
2512dissect_query_afp_get_vol_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2513{
2514
2515 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
2516 add_info_vol(tvb, pinfo, offset);
2517
2518 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2519 offset += 2;
2520
2521 decode_vol_bitmap(tree, tvb, offset);
2522 offset += 2;
2523
2524 return offset;
2525}
2526
2527/* ------------------------ */
2528static int
2529dissect_reply_afp_get_vol_param(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2530{
2531 uint16_t bitmap;
2532
2533 bitmap = decode_vol_bitmap(tree, tvb, offset);
2534 offset += 2;
2535
2536 offset = parse_vol_bitmap(tree, tvb, offset, bitmap);
2537
2538 return offset;
2539}
2540
2541/* **************************/
2542static int
2543dissect_query_afp_set_vol_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2544{
2545 uint16_t bitmap;
2546
2547 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
2548
2549 add_info_vol(tvb, pinfo, offset);
2550 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2551 offset += 2;
2552
2553 bitmap = decode_vol_bitmap(tree, tvb, offset);
2554 offset += 2;
2555
2556 offset = parse_vol_bitmap(tree, tvb, offset, bitmap);
2557
2558 return offset;
2559}
2560
2561/* ***************************/
2562static int
2563decode_uam_parameters(const char *uam, int len_uam, tvbuff_t *tvb, proto_tree *tree, int offset)
2564{
2565 int len;
2566
2567 if (!g_ascii_strncasecmp(uam, "Cleartxt passwrd", len_uam)) {
2568 if ((offset & 1))
2569 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2570
2571 len = 8; /* tvb_strsize(tvb, offset);*/
2572 proto_tree_add_item(tree, hf_afp_passwd, tvb, offset, len, ENC_UTF_80x00000002|ENC_NA0x00000000);
2573 offset += len;
2574 }
2575 else if (!g_ascii_strncasecmp(uam, "DHCAST128", len_uam)) {
2576 if ((offset & 1))
2577 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2578
2579 len = 16;
2580 proto_tree_add_item(tree, hf_afp_random, tvb, offset, len, ENC_NA0x00000000);
2581 offset += len;
2582 }
2583 else if (!g_ascii_strncasecmp(uam, "2-Way Randnum exchange", len_uam)) {
2584 /* nothing */
2585 return offset;
2586 }
2587 return offset;
2588}
2589
2590/* ---------------- */
2591static int
2592dissect_query_afp_login(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2593{
2594 int len;
2595 int len_uam;
2596 const char *uam;
2597
2598 len = tvb_get_uint8(tvb, offset);
2599 proto_tree_add_item(tree, hf_afp_Version, tvb, offset, 1, ENC_UTF_80x00000002|ENC_BIG_ENDIAN0x00000000);
2600 offset += len +1;
2601 len_uam = tvb_get_uint8(tvb, offset);
2602 uam = (const char *)tvb_get_string_enc(pinfo->pool, tvb, offset +1, len_uam, ENC_UTF_80x00000002|ENC_NA0x00000000);
2603 proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1, ENC_UTF_80x00000002|ENC_BIG_ENDIAN0x00000000);
2604 offset += len_uam +1;
2605
2606 if (!g_ascii_strncasecmp(uam, "No User Authent", len_uam)) {
2607 return offset;
2608 }
2609
2610 len = tvb_get_uint8(tvb, offset);
2611 proto_tree_add_item(tree, hf_afp_user, tvb, offset, 1, ENC_UTF_80x00000002|ENC_BIG_ENDIAN0x00000000);
2612 offset += len +1;
2613
2614 return decode_uam_parameters(uam, len_uam, tvb, tree, offset);
2615}
2616
2617/* ***************************/
2618static int
2619dissect_query_afp_login_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2620{
2621 uint16_t len;
2622 int len_uam;
2623 const char *uam;
2624 uint8_t path_type;
2625
2626 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2627 proto_tree_add_item(tree, hf_afp_login_flags, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2628 offset += 2;
2629
2630 len = tvb_get_uint8(tvb, offset);
2631 proto_tree_add_item(tree, hf_afp_Version, tvb, offset, 1, ENC_UTF_80x00000002|ENC_BIG_ENDIAN0x00000000);
2632 offset += len +1;
2633
2634 len_uam = tvb_get_uint8(tvb, offset);
2635 uam = (const char*)tvb_get_string_enc(pinfo->pool, tvb, offset +1, len_uam, ENC_UTF_80x00000002|ENC_NA0x00000000);
2636 proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1, ENC_UTF_80x00000002|ENC_BIG_ENDIAN0x00000000);
2637 offset += len_uam +1;
2638
2639 proto_tree_add_item(tree, hf_afp_user_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2640 offset++;
2641 /* only type 3 */
2642 proto_tree_add_item_ret_uint16(tree, hf_afp_user_len, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000, &len);
2643 offset += 2;
2644 proto_tree_add_item(tree, hf_afp_user_name, tvb, offset, len, ENC_UTF_80x00000002);
2645 offset += len;
2646
2647 /* directory service */
2648 proto_tree_add_item_ret_uint8(tree, hf_afp_path_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000, &path_type);
2649 offset++;
2650 /* FIXME use 16 bit len + unicode from smb dissector */
2651 switch (path_type) {
2652 case 1:
2653 case 2:
2654 proto_tree_add_item_ret_uint16(tree, hf_afp_path_len, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000, &len);
2655 offset++;
2656 proto_tree_add_item(tree, hf_afp_path_name, tvb, offset, len, ENC_UTF_80x00000002);
2657 offset += len;
2658 break;
2659 case 3:
2660 proto_tree_add_item_ret_uint16( tree, hf_afp_path_unicode_len, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000, &len);
2661 offset += 2;
2662 proto_tree_add_item(tree, hf_afp_path_name, tvb, offset, len, ENC_UTF_80x00000002);
2663 offset += len;
2664 break;
2665 default:
2666 break;
2667 }
2668
2669 return decode_uam_parameters(uam, len_uam, tvb, tree, offset);
2670}
2671
2672/* ************************** */
2673static int
2674dissect_query_afp_write(tvbuff_t *tvb, packet_info *pinfo , proto_tree *tree, int offset)
2675{
2676 int param;
2677
2678
2679 proto_tree_add_item(tree, hf_afp_flag, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2680 offset += 1;
2681
2682 add_info_fork(tvb, pinfo, offset);
2683 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2684 offset += 2;
2685
2686 proto_tree_add_item(tree, hf_afp_offset, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2687 param = tvb_get_ntohl(tvb, offset);
2688 col_append_fstr(pinfo->cinfo, COL_INFO, " Offset=%d", param);
2689 offset += 4;
2690
2691 proto_tree_add_item(tree, hf_afp_rw_count, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2692 param = tvb_get_ntohl(tvb, offset);
2693 col_append_fstr(pinfo->cinfo, COL_INFO, " Size=%d", param);
2694 offset += 4;
2695
2696 return offset;
2697}
2698
2699static int
2700dissect_reply_afp_write(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2701{
2702 proto_tree_add_item(tree, hf_afp_last_written, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2703 offset += 4;
2704
2705 return offset;
2706}
2707
2708/* ************************** */
2709static int
2710dissect_query_afp_write_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2711{
2712 proto_tree_add_item(tree, hf_afp_flag, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2713 offset += 1;
2714
2715 add_info_fork(tvb, pinfo, offset);
2716 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2717 offset += 2;
2718
2719 proto_tree_add_item(tree, hf_afp_offset64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
2720 offset += 8;
2721
2722 proto_tree_add_item(tree, hf_afp_rw_count64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
2723 offset += 8;
2724
2725 return offset;
2726}
2727
2728static int
2729dissect_reply_afp_write_ext(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2730{
2731 proto_tree_add_item(tree, hf_afp_last_written64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
2732 offset += 8;
2733
2734 return offset;
2735}
2736
2737/* ************************** */
2738static int
2739dissect_query_afp_read(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2740{
2741 int param;
2742
2743 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2744
2745 add_info_fork(tvb, pinfo, offset);
2746 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2747 offset += 2;
2748
2749 proto_tree_add_item(tree, hf_afp_offset, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2750 param = tvb_get_ntohl(tvb, offset);
2751 col_append_fstr(pinfo->cinfo, COL_INFO, " Offset=%d", param);
2752 offset += 4;
2753
2754 proto_tree_add_item(tree, hf_afp_rw_count, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2755 param = tvb_get_ntohl(tvb, offset);
2756 col_append_fstr(pinfo->cinfo, COL_INFO, " Size=%d", param);
2757 offset += 4;
2758
2759 proto_tree_add_item(tree, hf_afp_newline_mask, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2760 offset++;
2761
2762 proto_tree_add_item(tree, hf_afp_newline_char, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2763 offset++;
2764
2765 return offset;
2766}
2767
2768/* ************************** */
2769static int
2770dissect_query_afp_read_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2771{
2772 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2773
2774 add_info_fork(tvb, pinfo, offset);
2775 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2776 offset += 2;
2777
2778 proto_tree_add_item(tree, hf_afp_offset64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
2779 offset += 8;
2780
2781 proto_tree_add_item(tree, hf_afp_rw_count64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
2782 offset += 8;
2783
2784 return offset;
2785}
2786
2787/* **************************
2788 Open desktop call
2789 query is the same than AFP_FLUSH, AFP_CLOSEVOL
2790
2791*/
2792static int
2793dissect_reply_afp_open_dt(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2794{
2795 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2796 offset += 2;
2797
2798 return offset;
2799}
2800
2801/* **************************
2802 no reply
2803*/
2804static int
2805dissect_query_afp_close_dt(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2806{
2807 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2808 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2809 offset += 2;
2810
2811 return offset;
2812}
2813
2814/* **************************
2815 calls using the same format :
2816 1 pad byte
2817 fork number
2818 AFP_FLUSHFORK
2819 AFP_CLOSEFORK
2820 AFP_SYNCFORK
2821*/
2822static int
2823dissect_query_afp_with_fork(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2824{
2825 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2826 add_info_fork(tvb, pinfo, offset);
2827 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2828 offset += 2;
2829
2830 return offset;
2831}
2832
2833/* ************************** */
2834static int
2835dissect_query_afp_get_fldr_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2836{
2837 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2838 offset = decode_vol_did_file_dir_bitmap(tree, tvb, offset);
2839
2840 offset = decode_name(tree, pinfo, tvb, offset);
2841
2842 return offset;
2843}
2844
2845/* -------------------------- */
2846static int
2847dissect_reply_afp_get_fldr_param(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2848{
2849 uint8_t flags;
2850 uint16_t f_bitmap, d_bitmap;
2851
2852 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2853 offset += 2;
2854
2855 d_bitmap = decode_dir_bitmap(tree, tvb, offset);
2856 offset += 2;
2857
2858 flags = tvb_get_uint8(tvb, offset);
2859 proto_tree_add_item(tree, hf_afp_file_flag, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
2860 offset++;
2861 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2862 if (flags) {
2863 offset = parse_dir_bitmap(tree, tvb, offset, d_bitmap);
2864 }
2865 else {
2866 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
2867 }
2868 return offset;
2869}
2870
2871/* **************************
2872 no reply
2873*/
2874static int
2875dissect_query_afp_set_fldr_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2876{
2877 uint16_t f_bitmap;
2878
2879 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2880 offset = decode_vol_did(tree, tvb, offset);
2881
2882 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2883 offset += 2;
2884
2885 offset = decode_name(tree, pinfo, tvb, offset);
2886
2887 if ((offset & 1))
2888 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2889 /* did:name can be a file or a folder but only the intersection between
2890 * file bitmap and dir bitmap can be set.
2891 * Well it's in afp spec, but clients (Mac) are setting 'file only' bits with this call
2892 * (WriteInhibit for example).
2893 */
2894 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap, 1);
2895
2896 return offset;
2897}
2898
2899/* **************************
2900 no reply
2901*/
2902static int
2903dissect_query_afp_set_file_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2904{
2905 uint16_t f_bitmap;
2906
2907 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2908 offset = decode_vol_did(tree, tvb, offset);
2909
2910 f_bitmap = decode_file_bitmap(tree, tvb, offset);
2911 offset += 2;
2912
2913 offset = decode_name(tree, pinfo, tvb, offset);
2914
2915 if ((offset & 1))
2916 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2917 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap, 0);
2918
2919 return offset;
2920}
2921
2922/* **************************
2923 no reply
2924*/
2925static int
2926dissect_query_afp_set_dir_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2927{
2928 uint16_t d_bitmap;
2929
2930 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2931 offset = decode_vol_did(tree, tvb, offset);
2932
2933 d_bitmap = decode_dir_bitmap(tree, tvb, offset);
2934 offset += 2;
2935
2936 offset = decode_name(tree, pinfo, tvb, offset);
2937
2938 if ((offset & 1))
2939 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2940 offset = parse_dir_bitmap(tree, tvb, offset, d_bitmap);
2941
2942 offset += 4;
2943 return offset;
2944}
2945
2946/* **************************
2947 AFP_DELETE
2948 AFP_CREATE_DIR
2949 */
2950static int
2951dissect_query_afp_create_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
2952{
2953 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2954 offset = decode_vol_did(tree, tvb, offset);
2955
2956 offset = decode_name(tree, pinfo, tvb, offset);
2957 return offset;
2958}
2959
2960/* --------------------------
2961 AFP_MOVE
2962*/
2963static int
2964dissect_reply_afp_create_id(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2965{
2966 proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2967 offset += 4;
2968
2969 return offset;
2970}
2971
2972/* -------------------------- */
2973static int
2974dissect_reply_afp_create_dir(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2975{
2976 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2977 offset += 4;
2978
2979 return offset;
2980}
2981
2982/* **************************
2983 no reply
2984*/
2985static int
2986dissect_query_afp_delete_id(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
2987{
2988 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
2989 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
2990 offset += 2;
2991 proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
2992 offset += 4;
2993
2994 return offset;
2995}
2996
2997/* **************************
2998 same reply as get_fork_param
2999*/
3000static int
3001dissect_query_afp_resolve_id(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3002{
3003 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3004 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3005 offset += 2;
3006 proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3007 offset += 4;
3008
3009 decode_file_bitmap(tree, tvb, offset);
3010 offset += 2;
3011
3012 return offset;
3013}
3014
3015/* ************************** */
3016static int
3017dissect_query_afp_get_fork_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3018{
3019
3020 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3021 add_info_fork(tvb, pinfo, offset);
3022 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3023 offset += 2;
3024
3025 decode_file_bitmap(tree, tvb, offset);
3026 offset += 2;
3027 return offset;
3028}
3029
3030/* -------------------------- */
3031static int
3032dissect_reply_afp_get_fork_param(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3033{
3034 uint16_t f_bitmap;
3035
3036 f_bitmap = decode_file_bitmap(tree, tvb, offset);
3037 offset += 2;
3038
3039 offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
3040
3041 return offset;
3042}
3043
3044/* ************************** */
3045static int
3046dissect_query_afp_set_fork_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3047{
3048 uint16_t bitmap;
3049 int param;
3050
3051 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3052 add_info_fork(tvb, pinfo, offset);
3053 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3054 offset += 2;
3055
3056 bitmap = decode_file_bitmap(tree, tvb, offset);
3057 offset += 2;
3058
3059 if ((bitmap & kFPExtDataForkLenBit(1U << 11)) || (bitmap & kFPExtRsrcForkLenBit(1U << 14))) {
3060 proto_tree_add_item(tree, hf_afp_ofork_len64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
3061 offset += 8;
3062 }
3063 else {
3064 proto_tree_add_item(tree, hf_afp_ofork_len, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3065 param = tvb_get_ntohl(tvb, offset);
3066 col_append_fstr(pinfo->cinfo, COL_INFO, " Size=%d", param);
3067 offset += 4;
3068 }
3069 return offset;
3070}
3071
3072/* ************************** */
3073static int
3074dissect_query_afp_move(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3075{
3076
3077 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3078 offset = decode_vol_did(tree, tvb, offset);
3079
3080 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3081 offset += 4;
3082
3083 offset = decode_name_label(tree, pinfo, tvb, offset, "Source path: %s", true1);
3084 offset = decode_name_label(tree, pinfo, tvb, offset, "Dest dir: %s", false0);
3085 offset = decode_name_label(tree, pinfo, tvb, offset, "New name: %s", false0);
3086
3087 return offset;
3088}
3089
3090/* ************************** */
3091static int
3092dissect_query_afp_exchange_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3093{
3094
3095 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3096 offset = decode_vol_did(tree, tvb, offset);
3097
3098 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3099 offset += 4;
3100
3101 offset = decode_name_label(tree, pinfo, tvb, offset, "Source path: %s", true1);
3102 offset = decode_name_label(tree, pinfo, tvb, offset, "Dest path: %s", false0);
3103
3104 return offset;
3105}
3106/* ************************** */
3107static int
3108dissect_query_afp_copy_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3109{
3110 proto_tree *sub_tree;
3111
3112 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3113 sub_tree = proto_tree_add_subtree(tree, tvb, offset, 6, ett_afp_vol_did, NULL((void*)0), "Source volume");
3114
3115 offset = decode_vol_did(sub_tree, tvb, offset);
3116
3117 sub_tree = proto_tree_add_subtree(tree, tvb, offset, 6, ett_afp_vol_did, NULL((void*)0), "Dest volume");
3118
3119 offset = decode_vol_did(sub_tree, tvb, offset);
3120
3121 offset = decode_name_label(tree, pinfo, tvb, offset, "Source path: %s", true1);
3122 offset = decode_name_label(tree, pinfo, tvb, offset, "Dest dir: %s", false0);
3123 offset = decode_name_label(tree, pinfo, tvb, offset, "New name: %s", false0);
3124
3125 return offset;
3126}
3127
3128/* ************************** */
3129static int
3130dissect_query_afp_rename(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3131{
3132
3133 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3134 offset = decode_vol_did(tree, tvb, offset);
3135
3136 offset = decode_name_label(tree, pinfo, tvb, offset, "Old name: %s", true1);
3137 offset = decode_name_label(tree, pinfo, tvb, offset, "New name: %s", false0);
3138
3139 return offset;
3140}
3141
3142/* ************************** */
3143static int
3144dissect_query_afp_byte_lock(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3145{
3146 proto_tree *sub_tree;
3147 uint8_t flag;
3148
3149 flag = tvb_get_uint8(tvb, offset);
3150 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1,
3151 ett_afp_lock_flags, NULL((void*)0), "Flags: 0x%02x", flag);
3152
3153 proto_tree_add_item(sub_tree, hf_afp_lock_op, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
3154 proto_tree_add_item(sub_tree, hf_afp_lock_from, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
3155 offset += 1;
3156
3157 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3158 offset += 2;
3159
3160 proto_tree_add_item(tree, hf_afp_lock_offset, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3161 offset += 4;
3162
3163 proto_tree_add_item(tree, hf_afp_lock_len, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3164 offset += 4;
3165 return offset;
3166}
3167
3168/* -------------------------- */
3169static int
3170dissect_reply_afp_byte_lock(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3171{
3172 proto_tree_add_item(tree, hf_afp_lock_range_start, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3173 offset += 4;
3174
3175 return offset;
3176}
3177
3178/* ************************** */
3179static int
3180dissect_query_afp_byte_lock_ext(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3181{
3182 proto_tree *sub_tree;
3183 uint8_t flag;
3184
3185 flag = tvb_get_uint8(tvb, offset);
3186 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1,
3187 ett_afp_lock_flags, NULL((void*)0), "Flags: 0x%02x", flag);
3188
3189 proto_tree_add_item(sub_tree, hf_afp_lock_op, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
3190 proto_tree_add_item(sub_tree, hf_afp_lock_from, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
3191 offset += 1;
3192
3193 proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3194 offset += 2;
3195
3196 proto_tree_add_item(tree, hf_afp_lock_offset64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
3197 offset += 8;
3198
3199 proto_tree_add_item(tree, hf_afp_lock_len64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
3200 offset += 8;
3201 return offset;
3202}
3203
3204/* -------------------------- */
3205static int
3206dissect_reply_afp_byte_lock_ext(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3207{
3208 proto_tree_add_item(tree, hf_afp_lock_range_start64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
3209 offset += 8;
3210
3211 return offset;
3212}
3213
3214/* ************************** */
3215static int
3216dissect_query_afp_add_cmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3217{
3218 uint8_t len;
3219
3220 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3221 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3222 offset += 2;
3223
3224 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3225 offset += 4;
3226
3227 offset = decode_name(tree, pinfo, tvb, offset);
3228
3229 if ((offset & 1))
3230 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3231
3232 len = tvb_get_uint8(tvb, offset);
3233 proto_tree_add_item(tree, hf_afp_comment, tvb, offset, 1, ENC_UTF_80x00000002|ENC_BIG_ENDIAN0x00000000);
3234 offset += len +1;
3235
3236 return offset;
3237}
3238
3239
3240/* ************************** */
3241static int
3242dissect_query_afp_get_cmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3243{
3244
3245 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3246 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3247 offset += 2;
3248
3249 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3250 offset += 4;
3251
3252 offset = decode_name(tree, pinfo, tvb, offset);
3253 return offset;
3254}
3255
3256/* -------------------------- */
3257static int
3258dissect_reply_afp_get_cmt(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3259{
3260 uint8_t len;
3261
3262 len = tvb_get_uint8(tvb, offset);
3263 proto_tree_add_item(tree, hf_afp_comment, tvb, offset, 1, ENC_UTF_80x00000002|ENC_BIG_ENDIAN0x00000000);
3264 offset += len +1;
3265
3266 return offset;
3267}
3268
3269/* ************************** */
3270static int
3271dissect_query_afp_get_icon(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3272{
3273
3274 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3275 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3276 offset += 2;
3277 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4, ENC_UTF_80x00000002);
3278 offset += 4;
3279
3280 proto_tree_add_item(tree, hf_afp_file_type, tvb, offset, 4, ENC_ASCII0x00000000);
3281 offset += 4;
3282
3283 proto_tree_add_item(tree, hf_afp_icon_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
3284 offset += 1;
3285 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3286
3287 proto_tree_add_item(tree, hf_afp_icon_length, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3288 offset += 2;
3289
3290 return offset;
3291}
3292
3293/* ************************** */
3294static int
3295dissect_query_afp_get_icon_info(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3296{
3297
3298 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3299 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3300 offset += 2;
3301 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4, ENC_ASCII0x00000000);
3302 offset += 4;
3303
3304 proto_tree_add_item(tree, hf_afp_icon_index, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3305 offset += 2;
3306
3307 return offset;
3308}
3309
3310/* -------------------------- */
3311static int
3312dissect_reply_afp_get_icon_info(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3313{
3314
3315 proto_tree_add_item(tree, hf_afp_icon_tag, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3316 offset += 4;
3317
3318 proto_tree_add_item(tree, hf_afp_file_type, tvb, offset, 4, ENC_ASCII0x00000000);
3319 offset += 4;
3320
3321 proto_tree_add_item(tree, hf_afp_icon_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
3322 offset += 1;
3323
3324 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3325 proto_tree_add_item(tree, hf_afp_icon_length, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3326 offset += 2;
3327
3328 return offset;
3329}
3330
3331/* ************************** */
3332static int
3333dissect_query_afp_add_icon(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3334{
3335
3336 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3337 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3338 offset += 2;
3339 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4, ENC_ASCII0x00000000);
3340 offset += 4;
3341
3342 proto_tree_add_item(tree, hf_afp_file_type, tvb, offset, 4, ENC_ASCII0x00000000);
3343 offset += 4;
3344
3345 proto_tree_add_item(tree, hf_afp_icon_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
3346 offset += 1;
3347
3348 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3349 proto_tree_add_item(tree, hf_afp_icon_tag, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3350 offset += 4;
3351
3352 proto_tree_add_item(tree, hf_afp_icon_length, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3353 offset += 2;
3354
3355 return offset;
3356}
3357
3358/* **************************
3359 no reply
3360*/
3361static int
3362decode_dt_did(proto_tree *tree, tvbuff_t *tvb, int offset)
3363{
3364 /* FIXME it's not volume but dt cf decode_name*/
3365 Vol = tvb_get_ntohs(tvb, offset);
3366 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3367 offset += 2;
3368
3369 Did = tvb_get_ntohl(tvb, offset);
3370 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3371 offset += 4;
3372 return offset;
3373}
3374
3375/* -------------------------- */
3376static int
3377dissect_query_afp_add_appl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3378{
3379
3380 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3381 offset = decode_dt_did(tree, tvb, offset);
3382
3383 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4, ENC_ASCII0x00000000);
3384 offset += 4;
3385
3386 proto_tree_add_item(tree, hf_afp_appl_tag, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3387 offset += 4;
3388
3389 offset = decode_name(tree, pinfo, tvb, offset);
3390
3391 return offset;
3392}
3393
3394/* **************************
3395 no reply
3396*/
3397static int
3398dissect_query_afp_rmv_appl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3399{
3400
3401 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3402 offset = decode_dt_did(tree, tvb, offset);
3403
3404 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4, ENC_ASCII0x00000000);
3405 offset += 4;
3406
3407 offset = decode_name(tree, pinfo, tvb, offset);
3408
3409 return offset;
3410}
3411
3412/* ************************** */
3413static int
3414dissect_query_afp_get_appl(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3415{
3416
3417 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3418 proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3419 offset += 2;
3420
3421 proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4, ENC_ASCII0x00000000);
3422 offset += 4;
3423
3424 proto_tree_add_item(tree, hf_afp_appl_index, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3425 offset += 2;
3426
3427 decode_file_bitmap(tree, tvb, offset);
3428 offset += 2;
3429
3430 return offset;
3431}
3432
3433/* -------------------------- */
3434static int
3435dissect_reply_afp_get_appl(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3436{
3437 proto_tree_add_item(tree, hf_afp_appl_tag, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3438 offset += 4;
3439
3440 return offset;
3441}
3442
3443/* ************************** */
3444static int
3445dissect_query_afp_create_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3446{
3447 proto_tree_add_item(tree, hf_afp_create_flag, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
3448 offset++;
3449
3450 offset = decode_vol_did(tree, tvb, offset);
3451
3452 offset = decode_name(tree, pinfo, tvb, offset);
3453
3454 return offset;
3455}
3456
3457/* ************************** */
3458static int
3459dissect_query_afp_map_id(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3460{
3461 uint8_t type;
3462
3463 proto_tree_add_item_ret_uint8(tree, hf_afp_map_id_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000, &type);
3464 offset++;
3465
3466 if ( type < 5) {
3467 proto_tree_add_item(tree, hf_afp_map_id, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3468 offset += 4;
3469 }
3470 else {
3471 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16, ENC_BIG_ENDIAN0x00000000);
3472 offset += 16;
3473 }
3474
3475 return offset;
3476}
3477
3478/* -------------------------- */
3479static int
3480dissect_reply_afp_map_id(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3481{
3482 int len;
3483 int size = 1;
3484
3485 len = tvb_get_uint8(tvb, offset);
3486 /* for type 3 and 4 len is 16 bits but we don't keep the type from the request
3487 * XXX assume name < 256, ie the first byte is zero.
3488 */
3489 if (!len) {
3490 len = tvb_get_uint8(tvb, offset +1);
3491 if (!len) {
3492 /*
3493 * Assume it's kUserUUIDToUTF8Name or
3494 * kGroupUUIDToUTF8Name.
3495 */
3496 proto_tree_add_item(tree, hf_afp_map_id_reply_type, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3497 offset += 4;
3498
3499 proto_tree_add_item(tree, hf_afp_map_id, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3500 offset += 4;
3501
3502 size = 2;
3503 len = tvb_get_uint8(tvb, offset +1);
3504
3505 }
3506 else {
3507 int remain = tvb_reported_length_remaining(tvb,offset);
3508 if (remain == len +2) {
3509 size = 2;
3510 }
3511 else {
3512 /* give up */
3513 len = remain;
3514 size = 0;
3515 }
3516 }
3517 }
3518 if (size) {
3519 proto_tree_add_item(tree, hf_afp_map_name, tvb, offset, size, ENC_ASCII0x00000000|ENC_BIG_ENDIAN0x00000000);
3520 }
3521 else {
3522 proto_tree_add_item(tree, hf_afp_unknown, tvb, offset, len, ENC_NA0x00000000);
3523 }
3524 offset += len +size;
3525 return offset;
3526}
3527
3528/* ************************** */
3529static int
3530dissect_query_afp_map_name(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3531{
3532 int len;
3533 uint8_t type;
3534 int size;
3535
3536 proto_tree_add_item_ret_uint8(tree, hf_afp_map_name_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000, &type);
3537 offset++;
3538 switch (type) {
3539 case 5:
3540 case 6:
3541 /*
3542 * Maps to UUID, UTF-8 string
3543 *
3544 * XXX - the spec doesn't say the string length is 2 bytes
3545 * for this case.
3546 */
3547 size = 2;
3548 len = tvb_get_ntohs(tvb, offset);
3549 break;
3550 default:
3551 /* Maps to UID/GID */
3552 size = 1;
3553 len = tvb_get_uint8(tvb, offset);
3554 break;
3555 }
3556 proto_tree_add_item(tree, hf_afp_map_name, tvb, offset, size, ENC_ASCII0x00000000|ENC_BIG_ENDIAN0x00000000);
3557 offset += (len+size);
3558
3559 return offset;
3560}
3561
3562/* -------------------------- */
3563static int
3564dissect_reply_afp_map_name(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3565{
3566 int remain;
3567
3568 /* We don't keep the type from the request */
3569 /* If remain == 16, assume UUID */
3570 remain = tvb_reported_length(tvb);
3571 if (remain == 16) {
3572 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16, ENC_BIG_ENDIAN0x00000000);
3573 offset += 16;
3574 }
3575 else {
3576 proto_tree_add_item(tree, hf_afp_map_id, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3577 offset += 4;
3578 }
3579
3580 return offset;
3581}
3582
3583/* ************************** */
3584static int
3585dissect_query_afp_disconnect_old_session(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3586{
3587 uint32_t token_len;
3588
3589 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3590
3591 proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3592 offset += 2;
3593
3594 proto_tree_add_item_ret_uint(tree, hf_afp_session_token_len,
3595 tvb, offset, 4, ENC_BIG_ENDIAN0x00000000, &token_len);
3596 offset += 4;
3597
3598 if ((uint32_t)offset + token_len > INT_MAX2147483647)
3599 return offset;
3600
3601 proto_tree_add_item(tree, hf_afp_session_token,
3602 tvb, offset, (int)token_len, ENC_NA0x00000000);
3603 offset += (int)token_len;
3604
3605 return offset;
3606}
3607
3608/* ************************** */
3609static int
3610dissect_query_afp_get_session_token(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3611{
3612 uint16_t token;
3613 uint32_t token_len;
3614
3615 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3616
3617 token = tvb_get_ntohs(tvb, offset);
3618 proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3619 offset += 2;
3620 if (token == kLoginWithoutID0 || token == kGetKerberosSessionKey8) /* 0 || 8 */
3621 return offset;
3622
3623 proto_tree_add_item_ret_uint(tree, hf_afp_session_token_len,
3624 tvb, offset, 4, ENC_BIG_ENDIAN0x00000000, &token_len);
3625 offset += 4;
3626
3627 if (token==kLoginWithTimeAndID3 || token==kReconnWithTimeAndID4) {
3628 proto_tree_add_item(tree, hf_afp_session_token_timestamp,
3629 tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3630 offset += 4;
3631 }
3632
3633 if ((uint32_t)offset + token_len > INT_MAX2147483647)
3634 return offset;
3635
3636 proto_tree_add_item(tree, hf_afp_session_token,
3637 tvb, offset, (int)token_len, ENC_NA0x00000000);
3638 offset += (int)token_len;
3639
3640 return offset;
3641}
3642
3643/* -------------------------- */
3644static int
3645dissect_reply_afp_get_session_token(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3646{
3647 int size;
3648 uint32_t token_len;
3649
3650 /* FIXME spec and capture disagree : or it's 4 bytes with no token type, or it's 2 bytes */
3651 size = 4;
3652 /* [cm]: FIXME continued: Since size is set to 4, this test is never true.
3653 if (size == 2) {
3654 proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2, ENC_BIG_ENDIAN);
3655 offset += 2;
3656 }
3657 */
3658 proto_tree_add_item_ret_uint(tree, hf_afp_session_token_len,
3659 tvb, offset, size, ENC_BIG_ENDIAN0x00000000, &token_len);
3660 offset += size;
3661
3662 if ((uint32_t)offset + token_len > INT_MAX2147483647)
3663 return offset;
3664
3665 proto_tree_add_item(tree, hf_afp_session_token,
3666 tvb, offset, (int)token_len, ENC_NA0x00000000);
3667 offset += (int)token_len;
3668
3669 return offset;
3670}
3671
3672/* ************************** */
3673static int * const afp_message_bitmaps[] = {
3674 &hf_afp_message_bitmap_REQ,
3675 &hf_afp_message_bitmap_UTF,
3676 NULL((void*)0)
3677};
3678
3679static int
3680dissect_query_afp_get_server_message(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3681{
3682
3683 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3684 proto_tree_add_item(tree, hf_afp_message_type, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3685 offset += 2;
3686
3687 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_message_bitmap,
3688 ett_afp_message_bitmap, afp_message_bitmaps, ENC_BIG_ENDIAN0x00000000);
3689 offset += 2;
3690
3691 return offset;
3692}
3693
3694/* ************************** */
3695static int
3696dissect_reply_afp_get_server_message(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3697{
3698 uint16_t bitmap;
3699 uint16_t len = 0;
3700
3701 /* FIXME: APF 3.1 specs also specify a long reply format, yet unused */
3702
3703 proto_tree_add_item(tree, hf_afp_message_type, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3704 offset += 2;
3705
3706 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_message_bitmap,
3707 ett_afp_message_bitmap, afp_message_bitmaps, ENC_BIG_ENDIAN0x00000000);
3708 bitmap = tvb_get_ntohs(tvb, offset);
3709 offset += 2;
3710
3711 /*
3712 * XXX - the spec says that the 0x01 bit indicates whether
3713 * the ServerMessage field contains a server message or a login
3714 * message.
3715 */
3716 if (bitmap & 0x02) {
3717 /* Message is UTF-8, and message length is 2 bytes */
3718 proto_tree_add_item_ret_uint16(tree, hf_afp_message_len, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000, &len);
3719 offset += 2;
3720 if (len) {
3721 proto_tree_add_item(tree, hf_afp_message, tvb, offset, len , ENC_UTF_80x00000002);
3722 offset += len;
3723 }
3724 } else {
3725 /*
3726 * Message is not UTF-8, and message length is 1 byte.
3727 *
3728 * Is the message in some Mac encoding? Always Mac Roman,
3729 * or possibly some other encoding for other locales?
3730 */
3731 proto_tree_add_item_ret_uint16(tree, hf_afp_message_len, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000, &len);
3732 offset += 1;
3733 if (len) {
3734 proto_tree_add_item(tree, hf_afp_message, tvb, offset, len , ENC_ASCII0x00000000);
3735 offset += len;
3736 }
3737 }
3738
3739 return offset;
3740}
3741
3742/* ************************** */
3743static int * const afp_user_bitmaps[] = {
3744 &hf_afp_user_bitmap_UID,
3745 &hf_afp_user_bitmap_GID,
3746 &hf_afp_user_bitmap_UUID,
3747 NULL((void*)0)
3748};
3749
3750static int
3751dissect_query_afp_get_user_info(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3752{
3753
3754 proto_tree_add_item(tree, hf_afp_user_flag, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
3755 offset++;
3756
3757 proto_tree_add_item(tree, hf_afp_user_ID, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3758 offset += 4;
3759
3760 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_user_bitmap,
3761 ett_afp_user_bitmap, afp_user_bitmaps, ENC_BIG_ENDIAN0x00000000);
3762 offset += 2;
3763
3764 return offset;
3765}
3766
3767/* -------------------------- */
3768static int
3769dissect_reply_afp_get_user_info(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3770{
3771 uint16_t bitmap;
3772
3773 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_user_bitmap,
3774 ett_afp_user_bitmap, afp_user_bitmaps, ENC_BIG_ENDIAN0x00000000);
3775 bitmap = tvb_get_ntohs(tvb, offset);
3776
3777 offset += 2;
3778 if ((bitmap & 1)) {
3779 proto_tree_add_item(tree, hf_afp_user_ID, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3780 offset += 4;
3781 }
3782
3783 if ((bitmap & 2)) {
3784 proto_tree_add_item(tree, hf_afp_group_ID, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3785 offset += 4;
3786 }
3787
3788 if ((bitmap & 4)) {
3789 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16, ENC_BIG_ENDIAN0x00000000);
3790 offset += 16;
3791 }
3792 return offset;
3793}
3794
3795
3796/* ************************** */
3797static int
3798decode_attr_name (proto_tree *tree, packet_info *pinfo _U___attribute__((unused)), tvbuff_t *tvb, int offset, const char *label)
3799{
3800 int len;
3801
3802 if ((offset & 1))
3803 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3804
3805 len = tvb_get_ntohs(tvb, offset);
3806
3807 if (tree) {
3808 char *name;
3809 proto_tree *sub_tree;
3810
3811 name = tvb_format_text(pinfo->pool, tvb,offset+2, len);
3812 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, len + 2,
3813 ett_afp_extattr_names, NULL((void*)0), label, name);
3814
3815 proto_tree_add_item(sub_tree, hf_afp_extattr_namelen, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3816 proto_tree_add_item(sub_tree, hf_afp_extattr_name, tvb, offset +2, len, ENC_UTF_80x00000002);
3817 }
3818 offset += 2 +len;
3819
3820 return offset;
3821}
3822
3823/* ************************** */
3824static int
3825decode_attr_bitmap (proto_tree *tree, tvbuff_t *tvb, int offset)
3826{
3827 static int * const bitmaps[] = {
3828 &hf_afp_extattr_bitmap_NoFollow,
3829 &hf_afp_extattr_bitmap_Create,
3830 &hf_afp_extattr_bitmap_Replace,
3831 NULL((void*)0)
3832 };
3833
3834 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_extattr_bitmap,
3835 ett_afp_extattr_bitmap, bitmaps, ENC_BIG_ENDIAN0x00000000);
3836 offset += 2;
3837 return offset;
3838}
3839
3840/* ************************** */
3841static int
3842dissect_query_afp_get_ext_attr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3843{
3844 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3845 offset = decode_vol_did(tree, tvb, offset);
3846
3847 offset = decode_attr_bitmap(tree, tvb, offset);
3848
3849 /* 8byte offset */
3850 proto_tree_add_item(tree, hf_afp_offset64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
3851 offset += 8;
3852 /* 8byte reqcount */
3853 proto_tree_add_item(tree, hf_afp_reqcount64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
3854 offset += 8;
3855
3856 /* maxreply */
3857 proto_tree_add_item(tree, hf_afp_extattr_reply_size, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3858 offset += 4;
3859
3860 offset = decode_name(tree, pinfo, tvb, offset);
3861
3862 offset = decode_attr_name(tree, pinfo, tvb, offset, "Attribute: %s");
3863
3864 return offset;
3865}
3866
3867/* -------------------------- */
3868static int
3869dissect_reply_afp_get_ext_attr(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3870{
3871 uint32_t extattr_len;
3872
3873 offset = decode_attr_bitmap(tree, tvb, offset);
3874
3875 proto_tree_add_item_ret_uint(tree, hf_afp_extattr_len,
3876 tvb, offset, 4, ENC_BIG_ENDIAN0x00000000, &extattr_len);
3877 offset += 4;
3878
3879 if ((uint32_t)offset + extattr_len > INT_MAX2147483647)
3880 return offset;
3881
3882 proto_tree_add_item(tree, hf_afp_extattr_data,
3883 tvb, offset, (int)extattr_len, ENC_NA0x00000000);
3884 offset += (int)extattr_len;
3885
3886 return offset;
3887}
3888
3889/* ************************** */
3890static int
3891dissect_query_afp_set_ext_attr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3892{
3893 uint32_t len;
3894
3895 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3896 offset = decode_vol_did(tree, tvb, offset);
3897
3898 offset = decode_attr_bitmap(tree, tvb, offset);
3899
3900 /* 8byte offset */
3901 proto_tree_add_item(tree, hf_afp_offset64, tvb, offset, 8, ENC_BIG_ENDIAN0x00000000);
3902 offset += 8;
3903
3904 offset = decode_name(tree, pinfo, tvb, offset);
3905
3906 offset = decode_attr_name(tree, pinfo, tvb, offset, "Attribute: %s");
3907
3908 proto_tree_add_item_ret_uint(tree, hf_afp_extattr_len, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000, &len);
3909 offset += 4;
3910
3911 proto_tree_add_item(tree, hf_afp_extattr_data, tvb, offset, len, ENC_NA0x00000000);
3912 offset += len;
3913
3914 return offset;
3915}
3916
3917/* ************************** */
3918static int
3919dissect_query_afp_list_ext_attrs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3920{
3921 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3922 offset = decode_vol_did(tree, tvb, offset);
3923
3924 /* for this command only kXAttrNoFollow is valid */
3925 offset = decode_attr_bitmap(tree, tvb, offset);
3926
3927 proto_tree_add_item(tree, hf_afp_extattr_req_count, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
3928 offset += 2;
3929
3930 proto_tree_add_item(tree, hf_afp_extattr_start_index, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3931 offset += 4;
3932
3933 proto_tree_add_item(tree, hf_afp_extattr_reply_size, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
3934 offset += 4;
3935
3936 offset = decode_name(tree, pinfo, tvb, offset);
3937
3938 return offset;
3939}
3940
3941/* -------------------------- */
3942static int
3943dissect_reply_afp_list_ext_attrs(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
3944{
3945 proto_tree *sub_tree;
3946 unsigned len_field = 0;
3947 int length;
3948 int remain;
3949
3950 offset = decode_attr_bitmap(tree, tvb, offset);
3951
3952 proto_tree_add_item_ret_uint(tree, hf_afp_extattr_reply_size,
3953 tvb, offset, 4, ENC_BIG_ENDIAN0x00000000, &len_field);
3954 offset += 4;
3955 if (len_field > INT_MAX2147483647) {
3956 /* XXX - add expert info */
3957 return offset;
3958 }
3959
3960 /* If reply_size was 0 on request, server only reports the size of
3961 the entries without actually adding any entries */
3962 remain = tvb_reported_length_remaining(tvb, offset);
3963 if (remain < (int)len_field)
3964 return offset;
3965
3966 sub_tree = proto_tree_add_subtree(tree, tvb, offset, remain,
3967 ett_afp_extattr_names, NULL((void*)0), "Attributes");
3968 while (remain > 0) {
3969 length = (int)tvb_strsize(tvb, offset);
3970
3971 proto_tree_add_item(sub_tree, hf_afp_extattr_name, tvb, offset, length, ENC_UTF_80x00000002);
3972 offset += length;
3973 remain -= length;
3974 }
3975
3976 return offset;
3977}
3978
3979/* ************************** */
3980static int
3981dissect_query_afp_remove_ext_attr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
3982{
3983 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
3984 offset = decode_vol_did(tree, tvb, offset);
3985
3986 offset = decode_attr_bitmap(tree, tvb, offset);
3987
3988 offset = decode_name(tree, pinfo, tvb, offset);
3989
3990 offset = decode_attr_name(tree, pinfo, tvb, offset, "Attribute: %s");
3991
3992 return offset;
3993}
3994
3995/* ************************** */
3996static int
3997decode_acl_access_bitmap(tvbuff_t *tvb, proto_tree *tree, int offset)
3998{
3999 uint32_t bitmap;
4000 static int * const bitmaps[] = {
4001 &hf_afp_acl_access_bitmap_read_data,
4002 &hf_afp_acl_access_bitmap_write_data,
4003 &hf_afp_acl_access_bitmap_execute,
4004 &hf_afp_acl_access_bitmap_delete,
4005 &hf_afp_acl_access_bitmap_append_data,
4006 &hf_afp_acl_access_bitmap_delete_child,
4007 &hf_afp_acl_access_bitmap_read_attrs,
4008 &hf_afp_acl_access_bitmap_write_attrs,
4009 &hf_afp_acl_access_bitmap_read_extattrs,
4010 &hf_afp_acl_access_bitmap_write_extattrs,
4011 &hf_afp_acl_access_bitmap_read_security,
4012 &hf_afp_acl_access_bitmap_write_security,
4013 &hf_afp_acl_access_bitmap_change_owner,
4014 &hf_afp_acl_access_bitmap_synchronize,
4015 &hf_afp_acl_access_bitmap_generic_all,
4016 &hf_afp_acl_access_bitmap_generic_execute,
4017 &hf_afp_acl_access_bitmap_generic_write,
4018 &hf_afp_acl_access_bitmap_generic_read,
4019 NULL((void*)0)
4020 };
4021
4022 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_acl_access_bitmap,
4023 ett_afp_acl_access_bitmap, bitmaps, ENC_BIG_ENDIAN0x00000000);
4024 bitmap = tvb_get_ntohl(tvb, offset);
4025
4026 return bitmap;
4027}
4028
4029/* ************************** */
4030static int
4031dissect_query_afp_access(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
4032{
4033 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
4034 offset = decode_vol_did(tree, tvb, offset);
4035
4036 proto_tree_add_item(tree, hf_afp_access_bitmap, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
4037 offset += 2;
4038
4039 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16, ENC_BIG_ENDIAN0x00000000);
4040 offset += 16;
4041
4042 decode_acl_access_bitmap(tvb, tree, offset);
4043 offset += 4;
4044
4045 offset = decode_name(tree, pinfo, tvb, offset);
4046
4047 return offset;
4048}
4049
4050/* ************************** */
4051static int
4052dissect_query_afp_with_did(tvbuff_t *tvb, packet_info *pinfo _U___attribute__((unused)), proto_tree *tree, int offset)
4053{
4054 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
4055 offset = decode_vol_did(tree, tvb, offset);
4056
4057 proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4058 offset += 4;
4059
4060 return offset;
4061}
4062
4063/* ************************** */
4064
4065#define SQ_TYPE_NULL0x0000 0x0000
4066#define SQ_TYPE_COMPLEX0x0200 0x0200
4067#define SQ_TYPE_INT640x8400 0x8400
4068#define SQ_TYPE_BOOL0x0100 0x0100
4069#define SQ_TYPE_FLOAT0x8500 0x8500
4070#define SQ_TYPE_DATA0x0700 0x0700
4071#define SQ_TYPE_CNIDS0x8700 0x8700
4072#define SQ_TYPE_UUID0x0e00 0x0e00
4073#define SQ_TYPE_DATE0x8600 0x8600
4074
4075#define SQ_CPX_TYPE_ARRAY0x0a00 0x0a00
4076#define SQ_CPX_TYPE_STRING0x0c00 0x0c00
4077#define SQ_CPX_TYPE_UTF16_STRING0x1c00 0x1c00
4078#define SQ_CPX_TYPE_DICT0x0d00 0x0d00
4079#define SQ_CPX_TYPE_CNIDS0x1a00 0x1a00
4080#define SQ_CPX_TYPE_FILEMETA0x1b00 0x1b00
4081
4082#define SUBQ_SAFETY_LIM20 20
4083
4084static int
4085spotlight_int64(tvbuff_t *tvb, proto_tree *tree, int offset, unsigned encoding)
4086{
4087 unsigned count, i;
4088 uint64_t query_data64;
4089
4090 query_data64 = tvb_get_uint64(tvb, offset, encoding);
4091 count = (unsigned)(query_data64 >> 32);
4092 offset += 8;
4093
4094 for (i = 0; i < count; i++) {
4095 proto_tree_add_item(tree, hf_afp_int64, tvb, offset, 8, encoding);
4096 offset += 8;
4097 }
4098
4099 return count;
4100}
4101
4102static int
4103spotlight_date(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, unsigned encoding)
4104{
4105 unsigned count, i;
4106 uint64_t query_data64;
4107 nstime_t t;
4108
4109 query_data64 = tvb_get_uint64(tvb, offset, encoding);
4110 count = (unsigned)(query_data64 >> 32);
4111 offset += 8;
4112
4113 if (count > SUBQ_SAFETY_LIM20) {
4114 expert_add_info_format(pinfo, tree, &ei_afp_subquery_count_over_safety_limit,
4115 "Subquery count (%d) > safety limit (%d)", count, SUBQ_SAFETY_LIM20);
4116 return -1;
4117 }
4118
4119 for (i = 0; i < count; i++) {
4120 query_data64 = tvb_get_uint64(tvb, offset, encoding) >> 24;
4121 t.secs = (time_t)(query_data64 - SPOTLIGHT_TIME_DELTA280878921600UL);
4122 t.nsecs = 0;
4123 proto_tree_add_time(tree, hf_afp_spotlight_date, tvb, offset, 8, &t);
4124 offset += 8;
4125 }
4126
4127 return count;
4128}
4129
4130static int
4131spotlight_uuid(tvbuff_t *tvb, proto_tree *tree, int offset, unsigned encoding)
4132{
4133 unsigned count, i;
4134 uint64_t query_data64;
4135
4136 query_data64 = tvb_get_uint64(tvb, offset, encoding);
4137 count = (unsigned)(query_data64 >> 32);
4138 offset += 8;
4139
4140 for (i = 0; i < count; i++) {
4141 proto_tree_add_item(tree, hf_afp_spotlight_uuid, tvb, offset, 16, ENC_BIG_ENDIAN0x00000000);
4142 offset += 16;
4143 }
4144
4145 return count;
4146}
4147
4148static int
4149spotlight_float(tvbuff_t *tvb, proto_tree *tree, int offset, unsigned encoding)
4150{
4151 unsigned count, i;
4152 uint64_t query_data64;
4153
4154 query_data64 = tvb_get_uint64(tvb, offset, encoding);
4155 count = (unsigned)(query_data64 >> 32);
4156 offset += 8;
4157
4158 for (i = 0; i < count; i++) {
4159 proto_tree_add_item(tree, hf_afp_float, tvb, offset, 8, encoding);
4160 offset += 8;
4161 }
4162
4163 return count;
4164}
4165
4166static int
4167spotlight_CNID_array(tvbuff_t *tvb, proto_tree *tree, int offset, unsigned encoding)
4168{
4169 unsigned count;
4170 uint64_t query_data64;
4171 uint16_t unknown1;
4172 uint32_t unknown2;
4173
4174 query_data64 = tvb_get_uint64(tvb, offset, encoding);
4175 count = (unsigned)(query_data64 & 0xffff);
4176 unknown1 = (query_data64 & 0xffff0000) >> 16;
4177 unknown2 = (uint32_t)(query_data64 >> 32);
4178
4179 proto_tree_add_uint(tree, hf_afp_unknown16, tvb, offset + 2, 2, unknown1);
4180 proto_tree_add_uint(tree, hf_afp_unknown32, tvb, offset + 4, 4, unknown2);
4181 offset += 8;
4182
4183
4184 while (count --) {
4185 proto_tree_add_item(tree, hf_afp_cnid, tvb, offset, 8, encoding);
4186 offset += 8;
4187 }
4188
4189 return 0;
4190}
4191
4192static const val64_string qtype_string_values[] = {
4193 {SQ_TYPE_NULL0x0000, "null" },
4194 {SQ_TYPE_COMPLEX0x0200, "complex"},
4195 {SQ_TYPE_INT640x8400, "int64" },
4196 {SQ_TYPE_BOOL0x0100, "bool"},
4197 {SQ_TYPE_FLOAT0x8500, "float" },
4198 {SQ_TYPE_DATA0x0700, "data"},
4199 {SQ_TYPE_CNIDS0x8700, "CNIDs" },
4200 {0, NULL((void*)0)}
4201};
4202
4203static const val64_string cpx_qtype_string_values[] = {
4204 {SQ_CPX_TYPE_ARRAY0x0a00, "array" },
4205 {SQ_CPX_TYPE_STRING0x0c00, "string"},
4206 {SQ_CPX_TYPE_UTF16_STRING0x1c00, "utf-16 string" },
4207 {SQ_CPX_TYPE_DICT0x0d00, "dictionary"},
4208 {SQ_CPX_TYPE_CNIDS0x1a00, "CNIDs" },
4209 {SQ_CPX_TYPE_FILEMETA0x1b00, "FileMeta"},
4210 {0, NULL((void*)0)}
4211};
4212
4213static int
4214// NOLINTNEXTLINE(misc-no-recursion)
4215spotlight_dissect_query_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
4216 uint64_t cpx_query_type, int count, int toc_offset, unsigned encoding)
4217{
4218 int i, j;
4219 int subquery_count;
4220 int toc_index;
4221 uint64_t query_data64;
4222 int query_length;
4223 uint64_t query_type;
4224 uint64_t complex_query_type;
4225 tvbuff_t *spotlight_tvb;
4226 char *str_tmp;
4227
4228 proto_item *item_query;
4229 proto_tree *sub_tree;
4230
4231 /*
4232 * This loops through a possibly nested query data structure.
4233 * The outermost one is always without count and called from
4234 * dissect_spotlight() with count = prefs.gui_max_tree_depth
4235 * thus the while (...) loop terminates if (offset >= toc_offset).
4236 * If nested structures are found, these will have an encoded element
4237 * count which is used in a recursive call to
4238 * spotlight_dissect_query_loop as count parameter, thus in this case
4239 * the while (...) loop will terminate when count reaches 0.
4240 */
4241 while ((offset < (toc_offset - 8)) && (count > 0)) {
4242 query_data64 = tvb_get_uint64(tvb, offset, encoding);
4243 query_length = ((int)query_data64 & 0xffff) * 8;
4244 if (query_length == 0) {
4245 /* XXX - report this as an error */
4246 break;
4247 }
4248 query_type = (query_data64 & 0xffff0000) >> 16;
4249
4250 switch (query_type) {
4251 case SQ_TYPE_COMPLEX0x0200:
4252 toc_index = (int)((query_data64 >> 32) - 1);
4253 query_data64 = tvb_get_uint64(tvb, toc_offset + toc_index * 8, encoding);
4254 complex_query_type = (query_data64 & 0xffff0000) >> 16;
4255
4256 switch (complex_query_type) {
4257 case SQ_CPX_TYPE_ARRAY0x0a00:
4258 case SQ_CPX_TYPE_DICT0x0d00:
4259 subquery_count = (int)(query_data64 >> 32);
4260 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, query_length,
4261 ett_afp_spotlight_query_line, NULL((void*)0),
4262 "%s, toc index: %u, children: %u",
4263 val64_to_str_const(complex_query_type, cpx_qtype_string_values, "Unknown"),
4264 toc_index + 1,
4265 subquery_count);
4266 break;
4267 case SQ_CPX_TYPE_STRING0x0c00:
4268 subquery_count = 1;
4269 query_data64 = tvb_get_uint64(tvb, offset + 8, encoding);
4270 query_length = ((int)query_data64 & 0xffff) * 8;
4271 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, query_length + 8,
4272 ett_afp_spotlight_query_line, NULL((void*)0),
4273 "%s, toc index: %u, string: '%s'",
4274 val64_to_str_const(complex_query_type, cpx_qtype_string_values, "Unknown"),
4275 toc_index + 1,
4276 tvb_get_string_enc(pinfo->pool, tvb, offset + 16, query_length - 8, ENC_UTF_80x00000002|ENC_NA0x00000000));
4277 break;
4278 case SQ_CPX_TYPE_UTF16_STRING0x1c00:
4279 /*
4280 * This is an UTF-16 string.
4281 * Dissections show the typical byte order mark 0xFFFE or 0xFEFF, respectively.
4282 * However the existence of such a mark can not be assumed.
4283 * If the mark is missing, big endian encoding is assumed.
4284 * XXX - assume the encoding given by "encoding"?
4285 */
4286
4287 subquery_count = 1;
4288 query_data64 = tvb_get_uint64(tvb, offset + 8, encoding);
4289 query_length = ((int)query_data64 & 0xffff) * 8;
4290
4291 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, query_length + 8,
4292 ett_afp_spotlight_query_line, NULL((void*)0),
4293 "%s, toc index: %u, utf-16 string: '%s'",
4294 val64_to_str_const(complex_query_type, cpx_qtype_string_values, "Unknown"),
4295 toc_index + 1,
4296 tvb_get_string_enc(pinfo->pool, tvb, offset + 16,
4297 query_length - 8, ENC_UTF_160x00000004|ENC_BIG_ENDIAN0x00000000|ENC_BOM0x20000000));
4298 break;
4299 default:
4300 subquery_count = 1;
4301 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, query_length,
4302 ett_afp_spotlight_query_line, NULL((void*)0),
4303 "type: %s (%s), toc index: %u, children: %u",
4304 val64_to_str_const(query_type, qtype_string_values, "Unknown"),
4305 val64_to_str_const(complex_query_type, cpx_qtype_string_values, "Unknown"),
4306 toc_index + 1,
4307 subquery_count);
4308 break;
4309 }
4310
4311 offset += 8;
4312 increment_dissection_depth(pinfo);
4313 offset = spotlight_dissect_query_loop(tvb, pinfo, sub_tree, offset, complex_query_type, subquery_count, toc_offset, encoding);
4314 decrement_dissection_depth(pinfo);
4315 count--;
4316 break;
4317 case SQ_TYPE_NULL0x0000:
4318 subquery_count = (int)(query_data64 >> 32);
4319 if (subquery_count > count) {
4320 item_query = proto_tree_add_item(tree, hf_afp_null, tvb, offset, query_length, ENC_NA0x00000000);
4321 expert_add_info_format(pinfo, item_query, &ei_afp_subquery_count_over_query_count,
4322 "Subquery count (%d) > query count (%d)", subquery_count, count);
4323 count = 0;
4324 } else if (subquery_count > 20) {
4325 item_query = proto_tree_add_item(tree, hf_afp_null, tvb, offset, query_length, ENC_NA0x00000000);
4326 expert_add_info_format(pinfo, item_query, &ei_afp_abnormal_num_subqueries,
4327 "Abnormal number of subqueries (%d)", subquery_count);
4328 count -= subquery_count;
4329 } else {
4330 for (i = 0; i < subquery_count; i++, count--)
4331 proto_tree_add_item(tree, hf_afp_null, tvb, offset, query_length, encoding);
4332 }
4333 offset += query_length;
4334 break;
4335 case SQ_TYPE_BOOL0x0100:
4336 proto_tree_add_uint64_format_value(tree, hf_afp_bool, tvb, offset, query_length, (query_data64 >> 32), "%s", (query_data64 >> 32) ? "true" : "false");
4337 count--;
4338 offset += query_length;
4339 break;
4340 case SQ_TYPE_INT640x8400:
4341 sub_tree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_afp_spotlight_query_line, NULL((void*)0), "int64");
4342 j = spotlight_int64(tvb, sub_tree, offset, encoding);
4343 count -= j;
4344 offset += query_length;
4345 break;
4346 case SQ_TYPE_UUID0x0e00:
4347 sub_tree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_afp_spotlight_query_line, NULL((void*)0), "UUID");
4348 j = spotlight_uuid(tvb, sub_tree, offset, encoding);
4349 count -= j;
4350 offset += query_length;
4351 break;
4352 case SQ_TYPE_FLOAT0x8500:
4353 sub_tree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_afp_spotlight_query_line, NULL((void*)0), "float");
4354 j = spotlight_float(tvb, sub_tree, offset, encoding);
4355 count -= j;
4356 offset += query_length;
4357 break;
4358 case SQ_TYPE_DATA0x0700:
4359 switch (cpx_query_type) {
4360 case SQ_CPX_TYPE_STRING0x0c00:
4361 str_tmp = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset + 8, query_length - 8, ENC_UTF_80x00000002|ENC_NA0x00000000);
4362 proto_tree_add_string(tree, hf_afp_string, tvb, offset, query_length, str_tmp);
4363 break;
4364 case SQ_CPX_TYPE_UTF16_STRING0x1c00: {
4365 /* description see above */
4366 str_tmp = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset + 8, query_length - 8, ENC_UTF_160x00000004|ENC_BIG_ENDIAN0x00000000|ENC_BOM0x20000000);
4367 proto_tree_add_string(tree, hf_afp_utf_16_string, tvb, offset, query_length, str_tmp);
4368 break;
4369 }
4370 case SQ_CPX_TYPE_FILEMETA0x1b00:
4371 sub_tree = proto_tree_add_subtree(tree, tvb, offset, query_length,
4372 ett_afp_spotlight_query_line, &item_query, "filemeta");
4373 if (query_length <= 8) {
4374 proto_item_append_text(item_query, " (empty)");
4375 } else {
4376 spotlight_tvb = tvb_new_subset_length(tvb, offset+8, query_length);
4377 call_dissector(spotlight_handle, spotlight_tvb, pinfo, sub_tree);
4378 }
4379 break;
4380 }
4381 count--;
4382 offset += query_length;
4383 break;
4384 case SQ_TYPE_CNIDS0x8700:
4385 sub_tree = proto_tree_add_subtree(tree, tvb, offset, query_length,
4386 ett_afp_spotlight_query_line, &item_query, "CNID Array");
4387 if (query_length <= 8) {
4388 proto_item_append_text(item_query, " (empty)");
4389 } else {
4390 spotlight_CNID_array(tvb, sub_tree, offset + 8, encoding);
4391 }
4392 count--;
4393 offset += query_length;
4394 break;
4395 case SQ_TYPE_DATE0x8600:
4396 if ((j = spotlight_date(tvb, pinfo, tree, offset, encoding)) == -1)
4397 return offset;
4398 count -= j;
4399 offset += query_length;
4400 break;
4401 default:
4402 proto_tree_add_string(tree, hf_afp_query_type, tvb, offset, query_length, val64_to_str_const(query_type, qtype_string_values, "Unknown"));
4403 count--;
4404 offset += query_length;
4405 break;
4406 }
4407 }
4408
4409 return offset;
4410}
4411
4412static const val64_string endian_vals[] = {
4413 {0, "Little Endian" },
4414 {1, "Big Endian" },
4415 {0, NULL((void*)0) } };
4416
4417static int
4418dissect_spotlight(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U___attribute__((unused)))
4419{
4420 unsigned encoding;
4421 int i;
4422 unsigned offset = 0;
4423 uint64_t toc_offset;
4424 uint64_t querylen;
4425 int toc_entries;
4426 uint64_t toc_entry;
4427
4428 proto_tree *sub_tree_queries;
4429 proto_tree *sub_tree_toc;
4430 proto_item *ti;
4431
4432 if (strncmp((char*)tvb_get_string_enc(pinfo->pool, tvb, offset, 8, ENC_UTF_80x00000002|ENC_NA0x00000000), "md031234", 8) == 0)
4433 encoding = ENC_BIG_ENDIAN0x00000000;
4434 else
4435 encoding = ENC_LITTLE_ENDIAN0x80000000;
4436 proto_tree_add_uint64(tree, hf_afp_endianness, tvb, offset, 8, (encoding == ENC_BIG_ENDIAN0x00000000));
4437 offset += 8;
4438
4439 toc_offset = (tvb_get_uint64(tvb, offset, encoding) >> 32) * 8;
4440 if (toc_offset < 8) {
4441 ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset);
4442 expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64"l" "u" " < 8 (bogus)", toc_offset);
4443 return tvb_captured_length(tvb);
4444 }
4445 toc_offset -= 8;
4446 if (offset + toc_offset + 8 > INT_MAX2147483647) {
4447 ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset);
4448 expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64"l" "u" " > %u (bogus)", toc_offset, INT_MAX2147483647 - 8 - offset);
4449 return tvb_captured_length(tvb);
4450 }
4451 querylen = (tvb_get_uint64(tvb, offset, encoding) & 0xffffffff) * 8;
4452 if (querylen < 8) {
4453 ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset);
4454 expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64"l" "u" " Bytes, Query length: %" PRIu64"l" "u" " < 8 (bogus)",
4455 toc_offset, querylen);
4456 return tvb_captured_length(tvb);
4457 }
4458 querylen -= 8;
4459 if (querylen > INT_MAX2147483647) {
4460 ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset);
4461 expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64"l" "u" " Bytes, Query length: %" PRIu64"l" "u" " > %u (bogus)",
4462 toc_offset, querylen, INT_MAX2147483647);
4463 return tvb_captured_length(tvb);
4464 }
4465 proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset);
4466 proto_tree_add_uint64(tree, hf_afp_query_len, tvb, offset, 8, querylen);
4467 offset += 8;
4468
4469 toc_entries = (int)(tvb_get_uint64(tvb, offset + (int)toc_offset, encoding) & 0xffff);
4470
4471 sub_tree_queries = proto_tree_add_subtree(tree, tvb, offset, (int)toc_offset,
4472 ett_afp_spotlight_queries, NULL((void*)0),
4473 "Spotlight RPC data");
4474
4475 /* Queries */
4476 offset = spotlight_dissect_query_loop(tvb, pinfo, sub_tree_queries, offset, SQ_CPX_TYPE_ARRAY0x0a00, prefs.gui_max_tree_depth, offset + (int)toc_offset + 8, encoding);
4477
4478 /* ToC */
4479 sub_tree_toc = proto_tree_add_subtree_format(tree, tvb, offset,
4480 (int)querylen - (int)toc_offset,
4481 ett_afp_spotlight_toc, &ti,
4482 "Complex types ToC (%u entries)",
4483 toc_entries);
4484 if (toc_entries < 1) {
4485 proto_item_append_text(ti, " (%u < 1 - bogus)", toc_entries);
4486 return tvb_captured_length(tvb);
4487 }
4488 proto_item_append_text(ti, " (%u entries)", toc_entries);
4489
4490 toc_entries -= 1;
4491 proto_tree_add_uint(sub_tree_toc, hf_afp_num_toc_entries, tvb, offset, 2, toc_entries);
4492 proto_tree_add_item(sub_tree_toc, hf_afp_unknown16, tvb, offset + 2, 2, ENC_BIG_ENDIAN0x00000000);
4493 proto_tree_add_item(sub_tree_toc, hf_afp_unknown32, tvb, offset + 4, 4, ENC_BIG_ENDIAN0x00000000);
4494
4495 offset += 8;
4496 for (i = 0; i < toc_entries; i++, offset += 8) {
4497 toc_entry = tvb_get_uint64(tvb, offset, encoding);
4498 switch((toc_entry & 0xffff0000) >> 16)
4499 {
4500 case SQ_CPX_TYPE_ARRAY0x0a00:
4501 case SQ_CPX_TYPE_DICT0x0d00:
4502 proto_tree_add_uint64_format(sub_tree_toc, hf_afp_toc_entry, tvb, offset, 8, toc_entry,
4503 "%u: count: %" PRIu64"l" "u" ", type: %s, offset: %" PRIu64"l" "u",
4504 i+1, toc_entry >> 32, val64_to_str_const((toc_entry & 0xffff0000) >> 16, cpx_qtype_string_values, "Unknown"),
4505 (toc_entry & 0xffff) * 8);
4506 break;
4507 case SQ_CPX_TYPE_STRING0x0c00:
4508 case SQ_CPX_TYPE_UTF16_STRING0x1c00:
4509 proto_tree_add_uint64_format(sub_tree_toc, hf_afp_toc_entry, tvb, offset, 8, toc_entry,
4510 "%u: pad byte count: %" PRIx64"l" "x" ", type: %s, offset: %" PRIu64"l" "u",
4511 i+1, 8 - (toc_entry >> 32), val64_to_str_const((toc_entry & 0xffff0000) >> 16, cpx_qtype_string_values, "Unknown"),
4512 (toc_entry & 0xffff) * 8);
4513 break;
4514 default:
4515 proto_tree_add_uint64_format(sub_tree_toc, hf_afp_toc_entry, tvb, offset, 8, toc_entry,
4516 "%u: unknown: 0x%08" PRIx64"l" "x" ", type: %s, offset: %" PRIu64"l" "u",
4517 i+1, toc_entry >> 32, val64_to_str_const((toc_entry & 0xffff0000) >> 16, cpx_qtype_string_values, "Unknown"),
4518 (toc_entry & 0xffff) * 8);
4519 }
4520 }
4521
4522 return offset;
4523}
4524
4525static int
4526dissect_query_afp_spotlight(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, afp_request_val *request_val)
4527{
4528 unsigned len;
4529 tvbuff_t *spotlight_tvb;
4530
4531 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
4532 offset = decode_vol(tree, tvb, offset);
4533
4534 proto_tree_add_item(tree, hf_afp_spotlight_request_flags, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4535 offset += 4;
4536
4537 proto_tree_add_item(tree, hf_afp_spotlight_request_command, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4538 offset += 4;
4539
4540 proto_tree_add_item(tree, hf_afp_spotlight_request_reserved, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4541 offset += 4;
4542
4543 switch (request_val->spotlight_req_command) {
4544
4545 case SPOTLIGHT_CMD_GET_VOLPATH4:
4546 tvb_get_stringz_enc(pinfo->pool, tvb, offset, &len, ENC_UTF_80x00000002|ENC_NA0x00000000);
4547 proto_tree_add_item(tree, hf_afp_spotlight_volpath_client, tvb, offset, len, ENC_UTF_80x00000002);
4548 offset += len;
4549 break;
4550
4551 case SPOTLIGHT_CMD_GET_VOLID2:
4552 /* empty */
4553 break;
4554
4555 case SPOTLIGHT_CMD_GET_THREE3:
4556 proto_tree_add_item(tree, hf_afp_spotlight_volflags, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4557 offset += 4;
4558
4559 proto_tree_add_item(tree, hf_afp_spotlight_reqlen, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4560 offset += 4;
4561
4562 spotlight_tvb = tvb_new_subset_remaining(tvb, offset);
4563 offset += call_dissector(spotlight_handle, spotlight_tvb, pinfo, tree);
4564 break;
4565 }
4566 return offset;
4567}
4568
4569/* ************************** */
4570static uint16_t
4571decode_acl_list_bitmap(tvbuff_t *tvb, proto_tree *tree, int offset)
4572{
4573 uint16_t bitmap;
4574 static int * const bitmaps[] = {
4575 &hf_afp_acl_list_bitmap_UUID,
4576 &hf_afp_acl_list_bitmap_GRPUUID,
4577 &hf_afp_acl_list_bitmap_ACL,
4578 &hf_afp_acl_list_bitmap_REMOVEACL,
4579 &hf_afp_acl_list_bitmap_Inherit,
4580 NULL((void*)0)
4581 };
4582
4583 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_acl_list_bitmap,
4584 ett_afp_acl_list_bitmap, bitmaps, ENC_BIG_ENDIAN0x00000000);
4585 bitmap = tvb_get_ntohs(tvb, offset);
4586 return bitmap;
4587}
4588
4589
4590/* ************************** */
4591static uint32_t
4592decode_ace_flags_bitmap(tvbuff_t *tvb, proto_tree *tree, int offset)
4593{
4594 uint32_t bitmap;
4595
4596 static int * const bitmaps[] = {
4597 &hf_afp_ace_flags_allow,
4598 &hf_afp_ace_flags_deny,
4599 &hf_afp_ace_flags_inherited,
4600 &hf_afp_ace_flags_fileinherit,
4601 &hf_afp_ace_flags_dirinherit,
4602 &hf_afp_ace_flags_limitinherit,
4603 &hf_afp_ace_flags_onlyinherit,
4604 NULL((void*)0)
4605 };
4606
4607 proto_tree_add_bitmask(tree, tvb, offset, hf_afp_ace_flags,
4608 ett_afp_ace_flags, bitmaps, ENC_BIG_ENDIAN0x00000000);
4609 bitmap = tvb_get_ntohl(tvb, offset);
4610
4611 return bitmap;
4612}
4613
4614static int
4615decode_kauth_ace(tvbuff_t *tvb, proto_tree *tree, int offset)
4616{
4617 /* FIXME: preliminary decoding... */
4618 if (tree) {
4619 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16, ENC_BIG_ENDIAN0x00000000);
4620 offset += 16;
4621
4622 decode_ace_flags_bitmap(tvb, tree, offset);
4623 offset += 4;
4624
4625 decode_acl_access_bitmap(tvb, tree, offset);
4626 offset += 4;
4627 }
4628 else {
4629 offset += 24;
4630 }
4631 return offset;
4632}
4633
4634#define AFP_MAX_ACL_ENTRIES500 500 /* Arbitrary. */
4635static int
4636decode_kauth_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
4637{
4638 uint32_t num_entries, i;
4639 proto_tree *sub_tree, *ace_tree;
4640 proto_item *item;
4641
4642 item = proto_tree_add_item_ret_uint(tree, hf_afp_acl_entrycount,
4643 tvb, offset, 4, ENC_BIG_ENDIAN0x00000000, &num_entries);
4644 sub_tree = proto_item_add_subtree(item, ett_afp_ace_entries);
4645 offset += 4;
4646
4647 proto_tree_add_item(tree, hf_afp_acl_flags, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4648 offset += 4;
4649
4650 if (num_entries > AFP_MAX_ACL_ENTRIES500) {
4651 expert_add_info_format(pinfo, item, &ei_afp_too_many_acl_entries,
4652 "Too many ACL entries (%u). Stopping dissection.",
4653 num_entries);
4654 return offset;
4655 }
4656
4657 for (i = 0; i < num_entries; i++) {
4658 ace_tree = proto_tree_add_subtree_format(sub_tree, tvb, offset, 24, ett_afp_ace_entry, NULL((void*)0), "ACE: %u", i);
4659 offset = decode_kauth_ace(tvb, ace_tree, offset);
4660 }
4661
4662 return offset;
4663}
4664
4665static int
4666decode_uuid_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, uint16_t bitmap)
4667{
4668 if ((offset & 1))
4669 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
4670
4671 if ((bitmap & kFileSec_UUID(1U << 0))) {
4672 proto_tree_add_item(tree, hf_afp_UUID, tvb, offset, 16, ENC_BIG_ENDIAN0x00000000);
4673 offset += 16;
4674 }
4675
4676 if ((bitmap & kFileSec_GRPUUID(1U << 1))) {
4677 proto_tree_add_item(tree, hf_afp_GRPUUID, tvb, offset, 16, ENC_BIG_ENDIAN0x00000000);
4678 offset += 16;
4679 }
4680
4681 if ((bitmap & kFileSec_ACL(1U << 2))) {
4682 offset = decode_kauth_acl(tvb, pinfo, tree, offset);
4683 }
4684
4685 return offset;
4686}
4687
4688/* ************************** */
4689static int
4690dissect_query_afp_set_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
4691{
4692 uint16_t bitmap;
4693
4694 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
4695 offset = decode_vol_did(tree, tvb, offset);
4696
4697 bitmap = decode_acl_list_bitmap(tvb, tree, offset);
4698 offset += 2;
4699
4700 offset = decode_name(tree, pinfo, tvb, offset);
4701
4702 offset = decode_uuid_acl(tvb, pinfo, tree, offset, bitmap);
4703
4704 return offset;
4705}
4706
4707/* ************************** */
4708static int
4709dissect_query_afp_get_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
4710{
4711 PAD(1){ proto_tree_add_item(tree, hf_afp_pad, tvb, offset, 1, 0x00000000
); offset += 1; }
;
4712 offset = decode_vol_did(tree, tvb, offset);
4713
4714 decode_acl_list_bitmap(tvb, tree, offset);
4715 offset += 2;
4716
4717 proto_tree_add_item(tree, hf_afp_max_reply_size32, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4718 offset += 4;
4719
4720 offset = decode_name(tree, pinfo, tvb, offset);
4721
4722 return offset;
4723}
4724
4725/* -------------------------- */
4726static int
4727dissect_reply_afp_get_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
4728{
4729 uint16_t bitmap;
4730
4731 bitmap = decode_acl_list_bitmap(tvb, tree, offset);
4732 offset += 2;
4733
4734 offset = decode_uuid_acl(tvb, pinfo, tree, offset, bitmap);
4735
4736 return offset;
4737}
4738
4739/* ************************** */
4740static int
4741dissect_reply_afp_spotlight(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, afp_request_val *request_val)
4742{
4743 unsigned len;
4744 tvbuff_t *spotlight_tvb;
4745
4746 switch (request_val->spotlight_req_command) {
4747
4748 case SPOTLIGHT_CMD_GET_VOLPATH4:
4749 proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4750 offset += 4;
4751
4752 proto_tree_add_item(tree, hf_afp_spotlight_reply_reserved, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4753 offset += 4;
4754
4755 tvb_get_stringz_enc(pinfo->pool, tvb, offset, &len, ENC_UTF_80x00000002|ENC_NA0x00000000);
4756 proto_tree_add_item(tree, hf_afp_spotlight_volpath_server, tvb, offset, len, ENC_UTF_80x00000002);
4757 offset += len;
4758 break;
4759
4760 case SPOTLIGHT_CMD_GET_VOLID2:
4761 proto_tree_add_item(tree, hf_afp_spotlight_volflags, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4762 offset += 4;
4763 break;
4764
4765 case SPOTLIGHT_CMD_GET_THREE3:
4766 proto_tree_add_item(tree, hf_afp_spotlight_returncode, tvb, offset, 4, ENC_BIG_ENDIAN0x00000000);
4767 offset += 4;
4768
4769 spotlight_tvb = tvb_new_subset_remaining(tvb, offset);
4770 offset += call_dissector(spotlight_handle, spotlight_tvb, pinfo, tree);
4771 break;
4772 }
4773 return offset;
4774}
4775
4776/* -----------------------------
4777 from netatalk/etc/afpd/status.c
4778*/
4779
4780/* server flags */
4781#define AFPSRVRINFO_COPY(1<<0) (1<<0) /* supports copyfile */
4782#define AFPSRVRINFO_PASSWD(1<<1) (1<<1) /* supports change password */
4783#define AFPSRVRINFO_NOSAVEPASSWD(1<<2) (1<<2) /* don't allow save password */
4784#define AFPSRVRINFO_SRVMSGS(1<<3) (1<<3) /* supports server messages */
4785#define AFPSRVRINFO_SRVSIGNATURE(1<<4) (1<<4) /* supports server signature */
4786#define AFPSRVRINFO_TCPIP(1<<5) (1<<5) /* supports tcpip */
4787#define AFPSRVRINFO_SRVNOTIFY(1<<6) (1<<6) /* supports server notifications */
4788#define AFPSRVRINFO_SRVRECONNECT(1<<7) (1<<7) /* supports reconnect */
4789#define AFPSRVRINFO_SRVDIRECTORY(1<<8) (1<<8) /* supports directory services */
4790#define AFPSRVRINFO_SRVUTF8(1<<9) (1<<9) /* supports UTF8 names AFP 3.1 */
4791#define AFPSRVRINFO_UUID(1<<10) (1<<10) /* supports UUIDs AFP 3.2 */
4792#define AFPSRVRINFO_EXT_SLEEP(1<<11) (1<<11) /* supports extended sleep, AFP 3.3 */
4793#define AFPSRVRINFO_FASTBOZO(1<<15) (1<<15) /* fast copying */
4794
4795#define AFPSTATUS_MACHOFF0 0
4796#define AFPSTATUS_VERSOFF2 2
4797#define AFPSTATUS_UAMSOFF4 4
4798#define AFPSTATUS_ICONOFF6 6
4799#define AFPSTATUS_FLAGOFF8 8
4800#define AFPSTATUS_PRELEN10 10
4801#define AFPSTATUS_POSTLEN4 4
4802#define AFPSTATUS_LEN(10 + 4) (AFPSTATUS_PRELEN10 + AFPSTATUS_POSTLEN4)
4803
4804#define INET6_ADDRLEN16 16
4805
4806static int
4807dissect_afp_server_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U___attribute__((unused)))
4808{
4809 int offset = 0;
4810 proto_tree *sub_tree;
4811
4812 uint16_t flag;
4813 uint8_t server_name_len;
4814 uint16_t sign_ofs = 0;
4815 uint16_t adr_ofs = 0;
4816 uint16_t dir_ofs = 0;
4817 uint16_t utf_ofs = 0;
4818 int variable_data_offset;
4819 uint8_t nbe;
4820 unsigned len;
4821 unsigned i;
4822
4823 static int * const flags[] = {
4824 &hf_afp_server_flag_copyfile,
4825 &hf_afp_server_flag_passwd,
4826 &hf_afp_server_flag_no_save_passwd,
4827 &hf_afp_server_flag_srv_msg,
4828 &hf_afp_server_flag_srv_sig,
4829 &hf_afp_server_flag_tcpip,
4830 &hf_afp_server_flag_notify,
4831 &hf_afp_server_flag_reconnect,
4832 &hf_afp_server_flag_directory,
4833 &hf_afp_server_flag_utf8_name,
4834 &hf_afp_server_flag_uuid,
4835 &hf_afp_server_flag_ext_sleep,
4836 &hf_afp_server_flag_fast_copy,
4837 NULL((void*)0)
4838 };
4839
4840 tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_afp_status, NULL((void*)0), "Get Status");
4841
4842 proto_tree_add_item(tree, hf_afp_machine_offset, tvb, AFPSTATUS_MACHOFF0, 2, ENC_BIG_ENDIAN0x00000000);
4843
4844 proto_tree_add_item(tree, hf_afp_version_offset, tvb, AFPSTATUS_VERSOFF2, 2, ENC_BIG_ENDIAN0x00000000);
4845
4846 proto_tree_add_item(tree, hf_afp_uams_offset, tvb, AFPSTATUS_UAMSOFF4, 2, ENC_BIG_ENDIAN0x00000000);
4847
4848 proto_tree_add_item(tree, hf_afp_icon_offset, tvb, AFPSTATUS_ICONOFF6, 2, ENC_BIG_ENDIAN0x00000000);
4849
4850 flag = tvb_get_ntohs(tvb, AFPSTATUS_FLAGOFF8);
4851
4852 proto_tree_add_bitmask(tree, tvb, AFPSTATUS_FLAGOFF8, hf_afp_server_flag,
4853 ett_afp_status_server_flag, flags, ENC_BIG_ENDIAN0x00000000);
4854
4855 offset = AFPSTATUS_PRELEN10;
4856 server_name_len = tvb_get_uint8(tvb, offset);
4857 proto_tree_add_item(tree, hf_afp_server_name, tvb, offset, 1, ENC_ASCII0x00000000|ENC_BIG_ENDIAN0x00000000);
4858 offset += 1 + server_name_len; /* 1 for the length byte */
4859
4860 if ((flag & AFPSRVRINFO_SRVSIGNATURE(1<<4))) {
4861 if ((offset & 1))
4862 offset++;
4863 sign_ofs = tvb_get_ntohs(tvb, offset);
4864 proto_tree_add_item(tree, hf_afp_signature_offset, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
4865 offset += 2;
4866 }
4867
4868 if ((flag & AFPSRVRINFO_TCPIP(1<<5))) {
4869 if ((offset & 1))
4870 offset++;
4871 adr_ofs = tvb_get_ntohs(tvb, offset);
4872 proto_tree_add_item(tree, hf_afp_network_address_offset, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
4873 offset += 2;
4874 }
4875
4876 if ((flag & AFPSRVRINFO_SRVDIRECTORY(1<<8))) {
4877 if ((offset & 1))
4878 offset++;
4879 dir_ofs = tvb_get_ntohs(tvb, offset);
4880 proto_tree_add_item(tree, hf_afp_directory_services_offset, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
4881 offset += 2;
4882 }
4883
4884 if ((flag & AFPSRVRINFO_SRVUTF8(1<<9))) {
4885 if ((offset & 1))
4886 offset++;
4887 utf_ofs = tvb_get_ntohs(tvb, offset);
4888 proto_tree_add_item(tree, hf_afp_utf8_server_name_offset, tvb, offset, 2, ENC_BIG_ENDIAN0x00000000);
4889 offset += 2;
4890 }
4891
4892 /*
4893 * XXX - should also check for overlap between "variable data" fields;
4894 * that requires keeping all the offsets and lengths and checking
4895 * against all the ones we've dissected so far.
4896 *
4897 * XXX - should report an error if there's overlap, rather than
4898 * just ignoring the field.
4899 */
4900 variable_data_offset = offset;
4901 offset = tvb_get_ntohs(tvb, AFPSTATUS_MACHOFF0);
4902 if (offset) {
4903 if (offset >= variable_data_offset) {
4904 proto_tree_add_item(tree, hf_afp_server_type, tvb, offset, 1, ENC_ASCII0x00000000|ENC_BIG_ENDIAN0x00000000);
4905 }
4906 }
4907
4908 offset = tvb_get_ntohs(tvb, AFPSTATUS_VERSOFF2);
4909 if (offset) {
4910 if (offset >= variable_data_offset) {
4911 nbe = tvb_get_uint8(tvb, offset);
4912 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1,
4913 ett_afp_vers, NULL((void*)0), "Version list: %u", nbe);
4914 offset++;
4915 for (i = 0; i < nbe; i++) {
4916 len = tvb_get_uint8(tvb, offset);
4917 proto_tree_add_item(sub_tree, hf_afp_server_vers, tvb, offset, 1, ENC_ASCII0x00000000|ENC_BIG_ENDIAN0x00000000);
4918 offset += len + 1;
4919 }
4920 }
4921 }
4922
4923 offset = tvb_get_ntohs(tvb, AFPSTATUS_UAMSOFF4);
4924 if (offset) {
4925 if (offset >= variable_data_offset) {
4926 nbe = tvb_get_uint8(tvb, offset);
4927 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1,
4928 ett_afp_uams, NULL((void*)0), "UAMS list: %u", nbe);
4929 offset++;
4930 for (i = 0; i < nbe; i++) {
4931 len = tvb_get_uint8(tvb, offset);
4932 proto_tree_add_item(sub_tree, hf_afp_server_uams, tvb, offset, 1, ENC_ASCII0x00000000|ENC_BIG_ENDIAN0x00000000);
4933 offset += len + 1;
4934 }
4935 }
4936 }
4937
4938 offset = tvb_get_ntohs(tvb, AFPSTATUS_ICONOFF6);
4939 if (offset) {
4940 if (offset >= variable_data_offset)
4941 proto_tree_add_item(tree, hf_afp_server_icon, tvb, offset, 256, ENC_NA0x00000000);
4942 }
4943
4944 if ((flag & AFPSRVRINFO_SRVSIGNATURE(1<<4))) {
4945 if (sign_ofs >= variable_data_offset)
4946 proto_tree_add_item(tree, hf_afp_server_signature, tvb, sign_ofs, 16, ENC_NA0x00000000);
4947 }
4948
4949 if ((flag & AFPSRVRINFO_TCPIP(1<<5))) {
4950 if (adr_ofs >= variable_data_offset) {
4951 proto_tree *adr_tree;
4952 unsigned char *tmp;
4953 uint16_t net;
4954 uint8_t node;
4955 uint16_t port;
4956
4957 offset = adr_ofs;
4958 nbe = tvb_get_uint8(tvb, offset);
4959 adr_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1,
4960 ett_afp_server_addr, NULL((void*)0), "Address list: %d", nbe);
4961 offset++;
4962 for (i = 0; i < nbe; i++) {
4963 uint8_t type;
4964
4965 len = tvb_get_uint8(tvb, offset);
4966 type = tvb_get_uint8(tvb, offset +1);
4967 switch (type) {
4968 case 1: /* IP */
4969 sub_tree = proto_tree_add_subtree_format(adr_tree, tvb, offset, len, ett_afp_server_addr_line, NULL((void*)0), "IP: %s", tvb_ip_to_str(pinfo->pool, tvb, offset+2)tvb_address_to_str(pinfo->pool, tvb, AT_IPv4, offset+2));
4970 break;
4971 case 2: /* IP + port */
4972 port = tvb_get_ntohs(tvb, offset+6);
4973 sub_tree = proto_tree_add_subtree_format(adr_tree, tvb, offset, len,
4974 ett_afp_server_addr_line, NULL((void*)0),
4975 "IP: %s:%d", tvb_ip_to_str(pinfo->pool, tvb, offset+2)tvb_address_to_str(pinfo->pool, tvb, AT_IPv4, offset+2), port);
4976 break;
4977 case 3: /* DDP, atalk_addr_to_str want host order not network */
4978 net = tvb_get_ntohs(tvb, offset+2);
4979 node = tvb_get_uint8(tvb, offset +4);
4980 port = tvb_get_uint8(tvb, offset +5);
4981 sub_tree = proto_tree_add_subtree_format(adr_tree, tvb, offset, len,
4982 ett_afp_server_addr_line, NULL((void*)0),
4983 "DDP: %u.%u:%u", net, node, port);
4984 break;
4985 case 4: /* DNS */
4986 case 5: /* SSH tunnel */
4987 /*
4988 * The AFP specification says of
4989 * the SSH tunnel type:
4990 *
4991 * IP address (four bytes) with port
4992 * number (2 bytes). If this tag is
4993 * present and the client is so
4994 * configured, the client attempts
4995 * to build a Secure Shell (SSH)
4996 * tunnel between itself and the
4997 * server and tries to connect
4998 * through it. This functionality
4999 * is deprecated.
5000 *
5001 * and, in the only place I've seen
5002 * it, it was like DNS.
5003 *
5004 * So we treat it as DNS.
5005 *
5006 * XXX - should we treat it as
5007 * IP+port if this is transported
5008 * over ASP rather DSI? The old
5009 * ASP code to dissect this
5010 * dissected it as IP+port.
5011 */
5012 if (len > 2) {
5013 /* XXX - internationalized DNS? */
5014 tmp = tvb_get_string_enc(pinfo->pool, tvb, offset +2, len -2, ENC_ASCII0x00000000|ENC_NA0x00000000);
5015 sub_tree = proto_tree_add_subtree_format(adr_tree, tvb, offset, len, ett_afp_server_addr_line, NULL((void*)0), "%s: %s", (type==4)?"DNS":"IP (SSH tunnel)", tmp);
5016 break;
5017 }
5018 else {
5019 sub_tree = proto_tree_add_subtree(adr_tree, tvb, offset, len,
5020 ett_afp_server_addr_line, NULL((void*)0), "Malformed DNS address");
5021 }
5022 break;
5023 case 6: /* IP6 */
5024 sub_tree = proto_tree_add_subtree_format(adr_tree, tvb, offset, len, ett_afp_server_addr_line, NULL((void*)0), "IPv6: %s", tvb_ip6_to_str(pinfo->pool, tvb, offset+2)tvb_address_to_str(pinfo->pool, tvb, AT_IPv6, offset+2));
5025 break;
5026 case 7: /* IP6 + 2bytes port */
5027 port = tvb_get_ntohs(tvb, offset+ 2+INET6_ADDRLEN16);
5028 sub_tree = proto_tree_add_subtree_format(adr_tree, tvb, offset, len,
5029 ett_afp_server_addr_line, NULL((void*)0),
5030 "IPv6: %s:%d", tvb_ip6_to_str(pinfo->pool, tvb, offset+2)tvb_address_to_str(pinfo->pool, tvb, AT_IPv6, offset+2), port);
5031 break;
5032 default:
5033 sub_tree = proto_tree_add_subtree_format(adr_tree, tvb, offset, len, ett_afp_server_addr_line, NULL((void*)0), "Unknown type: %u", type);
5034 break;
5035 }
5036 len -= 2;
5037 proto_tree_add_item(sub_tree, hf_afp_server_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
5038 offset++;
5039 proto_tree_add_item(sub_tree, hf_afp_server_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN0x00000000);
5040 offset++;
5041 proto_tree_add_item(sub_tree, hf_afp_server_addr_value,tvb, offset, len, ENC_NA0x00000000);
5042 offset += len;
5043 }
5044 }
5045 }
5046
5047 if ((flag & AFPSRVRINFO_SRVDIRECTORY(1<<8))) {
5048 if (dir_ofs >= variable_data_offset) {
5049 offset = dir_ofs;
5050 nbe = tvb_get_uint8(tvb, offset);
5051 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1,
5052 ett_afp_directory, NULL((void*)0), "Directory services list: %d", nbe);
5053 offset++;
5054 for (i = 0; i < nbe; i++) {
5055 len = tvb_get_uint8(tvb, offset);
5056 proto_tree_add_item(sub_tree, hf_afp_server_directory, tvb, offset, 1, ENC_ASCII0x00000000|ENC_BIG_ENDIAN0x00000000);
5057 offset += len + 1;
5058 }
5059 }
5060 }
5061
5062 if ((flag & AFPSRVRINFO_SRVUTF8(1<<9))) {
5063 if (utf_ofs >= variable_data_offset) {
5064 uint16_t ulen;
5065 char *tmp;
5066
5067 offset = utf_ofs;
5068 ulen = tvb_get_ntohs(tvb, offset);
5069 tmp = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset + 2, ulen, ENC_UTF_80x00000002|ENC_NA0x00000000);
5070 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, ulen + 2,
5071 ett_afp_utf8_name, NULL((void*)0), "UTF-8 server name: %s", tmp);
5072 proto_tree_add_uint(sub_tree, hf_afp_utf8_server_name_len, tvb, offset, 2, ulen);
5073 offset += 2;
5074 proto_tree_add_string(sub_tree, hf_afp_utf8_server_name, tvb, offset, ulen, tmp);
5075 offset += ulen;
5076 }
5077 }
5078
5079 return offset;
5080}
5081
5082/* ************************** */
5083static int
5084dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
5085{
5086 struct atp_asp_dsi_info *atp_asp_dsi_info = (struct atp_asp_dsi_info*)data;
5087 proto_tree *afp_tree = NULL((void*)0);
5088 proto_item *ti;
5089 conversation_t *conversation;
5090 int offset = 0;
5091 afp_request_key request_key, *new_request_key;
5092 afp_request_val *request_val;
5093 uint8_t afp_command;
5094 nstime_t delta_ts;
5095 int len;
5096
5097 /* Reject the packet if data is NULL */
5098 if (data == NULL((void*)0))
5099 return 0;
5100
5101 len = tvb_reported_length(tvb);
5102 col_set_str(pinfo->cinfo, COL_PROTOCOL, "AFP");
5103 col_clear(pinfo->cinfo, COL_INFO);
5104
5105 conversation = find_or_create_conversation(pinfo);
5106
5107 request_key.conversation = conversation->conv_index;
5108 request_key.tid = atp_asp_dsi_info->tid;
5109
5110 request_val = (afp_request_val *) wmem_map_lookup(
5111 afp_request_hash, &request_key);
5112
5113 if (!request_val && !atp_asp_dsi_info->reply) {
5114 afp_command = tvb_get_uint8(tvb, offset);
5115 new_request_key = wmem_new(wmem_file_scope(), afp_request_key)((afp_request_key*)wmem_alloc((wmem_file_scope()), sizeof(afp_request_key
)))
;
5116 *new_request_key = request_key;
5117
5118 request_val = wmem_new(wmem_file_scope(), afp_request_val)((afp_request_val*)wmem_alloc((wmem_file_scope()), sizeof(afp_request_val
)))
;
5119 request_val->command = afp_command;
5120
5121 if (afp_command == AFP_SPOTLIGHTRPC76)
5122 request_val->spotlight_req_command = tvb_get_ntohl(tvb, offset + 2 + 2 + 4);
5123 else
5124 request_val->spotlight_req_command = -1;
5125
5126 request_val->frame_req = pinfo->num;
5127 request_val->frame_res = 0;
5128 request_val->req_time=pinfo->abs_ts;
5129
5130 wmem_map_insert(afp_request_hash, new_request_key,
5131 request_val);
5132 }
5133
5134 if (!request_val) { /* missing request */
5135 col_set_str(pinfo->cinfo, COL_INFO, "[Reply without query?]");
5136 return tvb_captured_length(tvb);
5137 }
5138
5139 afp_command = request_val->command;
5140 col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
5141 val_to_str_ext(pinfo->pool, afp_command, &CommandCode_vals_ext,
5142 "Unknown command (%u)"),
5143 atp_asp_dsi_info->reply ? "reply" : "request");
5144 if (atp_asp_dsi_info->reply && atp_asp_dsi_info->code != 0) {
5145 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s (%d)",
5146 val_to_str_ext(pinfo->pool, atp_asp_dsi_info->code, &asp_error_vals_ext,
5147 "Unknown error (%u)"), atp_asp_dsi_info->code);
5148 }
5149
5150 ti = proto_tree_add_item(tree, proto_afp, tvb, offset, -1, ENC_NA0x00000000);
5151 afp_tree = proto_item_add_subtree(ti, ett_afp);
5152
5153 if (!atp_asp_dsi_info->reply) {
5154
5155 ti = proto_tree_add_uint(afp_tree, hf_afp_command, tvb,offset, 1, afp_command);
5156 if (afp_command != tvb_get_uint8(tvb, offset)) {
5157 /* we have the same conversation for different connections eg:
5158 * ip1:2048 --> ip2:548
5159 * ip1:2048 --> ip2:548 <RST>
5160 * ....
5161 * ip1:2048 --> ip2:548 <SYN> use the same port but it's a new session!
5162 */
5163 col_set_str(pinfo->cinfo, COL_INFO,
5164 "[Error!IP port reused, you need to split the capture file]");
5165 expert_add_info(pinfo, ti, &ei_afp_ip_port_reused);
5166 return tvb_captured_length(tvb);
5167 }
5168
5169 /*
5170 * Put in a field for the frame number of the frame to which
5171 * this is a response if we know that frame number (i.e.,
5172 * it's not 0).
5173 */
5174 if (request_val->frame_res != 0) {
5175 ti = proto_tree_add_uint(afp_tree, hf_afp_response_in,
5176 tvb, 0, 0, request_val->frame_res);
5177 proto_item_set_generated(ti);
5178 }
5179
5180 offset++;
5181 switch (afp_command) {
5182 case AFP_BYTELOCK1:
5183 offset = dissect_query_afp_byte_lock(tvb, pinfo, afp_tree, offset);
5184 break;
5185 case AFP_BYTELOCK_EXT59:
5186 offset = dissect_query_afp_byte_lock_ext(tvb, pinfo, afp_tree, offset);
5187 break;
5188 case AFP_OPENDT48: /* same as close vol */
5189 case AFP_FLUSH10:
5190 case AFP_CLOSEVOL2:
5191 offset = dissect_query_afp_with_vol_id(tvb, pinfo, afp_tree, offset);
5192 break;
5193 case AFP_CLOSEDIR3:
5194 /* offset = dissect_query_afp_close_dir(tvb, pinfo, afp_tree, offset); */
5195 break;
5196 case AFP_CLOSEDT49:
5197 offset = dissect_query_afp_close_dt(tvb, pinfo, afp_tree, offset);
5198 break;
5199 case AFP_FLUSHFORK11: /* same packet as closefork */
5200 case AFP_SYNCFORK79:
5201 case AFP_CLOSEFORK4:
5202 offset = dissect_query_afp_with_fork(tvb, pinfo, afp_tree, offset);
5203 break;
5204 case AFP_COPYFILE5:
5205 offset = dissect_query_afp_copy_file(tvb, pinfo, afp_tree, offset);
5206 break;
5207 case AFP_CREATEFILE7:
5208 offset = dissect_query_afp_create_file(tvb, pinfo, afp_tree, offset);
5209 break;
5210 case AFP_DISCTOLDSESS65:
5211 offset = dissect_query_afp_disconnect_old_session(tvb, pinfo, afp_tree, offset);
5212 break;
5213 case AFP_ENUMERATE_EXT268:
5214 offset = dissect_query_afp_enumerate_ext2(tvb, pinfo, afp_tree, offset);
5215 break;
5216 case AFP_ENUMERATE_EXT66:
5217 case AFP_ENUMERATE9:
5218 offset = dissect_query_afp_enumerate(tvb, pinfo, afp_tree, offset);
5219 break;
5220 case AFP_GETFORKPARAM14:
5221 offset = dissect_query_afp_get_fork_param(tvb, pinfo, afp_tree, offset);
5222 break;
5223 case AFP_GETSESSTOKEN64:
5224 offset = dissect_query_afp_get_session_token(tvb, pinfo, afp_tree, offset);
5225 break;
5226 case AFP_GETUSERINFO37:
5227 offset = dissect_query_afp_get_user_info(tvb, pinfo, afp_tree, offset);
5228 break;
5229 case AFP_GETSRVINFO15:
5230 /* offset = dissect_query_afp_get_server_info(tvb, pinfo, afp_tree, offset); */
5231 break;
5232 case AFP_GETSRVPARAM16:
5233 break; /* no parameters */
5234 case AFP_GETVOLPARAM17:
5235 offset = dissect_query_afp_get_vol_param(tvb, pinfo, afp_tree, offset);
5236 break;
5237 case AFP_LOGIN_EXT63:
5238 offset = dissect_query_afp_login_ext(tvb, pinfo, afp_tree, offset);
5239 break;
5240 case AFP_LOGIN18:
5241 offset = dissect_query_afp_login(tvb, pinfo, afp_tree, offset);
5242 break;
5243 case AFP_LOGINCONT19:
5244 case AFP_LOGOUT20:
5245 break;
5246 case AFP_MAPID21:
5247 offset = dissect_query_afp_map_id(tvb, pinfo, afp_tree, offset);
5248 break;
5249 case AFP_MAPNAME22:
5250 offset = dissect_query_afp_map_name(tvb, pinfo, afp_tree, offset);
5251 break;
5252 case AFP_MOVE23:
5253 offset = dissect_query_afp_move(tvb, pinfo, afp_tree, offset);
5254 break;
5255 case AFP_OPENVOL24:
5256 offset = dissect_query_afp_open_vol(tvb, pinfo, afp_tree, offset);
5257 break;
5258 case AFP_OPENDIR25:
5259 break;
5260 case AFP_OPENFORK26:
5261 offset = dissect_query_afp_open_fork(tvb, pinfo, afp_tree, offset);
5262 break;
5263 case AFP_READ27:
5264 offset = dissect_query_afp_read(tvb, pinfo, afp_tree, offset);
5265 break;
5266 case AFP_READ_EXT60:
5267 offset = dissect_query_afp_read_ext(tvb, pinfo, afp_tree, offset);
5268 break;
5269 case AFP_RENAME28:
5270 offset = dissect_query_afp_rename(tvb, pinfo, afp_tree, offset);
5271 break;
5272 case AFP_SETDIRPARAM29:
5273 offset = dissect_query_afp_set_dir_param(tvb, pinfo, afp_tree, offset);
5274 break;
5275 case AFP_SETFILEPARAM30:
5276 offset = dissect_query_afp_set_file_param(tvb, pinfo, afp_tree, offset);
5277 break;
5278 case AFP_SETFORKPARAM31:
5279 offset = dissect_query_afp_set_fork_param(tvb, pinfo, afp_tree, offset);
5280 break;
5281 case AFP_SETVOLPARAM32:
5282 offset = dissect_query_afp_set_vol_param(tvb, pinfo, afp_tree, offset);
5283 break;
5284 case AFP_WRITE33:
5285 offset = dissect_query_afp_write(tvb, pinfo, afp_tree, offset);
5286 break;
5287 case AFP_WRITE_EXT61:
5288 offset = dissect_query_afp_write_ext(tvb, pinfo, afp_tree, offset);
5289 break;
5290 case AFP_GETFLDRPARAM34:
5291 offset = dissect_query_afp_get_fldr_param(tvb, pinfo, afp_tree, offset);
5292 break;
5293 case AFP_SETFLDRPARAM35:
5294 offset = dissect_query_afp_set_fldr_param(tvb, pinfo, afp_tree, offset);
5295 break;
5296 case AFP_CHANGEPW36:
5297 break;
5298 case AFP_GETSRVRMSG38:
5299 offset = dissect_query_afp_get_server_message(tvb, pinfo, afp_tree, offset);
5300 break;
5301 case AFP_DELETE8: /* same as create_id */
5302 case AFP_CREATEDIR6:
5303 case AFP_CREATEID39:
5304 offset = dissect_query_afp_create_id(tvb, pinfo, afp_tree, offset);
5305 break;
5306 case AFP_DELETEID40:
5307 offset = dissect_query_afp_delete_id(tvb, pinfo, afp_tree, offset);
5308 break;
5309 case AFP_RESOLVEID41:
5310 offset = dissect_query_afp_resolve_id(tvb, pinfo, afp_tree, offset);
5311 break;
5312 case AFP_EXCHANGEFILE42:
5313 offset = dissect_query_afp_exchange_file(tvb, pinfo, afp_tree, offset);
5314 break;
5315 case AFP_CATSEARCH_EXT67:
5316 offset = dissect_query_afp_cat_search_ext(tvb, pinfo, afp_tree, offset);
5317 break;
5318 case AFP_CATSEARCH43:
5319 offset = dissect_query_afp_cat_search(tvb, pinfo, afp_tree, offset);
5320 break;
5321 case AFP_GETICON51:
5322 offset = dissect_query_afp_get_icon(tvb, pinfo, afp_tree, offset);
5323 break;
5324 case AFP_GTICNINFO52:
5325 offset = dissect_query_afp_get_icon_info(tvb, pinfo, afp_tree, offset);
5326 break;
5327 case AFP_ADDAPPL53:
5328 offset = dissect_query_afp_add_appl(tvb, pinfo, afp_tree, offset);
5329 break;
5330 case AFP_RMVAPPL54:
5331 offset = dissect_query_afp_rmv_appl(tvb, pinfo, afp_tree, offset);
5332 break;
5333 case AFP_GETAPPL55:
5334 offset = dissect_query_afp_get_appl(tvb, pinfo, afp_tree, offset);
5335 break;
5336 case AFP_ADDCMT56:
5337 offset = dissect_query_afp_add_cmt(tvb, pinfo, afp_tree, offset);
5338 break;
5339 case AFP_RMVCMT57: /* same as get_cmt */
5340 case AFP_GETCMT58:
5341 offset = dissect_query_afp_get_cmt(tvb, pinfo, afp_tree, offset);
5342 break;
5343 case AFP_ADDICON192:
5344 offset = dissect_query_afp_add_icon(tvb, pinfo, afp_tree, offset);
5345 break;
5346 case AFP_GETEXTATTR69:
5347 offset = dissect_query_afp_get_ext_attr(tvb, pinfo, afp_tree, offset);
5348 break;
5349 case AFP_SETEXTATTR70:
5350 offset = dissect_query_afp_set_ext_attr(tvb, pinfo, afp_tree, offset);
5351 break;
5352 case AFP_LISTEXTATTR72:
5353 offset = dissect_query_afp_list_ext_attrs(tvb, pinfo, afp_tree, offset);
5354 break;
5355 case AFP_REMOVEATTR71:
5356 offset = dissect_query_afp_remove_ext_attr(tvb, pinfo, afp_tree, offset);
5357 break;
5358 case AFP_GETACL73:
5359 offset = dissect_query_afp_get_acl(tvb, pinfo, afp_tree, offset);
5360 break;
5361 case AFP_SETACL74:
5362 offset = dissect_query_afp_set_acl(tvb, pinfo, afp_tree, offset);
5363 break;
5364 case AFP_ACCESS75:
5365 offset = dissect_query_afp_access(tvb, pinfo, afp_tree, offset);
5366 break;
5367 case AFP_SYNCDIR78:
5368 offset = dissect_query_afp_with_did(tvb, pinfo, afp_tree, offset);
5369 break;
5370 case AFP_SPOTLIGHTRPC76:
5371 offset = dissect_query_afp_spotlight(tvb, pinfo, afp_tree, offset, request_val);
5372 break;
5373 }
5374 }
5375 else {
5376 proto_tree_add_uint(afp_tree, hf_afp_command, tvb, 0, 0, afp_command);
5377
5378 /*
5379 * Put in fields for the frame with the response to this
5380 * frame - if we know the frame number (i.e., it's not 0).
5381 */
5382 if (request_val->frame_req != 0) {
5383 ti = proto_tree_add_uint(afp_tree, hf_afp_response_to,
5384 tvb, 0, 0, request_val->frame_req);
5385 proto_item_set_generated(ti);
5386 nstime_delta(&delta_ts, &pinfo->abs_ts, &request_val->req_time);
5387 ti = proto_tree_add_time(afp_tree, hf_afp_time, tvb,
5388 0, 0, &delta_ts);
5389 proto_item_set_generated(ti);
5390 }
5391
5392 /*
5393 * Set "frame_res" if it's not already known.
5394 */
5395 if (request_val->frame_res == 0)
5396 request_val->frame_res = pinfo->num;
5397
5398 /*
5399 * Tap the packet before the dissectors are called so we
5400 * still get the tap listener called even if there is an
5401 * exception.
5402 */
5403 tap_queue_packet(afp_tap, pinfo, request_val);
5404
5405 if (!len) {
5406 /* for some calls if the reply is an error there's no data
5407 */
5408 return tvb_captured_length(tvb);
5409 }
5410
5411 switch (afp_command) {
5412 case AFP_BYTELOCK1:
5413 offset = dissect_reply_afp_byte_lock(tvb, pinfo, afp_tree, offset);
5414 break;
5415 case AFP_BYTELOCK_EXT59:
5416 offset = dissect_reply_afp_byte_lock_ext(tvb, pinfo, afp_tree, offset);
5417 break;
5418 case AFP_ENUMERATE_EXT268:
5419 case AFP_ENUMERATE_EXT66:
5420 offset = dissect_reply_afp_enumerate_ext(tvb, pinfo, afp_tree, offset);
5421 break;
5422 case AFP_ENUMERATE9:
5423 offset = dissect_reply_afp_enumerate(tvb, pinfo, afp_tree, offset);
5424 break;
5425 case AFP_OPENVOL24:
5426 offset = dissect_reply_afp_open_vol(tvb, pinfo, afp_tree, offset);
5427 break;
5428 case AFP_OPENFORK26:
5429 offset = dissect_reply_afp_open_fork(tvb, pinfo, afp_tree, offset);
5430 break;
5431 case AFP_RESOLVEID41:
5432 case AFP_GETFORKPARAM14:
5433 offset = dissect_reply_afp_get_fork_param(tvb, pinfo, afp_tree, offset);
5434 break;
5435 case AFP_GETUSERINFO37:
5436 offset = dissect_reply_afp_get_user_info(tvb, pinfo, afp_tree, offset);
5437 break;
5438 case AFP_GETSRVPARAM16:
5439 offset = dissect_reply_afp_get_server_param(tvb, pinfo, afp_tree, offset);
5440 break;
5441 case AFP_GETSRVRMSG38:
5442 offset = dissect_reply_afp_get_server_message(tvb, pinfo, afp_tree, offset);
5443 break;
5444 case AFP_CREATEDIR6:
5445 offset = dissect_reply_afp_create_dir(tvb, pinfo, afp_tree, offset);
5446 break;
5447 case AFP_MAPID21:
5448 offset = dissect_reply_afp_map_id(tvb, pinfo, afp_tree, offset);
5449 break;
5450 case AFP_MAPNAME22:
5451 offset = dissect_reply_afp_map_name(tvb, pinfo, afp_tree, offset);
5452 break;
5453 case AFP_MOVE23: /* same as create_id */
5454 case AFP_CREATEID39:
5455 offset = dissect_reply_afp_create_id(tvb, pinfo, afp_tree, offset);
5456 break;
5457 case AFP_GETSESSTOKEN64:
5458 offset = dissect_reply_afp_get_session_token(tvb, pinfo, afp_tree, offset);
5459 break;
5460 case AFP_GETVOLPARAM17:
5461 offset = dissect_reply_afp_get_vol_param(tvb, pinfo, afp_tree, offset);
5462 break;
5463 case AFP_GETFLDRPARAM34:
5464 offset = dissect_reply_afp_get_fldr_param(tvb, pinfo, afp_tree, offset);
5465 break;
5466 case AFP_OPENDT48:
5467 offset = dissect_reply_afp_open_dt(tvb, pinfo, afp_tree, offset);
5468 break;
5469 case AFP_CATSEARCH_EXT67:
5470 offset = dissect_reply_afp_cat_search_ext(tvb, pinfo, afp_tree, offset);
5471 break;
5472 case AFP_CATSEARCH43:
5473 offset = dissect_reply_afp_cat_search(tvb, pinfo, afp_tree, offset);
5474 break;
5475 case AFP_GTICNINFO52:
5476 offset = dissect_reply_afp_get_icon_info(tvb, pinfo, afp_tree, offset);
5477 break;
5478 case AFP_GETAPPL55:
5479 offset = dissect_reply_afp_get_appl(tvb, pinfo, afp_tree, offset);
5480 break;
5481 case AFP_GETCMT58:
5482 offset = dissect_reply_afp_get_cmt(tvb, pinfo, afp_tree, offset);
5483 break;
5484 case AFP_WRITE33:
5485 offset = dissect_reply_afp_write(tvb, pinfo, afp_tree, offset);
5486 break;
5487 case AFP_WRITE_EXT61:
5488 offset = dissect_reply_afp_write_ext(tvb, pinfo, afp_tree, offset);
5489 break;
5490 case AFP_GETEXTATTR69:
5491 offset = dissect_reply_afp_get_ext_attr(tvb, pinfo, afp_tree, offset);
5492 break;
5493 case AFP_LISTEXTATTR72:
5494 offset = dissect_reply_afp_list_ext_attrs(tvb, pinfo, afp_tree, offset);
5495 break;
5496 case AFP_GETACL73:
5497 offset = dissect_reply_afp_get_acl(tvb, pinfo, afp_tree, offset);
5498 break;
5499 case AFP_SPOTLIGHTRPC76:
5500 offset = dissect_reply_afp_spotlight(tvb, pinfo, afp_tree, offset, request_val);
5501 break;
5502 }
5503 }
5504 if (offset < len) {
5505 call_data_dissector(tvb_new_subset_remaining(tvb, offset),
5506 pinfo, afp_tree);
5507 }
5508
5509 return tvb_captured_length(tvb);
5510}
5511
5512void
5513proto_register_afp(void)
5514{
5515
5516 static hf_register_info hf[] = {
5517 { &hf_afp_command,
5518 { "Command", "afp.command",
5519 FT_UINT8, BASE_DEC|BASE_EXT_STRING0x00000200, &CommandCode_vals_ext, 0x0,
5520 "AFP function", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5521
5522 { &hf_afp_pad,
5523 { "Pad", "afp.pad",
5524 FT_NONE, BASE_NONE, NULL((void*)0), 0,
5525 "Pad Byte", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5526
5527 { &hf_afp_Version,
5528 { "AFP Version", "afp.Version",
5529 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
5530 "Client AFP version", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5531
5532 { &hf_afp_UAM,
5533 { "UAM", "afp.UAM",
5534 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
5535 "User Authentication Method", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5536
5537 { &hf_afp_user,
5538 { "User", "afp.user",
5539 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
5540 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5541
5542 { &hf_afp_user_type,
5543 { "Type", "afp.user_type",
5544 FT_UINT8, BASE_HEX, VALS(path_type_vals)((0 ? (const struct _value_string*)0 : ((path_type_vals)))), 0,
5545 "Type of user name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5546 { &hf_afp_user_len,
5547 { "Len", "afp.user_len",
5548 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
5549 "User name length (unicode)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5550 { &hf_afp_user_name,
5551 { "User", "afp.user_name",
5552 FT_STRING, BASE_NONE, NULL((void*)0), 0x0,
5553 "User name (unicode)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5554
5555 { &hf_afp_passwd,
5556 { "Password", "afp.passwd",
5557 FT_STRINGZPAD, BASE_NONE, NULL((void*)0), 0x0,
5558 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5559
5560 { &hf_afp_random,
5561 { "Random number", "afp.random",
5562 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
5563 "UAM random number", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5564
5565 { &hf_afp_response_to,
5566 { "Response to", "afp.response_to",
5567 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST)((gpointer) (glong) (FT_FRAMENUM_REQUEST)), 0x0,
5568 "This packet is a response to the packet in this frame", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5569
5570 { &hf_afp_time,
5571 { "Time from request", "afp.time",
5572 FT_RELATIVE_TIME, BASE_NONE, NULL((void*)0), 0x0,
5573 "Time between Request and Response for AFP cmds", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5574
5575 { &hf_afp_response_in,
5576 { "Response in", "afp.response_in",
5577 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE)((gpointer) (glong) (FT_FRAMENUM_RESPONSE)), 0x0,
5578 "The response to this packet is in this packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5579
5580 { &hf_afp_login_flags,
5581 { "Flags", "afp.login_flags",
5582 FT_UINT16, BASE_HEX, NULL((void*)0), 0 /* 0x0FFF*/,
5583 "Login flags", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5584
5585 { &hf_afp_vol_bitmap,
5586 { "Bitmap", "afp.vol_bitmap",
5587 FT_UINT16, BASE_HEX, NULL((void*)0), 0 /* 0x0FFF*/,
5588 "Volume bitmap", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5589
5590 { &hf_afp_vol_bitmap_Attributes,
5591 { "Attributes", "afp.vol_bitmap.attributes",
5592 FT_BOOLEAN, 16, NULL((void*)0), kFPVolAttributeBit(1U << 0),
5593 "Volume attributes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5594
5595 { &hf_afp_vol_attribute,
5596 { "Attributes", "afp.vol_attributes",
5597 FT_UINT16, BASE_HEX, NULL((void*)0), 0,
5598 "Volume attributes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5599
5600 { &hf_afp_vol_attribute_ReadOnly,
5601 { "Read only", "afp.vol_attribute.read_only",
5602 FT_BOOLEAN, 16, NULL((void*)0), kReadOnly(1U << 0),
5603 "Read only volume", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5604
5605 { &hf_afp_vol_attribute_HasVolumePassword,
5606 { "Volume password", "afp.vol_attribute.passwd",
5607 FT_BOOLEAN, 16, NULL((void*)0), kHasVolumePassword(1U << 1),
5608 "Has a volume password", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5609
5610 { &hf_afp_vol_attribute_SupportsFileIDs,
5611 { "File IDs", "afp.vol_attribute.fileIDs",
5612 FT_BOOLEAN, 16, NULL((void*)0), kSupportsFileIDs(1U << 2),
5613 "Supports file IDs", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5614
5615 { &hf_afp_vol_attribute_SupportsCatSearch,
5616 { "Catalog search", "afp.vol_attribute.cat_search",
5617 FT_BOOLEAN, 16, NULL((void*)0), kSupportsCatSearch(1U << 3),
5618 "Supports catalog search operations", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5619
5620 { &hf_afp_vol_attribute_SupportsBlankAccessPrivs,
5621 { "Blank access privileges", "afp.vol_attribute.blank_access_privs",
5622 FT_BOOLEAN, 16, NULL((void*)0), kSupportsBlankAccessPrivs(1U << 4),
5623 "Supports blank access privileges", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5624
5625 { &hf_afp_vol_attribute_SupportsUnixPrivs,
5626 { "UNIX access privileges", "afp.vol_attribute.unix_privs",
5627 FT_BOOLEAN, 16, NULL((void*)0), kSupportsUnixPrivs(1U << 5),
5628 "Supports UNIX access privileges", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5629
5630 { &hf_afp_vol_attribute_SupportsUTF8Names,
5631 { "UTF-8 names", "afp.vol_attribute.utf8_names",
5632 FT_BOOLEAN, 16, NULL((void*)0), kSupportsUTF8Names(1U << 6),
5633 "Supports UTF-8 names", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5634
5635 { &hf_afp_vol_attribute_NoNetworkUserID,
5636 { "No Network User ID", "afp.vol_attribute.network_user_id",
5637 FT_BOOLEAN, 16, NULL((void*)0), kNoNetworkUserIDs(1U << 7),
5638 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5639
5640 { &hf_afp_vol_attribute_DefaultPrivsFromParent,
5641 { "Inherit parent privileges", "afp.vol_attribute.inherit_parent_privs",
5642 FT_BOOLEAN, 16, NULL((void*)0), kDefaultPrivsFromParent(1U << 8),
5643 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5644
5645 { &hf_afp_vol_attribute_NoExchangeFiles,
5646 { "No exchange files", "afp.vol_attribute.no_exchange_files",
5647 FT_BOOLEAN, 16, NULL((void*)0), kNoExchangeFiles(1U << 9),
5648 "Exchange files not supported", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5649
5650 { &hf_afp_vol_attribute_SupportsExtAttrs,
5651 { "Extended Attributes", "afp.vol_attribute.extended_attributes",
5652 FT_BOOLEAN, 16, NULL((void*)0), kSupportsExtAttrs(1U << 10),
5653 "Supports Extended Attributes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5654
5655 { &hf_afp_vol_attribute_SupportsACLs,
5656 { "ACLs", "afp.vol_attribute.acls",
5657 FT_BOOLEAN, 16, NULL((void*)0), kSupportsACLs(1U << 11),
5658 "Supports access control lists", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5659
5660 { &hf_afp_vol_attribute_CaseSensitive,
5661 { "Case sensitive", "afp.vol_attribute.case_sensitive",
5662 FT_BOOLEAN, 16, NULL((void*)0), kCaseSensitive(1U << 12),
5663 "Supports case-sensitive filenames", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5664
5665 { &hf_afp_vol_attribute_SupportsTMLockSteal,
5666 { "TM lock steal", "afp.vol_attribute.TM_lock_steal",
5667 FT_BOOLEAN, 16, NULL((void*)0), kSupportsTMLockSteal(1U << 13),
5668 "Supports Time Machine lock stealing", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5669
5670 { &hf_afp_vol_bitmap_Signature,
5671 { "Signature", "afp.vol_bitmap.signature",
5672 FT_BOOLEAN, 16, NULL((void*)0), kFPVolSignatureBit(1U << 1),
5673 "Volume signature", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5674
5675 { &hf_afp_vol_bitmap_CreateDate,
5676 { "Creation date", "afp.vol_bitmap.create_date",
5677 FT_BOOLEAN, 16, NULL((void*)0), kFPVolCreateDateBit(1U << 2),
5678 "Volume creation date", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5679
5680 { &hf_afp_vol_bitmap_ModDate,
5681 { "Modification date", "afp.vol_bitmap.mod_date",
5682 FT_BOOLEAN, 16, NULL((void*)0), kFPVolModDateBit(1U << 3),
5683 "Volume modification date", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5684
5685 { &hf_afp_vol_bitmap_BackupDate,
5686 { "Backup date", "afp.vol_bitmap.backup_date",
5687 FT_BOOLEAN, 16, NULL((void*)0), kFPVolBackupDateBit(1U << 4),
5688 "Volume backup date", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5689
5690 { &hf_afp_vol_bitmap_ID,
5691 { "ID", "afp.vol_bitmap.id",
5692 FT_BOOLEAN, 16, NULL((void*)0), kFPVolIDBit(1U << 5),
5693 "Volume ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5694
5695 { &hf_afp_vol_bitmap_BytesFree,
5696 { "Bytes free", "afp.vol_bitmap.bytes_free",
5697 FT_BOOLEAN, 16, NULL((void*)0), kFPVolBytesFreeBit(1U << 6),
5698 "Volume free bytes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5699
5700 { &hf_afp_vol_bitmap_BytesTotal,
5701 { "Bytes total", "afp.vol_bitmap.bytes_total",
5702 FT_BOOLEAN, 16, NULL((void*)0), kFPVolBytesTotalBit(1U << 7),
5703 "Volume total bytes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5704
5705 { &hf_afp_vol_bitmap_Name,
5706 { "Name", "afp.vol_bitmap.name",
5707 FT_BOOLEAN, 16, NULL((void*)0), kFPVolNameBit(1U << 8),
5708 "Volume name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5709
5710 { &hf_afp_vol_bitmap_ExtBytesFree,
5711 { "Extended bytes free", "afp.vol_bitmap.ex_bytes_free",
5712 FT_BOOLEAN, 16, NULL((void*)0), kFPVolExtBytesFreeBit(1U << 9),
5713 "Volume extended (>2GB) free bytes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5714
5715 { &hf_afp_vol_bitmap_ExtBytesTotal,
5716 { "Extended bytes total", "afp.vol_bitmap.ex_bytes_total",
5717 FT_BOOLEAN, 16, NULL((void*)0), kFPVolExtBytesTotalBit(1U << 10),
5718 "Volume extended (>2GB) total bytes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5719
5720 { &hf_afp_vol_bitmap_BlockSize,
5721 { "Block size", "afp.vol_bitmap.block_size",
5722 FT_BOOLEAN, 16, NULL((void*)0), kFPVolBlockSizeBit(1U << 11),
5723 "Volume block size", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5724
5725 { &hf_afp_dir_bitmap_Attributes,
5726 { "Attributes", "afp.dir_bitmap.attributes",
5727 FT_BOOLEAN, 16, NULL((void*)0), kFPAttributeBit(1U << 0),
5728 "Return attributes if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5729
5730 { &hf_afp_dir_bitmap_ParentDirID,
5731 { "DID", "afp.dir_bitmap.did",
5732 FT_BOOLEAN, 16, NULL((void*)0), kFPParentDirIDBit(1U << 1),
5733 "Return parent directory ID if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5734
5735 { &hf_afp_dir_bitmap_CreateDate,
5736 { "Creation date", "afp.dir_bitmap.create_date",
5737 FT_BOOLEAN, 16, NULL((void*)0), kFPCreateDateBit(1U << 2),
5738 "Return creation date if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5739
5740 { &hf_afp_dir_bitmap_ModDate,
5741 { "Modification date", "afp.dir_bitmap.mod_date",
5742 FT_BOOLEAN, 16, NULL((void*)0), kFPModDateBit(1U << 3),
5743 "Return modification date if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5744
5745 { &hf_afp_dir_bitmap_BackupDate,
5746 { "Backup date", "afp.dir_bitmap.backup_date",
5747 FT_BOOLEAN, 16, NULL((void*)0), kFPBackupDateBit(1U << 4),
5748 "Return backup date if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5749
5750 { &hf_afp_dir_bitmap_FinderInfo,
5751 { "Finder info", "afp.dir_bitmap.finder_info",
5752 FT_BOOLEAN, 16, NULL((void*)0), kFPFinderInfoBit(1U << 5),
5753 "Return finder info if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5754
5755 { &hf_afp_dir_bitmap_LongName,
5756 { "Long name", "afp.dir_bitmap.long_name",
5757 FT_BOOLEAN, 16, NULL((void*)0), kFPLongNameBit(1U << 6),
5758 "Return long name if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5759
5760 { &hf_afp_dir_bitmap_ShortName,
5761 { "Short name", "afp.dir_bitmap.short_name",
5762 FT_BOOLEAN, 16, NULL((void*)0), kFPShortNameBit(1U << 7),
5763 "Return short name if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5764
5765 { &hf_afp_dir_bitmap_NodeID,
5766 { "File ID", "afp.dir_bitmap.fid",
5767 FT_BOOLEAN, 16, NULL((void*)0), kFPNodeIDBit(1U << 8),
5768 "Return file ID if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5769
5770 { &hf_afp_dir_bitmap_OffspringCount,
5771 { "Offspring count", "afp.dir_bitmap.offspring_count",
5772 FT_BOOLEAN, 16, NULL((void*)0), kFPOffspringCountBit(1U << 9),
5773 "Return offspring count if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5774
5775 { &hf_afp_dir_bitmap_OwnerID,
5776 { "Owner id", "afp.dir_bitmap.owner_id",
5777 FT_BOOLEAN, 16, NULL((void*)0), kFPOwnerIDBit(1U << 10),
5778 "Return owner id if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5779
5780 { &hf_afp_dir_bitmap_GroupID,
5781 { "Group id", "afp.dir_bitmap.group_id",
5782 FT_BOOLEAN, 16, NULL((void*)0), kFPGroupIDBit(1U << 11),
5783 "Return group id if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5784
5785 { &hf_afp_dir_bitmap_AccessRights,
5786 { "Access rights", "afp.dir_bitmap.access_rights",
5787 FT_BOOLEAN, 16, NULL((void*)0), kFPAccessRightsBit(1U << 12),
5788 "Return access rights if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5789
5790 { &hf_afp_dir_bitmap_UTF8Name,
5791 { "UTF-8 name or ProDOS info", "afp.dir_bitmap.UTF8_name",
5792 FT_BOOLEAN, 16, NULL((void*)0), kFPUTF8NameBit(1U << 13),
5793 "Return UTF-8 name or ProDOS info if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5794
5795 { &hf_afp_dir_bitmap_UnixPrivs,
5796 { "UNIX privileges", "afp.dir_bitmap.unix_privs",
5797 FT_BOOLEAN, 16, NULL((void*)0), kFPUnixPrivsBit(1U << 15),
5798 "Return UNIX privileges if directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5799
5800 { &hf_afp_dir_attribute,
5801 { "Directory Attributes", "afp.dir_attribute",
5802 FT_UINT16, BASE_HEX, NULL((void*)0), 0x0,
5803 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5804
5805 { &hf_afp_dir_attribute_Invisible,
5806 { "Invisible", "afp.dir_attribute.invisible",
5807 FT_BOOLEAN, 16, NULL((void*)0), kFPInvisibleBit(1U << 0),
5808 "Directory is not visible", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5809
5810 { &hf_afp_dir_attribute_IsExpFolder,
5811 { "Share point", "afp.dir_attribute.share",
5812 FT_BOOLEAN, 16, NULL((void*)0), kFPMultiUserBit(1U << 1),
5813 "Directory is a share point", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5814
5815 { &hf_afp_dir_attribute_System,
5816 { "System", "afp.dir_attribute.system",
5817 FT_BOOLEAN, 16, NULL((void*)0), kFPSystemBit(1U << 2),
5818 "Directory is a system directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5819
5820 { &hf_afp_dir_attribute_Mounted,
5821 { "Mounted", "afp.dir_attribute.mounted",
5822 FT_BOOLEAN, 16, NULL((void*)0), kFPDAlreadyOpenBit(1U << 3),
5823 "Directory is mounted", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5824
5825 { &hf_afp_dir_attribute_InExpFolder,
5826 { "Shared area", "afp.dir_attribute.in_exported_folder",
5827 FT_BOOLEAN, 16, NULL((void*)0), kFPRAlreadyOpenBit(1U << 4),
5828 "Directory is in a shared area", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5829
5830 { &hf_afp_dir_attribute_BackUpNeeded,
5831 { "Backup needed", "afp.dir_attribute.backup_needed",
5832 FT_BOOLEAN, 16, NULL((void*)0), kFPBackUpNeededBit(1U << 6),
5833 "Directory needs to be backed up", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5834
5835 { &hf_afp_dir_attribute_RenameInhibit,
5836 { "Rename inhibit", "afp.dir_attribute.rename_inhibit",
5837 FT_BOOLEAN, 16, NULL((void*)0), kFPRenameInhibitBit(1U << 7),
5838 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5839
5840 { &hf_afp_dir_attribute_DeleteInhibit,
5841 { "Delete inhibit", "afp.dir_attribute.delete_inhibit",
5842 FT_BOOLEAN, 16, NULL((void*)0), kFPDeleteInhibitBit(1U << 8),
5843 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5844
5845 { &hf_afp_file_bitmap,
5846 { "File bitmap", "afp.file_bitmap",
5847 FT_UINT16, BASE_HEX, NULL((void*)0), 0x0,
5848 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5849
5850 { &hf_afp_file_bitmap_Attributes,
5851 { "Attributes", "afp.file_bitmap.attributes",
5852 FT_BOOLEAN, 16, NULL((void*)0), kFPAttributeBit(1U << 0),
5853 "Return attributes if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5854
5855 { &hf_afp_file_bitmap_ParentDirID,
5856 { "DID", "afp.file_bitmap.did",
5857 FT_BOOLEAN, 16, NULL((void*)0), kFPParentDirIDBit(1U << 1),
5858 "Return parent directory ID if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5859
5860 { &hf_afp_file_bitmap_CreateDate,
5861 { "Creation date", "afp.file_bitmap.create_date",
5862 FT_BOOLEAN, 16, NULL((void*)0), kFPCreateDateBit(1U << 2),
5863 "Return creation date if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5864
5865 { &hf_afp_file_bitmap_ModDate,
5866 { "Modification date", "afp.file_bitmap.mod_date",
5867 FT_BOOLEAN, 16, NULL((void*)0), kFPModDateBit(1U << 3),
5868 "Return modification date if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5869
5870 { &hf_afp_file_bitmap_BackupDate,
5871 { "Backup date", "afp.file_bitmap.backup_date",
5872 FT_BOOLEAN, 16, NULL((void*)0), kFPBackupDateBit(1U << 4),
5873 "Return backup date if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5874
5875 { &hf_afp_file_bitmap_FinderInfo,
5876 { "Finder info", "afp.file_bitmap.finder_info",
5877 FT_BOOLEAN, 16, NULL((void*)0), kFPFinderInfoBit(1U << 5),
5878 "Return finder info if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5879
5880 { &hf_afp_file_bitmap_LongName,
5881 { "Long name", "afp.file_bitmap.long_name",
5882 FT_BOOLEAN, 16, NULL((void*)0), kFPLongNameBit(1U << 6),
5883 "Return long name if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5884
5885 { &hf_afp_file_bitmap_ShortName,
5886 { "Short name", "afp.file_bitmap.short_name",
5887 FT_BOOLEAN, 16, NULL((void*)0), kFPShortNameBit(1U << 7),
5888 "Return short name if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5889
5890 { &hf_afp_file_bitmap_NodeID,
5891 { "File ID", "afp.file_bitmap.fid",
5892 FT_BOOLEAN, 16, NULL((void*)0), kFPNodeIDBit(1U << 8),
5893 "Return file ID if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5894
5895 { &hf_afp_file_bitmap_DataForkLen,
5896 { "Data fork size", "afp.file_bitmap.data_fork_len",
5897 FT_BOOLEAN, 16, NULL((void*)0), kFPDataForkLenBit(1U << 9),
5898 "Return data fork size if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5899
5900 { &hf_afp_file_bitmap_RsrcForkLen,
5901 { "Resource fork size", "afp.file_bitmap.resource_fork_len",
5902 FT_BOOLEAN, 16, NULL((void*)0), kFPRsrcForkLenBit(1U << 10),
5903 "Return resource fork size if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5904
5905 { &hf_afp_file_bitmap_ExtDataForkLen,
5906 { "Extended data fork size", "afp.file_bitmap.ex_data_fork_len",
5907 FT_BOOLEAN, 16, NULL((void*)0), kFPExtDataForkLenBit(1U << 11),
5908 "Return extended (>2GB) data fork size if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5909
5910 { &hf_afp_file_bitmap_LaunchLimit,
5911 { "Launch limit", "afp.file_bitmap.launch_limit",
5912 FT_BOOLEAN, 16, NULL((void*)0), kFPLaunchLimitBit(1U << 12),
5913 "Return launch limit if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5914
5915 { &hf_afp_file_bitmap_UTF8Name,
5916 { "UTF-8 name or ProDOS info", "afp.file_bitmap.UTF8_name",
5917 FT_BOOLEAN, 16, NULL((void*)0), kFPUTF8NameBit(1U << 13),
5918 "Return UTF-8 name or ProDOS info if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5919
5920 { &hf_afp_file_bitmap_ExtRsrcForkLen,
5921 { "Extended resource fork size", "afp.file_bitmap.ex_resource_fork_len",
5922 FT_BOOLEAN, 16, NULL((void*)0), kFPExtRsrcForkLenBit(1U << 14),
5923 "Return extended (>2GB) resource fork size if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5924
5925 { &hf_afp_file_bitmap_UnixPrivs,
5926 { "UNIX privileges", "afp.file_bitmap.unix_privs",
5927 FT_BOOLEAN, 16, NULL((void*)0), kFPUnixPrivsBit(1U << 15),
5928 "Return UNIX privileges if file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5929
5930 /* ---------- */
5931 { &hf_afp_file_attribute,
5932 { "File Attributes", "afp.file_attribute",
5933 FT_UINT16, BASE_HEX, NULL((void*)0), 0x0,
5934 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5935
5936 { &hf_afp_file_attribute_Invisible,
5937 { "Invisible", "afp.file_attribute.invisible",
5938 FT_BOOLEAN, 16, NULL((void*)0), kFPInvisibleBit(1U << 0),
5939 "File is not visible", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5940
5941 { &hf_afp_file_attribute_MultiUser,
5942 { "Multi user", "afp.file_attribute.multi_user",
5943 FT_BOOLEAN, 16, NULL((void*)0), kFPMultiUserBit(1U << 1),
5944 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5945
5946 { &hf_afp_file_attribute_System,
5947 { "System", "afp.file_attribute.system",
5948 FT_BOOLEAN, 16, NULL((void*)0), kFPSystemBit(1U << 2),
5949 "File is a system file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5950
5951 { &hf_afp_file_attribute_DAlreadyOpen,
5952 { "Data fork open", "afp.file_attribute.df_open",
5953 FT_BOOLEAN, 16, NULL((void*)0), kFPDAlreadyOpenBit(1U << 3),
5954 "Data fork already open", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5955
5956 { &hf_afp_file_attribute_RAlreadyOpen,
5957 { "Resource fork open", "afp.file_attribute.rf_open",
5958 FT_BOOLEAN, 16, NULL((void*)0), kFPRAlreadyOpenBit(1U << 4),
5959 "Resource fork already open", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5960
5961 { &hf_afp_file_attribute_WriteInhibit,
5962 { "Write inhibit", "afp.file_attribute.write_inhibit",
5963 FT_BOOLEAN, 16, NULL((void*)0), kFPWriteInhibitBit(1U << 5),
5964 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5965
5966 { &hf_afp_file_attribute_BackUpNeeded,
5967 { "Backup needed", "afp.file_attribute.backup_needed",
5968 FT_BOOLEAN, 16, NULL((void*)0), kFPBackUpNeededBit(1U << 6),
5969 "File needs to be backed up", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5970
5971 { &hf_afp_file_attribute_RenameInhibit,
5972 { "Rename inhibit", "afp.file_attribute.rename_inhibit",
5973 FT_BOOLEAN, 16, NULL((void*)0), kFPRenameInhibitBit(1U << 7),
5974 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5975
5976 { &hf_afp_file_attribute_DeleteInhibit,
5977 { "Delete inhibit", "afp.file_attribute.delete_inhibit",
5978 FT_BOOLEAN, 16, NULL((void*)0), kFPDeleteInhibitBit(1U << 8),
5979 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5980
5981 { &hf_afp_file_attribute_CopyProtect,
5982 { "Copy protect", "afp.file_attribute.copy_protect",
5983 FT_BOOLEAN, 16, NULL((void*)0), kFPCopyProtectBit(1U << 10),
5984 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5985
5986 { &hf_afp_file_attribute_SetClear,
5987 { "Set", "afp.file_attribute.set_clear",
5988 FT_BOOLEAN, 16, NULL((void*)0), kFPSetClearBit(1U << 15),
5989 "Clear/set attribute", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5990 /* ---------- */
5991
5992 { &hf_afp_vol_name,
5993 { "Volume", "afp.vol_name",
5994 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
5995 "Volume name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
5996
5997 { &hf_afp_vol_flag,
5998 { "Flags", "afp.vol_flag",
5999 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
6000 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6001
6002 { &hf_afp_vol_flag_passwd,
6003 { "Password", "afp.vol_flag_passwd",
6004 FT_BOOLEAN, 8, NULL((void*)0), 128,
6005 "Volume is password-protected", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6006
6007 { &hf_afp_vol_flag_has_config,
6008 { "Has config", "afp.vol_flag_has_config",
6009 FT_BOOLEAN, 8, NULL((void*)0), 1,
6010 "Volume has Apple II config info", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6011
6012 { &hf_afp_vol_id,
6013 { "Volume id", "afp.vol_id",
6014 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6015 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6016
6017 { &hf_afp_vol_signature,
6018 { "Signature", "afp.vol_signature",
6019 FT_UINT16, BASE_DEC, VALS(vol_signature_vals)((0 ? (const struct _value_string*)0 : ((vol_signature_vals))
))
, 0x0,
6020 "Volume signature", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6021
6022 { &hf_afp_vol_name_offset,
6023 { "Volume name offset","afp.vol_name_offset",
6024 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6025 "Volume name offset in packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6026
6027 { &hf_afp_vol_creation_date,
6028 { "Creation date", "afp.vol_creation_date",
6029 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL((void*)0), 0x0,
6030 "Volume creation date", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6031
6032 { &hf_afp_vol_modification_date,
6033 { "Modification date", "afp.vol_modification_date",
6034 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL((void*)0), 0x0,
6035 "Volume modification date", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6036
6037 { &hf_afp_vol_backup_date,
6038 { "Backup date", "afp.vol_backup_date",
6039 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL((void*)0), 0x0,
6040 "Volume backup date", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6041
6042 { &hf_afp_vol_bytes_free,
6043 { "Bytes free", "afp.vol_bytes_free",
6044 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6045 "Free space", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6046
6047 { &hf_afp_vol_bytes_total,
6048 { "Bytes total", "afp.vol_bytes_total",
6049 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6050 "Volume size", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6051
6052 { &hf_afp_vol_ex_bytes_free,
6053 { "Extended bytes free", "afp.vol_ex_bytes_free",
6054 FT_UINT64, BASE_DEC, NULL((void*)0), 0x0,
6055 "Extended (>2GB) free space", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6056
6057 { &hf_afp_vol_ex_bytes_total,
6058 { "Extended bytes total", "afp.vol_ex_bytes_total",
6059 FT_UINT64, BASE_DEC, NULL((void*)0), 0x0,
6060 "Extended (>2GB) volume size", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6061
6062 { &hf_afp_vol_block_size,
6063 { "Block size", "afp.vol_block_size",
6064 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6065 "Volume block size", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6066
6067 { &hf_afp_did,
6068 { "DID", "afp.did",
6069 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6070 "Parent directory ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6071
6072 { &hf_afp_dir_bitmap,
6073 { "Directory bitmap", "afp.dir_bitmap",
6074 FT_UINT16, BASE_HEX, NULL((void*)0), 0x0,
6075 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6076
6077 { &hf_afp_dir_offspring,
6078 { "Offspring", "afp.dir_offspring",
6079 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6080 "Directory offspring", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6081
6082 { &hf_afp_dir_OwnerID,
6083 { "Owner ID", "afp.dir_owner_id",
6084 FT_INT32, BASE_DEC, NULL((void*)0), 0x0,
6085 "Directory owner ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6086
6087 { &hf_afp_dir_GroupID,
6088 { "Group ID", "afp.dir_group_id",
6089 FT_INT32, BASE_DEC, NULL((void*)0), 0x0,
6090 "Directory group ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6091
6092 { &hf_afp_creation_date,
6093 { "Creation date", "afp.creation_date",
6094 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL((void*)0), 0x0,
6095 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6096
6097 { &hf_afp_modification_date,
6098 { "Modification date", "afp.modification_date",
6099 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL((void*)0), 0x0,
6100 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6101
6102 { &hf_afp_backup_date,
6103 { "Backup date", "afp.backup_date",
6104 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL((void*)0), 0x0,
6105 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6106
6107 { &hf_afp_finder_info,
6108 { "Finder info", "afp.finder_info",
6109 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
6110 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6111
6112 { &hf_afp_long_name_offset,
6113 { "Long name offset", "afp.long_name_offset",
6114 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6115 "Long name offset in packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6116
6117 { &hf_afp_prodos_info,
6118 { "ProDOS info", "afp.prodos_info",
6119 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
6120 "ProDOS file information", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } },
6121
6122 { &hf_afp_prodos_type,
6123 { "ProDOS type", "afp.prodos_type",
6124 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
6125 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } },
6126
6127 { &hf_afp_prodos_auxtype,
6128 { "ProDOS aux. type", "afp.prodos_auxtype",
6129 FT_UINT16, BASE_HEX, NULL((void*)0), 0x0,
6130 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) } },
6131
6132 { &hf_afp_short_name_offset,
6133 { "Short name offset", "afp.short_name_offset",
6134 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6135 "Short name offset in packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6136
6137 { &hf_afp_unicode_name_offset,
6138 { "Unicode name offset", "afp.unicode_name_offset",
6139 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6140 "Unicode name offset in packet", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6141
6142 { &hf_afp_unix_privs_uid,
6143 { "UID", "afp.unix_privs.uid",
6144 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6145 "User ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6146
6147 { &hf_afp_unix_privs_gid,
6148 { "GID", "afp.unix_privs.gid",
6149 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6150 "Group ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6151
6152 { &hf_afp_unix_privs_permissions,
6153 { "Permissions", "afp.unix_privs.permissions",
6154 FT_UINT32, BASE_OCT, NULL((void*)0), 0x0,
6155 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6156
6157 { &hf_afp_unix_privs_ua_permissions,
6158 { "User's access rights", "afp.unix_privs.ua_permissions",
6159 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
6160 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6161
6162 { &hf_afp_file_id,
6163 { "File ID", "afp.file_id",
6164 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6165 "File/directory ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6166
6167 { &hf_afp_file_DataForkLen,
6168 { "Data fork size", "afp.data_fork_len",
6169 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6170 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6171
6172 { &hf_afp_file_RsrcForkLen,
6173 { "Resource fork size", "afp.resource_fork_len",
6174 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6175 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6176
6177 { &hf_afp_file_ExtDataForkLen,
6178 { "Extended data fork size", "afp.ext_data_fork_len",
6179 FT_UINT64, BASE_DEC, NULL((void*)0), 0x0,
6180 "Extended (>2GB) data fork length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6181
6182 { &hf_afp_file_ExtRsrcForkLen,
6183 { "Extended resource fork size", "afp.ext_resource_fork_len",
6184 FT_UINT64, BASE_DEC, NULL((void*)0), 0x0,
6185 "Extended (>2GB) resource fork length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6186
6187 { &hf_afp_req_count,
6188 { "Req count", "afp.req_count",
6189 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6190 "Maximum number of structures returned", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6191
6192 { &hf_afp_start_index,
6193 { "Start index", "afp.start_index",
6194 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6195 "First structure returned", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6196
6197 { &hf_afp_max_reply_size,
6198 { "Reply size", "afp.reply_size",
6199 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6200 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6201
6202 { &hf_afp_start_index32,
6203 { "Start index", "afp.start_index32",
6204 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6205 "First structure returned", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6206
6207 { &hf_afp_max_reply_size32,
6208 { "Reply size", "afp.reply_size32",
6209 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6210 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6211
6212 { &hf_afp_file_flag,
6213 { "Dir", "afp.file_flag",
6214 FT_BOOLEAN, 8, NULL((void*)0), 0x80,
6215 "Is a dir", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6216
6217 { &hf_afp_create_flag,
6218 { "Hard create", "afp.create_flag",
6219 FT_BOOLEAN, 8, NULL((void*)0), 0x80,
6220 "Soft/hard create file", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6221
6222 { &hf_afp_request_bitmap,
6223 { "Request Bitmap", "afp.request_bitmap",
6224 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
6225 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6226
6227 { &hf_afp_request_bitmap_Attributes,
6228 { "Attributes", "afp.request_bitmap.attributes",
6229 FT_BOOLEAN, 32, NULL((void*)0), kFPAttributeBit(1U << 0),
6230 "Search attributes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6231
6232 { &hf_afp_request_bitmap_ParentDirID,
6233 { "DID", "afp.request_bitmap.did",
6234 FT_BOOLEAN, 32, NULL((void*)0), kFPParentDirIDBit(1U << 1),
6235 "Search parent directory ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6236
6237 { &hf_afp_request_bitmap_CreateDate,
6238 { "Creation date", "afp.request_bitmap.create_date",
6239 FT_BOOLEAN, 32, NULL((void*)0), kFPCreateDateBit(1U << 2),
6240 "Search creation date", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6241
6242 { &hf_afp_request_bitmap_ModDate,
6243 { "Modification date", "afp.request_bitmap.mod_date",
6244 FT_BOOLEAN, 32, NULL((void*)0), kFPModDateBit(1U << 3),
6245 "Search modification date", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6246
6247 { &hf_afp_request_bitmap_BackupDate,
6248 { "Backup date", "afp.request_bitmap.backup_date",
6249 FT_BOOLEAN, 32, NULL((void*)0), kFPBackupDateBit(1U << 4),
6250 "Search backup date", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6251
6252 { &hf_afp_request_bitmap_FinderInfo,
6253 { "Finder info", "afp.request_bitmap.finder_info",
6254 FT_BOOLEAN, 32, NULL((void*)0), kFPFinderInfoBit(1U << 5),
6255 "Search finder info", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6256
6257 { &hf_afp_request_bitmap_LongName,
6258 { "Long name", "afp.request_bitmap.long_name",
6259 FT_BOOLEAN, 32, NULL((void*)0), kFPLongNameBit(1U << 6),
6260 "Search long name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6261
6262 { &hf_afp_request_bitmap_DataForkLen,
6263 { "Data fork size", "afp.request_bitmap.data_fork_len",
6264 FT_BOOLEAN, 32, NULL((void*)0), kFPDataForkLenBit(1U << 9),
6265 "Search data fork size", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6266
6267 { &hf_afp_request_bitmap_OffspringCount,
6268 { "Offspring count", "afp.request_bitmap.offspring_count",
6269 FT_BOOLEAN, 32, NULL((void*)0), kFPOffspringCountBit(1U << 9),
6270 "Search offspring count", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6271
6272 { &hf_afp_request_bitmap_RsrcForkLen,
6273 { "Resource fork size", "afp.request_bitmap.resource_fork_len",
6274 FT_BOOLEAN, 32, NULL((void*)0), kFPRsrcForkLenBit(1U << 10),
6275 "Search resource fork size", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6276
6277 { &hf_afp_request_bitmap_ExtDataForkLen,
6278 { "Extended data fork size", "afp.request_bitmap.ex_data_fork_len",
6279 FT_BOOLEAN, 32, NULL((void*)0), kFPExtDataForkLenBit(1U << 11),
6280 "Search extended (>2GB) data fork size", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6281
6282 { &hf_afp_request_bitmap_UTF8Name,
6283 { "UTF-8 name", "afp.request_bitmap.UTF8_name",
6284 FT_BOOLEAN, 32, NULL((void*)0), kFPUTF8NameBit(1U << 13),
6285 "Search UTF-8 name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6286
6287 { &hf_afp_request_bitmap_ExtRsrcForkLen,
6288 { "Extended resource fork size", "afp.request_bitmap.ex_resource_fork_len",
6289 FT_BOOLEAN, 32, NULL((void*)0), kFPExtRsrcForkLenBit(1U << 14),
6290 "Search extended (>2GB) resource fork size", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6291
6292 { &hf_afp_request_bitmap_PartialNames,
6293 { "Match on partial names", "afp.request_bitmap.partial_names",
6294 FT_BOOLEAN, 32, NULL((void*)0), 0x80000000,
6295 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6296
6297 { &hf_afp_struct_size,
6298 { "Struct size", "afp.struct_size",
6299 FT_UINT8, BASE_DEC, NULL((void*)0),0,
6300 "Sizeof of struct", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6301
6302 { &hf_afp_struct_size16,
6303 { "Struct size", "afp.struct_size16",
6304 FT_UINT16, BASE_DEC, NULL((void*)0),0,
6305 "Sizeof of struct", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6306
6307 { &hf_afp_flag,
6308 { "From", "afp.flag",
6309 FT_UINT8, BASE_HEX, VALS(flag_vals)((0 ? (const struct _value_string*)0 : ((flag_vals)))), 0x80,
6310 "Offset is relative to start/end of the fork", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6311
6312 { &hf_afp_dt_ref,
6313 { "DT ref", "afp.dt_ref",
6314 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6315 "Desktop database reference num", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6316
6317 { &hf_afp_ofork,
6318 { "Fork", "afp.ofork",
6319 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6320 "Open fork reference number", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6321
6322 { &hf_afp_offset,
6323 { "Offset", "afp.offset",
6324 FT_INT32, BASE_DEC, NULL((void*)0), 0x0,
6325 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6326
6327 { &hf_afp_rw_count,
6328 { "Count", "afp.rw_count",
6329 FT_INT32, BASE_DEC, NULL((void*)0), 0x0,
6330 "Number of bytes to be read/written", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6331
6332 { &hf_afp_newline_mask,
6333 { "Newline mask", "afp.newline_mask",
6334 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
6335 "Value to AND bytes with when looking for newline", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6336
6337 { &hf_afp_newline_char,
6338 { "Newline char", "afp.newline_char",
6339 FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
6340 "Value to compare ANDed bytes with when looking for newline", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6341
6342 { &hf_afp_last_written,
6343 { "Last written", "afp.last_written",
6344 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6345 "Offset of the last byte written", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6346
6347 { &hf_afp_ofork_len,
6348 { "New length", "afp.ofork_len",
6349 FT_INT32, BASE_DEC, NULL((void*)0), 0x0,
6350 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6351
6352 { &hf_afp_path_type,
6353 { "Type", "afp.path_type",
6354 FT_UINT8, BASE_HEX, VALS(path_type_vals)((0 ? (const struct _value_string*)0 : ((path_type_vals)))), 0,
6355 "Type of names", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6356
6357 { &hf_afp_path_len,
6358 { "Len", "afp.path_len",
6359 FT_UINT8, BASE_DEC, NULL((void*)0), 0x0,
6360 "Path length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6361
6362 { &hf_afp_path_unicode_len,
6363 { "Len", "afp.path_unicode_len",
6364 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6365 "Path length (unicode)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6366
6367 { &hf_afp_path_unicode_hint,
6368 { "Unicode hint", "afp.path_unicode_hint",
6369 FT_UINT32, BASE_HEX|BASE_EXT_STRING0x00000200, &unicode_hint_vals_ext, 0x0,
6370 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6371
6372 { &hf_afp_path_name,
6373 { "Name", "afp.path_name",
6374 FT_STRING, BASE_NONE, NULL((void*)0), 0x0,
6375 "Path name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6376
6377 { &hf_afp_fork_type,
6378 { "Resource fork", "afp.fork_type",
6379 FT_BOOLEAN, 8, NULL((void*)0), 0x80,
6380 "Data/resource fork", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6381
6382 { &hf_afp_access_mode,
6383 { "Access mode", "afp.access",
6384 FT_UINT16, BASE_HEX, NULL((void*)0), 0x0,
6385 "Fork access mode", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6386
6387 { &hf_afp_access_read,
6388 { "Read", "afp.access.read",
6389 FT_BOOLEAN, 16, NULL((void*)0), 0x0001,
6390 "Open for reading", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6391
6392 { &hf_afp_access_write,
6393 { "Write", "afp.access.write",
6394 FT_BOOLEAN, 16, NULL((void*)0), 0x0002,
6395 "Open for writing", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6396
6397 { &hf_afp_access_deny_read,
6398 { "Deny read", "afp.access.deny_read",
6399 FT_BOOLEAN, 16, NULL((void*)0), 0x0010,
6400 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6401
6402 { &hf_afp_access_deny_write,
6403 { "Deny write", "afp.access.deny_write",
6404 FT_BOOLEAN, 16, NULL((void*)0), 0x0020,
6405 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6406
6407 { &hf_afp_comment,
6408 { "Comment", "afp.comment",
6409 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
6410 "File/folder comment", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6411
6412 /*
6413 * XXX - should this be a type that's displayed as
6414 * text if it's all printable ASCII and hex otherwise,
6415 * or something such as that?
6416 */
6417 { &hf_afp_file_creator,
6418 { "File creator", "afp.file_creator",
6419 FT_STRING, BASE_NONE, NULL((void*)0), 0x0,
6420 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6421
6422 /*
6423 * XXX - should this be a type that's displayed as
6424 * text if it's all printable ASCII and hex otherwise,
6425 * or something such as that?
6426 */
6427 { &hf_afp_file_type,
6428 { "File type", "afp.file_type",
6429 FT_STRING, BASE_NONE, NULL((void*)0), 0x0,
6430 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6431
6432 { &hf_afp_icon_type,
6433 { "Icon type", "afp.icon_type",
6434 FT_UINT8, BASE_HEX, NULL((void*)0) , 0,
6435 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6436
6437 { &hf_afp_icon_length,
6438 { "Size", "afp.icon_length",
6439 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6440 "Size for icon bitmap", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6441
6442 { &hf_afp_icon_index,
6443 { "Index", "afp.icon_index",
6444 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6445 "Icon index in desktop database", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6446
6447 { &hf_afp_icon_tag,
6448 { "Tag", "afp.icon_tag",
6449 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
6450 "Icon tag", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6451
6452 { &hf_afp_appl_index,
6453 { "Index", "afp.appl_index",
6454 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6455 "Application index", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6456
6457 { &hf_afp_appl_tag,
6458 { "Tag", "afp.appl_tag",
6459 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
6460 "Application tag", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6461
6462 { &hf_afp_lock_op,
6463 { "unlock", "afp.lock_op",
6464 FT_BOOLEAN, 8, NULL((void*)0), 0x1,
6465 "Lock/unlock op", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6466
6467 { &hf_afp_lock_from,
6468 { "End", "afp.lock_from",
6469 FT_BOOLEAN, 8, NULL((void*)0), 0x80,
6470 "Offset is relative to the end of the fork", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6471
6472 { &hf_afp_lock_offset,
6473 { "Offset", "afp.lock_offset",
6474 FT_INT32, BASE_DEC, NULL((void*)0), 0x0,
6475 "First byte to be locked", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6476
6477 { &hf_afp_lock_len,
6478 { "Length", "afp.lock_len",
6479 FT_INT32, BASE_DEC, NULL((void*)0), 0x0,
6480 "Number of bytes to be locked/unlocked", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6481
6482 { &hf_afp_lock_range_start,
6483 { "Start", "afp.lock_range_start",
6484 FT_INT32, BASE_DEC, NULL((void*)0), 0x0,
6485 "First byte locked/unlocked", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6486
6487 { &hf_afp_dir_ar,
6488 { "Access rights", "afp.dir_ar",
6489 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
6490 "Directory access rights", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6491
6492 { &hf_afp_dir_ar_o_search,
6493 { "Owner has search access", "afp.dir_ar.o_search",
6494 FT_BOOLEAN, 32, NULL((void*)0), AR_O_SEARCH(1U << 0),
6495 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6496
6497 { &hf_afp_dir_ar_o_read,
6498 { "Owner has read access", "afp.dir_ar.o_read",
6499 FT_BOOLEAN, 32, NULL((void*)0), AR_O_READ(1U << 1),
6500 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6501
6502 { &hf_afp_dir_ar_o_write,
6503 { "Owner has write access", "afp.dir_ar.o_write",
6504 FT_BOOLEAN, 32, NULL((void*)0), AR_O_WRITE(1U << 2),
6505 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6506
6507 { &hf_afp_dir_ar_g_search,
6508 { "Group has search access", "afp.dir_ar.g_search",
6509 FT_BOOLEAN, 32, NULL((void*)0), AR_G_SEARCH(1U << 8),
6510 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6511
6512 { &hf_afp_dir_ar_g_read,
6513 { "Group has read access", "afp.dir_ar.g_read",
6514 FT_BOOLEAN, 32, NULL((void*)0), AR_G_READ(1U << 9),
6515 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6516
6517 { &hf_afp_dir_ar_g_write,
6518 { "Group has write access", "afp.dir_ar.g_write",
6519 FT_BOOLEAN, 32, NULL((void*)0), AR_G_WRITE(1U << 10),
6520 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6521
6522 { &hf_afp_dir_ar_e_search,
6523 { "Everyone has search access", "afp.dir_ar.e_search",
6524 FT_BOOLEAN, 32, NULL((void*)0), AR_E_SEARCH(1U << 16),
6525 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6526
6527 { &hf_afp_dir_ar_e_read,
6528 { "Everyone has read access", "afp.dir_ar.e_read",
6529 FT_BOOLEAN, 32, NULL((void*)0), AR_E_READ(1U << 17),
6530 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6531
6532 { &hf_afp_dir_ar_e_write,
6533 { "Everyone has write access", "afp.dir_ar.e_write",
6534 FT_BOOLEAN, 32, NULL((void*)0), AR_E_WRITE(1U << 18),
6535 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6536
6537 { &hf_afp_dir_ar_u_search,
6538 { "User has search access", "afp.dir_ar.u_search",
6539 FT_BOOLEAN, 32, NULL((void*)0), AR_U_SEARCH(1U << 24),
6540 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6541
6542 { &hf_afp_dir_ar_u_read,
6543 { "User has read access", "afp.dir_ar.u_read",
6544 FT_BOOLEAN, 32, NULL((void*)0), AR_U_READ(1U << 25),
6545 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6546
6547 { &hf_afp_dir_ar_u_write,
6548 { "User has write access", "afp.dir_ar.u_write",
6549 FT_BOOLEAN, 32, NULL((void*)0), AR_U_WRITE(1U << 26),
6550 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6551
6552 { &hf_afp_dir_ar_blank,
6553 { "Blank access right", "afp.dir_ar.blank",
6554 FT_BOOLEAN, 32, NULL((void*)0), AR_BLANK(1U << 28),
6555 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6556
6557 { &hf_afp_dir_ar_u_own,
6558 { "User is the owner", "afp.dir_ar.u_owner",
6559 FT_BOOLEAN, 32, NULL((void*)0), AR_U_OWN(1U << 31),
6560 "Current user is the directory owner", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6561
6562 { &hf_afp_server_time,
6563 { "Server time", "afp.server_time",
6564 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL((void*)0), 0x0,
6565 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6566
6567 { &hf_afp_cat_req_matches,
6568 { "Max answers", "afp.cat_req_matches",
6569 FT_INT32, BASE_DEC, NULL((void*)0), 0x0,
6570 "Maximum number of matches to return.", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6571
6572 { &hf_afp_reserved,
6573 { "Reserved", "afp.reserved",
6574 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
6575 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6576
6577 { &hf_afp_cat_count,
6578 { "Cat count", "afp.cat_count",
6579 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6580 "Number of structures returned", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6581
6582 { &hf_afp_cat_position,
6583 { "Position", "afp.cat_position",
6584 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
6585 "Catalog position", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6586
6587 { &hf_afp_map_name_type,
6588 { "Type", "afp.map_name_type",
6589 FT_UINT8, BASE_DEC|BASE_EXT_STRING0x00000200, &map_name_type_vals_ext, 0x0,
6590 "Map name type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6591
6592 { &hf_afp_map_id_type,
6593 { "Type", "afp.map_id_type",
6594 FT_UINT8, BASE_DEC|BASE_EXT_STRING0x00000200, &map_id_type_vals_ext, 0x0,
6595 "Map ID type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6596
6597 { &hf_afp_map_id,
6598 { "ID", "afp.map_id",
6599 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6600 "User/Group ID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6601
6602 { &hf_afp_map_id_reply_type,
6603 { "Reply type", "afp.map_id_reply_type",
6604 FT_UINT32, BASE_DEC, VALS(map_id_reply_type_vals)((0 ? (const struct _value_string*)0 : ((map_id_reply_type_vals
))))
, 0x0,
6605 "Map ID reply type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6606
6607 { &hf_afp_map_name,
6608 { "Name", "afp.map_name",
6609 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
6610 "User/Group name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6611
6612 /* AFP 3.0 */
6613 { &hf_afp_lock_offset64,
6614 { "Offset", "afp.lock_offset64",
6615 FT_INT64, BASE_DEC, NULL((void*)0), 0x0,
6616 "First byte to be locked (64 bits)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6617
6618 { &hf_afp_lock_len64,
6619 { "Length", "afp.lock_len64",
6620 FT_INT64, BASE_DEC, NULL((void*)0), 0x0,
6621 "Number of bytes to be locked/unlocked (64 bits)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6622
6623 { &hf_afp_lock_range_start64,
6624 { "Start", "afp.lock_range_start64",
6625 FT_INT64, BASE_DEC, NULL((void*)0), 0x0,
6626 "First byte locked/unlocked (64 bits)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6627
6628 { &hf_afp_offset64,
6629 { "Offset", "afp.offset64",
6630 FT_INT64, BASE_DEC, NULL((void*)0), 0x0,
6631 "Offset (64 bits)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6632
6633 { &hf_afp_rw_count64,
6634 { "Count", "afp.rw_count64",
6635 FT_INT64, BASE_DEC, NULL((void*)0), 0x0,
6636 "Number of bytes to be read/written (64 bits)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6637
6638 { &hf_afp_last_written64,
6639 { "Last written", "afp.last_written64",
6640 FT_UINT64, BASE_DEC, NULL((void*)0), 0x0,
6641 "Offset of the last byte written (64 bits)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6642
6643 { &hf_afp_ofork_len64,
6644 { "New length", "afp.ofork_len64",
6645 FT_INT64, BASE_DEC, NULL((void*)0), 0x0,
6646 "New length (64 bits)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6647
6648 { &hf_afp_session_token_type,
6649 { "Type", "afp.session_token_type",
6650 FT_UINT16, BASE_HEX|BASE_EXT_STRING0x00000200, &token_type_vals_ext, 0x0,
6651 "Session token type", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6652
6653 /* FIXME FT_UINT32 in specs */
6654 { &hf_afp_session_token_len,
6655 { "Len", "afp.session_token_len",
6656 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6657 "Session token length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6658
6659 { &hf_afp_session_token_timestamp,
6660 { "Time stamp", "afp.session_token_timestamp",
6661 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
6662 "Session time stamp", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6663
6664 { &hf_afp_session_token,
6665 { "Token", "afp.session_token",
6666 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
6667 "Session token", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6668
6669 { &hf_afp_user_flag,
6670 { "Flag", "afp.user_flag",
6671 FT_UINT8, BASE_HEX, VALS(user_flag_vals)((0 ? (const struct _value_string*)0 : ((user_flag_vals)))), 0x01,
6672 "User Info flag", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6673
6674 { &hf_afp_user_ID,
6675 { "User ID", "afp.user_ID",
6676 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6677 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6678
6679 { &hf_afp_group_ID,
6680 { "Group ID", "afp.group_ID",
6681 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6682 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6683
6684 { &hf_afp_UUID,
6685 { "UUID", "afp.uuid",
6686 FT_GUID, BASE_NONE, NULL((void*)0), 0x0,
6687 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6688
6689 { &hf_afp_GRPUUID,
6690 { "GRPUUID", "afp.grpuuid",
6691 FT_GUID, BASE_NONE, NULL((void*)0), 0x0,
6692 "Group UUID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6693
6694 { &hf_afp_user_bitmap,
6695 { "Bitmap", "afp.user_bitmap",
6696 FT_UINT16, BASE_HEX, NULL((void*)0), 0,
6697 "User Info bitmap", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6698
6699 { &hf_afp_user_bitmap_UID,
6700 { "User ID", "afp.user_bitmap.UID",
6701 FT_BOOLEAN, 16, NULL((void*)0), 0x0001,
6702 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6703
6704 { &hf_afp_user_bitmap_GID,
6705 { "Primary group ID", "afp.user_bitmap.GID",
6706 FT_BOOLEAN, 16, NULL((void*)0), 0x0002,
6707 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6708
6709 { &hf_afp_user_bitmap_UUID,
6710 { "UUID", "afp.user_bitmap.UUID",
6711 FT_BOOLEAN, 16, NULL((void*)0), 0x0004,
6712 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6713
6714 { &hf_afp_message_type,
6715 { "Type", "afp.message_type",
6716 FT_UINT16, BASE_HEX, VALS(server_message_type)((0 ? (const struct _value_string*)0 : ((server_message_type)
)))
, 0,
6717 "Type of server message", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6718
6719 { &hf_afp_message_bitmap,
6720 { "Bitmap", "afp.message_bitmap",
6721 FT_UINT16, BASE_HEX, NULL((void*)0), 0,
6722 "Message bitmap", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6723
6724 /*
6725 * XXX - in the reply, this indicates whether the message
6726 * is a server message or a login message.
6727 */
6728 { &hf_afp_message_bitmap_REQ,
6729 { "Request message", "afp.message_bitmap.requested",
6730 FT_BOOLEAN, 16, NULL((void*)0), 0x0001,
6731 "Message Requested", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6732
6733 { &hf_afp_message_bitmap_UTF,
6734 { "Message is UTF-8", "afp.message_bitmap.utf8",
6735 FT_BOOLEAN, 16, NULL((void*)0), 0x0002,
6736 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6737
6738 { &hf_afp_message_len,
6739 { "Len", "afp.message_length",
6740 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6741 "Message length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6742
6743 { &hf_afp_message,
6744 { "Message", "afp.message",
6745 FT_STRING, BASE_NONE, NULL((void*)0), 0x0,
6746 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6747
6748 { &hf_afp_reqcount64,
6749 { "Count", "afp.reqcount64",
6750 FT_INT64, BASE_DEC, NULL((void*)0), 0x0,
6751 "Request Count (64 bits)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6752
6753 { &hf_afp_extattr_bitmap,
6754 { "Bitmap", "afp.extattr_bitmap",
6755 FT_UINT16, BASE_HEX, NULL((void*)0), 0,
6756 "Extended attributes bitmap", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6757
6758 { &hf_afp_extattr_bitmap_NoFollow,
6759 { "No follow symlinks", "afp.extattr_bitmap.nofollow",
6760 FT_BOOLEAN, 16, NULL((void*)0), 0x0001,
6761 "Do not follow symlink", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6762
6763 { &hf_afp_extattr_bitmap_Create,
6764 { "Create", "afp.extattr_bitmap.create",
6765 FT_BOOLEAN, 16, NULL((void*)0), 0x0002,
6766 "Create extended attribute", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6767
6768 { &hf_afp_extattr_bitmap_Replace,
6769 { "Replace", "afp.extattr_bitmap.replace",
6770 FT_BOOLEAN, 16, NULL((void*)0), 0x0004,
6771 "Replace extended attribute", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6772
6773 { &hf_afp_extattr_namelen,
6774 { "Length", "afp.extattr.namelen",
6775 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6776 "Extended attribute name length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6777
6778 { &hf_afp_extattr_name,
6779 { "Name", "afp.extattr.name",
6780 FT_STRING, BASE_NONE, NULL((void*)0), 0x0,
6781 "Extended attribute name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6782
6783 { &hf_afp_extattr_len,
6784 { "Length", "afp.extattr.len",
6785 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6786 "Extended attribute length", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6787
6788 { &hf_afp_extattr_data,
6789 { "Data", "afp.extattr.data",
6790 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
6791 "Extended attribute data", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6792
6793 { &hf_afp_extattr_req_count,
6794 { "Request Count", "afp.extattr.req_count",
6795 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
6796 "Request Count.", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6797
6798 { &hf_afp_extattr_start_index,
6799 { "Index", "afp.extattr.start_index",
6800 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6801 "Start index", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6802
6803 { &hf_afp_extattr_reply_size,
6804 { "Reply size", "afp.extattr.reply_size",
6805 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
6806 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6807
6808 /* ACL control list bitmap */
6809 { &hf_afp_access_bitmap,
6810 { "Bitmap", "afp.access_bitmap",
6811 FT_UINT16, BASE_HEX, NULL((void*)0), 0,
6812 "Bitmap (reserved)", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6813
6814 { &hf_afp_acl_list_bitmap,
6815 { "ACL bitmap", "afp.acl_list_bitmap",
6816 FT_UINT16, BASE_HEX, NULL((void*)0), 0,
6817 "ACL control list bitmap", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6818
6819 { &hf_afp_acl_list_bitmap_UUID,
6820 { "UUID", "afp.acl_list_bitmap.UUID",
6821 FT_BOOLEAN, 16, NULL((void*)0), kFileSec_UUID(1U << 0),
6822 "User UUID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6823
6824 { &hf_afp_acl_list_bitmap_GRPUUID,
6825 { "GRPUUID", "afp.acl_list_bitmap.GRPUUID",
6826 FT_BOOLEAN, 16, NULL((void*)0), kFileSec_GRPUUID(1U << 1),
6827 "Group UUID", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6828
6829 { &hf_afp_acl_list_bitmap_ACL,
6830 { "ACL", "afp.acl_list_bitmap.ACL",
6831 FT_BOOLEAN, 16, NULL((void*)0), kFileSec_ACL(1U << 2),
6832 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6833
6834 { &hf_afp_acl_list_bitmap_REMOVEACL,
6835 { "Remove ACL", "afp.acl_list_bitmap.REMOVEACL",
6836 FT_BOOLEAN, 16, NULL((void*)0), kFileSec_REMOVEACL(1U << 3),
6837 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6838
6839 { &hf_afp_acl_list_bitmap_Inherit,
6840 { "Inherit", "afp.acl_list_bitmap.Inherit",
6841 FT_BOOLEAN, 16, NULL((void*)0), kFileSec_Inherit(1U << 4),
6842 "Inherit ACL", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6843
6844 { &hf_afp_acl_entrycount,
6845 { "ACEs count", "afp.acl_entrycount",
6846 FT_UINT32, BASE_HEX, NULL((void*)0), 0,
6847 "Number of ACL entries", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6848
6849 { &hf_afp_acl_flags,
6850 { "ACL flags", "afp.acl_flags",
6851 FT_UINT32, BASE_HEX, NULL((void*)0), 0,
6852 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6853
6854 { &hf_afp_acl_access_bitmap,
6855 { "Bitmap", "afp.acl_access_bitmap",
6856 FT_UINT32, BASE_HEX, NULL((void*)0), 0,
6857 "ACL access bitmap", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6858
6859 { &hf_afp_acl_access_bitmap_read_data,
6860 { "Read/List", "afp.acl_access_bitmap.read_data",
6861 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_READ_DATA(1U << 1),
6862 "Read data / list directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6863
6864 { &hf_afp_acl_access_bitmap_write_data,
6865 { "Write/Add file", "afp.acl_access_bitmap.write_data",
6866 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_WRITE_DATA(1U << 2),
6867 "Write data to a file / add a file to a directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6868
6869 { &hf_afp_acl_access_bitmap_execute,
6870 { "Execute/Search", "afp.acl_access_bitmap.execute",
6871 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_EXECUTE(1U << 3),
6872 "Execute a program", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6873
6874 { &hf_afp_acl_access_bitmap_delete,
6875 { "Delete", "afp.acl_access_bitmap.delete",
6876 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_DELETE(1U << 4),
6877 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6878
6879 { &hf_afp_acl_access_bitmap_append_data,
6880 { "Append data/create subdir", "afp.acl_access_bitmap.append_data",
6881 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_APPEND_DATA(1U << 5),
6882 "Append data to a file / create a subdirectory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6883
6884 { &hf_afp_acl_access_bitmap_delete_child,
6885 { "Delete dir", "afp.acl_access_bitmap.delete_child",
6886 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_DELETE_CHILD(1U << 6),
6887 "Delete directory", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6888
6889 { &hf_afp_acl_access_bitmap_read_attrs,
6890 { "Read attributes", "afp.acl_access_bitmap.read_attrs",
6891 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_READ_ATTRIBUTES(1U << 7),
6892 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6893
6894 { &hf_afp_acl_access_bitmap_write_attrs,
6895 { "Write attributes", "afp.acl_access_bitmap.write_attrs",
6896 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_WRITE_ATTRIBUTES(1U << 8),
6897 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6898
6899 { &hf_afp_acl_access_bitmap_read_extattrs,
6900 { "Read extended attributes", "afp.acl_access_bitmap.read_extattrs",
6901 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_READ_EXTATTRIBUTES(1U << 9),
6902 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6903
6904 { &hf_afp_acl_access_bitmap_write_extattrs,
6905 { "Write extended attributes", "afp.acl_access_bitmap.write_extattrs",
6906 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_WRITE_EXTATTRIBUTES(1U << 10),
6907 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6908
6909 { &hf_afp_acl_access_bitmap_read_security,
6910 { "Read security", "afp.acl_access_bitmap.read_security",
6911 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_READ_SECURITY(1U << 11),
6912 "Read access rights", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6913
6914 { &hf_afp_acl_access_bitmap_write_security,
6915 { "Write security", "afp.acl_access_bitmap.write_security",
6916 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_WRITE_SECURITY(1U << 12),
6917 "Write access rights", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6918
6919 { &hf_afp_acl_access_bitmap_change_owner,
6920 { "Change owner", "afp.acl_access_bitmap.change_owner",
6921 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_CHANGE_OWNER(1U << 13),
6922 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6923
6924 { &hf_afp_acl_access_bitmap_synchronize,
6925 { "Synchronize", "afp.acl_access_bitmap.synchronize",
6926 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_SYNCHRONIZE(1U << 20),
6927 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6928
6929 { &hf_afp_acl_access_bitmap_generic_all,
6930 { "Generic all", "afp.acl_access_bitmap.generic_all",
6931 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_GENERIC_ALL(1U << 21),
6932 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6933
6934 { &hf_afp_acl_access_bitmap_generic_execute,
6935 { "Generic execute", "afp.acl_access_bitmap.generic_execute",
6936 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_GENERIC_EXECUTE(1U << 22),
6937 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6938
6939 { &hf_afp_acl_access_bitmap_generic_write,
6940 { "Generic write", "afp.acl_access_bitmap.generic_write",
6941 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_GENERIC_WRITE(1U << 23),
6942 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6943
6944 { &hf_afp_acl_access_bitmap_generic_read,
6945 { "Generic read", "afp.acl_access_bitmap.generic_read",
6946 FT_BOOLEAN, 32, NULL((void*)0), KAUTH_VNODE_GENERIC_READ(1U << 24),
6947 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6948
6949 { &hf_afp_ace_flags,
6950 { "Flags", "afp.ace_flags",
6951 FT_UINT32, BASE_HEX, NULL((void*)0), 0,
6952 "ACE flags", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6953
6954 { &hf_afp_ace_flags_allow,
6955 { "Allow", "afp.ace_flags.allow",
6956 FT_BOOLEAN, 32, NULL((void*)0), ACE_ALLOW(1U << 0),
6957 "Allow rule", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6958
6959 { &hf_afp_ace_flags_deny,
6960 { "Deny", "afp.ace_flags.deny",
6961 FT_BOOLEAN, 32, NULL((void*)0), ACE_DENY(1U << 1),
6962 "Deny rule", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6963
6964 { &hf_afp_ace_flags_inherited,
6965 { "Inherited", "afp.ace_flags.inherited",
6966 FT_BOOLEAN, 32, NULL((void*)0), ACE_INHERITED(1U << 4),
6967 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6968
6969 { &hf_afp_ace_flags_fileinherit,
6970 { "File inherit", "afp.ace_flags.file_inherit",
6971 FT_BOOLEAN, 32, NULL((void*)0), ACE_FILE_INHERIT(1U << 5),
6972 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6973
6974 { &hf_afp_ace_flags_dirinherit,
6975 { "Dir inherit", "afp.ace_flags.directory_inherit",
6976 FT_BOOLEAN, 32, NULL((void*)0), ACE_DIR_INHERIT(1U << 6),
6977 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6978
6979 { &hf_afp_ace_flags_limitinherit,
6980 { "Limit inherit", "afp.ace_flags.limit_inherit",
6981 FT_BOOLEAN, 32, NULL((void*)0), ACE_LIMIT_INHERIT(1U << 7),
6982 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6983
6984 { &hf_afp_ace_flags_onlyinherit,
6985 { "Only inherit", "afp.ace_flags.only_inherit",
6986 FT_BOOLEAN, 32, NULL((void*)0), ACE_ONLY_INHERIT(1U << 8),
6987 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6988
6989 { &hf_afp_spotlight_request_flags,
6990 { "Flags", "afp.spotlight.flags",
6991 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
6992 "Spotlight RPC Flags", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6993
6994 { &hf_afp_spotlight_request_command,
6995 { "Command", "afp.spotlight.command",
6996 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
6997 "Spotlight RPC Command", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
6998
6999 { &hf_afp_spotlight_request_reserved,
7000 { "Reserved", "afp.spotlight.reserved",
7001 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
7002 "Spotlight RPC Padding", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7003
7004 { &hf_afp_spotlight_reply_reserved,
7005 { "Reserved", "afp.spotlight.reserved",
7006 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
7007 "Spotlight RPC Padding", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7008
7009 { &hf_afp_spotlight_volpath_client,
7010 { "Client's volume path", "afp.spotlight.volpath_client",
7011 FT_STRING, BASE_NONE, NULL((void*)0), 0x0,
7012 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7013
7014 { &hf_afp_spotlight_volpath_server,
7015 { "Server's volume path", "afp.spotlight.volpath_server",
7016 FT_STRING, BASE_NONE, NULL((void*)0), 0x0,
7017 "Servers's volume path", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7018
7019 { &hf_afp_spotlight_returncode,
7020 { "Return code", "afp.spotlight.return",
7021 FT_INT32, BASE_DEC, NULL((void*)0), 0x0,
7022 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7023
7024 { &hf_afp_spotlight_volflags,
7025 { "Volume flags", "afp.spotlight.volflags",
7026 FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
7027 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7028
7029 { &hf_afp_spotlight_reqlen,
7030 { "Length", "afp.spotlight.reqlen",
7031 FT_UINT32, BASE_DEC, NULL((void*)0), 0x0,
7032 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7033
7034 { &hf_afp_spotlight_uuid,
7035 { "UUID", "afp.spotlight.uuid",
7036 FT_GUID, BASE_NONE, NULL((void*)0), 0x0,
7037 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7038
7039 { &hf_afp_spotlight_date,
7040 { "Date", "afp.spotlight.date",
7041 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL((void*)0), 0x0,
7042 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7043
7044 { &hf_afp_unknown,
7045 { "Unknown parameter", "afp.unknown_bytes",
7046 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
7047 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7048
7049 /* Status stuff from ASP or DSI */
7050 { &hf_afp_utf8_server_name_len,
7051 { "UTF-8 server name length", "afp.utf8_server_name_len",
7052 FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
7053 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7054
7055 { &hf_afp_utf8_server_name,
7056 { "UTF-8 server name", "afp.utf8_server_name",
7057 FT_STRING, BASE_NONE, NULL((void*)0), 0x0,
7058 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7059
7060 { &hf_afp_server_name,
7061 { "Server name", "afp.server_name",
7062 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
7063 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7064
7065 { &hf_afp_server_type,
7066 { "Server type", "afp.server_type",
7067 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
7068 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7069
7070 { &hf_afp_server_vers,
7071 { "AFP version", "afp.server_vers",
7072 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
7073 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7074
7075 { &hf_afp_server_uams,
7076 { "UAM", "afp.server_uams",
7077 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
7078 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7079
7080 { &hf_afp_server_icon,
7081 { "Icon bitmap", "afp.server_icon",
7082 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
7083 "Server icon bitmap", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7084
7085 { &hf_afp_server_directory,
7086 { "Directory service", "afp.server_directory",
7087 FT_UINT_STRING, BASE_NONE, NULL((void*)0), 0x0,
7088 "Server directory service", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7089
7090 { &hf_afp_server_signature,
7091 { "Server signature", "afp.server_signature",
7092 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
7093 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7094
7095 { &hf_afp_server_flag,
7096 { "Flag", "afp.server_flag",
7097 FT_UINT16, BASE_HEX, NULL((void*)0), 0x0,
7098 "Server capabilities flag", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7099 { &hf_afp_server_flag_copyfile,
7100 { "Support copyfile", "afp.server_flag.copyfile",
7101 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_COPY(1<<0),
7102 "Server support copyfile", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7103 { &hf_afp_server_flag_passwd,
7104 { "Support change password", "afp.server_flag.passwd",
7105 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_PASSWD(1<<1),
7106 "Server support change password", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7107 { &hf_afp_server_flag_no_save_passwd,
7108 { "Don't allow save password", "afp.server_flag.no_save_passwd",
7109 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_NOSAVEPASSWD(1<<2),
7110 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7111 { &hf_afp_server_flag_srv_msg,
7112 { "Support server message", "afp.server_flag.srv_msg",
7113 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_SRVMSGS(1<<3),
7114 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7115 { &hf_afp_server_flag_srv_sig,
7116 { "Support server signature", "afp.server_flag.srv_sig",
7117 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_SRVSIGNATURE(1<<4),
7118 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7119 { &hf_afp_server_flag_tcpip,
7120 { "Support TCP/IP", "afp.server_flag.tcpip",
7121 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_TCPIP(1<<5),
7122 "Server support TCP/IP", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7123 { &hf_afp_server_flag_notify,
7124 { "Support server notifications", "afp.server_flag.notify",
7125 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_SRVNOTIFY(1<<6),
7126 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7127 { &hf_afp_server_flag_reconnect,
7128 { "Support server reconnect", "afp.server_flag.reconnect",
7129 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_SRVRECONNECT(1<<7),
7130 NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7131 { &hf_afp_server_flag_directory,
7132 { "Support directory services", "afp.server_flag.directory",
7133 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_SRVDIRECTORY(1<<8),
7134 "Server support directory services", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7135 { &hf_afp_server_flag_utf8_name,
7136 { "Support UTF-8 server name", "afp.server_flag.utf8_name",
7137 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_SRVUTF8(1<<9),
7138 "Server support UTF-8 server name", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7139 { &hf_afp_server_flag_uuid,
7140 { "Support UUIDs", "afp.server_flag.uuids",
7141 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_UUID(1<<10),
7142 "Server supports UUIDs", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7143 { &hf_afp_server_flag_ext_sleep,
7144 { "Support extended sleep", "afp.server_flag.ext_sleep",
7145 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_EXT_SLEEP(1<<11),
7146 "Server supports extended sleep", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7147 { &hf_afp_server_flag_fast_copy,
7148 { "Support fast copy", "afp.server_flag.fast_copy",
7149 FT_BOOLEAN, 16, NULL((void*)0), AFPSRVRINFO_FASTBOZO(1<<15),
7150 "Server support fast copy", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7151
7152
7153 { &hf_afp_server_addr_len,
7154 { "Length", "afp.server_addr.len",
7155 FT_UINT8, BASE_DEC, NULL((void*)0), 0x0,
7156 "Address length.", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7157
7158 { &hf_afp_server_addr_type,
7159 { "Type", "afp.server_addr.type",
7160 FT_UINT8, BASE_DEC|BASE_EXT_STRING0x00000200, &afp_server_addr_type_vals_ext, 0x0,
7161 "Address type.", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7162
7163 { &hf_afp_server_addr_value,
7164 { "Value", "afp.server_addr.value",
7165 FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
7166 "Address value", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7167
7168 /* Generated from convert_proto_tree_add_text.pl */
7169 { &hf_afp_int64, { "int64", "afp.int64", FT_UINT64, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7170 { &hf_afp_float, { "float", "afp.float", FT_DOUBLE, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7171 { &hf_afp_unknown16, { "unknown1", "afp.unknown", FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7172 { &hf_afp_unknown32, { "unknown2", "afp.unknown", FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7173 { &hf_afp_cnid, { "CNID", "afp.cnid", FT_UINT64, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7174 { &hf_afp_null, { "null", "afp.null", FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7175 { &hf_afp_string, { "string", "afp.string", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7176 { &hf_afp_utf_16_string, { "utf-16 string", "afp.utf_16_string", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7177 { &hf_afp_bool, { "bool", "afp.bool", FT_UINT64, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7178 { &hf_afp_query_type, { "type", "afp.query_type", FT_STRING, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7179 { &hf_afp_toc_offset, { "ToC Offset", "afp.toc_offset", FT_UINT64, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7180 { &hf_afp_toc_entry, { "ToC Entry", "afp.toc_entry", FT_UINT64, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7181 { &hf_afp_endianness, { "Endianness", "afp.endianness", FT_UINT64, BASE_HEX | BASE_VAL64_STRING0x00000400, VALS64(endian_vals)((0 ? (const struct _val64_string*)0 : ((endian_vals)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7182 { &hf_afp_query_len, { "Query length", "afp.query_len", FT_UINT64, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7183 { &hf_afp_num_toc_entries, { "Number of entries", "afp.num_toc_entries", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7184 { &hf_afp_machine_offset, { "Machine offset", "afp.machine_offset", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7185 { &hf_afp_version_offset, { "Version offset", "afp.version_offset", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7186 { &hf_afp_uams_offset, { "UAMS offset", "afp.uams_offset", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7187 { &hf_afp_icon_offset, { "Icon offset", "afp.icon_offset", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7188 { &hf_afp_signature_offset, { "Signature offset", "afp.signature_offset", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7189 { &hf_afp_network_address_offset, { "Network address offset", "afp.network_address_offset", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7190 { &hf_afp_directory_services_offset, { "Directory services offset", "afp.directory_services_offset", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7191 { &hf_afp_utf8_server_name_offset, { "UTF-8 server name offset", "afp.utf8_server_name_offset", FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }},
7192 };
7193
7194 static int *ett[] = {
7195 &ett_afp,
7196 &ett_afp_server_vol,
7197 &ett_afp_vol_list,
7198 &ett_afp_vol_flag,
7199 &ett_afp_vol_bitmap,
7200 &ett_afp_vol_attribute,
7201 &ett_afp_dir_bitmap,
7202 &ett_afp_file_bitmap,
7203 &ett_afp_unix_privs,
7204 &ett_afp_enumerate,
7205 &ett_afp_enumerate_line,
7206 &ett_afp_access_mode,
7207 &ett_afp_dir_attribute,
7208 &ett_afp_file_attribute,
7209 &ett_afp_path_name,
7210 &ett_afp_lock_flags,
7211 &ett_afp_dir_ar,
7212 &ett_afp_cat_search,
7213 &ett_afp_cat_r_bitmap,
7214 &ett_afp_cat_spec,
7215 &ett_afp_vol_did,
7216 &ett_afp_user_bitmap,
7217 &ett_afp_message_bitmap,
7218 &ett_afp_extattr_bitmap,
7219 &ett_afp_extattr_names,
7220 &ett_afp_acl_list_bitmap,
7221 &ett_afp_acl_access_bitmap,
7222 &ett_afp_ace_entries,
7223 &ett_afp_ace_entry,
7224 &ett_afp_ace_flags,
7225 &ett_afp_spotlight_queries,
7226 &ett_afp_spotlight_query_line,
7227 &ett_afp_spotlight_query,
7228 &ett_afp_spotlight_data,
7229 &ett_afp_spotlight_toc,
7230 &ett_afp_prodos_info,
7231
7232 /* Status stuff from ASP or DSI */
7233 &ett_afp_status,
7234 &ett_afp_status_server_flag,
7235 &ett_afp_vers,
7236 &ett_afp_uams,
7237 &ett_afp_server_addr,
7238 &ett_afp_server_addr_line,
7239 &ett_afp_directory,
7240 &ett_afp_utf8_name
7241 };
7242
7243 static ei_register_info ei[] = {
7244 { &ei_afp_subquery_count_over_safety_limit, { "afp.subquery_count_over_safety_limit", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Subquery count > safety limit", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE
, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE
, -1, ((void*)0)}}
}},
7245 { &ei_afp_subquery_count_over_query_count, { "afp.subquery_count_over_query_count", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Subquery count > query count", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE
, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE
, -1, ((void*)0)}}
}},
7246 { &ei_afp_abnormal_num_subqueries, { "afp.abnormal_num_subqueries", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "Abnormal number of subqueries", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE
, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE
, -1, ((void*)0)}}
}},
7247 { &ei_afp_too_many_acl_entries, { "afp.too_many_acl_entries", PI_UNDECODED0x05000000, PI_WARN0x00600000, "Too many ACL entries", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE
, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE
, -1, ((void*)0)}}
}},
7248 { &ei_afp_ip_port_reused, { "afp.ip_port_reused", PI_SEQUENCE0x02000000, PI_WARN0x00600000, "IP port reused, you need to split the capture file", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE
, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE
, -1, ((void*)0)}}
}},
7249 { &ei_afp_toc_offset, { "afp.toc_offset.bogus", PI_PROTOCOL0x09000000, PI_WARN0x00600000, "ToC offset bogus", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE
, BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE
, -1, ((void*)0)}}
}},
7250 };
7251 expert_module_t* expert_afp;
7252
7253 proto_afp = proto_register_protocol("Apple Filing Protocol", "AFP", "afp");
7254 proto_register_field_array(proto_afp, hf, array_length(hf)(sizeof (hf) / sizeof (hf)[0]));
7255 proto_register_subtree_array(ett, array_length(ett)(sizeof (ett) / sizeof (ett)[0]));
7256 expert_afp = expert_register_protocol(proto_afp);
7257 expert_register_field_array(expert_afp, ei, array_length(ei)(sizeof (ei) / sizeof (ei)[0]));
7258
7259 afp_request_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), afp_hash, afp_equal);
7260
7261 register_dissector("afp", dissect_afp, proto_afp);
7262 register_dissector("afp_server_status", dissect_afp_server_status,
7263 proto_afp);
7264 register_dissector("afp_spotlight", dissect_spotlight, proto_afp);
7265
7266 afp_tap = register_tap("afp");
7267
7268 register_srt_table(proto_afp, NULL((void*)0), 1, afpstat_packet, afpstat_init, NULL((void*)0));
7269}
7270
7271void
7272proto_reg_handoff_afp(void)
7273{
7274 spotlight_handle = find_dissector_add_dependency("afp_spotlight", proto_afp);
7275}
7276
7277/* -------------------------------
7278 end
7279*/
7280
7281/*
7282 * Editor modelines - https://www.wireshark.org/tools/modelines.html
7283 *
7284 * Local variables:
7285 * c-basic-offset: 8
7286 * tab-width: 8
7287 * indent-tabs-mode: t
7288 * End:
7289 *
7290 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
7291 * :indentSize=8:tabSize=8:noTabs=false:
7292 */