The following commit has been merged in the master branch: commit 5089a61c24725848d293c8b47cb6081f9af24f53 Author: Antonio Quartulli ordex@autistici.org Date: Tue Jun 7 00:10:13 2011 +0200
batctl: added ap_isolation support
This patch introduces the possibility of enabling/disabling the ap_isolation feature in batman-adv
Signed-off-by: Antonio Quartulli ordex@autistici.org Signed-off-by: Marek Lindner lindner_marek@yahoo.de
diff --git a/main.c b/main.c index e0cccbd..a1e6f4d 100644 --- a/main.c +++ b/main.c @@ -58,6 +58,7 @@ void print_usage(void) { 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(" \tfragmentation|f [0|1] \tdisplay or modify the fragmentation mode setting\n"); + printf(" \tap_isolation|ap [0|1] \tdisplay or modify the ap isolation 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"); @@ -188,6 +189,11 @@ int main(int argc, char **argv) ret = handle_sys_setting(mesh_iface, argc - 1, argv + 1, SYS_FRAG, fragmentation_usage, sysfs_param_enable);
+ } else if ((strcmp(argv[1], "ap_isolation") == 0) || (strcmp(argv[1], "ap") == 0)) { + + ret = handle_sys_setting(mesh_iface, argc - 1, argv + 1, + SYS_AP_ISOLA, ap_isolation_usage, sysfs_param_enable); + } else if ((strcmp(argv[1], "bisect") == 0)) {
ret = bisect(argc - 1, argv + 1); diff --git a/man/batctl.8 b/man/batctl.8 index 7ee389a..b0c6fc6 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -152,6 +152,9 @@ If no parameter is given the current bonding mode setting is displayed. Otherwis .IP "\fBfragmentation\fP|\fBf\fP [\fB1\fP|\fB0\fP]" If no parameter is given the current fragmentation mode setting is displayed. Otherwise the parameter is used to enable or disable fragmentation. .br +.IP "\fBap_isolation\fP|\fBap\fP [\fB1\fP|\fB0\fP]" +If no parameter is given the current ap isolation setting is displayed. Otherwise the parameter is used to enable or disable ap isolation. +.br .IP "\fBping\fP|\fBp\fP [\fB-c count\fP][\fB-i interval\fP][\fB-t time\fP][\fB-R\fP] \fBMAC_address\fP|\fBbat-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/sys.c b/sys.c index dbf5383..4f2b2c5 100644 --- a/sys.c +++ b/sys.c @@ -270,6 +270,13 @@ void fragmentation_usage(void) printf(" \t -h print this help\n"); }
+void ap_isolation_usage(void) +{ + printf("Usage: batctl [options] ap_isolation [0|1]\n"); + printf("options:\n"); + printf(" \t -h print this help\n"); +} + int handle_sys_setting(char *mesh_iface, int argc, char **argv, char *file_path, void setting_usage(void), const char *sysfs_param[]) diff --git a/sys.h b/sys.h index 2c47550..2df846c 100644 --- a/sys.h +++ b/sys.h @@ -34,6 +34,7 @@ #define SYS_MESH_IFACE_FMT SYS_IFACE_PATH"/%s/batman_adv/mesh_iface" #define SYS_IFACE_STATUS_FMT SYS_IFACE_PATH"/%s/batman_adv/iface_status" #define SYS_FRAG "fragmentation" +#define SYS_AP_ISOLA "ap_isolation"
enum gw_modes { GW_MODE_OFF, @@ -47,6 +48,7 @@ extern const char *sysfs_param_server[]; void aggregation_usage(void); void bonding_usage(void); void fragmentation_usage(void); +void ap_isolation_usage(void); void gw_mode_usage(void); void vis_mode_usage(void); void orig_interval_usage(void);