netatalk  4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
afphelper.h File Reference
#include <inttypes.h>
#include "dsi.h"

Go to the source code of this file.

Macros

#define AFP_LOG_DEBUG   0
 
#define AFP_LOG_INFO   1
 
#define AFP_LOG_WARNING   2
 
#define AFP_LOG_ERROR   3
 
#define AFP_LOG_CRITICAL   4
 
#define AFP_LOG_MAX   5
 
#define AFP_PRINTF(level, fmt, ...)   afp_printf(level, Loglevel, Color, fmt, ##__VA_ARGS__)
 
#define BITERR_NOOBJ   (1 << 0)
 
#define BITERR_NODIR   (1 << 1)
 
#define BITERR_PARAM   (1 << 2)
 
#define BITERR_BUSY   (1 << 3)
 
#define BITERR_BADTYPE   (1 << 4)
 
#define BITERR_NOITEM   (1 << 5)
 
#define BITERR_DENYCONF   (1 << 6)
 
#define BITERR_NFILE   (1 << 7)
 
#define BITERR_ACCESS   (1 << 8)
 
#define BITERR_NOID   (1 << 9)
 
#define BITERR_BITMAP   (1 << 10)
 
#define BITERR_MISC   (1 << 11)
 

Typedefs

typedef struct CONN CONN
 

Functions

void afp_printf (int level, int loglevel, int color, const char *fmt,...)
 
void illegal_fork (DSI *dsi, char cmd, char *name)
 
int no_access_folder (uint16_t vol, int did, char *name)
 Use the second user for creating a folder with no access right.
 
int read_only_folder (uint16_t vol, int did, char *name)
 Use the second user for creating a folder with read only access right.
 
int delete_folder (uint16_t vol, int did, char *name)
 
int get_did (CONN *conn, uint16_t vol, int dir, char *name)
 
int get_fid (CONN *conn, uint16_t vol, int dir, char *name)
 
uint32_t get_forklen (DSI *dsi, int type)
 
void write_fork (CONN *conn, uint16_t vol, int dir, char *name, char *data)
 
void read_fork (CONN *conn, uint16_t vol, int dir, char *name, int len)
 
int read_only_folder_with_file (uint16_t vol, int did, char *name, char *file)
 Use the second user for creating a folder with read only access right.
 
int delete_folder_with_file (uint16_t vol, int did, char *name, char *file)
 
int get_vol_attrib (uint16_t vol)
 
int group_folder (uint16_t vol, int did, char *name)
 
unsigned int get_vol_free (uint16_t vol)
 
int not_valid (unsigned int ret, int mac_error, int afpd_error)
 
int not_valid_bitmap (unsigned int ret, unsigned int bitmap, int afpd_error)
 
int32_t is_there (CONN *conn, uint16_t volume, int32_t did, char *name)
 
int delete_directory_tree_by_did (CONN *conn, uint16_t volume, uint32_t dir_id)
 depth-first recursively delete a directory tree by DID
 
int delete_directory_tree (CONN *conn, uint16_t volume, uint32_t parent_did, char *dirname)
 depth-first recursively delete a directory tree by parent DID and name
 
void clear_volume (uint16_t vol, CONN *conn)
 

Macro Definition Documentation

◆ AFP_LOG_CRITICAL

#define AFP_LOG_CRITICAL   4

◆ AFP_LOG_DEBUG

#define AFP_LOG_DEBUG   0

◆ AFP_LOG_ERROR

#define AFP_LOG_ERROR   3

◆ AFP_LOG_INFO

#define AFP_LOG_INFO   1

◆ AFP_LOG_MAX

#define AFP_LOG_MAX   5

◆ AFP_LOG_WARNING

#define AFP_LOG_WARNING   2

◆ AFP_PRINTF

