]> arthur.barton.de Git - netatalk.git/blob - include/atalk/cnid_dbd_private.h
Convert afp_moveandrename and all called funcs to XXXat semantics if available
[netatalk.git] / include / atalk / cnid_dbd_private.h
1 /*
2  *  Interface to the cnid_dbd daemon that stores/retrieves CNIDs from a database.
3  */
4
5
6 #ifndef _ATALK_CNID_DBD_PRIVATE_H
7 #define _ATALK_CNID_DBD_PRIVATE_H 1
8
9 #include <sys/stat.h>
10 #include <atalk/adouble.h>
11 #include <sys/param.h>
12
13 #include <atalk/cnid_private.h>
14
15 #define CNID_DBD_OP_OPEN        0x01
16 #define CNID_DBD_OP_CLOSE       0x02
17 #define CNID_DBD_OP_ADD         0x03
18 #define CNID_DBD_OP_GET         0x04
19 #define CNID_DBD_OP_RESOLVE     0x05
20 #define CNID_DBD_OP_LOOKUP      0x06
21 #define CNID_DBD_OP_UPDATE      0x07
22 #define CNID_DBD_OP_DELETE      0x08
23 #define CNID_DBD_OP_MANGLE_ADD  0x09
24 #define CNID_DBD_OP_MANGLE_GET  0x0a
25 #define CNID_DBD_OP_GETSTAMP    0x0b
26 #define CNID_DBD_OP_REBUILD_ADD 0x0c
27
28 #define CNID_DBD_RES_OK            0x00
29 #define CNID_DBD_RES_NOTFOUND      0x01
30 #define CNID_DBD_RES_ERR_DB        0x02
31 #define CNID_DBD_RES_ERR_MAX       0x03
32 #define CNID_DBD_RES_ERR_DUPLCNID  0x04
33
34 struct cnid_dbd_rqst {
35     int     op;
36     cnid_t  cnid;
37     dev_t   dev;
38     ino_t   ino;
39     u_int32_t type;
40     cnid_t  did;
41     char   *name;
42     size_t  namelen;
43 };
44
45 struct cnid_dbd_rply {
46     int     result;    
47     cnid_t  cnid;
48     cnid_t  did;
49     char   *name;
50     size_t  namelen;
51 };
52
53 typedef struct CNID_private {
54     u_int32_t magic;
55     char      db_dir[MAXPATHLEN + 1]; /* Database directory without /.AppleDB appended */
56     int       fd;               /* File descriptor to cnid_dbd */
57     char      stamp[ADEDLEN_PRIVSYN]; /* db timestamp */
58     char      *client_stamp;
59     size_t    stamp_size;
60     int       notfirst;   /* already open before */
61     int       changed;  /* stamp differ */
62 } CNID_private;
63
64
65 #endif /* include/atalk/cnid_dbd.h */