Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (1.44 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);
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

    
50
/* krt.c bits */
51

    
52
void krt_io_init(void);
53

    
54
/* log.c */
55

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

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

    
67
#endif