diff options
Diffstat (limited to 'src/tailnet.h')
| -rw-r--r-- | src/tailnet.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tailnet.h b/src/tailnet.h new file mode 100644 index 0000000..8e7c8a6 --- /dev/null +++ b/src/tailnet.h @@ -0,0 +1,25 @@ +#ifndef TAILNET_H +#define TAILNET_H + +#include <stdbool.h> + +#define DEFINE_PROGRAM_LIST(...) \ + static const char *REQUIRED_PROGS[] = {__VA_ARGS__}; \ + static const int REQUIRED_PROGS_COUNT = \ + sizeof(REQUIRED_PROGS) / sizeof(REQUIRED_PROGS[0]); + +#define PROG_TAILSCALE "tailscale" +#define PROG_SYSCTL "sysctl" +#define PROG_UFW "ufw" +#define PROG_CURL "curl" +#define PROG_NFT "nft" +#define MAX_PROG_COUNT \ + 10 // this is here cause of C99 array sizes compile time constraints + +extern const char *tailnetMissingProgs[MAX_PROG_COUNT]; +bool tailnet_is_program_installed_boolean(const char *program_name); +bool tailnet_is_file_executable_boolean(const char *filepath); +bool tailnet_check_required_programs_boolean(void); +bool tailnet_advertise_exit_node_boolean(void); + +#endif |
