netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
cnid_bdb_private.h
Go to the documentation of this file.
1
12
13
14#ifndef _ATALK_CNID_DBD_PRIVATE_H
15#define _ATALK_CNID_DBD_PRIVATE_H 1
16
17#include <sys/param.h>
18#include <sys/stat.h>
19
20#include <atalk/adouble.h>
21#include <atalk/cnid_private.h>
22
23#define CNID_DBD_OP_OPEN 0x01
24#define CNID_DBD_OP_CLOSE 0x02
25#define CNID_DBD_OP_ADD 0x03
26#define CNID_DBD_OP_GET 0x04
27#define CNID_DBD_OP_RESOLVE 0x05
28#define CNID_DBD_OP_LOOKUP 0x06
29#define CNID_DBD_OP_UPDATE 0x07
30#define CNID_DBD_OP_DELETE 0x08
31#define CNID_DBD_OP_MANGLE_ADD 0x09
32#define CNID_DBD_OP_MANGLE_GET 0x0a
33#define CNID_DBD_OP_GETSTAMP 0x0b
34#define CNID_DBD_OP_REBUILD_ADD 0x0c
35#define CNID_DBD_OP_SEARCH 0x0d
36#define CNID_DBD_OP_WIPE 0x0e
37
38#define CNID_DBD_RES_OK 0x00
39#define CNID_DBD_RES_NOTFOUND 0x01
40#define CNID_DBD_RES_ERR_DB 0x02
41#define CNID_DBD_RES_ERR_MAX 0x03
42#define CNID_DBD_RES_ERR_DUPLCNID 0x04
43#define CNID_DBD_RES_SRCH_CNT 0x05
44#define CNID_DBD_RES_SRCH_DONE 0x06
45
46/* DBD_MAX_SRCH_RSLTS is the wire-protocol maximum batch size for the
47 * SEARCH op. It must equal CNID_FIND_MIN_RESULTS in <atalk/cnid.h>;
48 * the wrapper's lower-bound buflen check uses the latter so that the
49 * sqlite/mysql backends do not have to include this DBD-private header. */
50#define DBD_MAX_SRCH_RSLTS 100
51#define DBD_SEARCH_MAX_OFFSET 50000
52#define DBD_FIND_DEADLINE_SEC 10
53#define DBD_NUM_OPEN_ARGS 3
54
55/* NOTE: Spotlight's per-term minimum length (formerly named
56 * DBD_SEARCH_MIN_NAMELEN here) is intentionally NOT defined in this
57 * header. It is a Spotlight-backend policy, not a DBD wire-protocol
58 * constant; placing it here would force etc/spotlight/cnid/sl_cnid.c
59 * to include this DBD-private header. The constant lives as
60 * `SL_CNID_MIN_TERMLEN` inside etc/spotlight/cnid/sl_cnid.c */
61
62 struct cnid_dbd_rqst {
63 int op;
64 cnid_t cnid;
65 dev_t dev;
66 ino_t ino;
67 uint32_t type;
68 cnid_t did;
69 const char *name;
70 size_t namelen;
71};
72
73 struct cnid_dbd_rply {
74 int result;
75 cnid_t cnid;
76 cnid_t did;
77 char *name;
78 size_t namelen;
79};
80
81 typedef struct CNID_bdb_private {
82 struct vol *vol;
83 int fd;
84 char stamp[ADEDLEN_PRIVSYN];
85 char *client_stamp;
86 size_t stamp_size;
87 int notfirst;
88 int changed;
89} CNID_bdb_private;
90
91
92#endif /* include/atalk/cnid_dbd.h */
adouble.h
Part of Netatalk's AppleDouble implementatation.
ADEDLEN_PRIVSYN
#define ADEDLEN_PRIVSYN
Definition adouble.h:112
cnid_t
uint32_t cnid_t
Definition adouble.h:156
cnid_private.h
CNID_bdb_private
Definition cnid_bdb_private.h:81
CNID_bdb_private::stamp
char stamp[ADEDLEN_PRIVSYN]
Definition cnid_bdb_private.h:84
CNID_bdb_private::changed
int changed
Definition cnid_bdb_private.h:88
CNID_bdb_private::notfirst
int notfirst
Definition cnid_bdb_private.h:87
CNID_bdb_private::client_stamp
char * client_stamp
Definition cnid_bdb_private.h:85
CNID_bdb_private::vol
struct vol * vol
Definition cnid_bdb_private.h:82
CNID_bdb_private::fd
int fd
Definition cnid_bdb_private.h:83
CNID_bdb_private::stamp_size
size_t stamp_size
Definition cnid_bdb_private.h:86
cnid_dbd_rply
Definition cnid_bdb_private.h:73
cnid_dbd_rply::name
char * name
Definition cnid_bdb_private.h:77
cnid_dbd_rply::cnid
cnid_t cnid
Definition cnid_bdb_private.h:75
cnid_dbd_rply::did
cnid_t did
Definition cnid_bdb_private.h:76
cnid_dbd_rply::namelen
size_t namelen
Definition cnid_bdb_private.h:78
cnid_dbd_rply::result
int result
Definition cnid_bdb_private.h:74
cnid_dbd_rqst
Definition cnid_bdb_private.h:62
cnid_dbd_rqst::namelen
size_t namelen
Definition cnid_bdb_private.h:70
cnid_dbd_rqst::ino
ino_t ino
Definition cnid_bdb_private.h:66
cnid_dbd_rqst::did
cnid_t did
Definition cnid_bdb_private.h:68
cnid_dbd_rqst::name
const char * name
Definition cnid_bdb_private.h:69
cnid_dbd_rqst::cnid
cnid_t cnid
Definition cnid_bdb_private.h:64
cnid_dbd_rqst::type
uint32_t type
Definition cnid_bdb_private.h:67
cnid_dbd_rqst::dev
dev_t dev
Definition cnid_bdb_private.h:65
cnid_dbd_rqst::op
int op
Definition cnid_bdb_private.h:63