netatalk 4.4.3
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
afpclient.h
Go to the documentation of this file.
1/* ---------------------------------------------------
2*/
3#ifndef AFPCLIENT_H
4#define AFPCLIENT_H
5
6#ifdef HAVE_CONFIG_H
7#include "config.h"
8#endif /* HAVE_CONFIG_H */
9
10#include <stdio.h>
11#include <stdlib.h>
12#include <string.h>
13#include <unistd.h>
14#include <fcntl.h>
15#include <signal.h>
16
17#include <sys/types.h>
18#include <sys/stat.h>
19#include <sys/param.h>
20#include <sys/uio.h>
21#include <sys/time.h>
22#include <sys/socket.h>
23
24#include <sys/ioctl.h>
25#include <net/if.h>
26#include <netinet/tcp.h>
27#include <netinet/in.h>
28#include <arpa/inet.h>
29#include <errno.h>
30#include <netdb.h>
31
32#include <atalk/afp.h>
33#include "dsi.h"
34
35#ifndef SA_ONESHOT
36#define SA_ONESHOT SA_RESETHAND
37#endif
38
39
40#ifndef HAVE_BSWAP_64
41#define bswap_64(x) \
42 ((((x) & 0xff00000000000000ull) >> 56) \
43 | (((x) & 0x00ff000000000000ull) >> 40) \
44 | (((x) & 0x0000ff0000000000ull) >> 24) \
45 | (((x) & 0x000000ff00000000ull) >> 8) \
46 | (((x) & 0x00000000ff000000ull) << 8) \
47 | (((x) & 0x0000000000ff0000ull) << 24) \
48 | (((x) & 0x000000000000ff00ull) << 40) \
49 | (((x) & 0x00000000000000ffull) << 56))
50#endif /* bswap_64 */
51
52/* AFP functions */
53#ifndef AFP_CLOSEVOL
54#define AFP_CLOSEVOL 2
55#define AFP_ENUMERATE 9
56
57#define AFP_GETSRVINFO 15
58#define AFP_GETSRVPARAM 16
59#define AFP_LOGIN 18
60
61#define AFP_LOGOUT 20
62#define AFP_OPENVOL 24
63#define AFP_OPENDIR 25
64#define AFP_OPENFORK 26
65
66#define AFP_OPENDT 48
67#define AFP_CLOSEDT 49
68#endif
69
70/* ----------------------------- */
71/* from etc/afpd/directory.h volume attributes */
72#define DIRPBIT_ATTR 0
73#define DIRPBIT_PDID 1
74#define DIRPBIT_CDATE 2
75#define DIRPBIT_MDATE 3
76#define DIRPBIT_BDATE 4
77#define DIRPBIT_FINFO 5
78#define DIRPBIT_LNAME 6
79#define DIRPBIT_SNAME 7
80#define DIRPBIT_DID 8
81#define DIRPBIT_OFFCNT 9
82#define DIRPBIT_UID 10
83#define DIRPBIT_GID 11
84#define DIRPBIT_ACCESS 12
85#define DIRPBIT_PDINFO 13
86#define DIRPBIT_UNIXPR 15
87
88/* directory attribute bits (see file.h for other bits) */
89#define ATTRBIT_EXPFOLDER (1 << 1)
90#define ATTRBIT_MOUNTED (1 << 3)
91#define ATTRBIT_INEXPFOLDER (1 << 4)
92
93#define FILDIRBIT_ISDIR (1 << 7)
94#define FILDIRBIT_ISFILE (0)
95
96/* reserved directory id's */
97#define DIRDID_ROOT_PARENT htonl(1)
98#define DIRDID_ROOT htonl(2)
99
100/* ----------------------------- */
101/* from etc/afpd/file.h volume attributes */
102#define FILPBIT_ATTR 0
103#define FILPBIT_PDID 1
104#define FILPBIT_CDATE 2
105#define FILPBIT_MDATE 3
106#define FILPBIT_BDATE 4
107#define FILPBIT_FINFO 5
108#define FILPBIT_LNAME 6
109#define FILPBIT_SNAME 7
110#define FILPBIT_FNUM 8
111#define FILPBIT_DFLEN 9
112#define FILPBIT_RFLEN 10
113#define FILPBIT_EXTDFLEN 11
114#define FILPBIT_PDINFO 13
115#define FILPBIT_EXTRFLEN 14
116#define FILPBIT_UNIXPR 15
117
118/* attribute bits. d = directory attribute bit as well. */
119#define ATTRBIT_INVISIBLE (1<<0)
120#define ATTRBIT_MULTIUSER (1<<1)
121#define ATTRBIT_SYSTEM (1<<2)
122#define ATTRBIT_DOPEN (1<<3)
123#define ATTRBIT_ROPEN (1<<4)
124#define ATTRBIT_SHARED (1<<4)
125#define ATTRBIT_NOWRITE (1<<5)
126#define ATTRBIT_BACKUP (1<<6)
127#define ATTRBIT_NORENAME (1<<7)
128#define ATTRBIT_NODELETE (1<<8)
129#define ATTRBIT_NOCOPY (1<<10)
130#define ATTRBIT_SETCLR (1<<15)
131
132/* ----------------------------- */
133/* from etc/afpd/volume.h volume attributes */
134#define VOLPBIT_ATTR_RO (1 << 0)
135#define VOLPBIT_ATTR_PASSWD (1 << 1)
136#define VOLPBIT_ATTR_FILEID (1 << 2)
137#define VOLPBIT_ATTR_CATSEARCH (1 << 3)
138#define VOLPBIT_ATTR_BLANKACCESS (1 << 4)
139#define VOLPBIT_ATTR_UNIXPRIV (1 << 5)
140#define VOLPBIT_ATTR_UTF8 (1 << 6)
141#define VOLPBIT_ATTR_NONETUID (1 << 7)
142#define VOLPBIT_ATTR_PRIVPARENT (1 << 8)
143#define VOLPBIT_ATTR_NOEXCHANGE (1 << 9)
144#define VOLPBIT_ATTR_EXTATTRS (1 << 10)
145#define VOLPBIT_ATTR_ACLS (1 << 11)
146
147#define VOLPBIT_ATTR 0
148#define VOLPBIT_SIG 1
149#define VOLPBIT_CDATE 2
150#define VOLPBIT_MDATE 3
151#define VOLPBIT_BDATE 4
152#define VOLPBIT_VID 5
153#define VOLPBIT_BFREE 6
154#define VOLPBIT_BTOTAL 7
155#define VOLPBIT_NAME 8
156/* handle > 4GB volumes */
157#define VOLPBIT_XBFREE 9
158#define VOLPBIT_XBTOTAL 10
159#define VOLPBIT_BSIZE 11
160/* ----------------------------- */
161
162/* from etc/afpd/fork.h */
163#define AFPOF_DFORK 0x00
164#define AFPOF_RFORK 0x80
165
166#define OPENFORK_DATA (0)
167#define OPENFORK_RSCS (1<<7)
168
169#define OPENACC_RD (1<<0)
170#define OPENACC_WR (1<<1)
171#define OPENACC_DRD (1<<4)
172#define OPENACC_DWR (1<<5)
173
174#define AFPFORK_OPEN (1<<0)
175#define AFPFORK_RSRC (1<<1)
176#define AFPFORK_DATA (1<<2)
177#define AFPFORK_DIRTY (1<<3)
178#define AFPFORK_ACCRD (1<<4)
179#define AFPFORK_ACCWR (1<<5)
180#define AFPFORK_ACCMASK (AFPFORK_ACCRD | AFPFORK_ACCWR)
181
182/* we use this so that we can use the same mechanism for both byte
183 * locks and file synchronization locks. */
184#if _FILE_OFFSET_BITS == 64
185#define AD_FILELOCK_BASE (UINT64_C(0x7FFFFFFFFFFFFFFF) - 9)
186#else
187#define AD_FILELOCK_BASE (UINT32_C(0x7FFFFFFF) - 9)
188#endif
189
190 typedef struct CONN {
191 DSI dsi;
192#if 0
193 ASP asp;
194#endif
195 int type;
196 int afp_version;
197} CONN;
198
199 extern CONN *Conn, *Conn2;
200
201#define min(a,b) ((a) < (b) ? (a) : (b))
202
203#define PASSWDLEN 8
204
205#define dsi_clientID(x) ((x)->clientID++)
206
207#define my_dsi_send(x) do { \
208 (x)->header.dsi_len = htonl((x)->cmdlen); \
209 my_dsi_stream_send((x), (x)->commands, (x)->cmdlen); \
210} while (0)
211
212 int my_dsi_cmd_receive(DSI *x);
213 int my_dsi_data_receive(DSI *x);
214
215/* from
216 modified
217 */
218/* Files and directories */
219 struct afp_filedir_parms {
220 int isdir;
221 uint16_t bitmap;
222 uint16_t attr;
223 uint16_t vid;
224 uint32_t pdid;
225 uint32_t did;
226 uint32_t bdate, mdate, cdate;
227 uint32_t dflen, rflen;
228 uint64_t ext_dflen;
229 uint64_t ext_rflen;
230 uint16_t offcnt;
231 uint32_t uid, gid;
232 uint32_t unix_priv; /* FIXME what if mode_t != uint32_t */
233 uint8_t access[4];
234 uint8_t pdinfo[6];
235 /* FIXME: Finder info ! */
236 char finder_info[32];
237 int name_type;
238 char *lname;
239 char *sname;
240 char *utf8_name;
241};
242
243 struct afp_volume_parms {
244 /* FIXME: keep state across calls here (OPENED/CLOSED) */
245 uint8_t state;
246 uint8_t flags;
247 uint16_t attr;
248 uint16_t sig;
249 uint32_t cdate, bdate, mdate;
250 uint16_t vid;
251 uint32_t bfree, btotal, bsize;
252 char *name;
253 char *utf8_name;
254};
255
256 void afp_volume_unpack(struct afp_volume_parms *parms, unsigned char *b,
257 uint16_t rbitmap);
258
259 void afp_filedir_unpack(struct afp_filedir_parms *filedir,
260 const unsigned char *b,
261 uint16_t rfbitmap, uint16_t rdbitmap);
262 int afp_filedir_pack(unsigned char *b, struct afp_filedir_parms *filedir,
263 uint16_t rfbitmap, uint16_t rdbitmap);
264
265/*
266 afpclient.c
267*/
268 int OpenClientSocket(char *host, int port);
269 int CloseClientSocket(int fd);
270
271
272 size_t my_dsi_stream_read(DSI *dsi, void *data, const size_t length);
273 int my_dsi_stream_receive(DSI *dsi, void *buf, const size_t ilength,
274 size_t *rlength);
275 size_t my_dsi_stream_write(DSI *dsi, void *data, const size_t length);
276 int my_dsi_stream_send(DSI *dsi, void *buf, size_t length);
277uint16_t my_dsi_cmd_nwriterply_async(CONN *conn, uint64_t n);
278 void dump_header(DSI *dsi);
279
280 unsigned int DSIOpenSession(CONN *conn);
281 unsigned int DSIGetStatus(CONN *conn);
282 unsigned int DSICloseSession(CONN *conn);
283
284 unsigned int AFPopenLogin(CONN *conn, char *vers, char *uam, char *usr,
285 char *pwd);
286 unsigned int AFPopenLoginExt(CONN *conn, char *vers, char *uam, char *usr,
287 char *pwd);
288 unsigned int AFPLogOut(CONN *conn);
289 unsigned int AFPChangePW(CONN *conn, char *uam, char *usr, char *opwd,
290 char *pwd);
291
292 unsigned int AFPzzz(CONN *conn, int);
293
294 unsigned int AFPGetSrvrInfo(CONN *conn);
295 unsigned int AFPGetSrvrParms(CONN *conn);
296 unsigned int AFPGetSrvrMsg(CONN *conn, uint16_t type, uint16_t bitmap);
297
298 unsigned int AFPCloseVol(CONN *conn, uint16_t vol);
299 unsigned int AFPCloseDT(CONN *conn, uint16_t vol);
300
301 unsigned int AFPByteLock(CONN *conn, uint16_t fork, int end, int mode,
302 int offset, int size);
303 unsigned int AFPByteLock_ext(CONN *conn, uint16_t fork, int end, int mode,
304 off_t offset, off_t size);
305 unsigned int AFPCloseFork(CONN *conn, uint16_t fork);
306 unsigned int AFPFlush(CONN *conn, uint16_t vol);
307 unsigned int AFPFlushFork(CONN *conn, uint16_t fork);
308 unsigned int AFPDelete(CONN *conn, uint16_t vol, int did, char *name);
309
310 unsigned int AFPGetComment(CONN *conn, uint16_t vol, int did, char *name);
311 unsigned int AFPRemoveComment(CONN *conn, uint16_t vol, int did, char *name);
312 unsigned int AFPAddComment(CONN *conn, uint16_t vol, int did, char *name,
313 char *cmt);
314
315uint16_t AFPOpenVol(CONN *conn, char *vol, uint16_t bitmap);
316uint16_t AFPOpenFork(CONN *conn, uint16_t vol, char type, uint16_t bitmap,
317 int did, char *name, uint16_t access);
318
319 unsigned int AFPGetVolParam(CONN *conn, uint16_t vol, uint16_t bitmap);
320 unsigned int AFPSetVolParam(CONN *conn, uint16_t vol, uint16_t bitmap,
321 struct afp_volume_parms *parms);
322
323 unsigned int AFPCreateFile(CONN *conn, uint16_t vol, char type, int did,
324 char *name);
325 unsigned int AFPCreateDir(CONN *conn, uint16_t vol, int did, char *name);
326
327 unsigned int AFPWriteHeader(DSI *dsi, uint16_t fork, int offset, int size,
328 char *data, char whence);
329 unsigned int AFPWriteFooter(DSI *dsi, uint16_t fork, int offset, int size,
330 char *data, char whence);
331 unsigned int AFPWrite(CONN *conn, uint16_t fork, int offset, int size,
332 char *data, char whence);
333 unsigned int AFPWrite_ext(CONN *conn, uint16_t fork, off_t offset, off_t size,
334 char *data, char whence);
335 unsigned int AFPWrite_ext_async(CONN *conn, uint16_t fork, off_t offset,
336 off_t size, char *data, char whence);
337
338 unsigned int AFPReadHeader(DSI *dsi, uint16_t fork, int offset, int size,
339 char *data);
340 unsigned int AFPReadFooter(DSI *dsi, uint16_t fork, int offset, int size,
341 char *data);
342 unsigned int AFPRead(CONN *conn, uint16_t fork, int offset, int size,
343 char *data);
344 unsigned int AFPRead_ext(CONN *conn, uint16_t fork, off_t offset, off_t size,
345 char *data);
346 unsigned int AFPRead_ext_async(CONN *conn, uint16_t fork, off_t offset,
347 off_t size, char *data);
348
349 unsigned int AFPGetForkParam(CONN *conn, uint16_t fork, uint16_t bitmap);
350
351 unsigned int AFPGetSessionToken(CONN *conn, int type, uint32_t time, int len,
352 char *token);
353 unsigned int AFPDisconnectOldSession(CONN *conn, uint16_t type, int len,
354 char *token);
355
356 unsigned int AFPMapID(CONN *conn, char fn, int id);
357 unsigned int AFPMapName(CONN *conn, char fn, char *name);
358
359 unsigned int AFPAddAPPL(CONN *conn, uint16_t dt, int did, char *creator,
360 uint32_t tag, char *name);
361 unsigned int AFPGetAPPL(CONN *conn, uint16_t dt, char *name, uint16_t index,
362 uint16_t f_bitmap);
363 unsigned int AFPRemoveAPPL(CONN *conn, uint16_t dt, int did, char *creator,
364 char *name);
365
366 unsigned int AFPGetUserInfo(CONN *conn, char flag, int id, uint16_t bitmap);
367 unsigned int AFPBadPacket(CONN *conn, char fn, char *name);
368
369 unsigned int AFPCatSearch(CONN *conn, uint16_t vol, uint32_t nbe, char *pos,
370 uint16_t f_bitmap, uint16_t d_bitmap,
371 uint32_t rbitmap, struct afp_filedir_parms *filedir,
372 struct afp_filedir_parms *filedir2);
373
374 unsigned int AFPCatSearchExt(CONN *conn, uint16_t vol, uint32_t nbe, char *pos,
375 uint16_t f_bitmap, uint16_t d_bitmap,
376 uint32_t rbitmap, struct afp_filedir_parms *filedir,
377 struct afp_filedir_parms *filedir2);
378
379 unsigned int AFPSetForkParam(CONN *conn, uint16_t fork, uint16_t bitmap,
380 off_t size);
381
382/* FileSecurity bitmap values */
383#define kFileSec_UUID (1 << 0)
384#define kFileSec_GRPUUID (1 << 1)
385#define kFileSec_ACL (1 << 2)
386#define kFileSec_REMOVEACL (1 << 3)
387#define kFileSec_Inherit (1 << 4)
388
389/* Darwin ACE structure (24 bytes total) */
390 typedef struct darwin_ace {
391 unsigned char darwin_ace_uuid[16]; /* 16 bytes UUID */
392 uint32_t darwin_ace_flags; /* 4 bytes flags (network byte order) */
393 uint32_t darwin_ace_rights; /* 4 bytes rights (network byte order) */
394} __attribute__((packed)) darwin_ace_t;
395
396/* Darwin ACE flags - Must match server definitions in etc/afpd/acls.h
397 * These are bit flags that can be combined with inheritance flags
398 * PERMIT/DENY occupy bits 0-1 of the flags field
399 */
400#define DARWIN_ACE_FLAGS_PERMIT 0x00000001 /* Bit 0: ALLOW access */
401#define DARWIN_ACE_FLAGS_DENY 0x00000002 /* Bit 1: DENY access */
402#define DARWIN_ACE_FLAGS_FILE_INHERIT 0x00000020 /* Bit 5: Inherit to files */
403#define DARWIN_ACE_FLAGS_DIRECTORY_INHERIT 0x00000040 /* Bit 6: Inherit to dirs */
404#define DARWIN_ACE_FLAGS_ONLY_INHERIT 0x00000100 /* Bit 8: Inherit only */
405
406/* Darwin ACE rights (simplified subset) */
407#define DARWIN_ACE_READ_DATA 0x00000002
408#define DARWIN_ACE_WRITE_DATA 0x00000004
409#define DARWIN_ACE_EXECUTE 0x00000008
410
411 unsigned int AFPGetACL(CONN *conn, uint16_t vol, int did, uint16_t bitmap,
412 char *name);
413 unsigned int AFPSetACL(CONN *conn, uint16_t vol, int did, uint16_t bitmap,
414 char *name, uint32_t ace_count, darwin_ace_t *aces);
415 unsigned int AFPListExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap,
416 int maxsize, char *pathname);
417 unsigned int AFPGetExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap,
418 int maxsize, char *pathname, char *attrname);
419 unsigned int AFPSetExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap,
420 char *pathname, char *attrname, char *data);
421 unsigned int AFPRemoveExtAttr(CONN *conn, uint16_t vol, int did,
422 uint16_t bitmap, char *pathname, char *attrname);
423
424 int FPset_name(CONN *conn, int ofs, char *name);
425 void u2mac(uint8_t *dst, char *name, int len);
426
427 char *strp2cdup(unsigned char *src);
428
429#endif
430
431/* ---------------------------------
432*/
afp.h
Conn2
CONN * Conn2
Definition afparg.c:57
vers
char * vers
Definition afparg.c:53
uam
char * uam
Definition afparg.c:54
dsi
static DSI * dsi
Definition afparg.c:39
Conn
CONN * Conn
Definition afparg.c:40
AFPGetAPPL
unsigned int AFPGetAPPL(CONN *conn, uint16_t dt, char *name, uint16_t index, uint16_t f_bitmap)
Definition afpclient.c:2183
my_dsi_data_receive
int my_dsi_data_receive(DSI *x)
Definition afpclient.c:325
AFPRemoveAPPL
unsigned int AFPRemoveAPPL(CONN *conn, uint16_t dt, int did, char *creator, char *name)
Definition afpclient.c:2241
AFPCloseFork
unsigned int AFPCloseFork(CONN *conn, uint16_t fork)
Definition afpclient.c:731
AFPFlush
unsigned int AFPFlush(CONN *conn, uint16_t vol)
Definition afpclient.c:853
AFPByteLock_ext
unsigned int AFPByteLock_ext(CONN *conn, uint16_t fork, int end, int mode, off_t offset, off_t size)
Definition afpclient.c:807
AFPWriteFooter
unsigned int AFPWriteFooter(DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
Definition afpclient.c:1629
DSIGetStatus
unsigned int DSIGetStatus(CONN *conn)
Definition afpclient.c:439
AFPopenLoginExt
unsigned int AFPopenLoginExt(CONN *conn, char *vers, char *uam, char *usr, char *pwd)
Definition afpclient.c:521
DSIOpenSession
unsigned int DSIOpenSession(CONN *conn)
Definition afpclient.c:399
AFPSetVolParam
unsigned int AFPSetVolParam(CONN *conn, uint16_t vol, uint16_t bitmap, struct afp_volume_parms *parms)
Definition afpclient.c:1498
AFPGetForkParam
unsigned int AFPGetForkParam(CONN *conn, uint16_t fork, uint16_t bitmap)
Definition afpclient.c:2160
DSICloseSession
unsigned int DSICloseSession(CONN *conn)
Definition afpclient.c:457
AFPByteLock
unsigned int AFPByteLock(CONN *conn, uint16_t fork, int end, int mode, int offset, int size)
Definition afpclient.c:741
AFPGetSrvrInfo
unsigned int AFPGetSrvrInfo(CONN *conn)
Definition afpclient.c:669
AFPSetExtAttr
unsigned int AFPSetExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *pathname, char *attrname, char *data)
Definition afpclient.c:2531
AFPAddAPPL
unsigned int AFPAddAPPL(CONN *conn, uint16_t dt, int did, char *creator, uint32_t tag, char *name)
Definition afpclient.c:2213
AFPGetSrvrMsg
unsigned int AFPGetSrvrMsg(CONN *conn, uint16_t type, uint16_t bitmap)
Definition afpclient.c:689
my_dsi_cmd_nwriterply_async
uint16_t my_dsi_cmd_nwriterply_async(CONN *conn, uint64_t n)
AFPCloseVol
unsigned int AFPCloseVol(CONN *conn, uint16_t vol)
Definition afpclient.c:711
AFPOpenFork
uint16_t AFPOpenFork(CONN *conn, uint16_t vol, char type, uint16_t bitmap, int did, char *name, uint16_t access)
Definition afpclient.c:1740
AFPGetComment
unsigned int AFPGetComment(CONN *conn, uint16_t vol, int did, char *name)
Definition afpclient.c:1785
OpenClientSocket
int OpenClientSocket(char *host, int port)
Definition afpclient.c:20
AFPCatSearch
unsigned int AFPCatSearch(CONN *conn, uint16_t vol, uint32_t nbe, char *pos, uint16_t f_bitmap, uint16_t d_bitmap, uint32_t rbitmap, struct afp_filedir_parms *filedir, struct afp_filedir_parms *filedir2)
Definition afpclient.c:2267
AFPMapName
unsigned int AFPMapName(CONN *conn, char fn, char *name)
Definition afpclient.c:1940
AFPOpenVol
uint16_t AFPOpenVol(CONN *conn, char *vol, uint16_t bitmap)
Definition afpclient.c:873
AFPMapID
unsigned int AFPMapID(CONN *conn, char fn, int id)
Definition afpclient.c:1919
AFPCreateDir
unsigned int AFPCreateDir(CONN *conn, uint16_t vol, int did, char *name)
Definition afpclient.c:2128
AFPWriteHeader
unsigned int AFPWriteHeader(DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
Definition afpclient.c:1598
AFPCatSearchExt
unsigned int AFPCatSearchExt(CONN *conn, uint16_t vol, uint32_t nbe, char *pos, uint16_t f_bitmap, uint16_t d_bitmap, uint32_t rbitmap, struct afp_filedir_parms *filedir, struct afp_filedir_parms *filedir2)
Definition afpclient.c:2315
AFPChangePW
unsigned int AFPChangePW(CONN *conn, char *uam, char *usr, char *opwd, char *pwd)
Definition afpclient.c:592
AFPGetSrvrParms
unsigned int AFPGetSrvrParms(CONN *conn)
Definition afpclient.c:679
AFPWrite_ext_async
unsigned int AFPWrite_ext_async(CONN *conn, uint16_t fork, off_t offset, off_t size, char *data, char whence)
Definition afpclient.c:1712
my_dsi_stream_send
int my_dsi_stream_send(DSI *dsi, void *buf, size_t length)
Definition afpclient.c:183
my_dsi_stream_write
size_t my_dsi_stream_write(DSI *dsi, void *data, const size_t length)
Definition afpclient.c:152
AFPListExtAttr
unsigned int AFPListExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap, int maxsize, char *pathname)
Definition afpclient.c:2497
AFPBadPacket
unsigned int AFPBadPacket(CONN *conn, char fn, char *name)
Definition afpclient.c:1978
AFPRead
unsigned int AFPRead(CONN *conn, uint16_t fork, int offset, int size, char *data)
Definition afpclient.c:2046
AFPGetExtAttr
unsigned int AFPGetExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap, int maxsize, char *pathname, char *attrname)
Definition afpclient.c:2443
afp_volume_unpack
void afp_volume_unpack(struct afp_volume_parms *parms, unsigned char *b, uint16_t rbitmap)
Definition afpclient.c:981
afp_filedir_unpack
void afp_filedir_unpack(struct afp_filedir_parms *filedir, const unsigned char *b, uint16_t rfbitmap, uint16_t rdbitmap)
Definition afpclient.c:1135
afp_filedir_pack
int afp_filedir_pack(unsigned char *b, struct afp_filedir_parms *filedir, uint16_t rfbitmap, uint16_t rdbitmap)
Definition afpclient.c:1310
AFPReadHeader
unsigned int AFPReadHeader(DSI *dsi, uint16_t fork, int offset, int size, char *data)
Definition afpclient.c:2001
strp2cdup
char * strp2cdup(unsigned char *src)
Definition afpclient.c:952
AFPFlushFork
unsigned int AFPFlushFork(CONN *conn, uint16_t fork)
Definition afpclient.c:863
AFPRead_ext
unsigned int AFPRead_ext(CONN *conn, uint16_t fork, off_t offset, off_t size, char *data)
Definition afpclient.c:2058
dump_header
void dump_header(DSI *dsi)
Definition afpcmd.c:489
u2mac
void u2mac(uint8_t *dst, char *name, int len)
Definition afpclient.c:1525
AFPDelete
unsigned int AFPDelete(CONN *conn, uint16_t vol, int did, char *name)
Definition afpclient.c:1779
AFPDisconnectOldSession
unsigned int AFPDisconnectOldSession(CONN *conn, uint16_t type, int len, char *token)
Definition afpclient.c:1868
AFPGetACL
unsigned int AFPGetACL(CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *name)
Definition afpclient.c:2366
AFPSetForkParam
unsigned int AFPSetForkParam(CONN *conn, uint16_t fork, uint16_t bitmap, off_t size)
Definition afpclient.c:828
my_dsi_stream_read
size_t my_dsi_stream_read(DSI *dsi, void *data, const size_t length)
Definition afpclient.c:76
FPset_name
int FPset_name(CONN *conn, int ofs, char *name)
Definition afpclient.c:1545
AFPzzz
unsigned int AFPzzz(CONN *conn, int)
Definition afpclient.c:649
AFPReadFooter
unsigned int AFPReadFooter(DSI *dsi, uint16_t fork, int offset, int size, char *data)
Definition afpclient.c:2026
AFPGetUserInfo
unsigned int AFPGetUserInfo(CONN *conn, char flag, int id, uint16_t bitmap)
Definition afpclient.c:1895
my_dsi_stream_receive
int my_dsi_stream_receive(DSI *dsi, void *buf, const size_t ilength, size_t *rlength)
Definition afpclient.c:132
AFPCreateFile
unsigned int AFPCreateFile(CONN *conn, uint16_t vol, char type, int did, char *name)
Definition afpclient.c:1575
AFPCloseDT
unsigned int AFPCloseDT(CONN *conn, uint16_t vol)
Definition afpclient.c:721
AFPRead_ext_async
unsigned int AFPRead_ext_async(CONN *conn, uint16_t fork, off_t offset, off_t size, char *data)
Definition afpclient.c:2108
AFPGetVolParam
unsigned int AFPGetVolParam(CONN *conn, uint16_t vol, uint16_t bitmap)
Definition afpclient.c:1476
AFPLogOut
unsigned int AFPLogOut(CONN *conn)
Definition afpclient.c:638
AFPWrite_ext
unsigned int AFPWrite_ext(CONN *conn, uint16_t fork, off_t offset, off_t size, char *data, char whence)
Definition afpclient.c:1665
AFPRemoveComment
unsigned int AFPRemoveComment(CONN *conn, uint16_t vol, int did, char *name)
Definition afpclient.c:1791
AFPWrite
unsigned int AFPWrite(CONN *conn, uint16_t fork, int offset, int size, char *data, char whence)
Definition afpclient.c:1655
AFPRemoveExtAttr
unsigned int AFPRemoveExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *pathname, char *attrname)
Definition afpclient.c:2581
AFPAddComment
unsigned int AFPAddComment(CONN *conn, uint16_t vol, int did, char *name, char *cmt)
Definition afpclient.c:1797
CloseClientSocket
int CloseClientSocket(int fd)
Definition afpclient.c:69
AFPSetACL
unsigned int AFPSetACL(CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *name, uint32_t ace_count, darwin_ace_t *aces)
Definition afpclient.c:2395
AFPGetSessionToken
unsigned int AFPGetSessionToken(CONN *conn, int type, uint32_t time, int len, char *token)
Definition afpclient.c:1830
my_dsi_cmd_receive
int my_dsi_cmd_receive(DSI *x)
Definition afpclient.c:319
AFPopenLogin
unsigned int AFPopenLogin(CONN *conn, char *vers, char *uam, char *usr, char *pwd)
Definition afpclient.c:474
buf
static char buf[MAXPATHLEN+1]
Definition afppasswd.c:75
time
struct timeval time
config.h
data
#define data
Definition hash.c:37
did
cnid_t did
Definition nad_cp.c:93
type
static enum op type
Definition nad_cp.c:96
flag
#define flag(x)
Definition netacnv.c:15
port
static unsigned char port
Definition pap.c:504
ASP
Definition asp.h:43
CONN
Definition afpclient.h:190
CONN::afp_version
int afp_version
Definition afpclient.h:196
CONN::type
int type
Definition afpclient.h:195
CONN::dsi
DSI dsi
Definition afpclient.h:191
DSI
Definition include/atalk/dsi.h:58
afp_filedir_parms
Definition afpclient.h:219
afp_filedir_parms::offcnt
uint16_t offcnt
Definition afpclient.h:230
afp_filedir_parms::isdir
int isdir
Definition afpclient.h:220
afp_filedir_parms::attr
uint16_t attr
Definition afpclient.h:222
afp_filedir_parms::name_type
int name_type
Definition afpclient.h:237
afp_filedir_parms::cdate
uint32_t cdate
Definition afpclient.h:226
afp_filedir_parms::rflen
uint32_t rflen
Definition afpclient.h:227
afp_filedir_parms::sname
char * sname
Definition afpclient.h:239
afp_filedir_parms::mdate
uint32_t mdate
Definition afpclient.h:226
afp_filedir_parms::gid
uint32_t gid
Definition afpclient.h:231
afp_filedir_parms::utf8_name
char * utf8_name
Definition afpclient.h:240
afp_filedir_parms::finder_info
char finder_info[32]
Definition afpclient.h:236
afp_filedir_parms::bdate
uint32_t bdate
Definition afpclient.h:226
afp_filedir_parms::vid
uint16_t vid
Definition afpclient.h:223
afp_filedir_parms::pdinfo
uint8_t pdinfo[6]
Definition afpclient.h:234
afp_filedir_parms::ext_dflen
uint64_t ext_dflen
Definition afpclient.h:228
afp_filedir_parms::ext_rflen
uint64_t ext_rflen
Definition afpclient.h:229
afp_filedir_parms::did
uint32_t did
Definition afpclient.h:225
afp_filedir_parms::uid
uint32_t uid
Definition afpclient.h:231
afp_filedir_parms::dflen
uint32_t dflen
Definition afpclient.h:227
afp_filedir_parms::lname
char * lname
Definition afpclient.h:238
afp_filedir_parms::pdid
uint32_t pdid
Definition afpclient.h:224
afp_filedir_parms::unix_priv
uint32_t unix_priv
Definition afpclient.h:232
afp_filedir_parms::bitmap
uint16_t bitmap
Definition afpclient.h:221
afp_filedir_parms::access
uint8_t access[4]
Definition afpclient.h:233
afp_volume_parms
Definition afpclient.h:243
afp_volume_parms::flags
uint8_t flags
Definition afpclient.h:246
afp_volume_parms::vid
uint16_t vid
Definition afpclient.h:250
afp_volume_parms::state
uint8_t state
Definition afpclient.h:245
afp_volume_parms::mdate
uint32_t mdate
Definition afpclient.h:249
afp_volume_parms::attr
uint16_t attr
Definition afpclient.h:247
afp_volume_parms::btotal
uint32_t btotal
Definition afpclient.h:251
afp_volume_parms::cdate
uint32_t cdate
Definition afpclient.h:249
afp_volume_parms::bdate
uint32_t bdate
Definition afpclient.h:249
afp_volume_parms::utf8_name
char * utf8_name
Definition afpclient.h:253
afp_volume_parms::name
char * name
Definition afpclient.h:252
afp_volume_parms::bfree
uint32_t bfree
Definition afpclient.h:251
afp_volume_parms::sig
uint16_t sig
Definition afpclient.h:248
afp_volume_parms::bsize
uint32_t bsize
Definition afpclient.h:251
darwin_ace_t
Definition acls.h:105
darwin_ace
Definition afpclient.h:390
darwin_ace::darwin_ace_rights
uint32_t darwin_ace_rights
Definition afpclient.h:393
darwin_ace::darwin_ace_uuid
unsigned char darwin_ace_uuid[16]
Definition afpclient.h:391
darwin_ace::darwin_ace_flags
uint32_t darwin_ace_flags
Definition afpclient.h:392
vol
Definition include/atalk/volume.h:30
dsi.h
DSI (Data Stream Interface) protocol definitions modified for the afptest test-suite.