#
-# Copyright (C) 2006-2011 OpenWrt.org
+# Copyright (C) 2006-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=radvd
PKG_VERSION:=1.8.3
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://v6web.litech.org/radvd/dist \
return 0
}
-validate_ifname() {
- local ifname=$1
- [ -z "$ifname" -o "$ifname" != "${ifname%%[!A-Za-z0-9.:_-]*}" ] && return 1
- return 0
-}
-
validate_ip6addr() {
local ip6addr=$1
[ -z "$ip6addr" -o "$ip6addr" != "${ip6addr%%[!A-Fa-f0-9.:]*}" ] && return 1
return 0
}
-get_ifname() {
- local interface=$1
- validate_varname "$interface" || return 1
- local cfgt
- local ifname
-
- scan_interfaces
- config_get cfgt "$interface" TYPE
- [ "$cfgt" != "interface" ] && return 1
- config_get ifname "$interface" ifname
- validate_ifname "$ifname" || return 1
- printf '%s\n' "$ifname"
-
- return 0
-}
-
get_ip6addr() {
local ifname=$1
local scope=$2
local ignore
local interfaces
local interface
+ local device
local prefixes
local prefix
local name
config_get value "$cfg" Base6Interface
if [ -n "$value" ]; then
- if ifname=$(get_ifname "$value"); then
- printf '\t\t%s %s;\n' "Base6Interface" "$ifname"
+ if network_get_device device "$value"; then
+ printf '\t\t%s %s;\n' "Base6Interface" "$device"
fi
fi
config_get value "$cfg" Base6to4Interface
if [ -n "$value" ]; then
- if ifname=$(get_ifname "$value"); then
- printf '\t\t%s %s;\n' "Base6to4Interface" "$ifname"
+ if network_get_device device "$value"; then
+ printf '\t\t%s %s;\n' "Base6to4Interface" "$device"
fi
fi
}
radvd_write_config() {
- include /lib/network
+ . /lib/functions/network.sh
RADVD_INTERFACES=
config_foreach radvd_add_interface interface
config_foreach radvd_add_interface DNSSL
for INTERFACE in $RADVD_INTERFACES; do
- IFNAME=$(get_ifname "$INTERFACE") || continue
+ network_get_device IFNAME "$INTERFACE" || continue
printf 'interface %s\n{\n' "$IFNAME"
config_foreach radvd_write_interface interface
config_foreach radvd_write_prefix prefix