~ubuntu-branches/ubuntu/precise/netatalk/precise

« back to all changes in this revision

Viewing changes to include/atalk/afp.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Rittau
  • Date: 2004-01-19 12:43:49 UTC
  • Revision ID: james.westby@ubuntu.com-20040119124349-es563jbp0hk0ae51
Tags: upstream-1.6.4
ImportĀ upstreamĀ versionĀ 1.6.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 1990,1991 Regents of The University of Michigan.
 
3
 * All Rights Reserved.
 
4
 *
 
5
 * Permission to use, copy, modify, and distribute this software and
 
6
 * its documentation for any purpose and without fee is hereby granted,
 
7
 * provided that the above copyright notice appears in all copies and
 
8
 * that both that copyright notice and this permission notice appear
 
9
 * in supporting documentation, and that the name of The University
 
10
 * of Michigan not be used in advertising or publicity pertaining to
 
11
 * distribution of the software without specific, written prior
 
12
 * permission. This software is supplied as is without expressed or
 
13
 * implied warranties of any kind.
 
14
 *
 
15
 *      Research Systems Unix Group
 
16
 *      The University of Michigan
 
17
 *      c/o Mike Clark
 
18
 *      535 W. William Street
 
19
 *      Ann Arbor, Michigan
 
20
 *      +1-313-763-0525
 
21
 *      netatalk@itd.umich.edu
 
22
 */
 
23
 
 
24
#ifndef _ATALK_AFP_H
 
25
#define _ATALK_AFP_H 1
 
26
 
 
27
#include <sys/types.h>
 
28
#include <netatalk/endian.h>
 
29
 
 
30
typedef u_int16_t AFPUserBytes;
 
31
 
 
32
/* protocols */
 
33
#define AFPPROTO_ASP           1
 
34
#define AFPPROTO_DSI           2
 
35
 
 
36
/* actual transports. the DSI ones (tcp right now) need to be
 
37
 * kept in sync w/ <atalk/dsi.h>. 
 
38
 * convention: AFPTRANS_* = (1 << DSI_*) 
 
39
 */
 
40
#define AFPTRANS_NONE          0
 
41
#define AFPTRANS_DDP          (1 << 0)
 
42
#define AFPTRANS_TCP          (1 << 1)
 
43
#define AFPTRANS_ALL          (AFPTRANS_DDP | AFPTRANS_TCP)
 
44
 
 
45
/* server flags */
 
46
#define AFPSRVRINFO_COPY         (1<<0)  /* supports copyfile */
 
47
#define AFPSRVRINFO_PASSWD       (1<<1)  /* supports change password */
 
48
#define AFPSRVRINFO_NOSAVEPASSWD (1<<2)  /* don't allow save password */
 
49
#define AFPSRVRINFO_SRVMSGS      (1<<3)  /* supports server messages */
 
50
#define AFPSRVRINFO_SRVSIGNATURE (1<<4)  /* supports server signature */
 
51
#define AFPSRVRINFO_TCPIP        (1<<5)  /* supports tcpip */
 
52
#define AFPSRVRINFO_SRVNOTIFY    (1<<6)  /* supports server notifications */ 
 
53
 
 
54
#define AFPSRVRINFO_SRVRECONNECT (1<<7)  /* supports server reconnect */ 
 
55
#define AFPSRVRINFO_SRVRDIR      (1<<8)  /* supports directories service */ 
 
56
 
 
57
#define AFPSRVRINFO_SRVUTF8      (1<<9)  /* supports UTF8 names AFP 3.1 */ 
 
58
 
 
59
#define AFPSRVRINFO_FASTBOZO     (1<<15) /* fast copying */
 
60
 
 
61
#define AFP_OK          0
 
62
#define AFPERR_ACCESS   -5000   /* permission denied */
 
63
#define AFPERR_AUTHCONT -5001   /* logincont */
 
64
#define AFPERR_BADUAM   -5002   /* uam doesn't exist */
 
65
#define AFPERR_BADVERS  -5003   /* bad afp version number */
 
