diff options
Diffstat (limited to 'vpn/plugins/vici-client.h')
-rw-r--r-- | vpn/plugins/vici-client.h | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/vpn/plugins/vici-client.h b/vpn/plugins/vici-client.h index a49f0a78..91200e5a 100644 --- a/vpn/plugins/vici-client.h +++ b/vpn/plugins/vici-client.h @@ -13,32 +13,41 @@ struct _VICISection; typedef struct _VICISection VICISection; typedef enum { - VICI_CLIENT_ERROR_NONE, - VICI_CLIENT_ERROR_NOMEM, -} VICIClientError; - -typedef enum { - VICI_CLIENT_EVENT, -} VICIClientEvent; - -#define VICI_REQUEST_LOAD_CONN "load-conn" -#define VICI_REQUEST_LOAD_SHARED "load-shared" -#define VICI_REQUEST_LOAD_CERT "load-cert" -#define VICI_REQUEST_LOAD_INITIATE "initiate" - -typedef int (*vici_section_add_element)(VICISection *sect, const char *key, + VICI_CMD_LOAD_CONN, + VICI_CMD_LOAD_SHARED, + VICI_CMD_LOAD_CERT, + VICI_CMD_LOAD_AUTH, + VICI_CMD_UNLOAD_AUTH, + VICI_CMD_LOAD_KEY, + VICI_CMD_INITIATE, + VICI_CMD_MAX, +} VICIClientCmd; + +#define VICI_DEFAULT_URI "/var/run/charon.vici" + +typedef int (*vici_add_element)(VICISection *sect, const char *key, const char *value, const char *subsection); +typedef void (*vici_connect_reply_cb)(int err, void *user_data); + VICISection* vici_create_section(const char *name); -int vici_section_add_kv(VICISection *sect, const char *key, +int add_subsection(const char* name, VICISection* child, VICISection* section); +void vici_destroy_section(VICISection *sect); +int vici_add_kv(VICISection *sect, const char *key, const char *value, const char *subsection); -int vici_section_add_kvl(VICISection *sect, const char *key, +int vici_add_kvl(VICISection *sect, const char *key, + const char *value, const char *subsection); +int vici_add_list(VICISection* section, char *key, + GSList *list, const char* subsection); +int vici_add_cert_kv(VICISection *section, const char *key, + const char *value, const char *subsection); +int vici_add_cert_kvl(VICISection *section, const char *key, const char *value, const char *subsection); -void vici_destroy_section(VICISection *sect); -int vici_client_initialize(); -int vici_client_deinitialize(); -int vici_client_send_request(const char *cmd, VICISection *root); +int vici_initialize(VICIClient **vici_client); +int vici_deinitialize(VICIClient *vici_client); +void vici_set_connect_reply_cb(VICIClient *vici_client, vici_connect_reply_cb reply_cb, gpointer user_data); +int vici_send_request(VICIClient *vici_client, VICIClientCmd cmd, VICISection *root); #ifdef __cplusplus } |