X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fscripts%2Fsliver-ovs.in;fp=planetlab%2Fscripts%2Fsliver-ovs.in;h=1a63bf02e4df8b13ef94e6d8e6b6c98268dfd416;hb=62b6fe80822a34182cccad23cb62c35434a95dd9;hp=50ecab855c97369fa0389fbf9552fc6a9be0ab6a;hpb=e11741625af584cbc4eba13eea0a2ad1495fb4e0;p=sliver-openvswitch.git diff --git a/planetlab/scripts/sliver-ovs.in b/planetlab/scripts/sliver-ovs.in index 50ecab855..1a63bf02e 100755 --- a/planetlab/scripts/sliver-ovs.in +++ b/planetlab/scripts/sliver-ovs.in @@ -353,13 +353,32 @@ function gmap_probe () { echo $! > $pid_file } +#################### +# xxx tmp for a demo +# there *must* be a better way to do that +# the thing is the slice sees several tap devices at this point, which is odd... +# for now I'm searching the tapname based on some hint - the vnet ip range +VNET=10.0.16 +function show_mac () { + ifnames=$(grep : /proc/net/dev | cut -d: -f1 | awk '{print $1;}') + tapname="" + for ifname in $ifnames; do + ifconfig $ifname | grep -q "$VNET" && tapname=$ifname + done + if [ -z "$tapname" ] ; then + echo "no-tap-found-for$VNET" + exit 1 + fi + ifconfig $tapname | grep -i hwaddr | awk '{print $5;}' +} + #################### SUPPORTED_SUBCOMMANDS="start stop status start_db stop_db start_switch stop_switch create_bridge create_port del_bridge del_port show get_local_endpoint set_remote_endpoint set_controller del_controller gmap_probe -get_local_ip get_local_links" +get_local_ip get_local_links show_mac" function main () { message="Usage: $COMMAND ...