]> git.ipfire.org Git - thirdparty/bird.git/blob - sysdep/unix/unix.h
Adds support for soft reconfiguration.
[thirdparty/bird.git] / sysdep / unix / unix.h
1 /*
2 * BIRD -- Declarations Common to Unix Port
3 *
4 * (c) 1998--2000 Martin Mares <mj@ucw.cz>
5 *
6 * Can be freely distributed and used under the terms of the GNU GPL.
7 */
8
9 #ifndef _BIRD_UNIX_H_
10 #define _BIRD_UNIX_H_
11
12 struct pool;
13
14 /* main.c */
15
16 void async_config(void);
17 void async_dump(void);
18 void async_shutdown(void);
19 void cmd_reconfig(char *name, int type);
20
21 /* io.c */
22
23 volatile int async_config_flag;
24 volatile int async_dump_flag;
25 volatile int async_shutdown_flag;
26
27 #ifdef IPV6
28 #define BIRD_PF PF_INET6
29 #define BIRD_AF AF_INET6
30 typedef struct sockaddr_in6 sockaddr;
31 #else
32 #define BIRD_PF PF_INET
33 #define BIRD_AF AF_INET
34 typedef struct sockaddr_in sockaddr;
35 #endif
36
37 #ifndef SUN_LEN
38 #define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen ((ptr)->sun_path))
39 #endif
40
41 struct birdsock;
42
43 void io_init(void);
44 void io_loop(void);
45 void fill_in_sockaddr(sockaddr *sa, ip_addr a, unsigned port);
46 void get_sockaddr(sockaddr *sa, ip_addr *a, unsigned *port, int check);
47 int sk_open_unix(struct birdsock *s, char *name);
48 void *tracked_fopen(struct pool *, char *name, char *mode);
49 void test_old_bird(char *path);
50
51
52 /* krt.c bits */
53
54 void krt_io_init(void);
55
56 /* log.c */
57
58 void log_init(int debug, int init);
59 void log_init_debug(char *); /* Initialize debug dump to given file (NULL=stderr, ""=off) */
60 void log_switch(int debug, struct list *);
61
62 struct log_config {
63 node n;
64 unsigned int mask; /* Classes to log */
65 void *fh; /* FILE to log to, NULL=syslog */
66 int terminal_flag;
67 };
68
69 #endif