LEFT | RIGHT |
1 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8;
-*- | 1 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8;
-*- |
2 | 2 |
3 import os | 3 import os |
4 import Options | 4 import Options |
5 | 5 |
6 def set_options(opt): | 6 def set_options(opt): |
7 opt.add_option('--with-openflow', | 7 opt.add_option('--with-openflow', |
8 help=('Path to OFSID source for NS-3 OpenFlow Integration sup
port'), | 8 help=('Path to OFSID source for NS-3 OpenFlow Integration sup
port'), |
9 dest='with_openflow', default=None)· | 9 dest='with_openflow', default=None)· |
10 | 10 |
11 def configure(conf): | 11 def configure(conf): |
12 if Options.options.with_openflow: | 12 if Options.options.with_openflow: |
13 if os.path.isdir(Options.options.with_openflow): | 13 if os.path.isdir(Options.options.with_openflow): |
14 conf.check_message("libopenflow.a location", '', True, ("%s (given)"
% Options.options.with_openflow)) | 14 conf.check_message("libopenflow.a location", '', True, ("%s (given)"
% Options.options.with_openflow)) |
15 conf.env['WITH_OPENFLOW'] = os.path.abspath(Options.options.with_ope
nflow) | 15 conf.env['WITH_OPENFLOW'] = os.path.abspath(Options.options.with_ope
nflow) |
16 else: | 16 else: |
17 openflow_dir = os.path.join('..','openflow') | 17 openflow_dir = os.path.join('..','openflow') |
18 if os.path.isdir(openflow_dir): | 18 if os.path.isdir(openflow_dir): |
19 conf.check_message("openflow location", '', True, ("%s (guessed)
" % openflow_dir)) | 19 conf.check_message("openflow location", '', True, ("%s (guessed)
" % openflow_dir)) |
20 conf.env['WITH_OPENFLOW'] = os.path.abspath(openflow_dir) | 20 conf.env['WITH_OPENFLOW'] = os.path.abspath(openflow_dir) |
21 » » del openflow_dir | 21 » del openflow_dir |
22 if not conf.env['WITH_OPENFLOW']: | 22 if not conf.env['WITH_OPENFLOW']: |
23 conf.check_message("openflow location", '', False) | 23 conf.check_message("openflow location", '', False) |
24 conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", Fa
lse, | 24 conf.report_optional_feature("openflow", "NS-3 OpenFlow Integration", Fa
lse, |
25 "OpenFlow not enabled (see option --with-op
enflow)") | 25 "OpenFlow not enabled (see option --with-op
enflow)") |
26 return· | 26 return· |
27 | 27 |
28 test_code = ''' | 28 test_code = ''' |
29 #include "openflow.h" | 29 #include "openflow.h" |
| 30 #include "nicira-ext.h" |
| 31 #include "ericsson-ext.h" |
| 32 |
30 extern "C" | 33 extern "C" |
31 { | 34 { |
32 #define private _private | 35 #define private _private |
33 #define delete _delete | 36 #define delete _delete |
34 #define list List | 37 #define list List |
35 | |
36 #include "nicira-ext.h" | |
37 #include "ericsson-ext.h" | |
38 | 38 |
39 #include "csum.h" | 39 #include "csum.h" |
40 #include "poll-loop.h" | 40 #include "poll-loop.h" |
41 #include "rconn.h" | 41 #include "rconn.h" |
42 #include "stp.h" | 42 #include "stp.h" |
43 #include "vconn.h" | 43 #include "vconn.h" |
44 #include "xtoxll.h" | 44 #include "xtoxll.h" |
45 | 45 |
46 #include "chain.h" | 46 #include "chain.h" |
47 #include "table.h" | 47 #include "table.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 if bld.env['OPENFLOW'] and bld.env['DL'] and bld.env['XML2']: | 105 if bld.env['OPENFLOW'] and bld.env['DL'] and bld.env['XML2']: |
106 obj.uselib = 'OPENFLOW DL XML2'· | 106 obj.uselib = 'OPENFLOW DL XML2'· |
107 | 107 |
108 headers = bld.new_task_gen('ns3header') | 108 headers = bld.new_task_gen('ns3header') |
109 headers.module = 'switch' | 109 headers.module = 'switch' |
110 headers.source = [ | 110 headers.source = [ |
111 'openflow-interface.h', | 111 'openflow-interface.h', |
112 'switch-net-device.h', | 112 'switch-net-device.h', |
113 'switch-helper.h', | 113 'switch-helper.h', |
114 ] | 114 ] |
LEFT | RIGHT |