Add the plumbing in bgplgd to allow for leaked and invalid show rib
options.
--
:wq Claudio
Index: bgplgd.h
===================================================================
RCS file: /cvs/src/usr.sbin/bgplgd/bgplgd.h,v
retrieving revision 1.2
diff -u -p -r1.2 bgplgd.h
--- bgplgd.h 3 Feb 2023 10:10:36 -0000 1.2
+++ bgplgd.h 13 Mar 2023 17:01:16 -0000
@@ -30,7 +30,9 @@
#define QS_SHORTER 13
#define QS_ERROR 14
#define QS_AVS 15
-#define QS_MAX 16
+#define QS_INVALID 16
+#define QS_LEAKED 17
+#define QS_MAX 18
/* too add: empty-as, in, out, peer-as, source-as, transit-as */
@@ -41,7 +43,8 @@
(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_AVS))
+ (1 << QS_ERROR) | (1 << QS_AVS) | (1 << QS_INVALID) | \
+ (1 << QS_LEAKED))
struct cmd;
struct lg_ctx {
Index: qs.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgplgd/qs.c,v
retrieving revision 1.3
diff -u -p -r1.3 qs.c
--- qs.c 3 Feb 2023 10:10:36 -0000 1.3
+++ qs.c 13 Mar 2023 17:03:38 -0000
@@ -55,6 +55,8 @@ const struct qs {
{ QS_SHORTER, "or-shorter", ONE },
{ QS_ERROR, "error", ONE },
{ QS_AVS, "avs", AVS },
+ { QS_INVALID, "invalid", ONE },
+ { QS_LEAKED, "leaked", ONE },
{ 0, NULL }
};
@@ -380,13 +382,19 @@ qs_argv(char **argv, size_t argc, size_t
if (argc < len)
argv[argc++] = ctx->qs_args[QS_AVS].string;
}
- /* BEST and ERROR are exclusive */
+ /* BEST, ERROR, INVALID and LEAKED are exclusive */
if (ctx->qs_args[QS_BEST].one) {
if (argc < len)
argv[argc++] = "best";
} else if (ctx->qs_args[QS_ERROR].one) {
if (argc < len)
argv[argc++] = "error";
+ } else if (ctx->qs_args[QS_INVALID].one) {
+ if (argc < len)
+ argv[argc++] = "invalid";
+ } else if (ctx->qs_args[QS_LEAKED].one) {
+ if (argc < len)
+ argv[argc++] = "leaked";
}
/* prefix must be last for show rib */