summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde_rib.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-06-04 04:46:43 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-06-04 04:46:43 +0000
commit035d32216e5a779b4d4f0ca72e4db41f735a46d1 (patch)
tree5d3819b36b8791df574773fadac0b9107f9c0150 /usr.sbin/bgpd/rde_rib.c
parentc0c9f0ce03e247b21f0baeee8ff1a90e92ea243e (diff)
Add "rde rib <name>" to the config and allow the rde to use these other RIBs.
Still a bit hackish, reload is missing and printconf as well. Looks good h@
Diffstat (limited to 'usr.sbin/bgpd/rde_rib.c')
-rw-r--r--usr.sbin/bgpd/rde_rib.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c
index b023c3c7fca..761db5db985 100644
--- a/usr.sbin/bgpd/rde_rib.c
+++ b/usr.sbin/bgpd/rde_rib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_rib.c,v 1.112 2009/06/03 20:22:04 claudio Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.113 2009/06/04 04:46:42 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -49,19 +49,19 @@ RB_GENERATE(rib_tree, rib_entry, rib_e, rib_compare);
/* RIB specific functions */
-void
-rib_init(void)
-{
- rib_new(1, "DEFAULT", 0);
- rib_new(0, "Adj-RIB-In", F_RIB_NOEVALUATE);
-}
-
u_int16_t
-rib_new(u_int16_t id, char *name, u_int16_t flags)
+rib_new(int id, char *name, u_int16_t flags)
{
struct rib *xribs;
size_t newsize;
+ if (id < 0) {
+ for (id = 0; id < rib_size; id++) {
+ if (*ribs[id].name == '\0')
+ break;
+ }
+ }
+
if (id >= rib_size) {
newsize = sizeof(struct rib) * (id + 1);
if ((xribs = realloc(ribs, newsize)) == NULL) {