summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-05-29 13:32:24 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-05-29 13:32:24 +0200
commit6f68f066b63e992321ec1873a15c233f567b9aca (patch)
treee4adf6edcc622368c49ad0969442c3e5d7785f68
parent7c3d06b087946cbea4affa4a814e72b7a3556833 (diff)
downloadbird-6f68f066b63e992321ec1873a15c233f567b9aca.tar
bird-6f68f066b63e992321ec1873a15c233f567b9aca.zip
Add 'primary' configuration option.
-rw-r--r--sysdep/unix/krt.Y8
-rw-r--r--sysdep/unix/krt.h8
2 files changed, 16 insertions, 0 deletions
diff --git a/sysdep/unix/krt.Y b/sysdep/unix/krt.Y
index 11fd0c0..24f2dd2 100644
--- a/sysdep/unix/krt.Y
+++ b/sysdep/unix/krt.Y
@@ -68,6 +68,7 @@ kif_proto_start: proto_start DEVICE {
cf_kif = this_proto = proto_config_new(&proto_unix_iface, sizeof(struct kif_config));
this_proto->preference = DEF_PREF_DIRECT;
THIS_KIF->scan_time = 60;
+ init_list(&THIS_KIF->primary);
krt_if_construct(THIS_KIF);
}
;
@@ -81,6 +82,13 @@ kif_item:
/* Scan time of 0 means scan on startup only */
THIS_KIF->scan_time = $3;
}
+ | PRIMARY TEXT prefix_or_ipa {
+ struct kif_primary_item *kpi = cfg_alloc(sizeof (struct kif_primary_item));
+ kpi->pattern = $2;
+ kpi->prefix = $3.addr;
+ kpi->pxlen = $3.len;
+ add_tail(&THIS_KIF->primary, &kpi->n);
+ }
;
CF_CODE
diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h
index 10da1a8..607e699 100644
--- a/sysdep/unix/krt.h
+++ b/sysdep/unix/krt.h
@@ -86,10 +86,18 @@ void krt_got_route_async(struct krt_proto *p, struct rte *e, int new);
extern struct protocol proto_unix_iface;
+struct kif_primary_item {
+ node n;
+ byte *pattern;
+ ip_addr prefix;
+ int pxlen;
+};
+
struct kif_config {
struct proto_config c;
struct krt_if_params iface;
int scan_time; /* How often we re-scan interfaces */
+ list primary; /* Preferences for primary addresses */
};
struct kif_proto {