netatalk: afpclient.h Source File

netatalk 4.5.0
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/adouble.h>
33#include <atalk/afp.h>
34#include "dsi.h"
35
36#ifndef SA_ONESHOT
37#define SA_ONESHOT SA_RESETHAND
38#endif
39
40
41#ifndef HAVE_BSWAP_64
42#define bswap_64(x) \
43 ((((x) & 0xff00000000000000ull) >> 56) \
44 | (((x) & 0x00ff000000000000ull) >> 40) \
45 | (((x) & 0x0000ff0000000000ull) >> 24) \
46 | (((x) & 0x000000ff00000000ull) >> 8) \
47 | (((x) & 0x00000000ff000000ull) << 8) \
48 | (((x) & 0x0000000000ff0000ull) << 24) \
49 | (((x) & 0x000000000000ff00ull) << 40) \
50 | (((x) & 0x00000000000000ffull) << 56))
51#endif /* bswap_64 */
52
53/* AFP functions */
54#ifndef AFP_CLOSEVOL
55#define AFP_CLOSEVOL 2
56#define AFP_ENUMERATE 9
57
58#define AFP_GETSRVINFO 15
59#define AFP_GETSRVPARAM 16
60#define AFP_LOGIN 18
61
62#define AFP_LOGOUT 20
63#define AFP_OPENVOL 24
64#define AFP_OPENDIR 25
65#define AFP_OPENFORK 26
66
67#define AFP_OPENDT 48
68#define AFP_CLOSEDT 49
69#endif
70
71/* ----------------------------- */
72/* from etc/afpd/directory.h volume attributes */
73#define DIRPBIT_ATTR 0
74#define DIRPBIT_PDID 1
75#define DIRPBIT_CDATE 2
76#define DIRPBIT_MDATE 3
77#define DIRPBIT_BDATE 4
78#define DIRPBIT_FINFO 5
79#define DIRPBIT_LNAME 6
80#define DIRPBIT_SNAME 7
81#define DIRPBIT_DID 8
82#define DIRPBIT_OFFCNT 9
83#define DIRPBIT_UID 10
84#define DIRPBIT_GID 11
85#define DIRPBIT_ACCESS 12
86#define DIRPBIT_PDINFO 13
87#define DIRPBIT_UNIXPR 15
88
89/* ATTRBIT_* macros are inherited from <atalk/adouble.h>. */
90
91#define FILDIRBIT_ISDIR (1 << 7)
92#define FILDIRBIT_ISFILE (0)
93
94/* reserved directory id's */
95#define DIRDID_ROOT_PARENT htonl(1)
96#define DIRDID_ROOT htonl(2)
97
98/* ----------------------------- */
99/* from etc/afpd/file.h volume attributes */
100#define FILPBIT_ATTR 0
101#define FILPBIT_PDID 1
102#define FILPBIT_CDATE 2
103#define FILPBIT_MDATE 3
104#define FILPBIT_BDATE 4
105#define FILPBIT_FINFO 5
106#define FILPBIT_LNAME 6
107#define FILPBIT_SNAME 7
108#define FILPBIT_FNUM 8
109#define FILPBIT_DFLEN 9
110#define FILPBIT_RFLEN 10
111#define FILPBIT_EXTDFLEN 11
112#define FILPBIT_PDINFO 13
113#define FILPBIT_EXTRFLEN 14
114#define FILPBIT_UNIXPR 15
115
116/* ----------------------------- */
117/* from etc/afpd/volume.h volume attributes */
118#define VOLPBIT_ATTR_RO (1 << 0)
119#define VOLPBIT_ATTR_PASSWD (1 << 1)
120#define VOLPBIT_ATTR_FILEID (1 << 2)
121#define VOLPBIT_ATTR_CATSEARCH (1 << 3)
122#define VOLPBIT_ATTR_BLANKACCESS (1 << 4)
123#define VOLPBIT_ATTR_UNIXPRIV (1 << 5)
124#define VOLPBIT_ATTR_UTF8 (1 << 6)
125#define VOLPBIT_ATTR_NONETUID (1 << 7)
126#define VOLPBIT_ATTR_PRIVPARENT (1 << 8)
127#define VOLPBIT_ATTR_NOEXCHANGE (1 << 9)
128#define VOLPBIT_ATTR_EXTATTRS (1 << 10)
129#define VOLPBIT_ATTR_ACLS (1 << 11)
130#define VOLPBIT_ATTR_CASESENS (1 << 12)
131#define VOLPBIT_ATTR_TM (1 << 13)
132
133#define VOLPBIT_ATTR 0
134#define VOLPBIT_SIG 1
135#define VOLPBIT_CDATE 2
136#define VOLPBIT_MDATE 3
137#define VOLPBIT_BDATE 4
138#define VOLPBIT_VID 5
139#define VOLPBIT_BFREE 6
140#define VOLPBIT_BTOTAL 7
141#define VOLPBIT_NAME 8
142/* handle > 4GB volumes */
143#define VOLPBIT_XBFREE 9
144#define VOLPBIT_XBTOTAL 10
145#define VOLPBIT_BSIZE 11
146/* ----------------------------- */
147
148/* from etc/afpd/fork.h */
149#define AFPOF_DFORK 0x00
150#define AFPOF_RFORK 0x80
151
152#define OPENFORK_DATA (0)
153#define OPENFORK_RSCS (1<<7)
154
155#define OPENACC_RD (1<<0)
156#define OPENACC_WR (1<<1)
157#define OPENACC_DRD (1<<4)
158#define OPENACC_DWR (1<<5)
159
160#define AFPFORK_OPEN (1<<0)
161#define AFPFORK_RSRC (1<<1)
162#define AFPFORK_DATA (1<<2)
163#define AFPFORK_DIRTY (1<<3)
164#define AFPFORK_ACCRD (1<<4)
165#define AFPFORK_ACCWR (1<<5)
166#define AFPFORK_ACCMASK (AFPFORK_ACCRD | AFPFORK_ACCWR)
167
168/* we use this so that we can use the same mechanism for both byte
169 * locks and file synchronization locks. */
170#if _FILE_OFFSET_BITS == 64
171#define AD_FILELOCK_BASE (UINT64_C(0x7FFFFFFFFFFFFFFF) - 9)
172#else
173#define AD_FILELOCK_BASE (UINT32_C(0x7FFFFFFF) - 9)
174#endif
175
176 typedef struct CONN {
177 DSI dsi;
178#if 0
179 ASP asp;
180#endif
181 int type;
182 int afp_version;
183
184 /* Captured on kFPAuthContinue from FPLoginExt or FPLoginCont.
185 * UAM helpers can read login_cont_data/_len and pass login_cont_id
186 * back into AFPLoginCont for the next round trip. */
187 uint16_t login_cont_id;
188 size_t login_cont_len;
189 uint8_t login_cont_data[DSI_CMDSIZ];
190} CONN;
191
192 extern CONN *Conn, *Conn2;
193
194#define min(a,b) ((a) < (b) ? (a) : (b))
195
196#define PASSWDLEN 8
197
198int dsi_cmd_receive(DSI *x);
199int dsi_data_receive(DSI *x);
200
201void SendInit(DSI *dsi);
202void SetLen(DSI *dsi, int ofs);
203
204/* from
205 modified
206 */
207/* Files and directories */
208 struct afp_filedir_parms {
209 int isdir;
210 uint16_t bitmap;
211 uint16_t attr;
212 uint16_t vid;
213 uint32_t pdid;
214 uint32_t did;
215 uint32_t bdate, mdate, cdate;
216 uint32_t dflen, rflen;
217 uint64_t ext_dflen;
218 uint64_t ext_rflen;
219 uint16_t offcnt;
220 uint32_t uid, gid;
221 uint32_t unix_priv; /* FIXME what if mode_t != uint32_t */
222 uint8_t access[4];
223 uint8_t pdinfo[6];
224 /* FIXME: Finder info ! */
225 char finder_info[32];
226 int name_type;
227 char *lname;
228 char *sname;
229 char *utf8_name;
230};
231
232 struct afp_volume_parms {
233 /* FIXME: keep state across calls here (OPENED/CLOSED) */
234 uint8_t state;
235 uint8_t flags;
236 uint16_t attr;
237 uint16_t sig;
238 uint32_t cdate, bdate, mdate;
239 uint16_t vid;
240 uint32_t bfree, btotal, bsize;
241 char *name;
242 char *utf8_name;
243};
244
245void afp_volume_unpack(struct afp_volume_parms *parms, unsigned char *b,
246 uint16_t rbitmap);
247
248void afp_filedir_unpack(CONN *conn, struct afp_filedir_parms *filedir,
249 const unsigned char *b,
250 uint16_t rfbitmap, uint16_t rdbitmap);
251int afp_filedir_pack(CONN *conn, unsigned char *b,
252 struct afp_filedir_parms *filedir,
253 uint16_t rfbitmap, uint16_t rdbitmap);
254
255/*
256 afpclient.c
257*/
258int OpenClientSocket(char *host, int port);
259int CloseClientSocket(int fd);
260
261
262void dump_header(DSI *dsi);
263
264unsigned int DSIOpenSession(CONN *conn);
265unsigned int DSIGetStatus(CONN *conn);
266unsigned int DSICloseSession(CONN *conn);
267
268unsigned int AFPopenLogin(CONN *conn, const char *vers, const char *uam,
269 const char *usr, const char *pwd);
270
271/* Build an FPLoginExt with an arbitrary UserAuthInfo payload.
272 * Callers that need plain 8-byte cleartext padding should use
273 * AFPopenLoginExt_pwd() instead. */
274unsigned int AFPopenLoginExt(CONN *conn,
275 const char *vers, const char *uam,
276 const char *usr,
277 const void *auth_info, size_t auth_info_len);
278
279/* Convenience wrapper: FPLoginExt with the 8-byte zero-padded cleartext
280 * password payload that No-User-Authent and Cleartxt-Passwrd UAMs expect. */
281unsigned int AFPopenLoginExt_pwd(CONN *conn,
282 const char *vers, const char *uam,
283 const char *usr, const char *pwd);
284
285/* FPLoginCont with an arbitrary UserAuthInfo payload. Uses
286 * conn->login_cont_id captured from the previous FPLoginExt/FPLoginCont
287 * reply, and refreshes conn->login_cont_* on kFPAuthContinue. */
288unsigned int AFPLoginCont(CONN *conn,
289 const void *auth_info, size_t auth_info_len);
290unsigned int AFPLogOut(CONN *conn);
291unsigned int AFPChangePW(CONN *conn, char *uam, char *usr, char *opwd,
292 char *pwd);
293
294unsigned int AFPzzz(CONN *conn, int);
295
296unsigned int AFPGetSrvrInfo(CONN *conn);
297unsigned int AFPGetSrvrParms(CONN *conn);
298unsigned int AFPGetSrvrMsg(CONN *conn, uint16_t type, uint16_t bitmap);
299
300unsigned int AFPCloseVol(CONN *conn, uint16_t vol);
301unsigned int AFPCloseDT(CONN *conn, uint16_t vol);
302
303unsigned int AFPByteLock(CONN *conn, uint16_t fork, int end, int mode,
304 int offset, int size);
305unsigned int AFPByteLock_ext(CONN *conn, uint16_t fork, int end, int mode,
306 off_t offset, off_t size);
307unsigned int AFPCloseFork(CONN *conn, uint16_t fork);
308unsigned int AFPFlush(CONN *conn, uint16_t vol);
309unsigned int AFPFlushFork(CONN *conn, uint16_t fork);
310unsigned int AFPDelete(CONN *conn, uint16_t vol, int did, char *name);
311
312unsigned int AFPGetComment(CONN *conn, uint16_t vol, int did, char *name);
313unsigned int AFPRemoveComment(CONN *conn, uint16_t vol, int did, char *name);
314unsigned int AFPAddComment(CONN *conn, uint16_t vol, int did, char *name,
315 char *cmt);
316
317uint16_t AFPOpenVol(CONN *conn, char *vol, uint16_t bitmap);
318uint16_t AFPOpenFork(CONN *conn, uint16_t vol, char type, uint16_t bitmap,
319 int did, char *name, uint16_t access);
320
321unsigned int AFPGetVolParam(CONN *conn, uint16_t vol, uint16_t bitmap);
322unsigned int AFPSetVolParam(CONN *conn, uint16_t vol, uint16_t bitmap,
323 struct afp_volume_parms *parms);
324
325unsigned int AFPCreateFile(CONN *conn, uint16_t vol, char type, int did,
326 char *name);
327unsigned int AFPCreateDir(CONN *conn, uint16_t vol, int did, char *name);
328
329unsigned int AFPWriteHeader(DSI *dsi, uint16_t fork, int offset, int size,
330 char *data, char whence);
331unsigned int AFPWriteFooter(DSI *dsi, uint16_t fork, int offset, int size,
332 char *data, char whence);
333unsigned int AFPWrite(CONN *conn, uint16_t fork, int offset, int size,
334 char *data, char whence);
335unsigned int AFPWrite_ext(CONN *conn, uint16_t fork, off_t offset, off_t size,
336 char *data, char whence);
337unsigned int AFPWrite_ext_async(CONN *conn, uint16_t fork, off_t offset,
338 off_t size, char *data, char whence);
339
340unsigned int AFPReadHeader(DSI *dsi, uint16_t fork, int offset, int size,
341 char *data);
342unsigned int AFPReadFooter(DSI *dsi, uint16_t fork, int offset, int size,
343 char *data);
344unsigned int AFPRead(CONN *conn, uint16_t fork, int offset, int size,
345 char *data);
346unsigned int AFPRead_ext(CONN *conn, uint16_t fork, off_t offset, off_t size,
347 char *data);
348unsigned int AFPRead_ext_async(CONN *conn, uint16_t fork, off_t offset,
349 off_t size, char *data);
350
351unsigned int AFPGetForkParam(CONN *conn, uint16_t fork, uint16_t bitmap);
352
353unsigned int AFPGetSessionToken(CONN *conn, int type, uint32_t time, int len,
354 char *token);
355unsigned int AFPDisconnectOldSession(CONN *conn, uint16_t type, int len,
356 char *token);
357
358unsigned int AFPMapID(CONN *conn, char fn, int id);
359unsigned int AFPMapName(CONN *conn, char fn, char *name);
360
361unsigned int AFPAddAPPL(CONN *conn, uint16_t dt, int did, char *creator,
362 uint32_t tag, char *name);
363unsigned int AFPGetAPPL(CONN *conn, uint16_t dt, char *name, uint16_t index,
364 uint16_t f_bitmap);
365unsigned int AFPRemoveAPPL(CONN *conn, uint16_t dt, int did, char *creator,
366 char *name);
367
368unsigned int AFPGetUserInfo(CONN *conn, char flag, int id, uint16_t bitmap);
369unsigned int AFPBadPacket(CONN *conn, char fn, char *name);
370
371unsigned int AFPCatSearch(CONN *conn, uint16_t vol, uint32_t nbe, char *pos,
372 uint16_t f_bitmap, uint16_t d_bitmap,
373 uint32_t rbitmap, struct afp_filedir_parms *filedir,
374 struct afp_filedir_parms *filedir2);
375
376unsigned int AFPCatSearchExt(CONN *conn, uint16_t vol, uint32_t nbe, char *pos,
377 uint16_t f_bitmap, uint16_t d_bitmap,
378 uint32_t rbitmap, struct afp_filedir_parms *filedir,
379 struct afp_filedir_parms *filedir2);
380
381unsigned int AFPSetForkParam(CONN *conn, uint16_t fork, uint16_t bitmap,
382 off_t size);
383
384/* FileSecurity bitmap values */
385#define kFileSec_UUID (1 << 0)
386#define kFileSec_GRPUUID (1 << 1)
387#define kFileSec_ACL (1 << 2)
388#define kFileSec_REMOVEACL (1 << 3)
389#define kFileSec_Inherit (1 << 4)
390
391/* Darwin ACE structure (24 bytes total) */
392 typedef struct darwin_ace {
393 unsigned char darwin_ace_uuid[16]; /* 16 bytes UUID */
394 uint32_t darwin_ace_flags; /* 4 bytes flags (network byte order) */
395 uint32_t darwin_ace_rights; /* 4 bytes rights (network byte order) */
396} __attribute__((packed)) darwin_ace_t;
397
398/* Darwin ACE flags - Must match server definitions in etc/afpd/acls.h
399 * These are bit flags that can be combined with inheritance flags
400 * PERMIT/DENY occupy bits 0-1 of the flags field
401 */
402#define DARWIN_ACE_FLAGS_PERMIT 0x00000001 /* Bit 0: ALLOW access */
403#define DARWIN_ACE_FLAGS_DENY 0x00000002 /* Bit 1: DENY access */
404#define DARWIN_ACE_FLAGS_FILE_INHERIT 0x00000020 /* Bit 5: Inherit to files */
405#define DARWIN_ACE_FLAGS_DIRECTORY_INHERIT 0x00000040 /* Bit 6: Inherit to dirs */
406#define DARWIN_ACE_FLAGS_ONLY_INHERIT 0x00000100 /* Bit 8: Inherit only */
407
408/* Darwin ACE rights (simplified subset) */
409#define DARWIN_ACE_READ_DATA 0x00000002
410#define DARWIN_ACE_WRITE_DATA 0x00000004
411#define DARWIN_ACE_EXECUTE 0x00000008
412
413unsigned int AFPGetACL(CONN *conn, uint16_t vol, int did, uint16_t bitmap,
414 char *name);
415unsigned int AFPSetACL(CONN *conn, uint16_t vol, int did, uint16_t bitmap,
416 char *name, uint32_t ace_count, darwin_ace_t *aces);
417unsigned int AFPListExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap,
418 int maxsize, char *pathname);
419unsigned int AFPGetExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap,
420 int maxsize, char *pathname, char *attrname);
421unsigned int AFPSetExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap,
422 char *pathname, char *attrname, char *data);
423unsigned int AFPRemoveExtAttr(CONN *conn, uint16_t vol, int did,
424 uint16_t bitmap, char *pathname, char *attrname);
425
426int FPset_name(CONN *conn, int ofs, char *name);
427void u2mac(uint8_t *dst, char *name, int len);
428
429char *strp2cdup(unsigned char *src);
430
431#endif
432
433/* ---------------------------------
434*/
adouble.h
Part of Netatalk's AppleDouble implementatation.
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:2345
AFPRemoveAPPL
unsigned int AFPRemoveAPPL(CONN *conn, uint16_t dt, int did, char *creator, char *name)
Definition afpclient.c:2405
AFPCloseFork
unsigned int AFPCloseFork(CONN *conn, uint16_t fork)
Definition afpclient.c:842
AFPFlush
unsigned int AFPFlush(CONN *conn, uint16_t vol)
Definition afpclient.c:968
AFPByteLock_ext
unsigned int AFPByteLock_ext(CONN *conn, uint16_t fork, int end, int mode, off_t offset, off_t size)
Definition afpclient.c:920
AFPWriteFooter
unsigned int AFPWriteFooter(DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
Definition afpclient.c:1769
DSIGetStatus
unsigned int DSIGetStatus(CONN *conn)
Definition afpclient.c:440
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:1632
AFPGetForkParam
unsigned int AFPGetForkParam(CONN *conn, uint16_t fork, uint16_t bitmap)
Definition afpclient.c:2321
DSICloseSession
unsigned int DSICloseSession(CONN *conn)
Definition afpclient.c:459
AFPByteLock
unsigned int AFPByteLock(CONN *conn, uint16_t fork, int end, int mode, int offset, int size)
Definition afpclient.c:853
AFPGetSrvrInfo
unsigned int AFPGetSrvrInfo(CONN *conn)
Definition afpclient.c:775
AFPSetExtAttr
unsigned int AFPSetExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *pathname, char *attrname, char *data)
Definition afpclient.c:2706
AFPAddAPPL
unsigned int AFPAddAPPL(CONN *conn, uint16_t dt, int did, char *creator, uint32_t tag, char *name)
Definition afpclient.c:2376
AFPGetSrvrMsg
unsigned int AFPGetSrvrMsg(CONN *conn, uint16_t type, uint16_t bitmap)
Definition afpclient.c:797
AFPopenLogin
unsigned int AFPopenLogin(CONN *conn, const char *vers, const char *uam, const char *usr, const char *pwd)
Definition afpclient.c:477
AFPCloseVol
unsigned int AFPCloseVol(CONN *conn, uint16_t vol)
Definition afpclient.c:820
AFPOpenFork
uint16_t AFPOpenFork(CONN *conn, uint16_t vol, char type, uint16_t bitmap, int did, char *name, uint16_t access)
Definition afpclient.c:1884
AFPGetComment
unsigned int AFPGetComment(CONN *conn, uint16_t vol, int did, char *name)
Definition afpclient.c:1931
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:2432
AFPMapName
unsigned int AFPMapName(CONN *conn, char fn, char *name)
Definition afpclient.c:2093
AFPOpenVol
uint16_t AFPOpenVol(CONN *conn, char *vol, uint16_t bitmap)
Definition afpclient.c:990
AFPMapID
unsigned int AFPMapID(CONN *conn, char fn, int id)
Definition afpclient.c:2071
AFPCreateDir
unsigned int AFPCreateDir(CONN *conn, uint16_t vol, int did, char *name)
Definition afpclient.c:2288
AFPWriteHeader
unsigned int AFPWriteHeader(DSI *dsi, uint16_t fork, int offset, int size, char *data, char whence)
Definition afpclient.c:1737
AFPopenLoginExt
unsigned int AFPopenLoginExt(CONN *conn, const char *vers, const char *uam, const char *usr, const void *auth_info, size_t auth_info_len)
Definition afpclient.c:554
AFPLoginCont
unsigned int AFPLoginCont(CONN *conn, const void *auth_info, size_t auth_info_len)
Definition afpclient.c:662
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:2483
dsi_data_receive
int dsi_data_receive(DSI *x)
Definition afpclient.c:325
AFPChangePW
unsigned int AFPChangePW(CONN *conn, char *uam, char *usr, char *opwd, char *pwd)
Definition afpclient.c:695
AFPGetSrvrParms
unsigned int AFPGetSrvrParms(CONN *conn)
Definition afpclient.c:786
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:1855
dsi_cmd_receive
int dsi_cmd_receive(DSI *x)
Definition afpclient.c:319
AFPListExtAttr
unsigned int AFPListExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap, int maxsize, char *pathname)
Definition afpclient.c:2671
AFPBadPacket
unsigned int AFPBadPacket(CONN *conn, char fn, char *name)
Definition afpclient.c:2132
afp_filedir_pack
int afp_filedir_pack(CONN *conn, unsigned char *b, struct afp_filedir_parms *filedir, uint16_t rfbitmap, uint16_t rdbitmap)
Definition afpclient.c:1436
AFPRead
unsigned int AFPRead(CONN *conn, uint16_t fork, int offset, int size, char *data)
Definition afpclient.c:2203
AFPGetExtAttr
unsigned int AFPGetExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap, int maxsize, char *pathname, char *attrname)
Definition afpclient.c:2616
SendInit
void SendInit(DSI *dsi)
Definition afpclient.c:331
afp_volume_unpack
void afp_volume_unpack(struct afp_volume_parms *parms, unsigned char *b, uint16_t rbitmap)
Definition afpclient.c:1101
AFPReadHeader
unsigned int AFPReadHeader(DSI *dsi, uint16_t fork, int offset, int size, char *data)
Definition afpclient.c:2156
strp2cdup
char * strp2cdup(unsigned char *src)
Definition afpclient.c:1071
AFPFlushFork
unsigned int AFPFlushFork(CONN *conn, uint16_t fork)
Definition afpclient.c:979
AFPRead_ext
unsigned int AFPRead_ext(CONN *conn, uint16_t fork, off_t offset, off_t size, char *data)
Definition afpclient.c:2216
dump_header
void dump_header(DSI *dsi)
Definition afpcmd.c:489
u2mac
void u2mac(uint8_t *dst, char *name, int len)
Definition afpclient.c:1660
AFPDelete
unsigned int AFPDelete(CONN *conn, uint16_t vol, int did, char *name)
Definition afpclient.c:1924
AFPDisconnectOldSession
unsigned int AFPDisconnectOldSession(CONN *conn, uint16_t type, int len, char *token)
Definition afpclient.c:2018
AFPGetACL
unsigned int AFPGetACL(CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *name)
Definition afpclient.c:2537
AFPSetForkParam
unsigned int AFPSetForkParam(CONN *conn, uint16_t fork, uint16_t bitmap, off_t size)
Definition afpclient.c:942
FPset_name
int FPset_name(CONN *conn, int ofs, char *name)
Definition afpclient.c:1682
AFPzzz
unsigned int AFPzzz(CONN *conn, int)
Definition afpclient.c:754
AFPReadFooter
unsigned int AFPReadFooter(DSI *dsi, uint16_t fork, int offset, int size, char *data)
Definition afpclient.c:2182
AFPGetUserInfo
unsigned int AFPGetUserInfo(CONN *conn, char flag, int id, uint16_t bitmap)
Definition afpclient.c:2046
AFPCreateFile
unsigned int AFPCreateFile(CONN *conn, uint16_t vol, char type, int did, char *name)
Definition afpclient.c:1713
AFPCloseDT
unsigned int AFPCloseDT(CONN *conn, uint16_t vol)
Definition afpclient.c:831
AFPRead_ext_async
unsigned int AFPRead_ext_async(CONN *conn, uint16_t fork, off_t offset, off_t size, char *data)
Definition afpclient.c:2267
AFPGetVolParam
unsigned int AFPGetVolParam(CONN *conn, uint16_t vol, uint16_t bitmap)
Definition afpclient.c:1609
AFPLogOut
unsigned int AFPLogOut(CONN *conn)
Definition afpclient.c:742
AFPWrite_ext
unsigned int AFPWrite_ext(CONN *conn, uint16_t fork, off_t offset, off_t size, char *data, char whence)
Definition afpclient.c:1807
AFPRemoveComment
unsigned int AFPRemoveComment(CONN *conn, uint16_t vol, int did, char *name)
Definition afpclient.c:1938
AFPWrite
unsigned int AFPWrite(CONN *conn, uint16_t fork, int offset, int size, char *data, char whence)
Definition afpclient.c:1796
AFPopenLoginExt_pwd
unsigned int AFPopenLoginExt_pwd(CONN *conn, const char *vers, const char *uam, const char *usr, const char *pwd)
Definition afpclient.c:627
AFPRemoveExtAttr
unsigned int AFPRemoveExtAttr(CONN *conn, uint16_t vol, int did, uint16_t bitmap, char *pathname, char *attrname)
Definition afpclient.c:2757
AFPAddComment
unsigned int AFPAddComment(CONN *conn, uint16_t vol, int did, char *name, char *cmt)
Definition afpclient.c:1945
SetLen
void SetLen(DSI *dsi, int ofs)
Definition afpclient.c:341
CloseClientSocket
int CloseClientSocket(int fd)
Definition afpclient.c:70
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:2567
AFPGetSessionToken
unsigned int AFPGetSessionToken(CONN *conn, int type, uint32_t time, int len, char *token)
Definition afpclient.c:1979
afp_filedir_unpack
void afp_filedir_unpack(CONN *conn, struct afp_filedir_parms *filedir, const unsigned char *b, uint16_t rfbitmap, uint16_t rdbitmap)
Definition afpclient.c:1257
time
struct timeval time
config.h
data
#define data
Definition hash.c:38
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:176
CONN::afp_version
int afp_version
Definition afpclient.h:182
CONN::type
int type
Definition afpclient.h:181
CONN::login_cont_data
uint8_t login_cont_data[DSI_CMDSIZ]
Definition afpclient.h:189
CONN::login_cont_id
uint16_t login_cont_id
Definition afpclient.h:187
CONN::dsi
DSI dsi
Definition afpclient.h:177
CONN::login_cont_len
size_t login_cont_len
Definition afpclient.h:188
DSI
Definition include/atalk/dsi.h:58
afp_filedir_parms
Definition afpclient.h:208
afp_filedir_parms::offcnt
uint16_t offcnt
Definition afpclient.h:219
afp_filedir_parms::isdir
int isdir
Definition afpclient.h:209
afp_filedir_parms::attr
uint16_t attr
Definition afpclient.h:211
afp_filedir_parms::name_type
int name_type
Definition afpclient.h:226
afp_filedir_parms::cdate
uint32_t cdate
Definition afpclient.h:215
afp_filedir_parms::rflen
uint32_t rflen
Definition afpclient.h:216
afp_filedir_parms::sname
char * sname
Definition afpclient.h:228
afp_filedir_parms::mdate
uint32_t mdate
Definition afpclient.h:215
afp_filedir_parms::gid
uint32_t gid
Definition afpclient.h:220
afp_filedir_parms::utf8_name
char * utf8_name
Definition afpclient.h:229
afp_filedir_parms::finder_info
char finder_info[32]
Definition afpclient.h:225
afp_filedir_parms::bdate
uint32_t bdate
Definition afpclient.h:215
afp_filedir_parms::vid
uint16_t vid
Definition afpclient.h:212
afp_filedir_parms::pdinfo
uint8_t pdinfo[6]
Definition afpclient.h:223
afp_filedir_parms::ext_dflen
uint64_t ext_dflen
Definition afpclient.h:217
afp_filedir_parms::ext_rflen
uint64_t ext_rflen
Definition afpclient.h:218
afp_filedir_parms::did
uint32_t did
Definition afpclient.h:214
afp_filedir_parms::uid
uint32_t uid
Definition afpclient.h:220
afp_filedir_parms::dflen
uint32_t dflen
Definition afpclient.h:216
afp_filedir_parms::lname
char * lname
Definition afpclient.h:227
afp_filedir_parms::pdid
uint32_t pdid
Definition afpclient.h:213
afp_filedir_parms::unix_priv
uint32_t unix_priv
Definition afpclient.h:221
afp_filedir_parms::bitmap
uint16_t bitmap
Definition afpclient.h:210
afp_filedir_parms::access
uint8_t access[4]
Definition afpclient.h:222
afp_volume_parms
Definition afpclient.h:232
afp_volume_parms::flags
uint8_t flags
Definition afpclient.h:235
afp_volume_parms::vid
uint16_t vid
Definition afpclient.h:239
afp_volume_parms::state
uint8_t state
Definition afpclient.h:234
afp_volume_parms::mdate
uint32_t mdate
Definition afpclient.h:238
afp_volume_parms::attr
uint16_t attr
Definition afpclient.h:236
afp_volume_parms::btotal
uint32_t btotal
Definition afpclient.h:240
afp_volume_parms::cdate
uint32_t cdate
Definition afpclient.h:238
afp_volume_parms::bdate
uint32_t bdate
Definition afpclient.h:238
afp_volume_parms::utf8_name
char * utf8_name
Definition afpclient.h:242
afp_volume_parms::name
char * name
Definition afpclient.h:241
afp_volume_parms::bfree
uint32_t bfree
Definition afpclient.h:240
afp_volume_parms::sig
uint16_t sig
Definition afpclient.h:237
afp_volume_parms::bsize
uint32_t bsize
Definition afpclient.h:240
darwin_ace_t
Definition acls.h:105
darwin_ace
Definition afpclient.h:392
darwin_ace::darwin_ace_rights
uint32_t darwin_ace_rights
Definition afpclient.h:395
darwin_ace::darwin_ace_uuid
unsigned char darwin_ace_uuid[16]
Definition afpclient.h:393
darwin_ace::darwin_ace_flags
uint32_t darwin_ace_flags
Definition afpclient.h:394
vol
Definition include/atalk/volume.h:33
dsi.h
DSI (Data Stream Interface) protocol definitions for the test-suite.
DSI_CMDSIZ
#define DSI_CMDSIZ
Definition test/testsuite/dsi.h:57