@@ -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 @@ 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);
@@ -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
@@ -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;
@@ -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);
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> --- batctl/main.c | 37 +++++++++++++++++++++---------------- batctl/man/batctl.8 | 4 ++++ batctl/sys.c | 7 +++++++ batctl/sys.h | 1 + 4 files changed, 33 insertions(+), 16 deletions(-)