diff options
Diffstat (limited to 'usr.sbin/bgpctl/parser.c')
-rw-r--r-- | usr.sbin/bgpctl/parser.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c index 90bd808eded..0aee651fc91 100644 --- a/usr.sbin/bgpctl/parser.c +++ b/usr.sbin/bgpctl/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.5 2004/03/11 16:34:21 henning Exp $ */ +/* $OpenBSD: parser.c,v 1.6 2004/05/21 11:52:32 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -55,12 +55,15 @@ 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_nexthop[]; +static const struct token t_prefix[]; static const struct token t_main[] = { { KEYWORD, "reload", RELOAD, NULL}, { KEYWORD, "show", SHOW, t_show}, { KEYWORD, "fib", FIB, t_fib}, { KEYWORD, "neighbor", NEIGHBOR, t_neighbor}, + { KEYWORD, "network", NONE, t_nexthop}, { ENDTOKEN, "", NONE, NULL} }; @@ -144,6 +147,19 @@ static const struct token t_show_ip[] = { { ENDTOKEN, "", NONE, NULL} }; +static const struct token t_nexthop[] = { + { KEYWORD, "add", NETWORK_ADD, t_prefix}, + { KEYWORD, "delete", NETWORK_REMOVE, t_prefix}, + { KEYWORD, "flush", NETWORK_FLUSH, NULL}, + { KEYWORD, "show", NETWORK_SHOW, NULL}, + { ENDTOKEN, "", NONE, NULL} +}; + +static const struct token t_prefix[] = { + { PREFIX, "", NONE, NULL}, + { ENDTOKEN, "", NONE, NULL} +}; + static struct parse_result res; const struct token *match_token(const char *, const struct token []); |