dav/config.h

changeset 796
81e0f67386a6
parent 795
05647e862a17
child 798
d7f5067a27ce
equal deleted inserted replaced
795:05647e862a17 796:81e0f67386a6
39 39
40 #ifdef __cplusplus 40 #ifdef __cplusplus
41 extern "C" { 41 extern "C" {
42 #endif 42 #endif
43 43
44 typedef struct Repository Repository;
45 typedef struct DavKey Key;
46 typedef struct Proxy Proxy;
47 44
48 #define HTTP_PROXY 1 45 #define HTTP_PROXY 1
49 #define HTTPS_PROXY 2 46 #define HTTPS_PROXY 2
50 47
51 enum key_type {
52 KEY_AES128 = 0,
53 KEY_AES256,
54 };
55
56 typedef enum key_type KeyType;
57
58 struct Repository {
59 char *name;
60 char *url;
61 char *user;
62 char *password;
63 char *stored_user;
64 char *default_key;
65 char *cert;
66 bool verification;
67 bool encrypt_content;
68 bool encrypt_name;
69 bool encrypt_properties;
70 bool decrypt_content;
71 bool decrypt_name;
72 bool decrypt_properties;
73 int ssl_version;
74 unsigned long authmethods;
75 };
76 48
77 int check_config_dir(void); 49 int check_config_dir(void);
78 50
79 char* config_file_path(char *name); 51 char* config_file_path(char *name);
80 52
81 cxmutstr config_load_file(const char *path); 53 cxmutstr config_load_file(const char *path);
82 54
83 int load_config(DavContext *ctx); 55 int load_config(DavContext *ctx);
84 DavConfig* get_config(void); 56 DavConfig* get_config(void);
85 int store_config(void); 57 int store_config(void);
58 void free_config(void);
86 59
87 void free_config(void);
88 int load_repository(const xmlNode *reponode);
89 int load_key(const xmlNode *keynode);
90 int load_proxy(DavProxy*, const xmlNode *proxynode, int type);
91 cxmutstr load_key_file(const char *filename); 60 cxmutstr load_key_file(const char *filename);
92 int load_namespace(const xmlNode *node);
93 int load_secretstore(const xmlNode *node);
94 61
95 Repository* repository_new(void);
96
97 Repository* get_repository(cxstring name);
98 int get_repository_flags(Repository *repo);
99 DavSession *repository_session(Repository *repo);
100 Key* get_key(const char *name);
101
102 int add_repository(Repository *repo);
103 int remove_repository(Repository *repo);
104 int list_repositories(void); 62 int list_repositories(void);
105 CxIterator get_repositories(void);
106 63
107 PwdStore* get_pwdstore(void); 64 PwdStore* get_pwdstore(void);
108 int pwdstore_save(PwdStore *pwdstore); 65 int pwdstore_save(PwdStore *pwdstore);
109 66
110 67

mercurial