summaryrefslogtreecommitdiff
path: root/vpn/plugins/vici-client.h
blob: a49f0a78d0c319d87ec0fa17650e0648a5431dbf (plain)
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
#ifndef __VICI_CLIENT_H
#define __VICI_CLIENT_H

#ifdef __cplusplus
extern "C" {
#endif

/* strongswan VICI plugin client part*/
struct _VICIClient;
typedef struct _VICIClient VICIClient;

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,
		const char *value, const char *subsection);

VICISection* vici_create_section(const char *name);
int vici_section_add_kv(VICISection *sect, const char *key,
		const char *value, const char *subsection);
int vici_section_add_kvl(VICISection *sect, 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);

#ifdef __cplusplus
}
#endif

#endif /* __VICI_CLIENT_H */