#define AFP_PRINTF (   level,
  fmt,
  ... 
)    afp_printf(level, Loglevel, Color, fmt, ##__VA_ARGS__)

◆ BITERR_ACCESS

#define BITERR_ACCESS   (1 << 8)

◆ BITERR_BADTYPE

#define BITERR_BADTYPE   (1 << 4)

◆ BITERR_BITMAP

#define BITERR_BITMAP   (1 << 10)

◆ BITERR_BUSY

#define BITERR_BUSY   (1 << 3)

◆ BITERR_DENYCONF

#define BITERR_DENYCONF   (1 << 6)

◆ BITERR_MISC

#define BITERR_MISC   (1 << 11)

◆ BITERR_NFILE

#define BITERR_NFILE   (1 << 7)

◆ BITERR_NODIR

#define BITERR_NODIR   (1 << 1)

◆ BITERR_NOID

#define BITERR_NOID   (1 << 9)

◆ BITERR_NOITEM

#define BITERR_NOITEM   (1 << 5)

◆ BITERR_NOOBJ

#define BITERR_NOOBJ   (1 << 0)

◆ BITERR_PARAM

#define BITERR_PARAM   (1 << 2)

Typedef Documentation

◆ CONN

typedef struct CONN CONN

Function Documentation

◆ afp_printf()

void afp_printf ( int  level,
int  loglevel,
int  color,
const char *  fmt,
  ... 
)
extern

◆ clear_volume()

void clear_volume ( uint16_t  vol,
CONN conn 
)
extern

◆ delete_directory_tree()

int delete_directory_tree ( CONN conn,
uint16_t  volume,
uint32_t  parent_did,
char *  dirname 
)
extern

depth-first recursively delete a directory tree by parent DID and name

Resolves the starting directory once, then deletes descendants by DID so cleanup does not depend on round-tripping mangled long names from enumerate.

Parameters
connAFP connection
volumeVolume ID
parent_didParent directory ID
dirnameDirectory name to delete
Returns
0 on success, -1 on failure

◆ delete_directory_tree_by_did()

int delete_directory_tree_by_did ( CONN conn,
uint16_t  volume,
uint32_t  dir_id 
)
extern

depth-first recursively delete a directory tree by DID

Parameters
connAFP connection
volumeVolume ID
dir_idDirectory ID to delete
Returns
0 on success, -1 on failure

◆ delete_folder()

int delete_folder ( uint16_t  vol,
int  did,
char *  name 
)
extern
Note
We need to set rw perm first for .AppleDouble

◆ delete_folder_with_file()

int delete_folder_with_file ( uint16_t  vol,
int  did,
char *  name,
char *  file 
)
extern
Note
We need to set rw perm first for .AppleDouble

◆ get_did()

int get_did ( CONN conn,
uint16_t  vol,
int  dir,
char *  name 
)
extern

◆ get_fid()

int get_fid ( CONN conn,
uint16_t  vol,
int  dir,
char *  name 
)
extern

◆ get_forklen()

uint32_t get_forklen ( DSI dsi,
int  type 
)
extern

◆ get_vol_attrib()

int get_vol_attrib ( uint16_t  vol)
extern

◆ get_vol_free()

unsigned int get_vol_free ( uint16_t  vol)
extern

◆ group_folder()

int group_folder ( uint16_t  vol,
int  did,
char *  name 
)
extern

◆ illegal_fork()

void illegal_fork ( DSI dsi,
char  cmd,
char *  name 
)
extern

◆ is_there()

int32_t is_there ( CONN conn,
uint16_t  volume,
int32_t  did,
char *  name 
)
extern

◆ no_access_folder()

int no_access_folder ( uint16_t  vol,
int  did,
char *  name 
)
extern

Use the second user for creating a folder with no access right.

Note
assume did are the same for != user

◆ not_valid()

int not_valid ( unsigned int  ret,
int  mac_error,
int  afpd_error 
)
extern

◆ not_valid_bitmap()

int not_valid_bitmap ( unsigned int  ret,
unsigned int  bitmap,
int  afpd_error 
)
extern

◆ read_fork()

void read_fork ( CONN conn,
uint16_t  vol,
int  dir,
char *  name,
int  len 
)
extern

◆ read_only_folder()

int read_only_folder ( uint16_t  vol,
int  did,
char *  name 
)
extern

Use the second user for creating a folder with read only access right.

Note
assume did are the same for != user

◆ read_only_folder_with_file()

int read_only_folder_with_file ( uint16_t  vol,
int  did,
char *  name,
char *  file 
)
extern

Use the second user for creating a folder with read only access right.

Note
assume did are the same for != user

◆ write_fork()

void write_fork ( CONN conn,
uint16_t  vol,
int  dir,
char *  name,
char *  data 
)
extern