netatalk: globals.h File Reference

netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
globals.h File Reference
`#include <grp.h>`
`#include <iniparser.h>`
`#include <netdb.h>`
`#include <stdbool.h>`
`#include <sys/param.h>`
`#include <sys/types.h>`
`#include <netatalk/at.h>`
`#include <atalk/afp.h>`
`#include <atalk/compat.h>`
`#include <atalk/uam.h>`
`#include <atalk/unicode.h>`
`#include <atalk/afp_dtrace.h>`

Go to the source code of this file.

## Data Structures
struct | afp_volume_name
struct | afp_options
struct | AFPObj

## Macros
#define | MACFILELEN 31
#define | UTF8FILELEN_EARLY 255
#define | MAXUSERLEN 256
#define | MAXOPTLEN 256
#define | CNID_PATH_OVERHEAD 12 /* CNID protocol header size for path resolution */
#define | CNID_MAX_PATH_LEN (CNID_PATH_OVERHEAD + MAXPATHLEN + 1) /* Maximum path length for CNID operations */
#define | DEFAULT_MAX_DIRCACHE_SIZE 8192
#define | DEFAULT_DIRCACHE_VALIDATION_FREQ 1
#define | OPTION_DEBUG (1 << 0)
#define | OPTION_CLOSEVOL (1 << 1)
#define | OPTION_SERVERNOTIF (1 << 2)
#define | OPTION_NOSENDFILE (1 << 3)
#define | OPTION_VETOMSG (1 << 4)
#define | OPTION_AFP_READ_LOCK (1 << 5)
#define | OPTION_ANNOUNCESSH (1 << 6)
#define | OPTION_UUID (1 << 7)
#define | OPTION_ACL2MACCESS (1 << 8)
#define | OPTION_NOZEROCONF (1 << 9)
#define | OPTION_ACL2MODE (1 << 10)
#define | OPTION_SHARE_RESERV (1 << 11)
#define | OPTION_AFPSTATS (1 << 12)
#define | OPTION_SPOTLIGHT (1 << 13)
#define | OPTION_SPOTLIGHT_VOL (1 << 14)
#define | OPTION_RECVFILE (1 << 15)
#define | OPTION_SPOTLIGHT_EXPR (1 << 16)
#define | OPTION_DDP (1 << 17)
#define | OPTION_VALID_SHELLCHECK (1 << 18)
#define | PASSWD_NONE 0
#define | PASSWD_SET (1 << 0)
#define | PASSWD_NOSAVE (1 << 1)
#define | PASSWD_ALL (PASSWD_SET | PASSWD_NOSAVE)
#define | IS_AFP_SESSION(obj)
#define | AFPOBJ_TMPSIZ (MAXPATHLEN)
#define | RFORK_BUDGET_MAX_KB (10 * 1024 * 1024)
#define | RFORK_ENTRY_MAX_KB (10 * 1024)

## Typedefs
typedef struct AFPObj | AFPObj
typedef int(* | AFPCmd) (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)

## Functions
int | get_afp_errno (const int param)
void | afp_options_init (struct afp_options *)
void | afp_options_parse_cmdline (AFPObj *obj, int ac, char **av)
int | setmessage (const char *)
| Copy AFP message to message buffer.
void | readmessage (AFPObj *)
void | afp_over_asp (AFPObj *)
void | afp_over_dsi (AFPObj *)
void | afp_over_dsi_sighandlers (AFPObj *obj)

## Variables
AFPObj * | AFPobj
int | afp_version
int | afp_errno
unsigned char | nologin
struct dir * | curdir
char | getwdbuf []
struct afp_options | default_options
const char * | Cnid_srv
const char * | Cnid_port

## Macro Definition Documentation

## ◆ AFPOBJ_TMPSIZ

#define AFPOBJ_TMPSIZ (MAXPATHLEN)

## ◆ CNID_MAX_PATH_LEN

#define CNID_MAX_PATH_LEN (CNID_PATH_OVERHEAD + MAXPATHLEN + 1) /* Maximum path length for CNID operations */

## ◆ CNID_PATH_OVERHEAD

#define CNID_PATH_OVERHEAD 12 /* CNID protocol header size for path resolution */

## ◆ DEFAULT_DIRCACHE_VALIDATION_FREQ

#define DEFAULT_DIRCACHE_VALIDATION_FREQ 1

Validate every Nth access (default 1 for backward compatibility)

## ◆ DEFAULT_MAX_DIRCACHE_SIZE

#define DEFAULT_MAX_DIRCACHE_SIZE 8192

## ◆ IS_AFP_SESSION

#define IS_AFP_SESSION | ( |  | obj | ) |

Value:
(((obj)->dsi && (obj)->dsi->serversock == -1) || ((obj)->Type))
obj
static AFPObj obj
Definition netatalk.c:69

## ◆ MACFILELEN

#define MACFILELEN 31

Type2, HFS-compat

## ◆ MAXOPTLEN

#define MAXOPTLEN 256

## ◆ MAXUSERLEN

#define MAXUSERLEN 256

## ◆ OPTION_ACL2MACCESS

#define OPTION_ACL2MACCESS (1 << 8)

## ◆ OPTION_ACL2MODE

#define OPTION_ACL2MODE (1 << 10)

