aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Danilov <littlesmilingcloud@gmail.com>2011-01-13 14:47:43 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2011-01-13 14:47:43 -0800
commitfcaf399ec79c550884c5052d075919b7368bd104 (patch)
tree1cf387b1b103d7361af31ef7db4eb201a7e32102
parente83709515598a97e4c6c306ab2952ace13e8a398 (diff)
downloadandroid_external_brctl-fcaf399ec79c550884c5052d075919b7368bd104.tar.gz
android_external_brctl-fcaf399ec79c550884c5052d075919b7368bd104.tar.bz2
android_external_brctl-fcaf399ec79c550884c5052d075919b7368bd104.zip
show selected bridge
-rw-r--r--brctl/brctl_cmd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/brctl/brctl_cmd.c b/brctl/brctl_cmd.c
index d37e99c..b4ed104 100644
--- a/brctl/brctl_cmd.c
+++ b/brctl/brctl_cmd.c
@@ -338,8 +338,15 @@ static int show_bridge(const char *name, void *arg)
static int br_cmd_show(int argc, char *const* argv)
{
+ int i;
+
printf("bridge name\tbridge id\t\tSTP enabled\tinterfaces\n");
- br_foreach_bridge(show_bridge, NULL);
+ if (argc == 1)
+ br_foreach_bridge(show_bridge, NULL);
+ else
+ for(i = 2; i <= argc; i++)
+ show_bridge(argv[i - 1], NULL);
+
return 0;
}
@@ -454,7 +461,8 @@ static const struct command commands[] = {
"<bridge> <port> <cost>\tset path cost" },
{ 3, "setportprio", br_cmd_setportprio,
"<bridge> <port> <prio>\tset port priority" },
- { 0, "show", br_cmd_show, "\t\t\tshow a list of bridges" },
+ { 0, "show", br_cmd_show,
+ "[ <bridge> ]\t\tshow a list of bridges" },
{ 1, "showmacs", br_cmd_showmacs,
"<bridge>\t\tshow a list of mac addrs"},
{ 1, "showstp", br_cmd_showstp,