2002-04-25 23:58:02 +00:00
|
|
|
/* packet-afp.c
|
|
|
|
* Routines for afp packet dissection
|
|
|
|
* Copyright 2002, Didier Gautheron <dgautheron@magic.fr>
|
|
|
|
*
|
2002-08-02 23:36:07 +00:00
|
|
|
* $Id: packet-afp.c,v 1.20 2002/08/02 23:35:46 jmayer Exp $
|
2002-04-25 23:58:02 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* Copied from README.developer
|
|
|
|
* Copied from packet-dsi.c
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#ifdef NEED_SNPRINTF_H
|
|
|
|
# include "snprintf.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/strutil.h>
|
|
|
|
#include <epan/conversation.h>
|
|
|
|
|
|
|
|
#include "packet-afp.h"
|
|
|
|
|
|
|
|
/* The information in this module (AFP) comes from:
|
|
|
|
|
|
|
|
AFP 2.1 & 2.2.pdf contained in AppleShare_IP_6.3_SDK
|
|
|
|
available from http://www.apple.com
|
|
|
|
|
|
|
|
AFP3.0.pdf from http://www.apple.com
|
|
|
|
|
|
|
|
The netatalk source code by Wesley Craig & Adrian Sun
|
|
|
|
http://netatalk.sf.net
|
|
|
|
*/
|
|
|
|
/* from netatalk/include/afp.h */
|
|
|
|
#define AFPTRANS_NONE 0
|
|
|
|
#define AFPTRANS_DDP (1 << 0)
|
|
|
|
#define AFPTRANS_TCP (1 << 1)
|
|
|
|
#define AFPTRANS_ALL (AFPTRANS_DDP | AFPTRANS_TCP)
|
|
|
|
|
|
|
|
/* server flags */
|
|
|
|
#define AFPSRVRINFO_COPY (1<<0) /* supports copyfile */
|
|
|
|
#define AFPSRVRINFO_PASSWD (1<<1) /* supports change password */
|
|
|
|
#define AFPSRVRINFO_NOSAVEPASSWD (1<<2) /* don't allow save password */
|
|
|
|
#define AFPSRVRINFO_SRVMSGS (1<<3) /* supports server messages */
|
|
|
|
#define AFPSRVRINFO_SRVSIGNATURE (1<<4) /* supports server signature */
|
|
|
|
#define AFPSRVRINFO_TCPIP (1<<5) /* supports tcpip */
|
|
|
|
#define AFPSRVRINFO_SRVNOTIFY (1<<6) /* supports server notifications */
|
|
|
|
#define AFPSRVRINFO_FASTBOZO (1<<15) /* fast copying */
|
|
|
|
|
|
|
|
/* AFP Attention Codes -- 4 bits */
|
|
|
|
#define AFPATTN_SHUTDOWN (1 << 15) /* shutdown/disconnect */
|
|
|
|
#define AFPATTN_CRASH (1 << 14) /* server crashed */
|
|
|
|
#define AFPATTN_MESG (1 << 13) /* server has message */
|
|
|
|
#define AFPATTN_NORECONNECT (1 << 12) /* don't reconnect */
|
|
|
|
/* server notification */
|
|
|
|
#define AFPATTN_NOTIFY (AFPATTN_MESG | AFPATTN_NORECONNECT)
|
|
|
|
|
|
|
|
/* extended bitmap -- 12 bits. volchanged is only useful w/ a server
|
|
|
|
* notification, and time is only useful for shutdown. */
|
|
|
|
#define AFPATTN_VOLCHANGED (1 << 0) /* volume has changed */
|
|
|
|
#define AFPATTN_TIME(x) ((x) & 0xfff) /* time in minutes */
|
|
|
|
|
|
|
|
/* AFP functions */
|
|
|
|
#define AFP_BYTELOCK 1
|
|
|
|
#define AFP_CLOSEVOL 2
|
|
|
|
#define AFP_CLOSEDIR 3
|
|
|
|
#define AFP_CLOSEFORK 4
|
|
|
|
#define AFP_COPYFILE 5
|
|
|
|
#define AFP_CREATEDIR 6
|
|
|
|
#define AFP_CREATEFILE 7
|
|
|
|
#define AFP_DELETE 8
|
|
|
|
#define AFP_ENUMERATE 9
|
|
|
|
#define AFP_FLUSH 10
|
|
|
|
#define AFP_FLUSHFORK 11
|
|
|
|
#define AFP_GETFORKPARAM 14
|
|
|
|
#define AFP_GETSRVINFO 15
|
|
|
|
#define AFP_GETSRVPARAM 16
|
|
|
|
#define AFP_GETVOLPARAM 17
|
|
|
|
#define AFP_LOGIN 18
|
|
|
|
#define AFP_LOGINCONT 19
|
|
|
|
#define AFP_LOGOUT 20
|
|
|
|
#define AFP_MAPID 21
|
|
|
|
#define AFP_MAPNAME 22
|
|
|
|
#define AFP_MOVE 23
|
|
|
|
#define AFP_OPENVOL 24
|
|
|
|
#define AFP_OPENDIR 25
|
|
|
|
#define AFP_OPENFORK 26
|
|
|
|
#define AFP_READ 27
|
|
|
|
#define AFP_RENAME 28
|
|
|
|
#define AFP_SETDIRPARAM 29
|
|
|
|
#define AFP_SETFILEPARAM 30
|
|
|
|
#define AFP_SETFORKPARAM 31
|
|
|
|
#define AFP_SETVOLPARAM 32
|
|
|
|
#define AFP_WRITE 33
|
|
|
|
#define AFP_GETFLDRPARAM 34
|
|
|
|
#define AFP_SETFLDRPARAM 35
|
|
|
|
#define AFP_CHANGEPW 36
|
2002-07-29 06:35:12 +00:00
|
|
|
#define AFP_GETUSERINFO 37
|
2002-04-25 23:58:02 +00:00
|
|
|
#define AFP_GETSRVRMSG 38
|
|
|
|
#define AFP_CREATEID 39
|
|
|
|
#define AFP_DELETEID 40
|
|
|
|
#define AFP_RESOLVEID 41
|
|
|
|
#define AFP_EXCHANGEFILE 42
|
|
|
|
#define AFP_CATSEARCH 43
|
|
|
|
#define AFP_OPENDT 48
|
|
|
|
#define AFP_CLOSEDT 49
|
|
|
|
#define AFP_GETICON 51
|
|
|
|
#define AFP_GTICNINFO 52
|
|
|
|
#define AFP_ADDAPPL 53
|
|
|
|
#define AFP_RMVAPPL 54
|
|
|
|
#define AFP_GETAPPL 55
|
|
|
|
#define AFP_ADDCMT 56
|
|
|
|
#define AFP_RMVCMT 57
|
|
|
|
#define AFP_GETCMT 58
|
|
|
|
#define AFP_ADDICON 192
|
|
|
|
|
2002-06-20 00:44:33 +00:00
|
|
|
/* AFP 3.0 new calls */
|
|
|
|
#define AFP_BYTELOCK_EXT 59
|
|
|
|
#define AFP_CATSEARCH_EXT 67
|
|
|
|
#define AFP_ENUMERATE_EXT 66
|
|
|
|
#define AFP_READ_EXT 60
|
|
|
|
#define AFP_WRITE_EXT 61
|
|
|
|
#define AFP_GETSESSTOKEN 64
|
|
|
|
#define AFP_DISCTOLDSESS 65
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/* ----------------------------- */
|
|
|
|
static int proto_afp = -1;
|
|
|
|
static int hf_afp_reserved = -1;
|
|
|
|
|
|
|
|
static int hf_afp_command = -1; /* CommandCode */
|
|
|
|
static int hf_afp_AFPVersion = -1;
|
|
|
|
static int hf_afp_UAM = -1;
|
|
|
|
static int hf_afp_user = -1;
|
|
|
|
static int hf_afp_passwd = -1;
|
|
|
|
static int hf_afp_pad = -1;
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
static int hf_afp_vol_flag_passwd = -1;
|
|
|
|
static int hf_afp_vol_flag_unix_priv = -1;
|
|
|
|
static int hf_afp_server_time = -1;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_vol_bitmap = -1;
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
static int hf_afp_vol_name_offset = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_vol_id = -1;
|
|
|
|
static int hf_afp_vol_attribute = -1;
|
|
|
|
static int hf_afp_vol_name = -1;
|
|
|
|
static int hf_afp_vol_signature = -1;
|
|
|
|
static int hf_afp_vol_creation_date = -1;
|
|
|
|
static int hf_afp_vol_modification_date = -1;
|
|
|
|
static int hf_afp_vol_backup_date = -1;
|
|
|
|
static int hf_afp_vol_bytes_free = -1;
|
|
|
|
static int hf_afp_vol_bytes_total = -1;
|
|
|
|
static int hf_afp_vol_ex_bytes_free = -1;
|
|
|
|
static int hf_afp_vol_ex_bytes_total = -1;
|
|
|
|
static int hf_afp_vol_block_size = -1;
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* desktop stuff */
|
|
|
|
static int hf_afp_comment = -1;
|
|
|
|
static int hf_afp_file_creator = -1;
|
|
|
|
static int hf_afp_file_type = -1;
|
|
|
|
static int hf_afp_icon_type = -1;
|
|
|
|
static int hf_afp_icon_length = -1;
|
|
|
|
static int hf_afp_icon_tag = -1;
|
|
|
|
static int hf_afp_icon_index = -1;
|
|
|
|
static int hf_afp_appl_index = -1;
|
|
|
|
static int hf_afp_appl_tag = -1;
|
|
|
|
|
|
|
|
static int hf_afp_did = -1;
|
|
|
|
static int hf_afp_file_id = -1;
|
|
|
|
static int hf_afp_file_DataForkLen = -1;
|
|
|
|
static int hf_afp_file_RsrcForkLen = -1;
|
|
|
|
static int hf_afp_file_ExtDataForkLen = -1;
|
|
|
|
static int hf_afp_file_ExtRsrcForkLen = -1;
|
|
|
|
|
|
|
|
static int hf_afp_dir_bitmap = -1;
|
|
|
|
static int hf_afp_dir_offspring = -1;
|
|
|
|
static int hf_afp_dir_OwnerID = -1;
|
|
|
|
static int hf_afp_dir_GroupID = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
static int hf_afp_file_bitmap = -1;
|
|
|
|
static int hf_afp_req_count = -1;
|
|
|
|
static int hf_afp_start_index = -1;
|
|
|
|
static int hf_afp_max_reply_size = -1;
|
|
|
|
static int hf_afp_file_flag = -1;
|
2002-04-28 19:21:39 +00:00
|
|
|
static int hf_afp_create_flag = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_struct_size = -1;
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
static int hf_afp_cat_count = -1;
|
|
|
|
static int hf_afp_cat_req_matches = -1;
|
|
|
|
static int hf_afp_cat_position = -1;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_creation_date = -1;
|
|
|
|
static int hf_afp_modification_date = -1;
|
|
|
|
static int hf_afp_backup_date = -1;
|
|
|
|
static int hf_afp_finder_info = -1;
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
static int hf_afp_long_name_offset = -1;
|
|
|
|
static int hf_afp_short_name_offset = -1;
|
|
|
|
static int hf_afp_unicode_name_offset = -1;
|
|
|
|
static int hf_afp_unix_privs_uid = -1;
|
|
|
|
static int hf_afp_unix_privs_gid = -1;
|
|
|
|
static int hf_afp_unix_privs_permissions = -1;
|
|
|
|
static int hf_afp_unix_privs_ua_permissions = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
static int hf_afp_path_type = -1;
|
2002-04-28 19:21:39 +00:00
|
|
|
static int hf_afp_path_len = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_path_name = -1;
|
|
|
|
|
2002-04-28 19:33:32 +00:00
|
|
|
static int hf_afp_flag = -1;
|
|
|
|
static int hf_afp_dt_ref = -1;
|
|
|
|
static int hf_afp_ofork = -1;
|
|
|
|
static int hf_afp_ofork_len = -1;
|
|
|
|
static int hf_afp_offset = -1;
|
|
|
|
static int hf_afp_rw_count = -1;
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
static int hf_afp_newline_mask = -1;
|
|
|
|
static int hf_afp_newline_char = -1;
|
2002-04-28 19:33:32 +00:00
|
|
|
static int hf_afp_last_written = -1;
|
|
|
|
static int hf_afp_actual_count = -1;
|
2002-04-28 19:21:39 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_fork_type = -1;
|
|
|
|
static int hf_afp_access_mode = -1;
|
|
|
|
static int hf_afp_access_read = -1;
|
|
|
|
static int hf_afp_access_write = -1;
|
|
|
|
static int hf_afp_access_deny_read = -1;
|
|
|
|
static int hf_afp_access_deny_write = -1;
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
static gint hf_afp_lock_op = -1;
|
|
|
|
static gint hf_afp_lock_from = -1;
|
|
|
|
static gint hf_afp_lock_offset = -1;
|
|
|
|
static gint hf_afp_lock_len = -1;
|
|
|
|
static gint hf_afp_lock_range_start = -1;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static gint ett_afp = -1;
|
|
|
|
|
|
|
|
static gint ett_afp_vol_attribute = -1;
|
|
|
|
static gint ett_afp_enumerate = -1;
|
|
|
|
static gint ett_afp_enumerate_line = -1;
|
|
|
|
static gint ett_afp_access_mode = -1;
|
|
|
|
|
|
|
|
static gint ett_afp_vol_bitmap = -1;
|
|
|
|
static gint ett_afp_dir_bitmap = -1;
|
2002-04-28 19:21:39 +00:00
|
|
|
static gint ett_afp_dir_attribute = -1;
|
|
|
|
static gint ett_afp_file_attribute = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static gint ett_afp_file_bitmap = -1;
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
static gint ett_afp_unix_privs = -1;
|
2002-04-28 19:21:39 +00:00
|
|
|
static gint ett_afp_path_name = -1;
|
|
|
|
static gint ett_afp_lock_flags = -1;
|
|
|
|
static gint ett_afp_dir_ar = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
static gint ett_afp_server_vol = -1;
|
|
|
|
static gint ett_afp_vol_list = -1;
|
2002-05-03 21:25:43 +00:00
|
|
|
static gint ett_afp_vol_flag = -1;
|
2002-04-30 22:05:33 +00:00
|
|
|
static gint ett_afp_cat_search = -1;
|
|
|
|
static gint ett_afp_cat_r_bitmap = -1;
|
|
|
|
static gint ett_afp_cat_spec = -1;
|
2002-05-03 21:25:43 +00:00
|
|
|
static gint ett_afp_vol_did = -1;
|
2002-04-30 22:05:33 +00:00
|
|
|
|
2002-06-20 00:44:33 +00:00
|
|
|
/* AFP 3.0 parameters */
|
|
|
|
static gint hf_afp_lock_offset64 = -1;
|
|
|
|
static gint hf_afp_lock_len64 = -1;
|
|
|
|
static gint hf_afp_lock_range_start64 = -1;
|
|
|
|
|
|
|
|
static int hf_afp_offset64 = -1;
|
|
|
|
static int hf_afp_rw_count64 = -1;
|
|
|
|
|
|
|
|
static int hf_afp_last_written64 = -1;
|
|
|
|
|
|
|
|
static int hf_afp_session_token_type = -1;
|
|
|
|
static int hf_afp_session_token_len = -1;
|
|
|
|
static int hf_afp_session_token = -1;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static dissector_handle_t data_handle;
|
|
|
|
|
|
|
|
static const value_string vol_signature_vals[] = {
|
|
|
|
{1, "Flat"},
|
2002-04-28 21:04:04 +00:00
|
|
|
{2, "Fixed Directory ID"},
|
|
|
|
{3, "Variable Directory ID (deprecated)"},
|
|
|
|
{0, NULL }
|
|
|
|
};
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
static const value_string CommandCode_vals[] = {
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_BYTELOCK, "FPByteRangeLock" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_CLOSEVOL, "FPCloseVol" },
|
|
|
|
{AFP_CLOSEDIR, "FPCloseDir" },
|
|
|
|
{AFP_CLOSEFORK, "FPCloseFork" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_COPYFILE, "FPCopyFile" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_CREATEDIR, "FPCreateDir" },
|
|
|
|
{AFP_CREATEFILE, "FPCreateFile" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_DELETE, "FPDelete" },
|
|
|
|
{AFP_ENUMERATE, "FPEnumerate" },
|
|
|
|
{AFP_FLUSH, "FPFlush" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_FLUSHFORK, "FPFlushFork" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_GETFORKPARAM, "FPGetForkParms" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_GETSRVINFO, "FPGetSrvrInfo" },
|
|
|
|
{AFP_GETSRVPARAM, "FPGetSrvrParms" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_GETVOLPARAM, "FPGetVolParms" },
|
|
|
|
{AFP_LOGIN, "FPLogin" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_LOGINCONT, "FPLoginCont" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_LOGOUT, "FPLogout" },
|
|
|
|
{AFP_MAPID, "FPMapID" },
|
|
|
|
{AFP_MAPNAME, "FPMapName" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_MOVE, "FPMoveAndRename" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_OPENVOL, "FPOpenVol" },
|
|
|
|
{AFP_OPENDIR, "FPOpenDir" },
|
|
|
|
{AFP_OPENFORK, "FPOpenFork" },
|
|
|
|
{AFP_READ, "FPRead" },
|
|
|
|
{AFP_RENAME, "FPRename" },
|
|
|
|
{AFP_SETDIRPARAM, "FPSetDirParms" },
|
|
|
|
{AFP_SETFILEPARAM, "FPSetFileParms" },
|
|
|
|
{AFP_SETFORKPARAM, "FPSetForkParms" },
|
|
|
|
{AFP_SETVOLPARAM, "FPSetVolParms" },
|
|
|
|
{AFP_WRITE, "FPWrite" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_GETFLDRPARAM, "FPGetFileDirParms" },
|
|
|
|
{AFP_SETFLDRPARAM, "FPSetFileDirParms" },
|
|
|
|
{AFP_CHANGEPW, "FPChangePassword" },
|
2002-07-29 06:35:12 +00:00
|
|
|
{AFP_GETUSERINFO, "FPGetUserInfo" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_GETSRVRMSG, "FPGetSrvrMsg" },
|
|
|
|
{AFP_CREATEID, "FPCreateID" },
|
|
|
|
{AFP_DELETEID, "FPDeleteID" },
|
|
|
|
{AFP_RESOLVEID, "FPResolveID" },
|
|
|
|
{AFP_EXCHANGEFILE, "FPExchangeFiles" },
|
|
|
|
{AFP_CATSEARCH, "FPCatSearch" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_OPENDT, "FPOpenDT" },
|
|
|
|
{AFP_CLOSEDT, "FPCloseDT" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_GETICON, "FPGetIcon" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_GTICNINFO, "FPGetIconInfo" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_ADDAPPL, "FPAddAPPL" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_RMVAPPL, "FPRemoveAPPL" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_GETAPPL, "FPGetAPPL" },
|
2002-04-28 21:53:31 +00:00
|
|
|
{AFP_ADDCMT, "FPAddComment" },
|
|
|
|
{AFP_RMVCMT, "FPRemoveComment" },
|
|
|
|
{AFP_GETCMT, "FPGetComment" },
|
2002-06-20 00:44:33 +00:00
|
|
|
{AFP_BYTELOCK_EXT, "FPByteRangeLockExt" },
|
|
|
|
{AFP_CATSEARCH_EXT, "FPCatSearchExt" },
|
|
|
|
{AFP_ENUMERATE_EXT, "FPEnumerateExt" },
|
|
|
|
{AFP_READ_EXT, "FPReadExt" },
|
|
|
|
{AFP_WRITE_EXT, "FPWriteExt" },
|
|
|
|
{AFP_GETSESSTOKEN, "FPGetSessionToken" },
|
|
|
|
{AFP_DISCTOLDSESS, "FPDisconnectOldSession" },
|
2002-04-28 21:22:20 +00:00
|
|
|
{AFP_ADDICON, "FPAddIcon" },
|
2002-04-28 21:04:04 +00:00
|
|
|
{0, NULL }
|
|
|
|
};
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* volume bitmap
|
|
|
|
from Apple AFP3.0.pdf
|
|
|
|
Table 1-2 p. 20
|
|
|
|
*/
|
|
|
|
#define kFPVolAttributeBit (1 << 0)
|
|
|
|
#define kFPVolSignatureBit (1 << 1)
|
2002-04-28 21:04:04 +00:00
|
|
|
#define kFPVolCreateDateBit (1 << 2)
|
2002-04-25 23:58:02 +00:00
|
|
|
#define kFPVolModDateBit (1 << 3)
|
2002-04-28 21:04:04 +00:00
|
|
|
#define kFPVolBackupDateBit (1 << 4)
|
2002-04-25 23:58:02 +00:00
|
|
|
#define kFPVolIDBit (1 << 5)
|
2002-04-28 21:04:04 +00:00
|
|
|
#define kFPVolBytesFreeBit (1 << 6)
|
2002-04-25 23:58:02 +00:00
|
|
|
#define kFPVolBytesTotalBit (1 << 7)
|
|
|
|
#define kFPVolNameBit (1 << 8)
|
2002-04-28 21:04:04 +00:00
|
|
|
#define kFPVolExtBytesFreeBit (1 << 9)
|
|
|
|
#define kFPVolExtBytesTotalBit (1 << 10)
|
2002-04-25 23:58:02 +00:00
|
|
|
#define kFPVolBlockSizeBit (1 << 11)
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
static int hf_afp_vol_bitmap_Attributes = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_vol_bitmap_Signature = -1;
|
|
|
|
static int hf_afp_vol_bitmap_CreateDate = -1;
|
|
|
|
static int hf_afp_vol_bitmap_ModDate = -1;
|
|
|
|
static int hf_afp_vol_bitmap_BackupDate = -1;
|
2002-04-28 21:04:04 +00:00
|
|
|
static int hf_afp_vol_bitmap_ID = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_vol_bitmap_BytesFree = -1;
|
|
|
|
static int hf_afp_vol_bitmap_BytesTotal = -1;
|
2002-04-28 21:04:04 +00:00
|
|
|
static int hf_afp_vol_bitmap_Name = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_vol_bitmap_ExtBytesFree = -1;
|
|
|
|
static int hf_afp_vol_bitmap_ExtBytesTotal = -1;
|
|
|
|
static int hf_afp_vol_bitmap_BlockSize = -1;
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
static int hf_afp_vol_attribute_ReadOnly = -1;
|
|
|
|
static int hf_afp_vol_attribute_HasVolumePassword = -1;
|
|
|
|
static int hf_afp_vol_attribute_SupportsFileIDs = -1;
|
|
|
|
static int hf_afp_vol_attribute_SupportsCatSearch = -1;
|
|
|
|
static int hf_afp_vol_attribute_SupportsBlankAccessPrivs = -1;
|
|
|
|
static int hf_afp_vol_attribute_SupportsUnixPrivs = -1;
|
|
|
|
static int hf_afp_vol_attribute_SupportsUTF8Names = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
static int hf_afp_dir_bitmap_Attributes = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_dir_bitmap_ParentDirID = -1;
|
|
|
|
static int hf_afp_dir_bitmap_CreateDate = -1;
|
|
|
|
static int hf_afp_dir_bitmap_ModDate = -1;
|
|
|
|
static int hf_afp_dir_bitmap_BackupDate = -1;
|
|
|
|
static int hf_afp_dir_bitmap_FinderInfo = -1;
|
|
|
|
static int hf_afp_dir_bitmap_LongName = -1;
|
|
|
|
static int hf_afp_dir_bitmap_ShortName = -1;
|
|
|
|
static int hf_afp_dir_bitmap_NodeID = -1;
|
|
|
|
static int hf_afp_dir_bitmap_OffspringCount = -1;
|
|
|
|
static int hf_afp_dir_bitmap_OwnerID = -1;
|
|
|
|
static int hf_afp_dir_bitmap_GroupID = -1;
|
|
|
|
static int hf_afp_dir_bitmap_AccessRights = -1;
|
|
|
|
static int hf_afp_dir_bitmap_UTF8Name = -1;
|
|
|
|
static int hf_afp_dir_bitmap_UnixPrivs = -1;
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
static int hf_afp_dir_attribute_Invisible = -1;
|
|
|
|
static int hf_afp_dir_attribute_IsExpFolder = -1;
|
|
|
|
|
|
|
|
static int hf_afp_dir_attribute_System = -1;
|
|
|
|
static int hf_afp_dir_attribute_Mounted = -1;
|
|
|
|
static int hf_afp_dir_attribute_InExpFolder = -1;
|
|
|
|
|
|
|
|
static int hf_afp_dir_attribute_BackUpNeeded = -1;
|
|
|
|
static int hf_afp_dir_attribute_RenameInhibit = -1;
|
|
|
|
static int hf_afp_dir_attribute_DeleteInhibit = -1;
|
|
|
|
static int hf_afp_dir_attribute_SetClear = -1;
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
static int hf_afp_file_bitmap_Attributes = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_file_bitmap_ParentDirID = -1;
|
|
|
|
static int hf_afp_file_bitmap_CreateDate = -1;
|
|
|
|
static int hf_afp_file_bitmap_ModDate = -1;
|
|
|
|
static int hf_afp_file_bitmap_BackupDate = -1;
|
|
|
|
static int hf_afp_file_bitmap_FinderInfo = -1;
|
|
|
|
static int hf_afp_file_bitmap_LongName = -1;
|
|
|
|
static int hf_afp_file_bitmap_ShortName = -1;
|
|
|
|
static int hf_afp_file_bitmap_NodeID = -1;
|
2002-04-28 19:21:39 +00:00
|
|
|
static int hf_afp_file_bitmap_DataForkLen = -1;
|
|
|
|
static int hf_afp_file_bitmap_RsrcForkLen = -1;
|
|
|
|
static int hf_afp_file_bitmap_ExtDataForkLen = -1;
|
|
|
|
static int hf_afp_file_bitmap_LaunchLimit = -1;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_file_bitmap_UTF8Name = -1;
|
2002-04-28 19:21:39 +00:00
|
|
|
static int hf_afp_file_bitmap_ExtRsrcForkLen = -1;
|
2002-04-25 23:58:02 +00:00
|
|
|
static int hf_afp_file_bitmap_UnixPrivs = -1;
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
static int hf_afp_file_attribute_Invisible = -1;
|
|
|
|
static int hf_afp_file_attribute_MultiUser = -1;
|
|
|
|
static int hf_afp_file_attribute_System = -1;
|
|
|
|
static int hf_afp_file_attribute_DAlreadyOpen = -1;
|
|
|
|
static int hf_afp_file_attribute_RAlreadyOpen = -1;
|
|
|
|
static int hf_afp_file_attribute_WriteInhibit = -1;
|
|
|
|
static int hf_afp_file_attribute_BackUpNeeded = -1;
|
|
|
|
static int hf_afp_file_attribute_RenameInhibit = -1;
|
|
|
|
static int hf_afp_file_attribute_DeleteInhibit = -1;
|
|
|
|
static int hf_afp_file_attribute_CopyProtect = -1;
|
|
|
|
static int hf_afp_file_attribute_SetClear = -1;
|
|
|
|
|
2002-06-20 00:44:33 +00:00
|
|
|
static int hf_afp_map_name_type = -1;
|
|
|
|
static int hf_afp_map_name = -1;
|
|
|
|
static int hf_afp_map_id = -1;
|
|
|
|
static int hf_afp_map_id_type = -1;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
static const value_string vol_bitmap_vals[] = {
|
|
|
|
{kFPVolAttributeBit, "VolAttribute"},
|
2002-04-28 21:04:04 +00:00
|
|
|
{kFPVolSignatureBit, "VolSignature"},
|
|
|
|
{kFPVolCreateDateBit, "VolCreateDate"},
|
|
|
|
{kFPVolModDateBit, "VolModDate"},
|
|
|
|
{kFPVolBackupDateBit, "VolBackupDate"},
|
|
|
|
{kFPVolIDBit, "VolID"},
|
|
|
|
{kFPVolBytesFreeBit, "VolBytesFree"},
|
|
|
|
{kFPVolBytesTotalBit, "VolBytesTotal"},
|
|
|
|
{kFPVolNameBit, "VolNameBit"},
|
|
|
|
{kFPVolExtBytesFreeBit, "VolExtBytesFree"},
|
|
|
|
{kFPVolExtBytesTotalBit, "VolExtBytesTotal"},
|
|
|
|
{kFPVolBlockSizeBit, "VolBlockSize"},
|
2002-04-25 23:58:02 +00:00
|
|
|
{0, NULL } };
|
|
|
|
|
|
|
|
static const value_string flag_vals[] = {
|
|
|
|
{0, "Start" },
|
|
|
|
{1, "End" },
|
2002-04-28 21:04:04 +00:00
|
|
|
{0, NULL } };
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
static const value_string path_type_vals[] = {
|
|
|
|
{1, "Short names" },
|
|
|
|
{2, "Long names" },
|
|
|
|
{3, "Unicode names" },
|
2002-04-28 21:04:04 +00:00
|
|
|
{0, NULL } };
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-06-20 00:44:33 +00:00
|
|
|
static const value_string map_name_type_vals[] = {
|
|
|
|
{1, "Unicode user name to a user ID" },
|
|
|
|
{2, "Unicode group name to a group ID" },
|
|
|
|
{3, "Macintosh roman user name to a user ID" },
|
|
|
|
{4, "Macintosh roman group name to a group ID" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
|
|
|
static const value_string map_id_type_vals[] = {
|
|
|
|
{1, "User ID to a Macintosh roman user name" },
|
|
|
|
{2, "Group ID to a Macintosh roman group name" },
|
|
|
|
{3, "User ID to a unicode user name" },
|
|
|
|
{4, "Group ID to a unicode group name" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/*
|
|
|
|
volume attribute from Apple AFP3.0.pdf
|
|
|
|
Table 1-3 p. 22
|
|
|
|
*/
|
2002-04-28 21:04:04 +00:00
|
|
|
#define kReadOnly (1 << 0)
|
2002-04-25 23:58:02 +00:00
|
|
|
#define kHasVolumePassword (1 << 1)
|
|
|
|
#define kSupportsFileIDs (1 << 2)
|
|
|
|
#define kSupportsCatSearch (1 << 3)
|
2002-04-28 21:04:04 +00:00
|
|
|
#define kSupportsBlankAccessPrivs (1 << 4)
|
2002-04-25 23:58:02 +00:00
|
|
|
#define kSupportsUnixPrivs (1 << 5)
|
|
|
|
#define kSupportsUTF8Names (1 << 6)
|
|
|
|
|
|
|
|
/*
|
|
|
|
directory bitmap from Apple AFP3.0.pdf
|
|
|
|
Table 1-4 p. 31
|
|
|
|
*/
|
|
|
|
#define kFPAttributeBit (1 << 0)
|
|
|
|
#define kFPParentDirIDBit (1 << 1)
|
|
|
|
#define kFPCreateDateBit (1 << 2)
|
|
|
|
#define kFPModDateBit (1 << 3)
|
|
|
|
#define kFPBackupDateBit (1 << 4)
|
|
|
|
#define kFPFinderInfoBit (1 << 5)
|
|
|
|
#define kFPLongNameBit (1 << 6)
|
|
|
|
#define kFPShortNameBit (1 << 7)
|
|
|
|
#define kFPNodeIDBit (1 << 8)
|
2002-04-28 21:04:04 +00:00
|
|
|
#define kFPOffspringCountBit (1 << 9)
|
2002-04-25 23:58:02 +00:00
|
|
|
#define kFPOwnerIDBit (1 << 10)
|
|
|
|
#define kFPGroupIDBit (1 << 11)
|
|
|
|
#define kFPAccessRightsBit (1 << 12)
|
|
|
|
#define kFPUTF8NameBit (1 << 13)
|
|
|
|
#define kFPUnixPrivsBit (1 << 14)
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/*
|
|
|
|
directory Access Rights parameter AFP3.0.pdf
|
|
|
|
table 1-6 p. 34
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define AR_O_SEARCH (1 << 0) /* owner has search access */
|
|
|
|
#define AR_O_READ (1 << 1) /* owner has read access */
|
|
|
|
#define AR_O_WRITE (1 << 2) /* owner has write access */
|
|
|
|
|
|
|
|
#define AR_G_SEARCH (1 << 8) /* group has search access */
|
|
|
|
#define AR_G_READ (1 << 9) /* group has read access */
|
|
|
|
#define AR_G_WRITE (1 << 10) /* group has write access */
|
|
|
|
|
|
|
|
#define AR_E_SEARCH (1 << 16) /* everyone has search access */
|
|
|
|
#define AR_E_READ (1 << 17) /* everyone has read access */
|
|
|
|
#define AR_E_WRITE (1 << 18) /* everyone has write access */
|
|
|
|
|
|
|
|
#define AR_U_SEARCH (1 << 24) /* user has search access */
|
|
|
|
#define AR_U_READ (1 << 25) /* user has read access */
|
|
|
|
#define AR_U_WRITE (1 << 26) /* user has write access */
|
|
|
|
|
|
|
|
#define AR_BLANK (1 << 28) /* Blank Access Privileges (use parent dir privileges) */
|
|
|
|
#define AR_U_OWN (1 << 31) /* user is the owner */
|
|
|
|
|
|
|
|
static int hf_afp_dir_ar = -1;
|
|
|
|
static int hf_afp_dir_ar_o_search = -1;
|
|
|
|
static int hf_afp_dir_ar_o_read = -1;
|
|
|
|
static int hf_afp_dir_ar_o_write = -1;
|
|
|
|
static int hf_afp_dir_ar_g_search = -1;
|
|
|
|
static int hf_afp_dir_ar_g_read = -1;
|
|
|
|
static int hf_afp_dir_ar_g_write = -1;
|
|
|
|
static int hf_afp_dir_ar_e_search = -1;
|
|
|
|
static int hf_afp_dir_ar_e_read = -1;
|
|
|
|
static int hf_afp_dir_ar_e_write = -1;
|
|
|
|
static int hf_afp_dir_ar_u_search = -1;
|
|
|
|
static int hf_afp_dir_ar_u_read = -1;
|
|
|
|
static int hf_afp_dir_ar_u_write = -1;
|
|
|
|
static int hf_afp_dir_ar_blank = -1;
|
|
|
|
static int hf_afp_dir_ar_u_own = -1;
|
|
|
|
|
2002-07-29 06:35:12 +00:00
|
|
|
static int hf_afp_user_flag = -1;
|
|
|
|
static int hf_afp_user_ID = -1;
|
|
|
|
static int hf_afp_group_ID = -1;
|
|
|
|
static int hf_afp_user_bitmap = -1;
|
|
|
|
static int hf_afp_user_bitmap_UID = -1;
|
|
|
|
static int hf_afp_user_bitmap_GID = -1;
|
|
|
|
|
|
|
|
static gint ett_afp_user_bitmap = -1;
|
|
|
|
|
|
|
|
static const value_string user_flag_vals[] = {
|
|
|
|
{0, "Use user ID" },
|
|
|
|
{1, "Default user" },
|
|
|
|
{0, NULL } };
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/*
|
|
|
|
file bitmap AFP3.0.pdf
|
|
|
|
Table 1-7 p. 36
|
|
|
|
same as dir
|
|
|
|
kFPAttributeBit (bit 0)
|
|
|
|
kFPParentDirIDBit (bit 1)
|
|
|
|
kFPCreateDateBit (bit 2)
|
|
|
|
kFPModDateBit (bit 3)
|
|
|
|
kFPBackupDateBit (bit 4)
|
|
|
|
kFPFinderInfoBit (bit 5)
|
|
|
|
kFPLongNameBit (bit 6)
|
|
|
|
kFPShortNameBit (bit 7)
|
|
|
|
kFPNodeIDBit (bit 8)
|
|
|
|
|
|
|
|
kFPUTF8NameBit (bit 13)
|
|
|
|
*/
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
#define kFPDataForkLenBit (1 << 9)
|
|
|
|
#define kFPRsrcForkLenBit (1 << 10)
|
2002-04-25 23:58:02 +00:00
|
|
|
#define kFPExtDataForkLenBit (1 << 11)
|
2002-04-28 21:04:04 +00:00
|
|
|
#define kFPLaunchLimitBit (1 << 12)
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
#define kFPExtRsrcForkLenBit (1 << 14)
|
|
|
|
#define kFPUnixPrivsBit_file (1 << 15) /* :( */
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/*
|
|
|
|
file attribute AFP3.0.pdf
|
|
|
|
Table 1-8 p. 37
|
|
|
|
*/
|
|
|
|
#define kFPInvisibleBit (1 << 0)
|
|
|
|
#define kFPMultiUserBit (1 << 1)
|
|
|
|
#define kFPSystemBit (1 << 2)
|
|
|
|
#define kFPDAlreadyOpenBit (1 << 3)
|
|
|
|
#define kFPRAlreadyOpenBit (1 << 4)
|
|
|
|
#define kFPWriteInhibitBit (1 << 5)
|
|
|
|
#define kFPBackUpNeededBit (1 << 6)
|
2002-04-28 21:53:31 +00:00
|
|
|
#define kFPRenameInhibitBit (1 << 7)
|
|
|
|
#define kFPDeleteInhibitBit (1 << 8)
|
2002-04-28 19:21:39 +00:00
|
|
|
#define kFPCopyProtectBit (1 << 10)
|
|
|
|
#define kFPSetClearBit (1 << 15)
|
|
|
|
|
|
|
|
/* dir attribute */
|
|
|
|
#define kIsExpFolder (1 << 1)
|
2002-04-28 21:53:31 +00:00
|
|
|
#define kMounted (1 << 3)
|
2002-04-28 19:21:39 +00:00
|
|
|
#define kInExpFolder (1 << 4)
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
#define hash_init_count 20
|
|
|
|
|
|
|
|
/* Hash functions */
|
|
|
|
static gint afp_equal (gconstpointer v, gconstpointer v2);
|
|
|
|
static guint afp_hash (gconstpointer v);
|
|
|
|
|
|
|
|
static guint afp_packet_init_count = 200;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
guint32 conversation;
|
|
|
|
guint16 seq;
|
|
|
|
} afp_request_key;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
guint8 command;
|
|
|
|
} afp_request_val;
|
|
|
|
|
|
|
|
static GHashTable *afp_request_hash = NULL;
|
|
|
|
static GMemChunk *afp_request_keys = NULL;
|
|
|
|
static GMemChunk *afp_request_vals = NULL;
|
|
|
|
|
|
|
|
/* Hash Functions */
|
|
|
|
static gint afp_equal (gconstpointer v, gconstpointer v2)
|
|
|
|
{
|
|
|
|
afp_request_key *val1 = (afp_request_key*)v;
|
|
|
|
afp_request_key *val2 = (afp_request_key*)v2;
|
|
|
|
|
|
|
|
if (val1->conversation == val2->conversation &&
|
|
|
|
val1->seq == val2->seq) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static guint afp_hash (gconstpointer v)
|
|
|
|
{
|
|
|
|
afp_request_key *afp_key = (afp_request_key*)v;
|
|
|
|
return afp_key->seq;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* --------------------------
|
|
|
|
*/
|
|
|
|
#define PAD(x) { proto_tree_add_item(tree, hf_afp_pad, tvb, offset, x, FALSE); offset += x; }
|
|
|
|
|
|
|
|
static guint16
|
|
|
|
decode_vol_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint16 bitmap;
|
|
|
|
|
|
|
|
bitmap = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_item(tree, hf_afp_vol_bitmap, tvb, offset, 2,FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_vol_bitmap);
|
|
|
|
}
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_Attributes, tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_Signature, tvb, offset, 2,FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_CreateDate, tvb, offset, 2,FALSE);
|
2002-04-28 21:04:04 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_ModDate, tvb, offset, 2,FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_BackupDate, tvb, offset, 2,FALSE);
|
2002-04-28 21:04:04 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_ID, tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_BytesFree, tvb, offset, 2,FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_BytesTotal, tvb, offset, 2,FALSE);
|
2002-04-28 21:04:04 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_Name, tvb, offset, 2,FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_ExtBytesFree, tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_ExtBytesTotal, tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_bitmap_BlockSize , tvb, offset, 2,FALSE);
|
|
|
|
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static guint16
|
|
|
|
decode_vol_attribute (proto_tree *tree, tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint16 bitmap;
|
|
|
|
|
|
|
|
bitmap = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_item(tree, hf_afp_vol_attribute, tvb, offset, 2,FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_vol_attribute);
|
|
|
|
}
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_attribute_ReadOnly ,tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_attribute_HasVolumePassword ,tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsFileIDs ,tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsCatSearch ,tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsBlankAccessPrivs,tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsUnixPrivs ,tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_vol_attribute_SupportsUTF8Names ,tvb, offset, 2,FALSE);
|
|
|
|
|
|
|
|
return bitmap;
|
|
|
|
}
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
/* --------------------------
|
|
|
|
cf AFP3.0.pdf page 38
|
|
|
|
date are number of seconds from 12:00am on 01.01.2000 GMT
|
|
|
|
backup : 0x8000000 not set
|
|
|
|
from netatalk adouble.h
|
|
|
|
*/
|
|
|
|
#define DATE_NOT_SET 0x80000000
|
|
|
|
#define AD_DATE_DELTA 946684800
|
|
|
|
#define AD_DATE_TO_UNIX(x) (x + AD_DATE_DELTA)
|
|
|
|
static guint32
|
|
|
|
print_date(proto_tree *tree,int id, tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
2002-04-28 21:04:04 +00:00
|
|
|
time_t date = tvb_get_ntohl(tvb, offset);
|
|
|
|
nstime_t tv;
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
tv.secs = AD_DATE_TO_UNIX(date);
|
2002-04-28 22:08:50 +00:00
|
|
|
tv.nsecs = 0;
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_time(tree, id, tvb, offset, 4, &tv);
|
|
|
|
|
|
|
|
return date;
|
|
|
|
}
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
|
|
|
parse_vol_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 bitmap)
|
|
|
|
{
|
2002-04-28 21:04:04 +00:00
|
|
|
guint16 nameoff = 0;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
if ((bitmap & kFPVolAttributeBit)) {
|
|
|
|
decode_vol_attribute(tree,tvb,offset);
|
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolSignatureBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_signature,tvb, offset, 2, FALSE);
|
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolCreateDateBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
print_date(tree, hf_afp_vol_creation_date,tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolModDateBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
print_date(tree, hf_afp_vol_modification_date,tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolBackupDateBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
print_date(tree, hf_afp_vol_backup_date,tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolIDBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolBytesFreeBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_bytes_free,tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolBytesTotalBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_bytes_total,tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolNameBit)) {
|
|
|
|
nameoff = tvb_get_ntohs(tvb, offset);
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_vol_name_offset,tvb, offset, 2, FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolExtBytesFreeBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_ex_bytes_free,tvb, offset, 8, FALSE);
|
|
|
|
offset += 8;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolExtBytesTotalBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_ex_bytes_total,tvb, offset, 8, FALSE);
|
|
|
|
offset += 8;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPVolBlockSizeBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_block_size,tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if (nameoff) {
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
guint8 len;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_name, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
|
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static guint16
|
|
|
|
decode_file_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint16 bitmap;
|
|
|
|
|
|
|
|
bitmap = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_item(tree, hf_afp_file_bitmap, tvb, offset, 2,FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_file_bitmap);
|
|
|
|
}
|
2002-04-28 21:04:04 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_Attributes , tvb, offset, 2,FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_ParentDirID , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_CreateDate , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_ModDate , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_BackupDate , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_FinderInfo , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_LongName , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_ShortName , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_NodeID , tvb, offset, 2,FALSE);
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_DataForkLen , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_RsrcForkLen , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_ExtDataForkLen , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_LaunchLimit , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_UTF8Name , tvb, offset, 2,FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_ExtRsrcForkLen , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_bitmap_UnixPrivs , tvb, offset, 2,FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
static guint16
|
|
|
|
decode_file_attribute(proto_tree *tree, tvbuff_t *tvb, gint offset, int shared)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint16 attribute;
|
|
|
|
|
|
|
|
attribute = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_text(tree, tvb, offset, 2,
|
2002-04-28 21:22:20 +00:00
|
|
|
"File Attributes: 0x%04x", attribute);
|
2002-04-28 19:21:39 +00:00
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_file_attribute);
|
|
|
|
}
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_Invisible , tvb, offset, 2,FALSE);
|
|
|
|
if (!shared)
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_MultiUser , tvb, offset, 2,FALSE);
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_System , tvb, offset, 2,FALSE);
|
|
|
|
|
|
|
|
if (!shared) {
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_DAlreadyOpen , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_RAlreadyOpen , tvb, offset, 2,FALSE);
|
|
|
|
}
|
2002-06-20 00:44:33 +00:00
|
|
|
/* writeinhibit is file only but Macs are setting it with FPSetFileDirParms too */
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_WriteInhibit , tvb, offset, 2,FALSE);
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_BackUpNeeded , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_RenameInhibit, tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_DeleteInhibit, tvb, offset, 2,FALSE);
|
|
|
|
|
|
|
|
if (!shared)
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_CopyProtect , tvb, offset, 2,FALSE);
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_file_attribute_SetClear , tvb, offset, 2,FALSE);
|
|
|
|
|
|
|
|
return(attribute);
|
|
|
|
}
|
|
|
|
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
static void
|
|
|
|
decode_access_rights (proto_tree *tree, tvbuff_t *tvb, int hf, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree;
|
|
|
|
proto_item *item;
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_item(tree, hf, tvb, offset, 4, FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_dir_ar);
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_o_search, tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_o_read , tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_o_write , tvb, offset, 4, FALSE);
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_g_search, tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_g_read , tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_g_write , tvb, offset, 4, FALSE);
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_e_search, tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_e_read , tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_e_write , tvb, offset, 4, FALSE);
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_u_search, tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_u_read , tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_u_write , tvb, offset, 4, FALSE);
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_blank , tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_ar_u_own , tvb, offset, 4, FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
decode_unix_privs (proto_tree *tree, tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree;
|
|
|
|
proto_item *item;
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_text(tree, tvb, offset, 16,
|
|
|
|
"UNIX privileges");
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_unix_privs);
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_unix_privs_uid, tvb, offset, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_unix_privs_gid, tvb, offset+4, 4, FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_unix_privs_permissions, tvb, offset+8, 4, FALSE);
|
|
|
|
decode_access_rights(sub_tree, tvb, hf_afp_unix_privs_ua_permissions, offset+12);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-04-28 19:21:39 +00:00
|
|
|
parse_file_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 bitmap, int shared)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
guint16 lnameoff = 0;
|
|
|
|
guint16 snameoff = 0;
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
guint16 unameoff = 0;
|
2002-04-25 23:58:02 +00:00
|
|
|
gint max_offset = 0;
|
|
|
|
|
|
|
|
gint org_offset = offset;
|
|
|
|
|
|
|
|
if ((bitmap & kFPAttributeBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
decode_file_attribute(tree, tvb, offset, shared);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPParentDirIDBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPCreateDateBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
print_date(tree, hf_afp_creation_date,tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPModDateBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
print_date(tree, hf_afp_modification_date,tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPBackupDateBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
print_date(tree, hf_afp_backup_date,tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPFinderInfoBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_finder_info,tvb, offset, 32, FALSE);
|
|
|
|
offset += 32;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPLongNameBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
gint tp_ofs;
|
|
|
|
guint8 len;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
lnameoff = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (lnameoff) {
|
|
|
|
tp_ofs = lnameoff +org_offset;
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_long_name_offset,tvb, offset, 2, FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
len = tvb_get_guint8(tvb, tp_ofs);
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_path_len, tvb, tp_ofs, 1,FALSE);
|
|
|
|
tp_ofs++;
|
|
|
|
proto_tree_add_item(tree, hf_afp_path_name, tvb, tp_ofs, len,FALSE);
|
|
|
|
tp_ofs += len;
|
2002-04-25 23:58:02 +00:00
|
|
|
max_offset = (tp_ofs >max_offset)?tp_ofs:max_offset;
|
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPShortNameBit)) {
|
|
|
|
snameoff = tvb_get_ntohs(tvb, offset);
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_short_name_offset,tvb, offset, 2, FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPNodeIDBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
if ((bitmap & kFPDataForkLenBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_DataForkLen, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((bitmap & kFPRsrcForkLenBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_RsrcForkLen, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((bitmap & kFPExtDataForkLenBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_ExtDataForkLen, tvb, offset, 8,FALSE);
|
|
|
|
offset += 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((bitmap & kFPLaunchLimitBit)) {
|
|
|
|
offset += 2; /* ? */
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((bitmap & kFPUTF8NameBit)) {
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
unameoff = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_unicode_name_offset,tvb, offset, 2, FALSE);
|
2002-04-28 19:21:39 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((bitmap & kFPExtRsrcForkLenBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_ExtRsrcForkLen, tvb, offset, 8,FALSE);
|
|
|
|
offset += 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((bitmap & kFPUnixPrivsBit_file)) {
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
/*
|
|
|
|
* XXX - the AFP 3.0 spec says this is "Four bytes", but
|
|
|
|
* also says the privileges are "stored in an FPUnixPrivs
|
|
|
|
* structure", which is 16 bytes long.
|
|
|
|
*
|
|
|
|
* We assume, for now, that the latter is true.
|
|
|
|
*/
|
|
|
|
decode_unix_privs(tree, tvb, offset);
|
|
|
|
offset += 16;
|
2002-04-28 19:21:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return (max_offset)?max_offset:offset;
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static guint16
|
|
|
|
decode_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint16 bitmap;
|
|
|
|
|
|
|
|
bitmap = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_item(tree, hf_afp_dir_bitmap, tvb, offset, 2,FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_dir_bitmap);
|
|
|
|
}
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_Attributes , tvb, offset, 2,FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_ParentDirID , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_CreateDate , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_ModDate , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_BackupDate , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_FinderInfo , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_LongName , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_ShortName , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_NodeID , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_OffspringCount , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_OwnerID , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_GroupID , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_AccessRights , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_UTF8Name , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_bitmap_UnixPrivs , tvb, offset, 2,FALSE);
|
|
|
|
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
static guint16
|
|
|
|
decode_dir_attribute(proto_tree *tree, tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint16 attribute;
|
|
|
|
|
|
|
|
attribute = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_text(tree, tvb, offset, 2,
|
2002-04-28 21:22:20 +00:00
|
|
|
"Directory Attributes: 0x%04x", attribute);
|
2002-04-28 19:21:39 +00:00
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_dir_attribute);
|
|
|
|
}
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_attribute_Invisible , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_attribute_IsExpFolder , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_attribute_System , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_attribute_Mounted , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_attribute_InExpFolder , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_attribute_BackUpNeeded , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_attribute_RenameInhibit, tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_dir_attribute_DeleteInhibit, tvb, offset, 2,FALSE);
|
|
|
|
|
|
|
|
return(attribute);
|
|
|
|
}
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
|
|
|
parse_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset, guint16 bitmap)
|
|
|
|
{
|
|
|
|
guint16 lnameoff = 0;
|
|
|
|
guint16 snameoff = 0;
|
|
|
|
guint16 unameoff = 0;
|
|
|
|
gint max_offset = 0;
|
|
|
|
|
|
|
|
gint org_offset = offset;
|
|
|
|
|
|
|
|
if ((bitmap & kFPAttributeBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
decode_dir_attribute(tree, tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPParentDirIDBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPCreateDateBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
print_date(tree, hf_afp_creation_date,tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPModDateBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
print_date(tree, hf_afp_modification_date,tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPBackupDateBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
print_date(tree, hf_afp_backup_date,tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPFinderInfoBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_finder_info,tvb, offset, 32, FALSE);
|
|
|
|
offset += 32;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPLongNameBit)) {
|
|
|
|
gint tp_ofs;
|
|
|
|
guint8 len;
|
|
|
|
lnameoff = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (lnameoff) {
|
|
|
|
tp_ofs = lnameoff +org_offset;
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_long_name_offset,tvb, offset, 2, FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
len = tvb_get_guint8(tvb, tp_ofs);
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_path_len, tvb, tp_ofs, 1,FALSE);
|
|
|
|
tp_ofs++;
|
|
|
|
proto_tree_add_item(tree, hf_afp_path_name, tvb, tp_ofs, len,FALSE);
|
|
|
|
tp_ofs += len;
|
2002-04-25 23:58:02 +00:00
|
|
|
max_offset = (tp_ofs >max_offset)?tp_ofs:max_offset;
|
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPShortNameBit)) {
|
|
|
|
snameoff = tvb_get_ntohs(tvb, offset);
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_short_name_offset,tvb, offset, 2, FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPNodeIDBit)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPOffspringCountBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_dir_offspring, tvb, offset, 2,FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 2; /* error in AFP3.0.pdf */
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPOwnerIDBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_dir_OwnerID, tvb, offset, 4, FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPGroupIDBit)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_dir_GroupID, tvb, offset, 4, FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPAccessRightsBit)) {
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
decode_access_rights(tree, tvb, hf_afp_dir_ar, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPUTF8NameBit)) {
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
unameoff = tvb_get_ntohs(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_unicode_name_offset,tvb, offset, 2, FALSE);
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
if ((bitmap & kFPUnixPrivsBit)) {
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
/*
|
|
|
|
* XXX - the AFP 3.0 spec says this is "Four bytes", but
|
|
|
|
* also says the privileges are "stored in an FPUnixPrivs
|
|
|
|
* structure", which is 16 bytes long.
|
|
|
|
*
|
|
|
|
* We assume, for now, that the latter is true.
|
|
|
|
*/
|
|
|
|
decode_unix_privs(tree, tvb, offset);
|
|
|
|
offset += 16;
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
return (max_offset)?max_offset:offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gchar *
|
|
|
|
name_in_bitmap(tvbuff_t *tvb, gint *offset, guint16 bitmap)
|
|
|
|
{
|
|
|
|
gchar *name;
|
|
|
|
gint org_offset = *offset;
|
|
|
|
guint16 nameoff;
|
|
|
|
guint8 len;
|
|
|
|
gint tp_ofs;
|
|
|
|
|
|
|
|
name = NULL;
|
|
|
|
if ((bitmap & kFPAttributeBit))
|
|
|
|
*offset += 2;
|
|
|
|
if ((bitmap & kFPParentDirIDBit))
|
|
|
|
*offset += 4;
|
|
|
|
if ((bitmap & kFPCreateDateBit))
|
|
|
|
*offset += 4;
|
|
|
|
if ((bitmap & kFPModDateBit))
|
|
|
|
*offset += 4;
|
|
|
|
if ((bitmap & kFPBackupDateBit))
|
|
|
|
*offset += 4;
|
|
|
|
if ((bitmap & kFPFinderInfoBit))
|
|
|
|
*offset += 32;
|
|
|
|
|
|
|
|
if ((bitmap & kFPLongNameBit)) {
|
|
|
|
nameoff = tvb_get_ntohs(tvb, *offset);
|
|
|
|
if (nameoff) {
|
|
|
|
tp_ofs = nameoff +org_offset;
|
|
|
|
len = tvb_get_guint8(tvb, tp_ofs);
|
|
|
|
tp_ofs++;
|
|
|
|
if (!(name = g_malloc(len +1)))
|
|
|
|
return name;
|
|
|
|
tvb_memcpy(tvb, name, tp_ofs, len);
|
|
|
|
*(name +len) = 0;
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* short name ? */
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gchar *
|
|
|
|
name_in_dbitmap(tvbuff_t *tvb, gint offset, guint16 bitmap)
|
|
|
|
{
|
|
|
|
gchar *name;
|
|
|
|
|
|
|
|
name = name_in_bitmap(tvb, &offset, bitmap);
|
|
|
|
if (name != NULL)
|
|
|
|
return name;
|
|
|
|
/*
|
|
|
|
check UTF8 name
|
|
|
|
*/
|
|
|
|
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gchar *
|
|
|
|
name_in_fbitmap(tvbuff_t *tvb, gint offset, guint16 bitmap)
|
|
|
|
{
|
|
|
|
gchar *name;
|
|
|
|
|
|
|
|
name = name_in_bitmap(tvb, &offset, bitmap);
|
|
|
|
if (name != NULL)
|
|
|
|
return name;
|
|
|
|
/*
|
|
|
|
check UTF8 name
|
|
|
|
*/
|
|
|
|
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-04-28 19:21:39 +00:00
|
|
|
decode_vol_did(proto_tree *tree, tvbuff_t *tvb, gint offset)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
2002-04-28 19:21:39 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
|
|
|
decode_vol_did_file_dir_bitmap (proto_tree *tree, tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
|
|
|
offset = decode_vol_did(tree, tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
decode_dir_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
/* ------------------------ */
|
2002-04-28 19:21:39 +00:00
|
|
|
static gchar *
|
|
|
|
get_name(tvbuff_t *tvb, int offset, int type)
|
|
|
|
{
|
|
|
|
guint8 len;
|
2002-04-30 22:05:33 +00:00
|
|
|
gchar *string;
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
offset++;
|
2002-04-30 22:05:33 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
switch (type) {
|
|
|
|
case 1:
|
|
|
|
case 2:
|
2002-04-30 22:05:33 +00:00
|
|
|
string = tvb_format_text(tvb,offset, len);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
string = "error Unicode...,next time";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
string = "unknow type";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return string;
|
2002-04-28 19:21:39 +00:00
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-04-28 19:21:39 +00:00
|
|
|
decode_name_label (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset, const gchar *label)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
int len;
|
2002-04-28 19:21:39 +00:00
|
|
|
gchar *name;
|
|
|
|
guint8 type;
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
|
|
|
|
type = tvb_get_guint8(tvb, offset);
|
|
|
|
len = tvb_get_guint8(tvb, offset +1);
|
|
|
|
name = get_name(tvb, offset +1, type);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
if (pinfo && check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", name);
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_text(tree, tvb, offset, len +2, label, name);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_path_name);
|
|
|
|
proto_tree_add_item( sub_tree, hf_afp_path_type, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item( sub_tree, hf_afp_path_len, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_string(sub_tree, hf_afp_path_name, tvb, offset, len,name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
offset += 2;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
return offset +len;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
|
|
|
decode_name (proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, gint offset)
|
|
|
|
{
|
2002-04-28 21:04:04 +00:00
|
|
|
return decode_name_label(tree, pinfo, tvb, offset, "Path: %s");
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_open_vol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
int len;
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
|
|
|
|
decode_vol_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
2002-05-01 10:01:42 +00:00
|
|
|
const gchar *rep;
|
2002-04-28 19:21:39 +00:00
|
|
|
rep = get_name(tvb, offset, 2);
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", rep);
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
if (!tree)
|
|
|
|
return offset;
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_vol_name, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
|
|
|
|
len = tvb_reported_length_remaining(tvb,offset);
|
|
|
|
if (len >= 8) {
|
|
|
|
/* optionnal password */
|
|
|
|
proto_tree_add_item(tree, hf_afp_passwd, tvb, offset, 8,FALSE);
|
|
|
|
offset += 8;
|
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_open_vol(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
guint16 bitmap;
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
if (!tree)
|
|
|
|
return offset;
|
2002-04-25 23:58:02 +00:00
|
|
|
bitmap = decode_vol_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
offset = parse_vol_bitmap(tree, tvb, offset, bitmap);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_get_server_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-30 22:05:33 +00:00
|
|
|
{
|
|
|
|
guint8 num;
|
|
|
|
guint8 len;
|
|
|
|
guint8 flag;
|
|
|
|
guint8 i;
|
|
|
|
proto_tree *sub_tree = NULL;
|
2002-05-03 21:25:43 +00:00
|
|
|
proto_tree *flag_tree;
|
2002-04-30 22:05:33 +00:00
|
|
|
proto_item *item;
|
2002-05-03 21:25:43 +00:00
|
|
|
proto_item *ti;
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
if (!tree)
|
|
|
|
return offset;
|
|
|
|
|
|
|
|
print_date(tree, hf_afp_server_time,tvb, offset);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
num = tvb_get_guint8(tvb, offset);
|
|
|
|
item = proto_tree_add_text(tree, tvb, offset, 1, "Volumes : %d", num);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_server_vol);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
for (i = 0; i < num; i++) {
|
|
|
|
const gchar *rep;
|
|
|
|
|
|
|
|
item = proto_tree_add_text(sub_tree, tvb, offset, -1,"Volume");
|
|
|
|
tree = proto_item_add_subtree(item, ett_afp_vol_list);
|
|
|
|
|
|
|
|
flag = tvb_get_guint8(tvb, offset);
|
2002-05-03 21:25:43 +00:00
|
|
|
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset , 1,"Flags : 0x%02x", flag);
|
|
|
|
flag_tree = proto_item_add_subtree(ti, ett_afp_vol_flag);
|
|
|
|
proto_tree_add_item(flag_tree, hf_afp_vol_flag_passwd, tvb, offset, 1,FALSE);
|
|
|
|
proto_tree_add_item(flag_tree, hf_afp_vol_flag_unix_priv ,tvb, offset, 1,FALSE);
|
2002-04-30 22:05:33 +00:00
|
|
|
offset++;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset) +1;
|
|
|
|
rep = get_name(tvb, offset, 2);
|
|
|
|
proto_item_set_text(item, rep);
|
|
|
|
proto_item_set_len(item, len +1);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_name, tvb, offset, 1,FALSE);
|
|
|
|
|
|
|
|
offset += len;
|
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* **************************
|
|
|
|
next calls use the same format :
|
|
|
|
1 pad byte
|
|
|
|
volume id
|
|
|
|
AFP_FLUSH
|
|
|
|
AFP_CLOSEVOL
|
|
|
|
AFP_OPENDT
|
|
|
|
*/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_with_vol_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
if (!tree)
|
|
|
|
return offset;
|
|
|
|
PAD(1);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_open_fork(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_fork_type, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = decode_vol_did(tree, tvb, offset);
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_item(tree, hf_afp_access_mode, tvb, offset, 2,FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_access_mode);
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_item(sub_tree, hf_afp_access_read , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_access_write , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_access_deny_read , tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_access_deny_write, tvb, offset, 2,FALSE);
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
offset += 2;
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_open_fork(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
int f_bitmap;
|
|
|
|
|
|
|
|
f_bitmap = decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_enumerate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
offset = decode_vol_did_file_dir_bitmap(tree, tvb, offset);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_req_count, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_start_index, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_max_reply_size, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
2002-04-30 22:05:33 +00:00
|
|
|
static int
|
|
|
|
loop_record(tvbuff_t *tvb, proto_tree *ptree, gint offset,
|
|
|
|
int count, guint16 d_bitmap, guint16 f_bitmap, int add)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
2002-04-30 22:05:33 +00:00
|
|
|
proto_tree *tree = NULL;
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_item *item;
|
2002-04-30 22:05:33 +00:00
|
|
|
gchar *name;
|
2002-04-25 23:58:02 +00:00
|
|
|
guint8 flags;
|
|
|
|
guint8 size;
|
|
|
|
gint org;
|
|
|
|
int i;
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
for (i = 0; i < count; i++) {
|
2002-04-25 23:58:02 +00:00
|
|
|
org = offset;
|
|
|
|
name = NULL;
|
2002-04-30 22:05:33 +00:00
|
|
|
size = tvb_get_guint8(tvb, offset) +add;
|
2002-04-25 23:58:02 +00:00
|
|
|
flags = tvb_get_guint8(tvb, offset +1);
|
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
if (ptree) {
|
2002-04-28 19:21:39 +00:00
|
|
|
if (flags) {
|
|
|
|
name = name_in_dbitmap(tvb, offset +2, d_bitmap);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
name = name_in_fbitmap(tvb, offset +2, f_bitmap);
|
|
|
|
}
|
|
|
|
if (!name) {
|
|
|
|
if (!(name = g_malloc(50))) { /* no memory ! */
|
|
|
|
}
|
|
|
|
snprintf(name, 50,"line %d", i +1);
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
2002-04-30 22:05:33 +00:00
|
|
|
item = proto_tree_add_text(ptree, tvb, offset, size, name);
|
2002-04-28 19:21:39 +00:00
|
|
|
tree = proto_item_add_subtree(item, ett_afp_enumerate_line);
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
proto_tree_add_item(tree, hf_afp_struct_size, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_flag, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
if (flags) {
|
|
|
|
offset = parse_dir_bitmap(tree, tvb, offset, d_bitmap);
|
|
|
|
}
|
|
|
|
else {
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
if ((offset & 1))
|
|
|
|
PAD(1);
|
|
|
|
offset = org +size; /* play safe */
|
2002-04-30 22:05:33 +00:00
|
|
|
if (ptree)
|
2002-04-28 19:21:39 +00:00
|
|
|
g_free((gpointer)name);
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
2002-04-30 22:05:33 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_enumerate(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-30 22:05:33 +00:00
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
int count;
|
|
|
|
guint16 f_bitmap;
|
|
|
|
guint16 d_bitmap;
|
|
|
|
|
|
|
|
f_bitmap = decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
d_bitmap = decode_dir_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
count = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_item(tree, hf_afp_req_count, tvb, offset, 2,FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_enumerate);
|
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return loop_record(tvb,sub_tree, offset, count, d_bitmap, f_bitmap,0);
|
|
|
|
|
|
|
|
}
|
|
|
|
/* **************************/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_cat_search(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *ptree, gint offset)
|
2002-04-30 22:05:33 +00:00
|
|
|
{
|
|
|
|
proto_tree *tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint16 f_bitmap;
|
|
|
|
guint16 d_bitmap;
|
|
|
|
guint32 r_bitmap;
|
|
|
|
guint8 size;
|
|
|
|
gint org;
|
|
|
|
|
|
|
|
if (!ptree)
|
|
|
|
return offset;
|
|
|
|
PAD(1);
|
|
|
|
|
|
|
|
proto_tree_add_item(ptree, hf_afp_vol_id, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(ptree, hf_afp_cat_req_matches, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(ptree, hf_afp_reserved, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(ptree, hf_afp_cat_position, tvb, offset, 16,FALSE);
|
|
|
|
offset += 16;
|
|
|
|
|
|
|
|
f_bitmap = decode_file_bitmap(ptree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
d_bitmap = decode_dir_bitmap(ptree, tvb, offset);
|
|
|
|
offset += 2;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-30 22:05:33 +00:00
|
|
|
/* FIXME req bitmap */
|
|
|
|
item = proto_tree_add_text(ptree, tvb, offset, 4, "Request bitmap");
|
|
|
|
tree = proto_item_add_subtree(item, ett_afp_cat_r_bitmap);
|
|
|
|
r_bitmap = decode_file_bitmap(tree, tvb, offset+2);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
/* spec 1 */
|
|
|
|
org = offset;
|
|
|
|
size = tvb_get_guint8(tvb, offset) +2;
|
|
|
|
|
|
|
|
item = proto_tree_add_text(ptree, tvb, offset, size, "Spec 1");
|
|
|
|
tree = proto_item_add_subtree(item, ett_afp_cat_spec);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_struct_size, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
PAD(1);
|
|
|
|
|
|
|
|
offset = parse_file_bitmap(tree, tvb, offset, r_bitmap,0);
|
|
|
|
offset = org +size;
|
|
|
|
|
|
|
|
/* spec 2 */
|
|
|
|
org = offset;
|
|
|
|
size = tvb_get_guint8(tvb, offset) +2;
|
|
|
|
|
|
|
|
item = proto_tree_add_text(ptree, tvb, offset, size, "Spec 2");
|
|
|
|
tree = proto_item_add_subtree(item, ett_afp_cat_spec);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_struct_size, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
PAD(1);
|
|
|
|
|
|
|
|
offset = parse_file_bitmap(tree, tvb, offset, r_bitmap,0);
|
|
|
|
offset = org +size;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_cat_search(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-30 22:05:33 +00:00
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint16 f_bitmap;
|
|
|
|
guint16 d_bitmap;
|
|
|
|
int count;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_cat_position, tvb, offset, 16,FALSE);
|
|
|
|
offset += 16;
|
|
|
|
|
|
|
|
f_bitmap = decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
d_bitmap = decode_dir_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
count = tvb_get_ntohl(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_item(tree, hf_afp_cat_count, tvb, offset, 4,FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_cat_search);
|
|
|
|
}
|
|
|
|
offset += 4;
|
|
|
|
return loop_record(tvb,sub_tree, offset, count, d_bitmap, f_bitmap, 2);
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* **************************/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_get_vol_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
PAD(1)
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
decode_vol_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ------------------------ */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_get_vol_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
guint16 bitmap;
|
|
|
|
|
|
|
|
bitmap = decode_vol_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
offset = parse_vol_bitmap(tree, tvb, offset, bitmap);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* **************************/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_set_vol_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
guint16 bitmap;
|
|
|
|
|
|
|
|
PAD(1)
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
bitmap = decode_vol_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
offset = parse_vol_bitmap(tree, tvb, offset, bitmap);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/* ***************************/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_login(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
int len;
|
2002-04-28 21:53:31 +00:00
|
|
|
const char *uam;
|
2002-04-28 19:21:39 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_AFPVersion, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
2002-04-28 19:21:39 +00:00
|
|
|
uam = tvb_get_ptr(tvb, offset +1, len);
|
2002-04-25 23:58:02 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
|
2002-05-11 22:40:40 +00:00
|
|
|
if (!strncasecmp(uam, "Cleartxt passwrd", len)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
/* clear text */
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_user, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-06-20 00:44:33 +00:00
|
|
|
len = 8; /* tvb_strsize(tvb, offset);*/
|
2002-04-28 19:21:39 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_passwd, tvb, offset, len,FALSE);
|
|
|
|
offset += len;
|
|
|
|
}
|
2002-05-11 22:40:40 +00:00
|
|
|
else if (!strncasecmp(uam, "No User Authent", len)) {
|
2002-04-28 19:21:39 +00:00
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
return(offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_write(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_flag, tvb, offset, 1,FALSE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_offset, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_rw_count, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:33:32 +00:00
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_write(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:33:32 +00:00
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_last_written, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-06-20 00:44:33 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_write_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_flag, tvb, offset, 1,FALSE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_offset64, tvb, offset, 8,FALSE);
|
|
|
|
offset += 8;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_rw_count64, tvb, offset, 8,FALSE);
|
|
|
|
offset += 8;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
dissect_reply_afp_write_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_last_written64, tvb, offset, 8, FALSE);
|
|
|
|
offset += 8;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_read(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
PAD(1);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_offset, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_rw_count, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_newline_mask, tvb, offset, 1,FALSE);
|
2002-04-28 19:21:39 +00:00
|
|
|
offset++;
|
|
|
|
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_afp_newline_char, tvb, offset, 1,FALSE);
|
2002-04-28 19:21:39 +00:00
|
|
|
offset++;
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-06-20 00:44:33 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_read_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
PAD(1);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_offset64, tvb, offset, 8,FALSE);
|
|
|
|
offset += 8;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_rw_count64, tvb, offset, 8,FALSE);
|
|
|
|
offset += 8;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* **************************
|
|
|
|
Open desktop call
|
|
|
|
query is the same than AFP_FLUSH, AFP_CLOSEVOL
|
|
|
|
|
|
|
|
*/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_open_dt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* **************************
|
|
|
|
no reply
|
|
|
|
*/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_close_dt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* **************************
|
|
|
|
calls using the same format :
|
|
|
|
1 pad byte
|
|
|
|
fork number
|
|
|
|
AFP_FLUSHFORK
|
|
|
|
AFP_CLOSEFORK
|
|
|
|
*/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_with_fork(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_get_fldr_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
PAD(1);
|
|
|
|
offset = decode_vol_did_file_dir_bitmap(tree, tvb, offset);
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_get_fldr_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-25 23:58:02 +00:00
|
|
|
{
|
2002-04-28 19:21:39 +00:00
|
|
|
guint8 flags;
|
|
|
|
guint16 f_bitmap, d_bitmap;
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
f_bitmap = decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
d_bitmap = decode_dir_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
flags = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_flag, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
PAD(1);
|
|
|
|
if (flags) {
|
|
|
|
offset = parse_dir_bitmap(tree, tvb, offset, d_bitmap);
|
|
|
|
}
|
|
|
|
else {
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* **************************
|
|
|
|
no reply
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_set_fldr_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
guint16 f_bitmap;
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
offset = decode_vol_did(tree, tvb, offset);
|
|
|
|
|
|
|
|
f_bitmap = decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
|
|
|
|
|
|
|
if ((offset & 1))
|
|
|
|
PAD(1);
|
|
|
|
/* did:name can be a file or a folder but only the intersection between
|
2002-06-20 00:44:33 +00:00
|
|
|
* file bitmap and dir bitmap can be set.
|
|
|
|
* Well it's in afp spec, but clients (Mac) are setting 'file only' bits with this call
|
|
|
|
* (WriteInhibit for example).
|
2002-04-28 19:21:39 +00:00
|
|
|
*/
|
|
|
|
offset = parse_file_bitmap(tree, tvb, offset, f_bitmap, 1);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* **************************
|
|
|
|
no reply
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_set_file_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
guint16 f_bitmap;
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
offset = decode_vol_did(tree, tvb, offset);
|
|
|
|
|
|
|
|
f_bitmap = decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
|
|
|
|
|
|
|
if ((offset & 1))
|
|
|
|
PAD(1);
|
|
|
|
offset = parse_file_bitmap(tree, tvb, offset, f_bitmap, 0);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* **************************
|
|
|
|
no reply
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_set_dir_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
guint16 d_bitmap;
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
offset = decode_vol_did(tree, tvb, offset);
|
|
|
|
|
|
|
|
d_bitmap = decode_dir_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
|
|
|
|
|
|
|
if ((offset & 1))
|
|
|
|
PAD(1);
|
|
|
|
offset = parse_dir_bitmap(tree, tvb, offset, d_bitmap);
|
|
|
|
|
|
|
|
offset += 4;
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* **************************
|
|
|
|
AFP_DELETE
|
|
|
|
AFP_CREATE_DIR
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_create_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
PAD(1);
|
|
|
|
offset = decode_vol_did(tree, tvb, offset);
|
|
|
|
|
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* --------------------------
|
|
|
|
AFP_MOVE
|
|
|
|
*/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_create_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_create_dir(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* **************************
|
|
|
|
no reply
|
|
|
|
*/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_delete_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* **************************
|
|
|
|
same reply as get_fork_param
|
|
|
|
*/
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_resolve_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_vol_id, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_id, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_get_fork_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_get_fork_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
guint16 f_bitmap;
|
|
|
|
|
|
|
|
f_bitmap = decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
offset = parse_file_bitmap(tree, tvb, offset, f_bitmap,0);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_set_fork_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork_len, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_move(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
offset = decode_vol_did(tree, tvb, offset);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
offset = decode_name_label(tree, pinfo, tvb, offset, "Source path: %s");
|
|
|
|
offset = decode_name_label(tree, NULL, tvb, offset, "Dest dir: %s");
|
|
|
|
offset = decode_name_label(tree, NULL, tvb, offset, "New name: %s");
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-05-11 22:40:40 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_exchange_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
offset = decode_vol_did(tree, tvb, offset);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
offset = decode_name_label(tree, pinfo, tvb, offset, "Source path: %s");
|
|
|
|
offset = decode_name_label(tree, NULL, tvb, offset, "Dest path: %s");
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
2002-05-03 21:25:43 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_copy_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_text(tree, tvb, offset, 6,"Source volume");
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_vol_did);
|
|
|
|
}
|
|
|
|
offset = decode_vol_did(sub_tree, tvb, offset);
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_text(tree, tvb, offset, 6,"Dest volume");
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_vol_did);
|
|
|
|
}
|
|
|
|
offset = decode_vol_did(sub_tree, tvb, offset);
|
|
|
|
|
|
|
|
offset = decode_name_label(tree, pinfo, tvb, offset, "Source path: %s");
|
|
|
|
offset = decode_name_label(tree, NULL, tvb, offset, "Dest dir: %s");
|
|
|
|
offset = decode_name_label(tree, NULL, tvb, offset, "New name: %s");
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_rename(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
offset = decode_vol_did(tree, tvb, offset);
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
offset = decode_name_label(tree, pinfo, tvb, offset, "Old name: %s");
|
|
|
|
offset = decode_name_label(tree, NULL, tvb, offset, "New name: %s");
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_byte_lock(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint8 flag;
|
|
|
|
|
|
|
|
flag = tvb_get_guint8(tvb, offset);
|
|
|
|
if (tree) {
|
2002-04-28 21:04:04 +00:00
|
|
|
item = proto_tree_add_text(tree, tvb, offset, 1, "Flags: 0x%02x", flag);
|
2002-04-28 19:21:39 +00:00
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_lock_flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_lock_op, tvb, offset, 1,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_lock_from, tvb, offset, 1,FALSE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_lock_offset, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_lock_len, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_byte_lock(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_lock_range_start, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-06-20 00:44:33 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_byte_lock_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint8 flag;
|
|
|
|
|
|
|
|
flag = tvb_get_guint8(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_text(tree, tvb, offset, 1, "Flags: 0x%02x", flag);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_lock_flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_lock_op, tvb, offset, 1,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_lock_from, tvb, offset, 1,FALSE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_ofork, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_lock_offset64, tvb, offset, 8,FALSE);
|
|
|
|
offset += 8;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_lock_len64, tvb, offset, 8,FALSE);
|
|
|
|
offset += 8;
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
|
|
|
dissect_reply_afp_byte_lock_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_lock_range_start64, tvb, offset, 8,FALSE);
|
|
|
|
offset += 8;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_add_cmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
guint8 len;
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
|
|
|
|
|
|
|
if ((offset & 1))
|
|
|
|
PAD(1);
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_comment, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_get_cmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_get_cmt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
guint8 len;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_comment, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_get_icon(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_type, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_icon_type, tvb, offset, 1,FALSE);
|
|
|
|
offset += 1;
|
|
|
|
PAD(1);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_icon_length, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_get_icon_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_icon_index, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_get_icon_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_icon_tag, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_type, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_icon_type, tvb, offset, 1,FALSE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_icon_length, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_add_icon(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_type, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_icon_type, tvb, offset, 1,FALSE);
|
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_icon_tag, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_icon_length, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* **************************
|
|
|
|
no reply
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_add_appl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_appl_tag, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* **************************
|
|
|
|
no reply
|
|
|
|
*/
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_rmv_appl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_did, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_query_afp_get_appl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_dt_ref, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_file_creator, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_appl_index, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
decode_file_bitmap(tree, tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
2002-05-01 10:01:42 +00:00
|
|
|
dissect_reply_afp_get_appl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
2002-04-28 19:21:39 +00:00
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_appl_tag, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_create_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_create_flag, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
offset = decode_vol_did(tree, tvb, offset);
|
|
|
|
|
|
|
|
offset = decode_name(tree, pinfo, tvb, offset);
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-06-20 00:44:33 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_map_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree_add_item(tree, hf_afp_map_id_type, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_map_id, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
|
|
|
dissect_reply_afp_map_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
int len;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_map_name, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_map_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
int len;
|
|
|
|
proto_tree_add_item(tree, hf_afp_map_name_type, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_map_name, tvb, offset, 1,FALSE);
|
|
|
|
offset += len +1;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
|
|
|
dissect_reply_afp_map_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_map_id, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_disconnect_old_session(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
int len;
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
len = tvb_get_ntohl(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_session_token_len, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_session_token, tvb, offset, len,FALSE);
|
|
|
|
offset += len;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_get_session_token(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
|
|
|
|
PAD(1);
|
|
|
|
proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
|
|
|
dissect_reply_afp_get_session_token(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
int len;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_session_token_type, tvb, offset, 2,FALSE);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
len = tvb_get_ntohl(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_afp_session_token_len, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_session_token, tvb, offset, len,FALSE);
|
|
|
|
offset += len;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-07-29 06:35:12 +00:00
|
|
|
/* ************************** */
|
|
|
|
static gint
|
|
|
|
dissect_query_afp_get_user_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint16 bitmap;
|
|
|
|
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_user_flag, tvb, offset, 1,FALSE);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_afp_user_ID, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
bitmap = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_item(tree, hf_afp_user_bitmap, tvb, offset, 2,FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_user_bitmap);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_user_bitmap_UID, tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_user_bitmap_GID, tvb, offset, 2,FALSE);
|
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------- */
|
|
|
|
static gint
|
|
|
|
dissect_reply_afp_get_user_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset)
|
|
|
|
{
|
|
|
|
proto_tree *sub_tree = NULL;
|
|
|
|
proto_item *item;
|
|
|
|
guint16 bitmap;
|
|
|
|
|
|
|
|
bitmap = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (tree) {
|
|
|
|
item = proto_tree_add_item(tree, hf_afp_user_bitmap, tvb, offset, 2,FALSE);
|
|
|
|
sub_tree = proto_item_add_subtree(item, ett_afp_user_bitmap);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_user_bitmap_UID, tvb, offset, 2,FALSE);
|
|
|
|
proto_tree_add_item(sub_tree, hf_afp_user_bitmap_GID, tvb, offset, 2,FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
offset += 2;
|
|
|
|
if ((bitmap & 1)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_user_ID, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((bitmap & 2)) {
|
|
|
|
proto_tree_add_item(tree, hf_afp_group_ID, tvb, offset, 4,FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* ************************** */
|
|
|
|
static void
|
2002-04-25 23:58:02 +00:00
|
|
|
dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
struct aspinfo *aspinfo = pinfo->private_data;
|
|
|
|
proto_tree *afp_tree = NULL;
|
|
|
|
proto_item *ti;
|
|
|
|
conversation_t *conversation;
|
|
|
|
gint offset = 0;
|
|
|
|
afp_request_key request_key, *new_request_key;
|
|
|
|
afp_request_val *request_val;
|
2002-04-28 19:21:39 +00:00
|
|
|
guint8 afp_command;
|
2002-04-30 22:05:33 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
int len = tvb_reported_length_remaining(tvb,0);
|
|
|
|
|
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AFP");
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
|
|
|
|
conversation = find_conversation(&pinfo->src, &pinfo->dst, pinfo->ptype,
|
|
|
|
pinfo->srcport, pinfo->destport, 0);
|
|
|
|
|
|
|
|
if (conversation == NULL)
|
|
|
|
{
|
|
|
|
conversation = conversation_new(&pinfo->src, &pinfo->dst,
|
|
|
|
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
request_key.conversation = conversation->index;
|
|
|
|
request_key.seq = aspinfo->seq;
|
|
|
|
|
|
|
|
request_val = (afp_request_val *) g_hash_table_lookup(
|
|
|
|
afp_request_hash, &request_key);
|
|
|
|
|
|
|
|
if (!request_val && !aspinfo->reply) {
|
|
|
|
afp_command = tvb_get_guint8(tvb, offset);
|
|
|
|
new_request_key = g_mem_chunk_alloc(afp_request_keys);
|
|
|
|
*new_request_key = request_key;
|
|
|
|
|
|
|
|
request_val = g_mem_chunk_alloc(afp_request_vals);
|
|
|
|
request_val->command = tvb_get_guint8(tvb, offset);
|
|
|
|
|
|
|
|
g_hash_table_insert(afp_request_hash, new_request_key,
|
|
|
|
request_val);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!request_val) { /* missing request */
|
2002-05-03 21:25:43 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "[Reply without query?]");
|
2002-04-25 23:58:02 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
afp_command = request_val->command;
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
2002-04-28 22:16:50 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
|
2002-04-28 21:53:31 +00:00
|
|
|
val_to_str(afp_command, CommandCode_vals,
|
2002-04-28 23:47:44 +00:00
|
|
|
"Unknown command (%u)"),
|
2002-04-28 22:16:50 +00:00
|
|
|
aspinfo->reply ? "reply" : "request");
|
2002-06-20 00:44:33 +00:00
|
|
|
if (aspinfo->reply && aspinfo->code != 0) {
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ": %s (%d)",
|
|
|
|
val_to_str(aspinfo->code, asp_error_vals,
|
|
|
|
"Unknown error (%u)"), aspinfo->code);
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tree)
|
|
|
|
{
|
|
|
|
ti = proto_tree_add_item(tree, proto_afp, tvb, offset, -1,FALSE);
|
|
|
|
afp_tree = proto_item_add_subtree(ti, ett_afp);
|
|
|
|
}
|
|
|
|
if (!aspinfo->reply) {
|
|
|
|
proto_tree_add_uint(afp_tree, hf_afp_command, tvb,offset, 1, afp_command);
|
|
|
|
offset++;
|
|
|
|
switch(afp_command) {
|
|
|
|
case AFP_BYTELOCK:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_byte_lock(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
case AFP_BYTELOCK_EXT:
|
|
|
|
offset = dissect_query_afp_byte_lock_ext(tvb, pinfo, afp_tree, offset);break;
|
2002-04-28 19:21:39 +00:00
|
|
|
case AFP_OPENDT: /* same as close vol */
|
|
|
|
case AFP_FLUSH:
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_CLOSEVOL:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_with_vol_id(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_CLOSEDIR:
|
2002-04-28 19:21:39 +00:00
|
|
|
/* offset = dissect_query_afp_close_dir(tvb, pinfo, afp_tree, offset);break; */
|
|
|
|
break;
|
|
|
|
case AFP_CLOSEDT:
|
|
|
|
offset = dissect_query_afp_close_dt(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_FLUSHFORK: /* same packet as closefork */
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_CLOSEFORK:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_with_fork(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_COPYFILE:
|
2002-05-03 21:25:43 +00:00
|
|
|
offset = dissect_query_afp_copy_file(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_CREATEFILE:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_create_file(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
case AFP_DISCTOLDSESS:
|
|
|
|
offset = dissect_query_afp_disconnect_old_session(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_ENUMERATE_EXT:
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_ENUMERATE:
|
|
|
|
offset = dissect_query_afp_enumerate(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_GETFORKPARAM:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_get_fork_param(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
case AFP_GETSESSTOKEN:
|
|
|
|
offset = dissect_query_afp_get_session_token(tvb, pinfo, afp_tree, offset);break;
|
2002-07-29 06:35:12 +00:00
|
|
|
case AFP_GETUSERINFO:
|
|
|
|
offset = dissect_query_afp_get_user_info(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_GETSRVINFO:
|
2002-04-28 19:21:39 +00:00
|
|
|
/* offset = dissect_query_afp_get_server_info(tvb, pinfo, afp_tree, offset);break; */
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_GETSRVPARAM:
|
2002-04-28 19:21:39 +00:00
|
|
|
break; /* no parameters */
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_GETVOLPARAM:
|
|
|
|
offset = dissect_query_afp_get_vol_param(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_LOGIN:
|
|
|
|
offset = dissect_query_afp_login(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_LOGINCONT:
|
|
|
|
case AFP_LOGOUT:
|
2002-06-20 00:44:33 +00:00
|
|
|
break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_MAPID:
|
2002-06-20 00:44:33 +00:00
|
|
|
offset = dissect_query_afp_map_id(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_MAPNAME:
|
2002-06-20 00:44:33 +00:00
|
|
|
offset = dissect_query_afp_map_name(tvb, pinfo, afp_tree, offset);break;
|
2002-04-28 19:21:39 +00:00
|
|
|
case AFP_MOVE:
|
|
|
|
offset = dissect_query_afp_move(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_OPENVOL:
|
|
|
|
offset = dissect_query_afp_open_vol(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_OPENDIR:
|
|
|
|
break;
|
|
|
|
case AFP_OPENFORK:
|
|
|
|
offset = dissect_query_afp_open_fork(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_READ:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_read(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
case AFP_READ_EXT:
|
|
|
|
offset = dissect_query_afp_read_ext(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_RENAME:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_rename(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_SETDIRPARAM:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_set_dir_param(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_SETFILEPARAM:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_set_file_param(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_SETFORKPARAM:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_set_fork_param(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_SETVOLPARAM:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_set_vol_param(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_WRITE:
|
|
|
|
offset = dissect_query_afp_write(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
case AFP_WRITE_EXT:
|
|
|
|
offset = dissect_query_afp_write_ext(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_GETFLDRPARAM:
|
|
|
|
offset = dissect_query_afp_get_fldr_param(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_SETFLDRPARAM:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_set_fldr_param(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_CHANGEPW:
|
|
|
|
case AFP_GETSRVRMSG:
|
2002-04-28 19:21:39 +00:00
|
|
|
break;
|
|
|
|
case AFP_DELETE: /* same as create_id */
|
|
|
|
case AFP_CREATEDIR:
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_CREATEID:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_create_id(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_DELETEID:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_delete_id(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_RESOLVEID:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_resolve_id(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_EXCHANGEFILE:
|
2002-05-11 22:40:40 +00:00
|
|
|
offset = dissect_query_afp_exchange_file(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
case AFP_CATSEARCH_EXT:
|
2002-04-30 22:05:33 +00:00
|
|
|
case AFP_CATSEARCH:
|
|
|
|
offset = dissect_query_afp_cat_search(tvb, pinfo, afp_tree, offset);break;
|
2002-05-03 21:25:43 +00:00
|
|
|
case AFP_GETICON:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_get_icon(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_GTICNINFO:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_get_icon_info(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_ADDAPPL:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_add_appl(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_RMVAPPL:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_rmv_appl(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_GETAPPL:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_get_appl(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_ADDCMT:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_add_cmt(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_RMVCMT: /* same as get_cmt */
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_GETCMT:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_get_cmt(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_ADDICON:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset = dissect_query_afp_add_icon(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2002-04-28 21:53:31 +00:00
|
|
|
proto_tree_add_uint(afp_tree, hf_afp_command, tvb, 0, 0, afp_command);
|
2002-04-30 22:05:33 +00:00
|
|
|
if (!len) {
|
|
|
|
/* for some calls if the reply is an error there's no data
|
|
|
|
*/
|
|
|
|
return;
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
switch(afp_command) {
|
2002-04-28 19:21:39 +00:00
|
|
|
case AFP_BYTELOCK:
|
|
|
|
offset = dissect_reply_afp_byte_lock(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
case AFP_BYTELOCK_EXT:
|
|
|
|
offset = dissect_reply_afp_byte_lock_ext(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_ENUMERATE_EXT:
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_ENUMERATE:
|
|
|
|
offset = dissect_reply_afp_enumerate(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_OPENVOL:
|
|
|
|
offset = dissect_reply_afp_open_vol(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_OPENFORK:
|
|
|
|
offset = dissect_reply_afp_open_fork(tvb, pinfo, afp_tree, offset);break;
|
2002-04-28 19:21:39 +00:00
|
|
|
case AFP_RESOLVEID:
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_GETFORKPARAM:
|
2002-04-28 19:21:39 +00:00
|
|
|
offset =dissect_reply_afp_get_fork_param(tvb, pinfo, afp_tree, offset);break;
|
2002-07-29 06:35:12 +00:00
|
|
|
case AFP_GETUSERINFO:
|
|
|
|
offset = dissect_reply_afp_get_user_info(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_GETSRVPARAM:
|
2002-04-30 22:05:33 +00:00
|
|
|
offset = dissect_reply_afp_get_server_param(tvb, pinfo, afp_tree, offset);break;
|
2002-04-28 19:21:39 +00:00
|
|
|
case AFP_CREATEDIR:
|
|
|
|
offset = dissect_reply_afp_create_dir(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
case AFP_MAPID:
|
|
|
|
offset = dissect_reply_afp_map_id(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_MAPNAME:
|
|
|
|
offset = dissect_reply_afp_map_name(tvb, pinfo, afp_tree, offset);break;
|
2002-04-28 19:21:39 +00:00
|
|
|
case AFP_MOVE: /* same as create_id */
|
|
|
|
case AFP_CREATEID:
|
|
|
|
offset = dissect_reply_afp_create_id(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
case AFP_GETSESSTOKEN:
|
|
|
|
offset = dissect_reply_afp_get_session_token(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
case AFP_GETVOLPARAM:
|
|
|
|
offset = dissect_reply_afp_get_vol_param(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_GETFLDRPARAM:
|
|
|
|
offset = dissect_reply_afp_get_fldr_param(tvb, pinfo, afp_tree, offset);break;
|
2002-04-28 19:21:39 +00:00
|
|
|
case AFP_OPENDT:
|
|
|
|
offset = dissect_reply_afp_open_dt(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
|
|
|
|
case AFP_CATSEARCH_EXT:
|
2002-04-30 22:05:33 +00:00
|
|
|
case AFP_CATSEARCH:
|
|
|
|
offset = dissect_reply_afp_cat_search(tvb, pinfo, afp_tree, offset);break;
|
2002-04-28 19:21:39 +00:00
|
|
|
case AFP_GTICNINFO:
|
|
|
|
offset = dissect_reply_afp_get_icon_info(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_GETAPPL:
|
|
|
|
offset = dissect_reply_afp_get_appl(tvb, pinfo, afp_tree, offset);break;
|
|
|
|
case AFP_GETCMT:
|
|
|
|
offset = dissect_reply_afp_get_cmt(tvb, pinfo, afp_tree, offset);break;
|
2002-04-28 19:33:32 +00:00
|
|
|
case AFP_WRITE:
|
|
|
|
offset = dissect_reply_afp_write(tvb, pinfo, afp_tree, offset);break;
|
2002-06-20 00:44:33 +00:00
|
|
|
case AFP_WRITE_EXT:
|
|
|
|
offset = dissect_reply_afp_write_ext(tvb, pinfo, afp_tree, offset);break;
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
}
|
2002-05-30 05:26:05 +00:00
|
|
|
if (tree && offset < len) {
|
|
|
|
call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1),
|
|
|
|
pinfo, afp_tree);
|
|
|
|
}
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void afp_reinit( void)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (afp_request_hash)
|
|
|
|
g_hash_table_destroy(afp_request_hash);
|
|
|
|
if (afp_request_keys)
|
|
|
|
g_mem_chunk_destroy(afp_request_keys);
|
|
|
|
if (afp_request_vals)
|
|
|
|
g_mem_chunk_destroy(afp_request_vals);
|
|
|
|
|
|
|
|
afp_request_hash = g_hash_table_new(afp_hash, afp_equal);
|
|
|
|
|
|
|
|
afp_request_keys = g_mem_chunk_new("afp_request_keys",
|
|
|
|
sizeof(afp_request_key),
|
|
|
|
afp_packet_init_count * sizeof(afp_request_key),
|
|
|
|
G_ALLOC_AND_FREE);
|
|
|
|
afp_request_vals = g_mem_chunk_new("afp_request_vals",
|
|
|
|
sizeof(afp_request_val),
|
|
|
|
afp_packet_init_count * sizeof(afp_request_val),
|
|
|
|
G_ALLOC_AND_FREE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_afp(void)
|
|
|
|
{
|
|
|
|
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_afp_command,
|
|
|
|
{ "Command", "afp.command",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(CommandCode_vals), 0x0,
|
|
|
|
"AFP function", HFILL }},
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_pad,
|
|
|
|
{ "Pad", "afp.pad",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Pad Byte", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_AFPVersion,
|
|
|
|
{ "AFP Version", "afp.AFPVersion",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Client AFP version", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_UAM,
|
|
|
|
{ "UAM", "afp.UAM",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"User Authentication Method", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_user,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "User", "afp.user",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"User", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_passwd,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Password", "afp.passwd",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_STRINGZ, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Password", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_vol_bitmap,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Bitmap", "afp.vol_bitmap",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0 /* 0x0FFF*/,
|
|
|
|
"Volume bitmap", HFILL }},
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_vol_bitmap_Attributes,
|
|
|
|
{ "Attributes", "afp.vol_bitmap.attributes",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolAttributeBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Volume attributes", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_vol_attribute,
|
2002-04-28 21:22:20 +00:00
|
|
|
{ "Attributes", "afp.vol_attributes",
|
2002-04-28 21:04:04 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0,
|
|
|
|
"Volume attributes", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_vol_attribute_ReadOnly,
|
|
|
|
{ "Read only", "afp.vol_attribute.read_only",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kReadOnly,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Read only volume", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_vol_attribute_HasVolumePassword,
|
|
|
|
{ "Volume password", "afp.vol_attribute.passwd",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kHasVolumePassword,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Has a volume password", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_vol_attribute_SupportsFileIDs,
|
|
|
|
{ "File IDs", "afp.vol_attribute.fileIDs",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kSupportsFileIDs,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Supports file IDs", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_vol_attribute_SupportsCatSearch,
|
|
|
|
{ "Catalog search", "afp.vol_attribute.cat_search",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kSupportsCatSearch,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Supports catalog search operations", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_vol_attribute_SupportsBlankAccessPrivs,
|
|
|
|
{ "Blank access privileges", "afp.vol_attribute.blank_access_privs",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kSupportsBlankAccessPrivs,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Supports blank access privileges", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_vol_attribute_SupportsUnixPrivs,
|
|
|
|
{ "UNIX access privileges", "afp.vol_attribute.unix_privs",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kSupportsUnixPrivs,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Supports UNIX access privileges", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_vol_attribute_SupportsUTF8Names,
|
|
|
|
{ "UTF-8 names", "afp.vol_attribute.utf8_names",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kSupportsUTF8Names,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Supports UTF-8 names", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_vol_bitmap_Signature,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Signature", "afp.vol_bitmap.signature",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolSignatureBit,
|
|
|
|
"Volume signature", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bitmap_CreateDate,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Creation date", "afp.vol_bitmap.create_date",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolCreateDateBit,
|
|
|
|
"Volume creation date", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bitmap_ModDate,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Modification date", "afp.vol_bitmap.mod_date",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolModDateBit,
|
|
|
|
"Volume modification date", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bitmap_BackupDate,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Backup date", "afp.vol_bitmap.backup_date",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolBackupDateBit,
|
|
|
|
"Volume backup date", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bitmap_ID,
|
|
|
|
{ "ID", "afp.vol_bitmap.id",
|
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolIDBit,
|
|
|
|
"Volume ID", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bitmap_BytesFree,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Bytes free", "afp.vol_bitmap.bytes_free",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolBytesFreeBit,
|
|
|
|
"Volume free bytes", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bitmap_BytesTotal,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Bytes total", "afp.vol_bitmap.bytes_total",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolBytesTotalBit,
|
|
|
|
"Volume total bytes", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bitmap_Name,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Name", "afp.vol_bitmap.name",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolNameBit,
|
|
|
|
"Volume name", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bitmap_ExtBytesFree,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Extended bytes free", "afp.vol_bitmap.ex_bytes_free",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolExtBytesFreeBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Volume extended (>2GB) free bytes", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bitmap_ExtBytesTotal,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Extended bytes total", "afp.vol_bitmap.ex_bytes_total",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolExtBytesTotalBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Volume extended (>2GB) total bytes", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bitmap_BlockSize,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Block size", "afp.vol_bitmap.block_size",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPVolBlockSizeBit,
|
|
|
|
"Volume block size", HFILL }},
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_dir_bitmap_Attributes,
|
|
|
|
{ "Attributes", "afp.dir_bitmap.attributes",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPAttributeBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return attributes if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_ParentDirID,
|
|
|
|
{ "DID", "afp.dir_bitmap.did",
|
|
|
|
FT_BOOLEAN, 16, NULL, kFPParentDirIDBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return parent directory ID if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_CreateDate,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Creation date", "afp.dir_bitmap.create_date",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPCreateDateBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return creation date if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_ModDate,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Modification date", "afp.dir_bitmap.mod_date",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPModDateBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return modification date if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_BackupDate,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Backup date", "afp.dir_bitmap.backup_date",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPBackupDateBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return backup date if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_FinderInfo,
|
|
|
|
{ "Finder info", "afp.dir_bitmap.finder_info",
|
|
|
|
FT_BOOLEAN, 16, NULL, kFPFinderInfoBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return finder info if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_LongName,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Long name", "afp.dir_bitmap.long_name",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPLongNameBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return long name if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_ShortName,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Short name", "afp.dir_bitmap.short_name",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPShortNameBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return short name if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_NodeID,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "File ID", "afp.dir_bitmap.fid",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPNodeIDBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return file ID if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_OffspringCount,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Offspring count", "afp.dir_bitmap.offspring_count",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPOffspringCountBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return offspring count if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_OwnerID,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Owner id", "afp.dir_bitmap.owner_id",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPOwnerIDBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return owner id if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_GroupID,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Group id", "afp.dir_bitmap.group_id",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPGroupIDBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return group id if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_AccessRights,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Access rights", "afp.dir_bitmap.access_rights",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPAccessRightsBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return access rights if directory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_UTF8Name,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "UTF-8 name", "afp.dir_bitmap.UTF8_name",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPUTF8NameBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return UTF-8 name if diectory", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_dir_bitmap_UnixPrivs,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "UNIX privileges", "afp.dir_bitmap.unix_privs",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPUnixPrivsBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return UNIX privileges if directory", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_attribute_Invisible,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Invisible", "afp.dir_attribute.invisible",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPInvisibleBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory is not visible", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_attribute_IsExpFolder,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Share point", "afp.dir_attribute.share",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPMultiUserBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory is a share point", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_attribute_System,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "System", "afp.dir_attribute.system",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPSystemBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory is a system directory", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_attribute_Mounted,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Mounted", "afp.dir_attribute.mounted",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPDAlreadyOpenBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory is mounted", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_attribute_InExpFolder,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Shared area", "afp.dir_attribute.in_exported_folder",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPRAlreadyOpenBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory is in a shared area", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_attribute_BackUpNeeded,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Backup needed", "afp.dir_attribute.backup_needed",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPBackUpNeededBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory needs to be backed up", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_attribute_RenameInhibit,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Rename inhibit", "afp.dir_attribute.rename_inhibit",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPRenameInhibitBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Rename inhibit", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_attribute_DeleteInhibit,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Delete inhibit", "afp.dir_attribute.delete_inhibit",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPDeleteInhibitBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Delete inhibit", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_attribute_SetClear,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Set", "afp.dir_attribute.set_clear",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPSetClearBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Clear/set attribute", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_file_bitmap_Attributes,
|
|
|
|
{ "Attributes", "afp.file_bitmap.attributes",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPAttributeBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return attributes if file", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_bitmap_ParentDirID,
|
|
|
|
{ "DID", "afp.file_bitmap.did",
|
|
|
|
FT_BOOLEAN, 16, NULL, kFPParentDirIDBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return parent directory ID if file", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_bitmap_CreateDate,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Creation date", "afp.file_bitmap.create_date",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPCreateDateBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return creation date if file", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_bitmap_ModDate,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Modification date", "afp.file_bitmap.mod_date",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPModDateBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return modification date if file", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_bitmap_BackupDate,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Backup date", "afp.file_bitmap.backup_date",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPBackupDateBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return backup date if file", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_bitmap_FinderInfo,
|
|
|
|
{ "Finder info", "afp.file_bitmap.finder_info",
|
|
|
|
FT_BOOLEAN, 16, NULL, kFPFinderInfoBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return finder info if file", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_bitmap_LongName,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Long name", "afp.file_bitmap.long_name",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPLongNameBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return long name if file", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_bitmap_ShortName,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Short name", "afp.file_bitmap.short_name",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPShortNameBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return short name if file", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_bitmap_NodeID,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "File ID", "afp.file_bitmap.fid",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPNodeIDBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return file ID if file", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_file_bitmap_DataForkLen,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Data fork size", "afp.file_bitmap.data_fork_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPDataForkLenBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return data fork size if file", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_bitmap_RsrcForkLen,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Resource fork size", "afp.file_bitmap.resource_fork_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPRsrcForkLenBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return resource fork size if file", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_bitmap_ExtDataForkLen,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Extended data fork size", "afp.file_bitmap.ex_data_fork_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPExtDataForkLenBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return extended (>2GB) data fork size if file", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_bitmap_LaunchLimit,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Launch limit", "afp.file_bitmap.launch_limit",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPLaunchLimitBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return launch limit if file", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_bitmap_UTF8Name,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "UTF-8 name", "afp.file_bitmap.UTF8_name",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPUTF8NameBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return UTF-8 name if file", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_bitmap_ExtRsrcForkLen,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Extended resource fork size", "afp.file_bitmap.ex_resource_fork_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPExtRsrcForkLenBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return extended (>2GB) resource fork size if file", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_bitmap_UnixPrivs,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "UNIX privileges", "afp.file_bitmap.unix_privs",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPUnixPrivsBit_file,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Return UNIX privileges if file", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
/* ---------- */
|
|
|
|
{ &hf_afp_file_attribute_Invisible,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Invisible", "afp.file_attribute.invisible",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPInvisibleBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"File is not visible", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_attribute_MultiUser,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Multi user", "afp.file_attribute.multi_user",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPMultiUserBit,
|
|
|
|
"multi user", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_attribute_System,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "System", "afp.file_attribute.system",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPSystemBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"File is a system file", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_attribute_DAlreadyOpen,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Data fork open", "afp.file_attribute.df_open",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPDAlreadyOpenBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Data fork already open", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_attribute_RAlreadyOpen,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Resource fork open", "afp.file_attribute.rf_open",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPRAlreadyOpenBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Resource fork already open", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_attribute_WriteInhibit,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Write inhibit", "afp.file_attribute.write_inhibit",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPWriteInhibitBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Write inhibit", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_attribute_BackUpNeeded,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Backup needed", "afp.file_attribute.backup_needed",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPBackUpNeededBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"File needs to be backed up", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_attribute_RenameInhibit,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Rename inhibit", "afp.file_attribute.rename_inhibit",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPRenameInhibitBit,
|
|
|
|
"rename inhibit", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_attribute_DeleteInhibit,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Delete inhibit", "afp.file_attribute.delete_inhibit",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPDeleteInhibitBit,
|
|
|
|
"delete inhibit", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_attribute_CopyProtect,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Copy protect", "afp.file_attribute.copy_protect",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPCopyProtectBit,
|
|
|
|
"copy protect", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_attribute_SetClear,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Set", "afp.file_attribute.set_clear",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 16, NULL, kFPSetClearBit,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Clear/set attribute", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
/* ---------- */
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_name,
|
|
|
|
{ "Volume", "afp.vol_name",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Volume name", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-05-03 21:25:43 +00:00
|
|
|
{ &hf_afp_vol_flag_passwd,
|
|
|
|
{ "Password", "afp.vol_flag_passwd",
|
|
|
|
FT_BOOLEAN, 8, NULL, 1,
|
|
|
|
"Volume is password-protected", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_vol_flag_unix_priv,
|
|
|
|
{ "Unix privs", "afp.vol_flag_unix_priv",
|
|
|
|
FT_BOOLEAN, 8, NULL, 2,
|
|
|
|
"Volume has unix privileges", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_id,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Volume id", "afp.vol_id",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Volume id", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_signature,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Signature", "afp.vol_signature",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_DEC, VALS(vol_signature_vals), 0x0,
|
|
|
|
"Volume signature", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
{ &hf_afp_vol_name_offset,
|
|
|
|
{ "Volume name offset","afp.vol_name_offset",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
"Volume name offset in packet", HFILL }},
|
2002-04-28 21:04:04 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_creation_date,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Creation date", "afp.vol_creation_date",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Volume creation date", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_modification_date,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Modification date", "afp.vol_modification_date",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Volume modification date", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_backup_date,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Backup date", "afp.vol_backup_date",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Volume backup date", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bytes_free,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Bytes free", "afp.vol_bytes_free",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Free space", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_bytes_total,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Bytes total", "afp.vol_bytes_total",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Volume size", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_ex_bytes_free,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Extended bytes free", "afp.vol_ex_bytes_free",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT64, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Extended (>2GB) free space", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_ex_bytes_total,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Extended bytes total", "afp.vol_ex_bytes_total",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT64, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Extended (>2GB) volume size", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_vol_block_size,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Block size", "afp.vol_block_size",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Volume block size", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_did,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "DID", "afp.did",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Parent directory ID", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_dir_bitmap,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Directory bitmap", "afp.dir_bitmap",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory bitmap", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_offspring,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Offspring", "afp.dir_offspring",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory offspring", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_OwnerID,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Owner ID", "afp.dir_owner_id",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory owner ID", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_GroupID,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Group ID", "afp.dir_group_id",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory group ID", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_creation_date,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Creation date", "afp.creation_date",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Creation date", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_modification_date,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Modification date", "afp.modification_date",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Modification date", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_backup_date,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Backup date", "afp.backup_date",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Backup date", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_finder_info,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Finder info", "afp.finder_info",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BYTES, BASE_HEX, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Finder info", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
{ &hf_afp_long_name_offset,
|
|
|
|
{ "Long name offset", "afp.long_name_offset",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Long name offset in packet", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_short_name_offset,
|
|
|
|
{ "Short name offset", "afp.short_name_offset",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Short name offset in packet", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_unicode_name_offset,
|
|
|
|
{ "Unicode name offset", "afp.unicode_name_offset",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Unicode name offset in packet", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_unix_privs_uid,
|
|
|
|
{ "UID", "afp.unix_privs.uid",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"User ID", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_unix_privs_gid,
|
|
|
|
{ "GID", "afp.unix_privs.gid",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Group ID", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_unix_privs_permissions,
|
|
|
|
{ "Permissions", "afp.unix_privs.permissions",
|
|
|
|
FT_UINT32, BASE_OCT, NULL, 0x0,
|
|
|
|
"Permissions", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_unix_privs_ua_permissions,
|
|
|
|
{ "User's access rights", "afp.unix_privs.ua_permissions",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
"User's access rights", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_file_id,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "File ID", "afp.file_id",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"File/directory ID", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_DataForkLen,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Data fork size", "afp.data_fork_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Data fork size", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_RsrcForkLen,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Resource fork size", "afp.resource_fork_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Resource fork size", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_ExtDataForkLen,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Extended data fork size", "afp.ext_data_fork_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT64, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Extended (>2GB) data fork length", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_file_ExtRsrcForkLen,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Extended resource fork size", "afp.ext_resource_fork_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT64, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Extended (>2GB) resource fork length", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_file_bitmap,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "File bitmap", "afp.file_bitmap",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"File bitmap", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_req_count,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Req count", "afp.req_count",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Maximum number of structures returned", HFILL }},
|
|
|
|
|
2002-04-28 21:04:04 +00:00
|
|
|
{ &hf_afp_start_index,
|
|
|
|
{ "Start index", "afp.start_index",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"First structure returned", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_max_reply_size,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Reply size", "afp.reply_size",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"First structure returned", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_file_flag,
|
2002-05-03 21:25:43 +00:00
|
|
|
{ "Dir", "afp.file_flag",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 0x80,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Is a dir", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_create_flag,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Hard create", "afp.create_flag",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 0x80,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Soft/hard create file", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_struct_size,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Struct size", "afp.struct_size",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT8, BASE_DEC, NULL,0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Sizeof of struct", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_flag,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "From", "afp.flag",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT8, BASE_HEX, VALS(flag_vals), 0x80,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Offset is relative to start/end of the fork", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dt_ref,
|
|
|
|
{ "DT ref", "afp.dt_ref",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Desktop database reference num", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_ofork,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Fork", "afp.ofork",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Open fork reference number", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_offset,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Offset", "afp.offset",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Offset", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_rw_count,
|
2002-04-28 19:33:32 +00:00
|
|
|
{ "Count", "afp.rw_count",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 19:33:32 +00:00
|
|
|
"Number of bytes to be read/written", HFILL }},
|
|
|
|
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
{ &hf_afp_newline_mask,
|
|
|
|
{ "Newline mask", "afp.newline_mask",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
"Value to AND bytes with when looking for newline", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_newline_char,
|
|
|
|
{ "Newline char", "afp.newline_char",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
"Value to compare ANDed bytes with when looking for newline", HFILL }},
|
|
|
|
|
2002-04-28 19:33:32 +00:00
|
|
|
{ &hf_afp_last_written,
|
|
|
|
{ "Last written", "afp.last_written",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Offset of the last byte written", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_actual_count,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Count", "afp.actual_count",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Number of bytes returned by read/write", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_ofork_len,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "New length", "afp.ofork_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"New length", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_path_type,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Type", "afp.path_type",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT8, BASE_HEX, VALS(path_type_vals), 0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Type of names", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_path_len,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Len", "afp.path_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Path length", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_path_name,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Name", "afp.path_name",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Path name", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_fork_type,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Resource fork", "afp.fork_type",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 0x80,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Data/resource fork", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
|
|
|
{ &hf_afp_access_mode,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Access mode", "afp.access",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Fork access mode", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_access_read,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Read", "afp.access.read",
|
2002-04-25 23:58:02 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 1,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Open for reading", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_access_write,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Write", "afp.access.write",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 2,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Open for writing", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_access_deny_read,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Deny read", "afp.access.deny_read",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 0x10,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Deny read", HFILL }},
|
|
|
|
|
2002-04-25 23:58:02 +00:00
|
|
|
{ &hf_afp_access_deny_write,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Deny write", "afp.access.deny_write",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 0x20,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Deny write", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_comment,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Comment", "afp.comment",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"File/folder comment", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_file_creator,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "File creator", "afp.file_creator",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"File creator", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_file_type,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "File type", "afp.file_type",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"File type", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_icon_type,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Icon type", "afp.icon_type",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT8, BASE_HEX, NULL , 0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Icon type", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_icon_length,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Size", "afp.icon_length",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Size for icon bitmap", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_icon_index,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Index", "afp.icon_index",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Icon index in desktop database", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_icon_tag,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Tag", "afp.icon_tag",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Icon tag", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_appl_index,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Index", "afp.appl_index",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Application index", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_appl_tag,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Tag", "afp.appl_tag",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Application tag", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_lock_op,
|
|
|
|
{ "unlock", "afp.lock_op",
|
|
|
|
FT_BOOLEAN, 8, NULL, 0x1,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Lock/unlock op", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_lock_from,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "End", "afp.lock_from",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, 0x80,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Offset is relative to the end of the fork", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_lock_offset,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Offset", "afp.lock_offset",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"First byte to be locked", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_lock_len,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Length", "afp.lock_len",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Number of bytes to be locked/unlocked", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_lock_range_start,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Start", "afp.lock_range_start",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"First byte locked/unlocked", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_dir_ar,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Access rights", "afp.dir_ar",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Directory access rights", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_dir_ar_o_search,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Owner has search access", "afp.dir_ar.o_search",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_O_SEARCH,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Owner has search access", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_ar_o_read,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Owner has read access", "afp.dir_ar.o_read",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_O_READ,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Owner has read access", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_ar_o_write,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Owner has write access", "afp.dir_ar.o_write",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_O_WRITE,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Gwner has write access", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_dir_ar_g_search,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Group has search access", "afp.dir_ar.g_search",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_G_SEARCH,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Group has search access", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_ar_g_read,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Group has read access", "afp.dir_ar.g_read",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_G_READ,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Group has read access", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_ar_g_write,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Group has write access", "afp.dir_ar.g_write",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_G_WRITE,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Group has write access", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_dir_ar_e_search,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Everyone has search access", "afp.dir_ar.e_search",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_E_SEARCH,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Everyone has search access", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_ar_e_read,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Everyone has read access", "afp.dir_ar.e_read",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_E_READ,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Everyone has read access", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_ar_e_write,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Everyone has write access", "afp.dir_ar.e_write",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_E_WRITE,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Everyone has write access", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_dir_ar_u_search,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "User has search access", "afp.dir_ar.u_search",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_U_SEARCH,
|
2002-04-28 21:04:04 +00:00
|
|
|
"User has search access", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_ar_u_read,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "User has read access", "afp.dir_ar.u_read",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_U_READ,
|
2002-04-28 21:04:04 +00:00
|
|
|
"User has read access", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_ar_u_write,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "User has write access", "afp.dir_ar.u_write",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_U_WRITE,
|
2002-04-28 21:04:04 +00:00
|
|
|
"User has write access", HFILL }},
|
2002-04-28 19:21:39 +00:00
|
|
|
|
|
|
|
{ &hf_afp_dir_ar_blank,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "Blank access right", "afp.dir_ar.blank",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_BLANK,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Blank access right", HFILL }},
|
|
|
|
|
2002-04-28 19:21:39 +00:00
|
|
|
{ &hf_afp_dir_ar_u_own,
|
2002-04-28 21:04:04 +00:00
|
|
|
{ "User is the owner", "afp.dir_ar.u_owner",
|
2002-04-28 19:21:39 +00:00
|
|
|
FT_BOOLEAN, 32, NULL, AR_U_OWN,
|
2002-04-28 21:04:04 +00:00
|
|
|
"Current user is the directory owner", HFILL }},
|
2002-04-30 22:05:33 +00:00
|
|
|
|
|
|
|
{ &hf_afp_server_time,
|
|
|
|
{ "Server time", "afp.server_time",
|
|
|
|
FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x0,
|
|
|
|
"Server time", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_cat_req_matches,
|
|
|
|
{ "Max answers", "afp.cat_req_matches",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Maximum number of matches to return.", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_reserved,
|
|
|
|
{ "Reserved", "afp.reserved",
|
|
|
|
FT_BYTES, BASE_HEX, NULL, 0x0,
|
|
|
|
"Reserved", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_cat_count,
|
|
|
|
{ "Cat count", "afp.cat_count",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of structures returned", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_cat_position,
|
|
|
|
{ "Position", "afp.cat_position",
|
|
|
|
FT_BYTES, BASE_HEX, NULL, 0x0,
|
|
|
|
"Reserved", HFILL }},
|
|
|
|
|
2002-06-20 00:44:33 +00:00
|
|
|
|
|
|
|
{ &hf_afp_map_name_type,
|
|
|
|
{ "Type", "afp.map_name_type",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(map_name_type_vals), 0x0,
|
|
|
|
"Map name type", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_map_id_type,
|
|
|
|
{ "Type", "afp.map_id_type",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(map_id_type_vals), 0x0,
|
|
|
|
"Map ID type", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_map_id,
|
|
|
|
{ "ID", "afp.map_id",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"User/Group ID", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_map_name,
|
|
|
|
{ "Name", "afp.map_name",
|
|
|
|
FT_UINT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"User/Group name", HFILL }},
|
|
|
|
|
|
|
|
/* AFP 3.0 */
|
|
|
|
{ &hf_afp_lock_offset64,
|
|
|
|
{ "Offset", "afp.lock_offset64",
|
|
|
|
FT_INT64, BASE_DEC, NULL, 0x0,
|
|
|
|
"First byte to be locked (64 bits)", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_lock_len64,
|
|
|
|
{ "Length", "afp.lock_len64",
|
|
|
|
FT_INT64, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of bytes to be locked/unlocked (64 bits)", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_lock_range_start64,
|
|
|
|
{ "Start", "afp.lock_range_start64",
|
|
|
|
FT_INT64, BASE_DEC, NULL, 0x0,
|
|
|
|
"First byte locked/unlocked (64 bits)", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_offset64,
|
|
|
|
{ "Offset", "afp.offset64",
|
|
|
|
FT_INT64, BASE_DEC, NULL, 0x0,
|
|
|
|
"Offset (64 bits)", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_rw_count64,
|
|
|
|
{ "Count", "afp.rw_count64",
|
|
|
|
FT_INT64, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of bytes to be read/written (64 bits)", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_last_written64,
|
|
|
|
{ "Last written", "afp.last_written64",
|
|
|
|
FT_UINT64, BASE_DEC, NULL, 0x0,
|
|
|
|
"Offset of the last byte written (64 bits)", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_session_token_type,
|
|
|
|
{ "Type", "afp.session_token_type",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
"Session token type", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_session_token_len,
|
|
|
|
{ "Len", "afp.session_token_len",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Session token length", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_session_token,
|
|
|
|
{ "Token", "afp.session_token",
|
|
|
|
FT_BYTES, BASE_HEX, NULL, 0x0,
|
|
|
|
"Session token", HFILL }},
|
|
|
|
|
2002-07-29 06:35:12 +00:00
|
|
|
{ &hf_afp_user_flag,
|
|
|
|
{ "Flag", "afp.user_flag",
|
|
|
|
FT_UINT8, BASE_HEX, VALS(user_flag_vals), 0x01,
|
|
|
|
"User Info flag", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_user_ID,
|
|
|
|
{ "User ID", "afp.user_ID",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"User ID", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_group_ID,
|
|
|
|
{ "Group ID", "afp.group_ID",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Group ID", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_user_bitmap,
|
|
|
|
{ "Bitmap", "afp.user_bitmap",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0,
|
|
|
|
"User Info bitmap", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_user_bitmap_UID,
|
|
|
|
{ "User ID", "afp.user_bitmap.UID",
|
|
|
|
FT_BOOLEAN, 16, NULL, 0x01,
|
|
|
|
"User ID", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_afp_user_bitmap_GID,
|
|
|
|
{ "Primary group ID", "afp.user_bitmap.GID",
|
|
|
|
FT_BOOLEAN, 16, NULL, 0x02,
|
|
|
|
"Primary group ID", HFILL }},
|
2002-04-25 23:58:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
2002-04-28 21:04:04 +00:00
|
|
|
&ett_afp,
|
2002-04-30 22:05:33 +00:00
|
|
|
&ett_afp_server_vol,
|
|
|
|
&ett_afp_vol_list,
|
2002-05-03 21:25:43 +00:00
|
|
|
&ett_afp_vol_flag,
|
2002-04-25 23:58:02 +00:00
|
|
|
&ett_afp_vol_bitmap,
|
|
|
|
&ett_afp_vol_attribute,
|
|
|
|
&ett_afp_dir_bitmap,
|
|
|
|
&ett_afp_file_bitmap,
|
Have separate fields for volume, long file name, short file name, and
Unicode file name offsets.
Display the "UNIX privileges" field as a 4-longword structure, as part
of the AFP 3.0 spec claims; unfortunately, another part claims it's only
4 bytes, but, unless a "long" is 8 bits, one or the other claim must be
false.
Completely get rid of the static "afp_handle" variable - it's not
necessary.
Put the Unicode name offset into the tree, if present, in
"parse_file_bitmap()" and "parse_dir_bitmap()".
Get rid of some unused variables.
Put the newline mask and character into the tree for FPRead.
svn path=/trunk/; revision=5289
2002-04-29 09:38:34 +00:00
|
|
|
&ett_afp_unix_privs,
|
2002-04-25 23:58:02 +00:00
|
|
|
&ett_afp_enumerate,
|
|
|
|
&ett_afp_enumerate_line,
|
|
|
|
&ett_afp_access_mode,
|
2002-04-28 19:21:39 +00:00
|
|
|
&ett_afp_dir_attribute,
|
|
|
|
&ett_afp_file_attribute,
|
|
|
|
&ett_afp_path_name,
|
|
|
|
&ett_afp_lock_flags,
|
|
|
|
&ett_afp_dir_ar,
|
2002-04-30 22:05:33 +00:00
|
|
|
&ett_afp_cat_search,
|
|
|
|
&ett_afp_cat_r_bitmap,
|
|
|
|
&ett_afp_cat_spec,
|
2002-05-03 21:25:43 +00:00
|
|
|
&ett_afp_vol_did,
|
2002-07-29 06:35:12 +00:00
|
|
|
&ett_afp_user_bitmap,
|
2002-04-25 23:58:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
proto_afp = proto_register_protocol("AppleTalk Filing Protocol", "AFP", "afp");
|
|
|
|
proto_register_field_array(proto_afp, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
|
|
|
register_init_routine( &afp_reinit);
|
|
|
|
|
|
|
|
register_dissector("afp", dissect_afp, proto_afp);
|
2002-04-28 19:21:39 +00:00
|
|
|
data_handle = find_dissector("data");
|
2002-04-25 23:58:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_afp(void)
|
|
|
|
{
|
|
|
|
data_handle = find_dissector("data");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------------
|
|
|
|
end
|
|
|
|
*/
|