2 * BIRD Internet Routing Daemon -- Protocols
4 * (c) 1998--2000 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"
14 #include "lib/event.h"
15 #include "nest/route.h"
16 #include "conf/conf.h"
27 struct channel_config
;
59 extern struct protocol
*class_to_protocol
[PROTOCOL__MAX
];
64 char *template; /* Template for automatic generation of names */
65 int name_counter
; /* Counter for automatic name generation */
66 enum protocol_class
class; /* Machine readable protocol class */
67 uint preference
; /* Default protocol preference */
68 uint channel_mask
; /* Mask of accepted channel types (NB_*) */
69 uint proto_size
; /* Size of protocol data structure */
70 uint config_size
; /* Size of protocol config data structure */
72 void (*preconfig
)(struct protocol
*, struct config
*); /* Just before configuring */
73 void (*postconfig
)(struct proto_config
*); /* After configuring each instance */
74 struct proto
* (*init
)(struct proto_config
*); /* Create new instance */
75 int (*reconfigure
)(struct proto
*, struct proto_config
*); /* Try to reconfigure instance, returns success */
76 void (*dump
)(struct proto
*); /* Debugging dump */
77 void (*dump_attrs
)(struct rte
*); /* Dump protocol-dependent attributes */
78 int (*start
)(struct proto
*); /* Start the instance */
79 int (*shutdown
)(struct proto
*); /* Stop the instance */
80 void (*cleanup
)(struct proto
*); /* Called after shutdown when protocol became hungry/down */
81 void (*get_status
)(struct proto
*, byte
*buf
); /* Get instance status (for `show protocols' command) */
82 void (*get_route_info
)(struct rte
*, byte
*buf
); /* Get route information (for `show route' command) */
83 int (*get_attr
)(struct eattr
*, byte
*buf
, int buflen
); /* ASCIIfy dynamic attribute (returns GA_*) */
84 void (*show_proto_info
)(struct proto
*); /* Show protocol info (for `show protocols all' command) */
85 void (*copy_config
)(struct proto_config
*, struct proto_config
*); /* Copy config from given protocol instance */
88 void protos_build(void);
89 void proto_build(struct protocol
*);
90 void protos_preconfig(struct config
*);
91 void protos_commit(struct config
*new, struct config
*old
, int force_restart
, int type
);
92 struct proto
* proto_spawn(struct proto_config
*cf
, uint disabled
);
93 void protos_dump_all(void);
95 #define GA_UNKNOWN 0 /* Attribute not recognized */
96 #define GA_NAME 1 /* Result = name */
97 #define GA_FULL 2 /* Result = both name and value */
103 extern struct protocol
104 proto_device
, proto_radv
, proto_rip
, proto_static
, proto_mrt
,
105 proto_ospf
, proto_perf
,
106 proto_pipe
, proto_bgp
, proto_bfd
, proto_babel
, proto_rpki
;
109 * Routing Protocol Instance
112 struct proto_config
{
114 struct config
*global
; /* Global configuration data */
115 struct protocol
*protocol
; /* Protocol */
116 struct proto
*proto
; /* Instance we've created */
117 struct proto_config
*parent
; /* Parent proto_config for dynamic protocols */
120 int class; /* SYM_PROTO or SYM_TEMPLATE */
121 u8 net_type
; /* Protocol network type (NET_*), 0 for undefined */
122 u8 disabled
; /* Protocol enabled/disabled by default */
123 u32 debug
, mrtdump
; /* Debugging bitfields, both use D_* constants */
124 u32 router_id
; /* Protocol specific router ID */
126 list channels
; /* List of channel configs (struct channel_config) */
127 struct iface
*vrf
; /* Related VRF instance, NULL if global */
129 /* Check proto_reconfigure() and proto_copy_config() after changing struct proto_config */
131 /* Protocol-specific data follow... */
134 /* Protocol statistics */
136 /* Import - from protocol to core */
137 u32 imp_routes
; /* Number of routes successfully imported to the (adjacent) routing table */
138 u32 filt_routes
; /* Number of routes rejected in import filter but kept in the routing table */
139 u32 pref_routes
; /* Number of routes selected as best in the (adjacent) routing table */
140 u32 imp_updates_received
; /* Number of route updates received */
141 u32 imp_updates_invalid
; /* Number of route updates rejected as invalid */
142 u32 imp_updates_filtered
; /* Number of route updates rejected by filters */
143 u32 imp_updates_ignored
; /* Number of route updates rejected as already in route table */
144 u32 imp_updates_accepted
; /* Number of route updates accepted and imported */
145 u32 imp_withdraws_received
; /* Number of route withdraws received */
146 u32 imp_withdraws_invalid
; /* Number of route withdraws rejected as invalid */
147 u32 imp_withdraws_ignored
; /* Number of route withdraws rejected as already not in route table */
148 u32 imp_withdraws_accepted
; /* Number of route withdraws accepted and processed */
150 /* Export - from core to protocol */
151 u32 exp_routes
; /* Number of routes successfully exported to the protocol */
152 u32 exp_updates_received
; /* Number of route updates received */
153 u32 exp_updates_rejected
; /* Number of route updates rejected by protocol */
154 u32 exp_updates_filtered
; /* Number of route updates rejected by filters */
155 u32 exp_updates_accepted
; /* Number of route updates accepted and exported */
156 u32 exp_withdraws_received
; /* Number of route withdraws received */
157 u32 exp_withdraws_accepted
; /* Number of route withdraws accepted and processed */
161 node n
; /* Node in global proto_list */
162 struct protocol
*proto
; /* Protocol */
163 struct proto_config
*cf
; /* Configuration data */
164 struct proto_config
*cf_new
; /* Configuration we want to switch to after shutdown (NULL=delete) */
165 pool
*pool
; /* Pool containing local objects */
166 event
*event
; /* Protocol event */
168 list channels
; /* List of channels to rtables (struct channel) */
169 struct channel
*main_channel
; /* Primary channel */
170 struct rte_src
*main_source
; /* Primary route source */
171 struct iface
*vrf
; /* Related VRF instance, NULL if global */
173 char *name
; /* Name of this instance (== cf->name) */
174 u32 debug
; /* Debugging flags */
175 u32 mrtdump
; /* MRTDump flags */
176 uint active_channels
; /* Number of active channels */
177 byte net_type
; /* Protocol network type (NET_*), 0 for undefined */
178 byte disabled
; /* Manually disabled */
179 byte proto_state
; /* Protocol state machine (PS_*, see below) */
180 byte active
; /* From PS_START to cleanup after PS_STOP */
181 byte do_start
; /* Start actions are scheduled */
182 byte do_stop
; /* Stop actions are scheduled */
183 byte reconfiguring
; /* We're shutting down due to reconfiguration */
184 byte gr_recovery
; /* Protocol should participate in graceful restart recovery */
185 byte down_sched
; /* Shutdown is scheduled for later (PDS_*) */
186 byte down_code
; /* Reason for shutdown (PDC_* codes) */
187 u32 hash_key
; /* Random key used for hashing of neighbors */
188 btime last_state_change
; /* Time of last state transition */
189 char *last_state_name_announced
; /* Last state name we've announced to the user */
190 char *message
; /* State-change message, allocated from proto_pool */
193 * General protocol hooks:
195 * if_notify Notify protocol about interface state changes.
196 * ifa_notify Notify protocol about interface address changes.
197 * rt_notify Notify protocol about routing table updates.
198 * neigh_notify Notify protocol about neighbor cache events.
199 * make_tmp_attrs Add attributes to rta from from private attrs stored in rte. The route and rta MUST NOT be cached.
200 * store_tmp_attrs Store private attrs back to rte and undef added attributes. The route and rta MUST NOT be cached.
201 * preexport Called as the first step of the route exporting process.
202 * It can construct a new rte, add private attributes and
203 * decide whether the route shall be exported: 1=yes, -1=no,
204 * 0=process it through the export filter set by the user.
205 * reload_routes Request channel to reload all its routes to the core
206 * (using rte_update()). Returns: 0=reload cannot be done,
207 * 1= reload is scheduled and will happen (asynchronously).
208 * feed_begin Notify channel about beginning of route feeding.
209 * feed_end Notify channel about finish of route feeding.
212 void (*if_notify
)(struct proto
*, unsigned flags
, struct iface
*i
);
213 void (*ifa_notify
)(struct proto
*, unsigned flags
, struct ifa
*a
);
214 void (*rt_notify
)(struct proto
*, struct channel
*, struct network
*net
, struct rte
*new, struct rte
*old
);
215 void (*neigh_notify
)(struct neighbor
*neigh
);
216 void (*make_tmp_attrs
)(struct rte
*rt
, struct linpool
*pool
);
217 void (*store_tmp_attrs
)(struct rte
*rt
, struct linpool
*pool
);
218 int (*preexport
)(struct proto
*, struct rte
**rt
, struct linpool
*pool
);
219 void (*reload_routes
)(struct channel
*);
220 void (*feed_begin
)(struct channel
*, int initial
);
221 void (*feed_end
)(struct channel
*);
224 * Routing entry hooks (called only for routes belonging to this protocol):
226 * rte_recalculate Called at the beginning of the best route selection
227 * rte_better Compare two rte's and decide which one is better (1=first, 0=second).
228 * rte_same Compare two rte's and decide whether they are identical (1=yes, 0=no).
229 * rte_mergable Compare two rte's and decide whether they could be merged (1=yes, 0=no).
230 * rte_insert Called whenever a rte is inserted to a routing table.
231 * rte_remove Called whenever a rte is removed from the routing table.
234 int (*rte_recalculate
)(struct rtable
*, struct network
*, struct rte
*, struct rte
*, struct rte
*);
235 int (*rte_better
)(struct rte
*, struct rte
*);
236 int (*rte_same
)(struct rte
*, struct rte
*);
237 int (*rte_mergable
)(struct rte
*, struct rte
*);
238 struct rte
* (*rte_modify
)(struct rte
*, struct linpool
*);
239 void (*rte_insert
)(struct network
*, struct rte
*);
240 void (*rte_remove
)(struct network
*, struct rte
*);
242 /* Hic sunt protocol-specific data */
251 #define PDS_DISABLE 1 /* Proto disable scheduled */
252 #define PDS_RESTART 2 /* Proto restart scheduled */
254 #define PDC_CF_REMOVE 0x01 /* Removed in new config */
255 #define PDC_CF_DISABLE 0x02 /* Disabled in new config */
256 #define PDC_CF_RESTART 0x03 /* Restart due to reconfiguration */
257 #define PDC_CMD_DISABLE 0x11 /* Result of disable command */
258 #define PDC_CMD_RESTART 0x12 /* Result of restart command */
259 #define PDC_CMD_SHUTDOWN 0x13 /* Result of global shutdown */
260 #define PDC_CMD_GR_DOWN 0x14 /* Result of global graceful restart */
261 #define PDC_RX_LIMIT_HIT 0x21 /* Route receive limit reached */
262 #define PDC_IN_LIMIT_HIT 0x22 /* Route import limit reached */
263 #define PDC_OUT_LIMIT_HIT 0x23 /* Route export limit reached */
266 void *proto_new(struct proto_config
*);
267 void *proto_config_new(struct protocol
*, int class);
268 void proto_copy_config(struct proto_config
*dest
, struct proto_config
*src
);
269 void proto_clone_config(struct symbol
*sym
, struct proto_config
*parent
);
270 void proto_set_message(struct proto
*p
, char *msg
, int len
);
272 void graceful_restart_recovery(void);
273 void graceful_restart_init(void);
274 void graceful_restart_show_status(void);
275 void channel_graceful_restart_lock(struct channel
*c
);
276 void channel_graceful_restart_unlock(struct channel
*c
);
278 #define DEFAULT_GR_WAIT 240
280 void channel_show_limit(struct channel_limit
*l
, const char *dsc
);
281 void channel_show_info(struct channel
*c
);
283 void proto_cmd_show(struct proto
*, uintptr_t, int);
284 void proto_cmd_disable(struct proto
*, uintptr_t, int);
285 void proto_cmd_enable(struct proto
*, uintptr_t, int);
286 void proto_cmd_restart(struct proto
*, uintptr_t, int);
287 void proto_cmd_reload(struct proto
*, uintptr_t, int);
288 void proto_cmd_debug(struct proto
*, uintptr_t, int);
289 void proto_cmd_mrtdump(struct proto
*, uintptr_t, int);
291 void proto_apply_cmd(struct proto_spec ps
, void (* cmd
)(struct proto
*, uintptr_t, int), int restricted
, uintptr_t arg
);
292 struct proto
*proto_get_named(struct symbol
*, struct protocol
*);
295 #define CMD_RELOAD_IN 1
296 #define CMD_RELOAD_OUT 2
299 proto_get_router_id(struct proto_config
*pc
)
301 return pc
->router_id
? pc
->router_id
: pc
->global
->router_id
;
305 extern pool
*proto_pool
;
306 extern list proto_list
;
309 * Each protocol instance runs two different state machines:
311 * [P] The protocol machine: (implemented inside protocol)
318 * States: DOWN Protocol is down and it's waiting for the core
319 * requesting protocol start.
320 * START Protocol is waiting for connection with the rest
321 * of the network and it's not willing to accept
322 * packets. When it connects, it goes to UP state.
323 * UP Protocol is up and running. When the network
324 * connection breaks down or the core requests
325 * protocol to be terminated, it goes to STOP state.
326 * STOP Protocol is disconnecting from the network.
327 * After it disconnects, it returns to DOWN state.
329 * In: start() Called in DOWN state to request protocol startup.
330 * Returns new state: either UP or START (in this
331 * case, the protocol will notify the core when it
333 * stop() Called in START, UP or STOP state to request
334 * protocol shutdown. Returns new state: either
335 * DOWN or STOP (in this case, the protocol will
336 * notify the core when it finally comes DOWN).
338 * Out: proto_notify_state() -- called by protocol instance when
339 * it does any state transition not covered by
340 * return values of start() and stop(). This includes
341 * START->UP (delayed protocol startup), UP->STOP
342 * (spontaneous shutdown) and STOP->DOWN (delayed
351 void proto_notify_state(struct proto
*p
, unsigned state
);
354 * [F] The feeder machine: (implemented in core routines)
356 * HUNGRY ----> FEEDING
359 * FLUSHING <---- HAPPY
361 * States: HUNGRY Protocol either administratively down (i.e.,
362 * disabled by the user) or temporarily down
363 * (i.e., [P] is not UP)
364 * FEEDING The protocol came up and we're feeding it
365 * initial routes. [P] is UP.
366 * HAPPY The protocol is up and it's receiving normal
367 * routing updates. [P] is UP.
368 * FLUSHING The protocol is down and we're removing its
369 * routes from the table. [P] is STOP or DOWN.
371 * Normal lifecycle of a protocol looks like:
373 * HUNGRY/DOWN --> HUNGRY/START --> HUNGRY/UP -->
374 * FEEDING/UP --> HAPPY/UP --> FLUSHING/STOP|DOWN -->
375 * HUNGRY/STOP|DOWN --> HUNGRY/DOWN
377 * Sometimes, protocol might switch from HAPPY/UP to FEEDING/UP
378 * if it wants to refeed the routes (for example BGP does so
379 * as a result of received ROUTE-REFRESH request).
388 #define D_STATES 1 /* [core] State transitions */
389 #define D_ROUTES 2 /* [core] Routes passed by the filters */
390 #define D_FILTERS 4 /* [core] Routes rejected by the filters */
391 #define D_IFACES 8 /* [core] Interface events */
392 #define D_EVENTS 16 /* Protocol events */
393 #define D_PACKETS 32 /* Packets sent/received */
396 #define TRACE(flags, msg, args...) \
397 do { if (p->p.debug & flags) log(L_TRACE "%s: " msg, p->p.name , ## args ); } while(0)
405 #define MD_STATES 1 /* Protocol state changes (BGP4MP_MESSAGE_AS4) */
406 #define MD_MESSAGES 2 /* Protocol packets (BGP4MP_MESSAGE_AS4) */
409 * Known unique protocol instances as referenced by config routines
412 extern struct proto_config
*cf_dev_proto
;
419 #define PLD_RX 0 /* Receive limit */
420 #define PLD_IN 1 /* Import limit */
421 #define PLD_OUT 2 /* Export limit */
424 #define PLA_NONE 0 /* No limit */
425 #define PLA_WARN 1 /* Issue log warning */
426 #define PLA_BLOCK 2 /* Block new routes */
427 #define PLA_RESTART 4 /* Force protocol restart */
428 #define PLA_DISABLE 5 /* Shutdown and disable protocol */
430 #define PLS_INITIAL 0 /* Initial limit state after protocol start */
431 #define PLS_ACTIVE 1 /* Limit was hit */
432 #define PLS_BLOCKED 2 /* Limit is active and blocking new routes */
434 struct channel_limit
{
435 u32 limit
; /* Maximum number of prefixes */
436 u8 action
; /* Action to take (PLA_*) */
437 u8 state
; /* State of limit (PLS_*) */
440 void channel_notify_limit(struct channel
*c
, struct channel_limit
*l
, int dir
, u32 rt_count
);
447 struct channel_class
{
448 uint channel_size
; /* Size of channel data structure */
449 uint config_size
; /* Size of channel config data structure */
451 void (*init
)(struct channel
*, struct channel_config
*); /* Create new instance */
452 int (*reconfigure
)(struct channel
*, struct channel_config
*); /* Try to reconfigure instance, returns success */
453 int (*start
)(struct channel
*); /* Start the instance */
454 void (*shutdown
)(struct channel
*); /* Stop the instance */
455 void (*cleanup
)(struct channel
*); /* Channel finished flush */
457 void (*copy_config
)(struct channel_config
*, struct channel_config
*); /* Copy config from given channel instance */
460 void (*preconfig
)(struct protocol
*, struct config
*); /* Just before configuring */
461 void (*postconfig
)(struct proto_config
*); /* After configuring each instance */
464 void (*dump
)(struct proto
*); /* Debugging dump */
465 void (*dump_attrs
)(struct rte
*); /* Dump protocol-dependent attributes */
467 void (*get_status
)(struct proto
*, byte
*buf
); /* Get instance status (for `show protocols' command) */
468 void (*get_route_info
)(struct rte
*, byte
*buf
); /* Get route information (for `show route' command) */
469 int (*get_attr
)(struct eattr
*, byte
*buf
, int buflen
); /* ASCIIfy dynamic attribute (returns GA_*) */
470 void (*show_proto_info
)(struct proto
*); /* Show protocol info (for `show protocols all' command) */
475 extern struct channel_class channel_bgp
;
477 struct channel_config
{
480 const struct channel_class
*channel
;
482 struct proto_config
*parent
; /* Where channel is defined (proto or template) */
483 struct rtable_config
*table
; /* Table we're attached to */
484 const struct filter
*in_filter
, *out_filter
; /* Attached filters */
485 struct channel_limit rx_limit
; /* Limit for receiving routes from protocol
486 (relevant when in_keep_filtered is active) */
487 struct channel_limit in_limit
; /* Limit for importing routes from protocol */
488 struct channel_limit out_limit
; /* Limit for exporting routes to protocol */
490 u8 net_type
; /* Routing table network type (NET_*), 0 for undefined */
491 u8 ra_mode
; /* Mode of received route advertisements (RA_*) */
492 u16 preference
; /* Default route preference */
493 u8 merge_limit
; /* Maximal number of nexthops for RA_MERGED */
494 u8 in_keep_filtered
; /* Routes rejected in import filter are kept */
498 node n
; /* Node in proto->channels */
499 node table_node
; /* Node in table->channels */
501 const char *name
; /* Channel name (may be NULL) */
502 const struct channel_class
*channel
;
505 struct rtable
*table
;
506 const struct filter
*in_filter
; /* Input filter */
507 const struct filter
*out_filter
; /* Output filter */
508 struct channel_limit rx_limit
; /* Receive limit (for in_keep_filtered) */
509 struct channel_limit in_limit
; /* Input limit */
510 struct channel_limit out_limit
; /* Output limit */
512 struct event
*feed_event
; /* Event responsible for feeding */
513 struct fib_iterator feed_fit
; /* Routing table iterator used during feeding */
514 struct proto_stats stats
; /* Per-channel protocol statistics */
516 u8 net_type
; /* Routing table network type (NET_*), 0 for undefined */
517 u8 ra_mode
; /* Mode of received route advertisements (RA_*) */
518 u16 preference
; /* Default route preference */
519 u8 merge_limit
; /* Maximal number of nexthops for RA_MERGED */
520 u8 in_keep_filtered
; /* Routes rejected in import filter are kept */
522 u8 stale
; /* Used in reconfiguration */
525 u8 export_state
; /* Route export state (ES_*, see below) */
528 u8 refeeding
; /* We are refeeding (valid only if export_state == ES_FEEDING) */
529 u8 reloadable
; /* Hook reload_routes() is allowed on the channel */
530 u8 gr_lock
; /* Graceful restart mechanism should wait for this channel */
531 u8 gr_wait
; /* Route export to channel is postponed until graceful restart */
533 btime last_state_change
; /* Time of last state transition */
534 btime last_tx_filter_change
;
536 struct rtable
*in_table
; /* Internal table for received routes */
537 struct event
*reload_event
; /* Event responsible for reloading from in_table */
538 struct fib_iterator reload_fit
; /* Iterator in in_table used during reloading */
539 u8 reload_active
; /* Iterator reload_fit is linked */
546 * CS_DOWN - The initial and the final state of a channel. There is no route
547 * exchange between the protocol and the table. Channel is not counted as
548 * active. Channel keeps a ptr to the table, but do not lock the table and is
549 * not linked in the table. Generally, new closed channels are created in
550 * protocols' init() hooks. The protocol is expected to explicitly activate its
551 * channels (by calling channel_init() or channel_open()).
553 * CS_START - The channel as a connection between the protocol and the table is
554 * initialized (counted as active by the protocol, linked in the table and keeps
555 * the table locked), but there is no current route exchange. There still may be
556 * routes associated with the channel in the routing table if the channel falls
557 * to CS_START from CS_UP. Generally, channels are initialized in protocols'
558 * start() hooks when going to PS_START.
560 * CS_UP - The channel is initialized and the route exchange is allowed. Note
561 * that even in CS_UP state, route export may still be down (ES_DOWN) by the
562 * core decision (e.g. waiting for table convergence after graceful restart).
563 * I.e., the protocol decides to open the channel but the core decides to start
564 * route export. Route import (caused by rte_update() from the protocol) is not
565 * restricted by that and is on volition of the protocol. Generally, channels
566 * are opened in protocols' start() hooks when going to PS_UP.
568 * CS_FLUSHING - The transitional state between initialized channel and closed
569 * channel. The channel is still initialized, but no route exchange is allowed.
570 * Instead, the associated table is running flush loop to remove routes imported
571 * through the channel. After that, the channel changes state to CS_DOWN and
572 * is detached from the table (the table is unlocked and the channel is unlinked
573 * from it). Unlike other states, the CS_FLUSHING state is not explicitly
574 * entered or left by the protocol. A protocol may request to close a channel
575 * (by calling channel_close()), which causes the channel to change state to
576 * CS_FLUSHING and later to CS_DOWN. Also note that channels are closed
577 * automatically by the core when the protocol is going down.
579 * Allowed transitions:
581 * CS_DOWN -> CS_START / CS_UP
582 * CS_START -> CS_UP / CS_FLUSHING
583 * CS_UP -> CS_START / CS_FLUSHING
584 * CS_FLUSHING -> CS_DOWN (automatic)
590 #define CS_FLUSHING 3
597 struct channel_config
*proto_cf_find_channel(struct proto_config
*p
, uint net_type
);
598 static inline struct channel_config
*proto_cf_main_channel(struct proto_config
*pc
)
599 { struct channel_config
*cc
= HEAD(pc
->channels
); return NODE_VALID(cc
) ? cc
: NULL
; }
601 struct channel
*proto_find_channel_by_table(struct proto
*p
, struct rtable
*t
);
602 struct channel
*proto_find_channel_by_name(struct proto
*p
, const char *n
);
603 struct channel
*proto_add_channel(struct proto
*p
, struct channel_config
*cf
);
604 int proto_configure_channel(struct proto
*p
, struct channel
**c
, struct channel_config
*cf
);
606 void channel_set_state(struct channel
*c
, uint state
);
607 void channel_setup_in_table(struct channel
*c
);
608 void channel_schedule_reload(struct channel
*c
);
610 static inline void channel_init(struct channel
*c
) { channel_set_state(c
, CS_START
); }
611 static inline void channel_open(struct channel
*c
) { channel_set_state(c
, CS_UP
); }
612 static inline void channel_close(struct channel
*c
) { channel_set_state(c
, CS_FLUSHING
); }
614 void channel_request_feeding(struct channel
*c
);
615 void *channel_config_new(const struct channel_class
*cc
, const char *name
, uint net_type
, struct proto_config
*proto
);
616 void *channel_config_get(const struct channel_class
*cc
, const char *name
, uint net_type
, struct proto_config
*proto
);
617 int channel_reconfigure(struct channel
*c
, struct channel_config
*cf
);
620 /* Moved from route.h to avoid dependency conflicts */
621 static inline void rte_update(struct proto
*p
, const net_addr
*n
, rte
*new) { rte_update2(p
->main_channel
, n
, new, p
->main_source
); }
624 rte_update3(struct channel
*c
, const net_addr
*n
, rte
*new, struct rte_src
*src
)
626 if (c
->in_table
&& !rte_update_in(c
, n
, new, src
))
629 rte_update2(c
, n
, new, src
);