Commit c01a9466 authored by Ondřej Zajíček's avatar Ondřej Zajíček

Implements multiple routing table support for FreeBSD and OpenBSD.

Inspired by the patch from Alexander V. Chernikov.
parent c6964c30
krt-sock.c
krt-sock.Y
krt-sys.h
sysio.h
/*
* BIRD -- BSD Kernel Syncer Configuration
*
* (c) 1999--2000 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
CF_HDR
CF_DECLS
CF_KEYWORDS(KERNEL, TABLE)
CF_GRAMMAR
CF_ADDTO(kern_proto, kern_proto kern_sys_item ';')
kern_sys_item:
KERNEL TABLE expr {
if ($3 && (krt_max_tables == 1))
cf_error("Multiple kernel routing tables not supported");
if ($3 < 0 || $3 >= krt_max_tables)
cf_error("Kernel table id must be in range 0-%d", krt_max_tables - 1);
THIS_KRT->sys.table_id = $3;
}
;
CF_CODE
CF_END
This diff is collapsed.
......@@ -9,6 +9,7 @@
#ifndef _BIRD_KRT_SYS_H_
#define _BIRD_KRT_SYS_H_
struct birdsock;
/* Kernel interfaces */
......@@ -30,20 +31,18 @@ static inline void kif_sys_copy_config(struct kif_config *d UNUSED, struct kif_c
/* Kernel routes */
extern int krt_max_tables;
struct krt_params {
int table_id; /* Kernel table ID we sync with */
};
struct krt_state {
struct birdsock *sk;
};
static inline void krt_sys_init(struct krt_proto *p UNUSED) { }
static inline int krt_sys_reconfigure(struct krt_proto *p UNUSED, struct krt_config *n UNUSED, struct krt_config *o UNUSED) { return 1; }
static inline void krt_sys_preconfig(struct config *c UNUSED) { }
static inline void krt_sys_postconfig(struct krt_config *c UNUSED) { }
static inline void krt_sys_init_config(struct krt_config *c UNUSED) { }
static inline void krt_sys_copy_config(struct krt_config *d UNUSED, struct krt_config *s UNUSED) { }
#endif
......@@ -10,6 +10,7 @@
#define CONFIG_AUTO_ROUTES
#define CONFIG_SELF_CONSCIOUS
#define CONFIG_MULTIPLE_TABLES
#define CONFIG_SKIP_MC_BIND
......
......@@ -8,6 +8,7 @@
#define CONFIG_AUTO_ROUTES
#define CONFIG_SELF_CONSCIOUS
#define CONFIG_MULTIPLE_TABLES
#define CONFIG_SKIP_MC_BIND
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment