controller-legacy/include/helpers.h

38 lines
759 B
C
Raw Permalink Normal View History

2020-04-13 22:50:55 +00:00
#ifndef CONTROLLER_HELPERS_H
#define CONTROLLER_HELPERS_H
2020-05-06 23:41:16 +00:00
#include <time.h>
#include <config.h>
2020-04-16 23:38:25 +00:00
2020-04-13 22:50:55 +00:00
int
helper_connect_tcp_server(char* host, uint16_t port);
int
helper_bind_tcp_server(char* addr, uint16_t port, int max_client_backlog);
uint16_t
helper_get_port(int sock);
/**
* @brief Open socket for discovery
*
* Will exit program when unable to open socket.
*
* @param discovery_port Port number to listen on for discovery broadcasts
*
* @return Open socket to accept discovery broadcasts on
*/
int
helper_open_discovery_socket(uint16_t discovery_port);
void
2020-04-24 22:48:59 +00:00
helper_parse_cli(int argc, const char **argv, config_t *config);
int
2020-05-06 23:41:16 +00:00
helper_get_weekday(const struct tm *time_struct);
2020-07-26 19:05:41 +00:00
int
helper_drop_privileges();
2020-04-13 22:50:55 +00:00
#endif /* CONTROLLER_HELPERS_H */