]>
git.ipfire.org Git - thirdparty/bird.git/blob - nest/protocol.h
59db428716f688aa4b100900fd75a095289cb7f0
2 * BIRD Internet Routing Daemon -- Protocols
4 * (c) 1998 Martin Mares <mj@ucw.cz>
6 * Can be freely distributed and used under the terms of the GNU GPL.
9 #ifndef _BIRD_PROTOCOL_H_
10 #define _BIRD_PROTOCOL_H_
12 #include "lib/lists.h"
13 #include "lib/resource.h"
28 unsigned debug
; /* Default debugging flags */
30 void (*init
)(struct protocol
*); /* Boot time */
31 void (*preconfig
)(struct protocol
*); /* Just before configuring */
32 void (*postconfig
)(struct protocol
*); /* After configuring */
35 void protos_build(void);
36 void protos_init(void);
37 void protos_preconfig(void);
38 void protos_postconfig(void);
39 void protos_start(void);
40 void protos_dump_all(void);
42 extern list protocol_list
;
48 extern struct protocol proto_device
;
49 extern struct protocol proto_rip
;
52 * Routing Protocol Instance
57 struct protocol
*proto
; /* Protocol */
58 char *name
; /* Name of this instance */
59 unsigned debug
; /* Debugging flags */
60 pool
*pool
; /* Local objects */
61 unsigned preference
; /* Default route preference */
62 unsigned state
; /* PRS_... */
63 unsigned disabled
; /* Manually disabled */
65 void (*if_notify
)(struct proto
*, unsigned flags
, struct iface
*new, struct iface
*old
);
66 void (*rt_notify
)(struct proto
*, struct network
*net
, struct rte
*new, struct rte
*old
);
67 void (*neigh_notify
)(struct neighbor
*neigh
);
68 void (*dump
)(struct proto
*); /* Debugging dump */
69 void (*start
)(struct proto
*); /* Start the instance */
70 void (*shutdown
)(struct proto
*, int time
); /* Stop the instance */
72 int (*rta_same
)(struct rtattr
*, struct rtattr
*);
73 int (*rte_better
)(struct rte
*, struct rte
*);
74 void (*rte_insert
)(struct network
*, struct rte
*);
75 void (*rte_remove
)(struct network
*, struct rte
*);
77 /* Reconfigure function? */
78 /* Input/output filters */
79 /* Connection to routing tables? */
81 /* Hic sunt protocol-specific data */
84 #define PRS_DOWN 0 /* Inactive */
85 #define PRS_STARTING 1
88 void *proto_new(struct protocol
*, unsigned size
);
90 extern list proto_list
, inactive_proto_list
;
93 * Known unique protocol instances as referenced by config routines
96 extern struct proto
*cf_dev_proto
;