From patchwork Tue Mar 2 22:40:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 10 Return-Path: Received: from smtp121.mail.ukl.yahoo.com (smtp121.mail.ukl.yahoo.com [77.238.184.52]) by open-mesh.net (Postfix) with SMTP id 6AD461542F3 for ; Wed, 3 Mar 2010 00:09:34 +0100 (CET) Received: (qmail 91670 invoked from network); 2 Mar 2010 22:45:59 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=KSh4xWSz5Xesqzsrg3U8p8VGgh/1VJ4kE4oUPKWL1Sdgmta90+ijHweRkDFx+HwAX7edd+kQwCQZaQxVB4EI57EDtQRGs3aVWojjNwrZLF22mB9yi9LmxnEb3H90OgaKphOOzG0HQsFBw14n0GIh3Z5npI9pTt68O8S6fnG82oE= ; Received: from 115-80-176-30.taiwanmobile.net (lindner_marek@115.80.176.30 with plain) by smtp121.mail.ukl.yahoo.com with SMTP; 02 Mar 2010 22:45:57 +0000 GMT X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- X-YMail-OSG: Tcua8awVM1mz3Tmi5ya0_IrZcC46Id6Lr8E2d83rXKQvB50MD8zGzXoCF6KxRvTkNOZqb1JtzCDP7J0pjQAroTLmF3OXp5AtiUO58gfpIC8TtUobdI6zFknR1Cx0Yi9V05elJIFua1HrMgE1wNvLP9BSFU5SkInnBLR0wl7cp1psZKleA4_Iir6y2qC4IWGdlPM..w9sQUuZZeE6VpHw4WIwUZZH5y6mjHarMY3E.pCoATeR6nB_2JrZG73BEkkU5tzBhRxDQQnhrA-- X-Yahoo-Newman-Property: ymail-3 From: Marek Lindner To: b.a.t.m.a.n@lists.open-mesh.net Date: Wed, 3 Mar 2010 06:40:47 +0800 Message-Id: <1267569647-23594-3-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.0 In-Reply-To: <201003030640.16085.lindner_marek@yahoo.de> References: <201003030640.16085.lindner_marek@yahoo.de> Cc: Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH 3/3] batctl: adding batctl bonding mode support X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2010 23:09:34 -0000 Signed-off-by: Marek Lindner --- batctl/main.c | 37 +++++++++++++++++++++---------------- batctl/man/batctl.8 | 4 ++++ batctl/sys.c | 7 +++++++ batctl/sys.h | 1 + 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/batctl/main.c b/batctl/main.c index 99bfb5b..e0b7f55 100644 --- a/batctl/main.c +++ b/batctl/main.c @@ -41,23 +41,24 @@ void print_usage(void) { printf("Usage: batctl [options] commands \n"); printf("commands:\n"); - printf(" \tinterface|if [none|interface] \tdisplay or modify the interface settings\n"); - printf(" \toriginators|o \tdisplay the originator table\n"); - printf(" \tinterval|it [orig_interval] \tdisplay or modify the originator interval in ms\n"); - printf(" \tloglevel|ll [level] \tdisplay or modify the log level\n"); - printf(" \tlog|l \tread the log produced by the kernel module\n"); - printf(" \tgw_mode|gw [mode] \tdisplay or modify the gateway mode\n"); - printf(" \tgw_srv_list|gwl \tdisplay the gateway server list\n"); - printf(" \ttranslocal|tl \tdisplay the local translation table\n"); - printf(" \ttransglobal|tg \tdisplay the global translation table\n"); - printf(" \tvis_server|vs [enable|disable] \tdisplay or modify the status of the VIS server\n"); - printf(" \tvis_data|vd [dot|JSON] \tdisplay the VIS data in dot or JSON format\n"); - printf(" \taggregation|ag [0|1] \tdisplay or modify the packet aggregation setting\n"); + printf(" \tinterface|if [none|interface] \tdisplay or modify the interface settings\n"); + printf(" \toriginators|o \tdisplay the originator table\n"); + printf(" \tinterval|it [orig_interval] \tdisplay or modify the originator interval in ms\n"); + printf(" \tloglevel|ll [level] \tdisplay or modify the log level\n"); + printf(" \tlog|l \tread the log produced by the kernel module\n"); + printf(" \tgw_mode|gw [mode] \tdisplay or modify the gateway mode\n"); + printf(" \tgw_srv_list|gwl \tdisplay the gateway server list\n"); + printf(" \ttranslocal|tl \tdisplay the local translation table\n"); + printf(" \ttransglobal|tg \tdisplay the global translation table\n"); + printf(" \tvis_server|vs [enable|disable] \tdisplay or modify the status of the VIS server\n"); + printf(" \tvis_data|vd [dot|JSON] \tdisplay the VIS data in dot or JSON format\n"); + printf(" \taggregation|ag [0|1] \tdisplay or modify the packet aggregation setting\n"); + printf(" \tbonding|b [0|1] \tdisplay or modify the bonding mode setting\n"); printf("\n"); - printf(" \tping|p \tping another batman adv host via layer 2\n"); - printf(" \ttraceroute|tr \ttraceroute another batman adv host via layer 2\n"); - printf(" \ttcpdump|td \ttcpdump layer 2 traffic on the given interface\n"); - printf(" \tbisect .. \tanalyze given log files for routing stability\n"); + printf(" \tping|p \tping another batman adv host via layer 2\n"); + printf(" \ttraceroute|tr \ttraceroute another batman adv host via layer 2\n"); + printf(" \ttcpdump|td \ttcpdump layer 2 traffic on the given interface\n"); + printf(" \tbisect .. \tanalyze given log files for routing stability\n"); printf("options:\n"); printf(" \t-h print this help (or 'batctl -h' for the command specific help)\n"); printf(" \t-v print version\n"); @@ -144,6 +145,10 @@ int main(int argc, char **argv) ret = handle_sys_setting(argc - 1, argv + 1, SYS_AGGR, aggregation_usage); + } else if ((strcmp(argv[1], "bonding") == 0) || (strcmp(argv[1], "b") == 0)) { + + ret = handle_sys_setting(argc - 1, argv + 1, SYS_BONDING, bonding_usage); + } else if ((strcmp(argv[1], "bisect") == 0)) { ret = bisect(argc - 1, argv + 1); diff --git a/batctl/man/batctl.8 b/batctl/man/batctl.8 index 63b5bd4..dcadec4 100644 --- a/batctl/man/batctl.8 +++ b/batctl/man/batctl.8 @@ -126,6 +126,10 @@ If no parameter is given the current aggregation setting is displayed. Otherwise the parameter is used to enable or disable packet aggregation. .br +.IP "\fBbonding\fP|\fBb\fP [\fB1\fP|\fB0\fP]" +If no parameter is given the current bonding mode setting is displayed. +Otherwise the parameter is used to enable or disable the bonding mode. +.br .IP "\fBping\fP|\fBp\fP [\fB\-c \fP\fIcount\fP][\fB\-i \fP\fIinterval\fP][\fB\-t \fP\fItime\fP] \fIMAC_address\fP|\fIbat\-host_name\fP" Layer 2 ping of a MAC address or bat\-host name. batctl will try to find the bat\-host name if the given parameter was not a MAC diff --git a/batctl/sys.c b/batctl/sys.c index 8afffc7..5b4a9fa 100644 --- a/batctl/sys.c +++ b/batctl/sys.c @@ -177,6 +177,13 @@ void aggregation_usage(void) printf(" \t -h print this help\n"); } +void bonding_usage(void) +{ + printf("Usage: batctl [options] bonding \n"); + printf("options:\n"); + printf(" \t -h print this help\n"); +} + int handle_sys_setting(int argc, char **argv, char *file_path, void setting_usage(void)) { int optchar, res; diff --git a/batctl/sys.h b/batctl/sys.h index b7dd975..3560f98 100644 --- a/batctl/sys.h +++ b/batctl/sys.h @@ -28,6 +28,7 @@ #define SYS_TRANSTABLE_LOCAL "transtable_local" #define SYS_TRANSTABLE_GLOBAL "transtable_global" #define SYS_AGGR "aggregate_ogm" +#define SYS_BONDING "bonding" void originators_usage(void); void trans_local_usage(void);