diff options
author | Martin Willi <martin@strongswan.org> | 2009-04-14 10:34:24 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-04-14 10:34:24 +0000 |
commit | a44bb9345f0482b3dace19a27ee40320ddadc75f (patch) | |
tree | 34d75bd95b2868900213e13c31ddd892d2fd4904 /testing/scripts/function.sh | |
parent | 6e5c8d9413234b18a0631cddadd973a9f509708b (diff) | |
download | strongswan-a44bb9345f0482b3dace19a27ee40320ddadc75f.tar.bz2 strongswan-a44bb9345f0482b3dace19a27ee40320ddadc75f.tar.xz |
merged multi-auth branch back into trunk
Diffstat (limited to 'testing/scripts/function.sh')
-rwxr-xr-x | testing/scripts/function.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/testing/scripts/function.sh b/testing/scripts/function.sh index 22fce327c..917c972c7 100755 --- a/testing/scripts/function.sh +++ b/testing/scripts/function.sh @@ -83,3 +83,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.." + } + |