66
#define AFPERR_BITMAP   -5004   /* invalid bitmap */
 
67
#define AFPERR_CANTMOVE -5005   /* can't move file */
 
68
#define AFPERR_DENYCONF -5006   /* file synchronization locks conflict */
 
69
#define AFPERR_DIRNEMPT -5007   /* directory not empty */
 
70
#define AFPERR_DFULL    -5008   /* disk full */
 
71
#define AFPERR_EOF      -5009   /* end of file -- catsearch and afp_read */
 
72
#define AFPERR_BUSY     -5010   /* FileBusy */
 
73
#define AFPERR_FLATVOL  -5011   /* volume doesn't support directories */
 
74
#define AFPERR_NOITEM   -5012   /* ItemNotFound */
 
75
#define AFPERR_LOCK     -5013   /* LockErr */
 
76
#define AFPERR_MISC     -5014   /* misc. err */
 
77
#define AFPERR_NLOCK    -5015   /* no more locks */
 
78
#define AFPERR_NOSRVR   -5016   /* no response by server at that address */
 
79
#define AFPERR_EXIST    -5017   /* object already exists */
 
80
#define AFPERR_NOOBJ    -5018   /* object not found */
 
81
#define AFPERR_PARAM    -5019   /* parameter error */
 
82
#define AFPERR_NORANGE  -5020   /* no range lock */
 
83
#define AFPERR_RANGEOVR -5021   /* range overlap */
 
84
#define AFPERR_SESSCLOS -5022   /* session closed */
 
85
#define AFPERR_NOTAUTH  -5023   /* user not authenticated */
 
86
#define AFPERR_NOOP     -5024   /* command not supported */
 
87
#define AFPERR_BADTYPE  -5025   /* object is the wrong type */
 
88
#define AFPERR_NFILE    -5026   /* too many files open */
 
89
#define AFPERR_SHUTDOWN -5027   /* server is going down */
 
90
#define AFPERR_NORENAME -5028   /* can't rename */
 
91
#define AFPERR_NODIR    -5029   /* couldn't find directory */
 
92
#define AFPERR_ITYPE    -5030   /* wrong icon type */
 
93
#define AFPERR_VLOCK    -5031   /* volume locked */
 
94
#define AFPERR_OLOCK    -5032   /* object locked */
 
95
#define AFPERR_CTNSHRD  -5033   /* share point contains a share point */
 
96
#define AFPERR_NOID     -5034   /* file thread not found */
 
97
#define AFPERR_EXISTID  -5035   /* file already has an id */
 
98
#define AFPERR_DIFFVOL  -5036   /* different volume */
 
99
#define AFPERR_CATCHNG  -5037   /* catalog has changed */
 
100
#define AFPERR_SAMEOBJ  -5038   /* source file == destination file */
 
101
#define AFPERR_BADID    -5039   /* non-existent file id */
 
102
#define AFPERR_PWDSAME  -5040   /* same password/can't change password */
 
103
#define AFPERR_PWDSHORT -5041   /* password too short */
 
104
#define AFPERR_PWDEXPR  -5042   /* password expired */
 
105
#define AFPERR_INSHRD   -5043   /* folder being shared is inside a
 
106
                                   shared folder. may be returned by
 
107
                                   afpMoveAndRename. */
 
108
#define AFPERR_INTRASH  -5044   /* shared folder in trash. */
 
109
#define AFPERR_PWDCHNG  -5045   /* password needs to be changed */
 
110
#define AFPERR_PWDPOLCY -5046   /* password fails policy check */
 
111
#define AFPERR_USRLOGIN -5047   /* user already logged on */
 
112
 
 
113
/* AFP Attention Codes -- 4 bits */
 
114
#define AFPATTN_SHUTDOWN     (1 << 15)            /* shutdown/disconnect */
 
115
#define AFPATTN_CRASH        (1 << 14)            /* server crashed */
 
116
#define AFPATTN_MESG         (1 << 13)            /* server has message */
 
