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 #ifndef KEYFILE_H
30 #define KEYFILE_H
31
32 #include "conf.h"
33 #include "../daemon/keyfile_auth.h"
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 #define CFG_KEYFILE_ADD(list_begin, list_end, elm) \
40 cx_linked_list_add((
void**)list_begin, (
void**)list_end, -
1, offsetof(KeyfileEntry, next), elm)
41
42 typedef struct _keyfile_entry KeyfileEntry;
43
44 typedef struct _keyfile_conf {
45 ConfigParser parser;
46 char *file;
47 KeyfileEntry *users_begin;
48 KeyfileEntry *users_end;
49 } KeyfileConfig;
50
51 struct _keyfile_entry {
52 cxmutstr name;
53 enum KeyfileHashType hashtype;
54 cxmutstr hashdata;
55 cxmutstr *groups;
56 size_t numgroups;
57 KeyfileEntry *next;
58 };
59
60 KeyfileConfig *load_keyfile_config(
const char *file);
61 void free_keyfile_config(KeyfileConfig *conf);
62 int keyfile_parse(
void *p, ConfigLine *begin, ConfigLine *end, cxmutstr line);
63
64 #ifdef __cplusplus
65 }
66 #endif
67
68 #endif
69
70