netatalk: cnid_private.h File Reference

netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
cnid_private.h File Reference

Go to the source code of this file.

## Macros
#define | CNID_OFS 0
#define | CNID_LEN 4
#define | CNID_DEV_OFS CNID_LEN
#define | CNID_DEV_LEN 8
#define | CNID_INO_OFS (CNID_DEV_OFS + CNID_DEV_LEN)
#define | CNID_INO_LEN 8
#define | CNID_DEVINO_OFS CNID_LEN
#define | CNID_DEVINO_LEN (CNID_DEV_LEN + CNID_INO_LEN)
#define | CNID_TYPE_OFS (CNID_DEVINO_OFS + CNID_DEVINO_LEN)
#define | CNID_TYPE_LEN 4
#define | CNID_DID_OFS (CNID_TYPE_OFS + CNID_TYPE_LEN)
#define | CNID_DID_LEN CNID_LEN
#define | CNID_NAME_OFS (CNID_DID_OFS + CNID_DID_LEN)
#define | CNID_HEADER_LEN (CNID_NAME_OFS)
#define | CNIDFLAG_ROOTINFO_RO (1 << 0)
#define | CNIDFLAG_DB_RO (1 << 1)
#define | ROOTINFO_KEY "\0\0\0\0"
#define | ROOTINFO_KEYLEN 4
#define | ROOTINFO_DATA
#define | ROOTINFO_DATALEN (3*4 + 2*8 + 9)
#define | CNID_VERSION_0 0
#define | CNID_VERSION_1 1
#define | CNID_VERSION_UNINTIALIZED_DB UINT32_MAX
#define | CNID_VERSION CNID_VERSION_1

## Detailed Description

Common defines for cnid

## Macro Definition Documentation

## ◆ CNID_DEV_LEN

#define CNID_DEV_LEN 8

## ◆ CNID_DEV_OFS

#define CNID_DEV_OFS CNID_LEN

## ◆ CNID_DEVINO_LEN

#define CNID_DEVINO_LEN (CNID_DEV_LEN + CNID_INO_LEN)

## ◆ CNID_DEVINO_OFS

#define CNID_DEVINO_OFS CNID_LEN

## ◆ CNID_DID_LEN

#define CNID_DID_LEN CNID_LEN

## ◆ CNID_DID_OFS

#define CNID_DID_OFS (CNID_TYPE_OFS + CNID_TYPE_LEN)

## ◆ CNID_HEADER_LEN

#define CNID_HEADER_LEN (CNID_NAME_OFS)

## ◆ CNID_INO_LEN

#define CNID_INO_LEN 8

## ◆ CNID_INO_OFS

#define CNID_INO_OFS (CNID_DEV_OFS + CNID_DEV_LEN)

## ◆ CNID_LEN

#define CNID_LEN 4

## ◆ CNID_NAME_OFS

#define CNID_NAME_OFS (CNID_DID_OFS + CNID_DID_LEN)

## ◆ CNID_OFS

#define CNID_OFS 0

## ◆ CNID_TYPE_LEN

#define CNID_TYPE_LEN 4

## ◆ CNID_TYPE_OFS

#define CNID_TYPE_OFS (CNID_DEVINO_OFS + CNID_DEVINO_LEN)

## ◆ CNID_VERSION

#define CNID_VERSION CNID_VERSION_1

## ◆ CNID_VERSION_0

#define CNID_VERSION_0 0

## ◆ CNID_VERSION_1

#define CNID_VERSION_1 1

## ◆ CNID_VERSION_UNINTIALIZED_DB

#define CNID_VERSION_UNINTIALIZED_DB UINT32_MAX

## ◆ CNIDFLAG_DB_RO

#define CNIDFLAG_DB_RO (1 << 1)

## ◆ CNIDFLAG_ROOTINFO_RO

#define CNIDFLAG_ROOTINFO_RO (1 << 0)

## ◆ ROOTINFO_DATA

#define ROOTINFO_DATA

Value:
"\0\0\0\0" \
"\0\0\0\0\0\0\0\0" \
"\0\0\0\0\0\0\0\0" \
"\0\0\0\0" \
"\0\0\0\0" \
"RootInfo"

Rootinfo data, fields as they are used by normal entries for CNIDs (for reference):

- 4 bytes: CNID
- 8 bytes: dev
- 8 bytes: inode
- 4 bytes: is a file/directory (type)
- 4 bytes: DID
- x bytes: name

Contents in Rootinfo entry:

- 4 bytes: 0
- 8 bytes: db stamp: struct stat.st_ctime of database file
- 8 bytes: unused
- 4 bytes: last used CNID
- 4 bytes: version as htonl(uint32_t)
- 9 bytes: name "RootInfo"

## ◆ ROOTINFO_DATALEN

#define ROOTINFO_DATALEN (3*4 + 2*8 + 9)

## ◆ ROOTINFO_KEY

#define ROOTINFO_KEY "\0\0\0\0"

## ◆ ROOTINFO_KEYLEN

#define ROOTINFO_KEYLEN 4