-.\" $OpenBSD: bgplgd.8,v 1.4 2022/10/17 15:42:19 claudio Exp $
+.\" $OpenBSD: bgplgd.8,v 1.5 2023/02/03 10:10:36 job Exp $
.\"
.\" Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: October 17 2022 $
+.Dd $Mdocdate: February 3 2023 $
.Dt BGPLGD 8
.Os
.Sh NAME
.Pq Ic valid | not-found | invalid
.Xc
Show only prefixes that match the specified Origin Validation State.
+.Ic avs Ns = Ns
+.Pq Ic valid | invalid | unknown
+.Xc
+Show only prefixes that match the specified ASPA Validation State.
.It Cm best Ns = Ns 1
Show only selected routes.
.It Cm error Ns = Ns 1
-/* $OpenBSD: bgplgd.h,v 1.1 2022/06/28 16:11:30 claudio Exp $ */
+/* $OpenBSD: bgplgd.h,v 1.2 2023/02/03 10:10:36 job Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
*
#define QS_ALL 12
#define QS_SHORTER 13
#define QS_ERROR 14
-#define QS_MAX 15
+#define QS_AVS 15
+#define QS_MAX 16
/* too add: empty-as, in, out, peer-as, source-as, transit-as */
(1 << QS_EXTCOMMUNITY) | (1 << QS_LARGECOMMUNITY) | \
(1 << QS_AF) | (1 << QS_RIB) | (1 << QS_OVS) | \
(1 << QS_BEST) | (1 << QS_ALL) | (1 << QS_SHORTER) | \
- (1 << QS_ERROR))
+ (1 << QS_ERROR) | (1 << QS_AVS))
struct cmd;
struct lg_ctx {
-/* $OpenBSD: qs.c,v 1.2 2022/08/25 16:49:18 claudio Exp $ */
+/* $OpenBSD: qs.c,v 1.3 2023/02/03 10:10:36 job Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
*
PREFIX,
NUMBER,
FAMILY,
- OVS
+ OVS,
+ AVS,
};
const struct qs {
{ QS_ALL, "all", ONE },
{ QS_SHORTER, "or-shorter", ONE },
{ QS_ERROR, "error", ONE },
+ { QS_AVS, "avs", AVS },
{ 0, NULL }
};
return 400;
}
break;
+ case AVS:
+ if (strcmp("unknown", val) == 0 ||
+ strcmp("valid", val) == 0 ||
+ strcmp("invalid", val) == 0) {
+ ctx->qs_args[qs].string = strdup(val);
+ if (ctx->qs_args[qs].string == NULL) {
+ lwarn("parse_value");
+ return 500;
+ }
+ } else {
+ lwarnx("%s: bad AVS value %s", qs2str(qs), val);
+ return 400;
+ }
+ break;
}
+
return 0;
}
if (argc < len)
argv[argc++] = ctx->qs_args[QS_OVS].string;
}
+ if (ctx->qs_set & (1 << QS_AVS)) {
+ if (argc < len)
+ argv[argc++] = "avs";
+ if (argc < len)
+ argv[argc++] = ctx->qs_args[QS_AVS].string;
+ }
/* BEST and ERROR are exclusive */
if (ctx->qs_args[QS_BEST].one) {
if (argc < len)