--- /dev/null
+
+config KMOD_BATMAN_ADV_DEBUG_LOG
+ bool "enable verbose debug logging"
+ depends PACKAGE_kmod-batman-adv
+ default n
+config KMOD_BATMAN_ADV_BATCTL
+ bool "enable batctl"
+ depends PACKAGE_kmod-batman-adv
+ default y
+ help
+ batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced.
+ It is an easier method for configuring batman-adv and
+ provides some additional tools for debugging as well.
--- /dev/null
+#
+# Copyright (C) 2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=batman-adv
+
+PKG_VERSION:=2011.0.0
+PKG_MD5SUM:=9f59f63010f083a1ff56f977c9972f71
+BATCTL_MD5SUM:=48e1b3c4b6033215abb52ae757746f05
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_TOOL_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/batctl-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+define KernelPackage/batman-adv
+ URL:=http://www.open-mesh.org/
+ MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
+ SUBMENU:=Network Support
+ DEPENDS:=@!LINUX_2_4
+ TITLE:=B.A.T.M.A.N. Adv
+ FILES:=$(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
+ AUTOLOAD:=$(call AutoLoad,50,batman-adv)
+endef
+
+define KernelPackage/batman-adv/description
+B.A.T.M.A.N. advanced is a kernel module which allows to
+build layer 2 mesh networks. This package contains the
+version $(PKG_VERSION) of the kernel module plus its user space
+configuration & managerment tool batctl.
+endef
+
+define KernelPackage/batman-adv/config
+ source "$(SOURCE)/Config.in"
+endef
+
+MAKE_BATMAN_ADV_ARGS += \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ ARCH="$(LINUX_KARCH)" \
+ PATH="$(TARGET_PATH)" \
+ $(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),EXTRA_CFLAGS="-DCONFIG_BATMAN_ADV_DEBUG") \
+ SUBDIRS="$(PKG_BUILD_DIR)" \
+ LINUX_VERSION="$(LINUX_VERSION)" \
+ REVISION="" modules
+
+MAKE_BATCTL_ARGS += \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ CCFLAGS="$(TARGET_CFLAGS)" \
+ OFLAGS="$(TARGET_CFLAGS)" \
+ REVISION="" \
+ CC="$(TARGET_CC)" \
+ NODEBUG=1 \
+ UNAME="Linux" \
+ INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
+ STRIP="/bin/true" \
+ batctl install
+
+ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
+define Download/batctl
+ FILE:=batctl-$(PKG_VERSION).tar.gz
+ URL:=$(PKG_SOURCE_URL)
+ MD5SUM:=$(BATCTL_MD5SUM)
+endef
+$(eval $(call Download,batctl))
+
+BUILD_BATCTL = $(MAKE) -C $(PKG_TOOL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
+endif
+
+define Build/Compile
+ tar xzf "$(DL_DIR)/batctl-$(PKG_VERSION).tar.gz" -C "$(BUILD_DIR)/$(PKG_NAME)"
+ cp $(PKG_BUILD_DIR)/Makefile.kbuild $(PKG_BUILD_DIR)/Makefile
+ $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATMAN_ADV_ARGS)
+ $(BUILD_BATCTL)
+endef
+
+define Build/Clean
+ rm -rf $(BUILD_DIR)/$(PKG_NAME)/
+endef
+
+ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
+define KernelPackage/batman-adv/install
+ $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/etc/init.d/batman-adv $(1)/etc/init.d
+ $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batctl $(1)/usr/sbin/
+endef
+else
+define KernelPackage/batman-adv/install
+ $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/etc/init.d/batman-adv $(1)/etc/init.d
+ $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
+endef
+endif
+
+$(eval $(call KernelPackage,batman-adv))
--- /dev/null
+
+config 'mesh' 'bat0'
+ option 'interfaces' 'wlan0'
+ option 'aggregated_ogms'
+ option 'bonding'
+ option 'fragmentation'
+ option 'gw_bandwidth'
+ option 'gw_mode'
+ option 'gw_sel_class'
+ option 'log_level'
+ option 'orig_interval'
+ option 'vis_mode'
+
--- /dev/null
+#!/bin/sh /etc/rc.common
+START=90
+
+is_module_loaded() {
+
+ if [ ! -d "/sys/module/batman_adv" ]; then
+ echo "batman-adv module directory not found - was the kernel module loaded ?" >&2
+ return 0
+ fi
+
+ return 1
+}
+
+start_mesh () {
+ local meshif="$1"
+ local interfaces aggregated_ogms bonding fragmentation gw_bandwidth gw_mode gw_sel_class log_level orig_interval vis_mode
+
+ is_module_loaded
+ [ $? -ne 1 ] && return
+
+ config_get interfaces "$meshif" interfaces
+ config_get aggregated_ogms "$meshif" aggregated_ogms
+ config_get bonding "$meshif" bonding
+ config_get fragmentation "$meshif" fragmentation
+ config_get gw_bandwidth "$meshif" gw_bandwidth
+ config_get gw_mode "$meshif" gw_mode
+ config_get gw_sel_class "$meshif" gw_sel_class
+ config_get log_level "$meshif" log_level
+ config_get orig_interval "$meshif" orig_interval
+ config_get vis_mode "$meshif" vis_mode
+
+ if [ "$interfaces" = "" ]; then
+ echo Error, you must specify at least a network interface
+ return
+ fi
+
+ for interface in $interfaces
+ do
+ [ ! -f "/sys/class/net/$interface/batman_adv/mesh_iface" ] && echo "Can't add interface $interface - ignoring" && continue
+ echo $meshif > /sys/class/net/$interface/batman_adv/mesh_iface
+ done
+
+ if [ $orig_interval ]; then
+ echo $orig_interval > /sys/class/net/$meshif/mesh/orig_interval
+ fi
+
+ if [ $log_level ]; then
+ echo $log_level > /sys/class/net/$meshif/mesh/log_level 2>&-
+ fi
+
+ if [ $aggregated_ogms ]; then
+ echo $aggregated_ogms > /sys/class/net/$meshif/mesh/aggregated_ogms
+ fi
+
+ if [ $bonding ]; then
+ echo $bonding > /sys/class/net/$meshif/mesh/bonding
+ fi
+
+ if [ $fragmentation ]; then
+ echo $fragmentation > /sys/class/net/$meshif/mesh/fragmentation
+ fi
+
+ if [ $gw_bandwidth ]; then
+ echo $gw_bandwidth > /sys/class/net/$meshif/mesh/gw_bandwidth
+ fi
+
+ if [ $gw_mode ]; then
+ echo $gw_mode > /sys/class/net/$meshif/mesh/gw_mode
+ fi
+
+ if [ $gw_sel_class ]; then
+ echo $gw_sel_class > /sys/class/net/$meshif/mesh/gw_sel_class
+ fi
+
+ if [ $vis_mode ]; then
+ echo $vis_mode > /sys/class/net/$meshif/mesh/vis_mode
+ fi
+}
+
+stop_mesh() {
+ local meshif="$1"
+
+ is_module_loaded
+ [ $? -ne 1 ] && return
+
+ for iface in $(ls /sys/class/net/*)
+ do
+ [ ! -f "$iface/batman_adv/mesh_iface" ] && continue
+ [ "$(head -1 $iface/batman_adv/mesh_iface)" != "status: $meshif" ] && continue
+
+ echo "none" > $iface/batman_adv/mesh_iface
+ done
+}
+
+# can also be used with "batman-adv start bat0"
+start() {
+ 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
+}
+
+
+++ /dev/null
-
-config KMOD_BATMAN_ADV_DEBUG_LOG
- bool "enable verbose debug logging"
- depends PACKAGE_kmod-batman-adv
- default n
-config KMOD_BATMAN_ADV_BATCTL
- bool "enable batctl"
- depends PACKAGE_kmod-batman-adv
- default y
- help
- batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced.
- It is an easier method for configuring batman-adv and
- provides some additional tools for debugging as well.
+++ /dev/null
-#
-# Copyright (C) 2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-# $Id: Makefile 5624 2006-11-23 00:29:07Z nbd $
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=batman-adv
-
-PKG_VERSION:=2011.0.0
-PKG_MD5SUM:=9f59f63010f083a1ff56f977c9972f71
-BATCTL_MD5SUM:=48e1b3c4b6033215abb52ae757746f05
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_TOOL_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/batctl-$(PKG_VERSION)
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-define KernelPackage/batman-adv
- URL:=http://www.open-mesh.org/
- MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
- SUBMENU:=Network Support
- DEPENDS:=@!LINUX_2_4
- TITLE:=B.A.T.M.A.N. Adv
- FILES:=$(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
- AUTOLOAD:=$(call AutoLoad,50,batman-adv)
-endef
-
-define KernelPackage/batman-adv/description
-B.A.T.M.A.N. advanced is a kernel module which allows to
-build layer 2 mesh networks. This package contains the
-version $(PKG_VERSION) of the kernel module plus its user space
-configuration & managerment tool batctl.
-endef
-
-define KernelPackage/batman-adv/config
- source "$(SOURCE)/Config.in"
-endef
-
-MAKE_BATMAN_ADV_ARGS += \
- CROSS_COMPILE="$(TARGET_CROSS)" \
- ARCH="$(LINUX_KARCH)" \
- PATH="$(TARGET_PATH)" \
- $(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),EXTRA_CFLAGS="-DCONFIG_BATMAN_ADV_DEBUG") \
- SUBDIRS="$(PKG_BUILD_DIR)" \
- LINUX_VERSION="$(LINUX_VERSION)" \
- REVISION="" modules
-
-MAKE_BATCTL_ARGS += \
- CFLAGS="$(TARGET_CFLAGS)" \
- CCFLAGS="$(TARGET_CFLAGS)" \
- OFLAGS="$(TARGET_CFLAGS)" \
- REVISION="" \
- CC="$(TARGET_CC)" \
- NODEBUG=1 \
- UNAME="Linux" \
- INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
- STRIP="/bin/true" \
- batctl install
-
-ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
-define Download/batctl
- FILE:=batctl-$(PKG_VERSION).tar.gz
- URL:=$(PKG_SOURCE_URL)
- MD5SUM:=$(BATCTL_MD5SUM)
-endef
-$(eval $(call Download,batctl))
-
-BUILD_BATCTL = $(MAKE) -C $(PKG_TOOL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
-endif
-
-define Build/Compile
- tar xzf "$(DL_DIR)/batctl-$(PKG_VERSION).tar.gz" -C "$(BUILD_DIR)/$(PKG_NAME)"
- cp $(PKG_BUILD_DIR)/Makefile.kbuild $(PKG_BUILD_DIR)/Makefile
- $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATMAN_ADV_ARGS)
- $(BUILD_BATCTL)
-endef
-
-define Build/Clean
- rm -rf $(BUILD_DIR)/$(PKG_NAME)/
-endef
-
-ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
-define KernelPackage/batman-adv/install
- $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
- $(INSTALL_BIN) ./files/etc/init.d/batman-adv $(1)/etc/init.d
- $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batctl $(1)/usr/sbin/
-endef
-else
-define KernelPackage/batman-adv/install
- $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
- $(INSTALL_BIN) ./files/etc/init.d/batman-adv $(1)/etc/init.d
- $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config
-endef
-endif
-
-$(eval $(call KernelPackage,batman-adv))
+++ /dev/null
-
-config 'mesh' 'bat0'
- option 'interfaces' 'wlan0'
- option 'aggregated_ogms'
- option 'bonding'
- option 'fragmentation'
- option 'gw_bandwidth'
- option 'gw_mode'
- option 'gw_sel_class'
- option 'log_level'
- option 'orig_interval'
- option 'vis_mode'
-
+++ /dev/null
-#!/bin/sh /etc/rc.common
-START=90
-
-is_module_loaded() {
-
- if [ ! -d "/sys/module/batman_adv" ]; then
- echo "batman-adv module directory not found - was the kernel module loaded ?" >&2
- return 0
- fi
-
- return 1
-}
-
-start_mesh () {
- local meshif="$1"
- local interfaces aggregated_ogms bonding fragmentation gw_bandwidth gw_mode gw_sel_class log_level orig_interval vis_mode
-
- is_module_loaded
- [ $? -ne 1 ] && return
-
- config_get interfaces "$meshif" interfaces
- config_get aggregated_ogms "$meshif" aggregated_ogms
- config_get bonding "$meshif" bonding
- config_get fragmentation "$meshif" fragmentation
- config_get gw_bandwidth "$meshif" gw_bandwidth
- config_get gw_mode "$meshif" gw_mode
- config_get gw_sel_class "$meshif" gw_sel_class
- config_get log_level "$meshif" log_level
- config_get orig_interval "$meshif" orig_interval
- config_get vis_mode "$meshif" vis_mode
-
- if [ "$interfaces" = "" ]; then
- echo Error, you must specify at least a network interface
- return
- fi
-
- for interface in $interfaces
- do
- [ ! -f "/sys/class/net/$interface/batman_adv/mesh_iface" ] && echo "Can't add interface $interface - ignoring" && continue
- echo $meshif > /sys/class/net/$interface/batman_adv/mesh_iface
- done
-
- if [ $orig_interval ]; then
- echo $orig_interval > /sys/class/net/$meshif/mesh/orig_interval
- fi
-
- if [ $log_level ]; then
- echo $log_level > /sys/class/net/$meshif/mesh/log_level 2>&-
- fi
-
- if [ $aggregated_ogms ]; then
- echo $aggregated_ogms > /sys/class/net/$meshif/mesh/aggregated_ogms
- fi
-
- if [ $bonding ]; then
- echo $bonding > /sys/class/net/$meshif/mesh/bonding
- fi
-
- if [ $fragmentation ]; then
- echo $fragmentation > /sys/class/net/$meshif/mesh/fragmentation
- fi
-
- if [ $gw_bandwidth ]; then
- echo $gw_bandwidth > /sys/class/net/$meshif/mesh/gw_bandwidth
- fi
-
- if [ $gw_mode ]; then
- echo $gw_mode > /sys/class/net/$meshif/mesh/gw_mode
- fi
-
- if [ $gw_sel_class ]; then
- echo $gw_sel_class > /sys/class/net/$meshif/mesh/gw_sel_class
- fi
-
- if [ $vis_mode ]; then
- echo $vis_mode > /sys/class/net/$meshif/mesh/vis_mode
- fi
-}
-
-stop_mesh() {
- local meshif="$1"
-
- is_module_loaded
- [ $? -ne 1 ] && return
-
- for iface in $(ls /sys/class/net/*)
- do
- [ ! -f "$iface/batman_adv/mesh_iface" ] && continue
- [ "$(head -1 $iface/batman_adv/mesh_iface)" != "status: $meshif" ] && continue
-
- echo "none" > $iface/batman_adv/mesh_iface
- done
-}
-
-# can also be used with "batman-adv start bat0"
-start() {
- 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
-}
-
-