Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/changelog
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/changelog	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/changelog	(revision 90)
@@ -0,0 +1,23 @@
+sipb-xen-dom0 (2.1) unstable; urgency=low
+
+  * Fix typo in init script 
+  * depend  on dsniff for arpspoof
+
+ -- Sam Hartman <hartmans@debian.org>  Fri, 24 Aug 2007 17:22:20 -0400
+
+sipb-xen-dom0 (2) unstable; urgency=low
+
+  * Add qemu-dm-sipb written by andersk to get us the  domain ID in qemu-ifup 
+  * Add vif-sipbroute, a version of vif-route that does better netwwork
+    isolation and has initial but useless ipv6 support.  This version also
+    uses arpspoof to take over an address for domain migrations.   
+  * Add init script to enable rp_filter, proxy_arp and forwarding for the network config.
+
+ -- Sam Hartman <hartmans@debian.org>  Fri, 24 Aug 2007 17:17:23 -0400
+
+sipb-xen-dom0 (1) unstable; urgency=low
+
+  *  First version
+
+ -- Sam Hartman <hartmans@debian.org>  Sat,  4 Aug 2007 20:20:32 -0400
+
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/compat
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/compat	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/compat	(revision 90)
@@ -0,0 +1,1 @@
+4
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/control
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/control	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/control	(revision 90)
@@ -0,0 +1,13 @@
+Source: sipb-xen-dom0
+Section: base
+Priority: extra
+Maintainer: SIPB Xen Project <sipb-xen@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0)
+Standards-Version: 3.7.2
+
+Package: sipb-xen-dom0
+Architecture: all
+Depends: ${misc:Depends},  emacs21, dhcp3-server, nullmailer, dsniff, xen-hypervisor-3.1.0-1-amd64, xen-ioemu-3.1.0-1, xen-utils-3.1.0-1, xen-utils-common, lvm2, grub, linux-image-2.6.18-4-xen-amd64
+Description: SIPB Xen domain 0 configuration
+ This package includes the dependencies and configuration for 
+ a domain 0 sipb-xen server.
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/copyright
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/copyright	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/copyright	(revision 90)
@@ -0,0 +1,3 @@
+This package was created for internal use of the SIPB Xen Project of
+the MIT Student Information Processing Board.  Ask tabbott@mit.edu if
+you have questions about redistribution.
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/rules
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/rules	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/rules	(revision 90)
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+
+include /usr/share/cdbs/1/rules/debhelper.mk
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/sipb-xen-dom0.dirs
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/sipb-xen-dom0.dirs	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/sipb-xen-dom0.dirs	(revision 90)
@@ -0,0 +1,1 @@
+usr/share/sipb-xen-dom0
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/sipb-xen-dom0.init
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/sipb-xen-dom0.init	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/sipb-xen-dom0.init	(revision 90)
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+
+case $1 in
+    start)
+    for foo in all default; do
+    echo 1 >/proc/sys/net/ipv4/conf/$foo/rp_filter 
+    echo 1 >/proc/sys/net/ipv4/conf/$foo/proxy_arp
+    done
+    echo 1 >/proc/sys/net/ipv4/ip_forward
+    ;;
+    esac
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/sipb-xen-dom0.install
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/sipb-xen-dom0.install	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/debian/sipb-xen-dom0.install	(revision 90)
@@ -0,0 +1,2 @@
+files/* .
+xend-config.sxp usr/share/sipb-xen-dom0
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/files/etc/modprobe.d/loop-maxloop
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/files/etc/modprobe.d/loop-maxloop	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/files/etc/modprobe.d/loop-maxloop	(revision 90)
@@ -0,0 +1,1 @@
+options loop max_loop=64
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/files/etc/xen/scripts/vif-sipbroute
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/files/etc/xen/scripts/vif-sipbroute	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/files/etc/xen/scripts/vif-sipbroute	(revision 90)
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+
+
+
+#============================================================================
+# /etc/xen/vif-route
+#
+# Script for configuring a vif in routed mode.
+# The hotplugging system will call this script if it is specified either in
+# the device configuration given to Xend, or the default Xend configuration
+# in /etc/xen/xend-config.sxp.  If the script is specified in neither of those
+# places, then vif-bridge is the default.
+#
+# Usage:
+# vif-route (add|remove|online|offline)
+#
+# Environment vars:
+# vif         vif interface name (required).
+# XENBUS_PATH path to this device's details in the XenStore (required).
+# Read from the store:
+# ip      list of IP networks for the vif, space-separated (default given in
+#         this script).
+# V6PREFIX  prefix of v6 address to use
+# Note that the v6 support is kind of broken because there's not really a way to populate the v6 prefix
+# This script will set up proxy arp  for any ip addresses that are being routed
+
+#============================================================================
+
+dir=$(dirname "$0")
+. "$dir/vif-common.sh"
+
+main_ip=$(dom0_ip)
+
+case "$command" in
+    online)
+        ifconfig ${vif} ${main_ip} netmask 255.255.255.255 up
+        echo 1 >/proc/sys/net/ipv4/conf/${vif}/proxy_arp
+	echo 1 >/proc/sys/net/ipv4/conf/${vif}/rp_filter 
+        ipcmd='add'
+        cmdprefix=''
+        ;;
+    offline)
+        do_without_error ifdown ${vif}
+	if [ -f /var/run/radvd/radvd.pid.${vif} ] ; then
+	    do_without_error kill `cat /var/run/radvd/radvd.pid.${vif}`
+	    fi
+        ipcmd='del'
+        cmdprefix='do_without_error'
+        ;;
+esac
+
+v6prefix=${v6prefix:-}
+v6prefix=$(xenstore_read_default "$XENBUS_PATH/v6prefix" "$v6prefix")
+
+if [ "${ip}" ] ; then
+    # If we've been given a list of IP addresses, then add routes from dom0 to
+    # the guest using those addresses.
+    for addr in ${ip} ; do
+      ${cmdprefix} ip route ${ipcmd} ${addr} dev ${vif} src ${main_ip}
+      arpspoof -i eth0 ${addr}&
+      sleep 5
+      kill %arpspoof
+    done 
+fi
+
+if [ x${v6prefix} != x ] ; then
+    sed -e "s/@interface@/${vif}/" -e "s+@prefix@+${v6prefix}+" /etc/xen/radvd.conf.template >/var/run/radvd.conf.${vif}
+    ${cmdprefix} ip -6 addr  ${ipcmd}  fe80::/64 scope link  dev ${vif} 
+    if [ $1 = online ] ; then
+	radvd  -u radvd -C /var/run/radvd.conf.${vif} -p /var/run/radvd/radvd.pid.${vif}
+    fi
+    ${cmdprefix} ip -6 route ${ipcmd} ${v6prefix} dev ${vif} 
+    fi
+
+handle_iptable
+
+log debug "Successful vif-route $command for $vif."
+if [ "$command" == "online" ]
+then
+  success
+fi
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/files/usr/sbin/qemu-dm-sipb
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/files/usr/sbin/qemu-dm-sipb	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/files/usr/sbin/qemu-dm-sipb	(revision 90)
@@ -0,0 +1,16 @@
+#!/bin/sh
+domid=
+for i; do
+    if [ "$domid" = "_NEXT_" ]; then
+	domid=$i
+	break
+    elif [ "$i" = "-d" ]; then
+	domid=_NEXT_
+    fi
+done
+export domid
+echo 'BEGIN qemu-dm-sipb LOG' >> /tmp/log
+echo "$0 $@" >> /tmp/log
+env >> /tmp/log
+echo 'END qemu-dm-sipb LOG' >> /tmp/log
+exec "$ROOT/bin/qemu-dm" "$@"
Index: package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/xend-config.sxp
===================================================================
--- package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/xend-config.sxp	(revision 90)
+++ package_tags/sipb-xen-dom0/2.1/sipb-xen-dom0/xend-config.sxp	(revision 90)
@@ -0,0 +1,135 @@
+# -*- sh -*-
+
+#
+# Xend configuration file.
+#
+
+# This example configuration is appropriate for an installation that 
+# utilizes a bridged network configuration. Access to xend via http
+# is disabled.  
+
+# Commented out entries show the default for that entry, unless otherwise
+# specified.
+
+#(logfile /var/log/xen/xend.log)
+#(loglevel DEBUG)
+
+#(xend-http-server no)
+#(xend-unix-server no)
+#(xend-tcp-xmlrpc-server no)
+#(xend-unix-xmlrpc-server yes)
+#(xend-relocation-server no)
+
+#(xend-unix-path /var/lib/xend/xend-socket)
+
+# Port xend should use for the HTTP interface, if xend-http-server is set.
+#(xend-port            8000)
+
+# Port xend should use for the relocation interface, if xend-relocation-server
+# is set.
+#(xend-relocation-port 8002)
+
+# Address xend should listen on for HTTP connections, if xend-http-server is
+# set.
+# Specifying 'localhost' prevents remote connections.
+# Specifying the empty string '' (the default) allows all connections.
+#(xend-address '')
+#(xend-address localhost)
+
+# Address xend should listen on for relocation-socket connections, if
+# xend-relocation-server is set.
+# Meaning and default as for xend-address above.
+#(xend-relocation-address '')
+
+# The hosts allowed to talk to the relocation port.  If this is empty (the
+# default), then all connections are allowed (assuming that the connection
+# arrives on a port and interface on which we are listening; see
+# xend-relocation-port and xend-relocation-address above).  Otherwise, this
+# should be a space-separated sequence of regular expressions.  Any host with
+# a fully-qualified domain name or an IP address that matches one of these
+# regular expressions will be accepted.
+#
+# For example:
+#  (xend-relocation-hosts-allow '^localhost$ ^.*\.example\.org$')
+#
+#(xend-relocation-hosts-allow '')
+
+# The limit (in kilobytes) on the size of the console buffer
+#(console-limit 1024)
+
+##
+# To bridge network traffic, like this:
+#
+# dom0: fake eth0 -> vif0.0 -+
+#                            |
+#                          bridge -> real eth0 -> the network
+#                            |
+# domU: fake eth0 -> vifN.0 -+
+#
+# use
+#
+# (network-script network-bridge)
+#
+# Your default ethernet device is used as the outgoing interface, by default. 
+# To use a different one (e.g. eth1) use
+#
+# (network-script 'network-bridge netdev=eth1')
+#
+# The bridge is named xenbr0, by default.  To rename the bridge, use
+#
+# (network-script 'network-bridge bridge=<name>')
+#
+# It is possible to use the network-bridge script in more complicated
+# scenarios, such as having two outgoing interfaces, with two bridges, and
+# two fake interfaces per guest domain.  To do things like this, write
+# yourself a wrapper script, and call network-bridge from it, as appropriate.
+#
+(network-script network-bridge)
+
+# The script used to control virtual interfaces.  This can be overridden on a
+# per-vif basis when creating a domain or a configuring a new vif.  The
+# vif-bridge script is designed for use with the network-bridge script, or
+# similar configurations.
+#
+# If you have overridden the bridge name using
+# (network-script 'network-bridge bridge=<name>') then you may wish to do the
+# same here.  The bridge name can also be set when creating a domain or
+# configuring a new vif, but a value specified here would act as a default.
+#
+# If you are using only one bridge, the vif-bridge script will discover that,
+# so there is no need to specify it explicitly.
+#
+(vif-script vif-bridge)
+
+
+## Use the following if network traffic is routed, as an alternative to the
+# settings for bridged networking given above.
+#(network-script network-route)
+#(vif-script     vif-route)
+
+
+## Use the following if network traffic is routed with NAT, as an alternative
+# to the settings for bridged networking given above.
+#(network-script network-nat)
+#(vif-script     vif-nat)
+
+
+# Dom0 will balloon out when needed to free memory for domU.
+# dom0-min-mem is the lowest memory level (in MB) dom0 will get down to.
+# If dom0-min-mem=0, dom0 will never balloon out.
+(dom0-min-mem 196)
+
+# In SMP system, dom0 will use dom0-cpus # of CPUS
+# If dom0-cpus = 0, dom0 will take all cpus available
+(dom0-cpus 0)
+
+# Whether to enable core-dumps when domains crash.
+#(enable-dump no)
+
+# The tool used for initiating virtual TPM migration
+#(external-migration-tool '')
+
+# The interface for VNC servers to listen on. Defaults
+# to 127.0.0.1  To restore old 'listen everywhere' behaviour
+# set this to 0.0.0.0
+#(vnc-listen '127.0.0.1')
