X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/blobdiff_plain/91cf1fc24419d0492c890daaa70febb8ab89e1cc..751f91525735c6ecd163484567390adb236f4d1b:/host/usr/sbin/invirt-vmcontrol?ds=sidebyside diff --git a/host/usr/sbin/invirt-vmcontrol b/host/usr/sbin/invirt-vmcontrol index 66f5ca6..eaac5ac 100755 --- a/host/usr/sbin/invirt-vmcontrol +++ b/host/usr/sbin/invirt-vmcontrol @@ -41,6 +41,22 @@ case "$ACTION" in vnctoken) invirt-vnc-authtoken "$ORIGMACHINE" ;; + arp) + iface=`invirt-getconf xen.iface` + xs_prefix="/local/domain/0/backend/vif" + domid=`xm domid $MACHINE` + for vif in `xenstore-list $xs_prefix/$domid`; do + ip=`xenstore-read $xs_prefix/$domid/$vif/ip` + script=`xenstore-read $xs_prefix/$domid/$vif/script` + gw=`echo $script | sed -ne 's/.* gateway=\([0-9\.]*\).*/\1/p'` + oip=`echo $script | sed -ne 's/.* other_ip=\([0-9\.]*\).*/\1/p'` + ogw=`echo $script | sed -ne 's/.* other_gateway=\([0-9\.]*\).*/\1/p'` + timeout 5 /usr/sbin/arpspoof -i $iface -t $gw $ip + if [ -n "$oip" ]; then + timeout 5 /usr/sbin/arpspoof -i $iface -t $ogw $oip + fi + done + ;; *) echo "ERROR: Invalid Command" exit 34