Skip to contentSkip to conversation

batctl: Add hop_penalty setting command

PATCH New Sven Eckelmann 1 participant 1 message Feb 23, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batctl: Add hop_penalty setting command

OpenWrt was switched to use batctl as abstraction of the sysfs and netlink configuration interface. The only additional configuration option to finish this process is hop_penalty. It is required to defines the penalty which will be applied to an not available via batctl was hop_penalty originator message's tq-field on every hop.

---
 Makefile      |   1 +
 README.rst    |  15 +++++++
 hop_penalty.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++
 man/batctl.8  |   4 ++
 4 files changed, 135 insertions(+)
 create mode 100644 hop_penalty.c
Makefile +1 -0
index 4d8b709..55105cc 100755
@@ -63,6 +63,7 @@ $(eval $(call add_command,event,y))
 $(eval $(call add_command,fragmentation,y))
 $(eval $(call add_command,gateways,y))
 $(eval $(call add_command,gw_mode,y))
+$(eval $(call add_command,hop_penalty,y))
 $(eval $(call add_command,interface,y))
 $(eval $(call add_command,isolation_mark,y))
 $(eval $(call add_command,log,y))
README.rst +15 -0
index 4c0f544..e30b5b9 100644
@@ -530,6 +530,21 @@ Usage::
   batctl aggregation|ag [0|1]
 
 
+batctl hop_penalty
+==================
+
+display or modify the hop_penalty (0-255)
+
+Usage::
+
+  batctl hop_penalty|hp [penalty]
+
+Example::
+
+  $ batctl penalty
+  30
+
+
 batctl isolation_mark
 =====================
 
hop_penalty.c new file +115 -0

115 lines not on this page · raw message

man/batctl.8 +4 -0
index ed8e71f..0fbf1dd 100644
@@ -97,6 +97,10 @@ when parameter \fB\-t\fP is specified. Parameter \fB\-r\fP will do the same but
 If no parameter is given the current fragmentation mode setting is displayed. Otherwise the parameter is used to enable or
 disable fragmentation.
 .br
+.IP "\fBhop_penalty\fP|\fBhp\fP [\fBpenalty\fP]"
+If no parameter is given the current hop penalty setting is displayed. Otherwise the parameter is used to set the
+hop penalty. The penalty is can be 0-255 (255 sets originator message's TQ to zero when forwarded by this hop).
+.br
 .IP "\fBnetwork_coding\fP|\fBnc\fP [\fB0\fP|\fB1\fP]"
 If no parameter is given the current network coding mode setting is displayed. Otherwise the parameter is used to enable or
 disable network coding.
Signature · 1 line
2.20.1