--- /dev/null
+#!/usr/bin/python
+
+import sys
+import pwd
+import re
+import socket
+import struct
+import os
+import string
+
+vsys_config_dir = "/etc/planetlab/vsys-attributes"
+
+if len(sys.argv) != 2: sys.exit(1)
+
+slicename=sys.argv[1]
+sliceid = pwd.getpwnam(slicename).pw_uid
+dpname = "dp-%d"%sliceid
+
+### Read args from stdin
+arglines = map(string.strip, sys.stdin.readlines())
+if len(arglines) != 1: sys.exit(1)
+of_server = arglines[0]
+
+if re.match(r'^(tcp|udp):[\d\.]+$', vif) is None: exit(1)
+
+print "Requesting creation of data path %s."%dpname
+os.system("ovs-openflowd dp0 tcp:192.168.1.2")
--- /dev/null
+#!/usr/bin/python
+
+import sys
+import pwd
+import re
+import socket
+import struct
+import os
+import string
+
+vsys_config_dir = "/etc/planetlab/vsys-attributes"
+
+if len(sys.argv) != 2: sys.exit(1)
+
+slicename=sys.argv[1]
+sliceid = pwd.getpwnam(slicename).pw_uid
+
+dpname = "dp-%d"%sliceid
+
+print "Requesting creation of data path %s."%dpname
+os.system("ovs-dpctl add-dp %s"%dpname)
--- /dev/null
+#!/usr/bin/python
+
+import sys
+import pwd
+import re
+import socket
+import struct
+import os
+import string
+
+vsys_config_dir = "/etc/planetlab/vsys-attributes"
+
+if len(sys.argv) != 2: sys.exit(1)
+
+slicename=sys.argv[1]
+sliceid = pwd.getpwnam(slicename).pw_uid
+
+dpname = "dp-%d"%sliceid
+
+os.system("ovs-dpctl show %s"%dpname)
opt_txqueuelen = None
opt_rp_filter = None
opt_snat = None
+opt_ovs_dp = None
for optionline in options:
print >>sys.stderr, "txqueuelen value %s out of range 1-10000" % (val)
sys.exit(1)
opt_txqueuelen = intval
-
elif opt=="snat":
intval = int(val)
if val=="1":
opt_snat = True
+ elif opt=="vswitch":
+ opt_ovs_dp = val
else:
print >>sys.stderr, "Unknown option: \"%s\"" % (opt)
sys.exit(1)
-
### Configure interface
if opt_txqueuelen is None:
rp_cmd = "/sbin/sysctl net.ipv4.conf.%s.rp_filter=%s" % (vif, opt_rp_filter)
os.system(rp_cmd)
-
+# OVS datapath
+if opt_ovs_dp is not None:
+ cmd_ovs_addif = "ovs-dpctl add-if %s %s"%(opt_ovs_dp,vif)
+ os.system(cmd_ovs_addif)