summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/bgpd/bgpd.h9
-rw-r--r--usr.sbin/bgpd/rde.c17
-rw-r--r--usr.sbin/bgpd/rde.h6
-rw-r--r--usr.sbin/bgpd/rde_rib.c10
4 files changed, 17 insertions, 25 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index 06548ec2dea..c78ebd1fb40 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.250 2009/12/16 15:40:55 claudio Exp $ */
+/* $OpenBSD: bgpd.h,v 1.251 2010/01/10 00:15:09 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -579,8 +579,8 @@ struct ctl_show_rib_request {
pid_t pid;
u_int16_t flags;
enum imsg_type type;
- sa_family_t af;
u_int8_t prefixlen;
+ u_int8_t aid;
};
enum filter_actions {
@@ -743,11 +743,6 @@ struct filter_set {
enum action_types type;
};
-struct rrefresh {
- u_int16_t afi;
- u_int8_t safi;
-};
-
struct rde_rib {
SIMPLEQ_ENTRY(rde_rib) entry;
char name[PEER_DESCR_LEN];
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 1ac402e010a..cb98b3cf7e3 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.280 2010/01/05 08:49:57 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.281 2010/01/10 00:15:09 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -658,12 +658,12 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf)
else if (ribs[rid].state == RIB_NEW)
rib_dump(&ribs[0],
rde_softreconfig_load, &ribs[rid],
- AF_UNSPEC);
+ AID_UNSPEC);
}
/* sync local-RIB first */
if (reconf_in)
rib_dump(&ribs[0], rde_softreconfig_in, NULL,
- AF_UNSPEC);
+ AID_UNSPEC);
/* then sync peers */
if (reconf_out) {
int i;
@@ -672,7 +672,7 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf)
/* already synced by _load */
continue;
rib_dump(&ribs[i], rde_softreconfig_out,
- NULL, AF_UNSPEC);
+ NULL, AID_UNSPEC);
}
}
@@ -2010,7 +2010,7 @@ rde_dump_ctx_new(struct ctl_show_rib_request *req, pid_t pid,
}
ctx->ribctx.ctx_done = rde_dump_done;
ctx->ribctx.ctx_arg = ctx;
- ctx->ribctx.ctx_af = ctx->req.af;
+ ctx->ribctx.ctx_aid = ctx->req.aid;
rib_dump_r(&ctx->ribctx);
}
@@ -2049,7 +2049,7 @@ rde_dump_mrt_new(struct mrt *mrt, pid_t pid, int fd)
ctx->ribctx.ctx_upcall = mrt_dump_upcall;
ctx->ribctx.ctx_done = mrt_done;
ctx->ribctx.ctx_arg = &ctx->mrt;
- ctx->ribctx.ctx_af = AF_UNSPEC;
+ ctx->ribctx.ctx_aid = AID_UNSPEC;
LIST_INSERT_HEAD(&rde_mrts, ctx, entry);
rde_mrt_cnt++;
rib_dump_r(&ctx->ribctx);
@@ -2736,7 +2736,6 @@ void
peer_dump(u_int32_t id, u_int8_t aid)
{
struct rde_peer *peer;
- sa_family_t af; /* XXX needs to be replaced with aid */
peer = peer_get(id);
if (peer == NULL) {
@@ -2744,12 +2743,10 @@ peer_dump(u_int32_t id, u_int8_t aid)
return;
}
- af = aid2af(aid);
-
if (peer->conf.announce_type == ANNOUNCE_DEFAULT_ROUTE)
up_generate_default(rules_l, peer, aid);
else
- rib_dump(&ribs[peer->ribid], rde_up_dump_upcall, peer, af);
+ rib_dump(&ribs[peer->ribid], rde_up_dump_upcall, peer, aid);
if (peer->capa.restart)
peer_send_eor(peer, aid);
}
diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h
index c48ee243595..32ad0b951af 100644
--- a/usr.sbin/bgpd/rde.h
+++ b/usr.sbin/bgpd/rde.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.h,v 1.126 2009/12/18 15:51:37 claudio Exp $ */
+/* $OpenBSD: rde.h,v 1.127 2010/01/10 00:15:09 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and
@@ -250,7 +250,7 @@ struct rib_context {
void (*ctx_wait)(void *);
void *ctx_arg;
unsigned int ctx_count;
- sa_family_t ctx_af;
+ u_int8_t ctx_aid;
};
struct rib_entry {
@@ -361,7 +361,7 @@ void rib_free(struct rib *);
struct rib_entry *rib_get(struct rib *, struct bgpd_addr *, int);
struct rib_entry *rib_lookup(struct rib *, struct bgpd_addr *);
void rib_dump(struct rib *, void (*)(struct rib_entry *, void *),
- void *, sa_family_t);
+ void *, u_int8_t);
void rib_dump_r(struct rib_context *);
void rib_dump_runner(void);
int rib_dump_pending(void);
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c
index 1e0d8ddee11..e8c81c121bb 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.118 2009/12/01 14:28:05 claudio Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.119 2010/01/10 00:15:09 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -254,7 +254,7 @@ rib_empty(struct rib_entry *re)
void
rib_dump(struct rib *rib, void (*upcall)(struct rib_entry *, void *),
- void *arg, sa_family_t af)
+ void *arg, u_int8_t aid)
{
struct rib_context *ctx;
@@ -263,7 +263,7 @@ rib_dump(struct rib *rib, void (*upcall)(struct rib_entry *, void *),
ctx->ctx_rib = rib;
ctx->ctx_upcall = upcall;
ctx->ctx_arg = arg;
- ctx->ctx_af = af;
+ ctx->ctx_aid = aid;
rib_dump_r(ctx);
}
@@ -280,8 +280,8 @@ rib_dump_r(struct rib_context *ctx)
re = rib_restart(ctx);
for (i = 0; re != NULL; re = RB_NEXT(rib_tree, unused, re)) {
- if (ctx->ctx_af != AF_UNSPEC &&
- ctx->ctx_af != aid2af(re->prefix->aid))
+ if (ctx->ctx_aid != AID_UNSPEC &&
+ ctx->ctx_aid != re->prefix->aid)
continue;
if (ctx->ctx_count && i++ >= ctx->ctx_count &&
(re->flags & F_RIB_ENTRYLOCK) == 0) {