netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
cnid_dbd.h File Reference
`#include <arpa/inet.h>`
`#include <stdbool.h>`
`#include <string.h>`
`#include <sys/stat.h>`
`#include <unistd.h>`
`#include <atalk/cnid.h>`

Go to the source code of this file.

## Functions
struct _cnid_db * | cnid_dbd_open (struct cnid_open_args *args)
void | cnid_dbd_close (struct _cnid_db *)
cnid_t | cnid_dbd_add (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t, cnid_t)
cnid_t | cnid_dbd_get (struct _cnid_db *, cnid_t, const char *, size_t)
char * | cnid_dbd_resolve (struct _cnid_db *, cnid_t *, void *, size_t)
int | cnid_dbd_getstamp (struct _cnid_db *, void *, const size_t)
cnid_t | cnid_dbd_lookup (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t)
int | cnid_dbd_find (struct _cnid_db *cdb, const char *name, size_t namelen, void *buffer, size_t buflen, bool *more_available)
| Backend implementation of cnid_find() for the DBD daemon backend.
int | cnid_dbd_update (struct _cnid_db *, cnid_t, const struct stat *, cnid_t, const char *, size_t)
int | cnid_dbd_delete (struct _cnid_db *, const cnid_t)
cnid_t | cnid_dbd_rebuild_add (struct _cnid_db *, const struct stat *, cnid_t, const char *, size_t, cnid_t)
int | cnid_dbd_wipe (struct _cnid_db *cdb)

## Variables
struct _cnid_module | cnid_dbd_module

## Function Documentation

## ◆ cnid_dbd_add()

cnid_t cnid_dbd_add | ( | struct _cnid_db * | cdb,
|  | const struct stat * | st,
|  | cnid_t | did,
|  | const char * | name,
|  | size_t | len,
|  | cnid_t | hint )
| extern

## ◆ cnid_dbd_close()

void cnid_dbd_close | ( | struct _cnid_db * | cdb | ) |
| extern

## ◆ cnid_dbd_delete()

int cnid_dbd_delete | ( | struct _cnid_db * | cdb,
|  | const cnid_t | id )
| extern

## ◆ cnid_dbd_find()

int cnid_dbd_find | ( | struct _cnid_db * | cdb,
|  | const char * | name,
|  | size_t | namelen,
|  | void * | buffer,
|  | size_t | buflen,
|  | bool * | more_available )
| extern

Backend implementation of cnid_find() for the DBD daemon backend.

Parameter validation is performed once in the wrapper at libatalk/cnid/cnid.c. This function trusts that cdb, name, namelen, buffer and buflen are sane and focuses on driving the paginated SEARCH RPC to cnid_dbd.

The single cleanup path (goto out) ensures signal-handler restoration and more_available write-back happen in exactly one place — every error arm goes through it. *more_available is set to true if the result set was truncated by the daemon offset cap, the wall-clock deadline, signal-induced abort, or the buffer-fit guard; written only on success (the wrapper has already pre-zeroed it for error paths).

## ◆ cnid_dbd_get()

cnid_t cnid_dbd_get | ( | struct _cnid_db * | cdb,
|  | cnid_t | did,
|  | const char * | name,
|  | size_t | len )
| extern

## ◆ cnid_dbd_getstamp()

int cnid_dbd_getstamp | ( | struct _cnid_db * | cdb,
|  | void * | buffer,
|  | const size_t | len )
| extern

Caller passes buffer where we will store the db stamp

## ◆ cnid_dbd_lookup()

cnid_t cnid_dbd_lookup | ( | struct _cnid_db * | cdb,
|  | const struct stat * | st,
|  | cnid_t | did,
|  | const char * | name,
|  | size_t | len )
| extern

## ◆ cnid_dbd_open()

struct _cnid_db * cnid_dbd_open | ( | struct cnid_open_args * | args | ) |
| extern

## ◆ cnid_dbd_rebuild_add()

cnid_t cnid_dbd_rebuild_add | ( | struct _cnid_db * | cdb,
|  | const struct stat * | st,
|  | cnid_t | did,
|  | const char * | name,
|  | size_t | len,
|  | cnid_t | hint )
| extern

## ◆ cnid_dbd_resolve()

char * cnid_dbd_resolve | ( | struct _cnid_db * | cdb,
|  | cnid_t * | id,
|  | void * | buffer,
|  | size_t | len )
| extern

## ◆ cnid_dbd_update()

int cnid_dbd_update | ( | struct _cnid_db * | cdb,
|  | cnid_t | id,
|  | const struct stat * | st,
|  | cnid_t | did,
|  | const char * | name,
|  | size_t | len )
| extern

## ◆ cnid_dbd_wipe()

int cnid_dbd_wipe | ( | struct _cnid_db * | cdb | ) |
| extern

## Variable Documentation

## ◆ cnid_dbd_module

struct _cnid_module cnid_dbd_module
| extern