From a1f9ab3d746aff3e0a6af3322e36b592b64bbc92 Mon Sep 17 00:00:00 2001
From: florian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Date: Fri, 18 Jul 2008 14:04:18 +0000
Subject: [PATCH] The 6tunnel and 6bridge helpers should be packaged separately
 from 6tunnel which is another application

git-svn-id: svn://svn.openwrt.org/openwrt/packages@11858 3c298f89-4303-0410-b956-a3cf2f4a3e73
---
 ipv6/6tunnel/Makefile           | 10 ------
 ipv6/6tunnel/files/6bridge.conf |  2 --
 ipv6/6tunnel/files/6bridge.init | 53 ---------------------------
 ipv6/6tunnel/files/6tunnel.conf |  6 ----
 ipv6/6tunnel/files/6tunnel.init | 64 ---------------------------------
 5 files changed, 135 deletions(-)
 delete mode 100644 ipv6/6tunnel/files/6bridge.conf
 delete mode 100644 ipv6/6tunnel/files/6bridge.init
 delete mode 100644 ipv6/6tunnel/files/6tunnel.conf
 delete mode 100644 ipv6/6tunnel/files/6tunnel.init

diff --git a/ipv6/6tunnel/Makefile b/ipv6/6tunnel/Makefile
index 64afbff24..189238d14 100644
--- a/ipv6/6tunnel/Makefile
+++ b/ipv6/6tunnel/Makefile
@@ -44,19 +44,9 @@ define Build/Compile
 		default
 endef
 
-define Package/6tunnel/conffiles
-/etc/config/6tunnel
-endef
-
 define Package/6tunnel/install
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/6tunnel $(1)/usr/sbin/
-	$(INSTALL_DIR) $(1)/etc/config
-	$(INSTALL_DATA) ./files/6tunnel.conf $(1)/etc/config/6tunnel
-	$(INSTALL_DATA) ./files/6bridge.conf $(1)/etc/config/6bridge
-	$(INSTALL_DIR) $(1)/etc/init.d
-	$(INSTALL_BIN) ./files/6tunnel.init $(1)/etc/init.d/6tunnel
-	$(INSTALL_BIN) ./files/6bridge.init $(1)/etc/init.d/6bridge
 endef
 
 $(eval $(call BuildPackage,6tunnel))
diff --git a/ipv6/6tunnel/files/6bridge.conf b/ipv6/6tunnel/files/6bridge.conf
deleted file mode 100644
index e2980ad65..000000000
--- a/ipv6/6tunnel/files/6bridge.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-config 6bridge
-	option bridge	'bripv6'	
diff --git a/ipv6/6tunnel/files/6bridge.init b/ipv6/6tunnel/files/6bridge.init
deleted file mode 100644
index ba98d66be..000000000
--- a/ipv6/6tunnel/files/6bridge.init
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh /etc/rc.common
-START=46
-STOP=46
-
-start_service() {
-	local section="$1"
-	
-	include /lib/network
-	scan_interfaces
-	config_load /var/state/network
-
-	config_get LAN lan ifname
-	config_get WAN wan ifname
-	config_get bridge "$section" bridge
-
-	brctl addbr $bridge
-	brctl addif $bridge $LAN
-	brctl addif $bridge $WAN
-	brctl setfd $bridge 0
-        ebtables -t broute -A BROUTING -i $WAN -p ! ipv6 -j DROP
-        ifconfig $bridge up
-}
-
-stop_service() {
-        local section="$1"
-
-        include /lib/network
-        scan_interfaces
-        config_load /var/state/network
-
-        config_get LAN lan ifname
-        config_get WAN wan ifname
-        config_get bridge "$section" bridge
-
-        ifconfig $bridge down
-        ebtables -t broute -F
-        brctl delif $bridge $WAN
-        brctl delif $bridge $LAN
-        brctl delbr $bridge
-}
-start() {
-        if ! [ -f /proc/net/if_inet6 ]; then
-                echo "IPv6 not enabled, install kmod-ipv6";
-                exit 1;
-        fi
-        config_load "6bridge"
-        config_foreach start_service 6bridge
-}
-
-stop () {
-        config_load "6bridge"
-        config_foreach stop_service 6bridge
-}
diff --git a/ipv6/6tunnel/files/6tunnel.conf b/ipv6/6tunnel/files/6tunnel.conf
deleted file mode 100644
index efd8f817c..000000000
--- a/ipv6/6tunnel/files/6tunnel.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-config 6tunnel
-        option tnlifname     'sixbone'
-        option remoteip4	''
-	option localip4		''
-	option localip6		''
-	option prefix		'/64'
diff --git a/ipv6/6tunnel/files/6tunnel.init b/ipv6/6tunnel/files/6tunnel.init
deleted file mode 100644
index cd4e1fc02..000000000
--- a/ipv6/6tunnel/files/6tunnel.init
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh /etc/rc.common
-START=46
-STOP=46
-
-start_service() {
-	local section="$1"
-	
-	include /lib/network
-	scan_interfaces
-	config_load /var/state/network
-
-	config_get LAN lan ifname
-        config_get tnlifname "$section" tnlifname
-	config_get remoteip4 "$section" remoteip4
-	config_get localip4 "$section" localip4
-	config_get localip6 "$section" localip6
-	config_get prefix "$section" prefix
-
-	ip tunnel add $tnlifname mode sit remote $remoteip4 local $localip4 ttl 255
-	ifconfig $tnlifname up
-	ip addr add $localip6 dev $tnlifname
-	ip route add ::/0 dev $tnlifname
-	ip route add 2000::/3 dev $tnlifname
-	ip -6 addr add $prefix dev $LAN
-}
-
-stop_service() {
-	local section="$1"
-	
-	include /lib/network
-	scan_interfaces
-	config_load /var/state/network
-
-	config_get LAN lan ifname
-        config_get tnlifname "$section" tnlifname
-	config_get remoteip4 "$section" remoteip4
-	config_get localip4 "$section" localip4
-	config_get localip6 "$section" localip6
-	config_get prefix "$section" prefix
-
-	ip -6 addr del $prefix dev $LAN
-	ip -6 ro del 2000::/3 dev $tnlifname
-	ip -6 ro del ::/0 dev $tnlifname
-	ip addr del $localip6 dev $tnlifname
-	ifconfig $tnlifname down
-	ip tunnel del $tnlifname
-}
-start() {
-	if ! [ -f /proc/net/if_inet6 ]; then
-		echo "IPv6 not enabled, install kmod-ipv6";
-		exit 1;
-	fi
-	if ! [ -x /sbin/ip ]; then
-		echo "ip is required to setup the tunnel";
-		exit 1;
-	fi
-	config_load "6tunnel"
-	config_foreach start_service 6tunnel
-}
-
-stop () {
-	config_load "6tunnel"
-	config_foreach stop_service 6tunnel
-}