netatalk  4.4.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(CONN *conn, uint16_t volume,
60 uint32_t parent_did, char *dirname);
61extern void clear_volume(uint16_t vol, CONN *conn);
62
63#endif
static DSI * dsi
Definition afparg.c:39
int delete_folder(uint16_t vol, int did, char *name)
Definition afphelper.c:563
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:479
void clear_volume(uint16_t vol, CONN *conn)
Definition afphelper.c:1155
void write_fork(CONN *conn, uint16_t vol, int dir, char *name, char *data)
Definition afphelper.c:137
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:400
void afp_printf(int level, int loglevel, int color, const char *fmt,...)
Definition afphelper.c:925
int not_valid(unsigned int ret, int mac_error, int afpd_error)
Definition afphelper.c:722
int get_vol_attrib(uint16_t vol)
Definition afphelper.c:688
int delete_folder_with_file(uint16_t vol, int did, char *name, char *file)
Definition afphelper.c:624
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:182
int delete_directory_tree(CONN *conn, uint16_t volume, uint32_t parent_did, char *dirname)
depth-first recursively delete a directory tree
Definition afphelper.c:971
uint32_t get_forklen(DSI *dsi, int type)
Definition afphelper.c:122
void illegal_fork(DSI *dsi, char cmd, char *name)
Definition afphelper.c:15
int group_folder(uint16_t vol, int did, char *name)
Definition afphelper.c:311
unsigned int get_vol_free(uint16_t vol)
Definition afphelper.c:705
void read_fork(CONN *conn, uint16_t vol, int dir, char *name, int len)
Definition afphelper.c:157
int get_did(CONN *conn, uint16_t vol, int dir, char *name)
Definition afphelper.c:74
int not_valid_bitmap(unsigned int ret, unsigned int bitmap, int afpd_error)
Definition afphelper.c:873
int get_fid(CONN *conn, uint16_t vol, int dir, char *name)
Definition afphelper.c:99
int32_t is_there(CONN *conn, uint16_t volume, int32_t did, char *name)
Definition afphelper.c:944
#define data
Definition hash.c:37
cnid_t did
Definition nad_cp.c:93
static enum op type
Definition nad_cp.c:96
static afpvol_t volume
Definition nad_rm.c:46
Definition afpclient.h:190
Definition include/atalk/dsi.h:58
Definition include/atalk/directory.h:56
Definition include/atalk/volume.h:30
DSI (Data Stream Interface) protocol definitions modified for the afptest test-suite.