syslog.h
author viric@llimona
Fri, 16 Jun 2006 18:25:03 +0200
changeset 61 4cd174a9b698
parent 57 de776a4548da
permissions -rw-r--r--
Added the setsockopt for IPV6_V6ONLY, in order to have IPv6 and IPv4 in two different sockets for the same port.

enum {
	MAX_STRING=255,
	TCP_LISTEN_QUEUE=10,
	MAX_CHILDS=15
};

enum etype_config
{
	FROM_UNIX,
	FROM_NPIPE,
	FROM_UDP,
	TO_UDP_HOST,
	TO_UDP_PORT,
	TCP_MANAGER,
	LOG_FILE,
	PID_FILE,
	ETYPE_END
};

struct config_element
{
	enum etype_config type; /* Type of the configuration element */
	char value[MAX_STRING]; /* Value of the parameter */
};

/* Prototypes -------------------- */

/* config.c */
void init_config();
int get_config(const enum etype_config type, char * restrict value, int max);

/* signals.c */
void program_child_handler(void (*child_handler)(int));
void program_ignore_hup();
void program_handler(int signum, void (*handler)(int));

/* out_udp.c */
int init_out_udp();
int write_out_udp(const char * restrict buf, const int len);
int close_out_udp();

/* out_file.c */
int init_out_file();
int write_out_file(const char * restrict buf, const int len);
int close_out_file();

/* tcp_server.c */
int init_tcp_server();
void close_out_tcp();

/* childs.c */
void term_childs();
void wait_childs_die();
void child_handler(int parameter);
int child_fork();
int get_childs_alive();