summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2012-03-27 18:24:12 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2012-03-27 18:24:12 +0000
commit7f115f602a7dc59e87440535d1ad3b8c14c1bc73 (patch)
treec6b1b06368f778ce8e1730e15e92591ad0d0d178 /usr.sbin
parent074b33138df8b6c523644a2b2e3d17b6d8408202 (diff)
Introduce "selected" as show rib attribute to only show selected routes.
Can be combined like: bgpctl show rib nei peer1 selected to only show the routes that are used from neighbor peer1. Requested by and OK deraadt@, OK henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpctl/bgpctl.86
-rw-r--r--usr.sbin/bgpctl/parser.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.8 b/usr.sbin/bgpctl/bgpctl.8
index 30f9fe41463..77a7531672e 100644
--- a/usr.sbin/bgpctl/bgpctl.8
+++ b/usr.sbin/bgpctl/bgpctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bgpctl.8,v 1.56 2011/09/26 08:32:31 jmc Exp $
+.\" $OpenBSD: bgpctl.8,v 1.57 2012/03/27 18:24:11 claudio Exp $
.\"
.\" Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: September 26 2011 $
+.Dd $Mdocdate: March 27 2012 $
.Dt BGPCTL 8
.Os
.Sh NAME
@@ -306,6 +306,8 @@ Additionally, the following
are defined:
.Pp
.Bl -tag -width "detail" -compact
+.It Cm selected
+Show only selected routes.
.It Cm detail
Show more detailed output for matching routes.
.It Ar family
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c
index 13dc8e1cc0b..05744c844ee 100644
--- a/usr.sbin/bgpctl/parser.c
+++ b/usr.sbin/bgpctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.63 2011/09/21 10:37:51 claudio Exp $ */
+/* $OpenBSD: parser.c,v 1.64 2012/03/27 18:24:11 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -160,6 +160,7 @@ static const struct token t_show_rib[] = {
{ ASTYPE, "peer-as", AS_PEER, t_show_rib_as},
{ ASTYPE, "empty-as", AS_EMPTY, t_show_rib},
{ KEYWORD, "community", NONE, t_show_community},
+ { FLAG, "selected", F_CTL_ACTIVE, t_show_rib},
{ FLAG, "detail", F_CTL_DETAIL, t_show_rib},
{ FLAG, "in", F_CTL_ADJ_IN, t_show_rib},
{ FLAG, "out", F_CTL_ADJ_OUT, t_show_rib},