-.\" $OpenBSD: bgpctl.8,v 1.99 2021/06/16 16:24:12 job Exp $
+.\" $OpenBSD: bgpctl.8,v 1.100 2021/08/09 08:24:36 claudio Exp $
.\"
.\" Copyright (c) 2003 Henning Brauer <henning@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: June 16 2021 $
+.Dd $Mdocdate: August 9 2021 $
.Dt BGPCTL 8
.Os
.Sh NAME
Show only entries from the specified peer.
.It Cm neighbor group Ar description
Show only entries from the specified peer group.
+.It Cm path-id Ar pathid
+Show only entries which match the specified
+.Ar pathid .
+Must be used together with either
+.Cm neighbor
+or
+.Cm out .
.It Cm peer-as Ar as
Show all entries with
.Ar as
-/* $OpenBSD: bgpctl.c,v 1.272 2021/08/02 16:51:39 claudio Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.273 2021/08/09 08:24:36 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
ribreq.neighbor = neighbor;
strlcpy(ribreq.rib, res->rib, sizeof(ribreq.rib));
ribreq.aid = res->aid;
+ ribreq.path_id = res->pathid;
ribreq.flags = res->flags;
imsg_compose(ibuf, type, 0, 0, -1, &ribreq, sizeof(ribreq));
break;
-/* $OpenBSD: parser.c,v 1.106 2021/02/16 08:30:21 claudio Exp $ */
+/* $OpenBSD: parser.c,v 1.107 2021/08/09 08:24:36 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
RD,
FAMILY,
RTABLE,
- FILENAME
+ FILENAME,
+ PATHID,
};
struct token {
static const struct token t_fib_table[];
static const struct token t_show_fib_table[];
static const struct token t_communication[];
+static const struct token t_show_rib_path[];
static const struct token t_main[] = {
{ KEYWORD, "reload", RELOAD, t_communication},
{ 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, "ovs", NONE, t_show_ovs},
+ { KEYWORD, "path-id", NONE, t_show_rib_path},
{ KEYWORD, "table", NONE, t_show_rib_rib},
{ KEYWORD, "summary", SHOW_SUMMARY, t_show_summary},
{ KEYWORD, "memory", SHOW_RIB_MEM, NULL},
- { KEYWORD, "ovs", NONE, t_show_ovs},
{ FAMILY, "", NONE, t_show_rib},
{ PREFIX, "", NONE, t_show_prefix},
{ ENDTOKEN, "", NONE, NULL}
{ ENDTOKEN, "", NONE, NULL}
};
+static const struct token t_show_rib_path[] = {
+ { PATHID, "", NONE, t_show_rib},
+ { ENDTOKEN, "", NONE, NULL}
+};
+
static struct parse_result res;
const struct token *match_token(int *argc, char **argv[],
case PREPSELF:
case WEIGHT:
case RTABLE:
+ case PATHID:
if (word != NULL && wordlen > 0 &&
parse_number(word, &res, table[i].type)) {
match++;
case PREPNBR:
case PREPSELF:
case WEIGHT:
+ case PATHID:
fprintf(stderr, " <number>\n");
break;
case RTABLE:
errx(1, "number is %s: %s", errstr, word);
/* number was parseable */
- if (type == RTABLE) {
+ switch (type) {
+ case RTABLE:
r->rtableid = uval;
return (1);
+ case PATHID:
+ r->pathid = uval;
+ r->flags |= F_CTL_HAS_PATHID;
+ return (1);
+ default:
+ break;
}
if ((fs = calloc(1, sizeof(struct filter_set))) == NULL)