netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
cnid_private.h
Go to the documentation of this file.
1
5
6#ifndef _ATALK_CNID_PRIVATE_H
7#define _ATALK_CNID_PRIVATE_H 1
8
9#define CNID_OFS 0
10#define CNID_LEN 4
11
12#define CNID_DEV_OFS CNID_LEN
13#define CNID_DEV_LEN 8
14
15#define CNID_INO_OFS (CNID_DEV_OFS + CNID_DEV_LEN)
16#define CNID_INO_LEN 8
17
18#define CNID_DEVINO_OFS CNID_LEN
19#define CNID_DEVINO_LEN (CNID_DEV_LEN + CNID_INO_LEN)
20
21#define CNID_TYPE_OFS (CNID_DEVINO_OFS + CNID_DEVINO_LEN)
22#define CNID_TYPE_LEN 4
23
24#define CNID_DID_OFS (CNID_TYPE_OFS + CNID_TYPE_LEN)
25#define CNID_DID_LEN CNID_LEN
26
27#define CNID_NAME_OFS (CNID_DID_OFS + CNID_DID_LEN)
28#define CNID_HEADER_LEN (CNID_NAME_OFS)
29
30#define CNIDFLAG_ROOTINFO_RO (1 << 0)
31#define CNIDFLAG_DB_RO (1 << 1)
32
33/* special key/data pair we use to store current cnid and database stamp in cnid2.db */
34
35#define ROOTINFO_KEY "\0\0\0\0"
36#define ROOTINFO_KEYLEN 4
37
55#define ROOTINFO_DATA "\0\0\0\0" \
56 "\0\0\0\0\0\0\0\0" \
57 "\0\0\0\0\0\0\0\0" \
58 "\0\0\0\0" \
59 "\0\0\0\0" \
60 "RootInfo"
61#define ROOTINFO_DATALEN (3*4 + 2*8 + 9)
62
63/*
64 * CNID version history:
65 * 0: up to Netatalk 2.1.x
66 * 1: starting with 2.2, additional name index, used in cnid_find
67 */
68#define CNID_VERSION_0 0
69#define CNID_VERSION_1 1
70#define CNID_VERSION_UNINTIALIZED_DB UINT32_MAX
71
72/* Current CNID version */
73#define CNID_VERSION CNID_VERSION_1
74
75#endif