The kernel requires to have all files in /sys documented and updated
when new files are added.
batman-adv has two important classes of files: one class for each mesh
device and one for a directory in all normal netdevice folders.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
---
Following files needs to be documented:
* fragmentation
* gw_mode
batman-adv/sysfs-class-net-batman-adv | 14 ++++++++++++++
batman-adv/sysfs-class-net-mesh | 33 +++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 0 deletions(-)
create mode 100644 batman-adv/sysfs-class-net-batman-adv
create mode 100644 batman-adv/sysfs-class-net-mesh
diff --git a/batman-adv/sysfs-class-net-batman-adv b/batman-adv/sysfs-class-net-batman-adv
new file mode 100644
index 0000000..38dd762
--- /dev/null
+++ b/batman-adv/sysfs-class-net-batman-adv
@@ -0,0 +1,14 @@
+
+What: /sys/class/net/<iface>/batman-adv/mesh_iface
+Date: May 2010
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+Description:
+ The /sys/class/net/<iface>/batman-adv/mesh_iface file
+ displays the batman mesh interface this <iface>
+ currently is associated with.
+
+What: /sys/class/net/<iface>/batman-adv/iface_status
+Date: May 2010
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+Description:
+ Indicates the status of <iface> as it is seen by batman.
diff --git a/batman-adv/sysfs-class-net-mesh b/batman-adv/sysfs-class-net-mesh
new file mode 100644
index 0000000..5aa1912
--- /dev/null
+++ b/batman-adv/sysfs-class-net-mesh
@@ -0,0 +1,33 @@
+
+What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms
+Date: May 2010
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+Description:
+ Indicates whether the batman protocol messages of the
+ mesh <mesh_iface> shall be aggregated or not.
+
+What: /sys/class/net/<mesh_iface>/mesh/bonding
+Date: June 2010
+Contact: Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
+Description:
+ Indicates whether the data traffic going through the
+ mesh will be sent using multiple interfaces at the
+ same time (if available).
+
+What: /sys/class/net/<mesh_iface>/mesh/orig_interval
+Date: May 2010
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+Description:
+ Defines the interval in milliseconds in which batman
+ sends its protocol messages.
+
+What: /sys/class/net/<mesh_iface>/mesh/vis_mode
+Date: May 2010
+Contact: Marek Lindner <lindner_marek(a)yahoo.de>
+Description:
+ Each batman node only maintains information about its
+ own local neighborhood, therefore generating graphs
+ showing the topology of the entire mesh is not easily
+ feasible without having a central instance to collect
+ the local topologies from all nodes. This file allows
+ to activate the collecting (server) mode.
--
1.7.2.3
bat_dbg() invokes debug_log() which invokes the kernel's vscnprintf(),
which invokes the kernel's vsnprintf(), and not the customized
bat_vsnprintf(), which backports the %pM to older kernel versions!
Therefore this commit ports a customized vscnprintf() to bat_printk.c,
too, making mac addresses being displayed correctly with bat_dbg()
again.
Signed-off-by: Linus Lüssing <linus.luessing(a)web.de>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
---
bat_printk.c | 25 +++++++++++++++++++++++++
compat.h | 3 +++
2 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/bat_printk.c b/bat_printk.c
index 4a02d7e..6615876 100644
--- a/bat_printk.c
+++ b/bat_printk.c
@@ -838,6 +838,31 @@ static int bat_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
}
/**
+ * bat_vscnprintf - Format a string and place it in a buffer
+ * @buf: The buffer to place the result into
+ * @size: The size of the buffer, including the trailing null space
+ * @fmt: The format string to use
+ * @args: Arguments for the format string
+ *
+ * The return value is the number of characters which have been written into
+ * the @buf not including the trailing '\0'. If @size is <= 0 the function
+ * returns 0.
+ *
+ * Call this function if you are already dealing with a va_list.
+ * You probably want scnprintf() instead.
+ *
+ * See the vsnprintf() documentation for format string extensions over C99.
+ */
+int bat_vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
+{
+ int i;
+
+ i = bat_vsnprintf(buf, size, fmt, args);
+
+ return (i >= size) ? (size - 1) : i;
+}
+
+/**
* bat_printk - print a kernel message using extra %p formatting
* strings, forward compatible with kernel version 2.6.31 printk, minus
* *p[sS].
diff --git a/compat.h b/compat.h
index d59d709..5c02b44 100644
--- a/compat.h
+++ b/compat.h
@@ -256,6 +256,9 @@ next_sibling:
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+int bat_vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
+#define vscnprintf bat_vscnprintf
+
asmlinkage int bat_printk(const char *fmt, ...);
#define printk bat_printk
--
1.7.1
If it is an inappropriate place to post, please direct me to the right
place.
I could not find relevant info with google.
I have an ad hoc network using batman. The network config of backbone nodes:
10.42.0.N/24 :wireless interface, network for backbone nodes
10.42.N.1/24 : wireless interface, network for user nodes. dhcp served here
10.43.N.1/24 : wired interface, network for user nodes. dhcp served here
This setup works with linux as a user node. It tries its old ip with
dhcp request, but after that it asks for a new address with dhcp
discover. But with a windows 7 there is a problem.
The windows gets an address with DHCP from one node. When it roams to
another nodes' area, it cannot get an ip address for the new area. It
seems that the windows box do not want to forget the first IP it got. We
have tried:
ipconfig /renew
shutting down and restarting wifi connection
setting dhcp lease time to 1 min in all nodes, going to the old node
area, getting the old ip, and renew, shut down, etc.
The windows seems to use dhcp request all times, never dhcp discover,
even after it obviosly figured out that the old IP won't work.
The dhcp servers aren't set to be authoritative, as it would create
problems where their area overlap.
I would be glad to have any suggestions.
Thank you