]> arthur.barton.de Git - netatalk.git/blob - include/atalk/cnid_bdb_private.h
Writing metadata xattr on directories with sticky bit set, FR#94
[netatalk.git] / include / atalk / cnid_bdb_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 #define CNID_DBD_OP_SEARCH      0x0d
28 #define CNID_DBD_OP_WIPE        0x0e
29
30 #define CNID_DBD_RES_OK            0x00
31 #define CNID_DBD_RES_NOTFOUND      0x01
32 #define CNID_DBD_RES_ERR_DB        0x02
33 #define CNID_DBD_RES_ERR_MAX       0x03
34 #define CNID_DBD_RES_ERR_DUPLCNID  0x04
35 #define CNID_DBD_RES_SRCH_CNT      0x05
36 #define CNID_DBD_RES_SRCH_DONE     0x06
37
38 #define DBD_MAX_SRCH_RSLTS 100
39 #define DBD_NUM_OPEN_ARGS 3
40
41 struct cnid_dbd_rqst {
42     int     op;
43     cnid_t  cnid;
44     dev_t   dev;
45     ino_t   ino;
46     uint32_t type;
47     cnid_t  did;
48     const char *name;
49     size_t  namelen;
50 };
51
52 struct cnid_dbd_rply {
53     int     result;    
54     cnid_t  cnid;
55     cnid_t  did;
56     char    *name;
57     size_t  namelen;
58 };
59
60 typedef struct CNID_bdb_private {
61     struct vol *vol;
62     int       fd;               /* File descriptor to cnid_dbd */
63     char      stamp[ADEDLEN_PRIVSYN]; /* db timestamp */
64     char      *client_stamp;
65     size_t    stamp_size;
66     int       notfirst;   /* already open before */
67     int       changed;  /* stamp differ */
68 } CNID_bdb_private;
69
70
71 #endif /* include/atalk/cnid_dbd.h */