37 lines
792 B
C
37 lines
792 B
C
#ifndef CONTROLLER_HELPERS_H
|
|
#define CONTROLLER_HELPERS_H
|
|
|
|
#include <confini.h>
|
|
#include <config.h>
|
|
|
|
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);
|
|
|
|
int
|
|
helper_load_config(IniDispatch *disp, void *config_void);
|
|
|
|
void
|
|
helper_parse_cli(int argc, const char **argv, config_t *config);
|
|
|
|
int
|
|
helper_get_weekday(const time_t timestamp_now);
|
|
|
|
#endif /* CONTROLLER_HELPERS_H */
|