netatalk  4.6.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/* Log in with the UAM selected for the test runner. */
65extern unsigned int afptest_login(CONN *conn, char *vers, char *uam,
66 const char *selected_uam, char *user,
67 char *password);
68/* As above, but keep the historical FPLogin fallback for ClearTxt. */
69extern unsigned int afptest_login_plain(CONN *conn, char *vers, char *uam,
70 const char *selected_uam, char *user,
71 char *password);
72
73#endif
char * vers
Definition afparg.c:66
char * uam
Definition afparg.c:67
int delete_folder(uint16_t vol, int did, char *name)
Definition afphelper.c:603
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:519
void clear_volume(uint16_t vol, CONN *conn)
Definition afphelper.c:1285
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:440
void afp_printf(int level, int loglevel, int color, const char *fmt,...)
Definition afphelper.c:977
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:1048
int get_vol_attrib(uint16_t vol)
Definition afphelper.c:728
unsigned int afptest_login_plain(CONN *conn, char *vers, char *uam, const char *selected_uam, char *user, char *password)
Definition afphelper.c:48
int delete_folder_with_file(uint16_t vol, int did, char *name, char *file)
Definition afphelper.c:664
int not_valid_bitmap(unsigned int ret, unsigned int bitmap, int netatalk_error)
Definition afphelper.c:925
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:223
void write_fork(CONN *conn, uint16_t vol, int dir, char *name, char *txt)
Definition afphelper.c:178
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:1252
uint32_t get_forklen(DSI *dsi, int type)
Definition afphelper.c:163
void illegal_fork(DSI *dsi, char cmd, char *name)
Definition afphelper.c:56
int not_valid(unsigned int ret, int mac_error, int netatalk_error)
Definition afphelper.c:762
int group_folder(uint16_t vol, int did, char *name)
Definition afphelper.c:351
unsigned int get_vol_free(uint16_t vol)
Definition afphelper.c:745
void read_fork(CONN *conn, uint16_t vol, int dir, char *name, int len)
Definition afphelper.c:198
unsigned int afptest_login(CONN *conn, char *vers, char *uam, const char *selected_uam, char *user, char *password)
Definition afphelper.c:40
int get_did(CONN *conn, uint16_t vol, int dir, char *name)
Definition afphelper.c:115
int get_fid(CONN *conn, uint16_t vol, int dir, char *name)
Definition afphelper.c:140
int32_t is_there(CONN *conn, uint16_t volume, int32_t did, char *name)
Definition afphelper.c:996
#define data
Definition hash.c:52
cnid_t did
Definition nad_cp.c:92
Definition afpclient.h:176
int type
Definition afpclient.h:178
DSI dsi
Definition afpclient.h:177
Definition include/atalk/dsi.h:58
Definition include/atalk/directory.h:72
Definition include/atalk/volume.h:33
DSI (Data Stream Interface) protocol definitions for the test-suite.