/*
 * vici.h — minimal declarations for the subset of strongSwan's libvici that
 * SwanDesk uses: opening a VICI connection to charon and subscribing to events.
 *
 * The Homebrew/source builds ship libvici.0.dylib but not its public header, so
 * we declare the stable ABI ourselves. Linked against the bundled libvici dylib.
 */

#ifndef SWANDESK_VICI_H
#define SWANDESK_VICI_H

#ifdef __cplusplus
extern "C" {
#endif

typedef struct vici_conn_t vici_conn_t;
typedef struct vici_res_t vici_res_t;

/* Event callback: libvici invokes this for each registered event. */
typedef void (*vici_event_cb_t)(void *user, char *name, vici_res_t *res);

void vici_init(void);

/* uri == NULL connects to the default charon VICI socket. */
vici_conn_t* vici_connect(char *uri);
void vici_disconnect(vici_conn_t *conn);

/* Register (cb != NULL) / unregister (cb == NULL) for a named event stream. */
int vici_register(vici_conn_t *conn, char *name, vici_event_cb_t cb, void *user);

#ifdef __cplusplus
}
#endif

#endif /* SWANDESK_VICI_H */
