From bfee927a61d2eaa0450326b34ad113bc0613270a Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 24 Jan 2023 14:14:15 +0000 Subject: [PATCH] Implmement `bgpctl show rib avs invalid` and firends. This will show all invalid ASPA paths. OK tb@ --- usr.sbin/bgpctl/bgpctl.8 | 6 ++++-- usr.sbin/bgpctl/parser.c | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bgpctl/bgpctl.8 b/usr.sbin/bgpctl/bgpctl.8 index b25112b1ad4..f76c009bfae 100644 --- a/usr.sbin/bgpctl/bgpctl.8 +++ b/usr.sbin/bgpctl/bgpctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: bgpctl.8,v 1.103 2022/12/22 19:53:24 kn Exp $ +.\" $OpenBSD: bgpctl.8,v 1.104 2023/01/24 14:14:15 claudio Exp $ .\" .\" Copyright (c) 2003 Henning Brauer .\" @@ -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: December 22 2022 $ +.Dd $Mdocdate: January 24 2023 $ .Dt BGPCTL 8 .Os .Sh NAME @@ -375,6 +375,8 @@ Show all entries with anywhere but rightmost. .It Cm ovs Pq Ic valid | not-found | invalid Show all entries with matching Origin Validation State (OVS). +.It Cm avs Pq Ic valid | unknown | invalid +Show all entries with matching ASAP Validation State (AVS). .El .Pp Additionally, the following diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c index b03e4dcf24e..1e467b314a0 100644 --- a/usr.sbin/bgpctl/parser.c +++ b/usr.sbin/bgpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.118 2022/11/10 10:47:30 mbuhl Exp $ */ +/* $OpenBSD: parser.c,v 1.119 2023/01/24 14:14:15 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -77,6 +77,7 @@ static const struct token t_show[]; static const struct token t_show_summary[]; static const struct token t_show_fib[]; static const struct token t_show_rib[]; +static const struct token t_show_avs[]; static const struct token t_show_ovs[]; static const struct token t_show_mrt[]; static const struct token t_show_mrt_file[]; @@ -181,6 +182,7 @@ static const struct token t_show_rib[] = { { FLAG, "in", F_CTL_ADJ_IN, t_show_rib}, { FLAG, "out", F_CTL_ADJ_OUT, t_show_rib}, { KEYWORD, "neighbor", NONE, t_show_rib_neigh}, + { KEYWORD, "avs", NONE, t_show_avs}, { KEYWORD, "ovs", NONE, t_show_ovs}, { KEYWORD, "path-id", NONE, t_show_rib_path}, { KEYWORD, "table", NONE, t_show_rib_rib}, @@ -191,6 +193,13 @@ static const struct token t_show_rib[] = { { ENDTOKEN, "", NONE, NULL} }; +static const struct token t_show_avs[] = { + { FLAG, "valid" , F_CTL_AVS_VALID, t_show_rib}, + { FLAG, "invalid", F_CTL_AVS_INVALID, t_show_rib}, + { FLAG, "unknonw", F_CTL_AVS_UNKNOWN, t_show_rib}, + { ENDTOKEN, "", NONE, NULL} +}; + static const struct token t_show_ovs[] = { { FLAG, "valid" , F_CTL_OVS_VALID, t_show_rib}, { FLAG, "invalid", F_CTL_OVS_INVALID, t_show_rib}, -- 2.20.1