diff --git a/src/intf/config_file.h b/src/intf/config_file.h new file mode 100644 index 0000000..52bf50e --- /dev/null +++ b/src/intf/config_file.h @@ -0,0 +1,11 @@ +#include +#include + +typedef struct KeyValuePair { + char *key; + char *value; + bool loop; +} keyvaluepair_t; + +keyvaluepair_t config_read(FILE *fp); +void config_write(FILE *fp, char *key, char *value); diff --git a/src/intf/magic_code.h b/src/intf/magic_code.h new file mode 100644 index 0000000..efebe83 --- /dev/null +++ b/src/intf/magic_code.h @@ -0,0 +1,4 @@ +#pragma once + +int MAGIC_CODE_A = 0xbb97dae1; +int MAGIC_CODE_B = 0xa935e462; diff --git a/src/intf/melon_vpn_sock.h b/src/intf/melon_vpn_sock.h new file mode 100644 index 0000000..bcc551c --- /dev/null +++ b/src/intf/melon_vpn_sock.h @@ -0,0 +1,5 @@ +#pragma once + +#define SV_DAEMON_SOCK_PATH "/tmp/melonvpndaemon.sock" +#define SV_RPEERS_SOCK_PATH "/tmp/melonvpnrefreshpeers.sock" +#define SV_CLIENT_SOCK_PATH "/tmp/melonvpn.sock" diff --git a/src/intf/open_gui.h b/src/intf/open_gui.h new file mode 100644 index 0000000..d395e49 --- /dev/null +++ b/src/intf/open_gui.h @@ -0,0 +1,4 @@ +#pragma once +#include + +int open_gui(int argc, char **argv, bool is_debug); diff --git a/src/intf/states.h b/src/intf/states.h new file mode 100644 index 0000000..629779a --- /dev/null +++ b/src/intf/states.h @@ -0,0 +1,7 @@ +#pragma once + +typedef enum { + CONNECTED, + DISCONNECTED, + RESTARTING +} States; diff --git a/src/intf/statusicon.h b/src/intf/statusicon.h new file mode 100644 index 0000000..e543d02 --- /dev/null +++ b/src/intf/statusicon.h @@ -0,0 +1,8 @@ +#pragma once + +#include +#include +#include "states.h" + +void status_icon_create(GtkWidget *window, char *off, char *on); +void status_icon_set_state(AppIndicatorStatus state); diff --git a/src/intf/unix_sockets.h b/src/intf/unix_sockets.h new file mode 100644 index 0000000..e91c865 --- /dev/null +++ b/src/intf/unix_sockets.h @@ -0,0 +1,10 @@ +#pragma once + +#include +#include + +#define BUF_SIZE 100 +#define BACKLOG 5 + +int unix_socket_client_start(char *sock_path); +int unix_socket_server_start(char *sock_path);