diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2007-03-28 12:34:09 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2007-03-28 12:34:09 +0000 |
commit | 00d2a05829dcd1881976428b02deb92bd90e33e9 (patch) | |
tree | f0d0a63ab84295d806c2ebbfdb541f2145d244e4 /usr.sbin/bgpctl/parser.c | |
parent | 34d950a9d7f2f8e26b6dacf7a3211b985f8d7b06 (diff) |
add support for bgpctl show rib community <community>
mostly from rivo nurges <rix@estpak.ee>, ok claudio
Diffstat (limited to 'usr.sbin/bgpctl/parser.c')
-rw-r--r-- | usr.sbin/bgpctl/parser.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c index b795397f2d4..d894bf7eeb0 100644 --- a/usr.sbin/bgpctl/parser.c +++ b/usr.sbin/bgpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.40 2007/03/07 11:55:54 henning Exp $ */ +/* $OpenBSD: parser.c,v 1.41 2007/03/28 12:34:08 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -73,6 +73,7 @@ static const struct token t_neighbor_modifiers[]; static const struct token t_show_as[]; static const struct token t_show_prefix[]; static const struct token t_show_ip[]; +static const struct token t_show_community[]; static const struct token t_network[]; static const struct token t_network_show[]; static const struct token t_prefix[]; @@ -135,6 +136,7 @@ static const struct token t_show_rib[] = { { ASTYPE, "transit-as", AS_TRANSIT, t_show_as}, { ASTYPE, "peer-as", AS_PEER, t_show_as}, { ASTYPE, "empty-as", AS_EMPTY, t_show_rib}, + { KEYWORD, "community", NONE, t_show_community}, { FLAG, "detail", F_CTL_DETAIL, t_show_rib}, { FLAG, "in", F_CTL_ADJ_IN, t_show_rib}, { FLAG, "out", F_CTL_ADJ_OUT, t_show_rib}, @@ -203,6 +205,11 @@ static const struct token t_show_ip[] = { { ENDTOKEN, "", NONE, NULL} }; +static const struct token t_show_community[] = { + { COMMUNITY, "", NONE, t_show_rib}, + { ENDTOKEN, "", NONE, NULL} +}; + static const struct token t_network[] = { { KEYWORD, "add", NETWORK_ADD, t_prefix}, { KEYWORD, "delete", NETWORK_REMOVE, t_prefix}, @@ -773,6 +780,9 @@ done: fs->action.community.as = as; fs->action.community.type = type; + r->community.as = as; + r->community.type = type; + TAILQ_INSERT_TAIL(&r->set, fs, entry); return (1); } |