5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef __VICI_CLIENT_H
21 #define __VICI_CLIENT_H
27 /* strongswan VICI plugin client part*/
29 typedef struct _VICIClient VICIClient;
32 typedef struct _VICISection VICISection;
43 VICI_CMD_REGISTER_CHILD_UPDOWN,
49 VICI_EVENT_CHILD_DOWN,
52 #define VICI_DEFAULT_URI "/var/run/charon.vici"
54 typedef int (*vici_add_element)(VICISection *sect, const char *key,
55 const char *value, const char *subsection);
57 typedef void (*vici_request_reply_cb)(int err, void *user_data);
58 typedef void (*vici_event_cb)(VICIClientEvent event, void *user_data);
60 VICISection* vici_create_section(const char *name);
61 int add_subsection(const char* name, VICISection* child, VICISection* section);
62 void vici_destroy_section(VICISection *sect);
63 int vici_add_kv(VICISection *sect, const char *key,
64 const char *value, const char *subsection);
65 int vici_add_kvl(VICISection *sect, const char *key,
66 const char *value, const char *subsection);
67 int vici_add_list(VICISection* section, char *key,
68 GSList *list, const char* subsection);
69 int vici_add_cert_kv(VICISection *section, const char *key,
70 const char *value, const char *subsection);
71 int vici_add_cert_kvl(VICISection *section, const char *key,
72 const char *value, const char *subsection);
74 int vici_initialize(VICIClient **vici_client);
75 int vici_deinitialize(VICIClient *vici_client);
76 void vici_set_request_reply_cb(VICIClient *vici_client, vici_request_reply_cb reply_cb, gpointer user_data);
77 int vici_send_request(VICIClient *vici_client, VICIClientCmd cmd, VICISection *root);
78 int vici_set_event_cb(VICIClient *vici_client, vici_event_cb cb, gpointer user_data);
84 #endif /* __VICI_CLIENT_H */