From patchwork Mon Jun 6 22:10:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1164 Return-Path: Received: from contumacia.investici.org (contumacia.investici.org [178.255.144.35]) by open-mesh.org (Postfix) with ESMTPS id 90DBE1541CF for ; Tue, 7 Jun 2011 00:10:39 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 6AA6EE8105; Mon, 6 Jun 2011 22:10:31 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 contumacia.investici.org 6AA6EE8105 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1307398236; bh=lEI3cybalbwYW8UEIm4KQ+TqKDNRu9rgPMzHzfqJxpo=; h=From:To:Cc:Subject:Date:Message-Id; b=CsHfnt8672JZMASd9ksRem+wLv5GYa0+dxLKWfQkSZAIetvBds/SZ9THnl5EJgk3L aSdRvCZ9m8Ba7wMQANs91cws7lV/K7GRlgeCXFpX2m3url7nLEt5gRF4FEiGDHJf0/ JMaJ9zAxgEQIgRo2m8RtJHJ6cFcGO4LLISqxJIZE= From: Antonio Quartulli To: "B.A.T.M.A.N" Date: Tue, 7 Jun 2011 00:10:13 +0200 Message-Id: <1307398213-8528-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 Subject: [B.A.T.M.A.N.] [PATCH] batctl: added ap_isolation support X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 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: Mon, 06 Jun 2011 22:10:39 -0000 This patch introduces the possibility of enabling/disabling the ap_isolation feature in batman-adv Signed-off-by: Antonio Quartulli --- main.c | 6 ++++++ sys.c | 7 +++++++ sys.h | 2 ++ 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/main.c b/main.c index eb67737..059c00f 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 \tping another batman adv host via layer 2\n"); printf(" \ttraceroute|tr \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/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);