summaryrefslogtreecommitdiff
path: root/sysdep/unix/krt.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-04-13 12:32:27 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2011-04-13 12:32:27 +0200
commit71ca77169d5d3e67459e46841b8bdb95accd8c2a (patch)
tree7d357b53c645b77957eddef4cd24979bf0418051 /sysdep/unix/krt.c
parent4aef102be1e29d3450e53a20a6b2f96d50527139 (diff)
Adds support for several Linux kernel route attributes.
Diffstat (limited to 'sysdep/unix/krt.c')
-rw-r--r--sysdep/unix/krt.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index 562dc717..70570703 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,