syslog.h
author viric@llimona
Fri, 16 Jun 2006 18:45:24 +0200
changeset 62 39bf7ecd7b21
parent 57 de776a4548da
permissions -rw-r--r--
IPV6_V6ONLY setsockopt added for the udp server.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
     1
enum {
49
ced312cc1eaa Separated the child handling in another module.
viric@llimona
parents: 39
diff changeset
     2
	MAX_STRING=255,
51
a01abd65856a The tcp server listen() started working. By now the connections are closed at once.
viric@llimona
parents: 49
diff changeset
     3
	TCP_LISTEN_QUEUE=10,
49
ced312cc1eaa Separated the child handling in another module.
viric@llimona
parents: 39
diff changeset
     4
	MAX_CHILDS=15
21
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
     5
};
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
     6
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
     7
enum etype_config
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
     8
{
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
     9
	FROM_UNIX,
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    10
	FROM_NPIPE,
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    11
	FROM_UDP,
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    12
	TO_UDP_HOST,
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    13
	TO_UDP_PORT,
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    14
	TCP_MANAGER,
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    15
	LOG_FILE,
57
de776a4548da Added the check for a pid file (syslog.pid by default).
viric@llimona
parents: 55
diff changeset
    16
	PID_FILE,
21
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    17
	ETYPE_END
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    18
};
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    19
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    20
struct config_element
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    21
{
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    22
	enum etype_config type; /* Type of the configuration element */
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    23
	char value[MAX_STRING]; /* Value of the parameter */
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    24
};
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    25
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    26
/* Prototypes -------------------- */
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    27
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    28
/* config.c */
24714adbc325 Implemented the configuration file for starting the services.
viric@mandarina
parents:
diff changeset
    29
void init_config();
23
3e2a39def0db Added use of strncmp, strncpy instead of the non-limited ones.
viric@mandarina
parents: 21
diff changeset
    30
int get_config(const enum etype_config type, char * restrict value, int max);
26
7227789ca718 Added a c file for signal programming.
viric@mandarina
parents: 23
diff changeset
    31
7227789ca718 Added a c file for signal programming.
viric@mandarina
parents: 23
diff changeset
    32
/* signals.c */
7227789ca718 Added a c file for signal programming.
viric@mandarina
parents: 23
diff changeset
    33
void program_child_handler(void (*child_handler)(int));
7227789ca718 Added a c file for signal programming.
viric@mandarina
parents: 23
diff changeset
    34
void program_ignore_hup();
28
a206baaa3ad5 Added main rutines for killing and waiting for childs' dead.
viric@mandarina
parents: 26
diff changeset
    35
void program_handler(int signum, void (*handler)(int));
35
6b6bbc8a5fdb Added UDP output.
viric@mandarina
parents: 28
diff changeset
    36
6b6bbc8a5fdb Added UDP output.
viric@mandarina
parents: 28
diff changeset
    37
/* out_udp.c */
6b6bbc8a5fdb Added UDP output.
viric@mandarina
parents: 28
diff changeset
    38
int init_out_udp();
39
60858d13b22c Log file output written in a C module. Now the kernel doesn't check the errors
viric@mandarina
parents: 35
diff changeset
    39
int write_out_udp(const char * restrict buf, const int len);
35
6b6bbc8a5fdb Added UDP output.
viric@mandarina
parents: 28
diff changeset
    40
int close_out_udp();
39
60858d13b22c Log file output written in a C module. Now the kernel doesn't check the errors
viric@mandarina
parents: 35
diff changeset
    41
60858d13b22c Log file output written in a C module. Now the kernel doesn't check the errors
viric@mandarina
parents: 35
diff changeset
    42
/* out_file.c */
60858d13b22c Log file output written in a C module. Now the kernel doesn't check the errors
viric@mandarina
parents: 35
diff changeset
    43
int init_out_file();
60858d13b22c Log file output written in a C module. Now the kernel doesn't check the errors
viric@mandarina
parents: 35
diff changeset
    44
int write_out_file(const char * restrict buf, const int len);
60858d13b22c Log file output written in a C module. Now the kernel doesn't check the errors
viric@mandarina
parents: 35
diff changeset
    45
int close_out_file();
49
ced312cc1eaa Separated the child handling in another module.
viric@llimona
parents: 39
diff changeset
    46
51
a01abd65856a The tcp server listen() started working. By now the connections are closed at once.
viric@llimona
parents: 49
diff changeset
    47
/* tcp_server.c */
a01abd65856a The tcp server listen() started working. By now the connections are closed at once.
viric@llimona
parents: 49
diff changeset
    48
int init_tcp_server();
55
c72dbd390cf2 Now the tcp_server sends the log file.
viric@llimona
parents: 51
diff changeset
    49
void close_out_tcp();
51
a01abd65856a The tcp server listen() started working. By now the connections are closed at once.
viric@llimona
parents: 49
diff changeset
    50
49
ced312cc1eaa Separated the child handling in another module.
viric@llimona
parents: 39
diff changeset
    51
/* childs.c */
ced312cc1eaa Separated the child handling in another module.
viric@llimona
parents: 39
diff changeset
    52
void term_childs();
ced312cc1eaa Separated the child handling in another module.
viric@llimona
parents: 39
diff changeset
    53
void wait_childs_die();
ced312cc1eaa Separated the child handling in another module.
viric@llimona
parents: 39
diff changeset
    54
void child_handler(int parameter);
ced312cc1eaa Separated the child handling in another module.
viric@llimona
parents: 39
diff changeset
    55
int child_fork();
ced312cc1eaa Separated the child handling in another module.
viric@llimona
parents: 39
diff changeset
    56
int get_childs_alive();