1 diff -r f860e2eac903 src/nepi/testbeds/ns3/connection_metadata.py
2 --- a/src/nepi/testbeds/ns3/connection_metadata.py Wed Aug 15 18:22:33 2012 +0200
3 +++ b/src/nepi/testbeds/ns3/connection_metadata.py Thu Aug 16 19:02:36 2012 +0200
5 (fd, msg) = passfd.recvfd(sock)
6 # Store a reference to the endpoint to keep the socket alive
7 fdnd.SetFileDescriptor(fd)
13 + TUNGETIFF = 0x800454d2
14 + IFF_NO_PI = 0x00001000
15 + IFF_TUN = 0x00000001
16 + IFF_TAP = 0x00000002
17 + struct_ifreq = "x"*16+"H"+"x"*22
19 + (flags, ) = struct.unpack(struct_ifreq,
20 + fcntl.ioctl(fd, TUNGETIFF, struct.pack(struct_ifreq, 0)))
22 + with_pi = (0 == (flags & IFF_NO_PI))
23 + is_tap = (0 == (flags & IFF_TUN))
25 + if is_tap and with_pi:
26 + fdnd.SetEncapsulationMode(fdnd.DIXPI)
27 + elif not is_tap and with_pi:
28 + fdnd.SetEncapsulationMode(fdnd.PI)
30 + # maybe the kernel doesn't support the IOCTL,
31 + # in which case, we assume it uses PI headers (as is usual)
35 + #err = traceback.format_exc()
40 diff -r f860e2eac903 src/nepi/testbeds/ns3/ns3_bindings_import.py
41 --- a/src/nepi/testbeds/ns3/ns3_bindings_import.py Wed Aug 15 18:22:33 2012 +0200
42 +++ b/src/nepi/testbeds/ns3/ns3_bindings_import.py Thu Aug 16 19:02:36 2012 +0200
44 #from ns.click import *
45 from ns.mobility import *
47 -from ns.netanim import *
48 +#from ns.netanim import *
49 from ns.stats import *
51 from ns.spectrum import *
52 diff -r f860e2eac903 src/nepi/testbeds/planetlab/application.py
53 --- a/src/nepi/testbeds/planetlab/application.py Wed Aug 15 18:22:33 2012 +0200
54 +++ b/src/nepi/testbeds/planetlab/application.py Thu Aug 16 19:02:36 2012 +0200
56 # We have to download the sources, untar, build...
57 #pygccxml_source_url = "http://leaseweb.dl.sourceforge.net/project/pygccxml/pygccxml/pygccxml-1.0/pygccxml-1.0.0.zip"
58 pygccxml_source_url = "http://yans.pl.sophia.inria.fr/libs/pygccxml-1.0.0.zip"
59 - ns3_source_url = "http://nepi.inria.fr/code/nepi-ns3.13/archive/tip.tar.gz"
60 + #ns3_source_url = "http://nepi.inria.fr/code/nepi-ns3.13/archive/tip.tar.gz"
61 + ns3_source_url = "http://nepi.inria.fr/code/nepi-ns3.fdnetdev/archive/tip.tar.gz"
62 passfd_source_url = "http://nepi.inria.fr/code/python-passfd/archive/tip.tar.gz"
64 - pybindgen_version = "797"
65 + #pybindgen_version = "797"
66 + pybindgen_version = "809"
71 "echo '7158877faff2254e6c094bf18e6b4283cac19137 pygccxml-1.0.0.zip' > archive_sums.txt && "
72 " ( " # check existing files
73 " sha1sum -c archive_sums.txt && "
74 - " test -f passfd-src.tar.gz && "
75 + " test -f passfd.tar.gz && "
76 " test -f ns3-src.tar.gz "
77 " ) || ( " # nope? re-download
78 - " rm -rf pybindgen pygccxml-1.0.0.zip passfd-src.tar.gz ns3-src.tar.gz && "
79 + " rm -rf pybindgen pygccxml-1.0.0.zip passfd.tar.gz ns3-src.tar.gz && "
80 " bzr checkout lp:pybindgen -r %(pybindgen_version)s && " # continue, to exploit the case when it has already been dl'ed
81 " wget -q -c -O pygccxml-1.0.0.zip %(pygccxml_source_url)s && "
82 - " wget -q -c -O passfd-src.tar.gz %(passfd_source_url)s && "
83 + " wget -q -c -O passfd.tar.gz %(passfd_source_url)s && "
84 " wget -q -c -O ns3-src.tar.gz %(ns3_source_url)s && "
85 " sha1sum -c archive_sums.txt " # Check SHA1 sums when applicable
87 "unzip -n pygccxml-1.0.0.zip && "
88 "mkdir -p ns3-src && "
89 - "mkdir -p passfd-src && "
90 + "mkdir -p passfd && "
91 "tar xzf ns3-src.tar.gz --strip-components=1 -C ns3-src && "
92 - "tar xzf passfd-src.tar.gz --strip-components=1 -C passfd-src && "
93 + "tar xzf passfd.tar.gz --strip-components=1 -C passfd && "
94 "rm -rf target && " # mv doesn't like unclean targets
96 "cd pygccxml-1.0.0 && "
99 "mv -f ${BUILD}/target/lib/python*/site-packages/pybindgen ${BUILD}/target/. && "
100 "rm -rf ${BUILD}/target/lib && "
101 - "cd ../passfd-src && "
103 "python setup.py build && "
104 "python setup.py install --install-lib ${BUILD}/target && "
105 "python setup.py clean && "
107 - "./waf configure --prefix=${BUILD}/target --with-pybindgen=../pybindgen-src -d release --disable-examples --disable-tests && "
108 + "./waf configure --prefix=${BUILD}/target --with-pybindgen=../pybindgen -d release --disable-examples --disable-tests && "
111 "rm -f ${BUILD}/target/lib/*.so && "