As much as possible, remove dependence on python 2.5
diff --git a/README b/README
index e5ff539..4f74942 100644
--- a/README
+++ b/README
@@ -27,7 +27,8 @@
1. Pre-requisites:
* Root privilege on host
- * Python 2.5 (or so)
+ * Python 2.5. You can run platforms using eth interfaces with
+ Python 2.4.
* oftest checked out (called <oftest> here)
* scapy installed: http://www.secdev.org/projects/scapy/
* Doxygen and doxypy for document generation (optional)
@@ -134,6 +135,31 @@
parameters this way. Each test case in the new file must derive
from unittest.TestCase.
+
+Using CentOS/RHEL
++++++++++++++++++
+
+ CentOS/RHEL have two challenges: they are very tied to Python 2.4
+ (and Scapy requires Python 2.5 for its latest version) and they
+ require a kernel upgrade to use veth pairs for local platform
+ testing.
+
+ If you only need to control eth interfaces for a remote platform,
+ you can use CentOS/RHEL. The key is to download scapy-1.2 from
+ the following link:
+
+ wget http://hg.secdev.org/scapy/raw-file/v1.2.0.2/scapy.py
+
+ See: http://www.dirk-loss.de/scapy-doc/installation.html#installing-scapy-v1-2
+ for more info.
+
+ Copy scapy.py to /usr/lib/python2.4/site-packages
+
+ If you hit an error related to importing scapy.all, you just need
+ to change the import to refer to scapy (not scapy.all). See
+ examples in parse.py for example.
+
+
Other Info
++++++++++
diff --git a/src/python/oftest/parse.py b/src/python/oftest/parse.py
index 9bd09b6..d60940a 100644
--- a/src/python/oftest/parse.py
+++ b/src/python/oftest/parse.py
@@ -11,7 +11,10 @@
try:
from scapy.all import *
except:
- sys.exit("Need to install scapy for packet parsing")
+ try:
+ import scapy as scapy
+ except:
+ sys.exit("Need to install scapy for packet parsing")
"""
of_message.py
diff --git a/tests/testutils.py b/tests/testutils.py
index 6f8e0b4..df7831e 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -1,5 +1,13 @@
-import scapy.all as scapy
+import sys
+
+try:
+ import scapy.all as scapy
+except:
+ try:
+ import scapy as scapy
+ except:
+ sys.exit("Need to install scapy for packet parsing")
import oftest.controller as controller
import oftest.cstruct as ofp
diff --git a/tools/pylibopenflow/bin/cstruct2py-get-struct.py b/tools/pylibopenflow/bin/cstruct2py-get-struct.py
old mode 100755
new mode 100644
index 4b8a350..d78d7c8
--- a/tools/pylibopenflow/bin/cstruct2py-get-struct.py
+++ b/tools/pylibopenflow/bin/cstruct2py-get-struct.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.5
+#!/usr/bin/env python
"""This script reads struct from C/C++ header file and output query
Author ykk
diff --git a/tools/pylibopenflow/bin/cstruct2py-pythonize.py b/tools/pylibopenflow/bin/cstruct2py-pythonize.py
old mode 100755
new mode 100644
index 47cbffb..39508cf
--- a/tools/pylibopenflow/bin/cstruct2py-pythonize.py
+++ b/tools/pylibopenflow/bin/cstruct2py-pythonize.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.5
+#!/usr/bin/env python
"""This script reads struct
Author ykk
diff --git a/tools/pylibopenflow/bin/cstruct2py-query-cheader.py b/tools/pylibopenflow/bin/cstruct2py-query-cheader.py
old mode 100755
new mode 100644
index 3d23ef0..ed82316
--- a/tools/pylibopenflow/bin/cstruct2py-query-cheader.py
+++ b/tools/pylibopenflow/bin/cstruct2py-query-cheader.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.5
+#!/usr/bin/env python
"""This script reads C/C++ header file and output query
Author ykk
diff --git a/tools/pylibopenflow/bin/pyopenflow-get-struct.py b/tools/pylibopenflow/bin/pyopenflow-get-struct.py
old mode 100755
new mode 100644
index 78297c5..d07d85e
--- a/tools/pylibopenflow/bin/pyopenflow-get-struct.py
+++ b/tools/pylibopenflow/bin/pyopenflow-get-struct.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.5
+#!/usr/bin/env python
"""This script reads struct from OpenFlow header file and output query
(C) Copyright Stanford University
diff --git a/tools/pylibopenflow/bin/pyopenflow-lavi-pythonize.py b/tools/pylibopenflow/bin/pyopenflow-lavi-pythonize.py
old mode 100755
new mode 100644
index bb8c180..914a424
--- a/tools/pylibopenflow/bin/pyopenflow-lavi-pythonize.py
+++ b/tools/pylibopenflow/bin/pyopenflow-lavi-pythonize.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.5
+#!/usr/bin/env python
"""This script generate class files for messenger and lavi in NOX,
specifically it creates a Python class for each data structure.
diff --git a/tools/pylibopenflow/bin/pyopenflow-load-controller.py b/tools/pylibopenflow/bin/pyopenflow-load-controller.py
old mode 100755
new mode 100644
index aef34f7..715a73a
--- a/tools/pylibopenflow/bin/pyopenflow-load-controller.py
+++ b/tools/pylibopenflow/bin/pyopenflow-load-controller.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.5
+#!/usr/bin/env python
"""This script fakes as n OpenFlow switch and
load the controller with k packets per second.
diff --git a/tools/pylibopenflow/bin/pyopenflow-ping-controller.py b/tools/pylibopenflow/bin/pyopenflow-ping-controller.py
old mode 100755
new mode 100644
index e5aa030..cae3a43
--- a/tools/pylibopenflow/bin/pyopenflow-ping-controller.py
+++ b/tools/pylibopenflow/bin/pyopenflow-ping-controller.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.5
+#!/usr/bin/env python
"""This script fakes as an OpenFlow switch to the controller
(C) Copyright Stanford University
diff --git a/tools/pylibopenflow/bin/pyopenflow-pythonize.py b/tools/pylibopenflow/bin/pyopenflow-pythonize.py
old mode 100755
new mode 100644
index 97b7c8f..6da4af9
--- a/tools/pylibopenflow/bin/pyopenflow-pythonize.py
+++ b/tools/pylibopenflow/bin/pyopenflow-pythonize.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.5
+#!/usr/bin/env python
"""This script generate openflow-packets.py which
creates Python class for each data structure in openflow.h.