From patchwork Wed Jan 12 15:29:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Danilov X-Patchwork-Id: 78584 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0BB2DB6F1E for ; Thu, 13 Jan 2011 02:29:23 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754838Ab1ALP3T (ORCPT ); Wed, 12 Jan 2011 10:29:19 -0500 Received: from mail-vw0-f46.google.com ([209.85.212.46]:54199 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754699Ab1ALP3R (ORCPT ); Wed, 12 Jan 2011 10:29:17 -0500 Received: by vws16 with SMTP id 16so173903vws.19 for ; Wed, 12 Jan 2011 07:29:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=kQ6R5emvccCEncCj+LXl2XPAYSFXiGUW9AlvmzzUnlE=; b=sjcRdDbonVDlpU6RME1oj3GY/L1JpCY/CofuMtn3ReDZNB4plulnt9pY1MyUgAPOpp 5LA2NK00f8z1K31veo0uYqTF4fFSLU9X85sryUijPrindII3nbHzgGwzOLk2l3YRZbgq uorlj9SdHfAZq5mcvGGRttpTWJqSiWEJ1elI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=mDRtzgpfrU71N3FzDp8PlHkshOS4RUrNtsFJeSEek6j9xJSuf2yDyXf9lCqP1CeCD6 A77OrVZmFSpUGRWuyUIFrEJ61wsF7GZKI/QSFbwHu/B/Nrf4DtaaHAEhSp1Qzj8nfhIe eDYCPuL/b9N2CLbS4PmD4gmwcsXDaJtBkmFvE= MIME-Version: 1.0 Received: by 10.229.91.10 with SMTP id k10mr934386qcm.141.1294846156658; Wed, 12 Jan 2011 07:29:16 -0800 (PST) Received: by 10.229.79.4 with HTTP; Wed, 12 Jan 2011 07:29:16 -0800 (PST) Date: Wed, 12 Jan 2011 18:29:16 +0300 Message-ID: Subject: [patch] bridge-utils: show selected bridge From: Anton Danilov To: netdev@vger.kernel.org Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org diff --git a/brctl/brctl_cmd.c b/brctl/brctl_cmd.c index d37e99c..d95fe54 100644 --- a/brctl/brctl_cmd.c +++ b/brctl/brctl_cmd.c @@ -338,8 +338,14 @@ static int show_bridge(const char *name, void *arg) static int br_cmd_show(int argc, char *const* argv) { + int i = 0; + 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 +460,8 @@ static const struct command commands[] = { " \tset path cost" }, { 3, "setportprio", br_cmd_setportprio, " \tset port priority" }, - { 0, "show", br_cmd_show, "\t\t\tshow a list of bridges" }, + { 0, "show", br_cmd_show, + "[ ]\t\tshow a list of bridges" }, { 1, "showmacs", br_cmd_showmacs, "\t\tshow a list of mac addrs"}, { 1, "showstp", br_cmd_showstp,