aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/config/netifd
diff options
context:
space:
mode:
authorJames <>2013-03-17 12:16:37 +0000
committerJames <>2013-03-17 12:16:37 +0000
commit27b76ab0671089c47506615a796a261e993896a7 (patch)
tree61213d67e7fa87b20356b23798558e2c4212c42f /package/network/config/netifd
downloadtrunk-36060-master.tar.gz
trunk-36060-master.tar.bz2
trunk-36060-master.zip
Diffstat (limited to 'package/network/config/netifd')
-rw-r--r--package/network/config/netifd/.svn/entries68
-rw-r--r--package/network/config/netifd/.svn/text-base/Makefile.svn-base46
-rw-r--r--package/network/config/netifd/Makefile46
-rw-r--r--package/network/config/netifd/files/.svn/entries40
-rw-r--r--package/network/config/netifd/files/etc/.svn/entries34
-rw-r--r--package/network/config/netifd/files/etc/hotplug.d/.svn/entries31
-rw-r--r--package/network/config/netifd/files/etc/hotplug.d/iface/.svn/entries96
-rw-r--r--package/network/config/netifd/files/etc/hotplug.d/iface/.svn/text-base/00-netstate.svn-base8
-rw-r--r--package/network/config/netifd/files/etc/hotplug.d/iface/.svn/text-base/10-ipv6-static.svn-base19
-rw-r--r--package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate8
-rw-r--r--package/network/config/netifd/files/etc/hotplug.d/iface/10-ipv6-static19
-rw-r--r--package/network/config/netifd/files/etc/init.d/.svn/entries62
-rw-r--r--package/network/config/netifd/files/etc/init.d/.svn/prop-base/network.svn-base5
-rw-r--r--package/network/config/netifd/files/etc/init.d/.svn/text-base/network.svn-base47
-rwxr-xr-xpackage/network/config/netifd/files/etc/init.d/network47
-rw-r--r--package/network/config/netifd/files/lib/.svn/entries34
-rw-r--r--package/network/config/netifd/files/lib/netifd/.svn/entries65
-rw-r--r--package/network/config/netifd/files/lib/netifd/.svn/prop-base/dhcp.script.svn-base5
-rw-r--r--package/network/config/netifd/files/lib/netifd/.svn/text-base/dhcp.script.svn-base62
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/dhcp.script62
-rw-r--r--package/network/config/netifd/files/lib/netifd/proto/.svn/entries62
-rw-r--r--package/network/config/netifd/files/lib/netifd/proto/.svn/prop-base/dhcp.sh.svn-base5
-rw-r--r--package/network/config/netifd/files/lib/netifd/proto/.svn/text-base/dhcp.sh.svn-base49
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/proto/dhcp.sh49
-rw-r--r--package/network/config/netifd/files/lib/network/.svn/entries62
-rw-r--r--package/network/config/netifd/files/lib/network/.svn/prop-base/config.sh.svn-base5
-rw-r--r--package/network/config/netifd/files/lib/network/.svn/text-base/config.sh.svn-base79
-rwxr-xr-xpackage/network/config/netifd/files/lib/network/config.sh79
-rw-r--r--package/network/config/netifd/files/sbin/.svn/entries164
-rw-r--r--package/network/config/netifd/files/sbin/.svn/prop-base/devstatus.svn-base5
-rw-r--r--package/network/config/netifd/files/sbin/.svn/prop-base/ifdown.svn-base5
-rw-r--r--package/network/config/netifd/files/sbin/.svn/prop-base/ifstatus.svn-base5
-rw-r--r--package/network/config/netifd/files/sbin/.svn/prop-base/ifup.svn-base5
-rw-r--r--package/network/config/netifd/files/sbin/.svn/text-base/devstatus.svn-base12
-rw-r--r--package/network/config/netifd/files/sbin/.svn/text-base/ifdown.svn-base1
-rw-r--r--package/network/config/netifd/files/sbin/.svn/text-base/ifstatus.svn-base13
-rw-r--r--package/network/config/netifd/files/sbin/.svn/text-base/ifup.svn-base79
-rwxr-xr-xpackage/network/config/netifd/files/sbin/devstatus12
l---------package/network/config/netifd/files/sbin/ifdown1
-rwxr-xr-xpackage/network/config/netifd/files/sbin/ifstatus13
-rwxr-xr-xpackage/network/config/netifd/files/sbin/ifup79
-rw-r--r--package/network/config/netifd/files/usr/.svn/entries31
-rw-r--r--package/network/config/netifd/files/usr/share/.svn/entries31
-rw-r--r--package/network/config/netifd/files/usr/share/udhcpc/.svn/entries62
-rw-r--r--package/network/config/netifd/files/usr/share/udhcpc/.svn/prop-base/default.script.svn-base5
-rw-r--r--package/network/config/netifd/files/usr/share/udhcpc/.svn/text-base/default.script.svn-base57
-rwxr-xr-xpackage/network/config/netifd/files/usr/share/udhcpc/default.script57
-rw-r--r--package/network/config/netifd/patches/.svn/entries62
-rw-r--r--package/network/config/netifd/patches/.svn/text-base/001-musl_af_inet_include.patch.svn-base11
-rw-r--r--package/network/config/netifd/patches/001-musl_af_inet_include.patch11
50 files changed, 1915 insertions, 0 deletions
diff --git a/package/network/config/netifd/.svn/entries b/package/network/config/netifd/.svn/entries
new file mode 100644
index 0000000..4ebc152
--- /dev/null
+++ b/package/network/config/netifd/.svn/entries
@@ -0,0 +1,68 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-02-22T08:56:29.298787Z
+35743
+cyrus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+files
+dir
+
+patches
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+e416eb8345976b288affaabbe8ad909e
+2013-02-22T08:56:29.298787Z
+35743
+cyrus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1139
+
diff --git a/package/network/config/netifd/.svn/text-base/Makefile.svn-base b/package/network/config/netifd/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..ad27e2c
--- /dev/null
+++ b/package/network/config/netifd/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,46 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=netifd
+PKG_VERSION:=2013-02-19
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://nbd.name/luci2/netifd.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=486aa750a164d41905beb61afec89268e3eb7f48
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
+# PKG_MIRROR_MD5SUM:=
+# CMAKE_INSTALL:=1
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=
+
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/netifd
+ SECTION:=base
+ CATEGORY:=Base system
+ DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn
+ TITLE:=OpenWrt Network Interface Configuration Daemon
+endef
+
+TARGET_CFLAGS += \
+ -I$(STAGING_DIR)/usr/include/libnl-tiny \
+ -I$(STAGING_DIR)/usr/include
+
+CMAKE_OPTIONS += \
+ -DLIBNL_LIBS=-lnl-tiny \
+ -DDEBUG=1
+
+define Package/netifd/install
+ $(INSTALL_DIR) $(1)/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/netifd $(1)/sbin/
+ $(CP) ./files/* $(1)/
+ $(CP) $(PKG_BUILD_DIR)/dummy/netifd-proto.sh $(1)/lib/netifd/
+endef
+
+$(eval $(call BuildPackage,netifd))
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
new file mode 100644
index 0000000..ad27e2c
--- /dev/null
+++ b/package/network/config/netifd/Makefile
@@ -0,0 +1,46 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=netifd
+PKG_VERSION:=2013-02-19
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://nbd.name/luci2/netifd.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=486aa750a164d41905beb61afec89268e3eb7f48
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
+# PKG_MIRROR_MD5SUM:=
+# CMAKE_INSTALL:=1
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=
+
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/netifd
+ SECTION:=base
+ CATEGORY:=Base system
+ DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn
+ TITLE:=OpenWrt Network Interface Configuration Daemon
+endef
+
+TARGET_CFLAGS += \
+ -I$(STAGING_DIR)/usr/include/libnl-tiny \
+ -I$(STAGING_DIR)/usr/include
+
+CMAKE_OPTIONS += \
+ -DLIBNL_LIBS=-lnl-tiny \
+ -DDEBUG=1
+
+define Package/netifd/install
+ $(INSTALL_DIR) $(1)/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/netifd $(1)/sbin/
+ $(CP) ./files/* $(1)/
+ $(CP) $(PKG_BUILD_DIR)/dummy/netifd-proto.sh $(1)/lib/netifd/
+endef
+
+$(eval $(call BuildPackage,netifd))
diff --git a/package/network/config/netifd/files/.svn/entries b/package/network/config/netifd/files/.svn/entries
new file mode 100644
index 0000000..1e86684
--- /dev/null
+++ b/package/network/config/netifd/files/.svn/entries
@@ -0,0 +1,40 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-01-29T14:40:04.101944Z
+35383
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+lib
+dir
+
+usr
+dir
+
+etc
+dir
+
+sbin
+dir
+
diff --git a/package/network/config/netifd/files/etc/.svn/entries b/package/network/config/netifd/files/etc/.svn/entries
new file mode 100644
index 0000000..8be2c35
--- /dev/null
+++ b/package/network/config/netifd/files/etc/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/etc
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-01-29T10:13:39.572932Z
+35369
+cyrus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+hotplug.d
+dir
+
+init.d
+dir
+
diff --git a/package/network/config/netifd/files/etc/hotplug.d/.svn/entries b/package/network/config/netifd/files/etc/hotplug.d/.svn/entries
new file mode 100644
index 0000000..22338da
--- /dev/null
+++ b/package/network/config/netifd/files/etc/hotplug.d/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/etc/hotplug.d
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-01-29T10:13:39.572932Z
+35369
+cyrus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+iface
+dir
+
diff --git a/package/network/config/netifd/files/etc/hotplug.d/iface/.svn/entries b/package/network/config/netifd/files/etc/hotplug.d/iface/.svn/entries
new file mode 100644
index 0000000..5810f6a
--- /dev/null
+++ b/package/network/config/netifd/files/etc/hotplug.d/iface/.svn/entries
@@ -0,0 +1,96 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/etc/hotplug.d/iface
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-01-29T10:13:39.572932Z
+35369
+cyrus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+00-netstate
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+07e4cbee0469ae27ace1efa977b04eae
+2012-02-03T10:17:30.884717Z
+30008
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+337
+
+10-ipv6-static
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+97591c010e5989d4f29cb5bc616f9e73
+2013-01-29T10:13:39.572932Z
+35369
+cyrus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+487
+
diff --git a/package/network/config/netifd/files/etc/hotplug.d/iface/.svn/text-base/00-netstate.svn-base b/package/network/config/netifd/files/etc/hotplug.d/iface/.svn/text-base/00-netstate.svn-base
new file mode 100644
index 0000000..c50cda6
--- /dev/null
+++ b/package/network/config/netifd/files/etc/hotplug.d/iface/.svn/text-base/00-netstate.svn-base
@@ -0,0 +1,8 @@
+[ ifup = "$ACTION" ] && {
+ uci_toggle_state network "$INTERFACE" up 1
+ uci_toggle_state network "$INTERFACE" connect_time $(sed -ne 's![^0-9].*$!!p' /proc/uptime)
+ [ -n "$DEVICE" ] && {
+ uci_toggle_state network "$INTERFACE" device "$(uci -q get network.$INTERFACE.ifname)"
+ uci_toggle_state network "$INTERFACE" ifname "$DEVICE"
+ }
+}
diff --git a/package/network/config/netifd/files/etc/hotplug.d/iface/.svn/text-base/10-ipv6-static.svn-base b/package/network/config/netifd/files/etc/hotplug.d/iface/.svn/text-base/10-ipv6-static.svn-base
new file mode 100644
index 0000000..d724894
--- /dev/null
+++ b/package/network/config/netifd/files/etc/hotplug.d/iface/.svn/text-base/10-ipv6-static.svn-base
@@ -0,0 +1,19 @@
+case "$ACTION" in
+ ifup)
+ . /lib/functions.sh
+
+ local proto ip6slaac
+ config_load network
+ config_get proto "$INTERFACE" proto
+ config_get_bool ip6slaac "$INTERFACE" ip6slaac
+
+ if [ "$proto" = "static" -a "$ip6slaac" = "1" ]; then
+ echo 2 > "/proc/sys/net/ipv6/conf/$DEVICE/accept_ra"
+
+ # Though this should be save here, it is not recommended
+ echo 1 > "/proc/sys/net/ipv6/conf/$DEVICE/disable_ipv6"
+ echo 0 > "/proc/sys/net/ipv6/conf/$DEVICE/disable_ipv6"
+ fi
+ ;;
+esac
+
diff --git a/package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate b/package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate
new file mode 100644
index 0000000..c50cda6
--- /dev/null
+++ b/package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate
@@ -0,0 +1,8 @@
+[ ifup = "$ACTION" ] && {
+ uci_toggle_state network "$INTERFACE" up 1
+ uci_toggle_state network "$INTERFACE" connect_time $(sed -ne 's![^0-9].*$!!p' /proc/uptime)
+ [ -n "$DEVICE" ] && {
+ uci_toggle_state network "$INTERFACE" device "$(uci -q get network.$INTERFACE.ifname)"
+ uci_toggle_state network "$INTERFACE" ifname "$DEVICE"
+ }
+}
diff --git a/package/network/config/netifd/files/etc/hotplug.d/iface/10-ipv6-static b/package/network/config/netifd/files/etc/hotplug.d/iface/10-ipv6-static
new file mode 100644
index 0000000..d724894
--- /dev/null
+++ b/package/network/config/netifd/files/etc/hotplug.d/iface/10-ipv6-static
@@ -0,0 +1,19 @@
+case "$ACTION" in
+ ifup)
+ . /lib/functions.sh
+
+ local proto ip6slaac
+ config_load network
+ config_get proto "$INTERFACE" proto
+ config_get_bool ip6slaac "$INTERFACE" ip6slaac
+
+ if [ "$proto" = "static" -a "$ip6slaac" = "1" ]; then
+ echo 2 > "/proc/sys/net/ipv6/conf/$DEVICE/accept_ra"
+
+ # Though this should be save here, it is not recommended
+ echo 1 > "/proc/sys/net/ipv6/conf/$DEVICE/disable_ipv6"
+ echo 0 > "/proc/sys/net/ipv6/conf/$DEVICE/disable_ipv6"
+ fi
+ ;;
+esac
+
diff --git a/package/network/config/netifd/files/etc/init.d/.svn/entries b/package/network/config/netifd/files/etc/init.d/.svn/entries
new file mode 100644
index 0000000..2520cee
--- /dev/null
+++ b/package/network/config/netifd/files/etc/init.d/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/etc/init.d
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-01-19T10:13:14.536731Z
+35240
+jow
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+network
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+f013880fead70c81159a0bc5c2096c31
+2013-01-19T10:13:14.536731Z
+35240
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+559
+
diff --git a/package/network/config/netifd/files/etc/init.d/.svn/prop-base/network.svn-base b/package/network/config/netifd/files/etc/init.d/.svn/prop-base/network.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/network/config/netifd/files/etc/init.d/.svn/prop-base/network.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/network/config/netifd/files/etc/init.d/.svn/text-base/network.svn-base b/package/network/config/netifd/files/etc/init.d/.svn/text-base/network.svn-base
new file mode 100644
index 0000000..429f33d
--- /dev/null
+++ b/package/network/config/netifd/files/etc/init.d/.svn/text-base/network.svn-base
@@ -0,0 +1,47 @@
+#!/bin/sh /etc/rc.common
+
+START=20
+STOP=90
+
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
+
+start() {
+ stop
+ [ -e /proc/sys/kernel/core_pattern ] && {
+ ulimit -c unlimited
+ echo '/tmp/%e.%p.%s.%t.core' > /proc/sys/kernel/core_pattern
+ }
+ service_start /sbin/netifd
+
+ setup_switch() { return 0; }
+
+ include /lib/network
+ setup_switch
+
+ sleep 5
+
+ /sbin/wifi down
+ /sbin/wifi up
+}
+
+restart() {
+ ifdown -a
+ sleep 1
+ start
+}
+
+shutdown() {
+ ifdown -a
+ stop
+}
+
+stop() {
+ service_stop /sbin/netifd
+}
+
+reload() {
+ ubus call network reload
+ /sbin/wifi down
+ /sbin/wifi up
+}
diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network
new file mode 100755
index 0000000..429f33d
--- /dev/null
+++ b/package/network/config/netifd/files/etc/init.d/network
@@ -0,0 +1,47 @@
+#!/bin/sh /etc/rc.common
+
+START=20
+STOP=90
+
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
+
+start() {
+ stop
+ [ -e /proc/sys/kernel/core_pattern ] && {
+ ulimit -c unlimited
+ echo '/tmp/%e.%p.%s.%t.core' > /proc/sys/kernel/core_pattern
+ }
+ service_start /sbin/netifd
+
+ setup_switch() { return 0; }
+
+ include /lib/network
+ setup_switch
+
+ sleep 5
+
+ /sbin/wifi down
+ /sbin/wifi up
+}
+
+restart() {
+ ifdown -a
+ sleep 1
+ start
+}
+
+shutdown() {
+ ifdown -a
+ stop
+}
+
+stop() {
+ service_stop /sbin/netifd
+}
+
+reload() {
+ ubus call network reload
+ /sbin/wifi down
+ /sbin/wifi up
+}
diff --git a/package/network/config/netifd/files/lib/.svn/entries b/package/network/config/netifd/files/lib/.svn/entries
new file mode 100644
index 0000000..72f9274
--- /dev/null
+++ b/package/network/config/netifd/files/lib/.svn/entries
@@ -0,0 +1,34 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/lib
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-12-15T17:19:24.809183Z
+34704
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+netifd
+dir
+
+network
+dir
+
diff --git a/package/network/config/netifd/files/lib/netifd/.svn/entries b/package/network/config/netifd/files/lib/netifd/.svn/entries
new file mode 100644
index 0000000..96910c4
--- /dev/null
+++ b/package/network/config/netifd/files/lib/netifd/.svn/entries
@@ -0,0 +1,65 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/lib/netifd
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-12-15T17:19:24.809183Z
+34704
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+dhcp.script
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+1693935249ca21d6ee4b449e363eab81
+2012-12-15T17:19:24.809183Z
+34704
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1392
+
+proto
+dir
+
diff --git a/package/network/config/netifd/files/lib/netifd/.svn/prop-base/dhcp.script.svn-base b/package/network/config/netifd/files/lib/netifd/.svn/prop-base/dhcp.script.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/network/config/netifd/files/lib/netifd/.svn/prop-base/dhcp.script.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/network/config/netifd/files/lib/netifd/.svn/text-base/dhcp.script.svn-base b/package/network/config/netifd/files/lib/netifd/.svn/text-base/dhcp.script.svn-base
new file mode 100644
index 0000000..d26db0f
--- /dev/null
+++ b/package/network/config/netifd/files/lib/netifd/.svn/text-base/dhcp.script.svn-base
@@ -0,0 +1,62 @@
+#!/bin/sh
+[ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
+
+. /lib/functions.sh
+. /lib/netifd/netifd-proto.sh
+
+set_classless_routes() {
+ local max=128
+ local type
+ while [ -n "$1" -a -n "$2" -a $max -gt 0 ]; do
+ proto_add_ipv4_route "${1%%/*}" "${1##*/}" "$2"
+ max=$(($max-1))
+ shift 2
+ done
+}
+
+setup_interface () {
+ proto_init_update "*" 1
+ proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}"
+ # TODO: apply $broadcast
+
+ for i in $router; do
+ proto_add_ipv4_route 0.0.0.0 0 "$i"
+ done
+
+ # CIDR STATIC ROUTES (rfc3442)
+ [ -n "$staticroutes" ] && set_classless_routes $staticroutes
+ [ -n "$msstaticroutes" ] && set_classless_routes $msstaticroutes
+
+ for dns in $dns; do
+ proto_add_dns_server "$dns"
+ done
+ for domain in $domain; do
+ proto_add_dns_search "$domain"
+ done
+ proto_send_update "$INTERFACE"
+
+ # TODO
+ # [ -n "$ntpsrv" ] && change_state network "$ifc" lease_ntpsrv "$ntpsrv"
+ # [ -n "$timesvr" ] && change_state network "$ifc" lease_timesrv "$timesvr"
+ # [ -n "$hostname" ] && change_state network "$ifc" lease_hostname "$hostname"
+ # [ -n "$timezone" ] && change_state network "$ifc" lease_timezone "$timezone"
+}
+
+deconfig_interface() {
+ proto_init_update "*" 0
+ proto_send_update "$INTERFACE"
+}
+
+case "$1" in
+ deconfig)
+ deconfig_interface
+ ;;
+ renew|bound)
+ setup_interface
+ ;;
+esac
+
+# user rules
+[ -f /etc/udhcpc.user ] && . /etc/udhcpc.user
+
+exit 0
diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script
new file mode 100755
index 0000000..d26db0f
--- /dev/null
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -0,0 +1,62 @@
+#!/bin/sh
+[ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
+
+. /lib/functions.sh
+. /lib/netifd/netifd-proto.sh
+
+set_classless_routes() {
+ local max=128
+ local type
+ while [ -n "$1" -a -n "$2" -a $max -gt 0 ]; do
+ proto_add_ipv4_route "${1%%/*}" "${1##*/}" "$2"
+ max=$(($max-1))
+ shift 2
+ done
+}
+
+setup_interface () {
+ proto_init_update "*" 1
+ proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}"
+ # TODO: apply $broadcast
+
+ for i in $router; do
+ proto_add_ipv4_route 0.0.0.0 0 "$i"
+ done
+
+ # CIDR STATIC ROUTES (rfc3442)
+ [ -n "$staticroutes" ] && set_classless_routes $staticroutes
+ [ -n "$msstaticroutes" ] && set_classless_routes $msstaticroutes
+
+ for dns in $dns; do
+ proto_add_dns_server "$dns"
+ done
+ for domain in $domain; do
+ proto_add_dns_search "$domain"
+ done
+ proto_send_update "$INTERFACE"
+
+ # TODO
+ # [ -n "$ntpsrv" ] && change_state network "$ifc" lease_ntpsrv "$ntpsrv"
+ # [ -n "$timesvr" ] && change_state network "$ifc" lease_timesrv "$timesvr"
+ # [ -n "$hostname" ] && change_state network "$ifc" lease_hostname "$hostname"
+ # [ -n "$timezone" ] && change_state network "$ifc" lease_timezone "$timezone"
+}
+
+deconfig_interface() {
+ proto_init_update "*" 0
+ proto_send_update "$INTERFACE"
+}
+
+case "$1" in
+ deconfig)
+ deconfig_interface
+ ;;
+ renew|bound)
+ setup_interface
+ ;;
+esac
+
+# user rules
+[ -f /etc/udhcpc.user ] && . /etc/udhcpc.user
+
+exit 0
diff --git a/package/network/config/netifd/files/lib/netifd/proto/.svn/entries b/package/network/config/netifd/files/lib/netifd/proto/.svn/entries
new file mode 100644
index 0000000..627c4de
--- /dev/null
+++ b/package/network/config/netifd/files/lib/netifd/proto/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/lib/netifd/proto
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-11-05T19:28:24.248597Z
+34089
+jow
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+dhcp.sh
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+53542ed23c9805277cc02e3d7dc0a307
+2012-11-05T19:28:24.248597Z
+34089
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1129
+
diff --git a/package/network/config/netifd/files/lib/netifd/proto/.svn/prop-base/dhcp.sh.svn-base b/package/network/config/netifd/files/lib/netifd/proto/.svn/prop-base/dhcp.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/network/config/netifd/files/lib/netifd/proto/.svn/prop-base/dhcp.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/network/config/netifd/files/lib/netifd/proto/.svn/text-base/dhcp.sh.svn-base b/package/network/config/netifd/files/lib/netifd/proto/.svn/text-base/dhcp.sh.svn-base
new file mode 100644
index 0000000..3830878
--- /dev/null
+++ b/package/network/config/netifd/files/lib/netifd/proto/.svn/text-base/dhcp.sh.svn-base
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. ../netifd-proto.sh
+init_proto "$@"
+
+proto_dhcp_init_config() {
+ proto_config_add_string "ipaddr"
+ proto_config_add_string "netmask"
+ proto_config_add_string "hostname"
+ proto_config_add_string "clientid"
+ proto_config_add_string "vendorid"
+ proto_config_add_boolean "broadcast"
+ proto_config_add_string "reqopts"
+}
+
+proto_dhcp_setup() {
+ local config="$1"
+ local iface="$2"
+
+ local ipaddr hostname clientid vendorid broadcast reqopts
+ json_get_vars ipaddr hostname clientid vendorid broadcast reqopts
+
+ local opt dhcpopts
+ for opt in $reqopts; do
+ append dhcpopts "-O $opt"
+ done
+
+ [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
+ [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
+
+ proto_export "INTERFACE=$config"
+ proto_run_command "$config" udhcpc \
+ -p /var/run/udhcpc-$iface.pid \
+ -s /lib/netifd/dhcp.script \
+ -f -t 0 -i "$iface" \
+ ${ipaddr:+-r $ipaddr} \
+ ${hostname:+-H $hostname} \
+ ${vendorid:+-V $vendorid} \
+ $clientid $broadcast $dhcpopts
+}
+
+proto_dhcp_teardown() {
+ local interface="$1"
+ proto_kill_command "$interface"
+}
+
+add_protocol dhcp
+
diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
new file mode 100755
index 0000000..3830878
--- /dev/null
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. ../netifd-proto.sh
+init_proto "$@"
+
+proto_dhcp_init_config() {
+ proto_config_add_string "ipaddr"
+ proto_config_add_string "netmask"
+ proto_config_add_string "hostname"
+ proto_config_add_string "clientid"
+ proto_config_add_string "vendorid"
+ proto_config_add_boolean "broadcast"
+ proto_config_add_string "reqopts"
+}
+
+proto_dhcp_setup() {
+ local config="$1"
+ local iface="$2"
+
+ local ipaddr hostname clientid vendorid broadcast reqopts
+ json_get_vars ipaddr hostname clientid vendorid broadcast reqopts
+
+ local opt dhcpopts
+ for opt in $reqopts; do
+ append dhcpopts "-O $opt"
+ done
+
+ [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
+ [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
+
+ proto_export "INTERFACE=$config"
+ proto_run_command "$config" udhcpc \
+ -p /var/run/udhcpc-$iface.pid \
+ -s /lib/netifd/dhcp.script \
+ -f -t 0 -i "$iface" \
+ ${ipaddr:+-r $ipaddr} \
+ ${hostname:+-H $hostname} \
+ ${vendorid:+-V $vendorid} \
+ $clientid $broadcast $dhcpopts
+}
+
+proto_dhcp_teardown() {
+ local interface="$1"
+ proto_kill_command "$interface"
+}
+
+add_protocol dhcp
+
diff --git a/package/network/config/netifd/files/lib/network/.svn/entries b/package/network/config/netifd/files/lib/network/.svn/entries
new file mode 100644
index 0000000..249cb3c
--- /dev/null
+++ b/package/network/config/netifd/files/lib/network/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/lib/network
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-06-11T13:25:58.910765Z
+32192
+jow
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+config.sh
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+12ee7e8a4599ad1948c9bf50e5bb0532
+2012-06-11T13:25:58.910765Z
+32192
+jow
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1607
+
diff --git a/package/network/config/netifd/files/lib/network/.svn/prop-base/config.sh.svn-base b/package/network/config/netifd/files/lib/network/.svn/prop-base/config.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/network/config/netifd/files/lib/network/.svn/prop-base/config.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/network/config/netifd/files/lib/network/.svn/text-base/config.sh.svn-base b/package/network/config/netifd/files/lib/network/.svn/text-base/config.sh.svn-base
new file mode 100644
index 0000000..9128971
--- /dev/null
+++ b/package/network/config/netifd/files/lib/network/.svn/text-base/config.sh.svn-base
@@ -0,0 +1,79 @@
+#!/bin/sh
+# Copyright (C) 2011 OpenWrt.org
+
+. /usr/share/libubox/jshn.sh
+
+find_config() {
+ local device="$1"
+ local ifdev ifl3dev ifobj
+ for ifobj in `ubus list network.interface.\*`; do
+ interface="${ifobj##network.interface.}"
+ (
+ json_load "$(ifstatus $interface)"
+ json_get_var ifdev device
+ json_get_var ifl3dev l3_device
+ if [[ "$device" = "$ifdev" ]] || [[ "$device" = "$ifl3dev" ]]; then
+ echo "$interface"
+ exit 0
+ else
+ exit 1
+ fi
+ ) && return
+ done
+}
+
+unbridge() {
+ return
+}
+
+ubus_call() {
+ json_init
+ local _data="$(ubus -S call "$1" "$2")"
+ [ -z "$_data" ] && return 1
+ json_load "$_data"
+ return 0
+}
+
+
+fixup_interface() {
+ local config="$1"
+ local ifname type device l3dev
+
+ config_get type "$config" type
+ config_get ifname "$config" ifname
+ config_get device "$config" device "$ifname"
+ [ "bridge" = "$type" ] && ifname="br-$config"
+ config_set "$config" device "$ifname"
+ ubus_call "network.interface.$config" status || return 0
+ json_get_var l3dev l3_device
+ [ -n "$l3dev" ] && ifname="$l3dev"
+ json_init
+ config_set "$config" ifname "$ifname"
+ config_set "$config" device "$device"
+}
+
+scan_interfaces() {
+ config_load network
+ config_foreach fixup_interface interface
+}
+
+prepare_interface_bridge() {
+ local config="$1"
+
+ [ -n "$config" ] || return 0
+ ubus call network.interface."$config" prepare
+}
+
+setup_interface() {
+ local iface="$1"
+ local config="$2"
+
+ [ -n "$config" ] || return 0
+ ubus call network.interface."$config" add_device "{ \"name\": \"$iface\" }"
+}
+
+do_sysctl() {
+ [ -n "$2" ] && \
+ sysctl -n -e -w "$1=$2" >/dev/null || \
+ sysctl -n -e "$1"
+}
diff --git a/package/network/config/netifd/files/lib/network/config.sh b/package/network/config/netifd/files/lib/network/config.sh
new file mode 100755
index 0000000..9128971
--- /dev/null
+++ b/package/network/config/netifd/files/lib/network/config.sh
@@ -0,0 +1,79 @@
+#!/bin/sh
+# Copyright (C) 2011 OpenWrt.org
+
+. /usr/share/libubox/jshn.sh
+
+find_config() {
+ local device="$1"
+ local ifdev ifl3dev ifobj
+ for ifobj in `ubus list network.interface.\*`; do
+ interface="${ifobj##network.interface.}"
+ (
+ json_load "$(ifstatus $interface)"
+ json_get_var ifdev device
+ json_get_var ifl3dev l3_device
+ if [[ "$device" = "$ifdev" ]] || [[ "$device" = "$ifl3dev" ]]; then
+ echo "$interface"
+ exit 0
+ else
+ exit 1
+ fi
+ ) && return
+ done
+}
+
+unbridge() {
+ return
+}
+
+ubus_call() {
+ json_init
+ local _data="$(ubus -S call "$1" "$2")"
+ [ -z "$_data" ] && return 1
+ json_load "$_data"
+ return 0
+}
+
+
+fixup_interface() {
+ local config="$1"
+ local ifname type device l3dev
+
+ config_get type "$config" type
+ config_get ifname "$config" ifname
+ config_get device "$config" device "$ifname"
+ [ "bridge" = "$type" ] && ifname="br-$config"
+ config_set "$config" device "$ifname"
+ ubus_call "network.interface.$config" status || return 0
+ json_get_var l3dev l3_device
+ [ -n "$l3dev" ] && ifname="$l3dev"
+ json_init
+ config_set "$config" ifname "$ifname"
+ config_set "$config" device "$device"
+}
+
+scan_interfaces() {
+ config_load network
+ config_foreach fixup_interface interface
+}
+
+prepare_interface_bridge() {
+ local config="$1"
+
+ [ -n "$config" ] || return 0
+ ubus call network.interface."$config" prepare
+}
+
+setup_interface() {
+ local iface="$1"
+ local config="$2"
+
+ [ -n "$config" ] || return 0
+ ubus call network.interface."$config" add_device "{ \"name\": \"$iface\" }"
+}
+
+do_sysctl() {
+ [ -n "$2" ] && \
+ sysctl -n -e -w "$1=$2" >/dev/null || \
+ sysctl -n -e "$1"
+}
diff --git a/package/network/config/netifd/files/sbin/.svn/entries b/package/network/config/netifd/files/sbin/.svn/entries
new file mode 100644
index 0000000..b8927cc
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/.svn/entries
@@ -0,0 +1,164 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/sbin
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-01-29T14:40:04.101944Z
+35383
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+devstatus
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+97e78aed908f5b22479f2482492aee86
+2011-10-23T17:22:14.121936Z
+28545
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+200
+
+ifstatus
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+31a12bb1ab197fdc24f7d4a0288ab681
+2013-01-29T14:40:04.101944Z
+35383
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+273
+
+ifup
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+1d80dbe8b2dd7b5fb6b8de73a2881e85
+2013-01-29T14:40:04.101944Z
+35383
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1320
+
+ifdown
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+7da3b21f78698f9c8d1fd0ed92022a46
+2011-10-21T01:47:49.907205Z
+28499
+nbd
+has-props
+
+
+svn:special
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4
+
diff --git a/package/network/config/netifd/files/sbin/.svn/prop-base/devstatus.svn-base b/package/network/config/netifd/files/sbin/.svn/prop-base/devstatus.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/.svn/prop-base/devstatus.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/network/config/netifd/files/sbin/.svn/prop-base/ifdown.svn-base b/package/network/config/netifd/files/sbin/.svn/prop-base/ifdown.svn-base
new file mode 100644
index 0000000..d222469
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/.svn/prop-base/ifdown.svn-base
@@ -0,0 +1,5 @@
+K 11
+svn:special
+V 1
+*
+END
diff --git a/package/network/config/netifd/files/sbin/.svn/prop-base/ifstatus.svn-base b/package/network/config/netifd/files/sbin/.svn/prop-base/ifstatus.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/.svn/prop-base/ifstatus.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/network/config/netifd/files/sbin/.svn/prop-base/ifup.svn-base b/package/network/config/netifd/files/sbin/.svn/prop-base/ifup.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/.svn/prop-base/ifup.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/network/config/netifd/files/sbin/.svn/text-base/devstatus.svn-base b/package/network/config/netifd/files/sbin/.svn/text-base/devstatus.svn-base
new file mode 100644
index 0000000..3c35b26
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/.svn/text-base/devstatus.svn-base
@@ -0,0 +1,12 @@
+#!/bin/sh
+. /usr/share/libubox/jshn.sh
+DEVICE="$1"
+
+[ -n "$DEVICE" ] || {
+ echo "Usage: $0 <device>"
+ exit 1
+}
+
+json_init
+json_add_string name "$DEVICE"
+ubus call network.device status "$(json_dump)"
diff --git a/package/network/config/netifd/files/sbin/.svn/text-base/ifdown.svn-base b/package/network/config/netifd/files/sbin/.svn/text-base/ifdown.svn-base
new file mode 100644
index 0000000..a687b74
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/.svn/text-base/ifdown.svn-base
@@ -0,0 +1 @@
+link ifup \ No newline at end of file
diff --git a/package/network/config/netifd/files/sbin/.svn/text-base/ifstatus.svn-base b/package/network/config/netifd/files/sbin/.svn/text-base/ifstatus.svn-base
new file mode 100644
index 0000000..8a951e6
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/.svn/text-base/ifstatus.svn-base
@@ -0,0 +1,13 @@
+#!/bin/sh
+INTERFACE="$1"
+
+[ -n "$INTERFACE" ] || {
+ echo "Usage: $0 <interface>"
+ exit 1
+}
+
+ubus -S list "network.interface.$INTERFACE" >/dev/null || {
+ echo "Interface $INTERFACE not found"
+ exit 1
+}
+ubus call network.interface status "{ \"interface\" : \"$INTERFACE\" }"
diff --git a/package/network/config/netifd/files/sbin/.svn/text-base/ifup.svn-base b/package/network/config/netifd/files/sbin/.svn/text-base/ifup.svn-base
new file mode 100644
index 0000000..af3aaa8
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/.svn/text-base/ifup.svn-base
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+ifup_all=
+setup_wifi=
+
+if_call() {
+ local interface="$1"
+ for mode in $modes; do
+ ubus call network.interface $mode "{ \"interface\" : \"$interface\" }"
+ done
+}
+
+case "$0" in
+ *ifdown) modes=down;;
+ *ifup)
+ modes="down up"
+ setup_wifi=1
+ ;;
+ *) echo "Invalid command: $0";;
+esac
+
+while :; do
+ case "$1" in
+ -a)
+ ifup_all=1
+ shift
+ ;;
+ -w)
+ setup_wifi=
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+[ "$modes" = "down up" ] && ubus call network reload
+if [ -n "$ifup_all" ]; then
+ for interface in `ubus -S list 'network.interface.*'`; do
+ if_call "${interface##network.interface.}"
+ done
+ [ -n "$setup_wifi" ] && /sbin/wifi up
+ exit
+else
+ ubus -S list "network.interface.$1" > /dev/null || {
+ echo "Interface $1 not found"
+ exit
+ }
+ if_call "$1"
+fi
+
+if [ -n "$setup_wifi" ] && grep -sq config /etc/config/wireless; then
+ . /lib/functions.sh
+
+ find_related_radios() {
+ local wdev wnet
+ config_get wdev "$1" device
+ config_get wnet "$1" network
+
+ if [ -n "$wdev" ]; then
+ for wnet in $wnet; do
+ if [ "$wnet" = "$network" ]; then
+ append radio_devs "$wdev" "$N"
+ fi
+ done
+ fi
+ }
+
+ local radio_devs
+ local network="$1"
+ config_load wireless
+ config_foreach find_related_radios wifi-iface
+
+ local dev
+ for dev in $(echo "$radio_devs" | sort -u); do
+ /sbin/wifi up "$dev"
+ done
+fi
diff --git a/package/network/config/netifd/files/sbin/devstatus b/package/network/config/netifd/files/sbin/devstatus
new file mode 100755
index 0000000..3c35b26
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/devstatus
@@ -0,0 +1,12 @@
+#!/bin/sh
+. /usr/share/libubox/jshn.sh
+DEVICE="$1"
+
+[ -n "$DEVICE" ] || {
+ echo "Usage: $0 <device>"
+ exit 1
+}
+
+json_init
+json_add_string name "$DEVICE"
+ubus call network.device status "$(json_dump)"
diff --git a/package/network/config/netifd/files/sbin/ifdown b/package/network/config/netifd/files/sbin/ifdown
new file mode 120000
index 0000000..a0e5c17
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/ifdown
@@ -0,0 +1 @@
+ifup \ No newline at end of file
diff --git a/package/network/config/netifd/files/sbin/ifstatus b/package/network/config/netifd/files/sbin/ifstatus
new file mode 100755
index 0000000..8a951e6
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/ifstatus
@@ -0,0 +1,13 @@
+#!/bin/sh
+INTERFACE="$1"
+
+[ -n "$INTERFACE" ] || {
+ echo "Usage: $0 <interface>"
+ exit 1
+}
+
+ubus -S list "network.interface.$INTERFACE" >/dev/null || {
+ echo "Interface $INTERFACE not found"
+ exit 1
+}
+ubus call network.interface status "{ \"interface\" : \"$INTERFACE\" }"
diff --git a/package/network/config/netifd/files/sbin/ifup b/package/network/config/netifd/files/sbin/ifup
new file mode 100755
index 0000000..af3aaa8
--- /dev/null
+++ b/package/network/config/netifd/files/sbin/ifup
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+ifup_all=
+setup_wifi=
+
+if_call() {
+ local interface="$1"
+ for mode in $modes; do
+ ubus call network.interface $mode "{ \"interface\" : \"$interface\" }"
+ done
+}
+
+case "$0" in
+ *ifdown) modes=down;;
+ *ifup)
+ modes="down up"
+ setup_wifi=1
+ ;;
+ *) echo "Invalid command: $0";;
+esac
+
+while :; do
+ case "$1" in
+ -a)
+ ifup_all=1
+ shift
+ ;;
+ -w)
+ setup_wifi=
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+[ "$modes" = "down up" ] && ubus call network reload
+if [ -n "$ifup_all" ]; then
+ for interface in `ubus -S list 'network.interface.*'`; do
+ if_call "${interface##network.interface.}"
+ done
+ [ -n "$setup_wifi" ] && /sbin/wifi up
+ exit
+else
+ ubus -S list "network.interface.$1" > /dev/null || {
+ echo "Interface $1 not found"
+ exit
+ }
+ if_call "$1"
+fi
+
+if [ -n "$setup_wifi" ] && grep -sq config /etc/config/wireless; then
+ . /lib/functions.sh
+
+ find_related_radios() {
+ local wdev wnet
+ config_get wdev "$1" device
+ config_get wnet "$1" network
+
+ if [ -n "$wdev" ]; then
+ for wnet in $wnet; do
+ if [ "$wnet" = "$network" ]; then
+ append radio_devs "$wdev" "$N"
+ fi
+ done
+ fi
+ }
+
+ local radio_devs
+ local network="$1"
+ config_load wireless
+ config_foreach find_related_radios wifi-iface
+
+ local dev
+ for dev in $(echo "$radio_devs" | sort -u); do
+ /sbin/wifi up "$dev"
+ done
+fi
diff --git a/package/network/config/netifd/files/usr/.svn/entries b/package/network/config/netifd/files/usr/.svn/entries
new file mode 100644
index 0000000..1f099cf
--- /dev/null
+++ b/package/network/config/netifd/files/usr/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/usr
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-02-27T16:23:39.874148Z
+30741
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+share
+dir
+
diff --git a/package/network/config/netifd/files/usr/share/.svn/entries b/package/network/config/netifd/files/usr/share/.svn/entries
new file mode 100644
index 0000000..b436dab
--- /dev/null
+++ b/package/network/config/netifd/files/usr/share/.svn/entries
@@ -0,0 +1,31 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/usr/share
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-02-27T16:23:39.874148Z
+30741
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+udhcpc
+dir
+
diff --git a/package/network/config/netifd/files/usr/share/udhcpc/.svn/entries b/package/network/config/netifd/files/usr/share/udhcpc/.svn/entries
new file mode 100644
index 0000000..602e48d
--- /dev/null
+++ b/package/network/config/netifd/files/usr/share/udhcpc/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/files/usr/share/udhcpc
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-02-27T16:23:39.874148Z
+30741
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+default.script
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+021bccd0bcd3a0f5f6166fccc54ef30d
+2012-02-27T16:23:39.874148Z
+30741
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1346
+
diff --git a/package/network/config/netifd/files/usr/share/udhcpc/.svn/prop-base/default.script.svn-base b/package/network/config/netifd/files/usr/share/udhcpc/.svn/prop-base/default.script.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/package/network/config/netifd/files/usr/share/udhcpc/.svn/prop-base/default.script.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/package/network/config/netifd/files/usr/share/udhcpc/.svn/text-base/default.script.svn-base b/package/network/config/netifd/files/usr/share/udhcpc/.svn/text-base/default.script.svn-base
new file mode 100644
index 0000000..ac765a6
--- /dev/null
+++ b/package/network/config/netifd/files/usr/share/udhcpc/.svn/text-base/default.script.svn-base
@@ -0,0 +1,57 @@
+#!/bin/sh
+[ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
+
+set_classless_routes() {
+ local max=128
+ local type
+ while [ -n "$1" -a -n "$2" -a $max -gt 0 ]; do
+ [ ${1##*/} -eq 32 ] && type=host || type=net
+ echo "udhcpc: adding route for $type $1 via $2"
+ route add -$type "$1" gw "$2" dev "$interface"
+ max=$(($max-1))
+ shift 2
+ done
+}
+
+setup_interface() {
+ echo "udhcpc: ifconfig $interface $ip netmask ${subnet:-255.255.255.0} broadcast ${broadcast:-+}"
+ ifconfig $interface $ip netmask ${subnet:-255.255.255.0} broadcast ${broadcast:-+}
+
+ [ -n "$router" ] && [ "$router" != "0.0.0.0" ] && [ "$router" != "255.255.255.255" ] && {
+ echo "udhcpc: setting default routers: $router"
+
+ local valid_gw=""
+ for i in $router ; do
+ route add default gw $i dev $interface
+ valid_gw="${valid_gw:+$valid_gw|}$i"
+ done
+
+ eval $(route -n | awk '
+ /^0.0.0.0\W{9}('$valid_gw')\W/ {next}
+ /^0.0.0.0/ {print "route del -net "$1" gw "$2";"}
+ ')
+ }
+
+ # CIDR STATIC ROUTES (rfc3442)
+ [ -n "$staticroutes" ] && set_classless_routes $staticroutes
+ [ -n "$msstaticroutes" ] && set_classless_routes $msstaticroutes
+}
+
+
+applied=
+case "$1" in
+ deconfig)
+ ifconfig "$interface" 0.0.0.0
+ ;;
+ renew)
+ setup_interface update
+ ;;
+ bound)
+ setup_interface ifup
+ ;;
+esac
+
+# user rules
+[ -f /etc/udhcpc.user ] && . /etc/udhcpc.user
+
+exit 0
diff --git a/package/network/config/netifd/files/usr/share/udhcpc/default.script b/package/network/config/netifd/files/usr/share/udhcpc/default.script
new file mode 100755
index 0000000..ac765a6
--- /dev/null
+++ b/package/network/config/netifd/files/usr/share/udhcpc/default.script
@@ -0,0 +1,57 @@
+#!/bin/sh
+[ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
+
+set_classless_routes() {
+ local max=128
+ local type
+ while [ -n "$1" -a -n "$2" -a $max -gt 0 ]; do
+ [ ${1##*/} -eq 32 ] && type=host || type=net
+ echo "udhcpc: adding route for $type $1 via $2"
+ route add -$type "$1" gw "$2" dev "$interface"
+ max=$(($max-1))
+ shift 2
+ done
+}
+
+setup_interface() {
+ echo "udhcpc: ifconfig $interface $ip netmask ${subnet:-255.255.255.0} broadcast ${broadcast:-+}"
+ ifconfig $interface $ip netmask ${subnet:-255.255.255.0} broadcast ${broadcast:-+}
+
+ [ -n "$router" ] && [ "$router" != "0.0.0.0" ] && [ "$router" != "255.255.255.255" ] && {
+ echo "udhcpc: setting default routers: $router"
+
+ local valid_gw=""
+ for i in $router ; do
+ route add default gw $i dev $interface
+ valid_gw="${valid_gw:+$valid_gw|}$i"
+ done
+
+ eval $(route -n | awk '
+ /^0.0.0.0\W{9}('$valid_gw')\W/ {next}
+ /^0.0.0.0/ {print "route del -net "$1" gw "$2";"}
+ ')
+ }
+
+ # CIDR STATIC ROUTES (rfc3442)
+ [ -n "$staticroutes" ] && set_classless_routes $staticroutes
+ [ -n "$msstaticroutes" ] && set_classless_routes $msstaticroutes
+}
+
+
+applied=
+case "$1" in
+ deconfig)
+ ifconfig "$interface" 0.0.0.0
+ ;;
+ renew)
+ setup_interface update
+ ;;
+ bound)
+ setup_interface ifup
+ ;;
+esac
+
+# user rules
+[ -f /etc/udhcpc.user ] && . /etc/udhcpc.user
+
+exit 0
diff --git a/package/network/config/netifd/patches/.svn/entries b/package/network/config/netifd/patches/.svn/entries
new file mode 100644
index 0000000..bddbcdf
--- /dev/null
+++ b/package/network/config/netifd/patches/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/config/netifd/patches
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-11-23T20:02:10.520862Z
+34310
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+001-musl_af_inet_include.patch
+file
+
+
+
+
+2013-03-17T12:13:19.000000Z
+ef2db5f9cbc33fb642df085540830c2b
+2012-11-23T20:02:10.520862Z
+34310
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+369
+
diff --git a/package/network/config/netifd/patches/.svn/text-base/001-musl_af_inet_include.patch.svn-base b/package/network/config/netifd/patches/.svn/text-base/001-musl_af_inet_include.patch.svn-base
new file mode 100644
index 0000000..510ee05
--- /dev/null
+++ b/package/network/config/netifd/patches/.svn/text-base/001-musl_af_inet_include.patch.svn-base
@@ -0,0 +1,11 @@
+diff -urN netifd-2012-10-29/utils.c netifd-2012-10-29.new/utils.c
+--- netifd-2012-10-29/utils.c 2012-11-23 17:15:39.000000000 +0100
++++ netifd-2012-10-29.new/utils.c 2012-11-23 17:16:53.409244361 +0100
+@@ -17,6 +17,7 @@
+
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
++#include <sys/socket.h>
+
+ void
+ __vlist_simple_init(struct vlist_simple_tree *tree, int offset)
diff --git a/package/network/config/netifd/patches/001-musl_af_inet_include.patch b/package/network/config/netifd/patches/001-musl_af_inet_include.patch
new file mode 100644
index 0000000..510ee05
--- /dev/null
+++ b/package/network/config/netifd/patches/001-musl_af_inet_include.patch
@@ -0,0 +1,11 @@
+diff -urN netifd-2012-10-29/utils.c netifd-2012-10-29.new/utils.c
+--- netifd-2012-10-29/utils.c 2012-11-23 17:15:39.000000000 +0100
++++ netifd-2012-10-29.new/utils.c 2012-11-23 17:16:53.409244361 +0100
+@@ -17,6 +17,7 @@
+
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
++#include <sys/socket.h>
+
+ void
+ __vlist_simple_init(struct vlist_simple_tree *tree, int offset)