summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2005-09-20 14:40:33 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2005-09-20 14:40:33 +0000
commitee62390afe00f47f4da8a2fbc68c4e8153588158 (patch)
tree05abc6a9e93db629e90366e97f491e2196a2232f
parentb99e7f7e88b122baa797c60d78122cfff86e9515 (diff)
allow "show rib" to be limited to an address family too
-rw-r--r--usr.sbin/bgpctl/bgpctl.84
-rw-r--r--usr.sbin/bgpctl/bgpctl.c4
-rw-r--r--usr.sbin/bgpctl/parser.c3
-rw-r--r--usr.sbin/bgpd/rde.c7
4 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.8 b/usr.sbin/bgpctl/bgpctl.8
index 43bf0a4a685..8d896c5b64b 100644
--- a/usr.sbin/bgpctl/bgpctl.8
+++ b/usr.sbin/bgpctl/bgpctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bgpctl.8,v 1.28 2005/09/20 13:47:08 henning Exp $
+.\" $OpenBSD: bgpctl.8,v 1.29 2005/09/20 14:40:32 henning Exp $
.\"
.\" Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
.\"
@@ -160,6 +160,8 @@ Show all entries that are internal routes with no AS's in the AS path.
This is the same as the
.Ic show summary
command.
+.It Ar family
+limit the output to the given address family.
.El
.It Cm show summary
Show a list of all neighbors, including information about the session state
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index 823f319c70d..a2f81eb8b09 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.90 2005/09/20 13:51:05 henning Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.91 2005/09/20 14:40:32 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -194,7 +194,7 @@ main(int argc, char *argv[])
&msg, sizeof(msg));
} else
imsg_compose(ibuf, IMSG_CTL_SHOW_RIB, 0, 0, -1,
- NULL, 0);
+ &res->af, sizeof(res->af));
show_rib_summary_head();
break;
case RELOAD:
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c
index 4dfe6ca584c..ad70a145e70 100644
--- a/usr.sbin/bgpctl/parser.c
+++ b/usr.sbin/bgpctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.20 2005/09/20 13:48:58 henning Exp $ */
+/* $OpenBSD: parser.c,v 1.21 2005/09/20 14:40:32 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -119,6 +119,7 @@ static const struct token t_show_rib[] = {
{ ASTYPE, "transit-as", AS_TRANSIT, t_show_as},
{ ASTYPE, "empty-as", AS_EMPTY, NULL},
{ KEYWORD, "summary", SHOW_SUMMARY, NULL},
+ { FAMILY, "", NONE, NULL},
{ ENDTOKEN, "", NONE, NULL}
};
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 56e0cd525e8..a32d4429ef6 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.171 2005/09/20 13:31:53 henning Exp $ */
+/* $OpenBSD: rde.c,v 1.172 2005/09/20 14:40:32 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -390,12 +390,13 @@ rde_dispatch_imsg_session(struct imsgbuf *ibuf)
NULL, 0);
break;
case IMSG_CTL_SHOW_RIB:
- if (imsg.hdr.len != IMSG_HEADER_SIZE) {
+ if (imsg.hdr.len != IMSG_HEADER_SIZE + sizeof(af)) {
log_warnx("rde_dispatch: wrong imsg len");
break;
}
pid = imsg.hdr.pid;
- pt_dump(rde_dump_upcall, &pid, AF_UNSPEC);
+ memcpy(&af, imsg.data, sizeof(af));
+ pt_dump(rde_dump_upcall, &pid, af);
imsg_compose(ibuf_se, IMSG_CTL_END, 0, pid, -1,
NULL, 0);
break;