diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2011-04-13 12:32:27 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2011-04-13 12:32:27 +0200 |
commit | 71ca77169d5d3e67459e46841b8bdb95accd8c2a (patch) | |
tree | 7d357b53c645b77957eddef4cd24979bf0418051 /sysdep/unix | |
parent | 4aef102be1e29d3450e53a20a6b2f96d50527139 (diff) | |
download | bird-71ca77169d5d3e67459e46841b8bdb95accd8c2a.tar bird-71ca77169d5d3e67459e46841b8bdb95accd8c2a.zip |
Adds support for several Linux kernel route attributes.
Diffstat (limited to 'sysdep/unix')
-rw-r--r-- | sysdep/unix/krt.c | 21 | ||||
-rw-r--r-- | sysdep/unix/krt.h | 4 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index 562dc71..7057070 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -890,6 +890,7 @@ krt_init(struct proto_config *c) p->p.accept_ra_types = RA_OPTIMAL; p->p.import_control = krt_import_control; p->p.rt_notify = krt_notify; + return &p->p; } @@ -907,15 +908,35 @@ krt_reconfigure(struct proto *p, struct proto_config *new) ; } + +static int +krt_get_attr(eattr * a, byte * buf, int buflen UNUSED) +{ + switch (a->id) + { + case EA_KRT_PREFSRC: + bsprintf(buf, "prefsrc"); + return GA_NAME; + case EA_KRT_REALM: + bsprintf(buf, "realm"); + return GA_NAME; + default: + return GA_UNKNOWN; + } +} + + struct protocol proto_unix_kernel = { name: "Kernel", template: "kernel%d", + attr_class: EAP_KRT, preconfig: krt_preconfig, postconfig: krt_postconfig, init: krt_init, start: krt_start, shutdown: krt_shutdown, reconfigure: krt_reconfigure, + get_attr: krt_get_attr, #ifdef KRT_ALLOW_LEARN dump: krt_dump, dump_attrs: krt_dump_attrs, diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h index ed61621..c88bc48 100644 --- a/sysdep/unix/krt.h +++ b/sysdep/unix/krt.h @@ -30,6 +30,10 @@ struct kif_proto; #define KRF_INSTALLED 0x80 /* This route should be installed in the kernel */ + +#define EA_KRT_PREFSRC EA_CODE(EAP_KRT, 0) +#define EA_KRT_REALM EA_CODE(EAP_KRT, 1) + /* Whenever we recognize our own routes, we allow learing of foreign routes */ #ifdef CONFIG_SELF_CONSCIOUS |