diff options
| author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-06-23 11:35:38 +0000 |
|---|---|---|
| committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-06-23 11:35:38 +0000 |
| commit | 7c52c3f35cdbdff58443b994f2f33d13b4d81f57 (patch) | |
| tree | e54a27979ea72ec41702bec2984c2eadac3b8862 /testing/scripts/function.sh | |
| parent | 4ef45ba0404dac3773e83af995a5ec584b23d633 (diff) | |
| download | vyos-strongswan-7c52c3f35cdbdff58443b994f2f33d13b4d81f57.tar.gz vyos-strongswan-7c52c3f35cdbdff58443b994f2f33d13b4d81f57.zip | |
Updated to new upstream version.
Diffstat (limited to 'testing/scripts/function.sh')
| -rwxr-xr-x | testing/scripts/function.sh | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/testing/scripts/function.sh b/testing/scripts/function.sh index f147e782e..e7ecbcf83 100755 --- a/testing/scripts/function.sh +++ b/testing/scripts/function.sh @@ -13,8 +13,6 @@ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# -# RCSID $Id: function.sh 3273 2007-10-08 20:18:34Z andreas $ ############################################ @@ -83,3 +81,47 @@ function searchandreplace { rm -f "$TMPFILE" } + +############################################# +# add a bridge +# + +function umlbr_add { + brctl addbr "umlbr$1" + brctl setfd "umlbr$1" 0 + brctl setageing "umlbr$1" 3600 + brctl stp "umlbr$1" off + ifconfig "umlbr$1" "$2" netmask "$3" up +} + +############################################# +# delete a bridge +# + +function umlbr_del { + ifconfig "umlbr$1" down &> /dev/null 2>&1 + brctl delbr "umlbr$1" &> /dev/null 2>&1 +} + +############################################# +# add a tap interface to a bridge +# + +function umlbr_add_tap { + tunctl -t "tap$1_$2" &> /dev/null 2>&1 + ifconfig "tap$1_$2" 0.0.0.0 promisc up &> /dev/null 2>&1 + brctl addif "umlbr$1" "tap$1_$2" &> /dev/null 2>&1 + cecho-n "$2.." + } + +############################################# +# delete a tap interface from a bridge +# + +function umlbr_del_tap { + ifconfig "umlbr$2" down &> /dev/null 2>&1 + brctl delif "umlbr$1" "tap$1_$2" &> /dev/null 2>&1 + tunctl -d "tap$1_$2" &> /dev/null 2>&1 + cecho-n "$2.." + } + |
