aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/config/swconfig/src/cli.c
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-04-09 14:19:13 +0000
committerJohn Crispin <blogic@openwrt.org>2013-04-09 14:19:13 +0000
commitd0f94eff4a8c6b4f71004b021db49210450d2572 (patch)
treea3ea430dcef3781b3947206602f5c2b80e14f8bf /package/network/config/swconfig/src/cli.c
parent3dc6fbf96d6a5b8916cd80092c05222172fe8d0b (diff)
downloadmaster-187ad058-d0f94eff4a8c6b4f71004b021db49210450d2572.tar.gz
master-187ad058-d0f94eff4a8c6b4f71004b021db49210450d2572.tar.bz2
master-187ad058-d0f94eff4a8c6b4f71004b021db49210450d2572.zip
[swconfig] add portmap support to userland
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36284 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/config/swconfig/src/cli.c')
-rw-r--r--package/network/config/swconfig/src/cli.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/package/network/config/swconfig/src/cli.c b/package/network/config/swconfig/src/cli.c
index 5f9e532bc0..2eb73bea38 100644
--- a/package/network/config/swconfig/src/cli.c
+++ b/package/network/config/swconfig/src/cli.c
@@ -41,6 +41,7 @@ enum {
CMD_LOAD,
CMD_HELP,
CMD_SHOW,
+ CMD_PORTMAP,
};
static void
@@ -214,6 +215,7 @@ int main(int argc, char **argv)
int cvlan = -1;
char *ckey = NULL;
char *cvalue = NULL;
+ char *csegment = NULL;
if((argc == 2) && !strcmp(argv[1], "list")) {
swlib_list();
@@ -252,6 +254,10 @@ int main(int argc, char **argv)
print_usage();
cmd = CMD_LOAD;
ckey = argv[++i];
+ } else if (!strcmp(arg, "portmap")) {
+ if (i + 1 < argc)
+ csegment = argv[++i];
+ cmd = CMD_PORTMAP;
} else if (!strcmp(arg, "show")) {
cmd = CMD_SHOW;
} else {
@@ -324,6 +330,9 @@ int main(int argc, char **argv)
case CMD_HELP:
list_attributes(dev);
break;
+ case CMD_PORTMAP:
+ swlib_print_portmap(dev, csegment);
+ break;
case CMD_SHOW:
if (cport >= 0 || cvlan >= 0) {
if (cport >= 0)