Repository : ssh://git@open-mesh.org/openwrt-feed-batman-adv
On branch : master
commit 72ac838ba53467b1ff178d124422f8917815a252 Author: Marek Lindner lindner_marek@yahoo.de Date: Sat Feb 16 19:46:51 2013 +0800
batman-adv-devel: network coding support and batman-adv script removal
With the netifd integration the batman-adv script broke. This script can safely be removed because '/etc/init.d/network' reloads the batman-adv interfaces as well (thanks to netifd).
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
72ac838ba53467b1ff178d124422f8917815a252 batman-adv-devel/Config.in | 9 +++- batman-adv-devel/Makefile | 1 + batman-adv-devel/files/etc/config/batman-adv | 1 + batman-adv-devel/files/lib/batman-adv/config.sh | 10 ++-- batman-adv-devel/files/usr/sbin/batman-adv | 60 ----------------------- 5 files changed, 15 insertions(+), 66 deletions(-)
diff --git a/batman-adv-devel/Config.in b/batman-adv-devel/Config.in index c3a7162..154cde8 100644 --- a/batman-adv-devel/Config.in +++ b/batman-adv-devel/Config.in @@ -14,6 +14,11 @@ config KMOD_BATMAN_ADV_DEVEL_DAT depends PACKAGE_kmod-batman-adv-devel default y
+config KMOD_BATMAN_ADV_DEVEL_NC + bool "enable network coding [requires promisc mode support]" + depends PACKAGE_kmod-batman-adv-devel + default n + config KMOD_BATMAN_ADV_DEVEL_BATCTL bool "enable batctl" depends PACKAGE_kmod-batman-adv-devel @@ -27,7 +32,7 @@ config KMOD_BATMAN_ADV_DEVEL_BATMAN_REV string prompt "batman-adv git revision to build package with" depends PACKAGE_kmod-batman-adv-devel - default "a33c882" + default "edd0853" help Enter the full or shortened git revision to override package default value. This allows to build from non-master branches @@ -37,7 +42,7 @@ config KMOD_BATMAN_ADV_DEVEL_BATCTL_REV string prompt "batctl git revision to build package with" depends PACKAGE_kmod-batman-adv-devel - default "0e2efdc" + default "3921283" help Enter the full or shortened git revision to override package default value. This allows to build from non-master branches diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile index 7bbb75e..513a793 100644 --- a/batman-adv-devel/Makefile +++ b/batman-adv-devel/Makefile @@ -61,6 +61,7 @@ MAKE_BATMAN_ADV_ARGS += \ CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_DEBUG_LOG),y,n) \ CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_BLA),y,n) \ CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_DAT),y,n) \ + CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_NC),y,n) \ REVISION="$(PKG_BATMAN_SHORTREV)" all
MAKE_BATCTL_ARGS += \ diff --git a/batman-adv-devel/files/etc/config/batman-adv b/batman-adv-devel/files/etc/config/batman-adv index 6a62203..79d660d 100644 --- a/batman-adv-devel/files/etc/config/batman-adv +++ b/batman-adv-devel/files/etc/config/batman-adv @@ -12,6 +12,7 @@ config 'mesh' 'bat0' option 'vis_mode' option 'bridge_loop_avoidance' option 'distributed_arp_table' + option 'network_coding' option 'hop_penalty'
# yet another batX instance diff --git a/batman-adv-devel/files/lib/batman-adv/config.sh b/batman-adv-devel/files/lib/batman-adv/config.sh index ae102e9..471c1f2 100644 --- a/batman-adv-devel/files/lib/batman-adv/config.sh +++ b/batman-adv-devel/files/lib/batman-adv/config.sh @@ -5,14 +5,14 @@ bat_load_module() [ -d "/sys/module/batman_adv/" ] && return
. /lib/functions.sh - load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-batman-adv* + load_modules /etc/modules.d/*-crc16 /etc/modules.d/*-crypto* /etc/modules.d/*-lib-crc* /etc/modules.d/*-batman-adv* }
bat_config() { local mesh="$1" local aggregated_ogms ap_isolation bonding bridge_loop_avoidance distributed_arp_table fragmentation - local gw_bandwidth gw_mode gw_sel_class hop_penalty log_level orig_interval vis_mode + local gw_bandwidth gw_mode gw_sel_class hop_penalty network_coding log_level orig_interval vis_mode
config_get aggregated_ogms "$mesh" aggregated_ogms config_get ap_isolation "$mesh" ap_isolation @@ -24,6 +24,7 @@ bat_config() config_get gw_mode "$mesh" gw_mode config_get gw_sel_class "$mesh" gw_sel_class config_get hop_penalty "$mesh" hop_penalty + config_get network_coding "$mesh" network_coding config_get log_level "$mesh" log_level config_get orig_interval "$mesh" orig_interval config_get vis_mode "$mesh" vis_mode @@ -33,13 +34,14 @@ bat_config() [ -n "$aggregate_ogms" ] && echo $aggregate_ogms > /sys/class/net/$mesh/mesh/aggregate_ogms [ -n "$ap_isolation" ] && echo $ap_isolation > /sys/class/net/$mesh/mesh/ap_isolation [ -n "$bonding" ] && echo $bonding > /sys/class/net/$mesh/mesh/bonding - [ -n "$bridge_loop_avoidance" ] && echo $bridge_loop_avoidance > /sys/class/net/$mesh/mesh/bridge_loop_avoidance - [ -n "$distributed_arp_table" ] && echo $distributed_arp_table > /sys/class/net/$mesh/mesh/distributed_arp_table + [ -n "$bridge_loop_avoidance" ] && echo $bridge_loop_avoidance > /sys/class/net/$mesh/mesh/bridge_loop_avoidance 2>&- + [ -n "$distributed_arp_table" ] && echo $distributed_arp_table > /sys/class/net/$mesh/mesh/distributed_arp_table 2>&- [ -n "$fragmentation" ] && echo $fragmentation > /sys/class/net/$mesh/mesh/fragmentation [ -n "$gw_bandwidth" ] && echo $gw_bandwidth > /sys/class/net/$mesh/mesh/gw_bandwidth [ -n "$gw_mode" ] && echo $gw_mode > /sys/class/net/$mesh/mesh/gw_mode [ -n "$gw_sel_class" ] && echo $gw_sel_class > /sys/class/net/$mesh/mesh/gw_sel_class [ -n "$hop_penalty" ] && echo $hop_penalty > /sys/class/net/$mesh/mesh/hop_penalty + [ -n "$network_coding" ] && echo $network_coding > /sys/class/net/$mesh/mesh/network_coding 2>&- [ -n "$log_level" ] && echo $log_level > /sys/class/net/$mesh/mesh/log_level 2>&- [ -n "$orig_interval" ] && echo $orig_interval > /sys/class/net/$mesh/mesh/orig_interval [ -n "$vis_mode" ] && echo $vis_mode > /sys/class/net/$mesh/mesh/vis_mode diff --git a/batman-adv-devel/files/usr/sbin/batman-adv b/batman-adv-devel/files/usr/sbin/batman-adv deleted file mode 100644 index ca9e603..0000000 --- a/batman-adv-devel/files/usr/sbin/batman-adv +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# Copyright (C) 2011 OpenWrt.org - -. /lib/functions.sh -. /lib/batman-adv/config.sh - -start_mesh() { - local mesh="$1" - local ifaces=$(awk -F':' '{if (NR > 2) print $1}' /proc/net/dev) - - for iface in $ifaces; do - [ -d /sys/class/net/$iface/batman_adv/ ] && bat_add_interface "$mesh" "$iface" - done - - bat_config "$mesh" -} - -stop_mesh() { - local mesh="$1" - local ifaces=$(awk -F':' '{if (NR > 2) print $1}' /proc/net/dev) - - for iface in $ifaces; do - [ -d /sys/class/net/$iface/batman_adv/ ] && bat_del_interface "$mesh" "$iface" - done -} - -# can also be used with "batman-adv start bat0" -start() { - bat_load_module - config_load batman-adv - - if [ -n "$1" ]; then - start_mesh $1 - else - config_foreach start_mesh mesh - fi -} - -# can also be used with "batman-adv stop bat0" -stop () { - config_load batman-adv - - if [ -n "$1" ]; then - stop_mesh $1 - else - config_foreach stop_mesh mesh - fi -} - -restart() { - stop $1 - start $1 -} - -case "$1" in - start) start $2 ;; - stop) stop $2 ;; - restart) restart $2 ;; - *) echo "Usage: batman-adv <start|stop|restart> [mesh instance]" -esac