gjc@3408
|
1 |
from pybindgen import Module, FileCodeSink, write_preamble, param, retval
|
gjc@3408
|
2 |
|
gjc@3408
|
3 |
|
gjc@3408
|
4 |
import pybindgen.settings
|
gjc@3408
|
5 |
import warnings
|
gjc@3408
|
6 |
|
gjc@3408
|
7 |
class ErrorHandler(pybindgen.settings.ErrorHandler):
|
gjc@3408
|
8 |
def handle_error(self, wrapper, exception, traceback_):
|
gjc@3408
|
9 |
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
|
gjc@3408
|
10 |
return True
|
gjc@3408
|
11 |
pybindgen.settings.error_handler = ErrorHandler()
|
gjc@3408
|
12 |
|
gjc@3408
|
13 |
|
gjc@3408
|
14 |
import sys
|
gjc@3408
|
15 |
import ns3_module_core
|
gjc@3408
|
16 |
import ns3_module_simulator
|
gjc@3408
|
17 |
import ns3_module_mobility
|
gjc@3408
|
18 |
import ns3_module_common
|
gjc@3408
|
19 |
import ns3_module_contrib
|
gjc@3408
|
20 |
import ns3_module_node
|
gjc@3408
|
21 |
import ns3_module_point_to_point
|
gjc@3408
|
22 |
import ns3_module_internet_stack
|
gjc@3408
|
23 |
import ns3_module_wifi
|
gjc@3408
|
24 |
import ns3_module_csma
|
gjc@3408
|
25 |
import ns3_module_packet_sink
|
gjc@3408
|
26 |
import ns3_module_global_routing
|
gjc@3408
|
27 |
import ns3_module_onoff
|
gjc@3408
|
28 |
import ns3_module_olsr
|
gjc@3408
|
29 |
import ns3_module_udp_echo
|
gjc@3408
|
30 |
import ns3_module_helper
|
gjc@3408
|
31 |
|
gjc@3408
|
32 |
def module_init():
|
gjc@3408
|
33 |
root_module = Module('ns3', cpp_namespace='::ns3')
|
gjc@3408
|
34 |
return root_module
|
gjc@3408
|
35 |
|
gjc@3408
|
36 |
def register_types(module):
|
gjc@3408
|
37 |
root_module = module.get_root()
|
gjc@3408
|
38 |
|
gjc@3408
|
39 |
root_module.begin_section('ns3_module_core')
|
gjc@3408
|
40 |
ns3_module_core.register_types(module)
|
gjc@3408
|
41 |
|
gjc@3408
|
42 |
try:
|
gjc@3408
|
43 |
import ns3_module_core__local
|
gjc@3408
|
44 |
except ImportError:
|
gjc@3408
|
45 |
pass
|
gjc@3408
|
46 |
else:
|
gjc@3408
|
47 |
ns3_module_core__local.register_types(module)
|
gjc@3408
|
48 |
|
gjc@3408
|
49 |
root_module.end_section('ns3_module_core')
|
gjc@3408
|
50 |
root_module.begin_section('ns3_module_simulator')
|
gjc@3408
|
51 |
ns3_module_simulator.register_types(module)
|
gjc@3408
|
52 |
|
gjc@3408
|
53 |
try:
|
gjc@3408
|
54 |
import ns3_module_simulator__local
|
gjc@3408
|
55 |
except ImportError:
|
gjc@3408
|
56 |
pass
|
gjc@3408
|
57 |
else:
|
gjc@3408
|
58 |
ns3_module_simulator__local.register_types(module)
|
gjc@3408
|
59 |
|
gjc@3408
|
60 |
root_module.end_section('ns3_module_simulator')
|
gjc@3408
|
61 |
root_module.begin_section('ns3_module_mobility')
|
gjc@3408
|
62 |
ns3_module_mobility.register_types(module)
|
gjc@3408
|
63 |
|
gjc@3408
|
64 |
try:
|
gjc@3408
|
65 |
import ns3_module_mobility__local
|
gjc@3408
|
66 |
except ImportError:
|
gjc@3408
|
67 |
pass
|
gjc@3408
|
68 |
else:
|
gjc@3408
|
69 |
ns3_module_mobility__local.register_types(module)
|
gjc@3408
|
70 |
|
gjc@3408
|
71 |
root_module.end_section('ns3_module_mobility')
|
gjc@3408
|
72 |
root_module.begin_section('ns3_module_common')
|
gjc@3408
|
73 |
ns3_module_common.register_types(module)
|
gjc@3408
|
74 |
|
gjc@3408
|
75 |
try:
|
gjc@3408
|
76 |
import ns3_module_common__local
|
gjc@3408
|
77 |
except ImportError:
|
gjc@3408
|
78 |
pass
|
gjc@3408
|
79 |
else:
|
gjc@3408
|
80 |
ns3_module_common__local.register_types(module)
|
gjc@3408
|
81 |
|
gjc@3408
|
82 |
root_module.end_section('ns3_module_common')
|
gjc@3408
|
83 |
root_module.begin_section('ns3_module_contrib')
|
gjc@3408
|
84 |
ns3_module_contrib.register_types(module)
|
gjc@3408
|
85 |
|
gjc@3408
|
86 |
try:
|
gjc@3408
|
87 |
import ns3_module_contrib__local
|
gjc@3408
|
88 |
except ImportError:
|
gjc@3408
|
89 |
pass
|
gjc@3408
|
90 |
else:
|
gjc@3408
|
91 |
ns3_module_contrib__local.register_types(module)
|
gjc@3408
|
92 |
|
gjc@3408
|
93 |
root_module.end_section('ns3_module_contrib')
|
gjc@3408
|
94 |
root_module.begin_section('ns3_module_node')
|
gjc@3408
|
95 |
ns3_module_node.register_types(module)
|
gjc@3408
|
96 |
|
gjc@3408
|
97 |
try:
|
gjc@3408
|
98 |
import ns3_module_node__local
|
gjc@3408
|
99 |
except ImportError:
|
gjc@3408
|
100 |
pass
|
gjc@3408
|
101 |
else:
|
gjc@3408
|
102 |
ns3_module_node__local.register_types(module)
|
gjc@3408
|
103 |
|
gjc@3408
|
104 |
root_module.end_section('ns3_module_node')
|
gjc@3408
|
105 |
root_module.begin_section('ns3_module_point_to_point')
|
gjc@3408
|
106 |
ns3_module_point_to_point.register_types(module)
|
gjc@3408
|
107 |
|
gjc@3408
|
108 |
try:
|
gjc@3408
|
109 |
import ns3_module_point_to_point__local
|
gjc@3408
|
110 |
except ImportError:
|
gjc@3408
|
111 |
pass
|
gjc@3408
|
112 |
else:
|
gjc@3408
|
113 |
ns3_module_point_to_point__local.register_types(module)
|
gjc@3408
|
114 |
|
gjc@3408
|
115 |
root_module.end_section('ns3_module_point_to_point')
|
gjc@3408
|
116 |
root_module.begin_section('ns3_module_internet_stack')
|
gjc@3408
|
117 |
ns3_module_internet_stack.register_types(module)
|
gjc@3408
|
118 |
|
gjc@3408
|
119 |
try:
|
gjc@3408
|
120 |
import ns3_module_internet_stack__local
|
gjc@3408
|
121 |
except ImportError:
|
gjc@3408
|
122 |
pass
|
gjc@3408
|
123 |
else:
|
gjc@3408
|
124 |
ns3_module_internet_stack__local.register_types(module)
|
gjc@3408
|
125 |
|
gjc@3408
|
126 |
root_module.end_section('ns3_module_internet_stack')
|
gjc@3408
|
127 |
root_module.begin_section('ns3_module_wifi')
|
gjc@3408
|
128 |
ns3_module_wifi.register_types(module)
|
gjc@3408
|
129 |
|
gjc@3408
|
130 |
try:
|
gjc@3408
|
131 |
import ns3_module_wifi__local
|
gjc@3408
|
132 |
except ImportError:
|
gjc@3408
|
133 |
pass
|
gjc@3408
|
134 |
else:
|
gjc@3408
|
135 |
ns3_module_wifi__local.register_types(module)
|
gjc@3408
|
136 |
|
gjc@3408
|
137 |
root_module.end_section('ns3_module_wifi')
|
gjc@3408
|
138 |
root_module.begin_section('ns3_module_csma')
|
gjc@3408
|
139 |
ns3_module_csma.register_types(module)
|
gjc@3408
|
140 |
|
gjc@3408
|
141 |
try:
|
gjc@3408
|
142 |
import ns3_module_csma__local
|
gjc@3408
|
143 |
except ImportError:
|
gjc@3408
|
144 |
pass
|
gjc@3408
|
145 |
else:
|
gjc@3408
|
146 |
ns3_module_csma__local.register_types(module)
|
gjc@3408
|
147 |
|
gjc@3408
|
148 |
root_module.end_section('ns3_module_csma')
|
gjc@3408
|
149 |
root_module.begin_section('ns3_module_packet_sink')
|
gjc@3408
|
150 |
ns3_module_packet_sink.register_types(module)
|
gjc@3408
|
151 |
|
gjc@3408
|
152 |
try:
|
gjc@3408
|
153 |
import ns3_module_packet_sink__local
|
gjc@3408
|
154 |
except ImportError:
|
gjc@3408
|
155 |
pass
|
gjc@3408
|
156 |
else:
|
gjc@3408
|
157 |
ns3_module_packet_sink__local.register_types(module)
|
gjc@3408
|
158 |
|
gjc@3408
|
159 |
root_module.end_section('ns3_module_packet_sink')
|
gjc@3408
|
160 |
root_module.begin_section('ns3_module_global_routing')
|
gjc@3408
|
161 |
ns3_module_global_routing.register_types(module)
|
gjc@3408
|
162 |
|
gjc@3408
|
163 |
try:
|
gjc@3408
|
164 |
import ns3_module_global_routing__local
|
gjc@3408
|
165 |
except ImportError:
|
gjc@3408
|
166 |
pass
|
gjc@3408
|
167 |
else:
|
gjc@3408
|
168 |
ns3_module_global_routing__local.register_types(module)
|
gjc@3408
|
169 |
|
gjc@3408
|
170 |
root_module.end_section('ns3_module_global_routing')
|
gjc@3408
|
171 |
root_module.begin_section('ns3_module_onoff')
|
gjc@3408
|
172 |
ns3_module_onoff.register_types(module)
|
gjc@3408
|
173 |
|
gjc@3408
|
174 |
try:
|
gjc@3408
|
175 |
import ns3_module_onoff__local
|
gjc@3408
|
176 |
except ImportError:
|
gjc@3408
|
177 |
pass
|
gjc@3408
|
178 |
else:
|
gjc@3408
|
179 |
ns3_module_onoff__local.register_types(module)
|
gjc@3408
|
180 |
|
gjc@3408
|
181 |
root_module.end_section('ns3_module_onoff')
|
gjc@3408
|
182 |
root_module.begin_section('ns3_module_olsr')
|
gjc@3408
|
183 |
ns3_module_olsr.register_types(module)
|
gjc@3408
|
184 |
|
gjc@3408
|
185 |
try:
|
gjc@3408
|
186 |
import ns3_module_olsr__local
|
gjc@3408
|
187 |
except ImportError:
|
gjc@3408
|
188 |
pass
|
gjc@3408
|
189 |
else:
|
gjc@3408
|
190 |
ns3_module_olsr__local.register_types(module)
|
gjc@3408
|
191 |
|
gjc@3408
|
192 |
root_module.end_section('ns3_module_olsr')
|
gjc@3408
|
193 |
root_module.begin_section('ns3_module_udp_echo')
|
gjc@3408
|
194 |
ns3_module_udp_echo.register_types(module)
|
gjc@3408
|
195 |
|
gjc@3408
|
196 |
try:
|
gjc@3408
|
197 |
import ns3_module_udp_echo__local
|
gjc@3408
|
198 |
except ImportError:
|
gjc@3408
|
199 |
pass
|
gjc@3408
|
200 |
else:
|
gjc@3408
|
201 |
ns3_module_udp_echo__local.register_types(module)
|
gjc@3408
|
202 |
|
gjc@3408
|
203 |
root_module.end_section('ns3_module_udp_echo')
|
gjc@3408
|
204 |
root_module.begin_section('ns3_module_helper')
|
gjc@3408
|
205 |
ns3_module_helper.register_types(module)
|
gjc@3408
|
206 |
|
gjc@3408
|
207 |
try:
|
gjc@3408
|
208 |
import ns3_module_helper__local
|
gjc@3408
|
209 |
except ImportError:
|
gjc@3408
|
210 |
pass
|
gjc@3408
|
211 |
else:
|
gjc@3408
|
212 |
ns3_module_helper__local.register_types(module)
|
gjc@3408
|
213 |
|
gjc@3408
|
214 |
root_module.end_section('ns3_module_helper')
|
gjc@3408
|
215 |
|
gjc@3408
|
216 |
## Register a nested module for the namespace internal
|
gjc@3408
|
217 |
|
gjc@3408
|
218 |
nested_module = module.add_cpp_namespace('internal')
|
gjc@3408
|
219 |
register_types_ns3_internal(nested_module)
|
gjc@3408
|
220 |
|
gjc@3408
|
221 |
|
gjc@3408
|
222 |
## Register a nested module for the namespace TimeStepPrecision
|
gjc@3408
|
223 |
|
gjc@3408
|
224 |
nested_module = module.add_cpp_namespace('TimeStepPrecision')
|
gjc@3408
|
225 |
register_types_ns3_TimeStepPrecision(nested_module)
|
gjc@3408
|
226 |
|
gjc@3408
|
227 |
|
gjc@3408
|
228 |
## Register a nested module for the namespace Config
|
gjc@3408
|
229 |
|
gjc@3408
|
230 |
nested_module = module.add_cpp_namespace('Config')
|
gjc@3408
|
231 |
register_types_ns3_Config(nested_module)
|
gjc@3408
|
232 |
|
gjc@3408
|
233 |
|
gjc@3408
|
234 |
## Register a nested module for the namespace olsr
|
gjc@3408
|
235 |
|
gjc@3408
|
236 |
nested_module = module.add_cpp_namespace('olsr')
|
gjc@3408
|
237 |
register_types_ns3_olsr(nested_module)
|
gjc@3408
|
238 |
|
gjc@3408
|
239 |
|
gjc@3408
|
240 |
def register_types_ns3_internal(module):
|
gjc@3408
|
241 |
root_module = module.get_root()
|
gjc@3408
|
242 |
|
gjc@3408
|
243 |
|
gjc@3408
|
244 |
def register_types_ns3_TimeStepPrecision(module):
|
gjc@3408
|
245 |
root_module = module.get_root()
|
gjc@3408
|
246 |
|
gjc@3408
|
247 |
|
gjc@3408
|
248 |
def register_types_ns3_Config(module):
|
gjc@3408
|
249 |
root_module = module.get_root()
|
gjc@3408
|
250 |
|
gjc@3408
|
251 |
|
gjc@3408
|
252 |
def register_types_ns3_olsr(module):
|
gjc@3408
|
253 |
root_module = module.get_root()
|
gjc@3408
|
254 |
|
gjc@3408
|
255 |
|
gjc@3408
|
256 |
def register_methods(root_module):
|
gjc@3408
|
257 |
root_module.begin_section('ns3_module_core')
|
gjc@3408
|
258 |
ns3_module_core.register_methods(root_module)
|
gjc@3408
|
259 |
|
gjc@3408
|
260 |
try:
|
gjc@3408
|
261 |
import ns3_module_core__local
|
gjc@3408
|
262 |
except ImportError:
|
gjc@3408
|
263 |
pass
|
gjc@3408
|
264 |
else:
|
gjc@3408
|
265 |
ns3_module_core__local.register_methods(root_module)
|
gjc@3408
|
266 |
|
gjc@3408
|
267 |
root_module.end_section('ns3_module_core')
|
gjc@3408
|
268 |
root_module.begin_section('ns3_module_simulator')
|
gjc@3408
|
269 |
ns3_module_simulator.register_methods(root_module)
|
gjc@3408
|
270 |
|
gjc@3408
|
271 |
try:
|
gjc@3408
|
272 |
import ns3_module_simulator__local
|
gjc@3408
|
273 |
except ImportError:
|
gjc@3408
|
274 |
pass
|
gjc@3408
|
275 |
else:
|
gjc@3408
|
276 |
ns3_module_simulator__local.register_methods(root_module)
|
gjc@3408
|
277 |
|
gjc@3408
|
278 |
root_module.end_section('ns3_module_simulator')
|
gjc@3408
|
279 |
root_module.begin_section('ns3_module_mobility')
|
gjc@3408
|
280 |
ns3_module_mobility.register_methods(root_module)
|
gjc@3408
|
281 |
|
gjc@3408
|
282 |
try:
|
gjc@3408
|
283 |
import ns3_module_mobility__local
|
gjc@3408
|
284 |
except ImportError:
|
gjc@3408
|
285 |
pass
|
gjc@3408
|
286 |
else:
|
gjc@3408
|
287 |
ns3_module_mobility__local.register_methods(root_module)
|
gjc@3408
|
288 |
|
gjc@3408
|
289 |
root_module.end_section('ns3_module_mobility')
|
gjc@3408
|
290 |
root_module.begin_section('ns3_module_common')
|
gjc@3408
|
291 |
ns3_module_common.register_methods(root_module)
|
gjc@3408
|
292 |
|
gjc@3408
|
293 |
try:
|
gjc@3408
|
294 |
import ns3_module_common__local
|
gjc@3408
|
295 |
except ImportError:
|
gjc@3408
|
296 |
pass
|
gjc@3408
|
297 |
else:
|
gjc@3408
|
298 |
ns3_module_common__local.register_methods(root_module)
|
gjc@3408
|
299 |
|
gjc@3408
|
300 |
root_module.end_section('ns3_module_common')
|
gjc@3408
|
301 |
root_module.begin_section('ns3_module_contrib')
|
gjc@3408
|
302 |
ns3_module_contrib.register_methods(root_module)
|
gjc@3408
|
303 |
|
gjc@3408
|
304 |
try:
|
gjc@3408
|
305 |
import ns3_module_contrib__local
|
gjc@3408
|
306 |
except ImportError:
|
gjc@3408
|
307 |
pass
|
gjc@3408
|
308 |
else:
|
gjc@3408
|
309 |
ns3_module_contrib__local.register_methods(root_module)
|
gjc@3408
|
310 |
|
gjc@3408
|
311 |
root_module.end_section('ns3_module_contrib')
|
gjc@3408
|
312 |
root_module.begin_section('ns3_module_node')
|
gjc@3408
|
313 |
ns3_module_node.register_methods(root_module)
|
gjc@3408
|
314 |
|
gjc@3408
|
315 |
try:
|
gjc@3408
|
316 |
import ns3_module_node__local
|
gjc@3408
|
317 |
except ImportError:
|
gjc@3408
|
318 |
pass
|
gjc@3408
|
319 |
else:
|
gjc@3408
|
320 |
ns3_module_node__local.register_methods(root_module)
|
gjc@3408
|
321 |
|
gjc@3408
|
322 |
root_module.end_section('ns3_module_node')
|
gjc@3408
|
323 |
root_module.begin_section('ns3_module_point_to_point')
|
gjc@3408
|
324 |
ns3_module_point_to_point.register_methods(root_module)
|
gjc@3408
|
325 |
|
gjc@3408
|
326 |
try:
|
gjc@3408
|
327 |
import ns3_module_point_to_point__local
|
gjc@3408
|
328 |
except ImportError:
|
gjc@3408
|
329 |
pass
|
gjc@3408
|
330 |
else:
|
gjc@3408
|
331 |
ns3_module_point_to_point__local.register_methods(root_module)
|
gjc@3408
|
332 |
|
gjc@3408
|
333 |
root_module.end_section('ns3_module_point_to_point')
|
gjc@3408
|
334 |
root_module.begin_section('ns3_module_internet_stack')
|
gjc@3408
|
335 |
ns3_module_internet_stack.register_methods(root_module)
|
gjc@3408
|
336 |
|
gjc@3408
|
337 |
try:
|
gjc@3408
|
338 |
import ns3_module_internet_stack__local
|
gjc@3408
|
339 |
except ImportError:
|
gjc@3408
|
340 |
pass
|
gjc@3408
|
341 |
else:
|
gjc@3408
|
342 |
ns3_module_internet_stack__local.register_methods(root_module)
|
gjc@3408
|
343 |
|
gjc@3408
|
344 |
root_module.end_section('ns3_module_internet_stack')
|
gjc@3408
|
345 |
root_module.begin_section('ns3_module_wifi')
|
gjc@3408
|
346 |
ns3_module_wifi.register_methods(root_module)
|
gjc@3408
|
347 |
|
gjc@3408
|
348 |
try:
|
gjc@3408
|
349 |
import ns3_module_wifi__local
|
gjc@3408
|
350 |
except ImportError:
|
gjc@3408
|
351 |
pass
|
gjc@3408
|
352 |
else:
|
gjc@3408
|
353 |
ns3_module_wifi__local.register_methods(root_module)
|
gjc@3408
|
354 |
|
gjc@3408
|
355 |
root_module.end_section('ns3_module_wifi')
|
gjc@3408
|
356 |
root_module.begin_section('ns3_module_csma')
|
gjc@3408
|
357 |
ns3_module_csma.register_methods(root_module)
|
gjc@3408
|
358 |
|
gjc@3408
|
359 |
try:
|
gjc@3408
|
360 |
import ns3_module_csma__local
|
gjc@3408
|
361 |
except ImportError:
|
gjc@3408
|
362 |
pass
|
gjc@3408
|
363 |
else:
|
gjc@3408
|
364 |
ns3_module_csma__local.register_methods(root_module)
|
gjc@3408
|
365 |
|
gjc@3408
|
366 |
root_module.end_section('ns3_module_csma')
|
gjc@3408
|
367 |
root_module.begin_section('ns3_module_packet_sink')
|
gjc@3408
|
368 |
ns3_module_packet_sink.register_methods(root_module)
|
gjc@3408
|
369 |
|
gjc@3408
|
370 |
try:
|
gjc@3408
|
371 |
import ns3_module_packet_sink__local
|
gjc@3408
|
372 |
except ImportError:
|
gjc@3408
|
373 |
pass
|
gjc@3408
|
374 |
else:
|
gjc@3408
|
375 |
ns3_module_packet_sink__local.register_methods(root_module)
|
gjc@3408
|
376 |
|
gjc@3408
|
377 |
root_module.end_section('ns3_module_packet_sink')
|
gjc@3408
|
378 |
root_module.begin_section('ns3_module_global_routing')
|
gjc@3408
|
379 |
ns3_module_global_routing.register_methods(root_module)
|
gjc@3408
|
380 |
|
gjc@3408
|
381 |
try:
|
gjc@3408
|
382 |
import ns3_module_global_routing__local
|
gjc@3408
|
383 |
except ImportError:
|
gjc@3408
|
384 |
pass
|
gjc@3408
|
385 |
else:
|
gjc@3408
|
386 |
ns3_module_global_routing__local.register_methods(root_module)
|
gjc@3408
|
387 |
|
gjc@3408
|
388 |
root_module.end_section('ns3_module_global_routing')
|
gjc@3408
|
389 |
root_module.begin_section('ns3_module_onoff')
|
gjc@3408
|
390 |
ns3_module_onoff.register_methods(root_module)
|
gjc@3408
|
391 |
|
gjc@3408
|
392 |
try:
|
gjc@3408
|
393 |
import ns3_module_onoff__local
|
gjc@3408
|
394 |
except ImportError:
|
gjc@3408
|
395 |
pass
|
gjc@3408
|
396 |
else:
|
gjc@3408
|
397 |
ns3_module_onoff__local.register_methods(root_module)
|
gjc@3408
|
398 |
|
gjc@3408
|
399 |
root_module.end_section('ns3_module_onoff')
|
gjc@3408
|
400 |
root_module.begin_section('ns3_module_olsr')
|
gjc@3408
|
401 |
ns3_module_olsr.register_methods(root_module)
|
gjc@3408
|
402 |
|
gjc@3408
|
403 |
try:
|
gjc@3408
|
404 |
import ns3_module_olsr__local
|
gjc@3408
|
405 |
except ImportError:
|
gjc@3408
|
406 |
pass
|
gjc@3408
|
407 |
else:
|
gjc@3408
|
408 |
ns3_module_olsr__local.register_methods(root_module)
|
gjc@3408
|
409 |
|
gjc@3408
|
410 |
root_module.end_section('ns3_module_olsr')
|
gjc@3408
|
411 |
root_module.begin_section('ns3_module_udp_echo')
|
gjc@3408
|
412 |
ns3_module_udp_echo.register_methods(root_module)
|
gjc@3408
|
413 |
|
gjc@3408
|
414 |
try:
|
gjc@3408
|
415 |
import ns3_module_udp_echo__local
|
gjc@3408
|
416 |
except ImportError:
|
gjc@3408
|
417 |
pass
|
gjc@3408
|
418 |
else:
|
gjc@3408
|
419 |
ns3_module_udp_echo__local.register_methods(root_module)
|
gjc@3408
|
420 |
|
gjc@3408
|
421 |
root_module.end_section('ns3_module_udp_echo')
|
gjc@3408
|
422 |
root_module.begin_section('ns3_module_helper')
|
gjc@3408
|
423 |
ns3_module_helper.register_methods(root_module)
|
gjc@3408
|
424 |
|
gjc@3408
|
425 |
try:
|
gjc@3408
|
426 |
import ns3_module_helper__local
|
gjc@3408
|
427 |
except ImportError:
|
gjc@3408
|
428 |
pass
|
gjc@3408
|
429 |
else:
|
gjc@3408
|
430 |
ns3_module_helper__local.register_methods(root_module)
|
gjc@3408
|
431 |
|
gjc@3408
|
432 |
root_module.end_section('ns3_module_helper')
|
gjc@3408
|
433 |
return
|
gjc@3408
|
434 |
|
gjc@3408
|
435 |
def register_functions(root_module):
|
gjc@3408
|
436 |
module = root_module
|
gjc@3408
|
437 |
root_module.begin_section('ns3_module_core')
|
gjc@3408
|
438 |
ns3_module_core.register_functions(root_module)
|
gjc@3408
|
439 |
|
gjc@3408
|
440 |
try:
|
gjc@3408
|
441 |
import ns3_module_core__local
|
gjc@3408
|
442 |
except ImportError:
|
gjc@3408
|
443 |
pass
|
gjc@3408
|
444 |
else:
|
gjc@3408
|
445 |
ns3_module_core__local.register_functions(root_module)
|
gjc@3408
|
446 |
|
gjc@3408
|
447 |
root_module.end_section('ns3_module_core')
|
gjc@3408
|
448 |
root_module.begin_section('ns3_module_simulator')
|
gjc@3408
|
449 |
ns3_module_simulator.register_functions(root_module)
|
gjc@3408
|
450 |
|
gjc@3408
|
451 |
try:
|
gjc@3408
|
452 |
import ns3_module_simulator__local
|
gjc@3408
|
453 |
except ImportError:
|
gjc@3408
|
454 |
pass
|
gjc@3408
|
455 |
else:
|
gjc@3408
|
456 |
ns3_module_simulator__local.register_functions(root_module)
|
gjc@3408
|
457 |
|
gjc@3408
|
458 |
root_module.end_section('ns3_module_simulator')
|
gjc@3408
|
459 |
root_module.begin_section('ns3_module_mobility')
|
gjc@3408
|
460 |
ns3_module_mobility.register_functions(root_module)
|
gjc@3408
|
461 |
|
gjc@3408
|
462 |
try:
|
gjc@3408
|
463 |
import ns3_module_mobility__local
|
gjc@3408
|
464 |
except ImportError:
|
gjc@3408
|
465 |
pass
|
gjc@3408
|
466 |
else:
|
gjc@3408
|
467 |
ns3_module_mobility__local.register_functions(root_module)
|
gjc@3408
|
468 |
|
gjc@3408
|
469 |
root_module.end_section('ns3_module_mobility')
|
gjc@3408
|
470 |
root_module.begin_section('ns3_module_common')
|
gjc@3408
|
471 |
ns3_module_common.register_functions(root_module)
|
gjc@3408
|
472 |
|
gjc@3408
|
473 |
try:
|
gjc@3408
|
474 |
import ns3_module_common__local
|
gjc@3408
|
475 |
except ImportError:
|
gjc@3408
|
476 |
pass
|
gjc@3408
|
477 |
else:
|
gjc@3408
|
478 |
ns3_module_common__local.register_functions(root_module)
|
gjc@3408
|
479 |
|
gjc@3408
|
480 |
root_module.end_section('ns3_module_common')
|
gjc@3408
|
481 |
root_module.begin_section('ns3_module_contrib')
|
gjc@3408
|
482 |
ns3_module_contrib.register_functions(root_module)
|
gjc@3408
|
483 |
|
gjc@3408
|
484 |
try:
|
gjc@3408
|
485 |
import ns3_module_contrib__local
|
gjc@3408
|
486 |
except ImportError:
|
gjc@3408
|
487 |
pass
|
gjc@3408
|
488 |
else:
|
gjc@3408
|
489 |
ns3_module_contrib__local.register_functions(root_module)
|
gjc@3408
|
490 |
|
gjc@3408
|
491 |
root_module.end_section('ns3_module_contrib')
|
gjc@3408
|
492 |
root_module.begin_section('ns3_module_node')
|
gjc@3408
|
493 |
ns3_module_node.register_functions(root_module)
|
gjc@3408
|
494 |
|
gjc@3408
|
495 |
try:
|
gjc@3408
|
496 |
import ns3_module_node__local
|
gjc@3408
|
497 |
except ImportError:
|
gjc@3408
|
498 |
pass
|
gjc@3408
|
499 |
else:
|
gjc@3408
|
500 |
ns3_module_node__local.register_functions(root_module)
|
gjc@3408
|
501 |
|
gjc@3408
|
502 |
root_module.end_section('ns3_module_node')
|
gjc@3408
|
503 |
root_module.begin_section('ns3_module_point_to_point')
|
gjc@3408
|
504 |
ns3_module_point_to_point.register_functions(root_module)
|
gjc@3408
|
505 |
|
gjc@3408
|
506 |
try:
|
gjc@3408
|
507 |
import ns3_module_point_to_point__local
|
gjc@3408
|
508 |
except ImportError:
|
gjc@3408
|
509 |
pass
|
gjc@3408
|
510 |
else:
|
gjc@3408
|
511 |
ns3_module_point_to_point__local.register_functions(root_module)
|
gjc@3408
|
512 |
|
gjc@3408
|
513 |
root_module.end_section('ns3_module_point_to_point')
|
gjc@3408
|
514 |
root_module.begin_section('ns3_module_internet_stack')
|
gjc@3408
|
515 |
ns3_module_internet_stack.register_functions(root_module)
|
gjc@3408
|
516 |
|
gjc@3408
|
517 |
try:
|
gjc@3408
|
518 |
import ns3_module_internet_stack__local
|
gjc@3408
|
519 |
except ImportError:
|
gjc@3408
|
520 |
pass
|
gjc@3408
|
521 |
else:
|
gjc@3408
|
522 |
ns3_module_internet_stack__local.register_functions(root_module)
|
gjc@3408
|
523 |
|
gjc@3408
|
524 |
root_module.end_section('ns3_module_internet_stack')
|
gjc@3408
|
525 |
root_module.begin_section('ns3_module_wifi')
|
gjc@3408
|
526 |
ns3_module_wifi.register_functions(root_module)
|
gjc@3408
|
527 |
|
gjc@3408
|
528 |
try:
|
gjc@3408
|
529 |
import ns3_module_wifi__local
|
gjc@3408
|
530 |
except ImportError:
|
gjc@3408
|
531 |
pass
|
gjc@3408
|
532 |
else:
|
gjc@3408
|
533 |
ns3_module_wifi__local.register_functions(root_module)
|
gjc@3408
|
534 |
|
gjc@3408
|
535 |
root_module.end_section('ns3_module_wifi')
|
gjc@3408
|
536 |
root_module.begin_section('ns3_module_csma')
|
gjc@3408
|
537 |
ns3_module_csma.register_functions(root_module)
|
gjc@3408
|
538 |
|
gjc@3408
|
539 |
try:
|
gjc@3408
|
540 |
import ns3_module_csma__local
|
gjc@3408
|
541 |
except ImportError:
|
gjc@3408
|
542 |
pass
|
gjc@3408
|
543 |
else:
|
gjc@3408
|
544 |
ns3_module_csma__local.register_functions(root_module)
|
gjc@3408
|
545 |
|
gjc@3408
|
546 |
root_module.end_section('ns3_module_csma')
|
gjc@3408
|
547 |
root_module.begin_section('ns3_module_packet_sink')
|
gjc@3408
|
548 |
ns3_module_packet_sink.register_functions(root_module)
|
gjc@3408
|
549 |
|
gjc@3408
|
550 |
try:
|
gjc@3408
|
551 |
import ns3_module_packet_sink__local
|
gjc@3408
|
552 |
except ImportError:
|
gjc@3408
|
553 |
pass
|
gjc@3408
|
554 |
else:
|
gjc@3408
|
555 |
ns3_module_packet_sink__local.register_functions(root_module)
|
gjc@3408
|
556 |
|
gjc@3408
|
557 |
root_module.end_section('ns3_module_packet_sink')
|
gjc@3408
|
558 |
root_module.begin_section('ns3_module_global_routing')
|
gjc@3408
|
559 |
ns3_module_global_routing.register_functions(root_module)
|
gjc@3408
|
560 |
|
gjc@3408
|
561 |
try:
|
gjc@3408
|
562 |
import ns3_module_global_routing__local
|
gjc@3408
|
563 |
except ImportError:
|
gjc@3408
|
564 |
pass
|
gjc@3408
|
565 |
else:
|
gjc@3408
|
566 |
ns3_module_global_routing__local.register_functions(root_module)
|
gjc@3408
|
567 |
|
gjc@3408
|
568 |
root_module.end_section('ns3_module_global_routing')
|
gjc@3408
|
569 |
root_module.begin_section('ns3_module_onoff')
|
gjc@3408
|
570 |
ns3_module_onoff.register_functions(root_module)
|
gjc@3408
|
571 |
|
gjc@3408
|
572 |
try:
|
gjc@3408
|
573 |
import ns3_module_onoff__local
|
gjc@3408
|
574 |
except ImportError:
|
gjc@3408
|
575 |
pass
|
gjc@3408
|
576 |
else:
|
gjc@3408
|
577 |
ns3_module_onoff__local.register_functions(root_module)
|
gjc@3408
|
578 |
|
gjc@3408
|
579 |
root_module.end_section('ns3_module_onoff')
|
gjc@3408
|
580 |
root_module.begin_section('ns3_module_olsr')
|
gjc@3408
|
581 |
ns3_module_olsr.register_functions(root_module)
|
gjc@3408
|
582 |
|
gjc@3408
|
583 |
try:
|
gjc@3408
|
584 |
import ns3_module_olsr__local
|
gjc@3408
|
585 |
except ImportError:
|
gjc@3408
|
586 |
pass
|
gjc@3408
|
587 |
else:
|
gjc@3408
|
588 |
ns3_module_olsr__local.register_functions(root_module)
|
gjc@3408
|
589 |
|
gjc@3408
|
590 |
root_module.end_section('ns3_module_olsr')
|
gjc@3408
|
591 |
root_module.begin_section('ns3_module_udp_echo')
|
gjc@3408
|
592 |
ns3_module_udp_echo.register_functions(root_module)
|
gjc@3408
|
593 |
|
gjc@3408
|
594 |
try:
|
gjc@3408
|
595 |
import ns3_module_udp_echo__local
|
gjc@3408
|
596 |
except ImportError:
|
gjc@3408
|
597 |
pass
|
gjc@3408
|
598 |
else:
|
gjc@3408
|
599 |
ns3_module_udp_echo__local.register_functions(root_module)
|
gjc@3408
|
600 |
|
gjc@3408
|
601 |
root_module.end_section('ns3_module_udp_echo')
|
gjc@3408
|
602 |
root_module.begin_section('ns3_module_helper')
|
gjc@3408
|
603 |
ns3_module_helper.register_functions(root_module)
|
gjc@3408
|
604 |
|
gjc@3408
|
605 |
try:
|
gjc@3408
|
606 |
import ns3_module_helper__local
|
gjc@3408
|
607 |
except ImportError:
|
gjc@3408
|
608 |
pass
|
gjc@3408
|
609 |
else:
|
gjc@3408
|
610 |
ns3_module_helper__local.register_functions(root_module)
|
gjc@3408
|
611 |
|
gjc@3408
|
612 |
root_module.end_section('ns3_module_helper')
|
gjc@3408
|
613 |
register_functions_ns3_internal(module.get_submodule('internal'), root_module)
|
gjc@3408
|
614 |
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
|
gjc@3408
|
615 |
register_functions_ns3_Config(module.get_submodule('Config'), root_module)
|
gjc@3408
|
616 |
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
|
gjc@3408
|
617 |
return
|
gjc@3408
|
618 |
|
gjc@3408
|
619 |
def register_functions_ns3_internal(module, root_module):
|
gjc@3408
|
620 |
return
|
gjc@3408
|
621 |
|
gjc@3408
|
622 |
def register_functions_ns3_TimeStepPrecision(module, root_module):
|
gjc@3408
|
623 |
return
|
gjc@3408
|
624 |
|
gjc@3408
|
625 |
def register_functions_ns3_Config(module, root_module):
|
gjc@3408
|
626 |
return
|
gjc@3408
|
627 |
|
gjc@3408
|
628 |
def register_functions_ns3_olsr(module, root_module):
|
gjc@3408
|
629 |
return
|
gjc@3408
|
630 |
|
gjc@3408
|
631 |
def main():
|
gjc@3408
|
632 |
out = FileCodeSink(sys.stdout)
|
gjc@3408
|
633 |
root_module = module_init()
|
gjc@3408
|
634 |
register_types(root_module)
|
gjc@3408
|
635 |
register_methods(root_module)
|
gjc@3408
|
636 |
register_functions(root_module)
|
gjc@3408
|
637 |
write_preamble(out)
|
gjc@3408
|
638 |
root_module.generate(out)
|
gjc@3408
|
639 |
|
gjc@3408
|
640 |
if __name__ == '__main__':
|
gjc@3408
|
641 |
main()
|
gjc@3408
|
642 |
|