Compare commits
49 commits
master
...
for-12.09.
Author | SHA1 | Date | |
---|---|---|---|
|
04e09d75ef | ||
|
bd6c447b82 | ||
|
e4b8715fb3 | ||
|
7626faa9fd | ||
|
5c075bfe8a | ||
|
9638491a78 | ||
|
bfccd8d754 | ||
|
eb5806285c | ||
|
274bb795c9 | ||
|
ea91e6500f | ||
|
0e1dbcde02 | ||
|
7d2109081a | ||
|
8fa4dcd3a6 | ||
|
8cbc0e65d6 | ||
|
aa79c2ee71 | ||
|
d31e649201 | ||
|
a738b4c433 | ||
|
0d76ea5133 | ||
|
052df65d5c | ||
|
3c1fc329dc | ||
|
847812a645 | ||
|
5c9d35a7f9 | ||
|
293b992fde | ||
|
60d2e59edc | ||
|
8b2daca524 | ||
|
82ffb5cb82 | ||
|
f4e601336d | ||
|
1d55b32c29 | ||
|
3c0625032f | ||
|
4dee217945 | ||
|
6698c00136 | ||
|
6fd0400472 | ||
|
a0ffcf13f2 | ||
|
b5136c0303 | ||
|
1fe6e87387 | ||
|
f17298563b | ||
|
c54200b308 | ||
|
e3dfd595eb | ||
|
d7a47d4529 | ||
|
924208e596 | ||
|
409e558f93 | ||
|
5838fc2716 | ||
|
940739efb6 | ||
|
da6a26ab9d | ||
|
5fa04c120f | ||
|
73b84ed6f9 | ||
|
98b20ec4d6 | ||
|
cee4be1393 | ||
|
8bc77992ec |
31 changed files with 1030 additions and 1773 deletions
59
babeld/Makefile
Normal file
59
babeld/Makefile
Normal file
|
@ -0,0 +1,59 @@
|
|||
#
|
||||
# Copyright (C) 2007-2009 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=babeld
|
||||
PKG_VERSION:=1.5.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/files/
|
||||
PKG_MD5SUM:=ac884beb644792bdb79f0042755820ee
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/babeld
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Routing and Redirection
|
||||
TITLE:=A loop-free distance-vector routing protocol
|
||||
URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/babel/
|
||||
MAINTAINER:=Gabriel Kerneis <gabriel@kerneis.info>
|
||||
DEPENDS:=+kmod-ipv6 +librt
|
||||
endef
|
||||
|
||||
define Package/babeld/description
|
||||
Babel is a loop-avoiding distance-vector routing protocol roughly based
|
||||
on DSDV and AODV, but with provisions for link cost estimation and
|
||||
redistribution of routes from other routing protocols.
|
||||
While it is optimised for wireless mesh networks, Babel will also work
|
||||
efficiently on wired networks. It will generate between 1.2 and 2.4 times
|
||||
the amount of routing traffic that RIPng would generate, while
|
||||
never counting to infinity.
|
||||
endef
|
||||
|
||||
define Package/babeld/conffiles
|
||||
/etc/babeld.conf
|
||||
/etc/config/babeld
|
||||
endef
|
||||
|
||||
MAKE_FLAGS+= \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
|
||||
define Package/babeld/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/babeld $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_CONF) ./files/babeld.conf $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/babeld.config $(1)/etc/config/babeld
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/babeld.init $(1)/etc/init.d/babeld
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,babeld))
|
38
babeld/files/babeld.conf
Normal file
38
babeld/files/babeld.conf
Normal file
|
@ -0,0 +1,38 @@
|
|||
# babel config file
|
||||
#
|
||||
# This config file simply documents sample entries.
|
||||
# "redistribute" means: redistribute routes from other routing protocols
|
||||
# into babel. "local" means addresses assigned to local interfaces.
|
||||
#
|
||||
# You do not need to edit this file: you can use /etc/config/babeld
|
||||
# instead (sections "interface" and "filter"). Both files can be used
|
||||
# simultaneously (the rules of this file are executed first).
|
||||
|
||||
# the default rules are:
|
||||
#
|
||||
## redistribute local
|
||||
## redistribute deny
|
||||
#
|
||||
# this says, redistribute local addresses but no other routes
|
||||
|
||||
|
||||
# redistribute IPv4 default route into babel
|
||||
## redistribute local ip 0.0.0.0/0 le 0 metric 128
|
||||
|
||||
# same but for IPv6
|
||||
## redistribute local ip ::/0 le 0 metric 128
|
||||
|
||||
|
||||
# don't redistribute all local addresses, only selected ones
|
||||
# after the first line, the "deny" rules kicks in. After the "deny"
|
||||
# no redistribute local rules are going to match
|
||||
## redistribute local ip 192.160.4.0/24
|
||||
## redistribute local deny
|
||||
|
||||
|
||||
# Babel refuses to redistribute routes with a protocol number of "boot";
|
||||
# this is standard practice, and means that you cannot easily
|
||||
# redistribute the default route installed by dhcp. It is however
|
||||
# possible to redistribute such route by explicitly specifying "proto 3"
|
||||
# on the redistribute line.
|
||||
## redistribute ip 0.0.0.0/0 le 0 proto 3 metric 128
|
78
babeld/files/babeld.config
Normal file
78
babeld/files/babeld.config
Normal file
|
@ -0,0 +1,78 @@
|
|||
package babeld
|
||||
|
||||
config general
|
||||
# option 'multicast_address' 'ff02:0:0:0:0:0:1:6'
|
||||
# option 'port' '6696'
|
||||
# option 'state_file' '/var/lib/babel-state'
|
||||
# option 'hello_interval' '4'
|
||||
# option 'wired_hello_interval' '20'
|
||||
# option 'diversity' '0,128'
|
||||
# option 'smoothing_half_time' '4'
|
||||
# option 'kernel_priority' '0'
|
||||
# Do not use this option unless you know what you are doing, as it can
|
||||
# cause persistent route flapping.
|
||||
## option 'duplication_priority' '0'
|
||||
# option 'carrier_sense' 'false'
|
||||
# option 'assume_wireless' 'false'
|
||||
# option 'no_split_horizon' 'false'
|
||||
# option 'debug' '0'
|
||||
# Listen for connections from a front-end, e.g. on port 33123.
|
||||
## option 'local_server' '33123'
|
||||
# option 'random_router_id' 'false'
|
||||
# Keep unfeasible routes
|
||||
## option 'keep_unfeasible' 'false'
|
||||
# Use the given kernel routing table for routes inserted by babeld.
|
||||
## option 'export_table' '0'
|
||||
# Export routes from the given kernel routing tables.
|
||||
## list 'import_table' '0'
|
||||
## list 'import_table' '42'
|
||||
# The configuration file is not necessary since you can do everything
|
||||
# from this file.
|
||||
# option 'conf_file' '/etc/babeld.conf'
|
||||
# option 'log_file' '/var/log/babeld.log'
|
||||
|
||||
# You can use aliases (like lan, wlan) or real names (like eth0.0).
|
||||
# If you use an alias, it must be already defined when babeld starts.
|
||||
# Otherwise, the name is taken literally and the interface can be
|
||||
# brought up later (useful for tunnels for instance).
|
||||
config interface wlan
|
||||
# Remove this line to enable babeld on this interface
|
||||
option 'ignore' 'true'
|
||||
# option 'wired' 'auto'
|
||||
# option 'link_quality' 'auto'
|
||||
# option 'split_horizon' 'auto'
|
||||
# The default is 96 for wired interfaces, and 256 for wireless ones
|
||||
## option 'rxcost' '256'
|
||||
# The default is specified with the -h and -H command-line flags.
|
||||
## option 'hello_interval' '4'
|
||||
# This can be set to a fairly large value, unless significant
|
||||
# packet loss is expected. The default is four times the hello
|
||||
# interval.
|
||||
## option 'update_interval' '16'
|
||||
# Options to enable and configure RTT-based metric
|
||||
## option 'enable_timestamps' 'false'
|
||||
## option 'max_rtt_penalty' '0'
|
||||
## option 'rtt_decay' '42'
|
||||
## option 'rtt_min' '10'
|
||||
## option 'rtt_max' '120'
|
||||
|
||||
config interface lan
|
||||
option 'ignore' 'true'
|
||||
|
||||
# A filter consists in a type ('in', 'out' or 'redistribute'), an action
|
||||
# ('allow', 'deny' or 'metric xxx') and a set of selectors ('ip', 'eq',
|
||||
# etc.). See /etc/babeld.conf for more details.
|
||||
# Here is a sample filter wich redistributes the default route if its
|
||||
# protocol number is "boot", e.g. when it installed by dhcp. It is
|
||||
# disabled by default.
|
||||
config filter
|
||||
option 'ignore' 'true'
|
||||
# Type
|
||||
option 'type' 'redistribute'
|
||||
# Selectors: ip, eq, le, ge, neigh, id, proto, local, if
|
||||
option 'ip' '0.0.0.0/0'
|
||||
option 'le' '0'
|
||||
option 'proto' '3'
|
||||
# Action
|
||||
option 'action' 'metric 128'
|
||||
|
155
babeld/files/babeld.init
Executable file
155
babeld/files/babeld.init
Executable file
|
@ -0,0 +1,155 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=70
|
||||
|
||||
pidfile='/var/run/babeld.pid'
|
||||
EXTRA_COMMANDS="status"
|
||||
EXTRA_HELP=" status Dump Babel's table to the log file."
|
||||
|
||||
listen_ifname() {
|
||||
local ifname=$(uci_get_state network "$1" ifname "$1")
|
||||
local switch="$2"
|
||||
append args "$switch $ifname"
|
||||
append interfaces "$ifname"
|
||||
}
|
||||
|
||||
append_ifname() {
|
||||
local section="$1"
|
||||
local option="$2"
|
||||
local switch="$3"
|
||||
local _name
|
||||
config_get _name "$section" "$option"
|
||||
[ -z "$_name" ] && return 0
|
||||
local ifname=$(uci_get_state network "$_name" ifname "$_name")
|
||||
append args "$switch $ifname"
|
||||
}
|
||||
|
||||
append_bool() {
|
||||
local section="$1"
|
||||
local option="$2"
|
||||
local value="$3"
|
||||
local _loctmp
|
||||
config_get_bool _loctmp "$section" "$option" 0
|
||||
[ "$_loctmp" -gt 0 ] && append args "$value"
|
||||
}
|
||||
|
||||
append_switch() {
|
||||
local value="$1"
|
||||
local switch="$2"
|
||||
append args "$switch $value"
|
||||
}
|
||||
|
||||
append_parm() {
|
||||
local section="$1"
|
||||
local option="$2"
|
||||
local switch="$3"
|
||||
local _loctmp
|
||||
config_get _loctmp "$section" "$option"
|
||||
[ -z "$_loctmp" ] && return 0
|
||||
append args "$switch $_loctmp"
|
||||
}
|
||||
|
||||
babel_filter() {
|
||||
local cfg="$1"
|
||||
local _loctmp
|
||||
|
||||
local _ignored
|
||||
config_get_bool _ignored "$cfg" 'ignore' 0
|
||||
[ "$_ignored" -eq 1 ] && return 0
|
||||
|
||||
append args "-C '"
|
||||
|
||||
append_parm "$cfg" 'type' ''
|
||||
|
||||
append_bool "$cfg" 'local' 'local'
|
||||
|
||||
append_parm "$cfg" 'ip' 'ip'
|
||||
append_parm "$cfg" 'eq' 'eq'
|
||||
append_parm "$cfg" 'le' 'le'
|
||||
append_parm "$cfg" 'ge' 'ge'
|
||||
append_parm "$cfg" 'neigh' 'neigh'
|
||||
append_parm "$cfg" 'id' 'id'
|
||||
append_parm "$cfg" 'proto' 'proto'
|
||||
|
||||
append_ifname "$cfg" 'if' 'if'
|
||||
|
||||
append_parm "$cfg" 'action' ''
|
||||
|
||||
append args ' ' "'"
|
||||
}
|
||||
|
||||
babel_addif() {
|
||||
local cfg="$1"
|
||||
|
||||
local _ignored
|
||||
config_get_bool _ignored "$cfg" 'ignore' 0
|
||||
[ "$_ignored" -eq 1 ] && return 0
|
||||
|
||||
listen_ifname "$cfg" "-C 'interface"
|
||||
|
||||
append_parm "$cfg" 'wired' 'wired'
|
||||
append_parm "$cfg" 'link_quality' 'link-quality'
|
||||
append_parm "$cfg" 'split_horizon' 'split-horizon'
|
||||
append_parm "$cfg" 'rxcost' 'rxcost'
|
||||
append_parm "$cfg" 'hello_interval' 'hello-interval'
|
||||
append_parm "$cfg" 'update_interval' 'update-interval'
|
||||
append_parm "$cfg" 'enable_timestamps' 'enable-timestamps'
|
||||
append_parm "$cfg" 'max_rtt_penalty' 'max-rtt-penalty'
|
||||
append_parm "$cfg" 'rtt_decay' 'rtt-decay'
|
||||
append_parm "$cfg" 'rtt_min' 'rtt-min'
|
||||
append_parm "$cfg" 'rtt_max' 'rtt-max'
|
||||
|
||||
append args ' ' "'"
|
||||
}
|
||||
|
||||
babel_config() {
|
||||
local cfg="$1"
|
||||
|
||||
append_bool "$cfg" 'carrier_sense' '-l'
|
||||
append_bool "$cfg" 'assume_wireless' '-w'
|
||||
append_bool "$cfg" 'no_split_horizon' '-s'
|
||||
append_bool "$cfg" 'keep_unfeasible' '-u'
|
||||
append_bool "$cfg" 'random_router_id' '-r'
|
||||
|
||||
append_parm "$cfg" 'multicast_address' '-m'
|
||||
append_parm "$cfg" 'port' '-p'
|
||||
append_parm "$cfg" 'state_file' '-S'
|
||||
append_parm "$cfg" 'hello_interval' '-h'
|
||||
append_parm "$cfg" 'wired_hello_interval' '-H'
|
||||
append_parm "$cfg" 'diversity' '-z'
|
||||
append_parm "$cfg" 'smoothing_half_time' '-M'
|
||||
append_parm "$cfg" 'kernel_priority' '-k'
|
||||
append_parm "$cfg" 'duplication_priority' '-A'
|
||||
append_parm "$cfg" 'debug' '-d'
|
||||
append_parm "$cfg" 'local_server' '-g'
|
||||
append_parm "$cfg" 'export_table' '-t'
|
||||
config_list_foreach "$cfg" 'import_table' append_switch '-T'
|
||||
append_parm "$cfg" 'conf_file' '-c'
|
||||
append_parm "$cfg" 'log_file' '-L'
|
||||
}
|
||||
|
||||
start() {
|
||||
mkdir -p /var/lib
|
||||
config_load babeld
|
||||
unset args
|
||||
unset interfaces
|
||||
config_foreach babel_config general
|
||||
config_foreach babel_addif interface
|
||||
config_foreach babel_filter filter
|
||||
[ -z "$interfaces" ] && return 0
|
||||
eval "/usr/sbin/babeld -D -I $pidfile $args $interfaces"
|
||||
}
|
||||
|
||||
stop() {
|
||||
[ -f "$pidfile" ] && kill $(cat $pidfile)
|
||||
# avoid race-condition on restart: wait for
|
||||
# babeld to die for real.
|
||||
[ -f "$pidfile" ] && sleep 1
|
||||
[ -f "$pidfile" ] && sleep 1
|
||||
[ -f "$pidfile" ] && sleep 1
|
||||
[ -f "$pidfile" ] && exit 42
|
||||
}
|
||||
|
||||
status() {
|
||||
[ -f "$pidfile" ] && kill -USR1 $(cat $pidfile)
|
||||
}
|
|
@ -14,6 +14,11 @@ config KMOD_BATMAN_ADV_DAT
|
|||
depends on PACKAGE_kmod-batman-adv
|
||||
default y
|
||||
|
||||
config KMOD_BATMAN_ADV_NC
|
||||
bool "enable network coding [requires promisc mode support]"
|
||||
depends on PACKAGE_kmod-batman-adv
|
||||
default n
|
||||
|
||||
config KMOD_BATMAN_ADV_BATCTL
|
||||
bool "enable batctl"
|
||||
depends on PACKAGE_kmod-batman-adv
|
||||
|
|
|
@ -10,11 +10,11 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=batman-adv
|
||||
|
||||
PKG_VERSION:=2013.1.0
|
||||
BATCTL_VERSION:=2013.1.0
|
||||
PKG_RELEASE:=3
|
||||
PKG_MD5SUM:=fe1fd32eddde1f91575d7a7ec21d5782
|
||||
BATCTL_MD5SUM:=767bf36c77c517e1d321169bf9a7fae5
|
||||
PKG_VERSION:=2013.4.0
|
||||
BATCTL_VERSION:=2013.4.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=6590caa324709289e3cb142273a5ff57
|
||||
BATCTL_MD5SUM:=42e269cc710bbc9a8fd17628201d4258
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
|
||||
|
@ -57,18 +57,32 @@ MAKE_BATMAN_ADV_ARGS += \
|
|||
CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),y,n) \
|
||||
CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_KMOD_BATMAN_ADV_BLA),y,n) \
|
||||
CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_KMOD_BATMAN_ADV_DAT),y,n) \
|
||||
CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_KMOD_BATMAN_ADV_NC),y,n) \
|
||||
REVISION="" all
|
||||
|
||||
MAKE_BATCTL_ARGS += \
|
||||
# The linker can identify unused sections of a binary when each symbol is stored
|
||||
# in a separate section. This mostly removes unused linker sections and reduces
|
||||
# the size by ~3% on mipsel.
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
# Link-time optimization allows to move parts of the optimization from the single
|
||||
# source file to the global source view. This is done by emitting the GIMPLE
|
||||
# representation in each object file and analyzing it again during the link step.
|
||||
|
||||
TARGET_CFLAGS += -flto
|
||||
TARGET_LDFLAGS += -fuse-linker-plugin
|
||||
|
||||
MAKE_BATCTL_ENV += \
|
||||
CPPFLAGS="$(TARGET_CPPFLAGS)" \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
CCFLAGS="$(TARGET_CFLAGS)" \
|
||||
OFLAGS="$(TARGET_CFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
MAKE_BATCTL_ARGS += \
|
||||
REVISION="" \
|
||||
CC="$(TARGET_CC)" \
|
||||
NODEBUG=1 \
|
||||
UNAME="Linux" \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
STRIP="/bin/true" \
|
||||
batctl install
|
||||
|
||||
ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
|
||||
|
@ -81,7 +95,7 @@ $(eval $(call Download,batctl))
|
|||
|
||||
BATCTL_EXTRACT = tar xzf "$(DL_DIR)/batctl-$(BATCTL_VERSION).tar.gz" -C "$(BUILD_DIR)/$(PKG_NAME)"
|
||||
BATCTL_PATCH = $(call Build/DoPatch,"$(PKG_BATCTL_BUILD_DIR)","$(PATCH_DIR)","*batctl*")
|
||||
BATCTL_BUILD = $(MAKE) -C $(PKG_BATCTL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
|
||||
BATCTL_BUILD = $(MAKE_BATCTL_ENV) $(MAKE) -C $(PKG_BATCTL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
|
||||
BATCTL_INSTALL = $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/sbin/batctl $(1)/usr/sbin/
|
||||
endif
|
||||
|
||||
|
@ -100,6 +114,13 @@ define Build/Patch
|
|||
$(BATCTL_PATCH)
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
$(SED) '/#define _NET_BATMAN_ADV_MAIN_H_/a\#undef CONFIG_MODULE_STRIPPED' \
|
||||
$(PKG_BUILD_DIR)/main.h
|
||||
endef
|
||||
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATMAN_ADV_ARGS)
|
||||
$(BATCTL_BUILD)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
From 2c7bfe1299efa97438814bf6826a8f7ab3bc0b16 Mon Sep 17 00:00:00 2001
|
||||
From: Sven Eckelmann <sven@narfation.org>
|
||||
Date: Tue, 7 May 2013 14:51:02 +0200
|
||||
Subject: [PATCH] batctl: Add CFLAGS to the linker step
|
||||
|
||||
The GCC manual states for different parameters that the options for compilation
|
||||
must also be used when linking. The options for compilation are stored in
|
||||
CFLAGS and added to LINK.o to fix the behavior.
|
||||
|
||||
Option which need this are for example -fPIC/-fPIE or -flto.
|
||||
|
||||
Signed-off-by: Sven Eckelmann <sven@narfation.org>
|
||||
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 311e70e..233f453 100755
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -53,7 +53,7 @@ RM ?= rm -f
|
||||
INSTALL ?= install
|
||||
MKDIR ?= mkdir -p
|
||||
COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
-LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH)
|
||||
+LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH)
|
||||
|
||||
# standard install paths
|
||||
PREFIX = /usr/local
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
From e56c79f4e863436d0fc6c48fed0db09b7a49e565 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Lindner <lindner_marek@yahoo.de>
|
||||
Date: Mon, 4 Mar 2013 10:39:49 +0800
|
||||
Subject: [PATCH 1/3] batman-adv: verify tt len does not exceed packet len
|
||||
|
||||
batadv_iv_ogm_process() accesses the packet using the tt_num_changes
|
||||
attribute regardless of the real packet len (assuming the length check
|
||||
was done before). Therefore a length check is needed to avoid reading
|
||||
random memory.
|
||||
|
||||
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
|
||||
---
|
||||
bat_iv_ogm.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
|
||||
index 72fe1bb..d5be889 100644
|
||||
--- a/bat_iv_ogm.c
|
||||
+++ b/bat_iv_ogm.c
|
||||
@@ -1292,7 +1292,8 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb,
|
||||
batadv_ogm_packet = (struct batadv_ogm_packet *)packet_buff;
|
||||
|
||||
/* unpack the aggregated packets and process them one by one */
|
||||
- do {
|
||||
+ while (batadv_iv_ogm_aggr_packet(buff_pos, packet_len,
|
||||
+ batadv_ogm_packet->tt_num_changes)) {
|
||||
tt_buff = packet_buff + buff_pos + BATADV_OGM_HLEN;
|
||||
|
||||
batadv_iv_ogm_process(ethhdr, batadv_ogm_packet, tt_buff,
|
||||
@@ -1303,8 +1304,7 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb,
|
||||
|
||||
packet_pos = packet_buff + buff_pos;
|
||||
batadv_ogm_packet = (struct batadv_ogm_packet *)packet_pos;
|
||||
- } while (batadv_iv_ogm_aggr_packet(buff_pos, packet_len,
|
||||
- batadv_ogm_packet->tt_num_changes));
|
||||
+ }
|
||||
|
||||
kfree_skb(skb);
|
||||
return NET_RX_SUCCESS;
|
||||
--
|
||||
1.7.10.4
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,250 +0,0 @@
|
|||
From 647d23f3e358d9fa4b1a8f0bb67a3e6bff30d4a1 Mon Sep 17 00:00:00 2001
|
||||
From: Antonio Quartulli <ordex@autistici.org>
|
||||
Date: Wed, 3 Apr 2013 19:10:26 +0200
|
||||
Subject: [PATCH 3/3] batman-adv: make is_my_mac() check for the current mesh
|
||||
only
|
||||
|
||||
On a multi-mesh node (a node running more than one batman-adv
|
||||
virtual interface) batadv_is_my_mac() has to check MAC
|
||||
addresses of hard interfaces belonging to the current mesh
|
||||
only.
|
||||
|
||||
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
|
||||
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
|
||||
---
|
||||
main.c | 5 ++++-
|
||||
main.h | 2 +-
|
||||
routing.c | 38 ++++++++++++++++++++------------------
|
||||
translation-table.c | 2 +-
|
||||
vis.c | 4 ++--
|
||||
5 files changed, 28 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/main.c b/main.c
|
||||
index 0488d70..fa563e4 100644
|
||||
--- a/main.c
|
||||
+++ b/main.c
|
||||
@@ -169,7 +169,7 @@ void batadv_mesh_free(struct net_device *soft_iface)
|
||||
atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
|
||||
}
|
||||
|
||||
-int batadv_is_my_mac(const uint8_t *addr)
|
||||
+int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr)
|
||||
{
|
||||
const struct batadv_hard_iface *hard_iface;
|
||||
|
||||
@@ -178,6 +178,9 @@ int batadv_is_my_mac(const uint8_t *addr)
|
||||
if (hard_iface->if_status != BATADV_IF_ACTIVE)
|
||||
continue;
|
||||
|
||||
+ if (hard_iface->soft_iface != bat_priv->soft_iface)
|
||||
+ continue;
|
||||
+
|
||||
if (batadv_compare_eth(hard_iface->net_dev->dev_addr, addr)) {
|
||||
rcu_read_unlock();
|
||||
return 1;
|
||||
diff --git a/main.h b/main.h
|
||||
index 08c5dd1..fcb5d65 100644
|
||||
--- a/main.h
|
||||
+++ b/main.h
|
||||
@@ -164,7 +164,7 @@ extern struct workqueue_struct *batadv_event_workqueue;
|
||||
|
||||
int batadv_mesh_init(struct net_device *soft_iface);
|
||||
void batadv_mesh_free(struct net_device *soft_iface);
|
||||
-int batadv_is_my_mac(const uint8_t *addr);
|
||||
+int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr);
|
||||
struct batadv_hard_iface *
|
||||
batadv_seq_print_text_primary_if_get(struct seq_file *seq);
|
||||
int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
|
||||
diff --git a/routing.c b/routing.c
|
||||
index 5ee21ce..319f290 100644
|
||||
--- a/routing.c
|
||||
+++ b/routing.c
|
||||
@@ -402,7 +402,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb,
|
||||
goto out;
|
||||
|
||||
/* not for me */
|
||||
- if (!batadv_is_my_mac(ethhdr->h_dest))
|
||||
+ if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest))
|
||||
goto out;
|
||||
|
||||
icmp_packet = (struct batadv_icmp_packet_rr *)skb->data;
|
||||
@@ -416,7 +416,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
/* packet for me */
|
||||
- if (batadv_is_my_mac(icmp_packet->dst))
|
||||
+ if (batadv_is_my_mac(bat_priv, icmp_packet->dst))
|
||||
return batadv_recv_my_icmp_packet(bat_priv, skb, hdr_size);
|
||||
|
||||
/* TTL exceeded */
|
||||
@@ -548,7 +548,8 @@ batadv_find_ifalter_router(struct batadv_orig_node *primary_orig,
|
||||
return router;
|
||||
}
|
||||
|
||||
-static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size)
|
||||
+static int batadv_check_unicast_packet(struct batadv_priv *bat_priv,
|
||||
+ struct sk_buff *skb, int hdr_size)
|
||||
{
|
||||
struct ethhdr *ethhdr;
|
||||
|
||||
@@ -567,7 +568,7 @@ static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size)
|
||||
return -1;
|
||||
|
||||
/* not for me */
|
||||
- if (!batadv_is_my_mac(ethhdr->h_dest))
|
||||
+ if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@@ -582,7 +583,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct batadv_hard_iface *recv_if)
|
||||
char tt_flag;
|
||||
size_t packet_size;
|
||||
|
||||
- if (batadv_check_unicast_packet(skb, hdr_size) < 0)
|
||||
+ if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0)
|
||||
return NET_RX_DROP;
|
||||
|
||||
/* I could need to modify it */
|
||||
@@ -614,7 +615,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct batadv_hard_iface *recv_if)
|
||||
case BATADV_TT_RESPONSE:
|
||||
batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_RX);
|
||||
|
||||
- if (batadv_is_my_mac(tt_query->dst)) {
|
||||
+ if (batadv_is_my_mac(bat_priv, tt_query->dst)) {
|
||||
/* packet needs to be linearized to access the TT
|
||||
* changes
|
||||
*/
|
||||
@@ -657,14 +658,15 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct batadv_hard_iface *recv_if)
|
||||
struct batadv_roam_adv_packet *roam_adv_packet;
|
||||
struct batadv_orig_node *orig_node;
|
||||
|
||||
- if (batadv_check_unicast_packet(skb, sizeof(*roam_adv_packet)) < 0)
|
||||
+ if (batadv_check_unicast_packet(bat_priv, skb,
|
||||
+ sizeof(*roam_adv_packet)) < 0)
|
||||
goto out;
|
||||
|
||||
batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX);
|
||||
|
||||
roam_adv_packet = (struct batadv_roam_adv_packet *)skb->data;
|
||||
|
||||
- if (!batadv_is_my_mac(roam_adv_packet->dst))
|
||||
+ if (!batadv_is_my_mac(bat_priv, roam_adv_packet->dst))
|
||||
return batadv_route_unicast_packet(skb, recv_if);
|
||||
|
||||
/* check if it is a backbone gateway. we don't accept
|
||||
@@ -967,7 +969,7 @@ static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv,
|
||||
* last time) the packet had an updated information or not
|
||||
*/
|
||||
curr_ttvn = (uint8_t)atomic_read(&bat_priv->tt.vn);
|
||||
- if (!batadv_is_my_mac(unicast_packet->dest)) {
|
||||
+ if (!batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
|
||||
orig_node = batadv_orig_hash_find(bat_priv,
|
||||
unicast_packet->dest);
|
||||
/* if it is not possible to find the orig_node representing the
|
||||
@@ -1044,14 +1046,14 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
|
||||
if (is4addr)
|
||||
hdr_size = sizeof(*unicast_4addr_packet);
|
||||
|
||||
- if (batadv_check_unicast_packet(skb, hdr_size) < 0)
|
||||
+ if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0)
|
||||
return NET_RX_DROP;
|
||||
|
||||
if (!batadv_check_unicast_ttvn(bat_priv, skb))
|
||||
return NET_RX_DROP;
|
||||
|
||||
/* packet for me */
|
||||
- if (batadv_is_my_mac(unicast_packet->dest)) {
|
||||
+ if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
|
||||
if (is4addr) {
|
||||
batadv_dat_inc_counter(bat_priv,
|
||||
unicast_4addr_packet->subtype);
|
||||
@@ -1088,7 +1090,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
|
||||
struct sk_buff *new_skb = NULL;
|
||||
int ret;
|
||||
|
||||
- if (batadv_check_unicast_packet(skb, hdr_size) < 0)
|
||||
+ if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0)
|
||||
return NET_RX_DROP;
|
||||
|
||||
if (!batadv_check_unicast_ttvn(bat_priv, skb))
|
||||
@@ -1097,7 +1099,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb,
|
||||
unicast_packet = (struct batadv_unicast_frag_packet *)skb->data;
|
||||
|
||||
/* packet for me */
|
||||
- if (batadv_is_my_mac(unicast_packet->dest)) {
|
||||
+ if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
|
||||
ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb);
|
||||
|
||||
if (ret == NET_RX_DROP)
|
||||
@@ -1151,13 +1153,13 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
|
||||
goto out;
|
||||
|
||||
/* ignore broadcasts sent by myself */
|
||||
- if (batadv_is_my_mac(ethhdr->h_source))
|
||||
+ if (batadv_is_my_mac(bat_priv, ethhdr->h_source))
|
||||
goto out;
|
||||
|
||||
bcast_packet = (struct batadv_bcast_packet *)skb->data;
|
||||
|
||||
/* ignore broadcasts originated by myself */
|
||||
- if (batadv_is_my_mac(bcast_packet->orig))
|
||||
+ if (batadv_is_my_mac(bat_priv, bcast_packet->orig))
|
||||
goto out;
|
||||
|
||||
if (bcast_packet->header.ttl < 2)
|
||||
@@ -1243,14 +1245,14 @@ int batadv_recv_vis_packet(struct sk_buff *skb,
|
||||
ethhdr = (struct ethhdr *)skb_mac_header(skb);
|
||||
|
||||
/* not for me */
|
||||
- if (!batadv_is_my_mac(ethhdr->h_dest))
|
||||
+ if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest))
|
||||
return NET_RX_DROP;
|
||||
|
||||
/* ignore own packets */
|
||||
- if (batadv_is_my_mac(vis_packet->vis_orig))
|
||||
+ if (batadv_is_my_mac(bat_priv, vis_packet->vis_orig))
|
||||
return NET_RX_DROP;
|
||||
|
||||
- if (batadv_is_my_mac(vis_packet->sender_orig))
|
||||
+ if (batadv_is_my_mac(bat_priv, vis_packet->sender_orig))
|
||||
return NET_RX_DROP;
|
||||
|
||||
switch (vis_packet->vis_type) {
|
||||
diff --git a/translation-table.c b/translation-table.c
|
||||
index 98a66a0..7abee19 100644
|
||||
--- a/translation-table.c
|
||||
+++ b/translation-table.c
|
||||
@@ -1953,7 +1953,7 @@ out:
|
||||
bool batadv_send_tt_response(struct batadv_priv *bat_priv,
|
||||
struct batadv_tt_query_packet *tt_request)
|
||||
{
|
||||
- if (batadv_is_my_mac(tt_request->dst)) {
|
||||
+ if (batadv_is_my_mac(bat_priv, tt_request->dst)) {
|
||||
/* don't answer backbone gws! */
|
||||
if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_request->src))
|
||||
return true;
|
||||
diff --git a/vis.c b/vis.c
|
||||
index c053244..6a1e646 100644
|
||||
--- a/vis.c
|
||||
+++ b/vis.c
|
||||
@@ -477,7 +477,7 @@ void batadv_receive_client_update_packet(struct batadv_priv *bat_priv,
|
||||
|
||||
/* Are we the target for this VIS packet? */
|
||||
if (vis_server == BATADV_VIS_TYPE_SERVER_SYNC &&
|
||||
- batadv_is_my_mac(vis_packet->target_orig))
|
||||
+ batadv_is_my_mac(bat_priv, vis_packet->target_orig))
|
||||
are_target = 1;
|
||||
|
||||
spin_lock_bh(&bat_priv->vis.hash_lock);
|
||||
@@ -496,7 +496,7 @@ void batadv_receive_client_update_packet(struct batadv_priv *bat_priv,
|
||||
batadv_send_list_add(bat_priv, info);
|
||||
|
||||
/* ... we're not the recipient (and thus need to forward). */
|
||||
- } else if (!batadv_is_my_mac(packet->target_orig)) {
|
||||
+ } else if (!batadv_is_my_mac(bat_priv, packet->target_orig)) {
|
||||
batadv_send_list_add(bat_priv, info);
|
||||
}
|
||||
|
||||
--
|
||||
1.7.10.4
|
||||
|
|
@ -8,13 +8,13 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=olsrd
|
||||
PKG_VERSION:=0.6.5.3
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.6.6
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=http://www.olsr.org/releases/0.6
|
||||
|
||||
PKG_MD5SUM:=c99a6800e152dbc08436c0c36c61e9e0
|
||||
PKG_MD5SUM:=f98e5a10f1842f6028023da114bf1e1a
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
|
36
olsrd/patches/001-hotfix-long-http-headers-txtinfo.patch
Normal file
36
olsrd/patches/001-hotfix-long-http-headers-txtinfo.patch
Normal file
|
@ -0,0 +1,36 @@
|
|||
commit d68c96cf53f188030452aadec466aa6389e81511
|
||||
Author: Henning Rogge <hrogge@gmail.com>
|
||||
Date: Tue May 13 21:23:36 2014 +0200
|
||||
|
||||
Hotfix for much too long http headers
|
||||
|
||||
diff --git a/lib/txtinfo/src/olsrd_txtinfo.c b/lib/txtinfo/src/olsrd_txtinfo.c
|
||||
index b56545d..2bcce41 100644
|
||||
--- a/lib/txtinfo/src/olsrd_txtinfo.c
|
||||
+++ b/lib/txtinfo/src/olsrd_txtinfo.c
|
||||
@@ -301,8 +301,15 @@ ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int flags __att
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET((unsigned int)ipc_connection, &rfds); /* Win32 needs the cast here */
|
||||
if (0 <= select(ipc_connection + 1, &rfds, NULL, NULL, &tv)) {
|
||||
- char requ[128];
|
||||
- ssize_t s = recv(ipc_connection, (void *)&requ, sizeof(requ), 0); /* Win32 needs the cast here */
|
||||
+ char requ[1024];
|
||||
+ ssize_t s = recv(ipc_connection, (void *)&requ, sizeof(requ)-1, 0); /* Win32 needs the cast here */
|
||||
+
|
||||
+ if (s == sizeof(requ)-1) {
|
||||
+ /* input was much too long, just skip the rest */
|
||||
+ char dummy[1024];
|
||||
+
|
||||
+ while (recv(ipc_connection, (void *)&dummy, sizeof(dummy), 0) == sizeof(dummy), 0);
|
||||
+ }
|
||||
if (0 < s) {
|
||||
requ[s] = 0;
|
||||
/* To print out neighbours only on the Freifunk Status
|
||||
@@ -329,6 +336,7 @@ ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int flags __att
|
||||
if (0 != strstr(requ, "/ver")) send_what |= SIW_VERSION;
|
||||
}
|
||||
}
|
||||
+
|
||||
if ( send_what == 0 ) send_what = SIW_ALL;
|
||||
}
|
||||
|
28
olsrd/patches/002-hotfix-long-http-headers-json.patch
Normal file
28
olsrd/patches/002-hotfix-long-http-headers-json.patch
Normal file
|
@ -0,0 +1,28 @@
|
|||
commit 528176910ee1d00278e4108cc23d9f4f2de8a639
|
||||
Author: Alessio Caiazza <nolith@abisso.org>
|
||||
Date: Wed May 14 22:45:33 2014 +0200
|
||||
|
||||
Hotfix for very long http headers also for jsoninfo
|
||||
|
||||
diff --git a/lib/jsoninfo/src/olsrd_jsoninfo.c b/lib/jsoninfo/src/olsrd_jsoninfo.c
|
||||
index 966292c..817c64a 100644
|
||||
--- a/lib/jsoninfo/src/olsrd_jsoninfo.c
|
||||
+++ b/lib/jsoninfo/src/olsrd_jsoninfo.c
|
||||
@@ -508,8 +508,15 @@ ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int flags __att
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET((unsigned int)ipc_connection, &rfds); /* Win32 needs the cast here */
|
||||
if (0 <= select(ipc_connection + 1, &rfds, NULL, NULL, &tv)) {
|
||||
- char requ[128];
|
||||
- ssize_t s = recv(ipc_connection, (void *)&requ, sizeof(requ), 0); /* Win32 needs the cast here */
|
||||
+ char requ[1024];
|
||||
+ ssize_t s = recv(ipc_connection, (void *)&requ, sizeof(requ)-1, 0); /* Win32 needs the cast here */
|
||||
+
|
||||
+ if (s == sizeof(requ)-1) {
|
||||
+ /* input was too much long, just skip the rest */
|
||||
+ char dummy[1024];
|
||||
+
|
||||
+ while (recv(ipc_connection, (void *)&dummy, sizeof(dummy), 0) == sizeof(dummy), 0);
|
||||
+ }
|
||||
if (0 < s) {
|
||||
requ[s] = 0;
|
||||
/* print out the requested tables */
|
67
oonf-dlep-proxy/Makefile
Normal file
67
oonf-dlep-proxy/Makefile
Normal file
|
@ -0,0 +1,67 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=oonf-dlep-proxy
|
||||
PKG_VERSION:=0.14.1-1
|
||||
PKG_REV:=d86825c0bdf144db706da444be7b0a2e8722b54d
|
||||
PKG_RELEASE:=$(PKG_REV)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=$(PKG_REV)
|
||||
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
CMAKE_OPTIONS=-D OONF_NO_WERROR:Bool=true \
|
||||
-D OONF_LOGGING_LEVEL:String=debug \
|
||||
-D OONF_NO_TESTING:Bool=true \
|
||||
-D UCI:Bool=true \
|
||||
-D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
|
||||
-D OONF_STATIC_PLUGINS:String="class;clock;layer2;packet_socket;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_system;nl80211_listener;layer2info;systeminfo;cfg_uciloader;cfg_compact;dlep_proxy" \
|
||||
-D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \
|
||||
-D OONF_VERSION:String=$(PKG_VERSION) \
|
||||
-D INSTALL_LIB_DIR:Path=lib/oonf \
|
||||
-D INSTALL_INCLUDE_DIR:Path=include/oonf \
|
||||
-D INSTALL_CMAKE_DIR:Path=lib/oonf \
|
||||
-D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr
|
||||
|
||||
define Package/oonf-git/template
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
MAINTAINER:=Henning Rogge <hrogge@gmail.com>
|
||||
SUBMENU:=OLSR.org network framework
|
||||
URL:=http://www.olsr.org/
|
||||
endef
|
||||
|
||||
define Package/oonf-dlep-proxy
|
||||
$(call Package/oonf-git/template)
|
||||
TITLE:= Build DLEP Radio+Router Agent
|
||||
DEPENDS:=+librt +libnl-tiny +libuci +oonf-init-scripts
|
||||
VERSION:=$(PKG_VERSION)
|
||||
endef
|
||||
|
||||
Build/Compile=$(call Build/Compile/Default,dlep_radio_static)
|
||||
Build/Install=
|
||||
|
||||
define Build/Install
|
||||
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/dlep_radio_static $(PKG_INSTALL_DIR)/usr/sbin/dlep_proxy;
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny
|
||||
|
||||
define Package/oonf-dlep-proxy/install
|
||||
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/dlep_radio_static $(1)/usr/sbin/dlep_proxy
|
||||
$(INSTALL_BIN) -D ./files/dlep_proxy.init $(1)/etc/init.d/dlep_proxy
|
||||
$(INSTALL_BIN) -D ./files/dlep_proxy.hotplug $(1)/etc/hotplug.d/iface/50-dlep_proxy
|
||||
$(INSTALL_DATA) -D ./files/dlep_proxy.uci $(1)/etc/config/dlep_proxy
|
||||
endef
|
||||
|
||||
define Package/oonf-dlep-proxy/conffiles
|
||||
/etc/config/dlep_proxy
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,oonf-dlep-proxy))
|
5
oonf-dlep-proxy/files/dlep_proxy.hotplug
Executable file
5
oonf-dlep-proxy/files/dlep_proxy.hotplug
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
DAEMON='dlep_proxy'
|
||||
|
||||
. /lib/functions/oonf_hotplug.sh
|
6
oonf-dlep-proxy/files/dlep_proxy.init
Executable file
6
oonf-dlep-proxy/files/dlep_proxy.init
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=82
|
||||
DAEMON='dlep_proxy'
|
||||
|
||||
. /lib/functions/oonf_init.sh
|
24
oonf-dlep-proxy/files/dlep_proxy.uci
Normal file
24
oonf-dlep-proxy/files/dlep_proxy.uci
Normal file
|
@ -0,0 +1,24 @@
|
|||
config global
|
||||
option 'failfast' 'no'
|
||||
option 'pidfile' '/var/run/dlep_proxy.pid'
|
||||
option 'lockfile' '/var/lock/dlep_proxy'
|
||||
|
||||
config log
|
||||
option 'syslog' 'true'
|
||||
option 'stderr' 'true'
|
||||
# option 'file' '/var/log/dlep_proxy.log'
|
||||
# option 'info' 'all'
|
||||
# option 'debug' 'all'
|
||||
|
||||
config telnet
|
||||
# option 'port' '2009'
|
||||
|
||||
#config dlep_radio
|
||||
# list 'name' 'eth0'
|
||||
# option 'datapath_if' 'eth1'
|
||||
# option 'not_proxied' 'false'
|
||||
# option 'proxied' 'true'
|
||||
|
||||
#config dlep-router
|
||||
# list 'name' 'eth0'
|
||||
# option 'datapath_if' 'eth0'
|
67
oonf-dlep-radio/Makefile
Normal file
67
oonf-dlep-radio/Makefile
Normal file
|
@ -0,0 +1,67 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=oonf-dlep-radio
|
||||
PKG_VERSION:=0.14.1-1
|
||||
PKG_REV:=d86825c0bdf144db706da444be7b0a2e8722b54d
|
||||
PKG_RELEASE:=$(PKG_REV)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=$(PKG_REV)
|
||||
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
CMAKE_OPTIONS=-D OONF_NO_WERROR:Bool=true \
|
||||
-D OONF_LOGGING_LEVEL:String=debug \
|
||||
-D OONF_NO_TESTING:Bool=true \
|
||||
-D UCI:Bool=true \
|
||||
-D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
|
||||
-D OONF_STATIC_PLUGINS:String="class;clock;layer2;packet_socket;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_system;nl80211_listener;layer2info;systeminfo;cfg_uciloader;cfg_compact;dlep_radio" \
|
||||
-D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \
|
||||
-D OONF_VERSION:String=$(PKG_VERSION) \
|
||||
-D INSTALL_LIB_DIR:Path=lib/oonf \
|
||||
-D INSTALL_INCLUDE_DIR:Path=include/oonf \
|
||||
-D INSTALL_CMAKE_DIR:Path=lib/oonf \
|
||||
-D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr
|
||||
|
||||
define Package/oonf-git/template
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
MAINTAINER:=Henning Rogge <hrogge@gmail.com>
|
||||
SUBMENU:=OLSR.org network framework
|
||||
URL:=http://www.olsr.org/
|
||||
endef
|
||||
|
||||
define Package/oonf-dlep-radio
|
||||
$(call Package/oonf-git/template)
|
||||
TITLE:= Build DLEP Radio Agent
|
||||
DEPENDS:=+librt +libnl-tiny +libuci +oonf-init-scripts
|
||||
VERSION:=$(PKG_VERSION)
|
||||
endef
|
||||
|
||||
Build/Compile=$(call Build/Compile/Default,dlep_radio_static)
|
||||
Build/Install=
|
||||
|
||||
define Build/Install
|
||||
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/dlep_radio_static $(PKG_INSTALL_DIR)/usr/sbin/dlep_radio;
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny
|
||||
|
||||
define Package/oonf-dlep-radio/install
|
||||
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/dlep_radio_static $(1)/usr/sbin/dlep_radio
|
||||
$(INSTALL_BIN) -D ./files/dlep_radio.init $(1)/etc/init.d/dlep_radio
|
||||
$(INSTALL_BIN) -D ./files/dlep_radio.hotplug $(1)/etc/hotplug.d/iface/50-dlep_radio
|
||||
$(INSTALL_DATA) -D ./files/dlep_radio.uci $(1)/etc/config/dlep_radio
|
||||
endef
|
||||
|
||||
define Package/oonf-dlep-radio/conffiles
|
||||
/etc/config/dlep_radio
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,oonf-dlep-radio))
|
5
oonf-dlep-radio/files/dlep_radio.hotplug
Executable file
5
oonf-dlep-radio/files/dlep_radio.hotplug
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
DAEMON='dlep_radio'
|
||||
|
||||
. /lib/functions/oonf_hotplug.sh
|
6
oonf-dlep-radio/files/dlep_radio.init
Executable file
6
oonf-dlep-radio/files/dlep_radio.init
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=82
|
||||
DAEMON='dlep_radio'
|
||||
|
||||
. /lib/functions/oonf_init.sh
|
24
oonf-dlep-radio/files/dlep_radio.uci
Normal file
24
oonf-dlep-radio/files/dlep_radio.uci
Normal file
|
@ -0,0 +1,24 @@
|
|||
config global
|
||||
option 'failfast' 'no'
|
||||
option 'pidfile' '/var/run/dlep_radio.pid'
|
||||
option 'lockfile' '/var/lock/dlep_radio'
|
||||
|
||||
config log
|
||||
option 'syslog' 'true'
|
||||
option 'stderr' 'true'
|
||||
# option 'file' '/var/log/dlep_radio.log'
|
||||
# option 'info' 'all'
|
||||
# option 'debug' 'all'
|
||||
|
||||
config telnet
|
||||
# option 'port' '2009'
|
||||
|
||||
config dlep_radio
|
||||
list 'name' 'wlan0'
|
||||
option 'datapath_if' 'br-lan'
|
||||
option 'not_proxied' 'false'
|
||||
option 'proxied' 'true'
|
||||
|
||||
config nl80211_listener
|
||||
option 'if' 'wlan0'
|
||||
option 'interval' '1.0'
|
36
oonf-init-scripts/Makefile
Normal file
36
oonf-init-scripts/Makefile
Normal file
|
@ -0,0 +1,36 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=oonf-init-scripts
|
||||
PKG_VERSION:=0.9.1-r3
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/oonf-init-scripts
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
MAINTAINER:=Henning Rogge <hrogge@gmail.com>
|
||||
SUBMENU:=OLSR.org network framework
|
||||
URL:=http://www.olsr.org/
|
||||
TITLE:= Common OONF startup scripts
|
||||
VERSION:=$(PKG_VERSION)
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/oonf-init-scripts/install
|
||||
$(INSTALL_BIN) -D ./files/oonf_init.sh $(1)/lib/functions/oonf_init.sh
|
||||
$(INSTALL_BIN) -D ./files/oonf_hotplug.sh $(1)/lib/functions/oonf_hotplug.sh
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,oonf-init-scripts))
|
10
oonf-init-scripts/files/oonf_hotplug.sh
Executable file
10
oonf-init-scripts/files/oonf_hotplug.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
case "${ACTION}" in
|
||||
ifup)
|
||||
. /etc/rc.common /etc/init.d/${DAEMON} enabled && {
|
||||
logger -t '${DAEMON}[hotplug]' -p daemon.info 'reloading configuration'
|
||||
. /etc/rc.common /etc/init.d/${DAEMON} reload
|
||||
}
|
||||
;;
|
||||
esac
|
120
oonf-init-scripts/files/oonf_init.sh
Executable file
120
oonf-init-scripts/files/oonf_init.sh
Executable file
|
@ -0,0 +1,120 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
oonf_log()
|
||||
{
|
||||
logger -s -t ${DAEMON} -p daemon.info "${1}"
|
||||
}
|
||||
|
||||
oonf_get_layer3_device()
|
||||
{
|
||||
local interface="${1}" # e.g. 'mywifi'
|
||||
local status dev proto
|
||||
local query="{ \"interface\" : \"${interface}\" }"
|
||||
|
||||
status="$( ubus -S call network.interface status "${query}" )" && {
|
||||
json_load "${status}"
|
||||
json_get_var 'dev' l3_device
|
||||
json_get_var 'proto' proto
|
||||
case "${proto}" in
|
||||
pppoe)
|
||||
# TODO: otherwise it segfaults
|
||||
oonf_log "refusing to add '$interface', because of proto '${proto}'"
|
||||
;;
|
||||
*)
|
||||
echo "${dev}" # e.g. 'wlan0-1'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
}
|
||||
|
||||
oonf_add_devices_to_configuration()
|
||||
{
|
||||
local i=0
|
||||
local device_name= section= interface= single_interface=
|
||||
|
||||
# make a copy of configuration and
|
||||
# add a 'name' (physical name) for all
|
||||
# 'interface-names' (e.g. mywifi)
|
||||
#
|
||||
# olsrd2.@interface[2]=interface
|
||||
# olsrd2.@interface[2].ifname='wan lan wlanadhoc wlanadhocRADIO1'
|
||||
|
||||
# /var is in ramdisc/tmpfs
|
||||
uci export ${DAEMON} >"/var/run/${DAEMON}_dev"
|
||||
|
||||
while section="$( uci -q -c /etc/config get "${DAEMON}.@[${i}]" )"; do {
|
||||
echo "section: ${section}"
|
||||
|
||||
interface="$( uci -q -c /etc/config get "${DAEMON}.@[${i}].ifname" )" || {
|
||||
i=$(( i + 1 ))
|
||||
continue
|
||||
}
|
||||
|
||||
case "$( uci -q get "${DAEMON}.@[${i}].ignore" )" in
|
||||
1|on|true|enabled|yes)
|
||||
oonf_log "removing/ignore section '$section'"
|
||||
uci -q -c /var/run delete "${DAEMON}_dev.@[${j}]"
|
||||
i=$(( i + 1 ))
|
||||
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
for single_interface in ${interface}; do {
|
||||
device_name="$( oonf_get_layer3_device "${single_interface}" )"
|
||||
|
||||
echo "Interface: ${single_interface} = ${device_name}"
|
||||
|
||||
if [ ! -z "${device_name}" ]
|
||||
then
|
||||
# add option 'name' for 'ifname' (e.g. 'mywifi')
|
||||
uci -q -c /var/run add_list "${DAEMON}_dev.@[${i}].name=${device_name}"
|
||||
fi
|
||||
} done
|
||||
i=$(( $i + 1 ))
|
||||
} done
|
||||
|
||||
uci -q -c /var/run commit "${DAEMON}_dev"
|
||||
|
||||
oonf_log "wrote '/var/run/${DAEMON}_dev'"
|
||||
}
|
||||
|
||||
oonf_reread_config()
|
||||
{
|
||||
local pid
|
||||
local pidfile="/var/run/${DAEMON}.pid"
|
||||
|
||||
if [ -e "${pidfile}" ]; then
|
||||
read pid <"${pidfile}"
|
||||
elif pidfile="$( uci -q get "${DAEMON}.@global[0].pidfile" )"; then
|
||||
read pid <"${pidfile}"
|
||||
fi
|
||||
|
||||
# if empty, ask kernel
|
||||
pid="${pid:-$( pidof ${DAEMON} )}"
|
||||
|
||||
[ -n "${pid}" ] && kill -SIGHUP ${pid}
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
oonf_add_devices_to_configuration
|
||||
|
||||
# produce coredumps
|
||||
ulimit -c unlimited
|
||||
|
||||
service_start /usr/sbin/${DAEMON} --set global.fork=true --load uci:///var/run/${DAEMON}_dev
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
service_stop /usr/sbin/${DAEMON}
|
||||
}
|
||||
|
||||
reload()
|
||||
{
|
||||
oonf_add_devices_to_configuration
|
||||
oonf_reread_config
|
||||
}
|
47
oonf-olsrd2/Config.in
Normal file
47
oonf-olsrd2/Config.in
Normal file
|
@ -0,0 +1,47 @@
|
|||
# OONF Olsrd2 configuration
|
||||
menu "Optional Plugins"
|
||||
depends on PACKAGE_oonf-olsrd2
|
||||
|
||||
config OONF_NHDP_AUTOLL4
|
||||
bool "Auto_LL4 plugin enabled"
|
||||
help
|
||||
The auto_ll4 plugin automatically generates linklocal IPv4 addresses on interfaces that do not contain IPv4 addresses.
|
||||
default n
|
||||
|
||||
config OONF_OLSRV2_LAN_IMPORT
|
||||
bool "Lan_import plugin enabled"
|
||||
help
|
||||
The lan_import plugin can read routing tables and automatically export them as locally attached networks in olsrd2.
|
||||
default n
|
||||
|
||||
config OONF_OLSRV2_ROUTE_MODIFIER
|
||||
bool "route_modifier plugin enabled"
|
||||
help
|
||||
The route_modifier plugin allows you to overwrite aspects of routes (like table/protocol) for certain destinations.
|
||||
default n
|
||||
|
||||
config OONF_GENERIC_DLEP_ROUTER
|
||||
bool "dlep_router plugin enabled"
|
||||
help
|
||||
The dlep_router plugin can receive linklayer metadata over the DLEP protocol.
|
||||
default n
|
||||
|
||||
config OONF_GENERIC_REMOTECONTROL
|
||||
bool "remotecontrol plugin enabled"
|
||||
help
|
||||
The remotecontrol plugin allows you to control configuration and logging over the telnet plugin. Be careful not to open this functionality over the network without securing it.
|
||||
default n
|
||||
|
||||
config OONF_GENERIC_HTTP
|
||||
bool "http plugin enabled"
|
||||
help
|
||||
The HTTP plugin allows HTTP access to all telnet commands.
|
||||
default n
|
||||
|
||||
config OONF_OLSRV2_MPR
|
||||
bool "MPR plugin enabled"
|
||||
help
|
||||
The MPR plugin reduce the routing graph to limit the overhead of the OLSRv2 protocol
|
||||
default n
|
||||
|
||||
endmenu
|
87
oonf-olsrd2/Makefile
Normal file
87
oonf-olsrd2/Makefile
Normal file
|
@ -0,0 +1,87 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=oonf-olsrd2
|
||||
PKG_VERSION:=0.14.1-1
|
||||
PKG_REV:=d86825c0bdf144db706da444be7b0a2e8722b54d
|
||||
PKG_RELEASE:=$(PKG_REV)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=https://github.com/OLSR/OONF.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=$(PKG_REV)
|
||||
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
SPACE:=
|
||||
SPACE+=
|
||||
CMAKE_OPTIONAL_PLUGINS:= $(subst $(SPACE),;,$(strip \
|
||||
$(if $(filter y,$(CONFIG_OONF_NHDP_AUTOLL4)),auto_ll4,) \
|
||||
$(if $(filter y,$(CONFIG_OONF_OLSRV2_LAN_IMPORT)),lan_import,) \
|
||||
$(if $(filter y,$(CONFIG_OONF_OLSRV2_ROUTE_MODIFIER)),route_modifier,) \
|
||||
$(if $(filter y,$(CONFIG_OONF_GENERIC_DLEP_ROUTER)),dlep_router,) \
|
||||
$(if $(filter y,$(CONFIG_OONF_GENERIC_REMOTECONTROL)),remotecontrol,) \
|
||||
$(if $(filter y,$(CONFIG_OONF_OLSRV2_MPR)),mpr,) \
|
||||
$(if $(filter y,$(CONFIG_OONF_GENERIC_HTTP)),http,) \
|
||||
))
|
||||
|
||||
BUILD_TYPE:= $(if $(filter y,$(CONFIG_DEBUG)),Debug,Release)
|
||||
|
||||
CMAKE_OPTIONS=-D CMAKE_BUILD_TYPE:String=$(BUILD_TYPE) \
|
||||
-D OONF_NO_WERROR:Bool=true \
|
||||
-D OONF_LOGGING_LEVEL:String=debug \
|
||||
-D OONF_NO_TESTING:Bool=true \
|
||||
-D UCI:Bool=true \
|
||||
-D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
|
||||
-D OONF_STATIC_PLUGINS:String="class;clock;duplicate_set;layer2;packet_socket;rfc5444;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_routing;os_system;nhdp;olsrv2;ff_dat_metric;neighbor_probing;nl80211_listener;link_config;layer2info;systeminfo;cfg_uciloader;cfg_compact;nhdpinfo;olsrv2info;netjsoninfo;${CMAKE_OPTIONAL_PLUGINS}" \
|
||||
-D OONF_LIB_GIT:String=v$(PKG_VERSION)-archive \
|
||||
-D OONF_VERSION:String=$(PKG_VERSION) \
|
||||
-D INSTALL_LIB_DIR:Path=lib/oonf \
|
||||
-D INSTALL_INCLUDE_DIR:Path=include/oonf \
|
||||
-D INSTALL_CMAKE_DIR:Path=lib/oonf \
|
||||
-D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr
|
||||
|
||||
define Package/oonf-git/template
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
MAINTAINER:=Henning Rogge <hrogge@gmail.com>
|
||||
SUBMENU:=OLSR.org network framework
|
||||
URL:=http://www.olsr.org/
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/oonf-olsrd2
|
||||
$(call Package/oonf-git/template)
|
||||
TITLE:= Build Olsrd V2 Routing Agent
|
||||
DEPENDS:=+librt +libnl-tiny +libuci +oonf-init-scripts
|
||||
VERSION:=$(PKG_VERSION)
|
||||
endef
|
||||
|
||||
define Package/oonf-olsrd2/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
Build/Compile=$(call Build/Compile/Default,olsrd2_static)
|
||||
Build/Install=
|
||||
|
||||
define Build/Install
|
||||
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/olsrd2_static $(PKG_INSTALL_DIR)/usr/sbin/olsrd2;
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -I${STAGING_DIR}/usr/include/libnl-tiny
|
||||
|
||||
define Package/oonf-olsrd2/install
|
||||
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/olsrd2_static $(1)/usr/sbin/olsrd2
|
||||
$(INSTALL_BIN) -D ./files/olsrd2.init $(1)/etc/init.d/olsrd2
|
||||
$(INSTALL_BIN) -D ./files/olsrd2.hotplug $(1)/etc/hotplug.d/iface/50-olsrd2
|
||||
$(INSTALL_DATA) -D ./files/olsrd2.uci $(1)/etc/config/olsrd2
|
||||
endef
|
||||
|
||||
define Package/oonf-olsrd2/conffiles
|
||||
/etc/config/olsrd2
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,oonf-olsrd2))
|
5
oonf-olsrd2/files/olsrd2.hotplug
Executable file
5
oonf-olsrd2/files/olsrd2.hotplug
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
DAEMON='olsrd2'
|
||||
|
||||
. /lib/functions/oonf_hotplug.sh
|
6
oonf-olsrd2/files/olsrd2.init
Executable file
6
oonf-olsrd2/files/olsrd2.init
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=82
|
||||
DAEMON='olsrd2'
|
||||
|
||||
. /lib/functions/oonf_init.sh
|
40
oonf-olsrd2/files/olsrd2.uci
Normal file
40
oonf-olsrd2/files/olsrd2.uci
Normal file
|
@ -0,0 +1,40 @@
|
|||
config global
|
||||
option 'failfast' 'no'
|
||||
option 'pidfile' '/var/run/olsrd2.pid'
|
||||
option 'lockfile' '/var/lock/olsrd2'
|
||||
|
||||
config log
|
||||
option 'syslog' 'true'
|
||||
option 'stderr' 'true'
|
||||
# option 'file' '/var/log/olsrd2.log'
|
||||
# option 'info' 'all'
|
||||
# option 'debug' 'all'
|
||||
|
||||
config telnet
|
||||
# option 'port' '2009'
|
||||
|
||||
config olsrv2
|
||||
# list 'lan' '::/0'
|
||||
# list 'lan' '0.0.0.0/0'
|
||||
|
||||
config interface
|
||||
option 'ifname' 'loopback'
|
||||
|
||||
config interface
|
||||
list 'ifname' 'WIFI'
|
||||
list 'ifname' 'wlanadhoc'
|
||||
list 'ifname' 'wlanadhocRADIO1'
|
||||
|
||||
config interface
|
||||
list 'ifname' 'wan'
|
||||
option 'ignore' '1'
|
||||
# option 'rx_bitrate' '100M'
|
||||
# option 'tx_bitrate' '100M'
|
||||
# option 'signal' '-20'
|
||||
|
||||
config interface
|
||||
list 'ifname' 'lan'
|
||||
option 'ignore' '1'
|
||||
# option 'rx_bitrate' '1G'
|
||||
# option 'tx_bitrate' '1G'
|
||||
# option 'signal' '-10'
|
Loading…
Reference in a new issue