117
#define AFPATTN_NORECONNECT  (1 << 12)            /* don't reconnect */
 
118
/* server notification */
 
119
#define AFPATTN_NOTIFY       (AFPATTN_MESG | AFPATTN_NORECONNECT) 
 
120
 
 
121
/* extended bitmap -- 12 bits. volchanged is only useful w/ a server
 
122
 * notification, and time is only useful for shutdown. */
 
123
#define AFPATTN_VOLCHANGED   (1 << 0)             /* volume has changed */
 
124
#define AFPATTN_TIME(x)      ((x) & 0xfff)        /* time in minutes */
 
125
 
 
126
typedef enum {
 
127
  AFPMESG_LOGIN = 0,
 
128
  AFPMESG_SERVER = 1
 
129
} afpmessage_t;
 
130
 
 
131
/* AFP functions */
 
132
#define AFP_BYTELOCK         1
 
133
#define AFP_CLOSEVOL             2
 
134
#define AFP_CLOSEDIR             3
 
135
#define AFP_CLOSEFORK            4
 
136
#define AFP_COPYFILE             5
 
137
#define AFP_CREATEDIR            6
 
138
#define AFP_CREATEFILE           7
 
139
#define AFP_DELETE                   8
 
140
#define AFP_ENUMERATE            9
 
141
#define AFP_FLUSH                   10
 
142
#define AFP_FLUSHFORK           11
 
143
 
 
144
#define AFP_GETFORKPARAM        14
 
145
#define AFP_GETSRVINFO          15
 
146
#define AFP_GETSRVPARAM         16
 
147
#define AFP_GETVOLPARAM         17
 
148
#define AFP_LOGIN               18
 
149
#define AFP_LOGINCONT           19
 
150
#define AFP_LOGOUT              20
 
151
#define AFP_MAPID                   21
 
152
#define AFP_MAPNAME                 22
 
153
#define AFP_MOVE                    23
 
154
#define AFP_OPENVOL             24
 
155
#define AFP_OPENDIR                 25
 
156
#define AFP_OPENFORK            26
 
157
#define AFP_READ                    27
 
158
#define AFP_RENAME                  28
 
159
#define AFP_SETDIRPARAM         29
 
160
#define AFP_SETFILEPARAM        30
 
161
#define AFP_SETFORKPARAM        31
 
162
#define AFP_SETVOLPARAM         32
 
163
#define AFP_WRITE                   33
 
164
#define AFP_GETFLDRPARAM        34
 
165
#define AFP_SETFLDRPARAM        35
 
166
#define AFP_CHANGEPW            36
 
167
 
 
168
#define AFP_GETSRVRMSG          38
 
169
#define AFP_CREATEID            39
 
170
#define AFP_DELETEID            40
 
171
#define AFP_RESOLVEID           41
 
172
#define AFP_EXCHANGEFILE        42
 
173
#define AFP_CATSEARCH           43
 
174
 
 
175
#define AFP_OPENDT                  48
 
176
#define AFP_CLOSEDT                 49
 
177
 
 
178
#define AFP_GETICON         51
 
179
#define AFP_GTICNINFO       52
 
180
#define AFP_ADDAPPL         53
 
181
#define AFP_RMVAPPL         54
 
182
 
 
183
#define AFP_GETAPPL         55
 
184
#define AFP_ADDCMT          56
 
185
#define AFP_RMVCMT          57
 
186
#define AFP_GETCMT          58
 
187
#define AFP_ADDICON        192
 
188
 
 
189
/* version 3.0 */
 
190
#define AFP_BYTELOCK_EXT        59
 
191
#define AFP_CATSEARCH_EXT       67
 
192
#define AFP_ENUMERATE_EXT       66
 
193
#define AFP_READ_EXT            60
 
194
#define AFP_WRITE_EXT           61
 
195
#define AFP_GETSESSTOKEN        64
 
196
#define AFP_DISCTOLDSESS        65
 
197
 
 
198
/* version 3.1 */
 
199
#define AFP_ENUMERATE_EXT2      68
 
200
 
 
201
#endif