Author: marek Date: 2010-03-11 20:19:05 +0100 (Thu, 11 Mar 2010) New Revision: 1596
Modified: trunk/batctl/main.c trunk/batctl/man/batctl.8 trunk/batctl/sys.c trunk/batctl/sys.h Log: batctl: adding batctl bonding mode support
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
Modified: trunk/batctl/main.c =================================================================== --- trunk/batctl/main.c 2010-03-11 19:19:01 UTC (rev 1595) +++ trunk/batctl/main.c 2010-03-11 19:19:05 UTC (rev 1596) @@ -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 <destination> \tping another batman adv host via layer 2\n"); - printf(" \ttraceroute|tr <destination> \ttraceroute another batman adv host via layer 2\n"); - printf(" \ttcpdump|td <interface> \ttcpdump layer 2 traffic on the given interface\n"); - printf(" \tbisect <file1> .. <fileN>\tanalyze given log files for routing stability\n"); + printf(" \tping|p <destination> \tping another batman adv host via layer 2\n"); + printf(" \ttraceroute|tr <destination> \ttraceroute another batman adv host via layer 2\n"); + printf(" \ttcpdump|td <interface> \ttcpdump layer 2 traffic on the given interface\n"); + printf(" \tbisect <file1> .. <fileN>\tanalyze given log files for routing stability\n"); printf("options:\n"); printf(" \t-h print this help (or 'batctl <command> -h' for the command specific help)\n"); printf(" \t-v print version\n"); @@ -144,6 +145,10 @@
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);
Modified: trunk/batctl/man/batctl.8 =================================================================== --- trunk/batctl/man/batctl.8 2010-03-11 19:19:01 UTC (rev 1595) +++ trunk/batctl/man/batctl.8 2010-03-11 19:19:05 UTC (rev 1596) @@ -126,6 +126,10 @@ 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][\fB-R\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
Modified: trunk/batctl/sys.c =================================================================== --- trunk/batctl/sys.c 2010-03-11 19:19:01 UTC (rev 1595) +++ trunk/batctl/sys.c 2010-03-11 19:19:05 UTC (rev 1596) @@ -177,6 +177,13 @@ 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;
Modified: trunk/batctl/sys.h =================================================================== --- trunk/batctl/sys.h 2010-03-11 19:19:01 UTC (rev 1595) +++ trunk/batctl/sys.h 2010-03-11 19:19:05 UTC (rev 1596) @@ -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);