From 074b33138df8b6c523644a2b2e3d17b6d8408202 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Tue, 27 Mar 2012 18:22:08 +0000 Subject: Introduce F_CTL_ACTIVE a flag to only show selected pathes. Requested and OK deraadt@, OK henning@ --- usr.sbin/bgpd/bgpd.h | 3 ++- usr.sbin/bgpd/rde.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 80e7e407522..16bf1e97f91 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.267 2011/09/20 21:19:06 claudio Exp $ */ +/* $OpenBSD: bgpd.h,v 1.268 2012/03/27 18:22:07 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -82,6 +82,7 @@ #define F_CTL_DETAIL 0x1000 /* only used by bgpctl */ #define F_CTL_ADJ_IN 0x2000 #define F_CTL_ADJ_OUT 0x4000 +#define F_CTL_ACTIVE 0x8000 /* * Limit the number of control messages generated by the RDE and queued in diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 46d140ba97a..fdc2122743f 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.311 2011/09/20 21:19:06 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.312 2012/03/27 18:22:07 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -2191,6 +2191,8 @@ rde_dump_filter(struct prefix *p, struct ctl_show_rib_request *req) !community_match(p->aspath, req->community.as, req->community.type)) return; + if ((req->flags & F_CTL_ACTIVE) && p->rib->active != p) + return; rde_dump_rib_as(p, p->aspath, req->pid, req->flags); } else if (req->flags & F_CTL_ADJ_OUT) { if (p->rib->active != p) -- cgit v1.2.3