File: log_extauth_p.h

package info (click to toggle)
pure-ftpd 1.0.47-3
  • links: PTS
  • area: main
  • in suites: buster
  • size: 3,212 kB
  • sloc: ansic: 29,132; sh: 1,632; makefile: 500; perl: 280
file content (58 lines) | stat: -rw-r--r-- 2,598 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef __LOG_EXTAUTH_P_H__
#define __LOG_EXTAUTH_P_H__ 1

#ifdef WITH_EXTAUTH

#include <sys/un.h>

#ifndef SUN_LEN
# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) NULL)->sun_path) \
                           + strlen((ptr)->sun_path))
#endif

#ifndef EXTAUTH_MAX_CONNECT_TRIES
# define EXTAUTH_MAX_CONNECT_TRIES 10
#endif
#ifndef EXTAUTH_MAX_CONNECT_DELAY
# define EXTAUTH_MAX_CONNECT_DELAY 1
#endif

typedef struct ExtauthCallBack_ {
    const char *keyword;
    void (*func)(const char *str, AuthResult * const result);
} ExtauthCallBack;

static void callback_reply_auth_ok(const char *str, AuthResult * const result);
static void callback_reply_uid(const char *str, AuthResult * const result);
static void callback_reply_gid(const char *str, AuthResult * const result);
static void callback_reply_dir(const char *str, AuthResult * const result);
static void callback_reply_slow_tilde_expansion(const char *str, AuthResult * const result);
static void callback_reply_throttling_bandwidth_ul(const char *str, AuthResult * const result);
static void callback_reply_throttling_bandwidth_dl(const char *str, AuthResult * const result);
static void callback_reply_user_quota_size(const char *str, AuthResult * const result);
static void callback_reply_user_quota_files(const char *str, AuthResult * const result);
static void callback_reply_ratio_upload(const char *str, AuthResult * const result);
static void callback_reply_ratio_download(const char *str, AuthResult * const result);
static void callback_reply_per_user_max(const char *str, AuthResult * const result);
static void callback_reply_end(const char *str, AuthResult * const result);

static ExtauthCallBack extauth_callbacks[] = {
    { EXTAUTH_REPLY_AUTH_OK, callback_reply_auth_ok },
    { EXTAUTH_REPLY_UID, callback_reply_uid },
    { EXTAUTH_REPLY_GID, callback_reply_gid },
    { EXTAUTH_REPLY_DIR, callback_reply_dir },
    { EXTAUTH_REPLY_SLOW_TILDE_EXPANSION, callback_reply_slow_tilde_expansion },
    { EXTAUTH_REPLY_THROTTLING_BANDWIDTH_UL, callback_reply_throttling_bandwidth_ul },
    { EXTAUTH_REPLY_THROTTLING_BANDWIDTH_DL, callback_reply_throttling_bandwidth_dl },
    { EXTAUTH_REPLY_USER_QUOTA_SIZE, callback_reply_user_quota_size },
    { EXTAUTH_REPLY_USER_QUOTA_FILES, callback_reply_user_quota_files },
    { EXTAUTH_REPLY_RATIO_UPLOAD, callback_reply_ratio_upload },
    { EXTAUTH_REPLY_RATIO_DOWNLOAD, callback_reply_ratio_download },
    { EXTAUTH_REPLY_PER_USER_MAX, callback_reply_per_user_max },
    { EXTAUTH_REPLY_END, callback_reply_end },
    { NULL, callback_reply_end }
};

#endif

#endif