/[baselayout]/branches/rc-scripts-1_6/net-scripts/net.modules.d/iptunnel
Gentoo

Contents of /branches/rc-scripts-1_6/net-scripts/net.modules.d/iptunnel

Parent Directory Parent Directory | Revision Log Revision Log


Revision 860 - (show annotations) (download)
Mon Jan 17 15:40:32 2005 UTC (9 years, 6 months ago) by uberlord
File size: 1811 byte(s)
all modules should now check interface existance correctly - fixes #76385

1 # IP Tunnel module for net-scripts
2 # Version 1.0.0
3 # Copyright (c) 2004 Gentoo Foundation
4 # Distributed under the terms of the GNU General Public License V2
5 # Contributed by Roy Marples (uberlord@gentoo.org)
6
7 # char* iptunnel_provides(void)
8 #
9 # Returns a string to change module definition for starting up
10 iptunnel_provides() {
11 echo "iptunnel"
12 }
13
14 # void iptunnel_depend(void)
15 #
16 # Sets up the dependancies for the module
17 iptunnel_depend() {
18 after wireless
19 before interface
20 }
21
22 # bool iptunnel_check_installed(void)
23 #
24 # Tunnelling is provided by the interface
25 iptunnel_check_installed() {
26 return 0
27 }
28
29 # bool iptunnel_check_depends(void)
30 #
31 # Checks to see if we have the needed functions
32 iptunnel_check_depends() {
33 local f
34
35 for f in interface_exists interface_variable interface_tunnel; do
36 [[ $( type -t ${f} ) == function ]] && continue
37 eerror "iptunnel: missing required function ${f}\n"
38 return 1
39 done
40
41 return 0
42 }
43
44 # char* iptunnel_get_vars(char *interface)
45 #
46 # Returns a string spaced with possible user set
47 # configuration variables
48 iptunnel_get_vars() {
49 echo "iptunnel_${1}"
50 }
51
52 # bool iptunnel_pre_start(char *iface)
53 #
54 # Create the device, give it the right perms
55 iptunnel_pre_start() {
56 local iface=${1} opts itype=$( interface_type ${1} )
57 local ifvar=$( interface_variable ${iface} )
58
59 # Get our options
60 eval opts=\"\$\{iptunnel_${ifvar}\}\"
61 [[ -z ${opts} ]] && return 0
62
63 ebegin "Creating tunnel ${iface}"
64 interface_tunnel add ${iface} ${opts} >${devnull}
65 eend $?
66 return $?
67
68 }
69
70 # bool iptunnel_stop(char *iface)
71 #
72 # Removes the device
73 iptunnel_stop() {
74 local iface=${1}
75
76 interface_exists ${iface} || return 0
77 [[ -z $( interface_tunnel show ${iface} 2>/dev/null ) ]] && return 0
78
79 ebegin "Destroying tunnel ${iface}"
80 interface_tunnel del ${iface} >${devnull}
81 eend $?
82 return $?
83 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20