40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
/* fips_control.h — FIPS Unix-socket JSON control client */
|
|
|
|
#ifndef FIPS_CONTROL_H
|
|
#define FIPS_CONTROL_H
|
|
|
|
#include <glib.h>
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct {
|
|
char npub[80];
|
|
int peer_count;
|
|
char tun_state[32];
|
|
char tun_name[16];
|
|
char state[32];
|
|
char tree_state[32];
|
|
gboolean tun_active;
|
|
} fips_status_t;
|
|
|
|
int fips_control_connect(const char *socket_path, int timeout_ms,
|
|
char *error, size_t error_size);
|
|
int fips_control_show_status(int fd, fips_status_t *status,
|
|
char *error, size_t error_size);
|
|
/* Returns the response data as compact JSON. Caller frees with g_free(). */
|
|
char *fips_control_show_peers(int fd, char *error, size_t error_size);
|
|
int fips_control_connect_peer(int fd, const char *npub, const char *address,
|
|
const char *transport,
|
|
char *error, size_t error_size);
|
|
void fips_control_close(int *fd);
|
|
gboolean fips_control_socket_available(const char *socket_path, int timeout_ms);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* FIPS_CONTROL_H */
|