Statistics
| Branch: | Revision:

iof-bird-daemon / sysdep / unix / unix.h @ e81b440f

History | View | Annotate | Download (1.5 KB)

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
void cmd_shutdown(void);
21

    
22
/* io.c */
23

    
24
volatile int async_config_flag;
25
volatile int async_dump_flag;
26
volatile int async_shutdown_flag;
27

    
28
#ifdef IPV6
29
#define BIRD_PF PF_INET6
30
#define BIRD_AF AF_INET6
31
typedef struct sockaddr_in6 sockaddr;
32
#else
33
#define BIRD_PF PF_INET
34
#define BIRD_AF AF_INET
35
typedef struct sockaddr_in sockaddr;
36
#endif
37

    
38
#ifndef SUN_LEN
39
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen ((ptr)->sun_path))
40
#endif
41

    
42
struct birdsock;
43

    
44
void io_init(void);
45
void io_loop(void);
46
void fill_in_sockaddr(sockaddr *sa, ip_addr a, unsigned port);
47
void get_sockaddr(sockaddr *sa, ip_addr *a, unsigned *port, int check);
48
int sk_open_unix(struct birdsock *s, char *name);
49
void *tracked_fopen(struct pool *, char *name, char *mode);
50
void test_old_bird(char *path);
51

    
52

    
53
/* krt.c bits */
54

    
55
void krt_io_init(void);
56

    
57
/* log.c */
58

    
59
void log_init(int debug, int init);
60
void log_init_debug(char *);                /* Initialize debug dump to given file (NULL=stderr, ""=off) */
61
void log_switch(int debug, struct list *);
62

    
63
struct log_config {
64
  node n;
65
  unsigned int mask;                        /* Classes to log */
66
  void *fh;                                /* FILE to log to, NULL=syslog */
67
  int terminal_flag;
68
};
69

    
70
#endif