All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio@meshcoding.com>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Antonio Quartulli <antonio@open-mesh.com>
Subject: [B.A.T.M.A.N.] [PATCHv2] batctl: add isolation_mark support
Date: Sat, 22 Feb 2014 15:16:41 +0100	[thread overview]
Message-ID: <1393078601-455-1-git-send-email-antonio@meshcoding.com> (raw)

From: Antonio Quartulli <antonio@open-mesh.com>

With this patch it is now possible to set/unset the value
of the isolation_mark used by the Extended Isolation feature
in batman-adv.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---

Change from v1:
- added section in man page


 man/batctl.8 | 20 ++++++++++++++++++++
 sys.c        |  9 +++++++--
 sys.h        |  1 +
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/man/batctl.8 b/man/batctl.8
index 2fe5941..b808293 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -151,6 +151,26 @@ least XX TQ better than the currently selected gateway (XX has to be a number be
 .RE
 .RE
 .br
+.IP "\fBisolation_mark\fP|\fBmark\fP"
+If no parameter is given the current isolation mark value is displayed.
+Otherwise the parameter is used to set or unset the isolation mark used by the
+Extended Isolation feature.
+.br
+The input is supposed to be of the form $value/$mask, where $value can be any
+32bit long integer (expressed in decimal or hex base) and $mask is a generic
+bitmask (expressed in hex base) that selects the bits to take into consideration
+from $value. It is also possible to enter the input using only $value and in
+this case the full bitmask is used by default.
+
+.br
+.br
+Example 1: 0x00000001/0xffffffff
+.br
+Example 2: 0x00040000/0xffff0000
+.br
+Example 3: 16 or 0x0F
+.br
+.br
 .PP
 .I \fBdebug tables:
 .IP
diff --git a/sys.c b/sys.c
index 5cebf52..fd6e107 100644
--- a/sys.c
+++ b/sys.c
@@ -96,8 +96,13 @@ const struct settings_data batctl_settings[BATCTL_SETTINGS_NUM] = {
 		.opt_short = "nc",
 		.sysfs_name = "network_coding",
 		.params = sysfs_param_enable,
-	}
-
+	},
+	{
+		.opt_long = "isolation_mark",
+		.opt_short = "mark",
+		.sysfs_name = "isolation_mark",
+		.params = NULL,
+	},
 };
 
 static void interface_usage(void)
diff --git a/sys.h b/sys.h
index 2cbbcfb..5633822 100644
--- a/sys.h
+++ b/sys.h
@@ -46,6 +46,7 @@ enum batctl_settings_list {
 	BATCTL_SETTINGS_BONDING,
 	BATCTL_SETTINGS_FRAGMENTATION,
 	BATCTL_SETTINGS_NETWORK_CODING,
+	BATCTL_SETTINGS_ISOLATION_MARK,
 	BATCTL_SETTINGS_NUM,
 };
 
-- 
1.8.4.5


             reply	other threads:[~2014-02-22 14:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-22 14:16 Antonio Quartulli [this message]
2014-02-24  6:50 ` [B.A.T.M.A.N.] [PATCHv2] batctl: add isolation_mark support Antonio Quartulli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393078601-455-1-git-send-email-antonio@meshcoding.com \
    --to=antonio@meshcoding.com \
    --cc=antonio@open-mesh.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.