netatalk: afphelper.h Source File

netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
afphelper.h
Go to the documentation of this file.
1#ifndef AFP_HELPER_H
2#define AFP_HELPER_H
3
4#include <inttypes.h>
5
6#include "dsi.h"
7
8/* log level */
9#define AFP_LOG_DEBUG 0
10#define AFP_LOG_INFO 1
11#define AFP_LOG_WARNING 2
12#define AFP_LOG_ERROR 3
13#define AFP_LOG_CRITICAL 4
14#define AFP_LOG_MAX 5
15
16extern void afp_printf(int level, int loglevel, int color, const char *fmt,
17 ...);
18
19#define AFP_PRINTF(level, fmt, ...) afp_printf(level, Loglevel, Color, fmt, ##__VA_ARGS__)
20
21#define BITERR_NOOBJ (1 << 0)
22#define BITERR_NODIR (1 << 1)
23#define BITERR_PARAM (1 << 2)
24#define BITERR_BUSY (1 << 3)
25#define BITERR_BADTYPE (1 << 4)
26#define BITERR_NOITEM (1 << 5)
27#define BITERR_DENYCONF (1 << 6)
28#define BITERR_NFILE (1 << 7)
29#define BITERR_ACCESS (1 << 8)
30#define BITERR_NOID (1 << 9)
31#define BITERR_BITMAP (1 << 10)
32#define BITERR_MISC (1 << 11)
33
34/* Forward declarations */
35typedef struct CONN CONN;
36
37/* Function declarations */
38extern void illegal_fork(DSI *dsi, char cmd, char *name);
39extern int no_access_folder(uint16_t vol, int did, char *name);
40extern int read_only_folder(uint16_t vol, int did, char *name);
41extern int delete_folder(uint16_t vol, int did, char *name);
42extern int get_did(CONN *conn, uint16_t vol, int dir, char *name);
43extern int get_fid(CONN *conn, uint16_t vol, int dir, char *name);
44extern uint32_t get_forklen(DSI *dsi, int type);
45extern void write_fork(CONN *conn, uint16_t vol, int dir, char *name,
46 char *data);
47extern void read_fork(CONN *conn, uint16_t vol, int dir, char *name, int len);
48extern int read_only_folder_with_file(uint16_t vol, int did, char *name,
49 char *file);
50extern int delete_folder_with_file(uint16_t vol, int did, char *name,
51 char *file);
52extern int get_vol_attrib(uint16_t vol);
53extern int group_folder(uint16_t vol, int did, char *name);
54extern unsigned int get_vol_free(uint16_t vol);
55extern int not_valid(unsigned int ret, int mac_error, int afpd_error);
56extern int not_valid_bitmap(unsigned int ret, unsigned int bitmap,
57 int afpd_error);
58extern int32_t is_there(CONN *conn, uint16_t volume, int32_t did, char *name);
59extern int delete_directory_tree_by_did(CONN *conn, uint16_t volume,
60 uint32_t dir_id);
61extern int delete_directory_tree(CONN *conn, uint16_t volume,
62 uint32_t parent_did, char *dirname);
63extern void clear_volume(uint16_t vol, CONN *conn);
64
65#endif
dsi
static DSI * dsi
Definition afparg.c:39
delete_folder
int delete_folder(uint16_t vol, int did, char *name)
Definition afphelper.c:568
read_only_folder_with_file
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.
Definition afphelper.c:484
clear_volume
void clear_volume(uint16_t vol, CONN *conn)
Definition afphelper.c:1247
write_fork
void write_fork(CONN *conn, uint16_t vol, int dir, char *name, char *data)
Definition afphelper.c:142
read_only_folder
int read_only_folder(uint16_t vol, int did, char *name)
Use the second user for creating a folder with read only access right.
Definition afphelper.c:405
afp_printf
void afp_printf(int level, int loglevel, int color, const char *fmt,...)
Definition afphelper.c:930
delete_directory_tree_by_did
int delete_directory_tree_by_did(CONN *conn, uint16_t volume, uint32_t dir_id)
depth-first recursively delete a directory tree by DID
Definition afphelper.c:1001
not_valid
int not_valid(unsigned int ret, int mac_error, int afpd_error)
Definition afphelper.c:727
get_vol_attrib
int get_vol_attrib(uint16_t vol)
Definition afphelper.c:693
delete_folder_with_file
int delete_folder_with_file(uint16_t vol, int did, char *name, char *file)
Definition afphelper.c:629
no_access_folder
int no_access_folder(uint16_t vol, int did, char *name)
Use the second user for creating a folder with no access right.
Definition afphelper.c:187
delete_directory_tree
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
Definition afphelper.c:1214
get_forklen
uint32_t get_forklen(DSI *dsi, int type)
Definition afphelper.c:127
illegal_fork
void illegal_fork(DSI *dsi, char cmd, char *name)
Definition afphelper.c:20
group_folder
int group_folder(uint16_t vol, int did, char *name)
Definition afphelper.c:316
get_vol_free
unsigned int get_vol_free(uint16_t vol)
Definition afphelper.c:710
read_fork
void read_fork(CONN *conn, uint16_t vol, int dir, char *name, int len)
Definition afphelper.c:162
get_did
int get_did(CONN *conn, uint16_t vol, int dir, char *name)
Definition afphelper.c:79
not_valid_bitmap
int not_valid_bitmap(unsigned int ret, unsigned int bitmap, int afpd_error)
Definition afphelper.c:878
get_fid
int get_fid(CONN *conn, uint16_t vol, int dir, char *name)
Definition afphelper.c:104
is_there
int32_t is_there(CONN *conn, uint16_t volume, int32_t did, char *name)
Definition afphelper.c:949
data
#define data
Definition hash.c:38
did
cnid_t did
Definition nad_cp.c:93
type
static enum op type
Definition nad_cp.c:96
volume
static afpvol_t volume
Definition nad_rm.c:46
CONN
Definition afpclient.h:176
DSI
Definition include/atalk/dsi.h:58
dir
Definition include/atalk/directory.h:56
vol
Definition include/atalk/volume.h:33
dsi.h
DSI (Data Stream Interface) protocol definitions for the test-suite.