diff options
author | job <job@cvs.openbsd.org> | 2017-12-17 18:41:18 +0000 |
---|---|---|
committer | job <job@cvs.openbsd.org> | 2017-12-17 18:41:18 +0000 |
commit | 0f3e74d53b964be218fb137d6106926b66825031 (patch) | |
tree | 66bf7f21d6b7bf46b7e377db300225c143fa43c5 /usr.bin | |
parent | cb2adb66955ecb1740ff0b6d41c1ab85109fccdc (diff) |
Add community/large-community commands and retain parameter input in form
OK deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/bgplg/bgplg.c | 16 | ||||
-rw-r--r-- | usr.bin/bgplg/bgplg.h | 10 |
2 files changed, 18 insertions, 8 deletions
diff --git a/usr.bin/bgplg/bgplg.c b/usr.bin/bgplg/bgplg.c index fa1fb361168..3654e4112f1 100644 --- a/usr.bin/bgplg/bgplg.c +++ b/usr.bin/bgplg/bgplg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgplg.c,v 1.16 2016/04/05 21:57:58 sthen Exp $ */ +/* $OpenBSD: bgplg.c,v 1.17 2017/12/17 18:41:17 job Exp $ */ /* * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org> @@ -304,12 +304,18 @@ main(void) printf("<option value='%s'>%s</option>\n", cmds[i].name, cmds[i].name); } + + if ((req = lg_getarg("req=", query, query_length)) != NULL) { + /* Could be NULL */ + argv = lg_arg2argv(req, &argc); + } + printf("</select>\n" - "<input type='text' name='req'/>\n" + "<input type='text' value='%s' name='req'/>\n" "<input type='submit' value='submit'/>\n" "</div>\n" "</form>\n" - "<pre>\n"); + "<pre>\n", req ? req : ""); fflush(stdout); #ifdef DEBUG @@ -328,10 +334,6 @@ main(void) printf("unspecified command\n"); goto err; } - if ((req = lg_getarg("req=", query, query_length)) != NULL) { - /* Could be NULL */ - argv = lg_arg2argv(req, &argc); - } for (i = 0; cmds[i].name != NULL; i++) { if (strcmp(cmd, cmds[i].name) == 0) { diff --git a/usr.bin/bgplg/bgplg.h b/usr.bin/bgplg/bgplg.h index a33d32a561b..4be65ca40fd 100644 --- a/usr.bin/bgplg/bgplg.h +++ b/usr.bin/bgplg/bgplg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgplg.h,v 1.11 2017/08/09 19:15:18 phessler Exp $ */ +/* $OpenBSD: bgplg.h,v 1.12 2017/12/17 18:41:17 job Exp $ */ /* * Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org> @@ -49,6 +49,14 @@ struct cmd { { BGPCTL, "show", "ip", "bgp", "empty-as", NULL } }, \ { "show ip bgp summary", 0, 0, NULL, \ { BGPCTL, "show", "ip", "bgp", "summary", NULL } }, \ + { "show ip bgp community", 1, 1, "<community>", \ + { BGPCTL, "show","ip", "bgp", "community", NULL } }, \ + { "show ip bgp detail community", 1, 1, "<community>", \ + { BGPCTL, "show","ip", "bgp", "detail", "community", NULL } },\ + { "show ip bgp large-community", 1, 1, "<large-community>",\ + { BGPCTL, "show","ip", "bgp", "large-community", NULL } }, \ + { "show ip bgp detail large-community", 1, 1, "<large-community>",\ + { BGPCTL, "show","ip", "bgp", "detail", "large-community", NULL } },\ { "show ip bgp detail", 1, 1, "<prefix>", \ { BGPCTL, "show","ip", "bgp", "detail", NULL } }, \ { "show ip bgp detail as", 1, 1, "<prefix>", \ |