## ◆ OPTION_AFP_READ_LOCK

#define OPTION_AFP_READ_LOCK (1 << 5)

whether to do AFP spec conforming read locks (default: no)

## ◆ OPTION_AFPSTATS

#define OPTION_AFPSTATS (1 << 12)

whether to expose afpstats Unix socket

## ◆ OPTION_ANNOUNCESSH

#define OPTION_ANNOUNCESSH (1 << 6)

## ◆ OPTION_CLOSEVOL

#define OPTION_CLOSEVOL (1 << 1)

## ◆ OPTION_DDP

#define OPTION_DDP (1 << 17)

whether to allow connections via appletalk/ddp

## ◆ OPTION_DEBUG

#define OPTION_DEBUG (1 << 0)

## ◆ OPTION_NOSENDFILE

#define OPTION_NOSENDFILE (1 << 3)

## ◆ OPTION_NOZEROCONF

#define OPTION_NOZEROCONF (1 << 9)

## ◆ OPTION_RECVFILE

#define OPTION_RECVFILE (1 << 15)

## ◆ OPTION_SERVERNOTIF

#define OPTION_SERVERNOTIF (1 << 2)

## ◆ OPTION_SHARE_RESERV

#define OPTION_SHARE_RESERV (1 << 11)

whether to use Solaris fcntl F_SHARE locks

## ◆ OPTION_SPOTLIGHT

#define OPTION_SPOTLIGHT (1 << 13)

whether to initialize Spotlight support

## ◆ OPTION_SPOTLIGHT_EXPR

#define OPTION_SPOTLIGHT_EXPR (1 << 16)

whether to allow Spotlight logic expressions

## ◆ OPTION_SPOTLIGHT_VOL

#define OPTION_SPOTLIGHT_VOL (1 << 14)

whether spotlight shall be enabled by default for volumes

## ◆ OPTION_UUID

#define OPTION_UUID (1 << 7)

## ◆ OPTION_VALID_SHELLCHECK

#define OPTION_VALID_SHELLCHECK (1 << 18)

whether to check for valid login shell

## ◆ OPTION_VETOMSG

#define OPTION_VETOMSG (1 << 4)

whether to send an AFP message for veto file access

## ◆ PASSWD_ALL

#define PASSWD_ALL (PASSWD_SET | PASSWD_NOSAVE)

## ◆ PASSWD_NONE

#define PASSWD_NONE 0

## ◆ PASSWD_NOSAVE

#define PASSWD_NOSAVE (1 << 1)

## ◆ PASSWD_SET

#define PASSWD_SET (1 << 0)

## ◆ RFORK_BUDGET_MAX_KB

#define RFORK_BUDGET_MAX_KB (10 * 1024 * 1024)

Hard cap: 10 GB in KB

## ◆ RFORK_ENTRY_MAX_KB

#define RFORK_ENTRY_MAX_KB (10 * 1024)

Hard cap: 10 MB in KB

## ◆ UTF8FILELEN_EARLY

#define UTF8FILELEN_EARLY 255

Type3, early Mac OS X 10.0-10.4.?

## Typedef Documentation

## ◆ AFPCmd

typedef int(* AFPCmd) (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)

typedef for AFP functions handlers

## ◆ AFPObj

typedef struct AFPObj AFPObj

## Function Documentation

## ◆ afp_options_init()

void afp_options_init | ( | struct afp_options * |  | ) |
| extern

## ◆ afp_options_parse_cmdline()

void afp_options_parse_cmdline | ( | AFPObj * | obj,
|  | int | ac,
|  | char ** | av )
| extern

## ◆ afp_over_asp()

void afp_over_asp | ( | AFPObj * | obj | ) |
| extern

## ◆ afp_over_dsi()

void afp_over_dsi | ( | AFPObj * | obj | ) |
| extern

## ◆ afp_over_dsi_sighandlers()

void afp_over_dsi_sighandlers | ( | AFPObj * | obj | ) |
| extern

## ◆ get_afp_errno()

int get_afp_errno | ( | const int | param | ) |
| extern

## ◆ readmessage()

void readmessage | ( | AFPObj * | obj | ) |
| extern

## ◆ setmessage()

int setmessage | ( | const char * | message | ) |
| extern

Copy AFP message to message buffer.

Parameters

  [in] | message | message to send

Returns
  0 if this message is being set the first time, return 1 if the preceeding message was the same

## Variable Documentation

## ◆ afp_errno

int afp_errno
| extern

## ◆ afp_version

int afp_version
| extern

## ◆ AFPobj

AFPObj* AFPobj
| extern

We generally pass this from afp_over_dsi to all afp_* funcs, so it should already be available everywhere. Unfortunately some funcs (eg acltoownermode) need acces to it but are deeply nested in the function chain with the caller already without acces to it. Changing this would require adding a reference to the caller which itself might be called in many places (eg acltoownermode is called from accessmode). The only sane way out is providing a copy of it here:

## ◆ Cnid_port

const char* Cnid_port
| extern

## ◆ Cnid_srv

const char* Cnid_srv
| extern

## ◆ curdir

struct dir* curdir
| extern

## ◆ default_options

struct afp_options default_options
| extern

## ◆ getwdbuf

char getwdbuf[]
| extern

## ◆ nologin

unsigned char nologin
| extern