Don't do fcn calls in arg of g_?to??(); Macro may very well eval args multiple times.
[obnox/wireshark/wip.git] / epan / dissectors / packet-afp.h
1 /* packet-afp.h
2  * Definitions for packet disassembly structures and routines
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #ifndef PACKET_AFP_H
26 #define PACKET_AFP_H
27
28 #define AFP_OK          0
29 #define AFPERR_ACCESS   (-5000)   /* permission denied */
30 #define AFPERR_AUTHCONT (-5001)   /* logincont */
31 #define AFPERR_BADUAM   (-5002)   /* uam doesn't exist */
32 #define AFPERR_BADVERS  (-5003)   /* bad afp version number */
33 #define AFPERR_BITMAP   (-5004)   /* invalid bitmap */
34 #define AFPERR_CANTMOVE (-5005)   /* can't move file */
35 #define AFPERR_DENYCONF (-5006)   /* file synchronization locks conflict */
36 #define AFPERR_DIRNEMPT (-5007)   /* directory not empty */
37 #define AFPERR_DFULL    (-5008)   /* disk full */
38 #define AFPERR_EOF      (-5009)   /* end of file -- catsearch and afp_read */
39 #define AFPERR_BUSY     (-5010)   /* FileBusy */
40 #define AFPERR_FLATVOL  (-5011)   /* volume doesn't support directories */
41 #define AFPERR_NOITEM   (-5012)   /* ItemNotFound */
42 #define AFPERR_LOCK     (-5013)   /* LockErr */
43 #define AFPERR_MISC     (-5014)   /* misc. err */
44 #define AFPERR_NLOCK    (-5015)   /* no more locks */
45 #define AFPERR_NOSRVR   (-5016)   /* no response by server at that address */
46 #define AFPERR_EXIST    (-5017)   /* object already exists */
47 #define AFPERR_NOOBJ    (-5018)   /* object not found */
48 #define AFPERR_PARAM    (-5019)   /* parameter error */
49 #define AFPERR_NORANGE  (-5020)   /* no range lock */
50 #define AFPERR_RANGEOVR (-5021)   /* range overlap */
51 #define AFPERR_SESSCLOS (-5022)   /* session closed */
52 #define AFPERR_NOTAUTH  (-5023)   /* user not authenticated */
53 #define AFPERR_NOOP     (-5024)   /* command not supported */
54 #define AFPERR_BADTYPE  (-5025)   /* object is the wrong type */
55 #define AFPERR_NFILE    (-5026)   /* too many files open */
56 #define AFPERR_SHUTDOWN (-5027)   /* server is going down */
57 #define AFPERR_NORENAME (-5028)   /* can't rename */
58 #define AFPERR_NODIR    (-5029)   /* couldn't find directory */
59 #define AFPERR_ITYPE    (-5030)   /* wrong icon type */
60 #define AFPERR_VLOCK    (-5031)   /* volume locked */
61 #define AFPERR_OLOCK    (-5032)   /* object locked */
62 #define AFPERR_CTNSHRD  (-5033)   /* share point contains a share point */
63 #define AFPERR_NOID     (-5034)   /* file thread not found */
64 #define AFPERR_EXISTID  (-5035)   /* file already has an id */
65 #define AFPERR_DIFFVOL  (-5036)   /* different volume */
66 #define AFPERR_CATCHNG  (-5037)   /* catalog has changed */
67 #define AFPERR_SAMEOBJ  (-5038)   /* source file == destination file */
68 #define AFPERR_BADID    (-5039)   /* non-existent file id */
69 #define AFPERR_PWDSAME  (-5040)   /* same password/can't change password */
70 #define AFPERR_PWDSHORT (-5041)   /* password too short */
71 #define AFPERR_PWDEXPR  (-5042)   /* password expired */
72 #define AFPERR_INSHRD   (-5043)   /* folder being shared is inside a shared folder. may be returned by
73                                                                    afpMoveAndRename. */
74 #define AFPERR_INTRASH  (-5044)   /* shared folder in trash. */
75 #define AFPERR_PWDCHNG  (-5045)   /* password needs to be changed */
76 #define AFPERR_PWDPOLCY (-5046)   /* password fails policy check */
77 #define AFPERR_USRLOGIN (-5047)   /* user already logged on */
78                                   /* also disk quota exceeded? */
79
80 extern value_string_ext asp_error_vals_ext;
81 extern value_string_ext afp_server_addr_type_vals_ext;
82
83 /* server flags */
84 #define AFPSRVRINFO_COPY         (1<<0)  /* supports copyfile */
85 #define AFPSRVRINFO_PASSWD       (1<<1)  /* supports change password */
86 #define AFPSRVRINFO_NOSAVEPASSWD (1<<2)  /* don't allow save password */
87 #define AFPSRVRINFO_SRVMSGS      (1<<3)  /* supports server messages */
88 #define AFPSRVRINFO_SRVSIGNATURE (1<<4)  /* supports server signature */
89 #define AFPSRVRINFO_TCPIP        (1<<5)  /* supports tcpip */
90 #define AFPSRVRINFO_SRVNOTIFY    (1<<6)  /* supports server notifications */
91 #define AFPSRVRINFO_SRVRECONNECT (1<<7)  /* supports reconnect */
92 #define AFPSRVRINFO_SRVDIRECTORY (1<<8)  /* supports directory services */
93 #define AFPSRVRINFO_SRVUTF8      (1<<9)  /* supports UTF8 names AFP 3.1 */
94 #define AFPSRVRINFO_UUID         (1<<10) /* supports UUIDs AFP 3.2 */
95 #define AFPSRVRINFO_EXT_SLEEP    (1<<11) /* supports extended sleep, AFP 3.3 */
96 #define AFPSRVRINFO_FASTBOZO     (1<<15) /* fast copying */
97
98
99 #define AFPSTATUS_MACHOFF     0
100 #define AFPSTATUS_VERSOFF     2
101 #define AFPSTATUS_UAMSOFF     4
102 #define AFPSTATUS_ICONOFF     6
103 #define AFPSTATUS_FLAGOFF     8
104 #define AFPSTATUS_PRELEN     10
105 #define AFPSTATUS_POSTLEN     4
106 #define AFPSTATUS_LEN        (AFPSTATUS_PRELEN + AFPSTATUS_POSTLEN)
107
108 /*
109  * Private data passed from DSI,DDP dissectors to AFP dissector.
110  *                       DSI              DDP
111  * aspinfo.reply        dsi.flags       atp.function == 0x80
112  *         release                      atp.function == 0xc0
113  *         command          command     asp.function
114  *         seq              requestid   atp.tid
115  *         code             code
116  */
117 struct aspinfo {
118         guint8  reply;                  /* 0 query  1 reply */
119         guint8  release;
120         guint16 command;                /* 2  6 write */
121         guint16 seq;                    /* sequence number */
122         gint32  code;                   /* error code/ offset NU */
123 };
124
125 /*
126  * value_string table for AFP command codes.
127  */
128 WS_VAR_IMPORT value_string_ext CommandCode_vals_ext;
129
130 /*
131  * Value from table matching requests and responses; also passed to AFP
132  * tap for responses.
133  */
134 typedef struct {
135         guint8  command;
136         guint32 frame_req, frame_res;
137         nstime_t req_time;
138         guint32 spotlight_req_command; /* Need this in the reply */
139 } afp_request_val;
140
141 #endif