From: job Date: Sun, 17 Dec 2017 18:41:17 +0000 (+0000) Subject: Add community/large-community commands and retain parameter input in form X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a4478c91a28270fa495e05a7db643c2dba75cff5;p=openbsd Add community/large-community commands and retain parameter input in form OK deraadt@ --- 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 @@ -304,12 +304,18 @@ main(void) printf("\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("\n" - "\n" + "\n" "\n" "\n" "\n" - "
\n");
+	    "
\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 
@@ -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>",		\