bug fixes
[nepi.git] / src / nepi / testbeds / ns3 / factories_metadata_v3_9.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 from nepi.util import tags
5 from nepi.util.constants import AF_INET, STATUS_NOT_STARTED, STATUS_RUNNING, \
6         STATUS_FINISHED, STATUS_UNDETERMINED
7 from nepi.util.tunchannel_impl import \
8     preconfigure_tunchannel, postconfigure_tunchannel, \
9     wait_tunchannel, create_tunchannel
10
11 wifi_standards = dict({
12     "WIFI_PHY_STANDARD_holland": 5,
13     "WIFI_PHY_STANDARD_80211p_SCH": 7,
14     "WIFI_PHY_STANDARD_80211_5Mhz": 4,
15     "WIFI_PHY_UNKNOWN": 8,
16     "WIFI_PHY_STANDARD_80211_10Mhz": 3,
17     "WIFI_PHY_STANDARD_80211g": 2,
18     "WIFI_PHY_STANDARD_80211p_CCH": 6,
19     "WIFI_PHY_STANDARD_80211a": 0,
20     "WIFI_PHY_STANDARD_80211b": 1
21 })
22
23 l4_protocols = dict({
24     "Icmpv4L4Protocol": 1,
25     "UdpL4Protocol": 17,
26     "TcpL4Protocol": 6,
27 })
28
29 service_flow_direction = dict({
30     "SF_DIRECTION_UP": 1,
31     "SF_DIRECTION_DOWN": 0,
32 })
33
34 service_flow_scheduling_type = dict ({
35     "SF_TYPE_NONE": 0,
36     "SF_TYPE_UNDEF": 1, 
37     "SF_TYPE_BE": 2,
38     "SF_TYPE_NRTPS": 3,
39     "SF_TYPE_RTPS": 4,
40     "SF_TYPE_UGS": 6, 
41     "SF_TYPE_ALL": 255
42 })
43
44 def _get_ipv4_protocol_guid(testbed_instance, node_guid):
45     # search for the Ipv4L3Protocol asociated with the device
46     protos_guids = testbed_instance.get_connected(node_guid, "protos", "node")
47     if len(protos_guids) == 0:
48         raise RuntimeError("No protocols where found for the node %d" % node_guid)
49     ipv4_guid = None
50     for proto_guid in protos_guids:
51         proto_factory_id = testbed_instance._create[proto_guid]
52         if proto_factory_id == "ns3::Ipv4L3Protocol":
53             ipv4_guid = proto_guid
54             break
55     if not ipv4_guid:
56         raise RuntimeError("No Ipv4L3Protocol associated to node %d. \
57                 can't add Ipv4 addresses" % node_guid)
58     return ipv4_guid
59
60 def _get_node_guid(testbed_instance, guid):
61     # search for the node asociated with the device
62     node_guids = testbed_instance.get_connected(guid, "node", "devs")
63     if len(node_guids) == 0:
64         raise RuntimeError("Can't instantiate interface %d outside netns \
65                 node" % guid)
66     node_guid = node_guids[0]
67     return node_guid
68
69 def _get_dev_number(testbed_instance, guid):
70     node_guid = _get_node_guid(testbed_instance, guid)
71     dev_guids = testbed_instance.get_connected(node_guid, "devs", "node")
72     interface_number = 0
73     for guid_ in dev_guids:
74         if guid_ == guid:
75             break
76         interface_number += 1
77     return interface_number
78
79 def _follow_trace(testbed_instance, guid, trace_id, filename):
80     testbed_instance.follow_trace(guid, trace_id, filename)
81     filepath = testbed_instance.trace_filepath(guid, trace_id)
82     return filepath
83
84 ### create traces functions ###
85
86 def p2pascii_trace(testbed_instance, guid, trace_id):
87     node_guid = _get_node_guid(testbed_instance, guid)
88     interface_number = _get_dev_number(testbed_instance, guid)
89     element = testbed_instance._elements[guid]
90     filename = "trace-p2p-node-%d-dev-%d.tr" % (node_guid, interface_number)
91     filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
92     helper = testbed_instance.ns3.PointToPointHelper()
93     asciiHelper = testbed_instance.ns3.AsciiTraceHelper()
94     stream = asciiHelper.CreateFileStream(filepath)
95     helper.EnableAscii(stream, element)
96
97 def p2ppcap_trace(testbed_instance, guid, trace_id):
98     node_guid = _get_node_guid(testbed_instance, guid)
99     interface_number = _get_dev_number(testbed_instance, guid)
100     element = testbed_instance._elements[guid]
101     filename = "trace-p2p-node-%d-dev-%d.pcap" % (node_guid, interface_number)
102     filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
103     helper = testbed_instance.ns3.PointToPointHelper()
104     helper.EnablePcap(filepath, element, explicitFilename = True)
105
106 def _csmapcap_trace(testbed_instance, guid, trace_id, promisc):
107     node_guid = _get_node_guid(testbed_instance, guid)
108     interface_number = _get_dev_number(testbed_instance, guid)
109     element = testbed_instance._elements[guid]
110     filename = "trace-csma-node-%d-dev-%d.pcap" % (node_guid, interface_number)
111     filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
112     helper = testbed_instance.ns3.CsmaHelper()
113     helper.EnablePcap(filepath, element, promiscuous = promisc, 
114             explicitFilename = True)
115
116 def csmapcap_trace(testbed_instance, guid, trace_id):
117     promisc = False
118     _csmapcap_trace(testbed_instance, guid, trace_id, promisc)
119
120 def csmapcap_promisc_trace(testbed_instance, guid, trace_id):
121     promisc = True
122     _csmapcap_trace(testbed_instance, guid, trace_id, promisc)
123
124 def fdpcap_trace(testbed_instance, guid, trace_id):
125     node_guid = _get_node_guid(testbed_instance, guid)
126     interface_number = _get_dev_number(testbed_instance, guid)
127     element = testbed_instance._elements[guid]
128     filename = "trace-fd-node-%d-dev-%d.pcap" % (node_guid, interface_number)
129     filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
130     helper = testbed_instance.ns3.FileDescriptorHelper()
131     helper.EnablePcap(filepath, element, explicitFilename = True)
132
133 def yanswifipcap_trace(testbed_instance, guid, trace_id):
134     dev_guid = testbed_instance.get_connected(guid, "dev", "phy")[0]
135     node_guid = _get_node_guid(testbed_instance, dev_guid)
136     interface_number = _get_dev_number(testbed_instance, dev_guid)
137     element = testbed_instance._elements[dev_guid]
138     filename = "trace-yanswifi-node-%d-dev-%d.pcap" % (node_guid, interface_number)
139     filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
140     helper = testbed_instance.ns3.YansWifiPhyHelper()
141     helper.EnablePcap(filepath, element, explicitFilename = True)
142
143 def wimaxascii_trace(testbed_instance, guid, trace_id):
144     node_guid = _get_node_guid(testbed_instance, guid)
145     interface_number = _get_dev_number(testbed_instance, guid)
146     element = testbed_instance._elements[guid]
147     filename = "trace-wimax-node-%d-dev-%d.tr" % (node_guid, interface_number)
148     filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
149     helper = testbed_instance.ns3.WimaxHelper()
150     asciiHelper = testbed_instance.ns3.AsciiTraceHelper()
151     stream = asciiHelper.CreateFileStream (filepath)
152     helper.EnableAscii(stream, element)
153     #helper.EnableLogComponents()
154
155 def wimaxpcap_trace(testbed_instance, guid, trace_id):
156     node_guid = _get_node_guid(testbed_instance, guid)
157     interface_number = _get_dev_number(testbed_instance, guid)
158     element = testbed_instance._elements[guid]
159     filename = "trace-wimax-node-%d-dev-%d.pcap" % (node_guid, interface_number)
160     filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
161     helper = testbed_instance.ns3.WimaxHelper()
162     helper.EnablePcap(filepath, element, explicitFilename = True)
163
164 def rtt_trace(testbed_instance, guid, trace_id):
165     element = testbed_instance._elements[guid]
166     helper = testbed_instance.ns3.PlotHelper()
167     prefix = "trace-app-%d" % (guid, )
168     filename = helper.GetFilenameFromSource(prefix, element, trace_id)
169     filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
170     prefix = filepath[:filepath.find(prefix)+len(prefix)]
171     helper.EnableTrace(element, trace_id, prefix, "T")
172
173 trace_functions = dict({
174     "P2PPcapTrace": p2ppcap_trace,
175     "P2PAsciiTrace": p2pascii_trace,
176     "CsmaPcapTrace": csmapcap_trace,
177     "CsmaPcapPromiscTrace": csmapcap_promisc_trace,
178     "FileDescriptorPcapTrace": fdpcap_trace,
179     "YansWifiPhyPcapTrace": yanswifipcap_trace,
180     "WimaxPcapTrace": wimaxpcap_trace,
181     "WimaxAsciiTrace": wimaxascii_trace,
182     "Rtt": rtt_trace,
183     })
184
185 ### Creation functions ###
186
187 def create_element(testbed_instance, guid):
188     element_factory = testbed_instance.ns3.ObjectFactory()
189     factory_id = testbed_instance._create[guid]
190     element_factory.SetTypeId(factory_id) 
191     construct_parameters = testbed_instance._get_construct_parameters(guid)
192     for name, value in construct_parameters.iteritems():
193         ns3_value = testbed_instance._to_ns3_value(guid, name, value)
194         element_factory.Set(name, ns3_value)
195     element = element_factory.Create()
196     testbed_instance._elements[guid] = element
197
198 def create_node(testbed_instance, guid):
199     create_element(testbed_instance, guid)
200     element = testbed_instance._elements[guid]
201     element.AggregateObject(testbed_instance.ns3.PacketSocketFactory())
202
203 def create_wifi_standard_model(testbed_instance, guid):
204     create_element(testbed_instance, guid)
205     element = testbed_instance._elements[guid]
206     parameters = testbed_instance._get_parameters(guid)
207     standard = parameters.get("Standard")
208     if not standard:
209         raise RuntimeError("No wifi standard set for %d" % guid)
210     element.ConfigureStandard(wifi_standards[standard])
211
212 def create_waypoint_mobility(testbed_instance, guid):
213     create_element(testbed_instance, guid)
214     element = testbed_instance._elements[guid]
215     parameters = testbed_instance._get_parameters(guid)
216     ns3 = testbed_instance.ns3
217     waypoints = parameters.get("WaypointList", "")
218     waypoints = waypoints.replace(" ","")
219     for swp in waypoints.split(","):
220         dwp = swp.split(":")
221         t = str(dwp[0])
222         time = ns3.Time(t)
223         pos = ns3.Vector(float(dwp[1]), float(dwp[2]), float(dwp[3]))
224         waypoint = ns3.Waypoint(time, pos)
225         element.AddWaypoint(waypoint)
226
227 def create_ipv4protocol(testbed_instance, guid):
228     create_element(testbed_instance, guid)
229     element = testbed_instance._elements[guid]
230     list_routing = testbed_instance.ns3.Ipv4ListRouting()
231     element.SetRoutingProtocol(list_routing)
232     static_routing = testbed_instance.ns3.Ipv4StaticRouting()
233     list_routing.AddRoutingProtocol(static_routing, 1)
234
235 def create_element_no_constructor(testbed_instance, guid):
236     """ Create function for ns3 classes for which 
237         TypeId.HasConstructor == False"""
238     factory_id = testbed_instance._create[guid]
239     factory_name = factory_id.replace("ns3::", "")
240     constructor = getattr(testbed_instance.ns3, factory_name)
241     element = constructor()
242     testbed_instance._elements[guid] = element
243
244 def create_base_station(testbed_instance, guid):
245     node_guid = _get_node_guid(testbed_instance, guid)
246     node = testbed_instance._elements[node_guid]
247     phy_guids = testbed_instance.get_connected(guid, "phy", "dev")
248     if len(phy_guids) == 0:
249         raise RuntimeError("No PHY was found for station %d" % guid)
250     phy = testbed_instance._elements[phy_guids[0]]
251     uplnk_guids = testbed_instance.get_connected(guid, "uplnk", "dev")
252     if len(uplnk_guids) == 0:
253         raise RuntimeError("No uplink scheduler was found for station %d" % guid)
254     uplnk = testbed_instance._elements[uplnk_guids[0]]
255     dwnlnk_guids = testbed_instance.get_connected(guid, "dwnlnk", "dev")
256     if len(dwnlnk_guids) == 0:
257         raise RuntimeError("No downlink scheduler was found for station %d" % guid)
258     dwnlnk = testbed_instance._elements[dwnlnk_guids[0]]
259     element = testbed_instance.ns3.BaseStationNetDevice(node, phy, uplnk, dwnlnk)
260     testbed_instance._elements[guid] = element
261
262 def create_subscriber_station(testbed_instance, guid):
263     node_guid = _get_node_guid(testbed_instance, guid)
264     node = testbed_instance._elements[node_guid]
265     phy_guids = testbed_instance.get_connected(guid, "phy", "dev")
266     if len(phy_guids) == 0:
267         raise RuntimeError("No PHY was found for station %d" % guid)
268     phy = testbed_instance._elements[phy_guids[0]]
269     element = testbed_instance.ns3.SubscriberStationNetDevice(node, phy)
270     element.SetModulationType(testbed_instance.ns3.WimaxPhy.MODULATION_TYPE_QAM16_12)
271     testbed_instance._elements[guid] = element
272
273 def create_wimax_channel(testbed_instance, guid):
274     element = testbed_instance.ns3.SimpleOfdmWimaxChannel(testbed_instance.ns3.SimpleOfdmWimaxChannel.COST231_PROPAGATION)
275     testbed_instance._elements[guid] = element
276
277 def create_wimax_phy(testbed_instance, guid):
278     element = testbed_instance.ns3.SimpleOfdmWimaxPhy()
279     testbed_instance._elements[guid] = element
280
281 def create_service_flow(testbed_instance, guid):
282     parameters = testbed_instance._get_parameters(guid)
283     direction = parameters.get("Direction")
284     if direction == None:
285         raise RuntimeError("No SchedulingType was found for service flow %d" % guid)
286     sched = parameters.get("SchedulingType")
287     if sched == None:
288         raise RuntimeError("No SchedulingType was found for service flow %d" % guid)
289     ServiceFlow = testbed_instance.ns3.ServiceFlow
290     direction = service_flow_direction[direction]
291     sched = service_flow_scheduling_type[sched]
292     element = ServiceFlow(direction)
293     element.SetCsSpecification(ServiceFlow.IPV4)
294     element.SetServiceSchedulingType(sched) 
295     element.SetMaxSustainedTrafficRate(100)
296     element.SetMinReservedTrafficRate(1000000)
297     element.SetMinTolerableTrafficRate(1000000)
298     element.SetMaximumLatency(100)
299     element.SetMaxTrafficBurst(2000)
300     element.SetTrafficPriority(1)
301     element.SetUnsolicitedGrantInterval(1)
302     element.SetMaxSustainedTrafficRate(70)
303     element.SetToleratedJitter(10)
304     element.SetSduSize(49)
305     element.SetRequestTransmissionPolicy(0)
306     testbed_instance._elements[guid] = element
307
308 def create_ipcs_classifier_record(testbed_instance, guid):
309     parameters = testbed_instance._get_parameters(guid)
310     src_address = parameters.get("SrcAddress")
311     if src_address == None:
312         raise RuntimeError("No SrcAddress was found for classifier %d" % guid)
313     src_address = testbed_instance.ns3.Ipv4Address(src_address)
314     src_mask = parameters.get("SrcMask")
315     if src_mask == None:
316         raise RuntimeError("No SrcMask was found for classifier %d" % guid)
317     src_mask = testbed_instance.ns3.Ipv4Mask(src_mask)
318     dst_address = parameters.get("DstAddress")
319     if dst_address == None:
320         raise RuntimeError("No Dstddress was found for classifier %d" % guid)
321     dst_address = testbed_instance.ns3.Ipv4Address(dst_address)
322     dst_mask = parameters.get("DstMask")
323     if dst_mask == None:
324         raise RuntimeError("No DstMask was found for classifier %d" % guid)
325     dst_mask = testbed_instance.ns3.Ipv4Mask(dst_mask)
326     src_port_low = parameters.get("SrcPortLow")
327     if src_port_low == None:
328         raise RuntimeError("No SrcPortLow was found for classifier %d" % guid)
329     src_port_high = parameters.get("SrcPortHigh")
330     if src_port_high == None:
331         raise RuntimeError("No SrcPortHigh was found for classifier %d" % guid)
332     dst_port_low = parameters.get("DstPortLow")
333     if dst_port_low == None:
334         raise RuntimeError("No DstPortLow was found for classifier %d" % guid)
335     dst_port_high = parameters.get("DstPortHigh")
336     if dst_port_high == None:
337         raise RuntimeError("No DstPortHigh was found for classifier %d" % guid)
338     protocol = parameters.get("Protocol")
339     if protocol == None or protocol not in l4_protocols:
340         raise RuntimeError("No Protocol was found for classifier %d" % guid)
341     priority = parameters.get("Priority")
342     if priority == None:
343         raise RuntimeError("No Priority was found for classifier %d" % guid)
344     element = testbed_instance.ns3.IpcsClassifierRecord(src_address, src_mask,
345         dst_address, dst_mask, src_port_low, src_port_high, dst_port_low, 
346         dst_port_high, l4_protocols[protocol], priority)
347     testbed_instance._elements[guid] = element
348
349 ### Start/Stop functions ###
350
351 def start_application(testbed_instance, guid):
352     element = testbed_instance.elements[guid]
353     # BUG: without doing this explicit call it doesn't start!!!
354     # Shouldn't be enough to set the StartTime?
355     element.Start()
356
357 def stop_application(testbed_instance, guid):
358     element = testbed_instance.elements[guid]
359     now = testbed_instance.ns3.Simulator.Now()
360     element.SetStopTime(now)
361
362 ### Status functions ###
363
364 def status_application(testbed_instance, guid):
365     if guid not in testbed_instance.elements.keys():
366         raise RuntimeError("Can't get status on guid %d" % guid )
367     now = testbed_instance.ns3.Simulator.Now()
368     if now.IsZero():
369         return STATUS_NOT_STARTED
370     app = testbed_instance.elements[guid]
371     parameters = testbed_instance._get_parameters(guid)
372     start_value = parameters.get("StartTime")
373     if start_value != None:
374         start_time = testbed_instance.ns3.Time(start_value)
375         if now.Compare(start_time) < 0:
376             return STATUS_NOT_STARTED
377     stop_value = parameters.get("StopTime")
378     if stop_value != None:
379         stop_time = testbed_instance.ns3.Time(stop_value)
380         if now.Compare(stop_time) < 0:
381             return STATUS_RUNNING
382         else:
383             return STATUS_FINISHED
384     return STATUS_UNDETERMINED
385
386 ### Configure functions ###
387
388 def configure_traces(testbed_instance, guid):
389     traces = testbed_instance._get_traces(guid)
390     for trace_id in traces:
391         trace_func = trace_functions[trace_id]
392         trace_func(testbed_instance, guid, trace_id)
393
394 def configure_element(testbed_instance, guid):
395     configure_traces(testbed_instance, guid)
396
397 def configure_device(testbed_instance, guid):
398     configure_traces(testbed_instance, guid)
399
400     element = testbed_instance._elements[guid]
401
402     parameters = testbed_instance._get_parameters(guid)
403     address = parameters.get("macAddress")
404     if address:
405         macaddr = testbed_instance.ns3.Mac48Address(address)
406     else:
407         macaddr = testbed_instance.ns3.Mac48Address.Allocate()
408     element.SetAddress(macaddr)
409
410     if not guid in testbed_instance._add_address:
411         return
412     # search for the node asociated with the device
413     node_guid = _get_node_guid(testbed_instance, guid)
414     node = testbed_instance.elements[node_guid]
415     # search for the Ipv4L3Protocol asociated with the device
416     ipv4_guid = _get_ipv4_protocol_guid(testbed_instance, node_guid)
417     ipv4 = testbed_instance._elements[ipv4_guid]
418     ns3 = testbed_instance.ns3
419     # add addresses 
420     addresses = testbed_instance._add_address[guid]
421     for address in addresses:
422         (address, netprefix, broadcast) = address
423         # TODO: missing IPV6 addresses!!
424         ifindex = ipv4.AddInterface(element)
425         inaddr = ns3.Ipv4InterfaceAddress(ns3.Ipv4Address(address),
426                 ns3.Ipv4Mask("/%d" % netprefix))
427         ipv4.AddAddress(ifindex, inaddr)
428         ipv4.SetMetric(ifindex, 1)
429         ipv4.SetUp(ifindex)
430
431 def _add_static_route(ns3, static_routing, 
432         address, netprefix, nexthop_address, ifindex):
433     if netprefix == 0:
434         # Default route: 0.0.0.0/0
435         static_routing.SetDefaultRoute(nexthop_address, ifindex) 
436     elif netprefix == 32:
437         # Host route: x.y.z.w/32
438         static_routing.AddHostRouteTo(address, nexthop_address, ifindex) 
439     else:
440         # Network route: x.y.z.w/n
441         mask = ns3.Ipv4Mask("/%d" % netprefix) 
442         static_routing.AddNetworkRouteTo(address, mask, nexthop_address, 
443                 ifindex) 
444
445 def _add_static_route_if(ns3, static_routing, address, netprefix, ifindex):
446     if netprefix == 0:
447         # Default route: 0.0.0.0/0
448         static_routing.SetDefaultRoute(ifindex) 
449     elif netprefix == 32:
450         # Host route: x.y.z.w/32
451         static_routing.AddHostRouteTo(address, ifindex) 
452     else:
453         # Network route: x.y.z.w/n
454         mask = ns3.Ipv4Mask("/%d" % netprefix) 
455         static_routing.AddNetworkRouteTo(address, mask, ifindex) 
456
457 def configure_node(testbed_instance, guid):
458     configure_traces(testbed_instance, guid)
459
460     element = testbed_instance._elements[guid]
461     if not guid in testbed_instance._add_route:
462         return
463     # search for the Ipv4L3Protocol asociated with the device
464     ipv4_guid = _get_ipv4_protocol_guid(testbed_instance, guid)
465     ipv4 = testbed_instance._elements[ipv4_guid]
466     list_routing = ipv4.GetRoutingProtocol()
467     (static_routing, priority) = list_routing.GetRoutingProtocol(0)
468     ns3 = testbed_instance.ns3
469     routes = testbed_instance._add_route[guid]
470     for route in routes:
471         (destination, netprefix, nexthop) = route
472         address = ns3.Ipv4Address(destination)
473         if nexthop:
474             nexthop_address = ns3.Ipv4Address(nexthop)
475             ifindex = -1
476             # TODO: HACKISH way of getting the ifindex... improve this
477             nifaces = ipv4.GetNInterfaces()
478             for ifidx in xrange(nifaces):
479                 iface = ipv4.GetInterface(ifidx)
480                 naddress = iface.GetNAddresses()
481                 for addridx in xrange(naddress):
482                     ifaddr = iface.GetAddress(addridx)
483                     ifmask = ifaddr.GetMask()
484                     ifindex = ipv4.GetInterfaceForPrefix(nexthop_address, ifmask)
485                     if ifindex == ifidx:
486                         break
487             if ifindex < 0:
488                 # Check previous ptp routes
489                 for chaindest, chainprefix, chainhop in routes:
490                     if chaindest == nexthop and chainprefix == 32:
491                         chainhop_address = ns3.Ipv4Address(chainhop)
492                         for ifidx in xrange(nifaces):
493                             iface = ipv4.GetInterface(ifidx)
494                             naddress = iface.GetNAddresses()
495                             for addridx in xrange(naddress):
496                                 ifaddr = iface.GetAddress(addridx)
497                                 ifmask = ifaddr.GetMask()
498                                 ifindex = ipv4.GetInterfaceForPrefix(chainhop_address, ifmask)
499                                 if ifindex == ifidx:
500                                     break
501             if ifindex < 0:
502                 raise RuntimeError, "Cannot associate interface for routing entry:" \
503                     "%s/%s -> %s. At node %s" % (destination, netprefix, nexthop, guid)
504             _add_static_route(ns3, static_routing, 
505                 address, netprefix, nexthop_address, ifindex)
506         else:
507             mask = ns3.Ipv4Mask("/%d" % netprefix) 
508             ifindex = ipv4.GetInterfaceForPrefix(address, mask)
509             if ifindex < 0:
510                 raise RuntimeError, "Cannot associate interface for routing entry:" \
511                     "%s/%s -> %s. At node %s" % (destination, netprefix, nexthop, guid)
512             _add_static_route_if(ns3, static_routing, 
513                 address, netprefix, nexthop_address, ifindex)
514
515 def configure_station(testbed_instance, guid):
516     configure_device(testbed_instance, guid)
517     element = testbed_instance._elements[guid]
518     element.Start()
519
520 ###  Factories  ###
521
522 factories_order = ["ns3::BasicEnergySource",
523     "ns3::WifiRadioEnergyModel",
524     "ns3::BSSchedulerRtps",
525     "ns3::BSSchedulerSimple",
526     "ns3::UdpTraceClient",
527     "ns3::UdpServer",
528     "ns3::UdpClient",
529     "ns3::FlowMonitor",
530     "ns3::Radvd",
531     "ns3::Ping6",
532     "ns3::flame::FlameProtocol",
533     "ns3::flame::FlameRtable",
534     "ns3::dot11s::AirtimeLinkMetricCalculator",
535     "ns3::dot11s::HwmpProtocol",
536     "ns3::dot11s::HwmpRtable",
537     "ns3::dot11s::PeerManagementProtocol",
538     "ns3::dot11s::PeerLink",
539     "ns3::MeshWifiInterfaceMac",
540     "ns3::MeshPointDevice",
541     "ns3::UanMacRcGw",
542     "ns3::UanMacRc",
543     "ns3::UanPhyCalcSinrDual",
544     "ns3::UanPhyPerGenDefault",
545     "ns3::UanPhyDual",
546     "ns3::UanPropModelThorp",
547     "ns3::UanMacCw",
548     "ns3::UanNoiseModelDefault",
549     "ns3::UanMacAloha",
550     "ns3::UanPropModelIdeal",
551     "ns3::UanTransducerHd",
552     "ns3::UanPhyCalcSinrDefault",
553     "ns3::UanPhyGen",
554     "ns3::UanPhyCalcSinrFhFsk",
555     "ns3::UanPhyPerUmodem",
556     "ns3::UanChannel",
557     "ns3::V4Ping",
558     "ns3::AthstatsWifiTraceSink",
559     "ns3::FlameStack",
560     "ns3::Dot11sStack",
561     "ns3::NonCommunicatingNetDevice",
562     "ns3::HalfDuplexIdealPhy",
563     "ns3::AlohaNoackNetDevice",
564     "ns3::SpectrumAnalyzer",
565     "ns3::WaveformGenerator",
566     "ns3::MultiModelSpectrumChannel",
567     "ns3::SingleModelSpectrumChannel",
568     "ns3::MsduStandardAggregator",
569     "ns3::EdcaTxopN",
570     "ns3::QstaWifiMac",
571     "ns3::QapWifiMac",
572     "ns3::QadhocWifiMac",
573     "ns3::MinstrelWifiManager",
574     "ns3::CaraWifiManager",
575     "ns3::AarfcdWifiManager",
576     "ns3::OnoeWifiManager",
577     "ns3::AmrrWifiManager",
578     "ns3::ConstantRateWifiManager",
579     "ns3::IdealWifiManager",
580     "ns3::AarfWifiManager",
581     "ns3::ArfWifiManager",
582     "ns3::WifiNetDevice",
583     "ns3::NqstaWifiMac",
584     "ns3::NqapWifiMac",
585     "ns3::AdhocWifiMac",
586     "ns3::DcaTxop",
587     "ns3::WifiMacQueue",
588     "ns3::YansWifiChannel",
589     "ns3::YansWifiPhy",
590     "ns3::NistErrorRateModel",
591     "ns3::YansErrorRateModel",
592     "ns3::WaypointMobilityModel",
593     "ns3::ConstantAccelerationMobilityModel",
594     "ns3::RandomDirection2dMobilityModel",
595     "ns3::RandomWalk2dMobilityModel",
596     "ns3::SteadyStateRandomWaypointMobilityModel",
597     "ns3::RandomWaypointMobilityModel",
598     "ns3::GaussMarkovMobilityModel",
599     "ns3::ConstantVelocityMobilityModel",
600     "ns3::ConstantPositionMobilityModel",
601     "ns3::ListPositionAllocator",
602     "ns3::GridPositionAllocator",
603     "ns3::RandomRectanglePositionAllocator",
604     "ns3::RandomBoxPositionAllocator",
605     "ns3::RandomDiscPositionAllocator",
606     "ns3::UniformDiscPositionAllocator",
607     "ns3::HierarchicalMobilityModel",
608     "ns3::aodv::RoutingProtocol",
609     "ns3::UdpEchoServer",
610     "ns3::UdpEchoClient",
611     "ns3::PacketSink",
612     "ns3::OnOffApplication",
613     "ns3::VirtualNetDevice",
614     "ns3::FileDescriptorNetDevice",
615     "ns3::Nepi::TunChannel",
616     "ns3::TapBridge",
617     "ns3::BridgeChannel",
618     "ns3::BridgeNetDevice",
619     "ns3::EmuNetDevice",
620     "ns3::CsmaChannel",
621     "ns3::CsmaNetDevice",
622     "ns3::PointToPointRemoteChannel",
623     "ns3::PointToPointChannel",
624     "ns3::PointToPointNetDevice",
625     "ns3::NscTcpL4Protocol",
626     "ns3::Icmpv6L4Protocol",
627     "ns3::Ipv6OptionPad1",
628     "ns3::Ipv6OptionPadn",
629     "ns3::Ipv6OptionJumbogram",
630     "ns3::Ipv6OptionRouterAlert",
631     "ns3::Ipv6ExtensionHopByHop",
632     "ns3::Ipv6ExtensionDestination",
633     "ns3::Ipv6ExtensionFragment",
634     "ns3::Ipv6ExtensionRouting",
635     "ns3::Ipv6ExtensionLooseRouting",
636     "ns3::Ipv6ExtensionESP",
637     "ns3::Ipv6ExtensionAH",
638     "ns3::Ipv6L3Protocol",
639     "ns3::LoopbackNetDevice",
640     "ns3::Icmpv4L4Protocol",
641     "ns3::RttMeanDeviation",
642     "ns3::ArpL3Protocol",
643     "ns3::TcpL4Protocol",
644     "ns3::UdpL4Protocol",
645     "ns3::Ipv4L3Protocol",
646     "ns3::SimpleNetDevice",
647     "ns3::SimpleChannel",
648     "ns3::PacketSocket",
649     "ns3::DropTailQueue",
650     "ns3::Node",
651     "ns3::FriisSpectrumPropagationLossModel",
652     "ns3::Cost231PropagationLossModel",
653     "ns3::JakesPropagationLossModel",
654     "ns3::RandomPropagationLossModel",
655     "ns3::FriisPropagationLossModel",
656     "ns3::TwoRayGroundPropagationLossModel",
657     "ns3::LogDistancePropagationLossModel",
658     "ns3::ThreeLogDistancePropagationLossModel",
659     "ns3::NakagamiPropagationLossModel",
660     "ns3::FixedRssLossModel",
661     "ns3::MatrixPropagationLossModel",
662     "ns3::RangePropagationLossModel",
663     "ns3::RandomPropagationDelayModel",
664     "ns3::ConstantSpeedPropagationDelayModel",
665     "ns3::RateErrorModel",
666     "ns3::ListErrorModel",
667     "ns3::ReceiveListErrorModel",
668     "ns3::PacketBurst",
669     "ns3::EnergySourceContainer",
670     "ns3::BSSchedulerRtps",
671     "ns3::BSSchedulerSimple",
672     "ns3::SimpleOfdmWimaxChannel",
673     "ns3::SimpleOfdmWimaxPhy",
674     "ns3::UplinkSchedulerMBQoS",
675     "ns3::UplinkSchedulerRtps",
676     "ns3::UplinkSchedulerSimple",
677     "ns3::IpcsClassifierRecord",
678     "ns3::ServiceFlow",
679     "ns3::BaseStationNetDevice",
680     "ns3::SubscriberStationNetDevice",
681  ]
682
683 factories_info = dict({
684     "ns3::Ping6": dict({
685         "category": "Application",
686         "create_function": create_element,
687         "configure_function": configure_element,
688         "help": "",
689         "connector_types": [],
690         "stop_function": stop_application,
691         "start_function": start_application,
692         "status_function": status_application,
693         "box_attributes": ["MaxPackets",
694             "Interval",
695             "RemoteIpv6",
696             "LocalIpv6",
697             "PacketSize",
698             "StartTime",
699             "StopTime"],
700     }),
701      "ns3::UdpL4Protocol": dict({
702         "category": "Protocol",
703         "create_function": create_element,
704         "configure_function": configure_element,
705         "help": "",
706         "connector_types": ["node"],
707         "box_attributes": ["ProtocolNumber"],
708     }),
709      "ns3::RandomDiscPositionAllocator": dict({
710         "category": "Mobility",
711         "create_function": create_element,
712         "configure_function": configure_element,
713         "help": "",
714         "connector_types": [],
715         "box_attributes": ["Theta",
716             "Rho",
717             "X",
718             "Y"],
719         "tags": [tags.MOBILE],
720     }),
721      "ns3::Node": dict({
722         "category": "Node",
723         "create_function": create_node,
724         "configure_function": configure_node,
725         "help": "",
726         "connector_types": ["devs", "apps", "protos", "mobility"],
727         "allow_routes": True,
728         "box_attributes": [],
729     }),
730      "ns3::GridPositionAllocator": dict({
731         "category": "Mobility",
732         "create_function": create_element,
733         "configure_function": configure_element,
734         "help": "",
735         "connector_types": [],
736         "box_attributes": ["GridWidth",
737             "MinX",
738             "MinY",
739             "DeltaX",
740             "DeltaY",
741             "LayoutType"],
742         "tags": [tags.MOBILE],
743     }),
744      "ns3::TapBridge": dict({
745         "category": "Device",
746         "create_function": create_element,
747         "configure_function": configure_element,
748         "help": "",
749         "connector_types": [],
750         "allow_addresses": True,
751         "box_attributes": ["Mtu",
752             "DeviceName",
753             "Gateway",
754             "IpAddress",
755             "MacAddress",
756             "Netmask",
757             "Start",
758             "Stop"],
759     }),
760      "ns3::FlowMonitor": dict({
761         "category": "",
762         "create_function": create_element,
763         "configure_function": configure_element,
764         "help": "",
765         "connector_types": [],
766         "box_attributes": ["MaxPerHopDelay",
767             "DelayBinWidth",
768             "JitterBinWidth",
769             "PacketSizeBinWidth",
770             "FlowInterruptionsBinWidth",
771             "FlowInterruptionsMinTime"],
772     }),
773      "ns3::ConstantVelocityMobilityModel": dict({
774         "category": "Mobility",
775         "create_function": create_element,
776         "configure_function": configure_element,
777         "help": "",
778         "connector_types": ["node"],
779         "box_attributes": ["Position",
780            "Velocity"],
781         "tags": [tags.MOBILE],
782     }),
783      "ns3::V4Ping": dict({
784         "category": "Application",
785         "create_function": create_element,
786         "configure_function": configure_element,
787         "help": "",
788         "connector_types": ["node"],
789         "stop_function": stop_application,
790         "start_function": start_application,
791         "status_function": status_application,
792         "box_attributes": ["Remote",
793             "Verbose",
794             "Interval",
795             "Size",
796             "StartTime",
797             "StopTime"],
798         "traces": ["rtt"],
799     }),
800      "ns3::dot11s::PeerLink": dict({
801         "category": "",
802         "create_function": create_element,
803         "configure_function": configure_element,
804         "help": "",
805         "connector_types": [],
806         "box_attributes": ["RetryTimeout",
807             "HoldingTimeout",
808             "ConfirmTimeout",
809             "MaxRetries",
810             "MaxBeaconLoss",
811             "MaxPacketFailure"],
812     }),
813      "ns3::PointToPointNetDevice": dict({
814         "category": "Device",
815         "create_function": create_element,
816         "configure_function": configure_device,
817         "help": "",
818         "connector_types": ["node", "err", "queue", "chan"],
819         "allow_addresses": True,
820         "box_attributes": ["Mtu",
821             "Address",
822             "DataRate",
823             "InterframeGap"],
824         "traces": ["p2ppcap", "p2pascii"]
825     }),
826      "ns3::NakagamiPropagationLossModel": dict({
827         "category": "Loss",
828         "create_function": create_element,
829         "configure_function": configure_element,
830         "help": "",
831         "connector_types": [],
832         "box_attributes": ["Distance1",
833             "Distance2",
834             "m0",
835             "m1",
836             "m2"],
837     }),
838      "ns3::AarfWifiManager": dict({
839         "category": "Manager",
840         "create_function": create_element,
841         "configure_function": configure_element,
842         "help": "",
843         "connector_types": [],
844         "box_attributes": ["SuccessK",
845             "TimerK",
846             "MaxSuccessThreshold",
847             "MinTimerThreshold",
848             "MinSuccessThreshold",
849             "IsLowLatency",
850             "MaxSsrc",
851             "MaxSlrc",
852             "RtsCtsThreshold",
853             "FragmentationThreshold",
854             "NonUnicastMode"],
855     }),
856      "ns3::Ipv6OptionJumbogram": dict({
857         "category": "",
858         "create_function": create_element,
859         "configure_function": configure_element,
860         "help": "",
861         "connector_types": [],
862         "box_attributes": ["OptionNumber"],
863     }),
864      "ns3::TwoRayGroundPropagationLossModel": dict({
865         "category": "Loss",
866         "create_function": create_element,
867         "configure_function": configure_element,
868         "help": "",
869         "connector_types": [],
870         "box_attributes": ["Lambda",
871             "SystemLoss",
872             "MinDistance",
873             "HeightAboveZ"],
874     }),
875      "ns3::OnOffApplication": dict({
876         "category": "Application",
877         "create_function": create_element,
878         "configure_function": configure_element,
879         "help": "",
880         "connector_types": ["node"],
881         "stop_function": stop_application,
882         "start_function": start_application,
883         "status_function": status_application,
884         "box_attributes": ["DataRate",
885             "PacketSize",
886             "Remote",
887             "OnTime",
888             "OffTime",
889             "MaxBytes",
890             "Protocol",
891             "StartTime",
892             "StopTime"],
893     }),
894      "ns3::AdhocWifiMac": dict({
895         "category": "Mac",
896         "create_function": create_element,
897         "configure_function": configure_element,
898         "help": "",
899         "connector_types": [],
900         "box_attributes": ["CtsTimeout",
901             "AckTimeout",
902             "BasicBlockAckTimeout",
903             "CompressedBlockAckTimeout",
904             "Sifs",
905             "EifsNoDifs",
906             "Slot",
907             "Pifs",
908             "MaxPropagationDelay",
909             "Ssid"],
910     }),
911      "ns3::ConstantAccelerationMobilityModel": dict({
912         "category": "Mobility",
913         "create_function": create_element,
914         "configure_function": configure_element,
915         "help": "",
916         "connector_types": ["node"],
917         "box_attributes": ["Position",
918             "Velocity"],
919         "tags": [tags.MOBILE],
920     }),
921      "ns3::GaussMarkovMobilityModel": dict({
922         "category": "Mobility",
923         "create_function": create_element,
924         "configure_function": configure_element,
925         "help": "",
926         "connector_types": [],
927         "box_attributes": ["Bounds",
928             "TimeStep",
929             "Alpha",
930             "MeanVelocity",
931             "MeanDirection",
932             "MeanPitch",
933             "NormalVelocity",
934             "NormalDirection",
935             "NormalPitch",
936             "Position",
937             "Velocity"],
938         "tags": [tags.MOBILE],
939     }),
940      "ns3::dot11s::HwmpProtocol": dict({
941         "category": "Protocol",
942         "create_function": create_element,
943         "configure_function": configure_element,
944         "help": "",
945         "connector_types": [],
946         "box_attributes": ["RandomStart",
947             "MaxQueueSize",
948             "Dot11MeshHWMPmaxPREQretries",
949             "Dot11MeshHWMPnetDiameterTraversalTime",
950             "Dot11MeshHWMPpreqMinInterval",
951             "Dot11MeshHWMPperrMinInterval",
952             "Dot11MeshHWMPactiveRootTimeout",
953             "Dot11MeshHWMPactivePathTimeout",
954             "Dot11MeshHWMPpathToRootInterval",
955             "Dot11MeshHWMPrannInterval",
956             "MaxTtl",
957             "UnicastPerrThreshold",
958             "UnicastPreqThreshold",
959             "UnicastDataThreshold",
960             "DoFlag",
961             "RfFlag"],
962     }),
963      "ns3::NscTcpL4Protocol": dict({
964         "category": "Protocol",
965         "create_function": create_element,
966         "configure_function": configure_element,
967         "help": "",
968         "connector_types": [],
969         "box_attributes": ["Library",
970           "ProtocolNumber"],
971     }),
972      "ns3::dot11s::AirtimeLinkMetricCalculator": dict({
973         "category": "",
974         "create_function": create_element,
975         "configure_function": configure_element,
976         "help": "",
977         "connector_types": [],
978         "box_attributes": ["Dot11sMeshHeaderLength"],
979     }),
980      "ns3::UanMacCw": dict({
981         "category": "",
982         "create_function": create_element,
983         "configure_function": configure_element,
984         "help": "",
985         "connector_types": [],
986         "box_attributes": ["CW",
987            "SlotTime"],
988     }),
989      "ns3::AthstatsWifiTraceSink": dict({
990         "category": "",
991         "create_function": create_element,
992         "configure_function": configure_element,
993         "help": "",
994         "connector_types": [],
995         "box_attributes": ["Interval"],
996     }),
997      "ns3::FlameStack": dict({
998         "category": "",
999         "create_function": create_element,
1000         "configure_function": configure_element,
1001         "help": "",
1002         "connector_types": [],
1003         "box_attributes": [],
1004     }),
1005      "ns3::UanMacRc": dict({
1006         "category": "",
1007         "create_function": create_element,
1008         "configure_function": configure_element,
1009         "help": "",
1010         "connector_types": [],
1011         "box_attributes": ["RetryRate",
1012             "MaxFrames",
1013             "QueueLimit",
1014             "SIFS",
1015             "NumberOfRates",
1016             "MinRetryRate",
1017             "RetryStep",
1018             "NumberOfRetryRates",
1019             "MaxPropDelay"],
1020     }),
1021      "ns3::WaypointMobilityModel": dict({
1022         "category": "Mobility",
1023         "create_function": create_waypoint_mobility,
1024         "configure_function": configure_element,
1025         "help": "Waypoint-based mobility model.",
1026         "connector_types": ["node"],
1027         "box_attributes": ["WaypointsLeft",
1028             "Position",
1029             "Velocity",
1030             "WaypointList"],
1031         "tags": [tags.MOBILE],
1032     }),
1033      "ns3::FileDescriptorNetDevice": dict({
1034         "category": "Device",
1035         "create_function": create_element,
1036         "configure_function": configure_device,
1037         "help": "Network interface associated to a file descriptor",
1038         "connector_types": ["node", "->fd"],
1039         "allow_addresses": True,
1040         "box_attributes": ["Address", 
1041             "LinuxSocketAddress",
1042             "tun_proto", "tun_addr", "tun_port", "tun_key"],
1043         "traces": ["fdpcap"]
1044     }),
1045      "ns3::Nepi::TunChannel": dict({
1046         "category": "Channel",
1047         "create_function": create_tunchannel,
1048         "preconfigure_function": preconfigure_tunchannel,
1049         "configure_function": postconfigure_tunchannel,
1050         "start_function": wait_tunchannel,
1051         "help": "Channel to forward FileDescriptorNetDevice data to "
1052                 "other TAP interfaces supporting the NEPI tunneling protocol.",
1053         "connector_types": ["fd->", "udp", "tcp"],
1054         "allow_addresses": False,
1055         "box_attributes": ["tun_proto", "tun_addr", "tun_port", "tun_key"]
1056     }),
1057      "ns3::CsmaNetDevice": dict({
1058         "category": "Device",
1059         "create_function": create_element,
1060         "configure_function": configure_device,
1061         "help": "CSMA (carrier sense, multiple access) interface",
1062         "connector_types": ["node", "chan", "err", "queue"],
1063         "allow_addresses": True,
1064         "box_attributes": ["Address",
1065             "Mtu",
1066             "SendEnable",
1067             "ReceiveEnable"],
1068         "traces": ["csmapcap", "csmapcap_promisc"]
1069     }),
1070      "ns3::UanPropModelThorp": dict({
1071         "category": "",
1072         "create_function": create_element,
1073         "configure_function": configure_element,
1074         "help": "",
1075         "connector_types": [],
1076         "box_attributes": ["SpreadCoef"],
1077     }),
1078      "ns3::NqstaWifiMac": dict({
1079         "category": "Mac",
1080         "create_function": create_wifi_standard_model,
1081         "configure_function": configure_element,
1082         "help": "",
1083         "connector_types": ["dev"],
1084         "box_attributes": ["ProbeRequestTimeout",
1085             "AssocRequestTimeout",
1086             "MaxMissedBeacons",
1087             "CtsTimeout",
1088             "AckTimeout",
1089             "BasicBlockAckTimeout",
1090             "CompressedBlockAckTimeout",
1091             "Sifs",
1092             "EifsNoDifs",
1093             "Slot",
1094             "Pifs",
1095             "MaxPropagationDelay",
1096             "Ssid"],
1097     }),
1098      "ns3::Icmpv6L4Protocol": dict({
1099         "category": "Protocol",
1100         "create_function": create_element,
1101         "configure_function": configure_element,
1102         "help": "",
1103         "connector_types": ["node"],
1104         "box_attributes": ["DAD",
1105             "ProtocolNumber"],
1106     }),
1107      "ns3::SimpleNetDevice": dict({
1108         "category": "Device",
1109         "create_function": create_element,
1110         "configure_function": configure_element,
1111         "help": "",
1112         "connector_types": ["node", "chan"],
1113         "allow_addresses": True,
1114         "box_attributes": [],
1115     }),
1116      "ns3::FriisPropagationLossModel": dict({
1117         "category": "Loss",
1118         "create_function": create_element,
1119         "configure_function": configure_element,
1120         "help": "",
1121         "connector_types": [],
1122         "box_attributes": ["Lambda",
1123             "SystemLoss",
1124             "MinDistance"],
1125     }),
1126      "ns3::Ipv6OptionRouterAlert": dict({
1127         "category": "",
1128         "create_function": create_element,
1129         "configure_function": configure_element,
1130         "help": "",
1131         "connector_types": [],
1132         "box_attributes": ["OptionNumber"],
1133     }),
1134      "ns3::UniformDiscPositionAllocator": dict({
1135         "category": "Mobility",
1136         "create_function": create_element,
1137         "configure_function": configure_element,
1138         "help": "",
1139         "connector_types": [],
1140         "box_attributes": ["rho",
1141             "X",
1142             "Y"],
1143         "tags": [tags.MOBILE],
1144     }),
1145      "ns3::RandomBoxPositionAllocator": dict({
1146         "category": "Mobility",
1147         "create_function": create_element,
1148         "configure_function": configure_element,
1149         "help": "",
1150         "connector_types": [],
1151         "box_attributes": ["X",
1152             "Y",
1153             "Z"],
1154         "tags": [tags.MOBILE],
1155     }),
1156      "ns3::Ipv6ExtensionDestination": dict({
1157         "category": "",
1158         "create_function": create_element,
1159         "configure_function": configure_element,
1160         "help": "",
1161         "connector_types": [],
1162         "box_attributes": ["ExtensionNumber"],
1163     }),
1164      "ns3::LoopbackNetDevice": dict({
1165         "category": "Device",
1166         "create_function": create_element,
1167         "configure_function": configure_element,
1168         "help": "",
1169         "connector_types": [],
1170         "box_attributes": [],
1171     }),
1172      "ns3::ConstantSpeedPropagationDelayModel": dict({
1173         "category": "Delay",
1174         "create_function": create_element,
1175         "configure_function": configure_element,
1176         "help": "",
1177         "connector_types": ["chan"],
1178         "box_attributes": ["Speed"],
1179     }),
1180      "ns3::Ipv6ExtensionHopByHop": dict({
1181         "category": "",
1182         "create_function": create_element,
1183         "configure_function": configure_element,
1184         "help": "",
1185         "connector_types": [],
1186         "box_attributes": ["ExtensionNumber"],
1187     }),
1188      "ns3::BridgeChannel": dict({
1189         "category": "Channel",
1190         "create_function": create_element,
1191         "configure_function": configure_element,
1192         "help": "",
1193         "connector_types": [],
1194         "box_attributes": [],
1195     }),
1196      "ns3::Radvd": dict({
1197         "category": "",
1198         "create_function": create_element,
1199         "configure_function": configure_element,
1200         "help": "",
1201         "connector_types": [],
1202         "box_attributes": ["StartTime",
1203             "StopTime"],
1204     }),
1205      "ns3::PacketSocket": dict({
1206         "category": "",
1207         "create_function": create_element,
1208         "configure_function": configure_element,
1209         "help": "",
1210         "connector_types": [],
1211         "box_attributes": ["RcvBufSize"],
1212     }),
1213      "ns3::flame::FlameProtocol": dict({
1214         "category": "Protocol",
1215         "create_function": create_element,
1216         "configure_function": configure_element,
1217         "help": "",
1218         "connector_types": [],
1219         "box_attributes": ["BroadcastInterval",
1220             "MaxCost"],
1221     }),
1222      "ns3::Cost231PropagationLossModel": dict({
1223         "category": "Loss",
1224         "create_function": create_element,
1225         "configure_function": configure_element,
1226         "help": "",
1227         "connector_types": [],
1228         "box_attributes": ["Lambda",
1229             "Frequency",
1230             "BSAntennaHeight",
1231             "SSAntennaHeight",
1232             "MinDistance"],
1233     }),
1234      "ns3::Ipv6ExtensionESP": dict({
1235         "category": "",
1236         "create_function": create_element,
1237         "configure_function": configure_element,
1238         "help": "",
1239         "connector_types": [],
1240         "box_attributes": ["ExtensionNumber"],
1241     }),
1242      "ns3::CaraWifiManager": dict({
1243         "category": "Manager",
1244         "create_function": create_element,
1245         "configure_function": configure_element,
1246         "help": "",
1247         "connector_types": [],
1248         "box_attributes": ["ProbeThreshold",
1249             "FailureThreshold",
1250             "SuccessThreshold",
1251             "Timeout",
1252             "IsLowLatency",
1253             "MaxSsrc",
1254             "MaxSlrc",
1255             "RtsCtsThreshold",
1256             "FragmentationThreshold",
1257             "NonUnicastMode"],
1258     
1259     }),
1260      "ns3::RttMeanDeviation": dict({
1261         "category": "",
1262         "create_function": create_element,
1263         "configure_function": configure_element,
1264         "help": "",
1265         "connector_types": [],
1266         "box_attributes": ["Gain",
1267             "MaxMultiplier",
1268             "InitialEstimation",
1269             "MinRTO"],
1270     }),
1271      "ns3::Icmpv4L4Protocol": dict({
1272         "category": "Protocol",
1273         "create_function": create_element,
1274         "configure_function": configure_element,
1275         "help": "",
1276         "connector_types": ["node"],
1277         "box_attributes": ["ProtocolNumber"],
1278     }),
1279      "ns3::WaveformGenerator": dict({
1280         "category": "",
1281         "create_function": create_element,
1282         "configure_function": configure_element,
1283         "help": "",
1284         "connector_types": [],
1285         "box_attributes": ["Period",
1286             "DutyCycle"],
1287     }),
1288      "ns3::YansWifiChannel": dict({
1289         "category": "Channel",
1290         "create_function": create_element,
1291         "configure_function": configure_element,
1292         "help": "",
1293         "connector_types": ["phys", "delay", "loss"],
1294         "box_attributes": [],
1295     }),
1296      "ns3::SimpleChannel": dict({
1297         "category": "Channel",
1298         "create_function": create_element,
1299         "configure_function": configure_element,
1300         "help": "",
1301         "connector_types": ["devs"],
1302         "box_attributes": [],
1303     }),
1304      "ns3::Ipv6ExtensionFragment": dict({
1305         "category": "",
1306         "create_function": create_element,
1307         "configure_function": configure_element,
1308         "help": "",
1309         "connector_types": [],
1310         "box_attributes": ["ExtensionNumber"],
1311     }),
1312      "ns3::Dot11sStack": dict({
1313         "category": "",
1314         "create_function": create_element,
1315         "configure_function": configure_element,
1316         "help": "",
1317         "connector_types": [],
1318         "box_attributes": ["Root"],
1319     }),
1320      "ns3::FriisSpectrumPropagationLossModel": dict({
1321         "category": "Loss",
1322         "create_function": create_element,
1323         "configure_function": configure_element,
1324         "help": "",
1325         "connector_types": [],
1326         "box_attributes": [],
1327     }),
1328      "ns3::RandomRectanglePositionAllocator": dict({
1329         "category": "Mobility",
1330         "create_function": create_element,
1331         "configure_function": configure_element,
1332         "help": "",
1333         "connector_types": [],
1334         "box_attributes": ["X",
1335            "Y"],
1336         "tags": [tags.MOBILE],
1337     }),
1338      "ns3::NqapWifiMac": dict({
1339         "category": "Mac",
1340         "create_function": create_wifi_standard_model,
1341         "configure_function": configure_element,
1342         "help": "",
1343         "connector_types": ["dev"],
1344         "box_attributes": ["BeaconInterval",
1345             "BeaconGeneration",
1346             "CtsTimeout",
1347             "AckTimeout",
1348             "BasicBlockAckTimeout",
1349             "CompressedBlockAckTimeout",
1350             "Sifs",
1351             "EifsNoDifs",
1352             "Slot",
1353             "Pifs",
1354             "MaxPropagationDelay",
1355             "Ssid"],
1356     }),
1357      "ns3::HierarchicalMobilityModel": dict({
1358         "category": "Mobility",
1359         "create_function": create_element,
1360         "configure_function": configure_element,
1361         "help": "",
1362         "connector_types": ["node"],
1363         "box_attributes": ["Position",
1364             "Velocity"],
1365         "tags": [tags.MOBILE],
1366     }),
1367      "ns3::ThreeLogDistancePropagationLossModel": dict({
1368         "category": "Loss",
1369         "create_function": create_element,
1370         "configure_function": configure_element,
1371         "help": "",
1372         "connector_types": [],
1373         "box_attributes": ["Distance0",
1374             "Distance1",
1375             "Distance2",
1376             "Exponent0",
1377             "Exponent1",
1378             "Exponent2",
1379             "ReferenceLoss"],
1380     }),
1381      "ns3::UanNoiseModelDefault": dict({
1382         "category": "",
1383         "create_function": create_element,
1384         "configure_function": configure_element,
1385         "help": "",
1386         "connector_types": [],
1387         "box_attributes": ["Wind",
1388             "Shipping"],
1389     }),
1390      "ns3::dot11s::HwmpRtable": dict({
1391         "category": "",
1392         "create_function": create_element,
1393         "configure_function": configure_element,
1394         "help": "",
1395         "connector_types": [],
1396         "box_attributes": [],
1397     }),
1398      "ns3::PacketBurst": dict({
1399         "category": "",
1400         "create_function": create_element,
1401         "configure_function": configure_element,
1402         "help": "",
1403         "connector_types": [],
1404         "box_attributes": [],
1405     }),
1406      "ns3::RandomPropagationDelayModel": dict({
1407         "category": "Delay",
1408         "create_function": create_element,
1409         "configure_function": configure_element,
1410         "help": "",
1411         "connector_types": [],
1412         "box_attributes": ["Variable"],
1413     }),
1414      "ns3::ArpL3Protocol": dict({
1415         "category": "Protocol",
1416         "create_function": create_element,
1417         "configure_function": configure_element,
1418         "help": "",
1419         "connector_types": ["node"],
1420         "box_attributes": [],
1421     }),
1422      "ns3::SteadyStateRandomWaypointMobilityModel": dict({
1423         "category": "Mobility",
1424         "create_function": create_element,
1425         "configure_function": configure_element,
1426         "help": "",
1427         "connector_types": [],
1428         "box_attributes": ["MinSpeed",
1429             "MaxSpeed",
1430             "MinPause",
1431             "MaxPause",
1432             "MinX",
1433             "MaxX",
1434             "MinY",
1435             "MaxY",
1436             "Position",
1437             "Velocity"],
1438         "tags": [tags.MOBILE],
1439     }),
1440      "ns3::BaseStationNetDevice": dict({
1441         "category": "Device",
1442         "create_function": create_base_station,
1443         "configure_function": configure_station,
1444         "help": "Base station for wireless mobile network",
1445         "connector_types": ["node", "chan", "phy", "uplnk", "dwnlnk"],
1446         "allow_addresses": True,
1447         "box_attributes": ["InitialRangInterval",
1448             "DcdInterval",
1449             "UcdInterval",
1450             "IntervalT8",
1451             "RangReqOppSize",
1452             "BwReqOppSize",
1453             "MaxRangCorrectionRetries",
1454             "Mtu",
1455             "RTG",
1456             "TTG"],
1457         "traces": ["wimaxpcap", "wimaxascii"],
1458     }),
1459      "ns3::UdpServer": dict({
1460         "category": "Application",
1461         "create_function": create_element,
1462         "configure_function": configure_element,
1463         "help": "",
1464         "connector_types": ["node"],
1465         "stop_function": stop_application,
1466         "start_function": start_application,
1467         "status_function": status_application,
1468         "box_attributes": ["Port",
1469             "PacketWindowSize",
1470             "StartTime",
1471             "StopTime"],
1472     }),
1473      "ns3::AarfcdWifiManager": dict({
1474         "category": "Manager",
1475         "create_function": create_element,
1476         "configure_function": configure_element,
1477         "help": "",
1478         "connector_types": [],
1479         "box_attributes": ["SuccessK",
1480             "TimerK",
1481             "MaxSuccessThreshold",
1482             "MinTimerThreshold",
1483             "MinSuccessThreshold",
1484             "MinRtsWnd",
1485             "MaxRtsWnd",
1486             "TurnOffRtsAfterRateDecrease",
1487             "TurnOnRtsAfterRateIncrease",
1488             "IsLowLatency",
1489             "MaxSsrc",
1490             "MaxSlrc",
1491             "RtsCtsThreshold",
1492             "FragmentationThreshold",
1493             "NonUnicastMode"],
1494     }),
1495      "ns3::UanTransducerHd": dict({
1496         "category": "",
1497         "create_function": create_element,
1498         "configure_function": configure_element,
1499         "help": "",
1500         "connector_types": [],
1501         "box_attributes": [],
1502     }),
1503      "ns3::LogDistancePropagationLossModel": dict({
1504         "category": "Loss",
1505         "create_function": create_element,
1506         "configure_function": configure_element,
1507         "help": "",
1508         "connector_types": ["prev", "next"],
1509         "box_attributes": ["Exponent",
1510             "ReferenceDistance",
1511             "ReferenceLoss"],
1512     }),
1513      "ns3::EmuNetDevice": dict({
1514         "category": "Device",
1515         "create_function": create_element,
1516         "configure_function": configure_element,
1517         "help": "",
1518         "connector_types": ["node", "queue"],
1519         "box_attributes": ["Mtu",
1520             "Address",
1521             "DeviceName",
1522             "Start",
1523             "Stop",
1524             "RxQueueSize"],
1525     }),
1526      "ns3::Ipv6ExtensionLooseRouting": dict({
1527         "category": "Routing",
1528         "create_function": create_element,
1529         "configure_function": configure_element,
1530         "help": "",
1531         "connector_types": [],
1532         "box_attributes": ["ExtensionNumber"],
1533     }),
1534      "ns3::RandomWaypointMobilityModel": dict({
1535         "category": "Mobility",
1536         "create_function": create_element,
1537         "configure_function": configure_element,
1538         "help": "",
1539         "connector_types": ["node"],
1540         "box_attributes": ["Speed",
1541             "Pause",
1542             "Position",
1543             "Velocity"],
1544         "tags": [tags.MOBILE],
1545     }),
1546      "ns3::RangePropagationLossModel": dict({
1547         "category": "Loss",
1548         "create_function": create_element,
1549         "configure_function": configure_element,
1550         "help": "",
1551         "connector_types": [],
1552         "box_attributes": ["MaxRange"],
1553     }),
1554      "ns3::AlohaNoackNetDevice": dict({
1555         "category": "Device",
1556         "create_function": create_element,
1557         "configure_function": configure_element,
1558         "help": "",
1559         "connector_types": [],
1560         "box_attributes": ["Address",
1561             "Mtu"],
1562     }),
1563      "ns3::MatrixPropagationLossModel": dict({
1564         "category": "Loss",
1565         "create_function": create_element,
1566         "configure_function": configure_element,
1567         "help": "",
1568         "connector_types": [],
1569         "box_attributes": ["DefaultLoss"],
1570     }),
1571      "ns3::WifiNetDevice": dict({
1572         "category": "Device",
1573         "create_function": create_element,
1574         "configure_function": configure_device,
1575         "help": "",
1576         "connector_types": ["node", "mac", "phy", "manager"],
1577         "allow_addresses": True,
1578         "box_attributes": ["Mtu"],
1579     }),
1580      "ns3::CsmaChannel": dict({
1581         "category": "Channel",
1582         "create_function": create_element,
1583         "configure_function": configure_element,
1584         "help": "",
1585         "connector_types": ["devs"],
1586         "box_attributes": ["DataRate",
1587             "Delay"],
1588     }),
1589      "ns3::BridgeNetDevice": dict({
1590         "category": "Device",
1591         "create_function": create_element,
1592         "configure_function": configure_element,
1593         "help": "",
1594         "connector_types": ["node"],
1595         "allow_addresses": True,
1596         "box_attributes": ["Mtu",
1597            "EnableLearning",
1598            "ExpirationTime"],
1599     }),
1600      "ns3::Ipv6ExtensionRouting": dict({
1601         "category": "Routing",
1602         "create_function": create_element,
1603         "configure_function": configure_element,
1604         "help": "",
1605         "connector_types": [],
1606         "box_attributes": ["ExtensionNumber"],
1607     }),
1608      "ns3::QstaWifiMac": dict({
1609         "category": "Mac",
1610         "create_function": create_wifi_standard_model,
1611         "configure_function": configure_element,
1612         "help": "Station Wifi MAC Model",
1613         "connector_types": ["dev"],
1614         "box_attributes": ["ProbeRequestTimeout",
1615             "AssocRequestTimeout",
1616             "MaxMissedBeacons",
1617             "CtsTimeout",
1618             "AckTimeout",
1619             "BasicBlockAckTimeout",
1620             "CompressedBlockAckTimeout",
1621             "Sifs",
1622             "EifsNoDifs",
1623             "Slot",
1624             "Pifs",
1625             "MaxPropagationDelay",
1626             "Ssid",
1627             "Standard"],
1628     }),
1629      "ns3::UdpEchoClient": dict({
1630         "category": "Application",
1631         "create_function": create_element,
1632         "configure_function": configure_element,
1633         "help": "",
1634         "connector_types": ["node"],
1635         "stop_function": stop_application,
1636         "start_function": start_application,
1637         "status_function": status_application,
1638         "box_attributes": ["MaxPackets",
1639             "Interval",
1640             "RemoteAddress",
1641             "RemotePort",
1642             "PacketSize",
1643             "StartTime",
1644             "StopTime"],
1645     }),
1646      "ns3::UdpClient": dict({
1647         "category": "Application",
1648         "create_function": create_element,
1649         "configure_function": configure_element,
1650         "help": "",
1651         "connector_types": ["node"],
1652         "stop_function": stop_application,
1653         "start_function": start_application,
1654         "status_function": status_application,
1655         "box_attributes": ["MaxPackets",
1656             "Interval",
1657             "RemoteAddress",
1658             "RemotePort",
1659             "PacketSize",
1660             "StartTime",
1661             "StopTime"],
1662     }),
1663      "ns3::PointToPointChannel": dict({
1664         "category": "Channel",
1665         "create_function": create_element,
1666         "configure_function": configure_element,
1667         "help": "",
1668         "connector_types": ["dev2"],
1669         "box_attributes": ["Delay"],
1670     }),
1671      "ns3::Ipv6StaticRouting": dict({
1672         "category": "Routing",
1673         "create_function": create_element,
1674         "configure_function": configure_element,
1675         "help": "",
1676         "connector_types": [],
1677         "box_attributes": [],
1678     }),
1679      "ns3::DropTailQueue": dict({
1680         "category": "Queue",
1681         "create_function": create_element,
1682         "configure_function": configure_element,
1683         "help": "",
1684         "connector_types": ["dev"],
1685         "box_attributes": ["MaxPackets",
1686            "MaxBytes"],
1687     }),
1688      "ns3::ConstantPositionMobilityModel": dict({
1689         "category": "Mobility",
1690         "create_function": create_element,
1691         "configure_function": configure_element,
1692         "help": "",
1693         "connector_types": ["node"],
1694         "box_attributes": ["Position",
1695             "Velocity"],
1696         "tags": [tags.MOBILE],
1697     }),
1698      "ns3::FixedRssLossModel": dict({
1699         "category": "Loss",
1700         "create_function": create_element,
1701         "configure_function": configure_element,
1702         "help": "",
1703         "connector_types": [],
1704         "box_attributes": ["Rss"],
1705     }),
1706      "ns3::EnergySourceContainer": dict({
1707         "category": "Energy",
1708         "create_function": create_element,
1709         "configure_function": configure_element,
1710         "help": "",
1711         "connector_types": [],
1712         "box_attributes": [],
1713     }),
1714      "ns3::RandomWalk2dMobilityModel": dict({
1715         "category": "Mobility",
1716         "create_function": create_element,
1717         "configure_function": configure_element,
1718         "help": "",
1719         "connector_types": ["node"],
1720         "box_attributes": ["Bounds",
1721             "Time",
1722             "Distance",
1723             "Mode",
1724             "Direction",
1725             "Speed",
1726             "Position",
1727             "Velocity"],
1728         "tags": [tags.MOBILE],
1729     }),
1730      "ns3::ListPositionAllocator": dict({
1731         "category": "",
1732         "create_function": create_element,
1733         "configure_function": configure_element,
1734         "help": "",
1735         "connector_types": [],
1736         "box_attributes": [],
1737     }),
1738      "ns3::dot11s::PeerManagementProtocol": dict({
1739         "category": "Protocol",
1740         "create_function": create_element,
1741         "configure_function": configure_element,
1742         "help": "",
1743         "connector_types": [],
1744         "box_attributes": ["MaxNumberOfPeerLinks",
1745             "MaxBeaconShiftValue",
1746             "EnableBeaconCollisionAvoidance"],
1747     }),
1748      "ns3::MeshPointDevice": dict({
1749         "category": "Device",
1750         "create_function": create_element,
1751         "configure_function": configure_element,
1752         "help": "",
1753         "connector_types": [],
1754         "allow_addresses": True,
1755         "box_attributes": ["Mtu"],
1756     }),
1757      "ns3::BasicEnergySource": dict({
1758         "category": "Energy",
1759         "create_function": create_element,
1760         "configure_function": configure_element,
1761         "help": "",
1762         "connector_types": [],
1763         "box_attributes": ["BasicEnergySourceInitialEnergyJ",
1764             "BasicEnergySupplyVoltageV",
1765             "PeriodicEnergyUpdateInterval"],
1766     }),
1767      "ns3::Ipv6OptionPadn": dict({
1768         "category": "",
1769         "create_function": create_element,
1770         "configure_function": configure_element,
1771         "help": "",
1772         "connector_types": [],
1773         "box_attributes": ["OptionNumber"],
1774     }),
1775      "ns3::QapWifiMac": dict({
1776         "category": "Mac",
1777         "create_function": create_wifi_standard_model,
1778         "configure_function": configure_element,
1779         "help": "Access point Wifi MAC Model",
1780         "connector_types": ["dev"],
1781         "box_attributes": ["BeaconInterval",
1782             "BeaconGeneration",
1783             "CtsTimeout",
1784             "AckTimeout",
1785             "BasicBlockAckTimeout",
1786             "CompressedBlockAckTimeout",
1787             "Sifs",
1788             "EifsNoDifs",
1789             "Slot",
1790             "Pifs",
1791             "MaxPropagationDelay",
1792             "Ssid",
1793             "Standard"],
1794     }),
1795      "ns3::YansErrorRateModel": dict({
1796         "category": "Error",
1797         "create_function": create_element,
1798         "configure_function": configure_element,
1799         "help": "",
1800         "connector_types": [],
1801         "box_attributes": [],
1802     }),
1803      "ns3::WifiMacQueue": dict({
1804         "category": "Queue",
1805         "create_function": create_element,
1806         "configure_function": configure_element,
1807         "help": "",
1808         "connector_types": [],
1809         "box_attributes": ["MaxPacketNumber",
1810            "MaxDelay"],
1811     }),
1812      "ns3::NonCommunicatingNetDevice": dict({
1813         "category": "Device",
1814         "create_function": create_element,
1815         "configure_function": configure_element,
1816         "help": "",
1817         "connector_types": [],
1818         "allow_addresses": True,
1819         "box_attributes": [],
1820     }),
1821      "ns3::RateErrorModel": dict({
1822         "category": "Error",
1823         "create_function": create_element,
1824         "configure_function": configure_element,
1825         "help": "",
1826         "connector_types": [],
1827         "box_attributes": ["ErrorUnit",
1828             "ErrorRate",
1829             "RanVar",
1830             "IsEnabled"],
1831     }),
1832      "ns3::MeshWifiInterfaceMac": dict({
1833         "category": "Mac",
1834         "create_function": create_element,
1835         "configure_function": configure_element,
1836         "help": "",
1837         "connector_types": [],
1838         "box_attributes": ["BeaconInterval",
1839             "RandomStart",
1840             "BeaconGeneration",
1841             "CtsTimeout",
1842             "AckTimeout",
1843             "BasicBlockAckTimeout",
1844             "CompressedBlockAckTimeout",
1845             "Sifs",
1846             "EifsNoDifs",
1847             "Slot",
1848             "Pifs",
1849             "MaxPropagationDelay",
1850             "Ssid"],
1851     }),
1852      "ns3::UanPhyCalcSinrDual": dict({
1853         "category": "",
1854         "create_function": create_element,
1855         "configure_function": configure_element,
1856         "help": "",
1857         "connector_types": [],
1858         "box_attributes": [],
1859     }),
1860      "ns3::Ipv6ExtensionAH": dict({
1861         "category": "",
1862         "create_function": create_element,
1863         "configure_function": configure_element,
1864         "help": "",
1865         "connector_types": [],
1866         "box_attributes": ["ExtensionNumber"],
1867     }),
1868      "ns3::SingleModelSpectrumChannel": dict({
1869         "category": "Channel",
1870         "create_function": create_element,
1871         "configure_function": configure_element,
1872         "help": "",
1873         "connector_types": [],
1874         "box_attributes": [],
1875     }),
1876      "ns3::YansWifiPhy": dict({
1877         "category": "Phy",
1878         "create_function": create_wifi_standard_model,
1879         "configure_function": configure_element,
1880         "help": "",
1881         "connector_types": ["dev", "err", "chan"],
1882         "box_attributes": ["EnergyDetectionThreshold",
1883             "CcaMode1Threshold",
1884             "TxGain",
1885             "RxGain",
1886             "TxPowerLevels",
1887             "TxPowerEnd",
1888             "TxPowerStart",
1889             "RxNoiseFigure",
1890             "ChannelSwitchDelay",
1891             "ChannelNumber",
1892             "Standard"],
1893         "traces": ["yanswifipcap"]
1894     }),
1895      "ns3::WifiRadioEnergyModel": dict({
1896         "category": "Energy",
1897         "create_function": create_element,
1898         "configure_function": configure_element,
1899         "help": "",
1900         "connector_types": [],
1901         "box_attributes": ["TxCurrentA",
1902             "RxCurrentA",
1903             "IdleCurrentA",
1904             "SleepCurrentA"],
1905     }),
1906      "ns3::EdcaTxopN": dict({
1907         "category": "",
1908         "create_function": create_element,
1909         "configure_function": configure_element,
1910         "help": "",
1911         "connector_types": [],
1912         "box_attributes": ["BlockAckThreshold",
1913             "MinCw",
1914             "MaxCw",
1915             "Aifsn"],
1916     }),
1917      "ns3::UanPhyPerGenDefault": dict({
1918         "category": "",
1919         "create_function": create_element,
1920         "configure_function": configure_element,
1921         "help": "",
1922         "connector_types": [],
1923         "box_attributes": ["Threshold"],
1924     }),
1925      "ns3::IdealWifiManager": dict({
1926         "category": "Manager",
1927         "create_function": create_element,
1928         "configure_function": configure_element,
1929         "help": "",
1930         "connector_types": [],
1931         "box_attributes": ["BerThreshold",
1932             "IsLowLatency",
1933             "MaxSsrc",
1934             "MaxSlrc",
1935             "RtsCtsThreshold",
1936             "FragmentationThreshold",
1937             "NonUnicastMode"],
1938     }),
1939      "ns3::MultiModelSpectrumChannel": dict({
1940         "category": "Channel",
1941         "create_function": create_element,
1942         "configure_function": configure_element,
1943         "help": "",
1944         "connector_types": [],
1945         "box_attributes": [],
1946     }),
1947      "ns3::HalfDuplexIdealPhy": dict({
1948         "category": "Phy",
1949         "create_function": create_element,
1950         "configure_function": configure_element,
1951         "help": "",
1952         "connector_types": [],
1953         "box_attributes": ["Rate"],
1954     }),
1955      "ns3::UanPhyCalcSinrDefault": dict({
1956         "category": "Phy",
1957         "create_function": create_element,
1958         "configure_function": configure_element,
1959         "help": "",
1960         "connector_types": [],
1961         "box_attributes": [],
1962     }),
1963      "ns3::ReceiveListErrorModel": dict({
1964         "category": "Error",
1965         "create_function": create_element,
1966         "configure_function": configure_element,
1967         "help": "",
1968         "connector_types": [],
1969         "box_attributes": ["IsEnabled"],
1970     }),
1971      "ns3::SpectrumAnalyzer": dict({
1972         "category": "",
1973         "create_function": create_element,
1974         "configure_function": configure_element,
1975         "help": "",
1976         "connector_types": [],
1977         "box_attributes": ["Resolution",
1978         "NoisePowerSpectralDensity"],
1979     }),
1980      "ns3::ConstantRateWifiManager": dict({
1981         "category": "Manager",
1982         "create_function": create_element,
1983         "configure_function": configure_element,
1984         "help": "",
1985         "connector_types": ["dev"],
1986         "box_attributes": ["DataMode",
1987             "ControlMode",
1988             "IsLowLatency",
1989             "MaxSsrc",
1990             "MaxSlrc",
1991             "RtsCtsThreshold",
1992             "FragmentationThreshold",
1993             "NonUnicastMode"],
1994     }),
1995      "ns3::Ipv6OptionPad1": dict({
1996         "category": "",
1997         "create_function": create_element,
1998         "configure_function": configure_element,
1999         "help": "",
2000         "connector_types": [],
2001         "box_attributes": ["OptionNumber"],
2002     }),
2003      "ns3::UdpTraceClient": dict({
2004         "category": "",
2005         "create_function": create_element,
2006         "configure_function": configure_element,
2007         "help": "",
2008         "connector_types": [],
2009         "box_attributes": ["RemoteAddress",
2010             "RemotePort",
2011             "MaxPacketSize",
2012             "StartTime",
2013             "StopTime"],
2014     }),
2015      "ns3::RraaWifiManager": dict({
2016         "category": "Manager",
2017         "create_function": create_element,
2018         "configure_function": configure_element,
2019         "help": "",
2020         "connector_types": [],
2021         "box_attributes": ["Basic",
2022             "Timeout",
2023             "ewndFor54mbps",
2024             "ewndFor48mbps",
2025             "ewndFor36mbps",
2026             "ewndFor24mbps",
2027             "ewndFor18mbps",
2028             "ewndFor12mbps",
2029             "ewndFor9mbps",
2030             "ewndFor6mbps",
2031             "poriFor48mbps",
2032             "poriFor36mbps",
2033             "poriFor24mbps",
2034             "poriFor18mbps",
2035             "poriFor12mbps",
2036             "poriFor9mbps",
2037             "poriFor6mbps",
2038             "pmtlFor54mbps",
2039             "pmtlFor48mbps",
2040             "pmtlFor36mbps",
2041             "pmtlFor24mbps",
2042             "pmtlFor18mbps",
2043             "pmtlFor12mbps",
2044             "pmtlFor9mbps",
2045             "IsLowLatency",
2046             "MaxSsrc",
2047             "MaxSlrc",
2048             "RtsCtsThreshold",
2049             "FragmentationThreshold",
2050             "NonUnicastMode"],
2051     }),
2052      "ns3::RandomPropagationLossModel": dict({
2053         "category": "Loss",
2054         "create_function": create_element,
2055         "configure_function": configure_element,
2056         "help": "",
2057         "connector_types": [],
2058         "box_attributes": ["Variable"],
2059     }),
2060      "ns3::UanChannel": dict({
2061         "category": "Channel",
2062         "create_function": create_element,
2063         "configure_function": configure_element,
2064         "help": "",
2065         "connector_types": [],
2066         "box_attributes": [],
2067     }),
2068      "ns3::MinstrelWifiManager": dict({
2069         "category": "Manager",
2070         "create_function": create_element,
2071         "configure_function": configure_element,
2072         "help": "",
2073         "connector_types": [],
2074         "box_attributes": ["UpdateStatistics",
2075             "LookAroundRate",
2076             "EWMA",
2077             "SegmentSize",
2078             "SampleColumn",
2079             "PacketLength",
2080             "IsLowLatency",
2081             "MaxSsrc",
2082             "MaxSlrc",
2083             "RtsCtsThreshold",
2084             "FragmentationThreshold",
2085             "NonUnicastMode"],
2086     }),
2087      "ns3::UanPhyDual": dict({
2088         "category": "Phy",
2089         "create_function": create_element,
2090         "configure_function": configure_element,
2091         "help": "",
2092         "connector_types": [],
2093         "box_attributes": ["CcaThresholdPhy1",
2094             "CcaThresholdPhy2",
2095             "TxPowerPhy1",
2096             "TxPowerPhy2",
2097             "RxGainPhy1",
2098             "RxGainPhy2",
2099             "SupportedModesPhy1",
2100             "SupportedModesPhy2"],
2101     }),
2102      "ns3::ListErrorModel": dict({
2103         "category": "Error",
2104         "create_function": create_element,
2105         "configure_function": configure_element,
2106         "help": "",
2107         "connector_types": ["dev"],
2108         "box_attributes": ["IsEnabled"],
2109     }),
2110      "ns3::VirtualNetDevice": dict({
2111         "category": "Device",
2112         "create_function": create_element,
2113         "configure_function": configure_element,
2114         "help": "",
2115         "connector_types": [],
2116         "allow_addresses": True,
2117         "box_attributes": ["Mtu"],
2118     }),
2119      "ns3::UanPhyGen": dict({
2120         "category": "Phy",
2121         "create_function": create_element,
2122         "configure_function": configure_element,
2123         "help": "",
2124         "connector_types": [],
2125         "box_attributes": ["CcaThreshold",
2126             "RxThreshold",
2127             "TxPower",
2128             "RxGain",
2129             "SupportedModes"],
2130     }),
2131      "ns3::Ipv6L3Protocol": dict({
2132         "category": "Protocol",
2133         "create_function": create_element,
2134         "configure_function": configure_element,
2135         "help": "",
2136         "connector_types": ["node"],
2137         "box_attributes": ["DefaultTtl",
2138             "IpForward"],
2139     }),
2140      "ns3::PointToPointRemoteChannel": dict({
2141         "category": "Channel",
2142         "create_function": create_element,
2143         "configure_function": configure_element,
2144         "help": "",
2145         "connector_types": [],
2146         "box_attributes": ["Delay"],
2147     }),
2148      "ns3::UanPhyPerUmodem": dict({
2149         "category": "Phy",
2150         "create_function": create_element,
2151         "configure_function": configure_element,
2152         "help": "",
2153         "connector_types": [],
2154         "box_attributes": [],
2155     }),
2156      "ns3::OnoeWifiManager": dict({
2157         "category": "Manager",
2158         "create_function": create_element,
2159         "configure_function": configure_element,
2160         "help": "",
2161         "connector_types": [],
2162         "box_attributes": ["UpdatePeriod",
2163             "RaiseThreshold",
2164             "AddCreditThreshold",
2165             "IsLowLatency",
2166             "MaxSsrc",
2167             "MaxSlrc",
2168             "RtsCtsThreshold",
2169             "FragmentationThreshold",
2170             "NonUnicastMode"],
2171     }),
2172      "ns3::QadhocWifiMac": dict({
2173         "category": "Mac",
2174         "create_function": create_element,
2175         "configure_function": configure_element,
2176         "help": "",
2177         "connector_types": [],
2178         "box_attributes": ["CtsTimeout",
2179             "AckTimeout",
2180             "BasicBlockAckTimeout",
2181             "CompressedBlockAckTimeout",
2182             "Sifs",
2183             "EifsNoDifs",
2184             "Slot",
2185             "Pifs",
2186             "MaxPropagationDelay",
2187             "Ssid"],
2188     }),
2189      "ns3::JakesPropagationLossModel": dict({
2190         "category": "Loss",
2191         "create_function": create_element,
2192         "configure_function": configure_element,
2193         "help": "",
2194         "connector_types": [],
2195         "box_attributes": ["NumberOfRaysPerPath",
2196             "NumberOfOscillatorsPerRay",
2197             "DopplerFreq",
2198             "Distribution"],
2199     }),
2200      "ns3::PacketSink": dict({
2201         "category": "Application",
2202         "create_function": create_element,
2203         "configure_function": configure_element,
2204         "help": "",
2205         "connector_types": ["node"],
2206         "stop_function": stop_application,
2207         "start_function": start_application,
2208         "status_function": status_application,
2209         "box_attributes": ["Local",
2210             "Protocol",
2211             "StartTime",
2212             "StopTime"],
2213     }),
2214      "ns3::RandomDirection2dMobilityModel": dict({
2215         "category": "Mobility",
2216         "create_function": create_element,
2217         "configure_function": configure_element,
2218         "help": "",
2219         "connector_types": ["node"],
2220         "box_attributes": ["Bounds",
2221             "RndSpeed",
2222             "Pause",
2223             "Position",
2224             "Velocity"],
2225         "tags": [tags.MOBILE],
2226     }),
2227      "ns3::UanMacAloha": dict({
2228         "category": "",
2229         "create_function": create_element,
2230         "configure_function": configure_element,
2231         "help": "",
2232         "connector_types": [],
2233         "box_attributes": [],
2234     }),
2235      "ns3::MsduStandardAggregator": dict({
2236         "category": "",
2237         "create_function": create_element,
2238         "configure_function": configure_element,
2239         "help": "",
2240         "connector_types": [],
2241         "box_attributes": ["MaxAmsduSize"],
2242     }),
2243      "ns3::DcaTxop": dict({
2244         "category": "",
2245         "create_function": create_element,
2246         "configure_function": configure_element,
2247         "help": "",
2248         "connector_types": [],
2249         "box_attributes": ["MinCw",
2250             "MaxCw",
2251             "Aifsn"],
2252     }),
2253      "ns3::UanPhyCalcSinrFhFsk": dict({
2254         "category": "Phy",
2255         "create_function": create_element,
2256         "configure_function": configure_element,
2257         "help": "",
2258         "connector_types": [],
2259         "box_attributes": ["NumberOfHops"],
2260     }),
2261      "ns3::UanPropModelIdeal": dict({
2262         "category": "",
2263         "create_function": create_element,
2264         "configure_function": configure_element,
2265         "help": "",
2266         "connector_types": [],
2267         "box_attributes": [],
2268     }),
2269      "ns3::UanMacRcGw": dict({
2270         "category": "",
2271         "create_function": create_element,
2272         "configure_function": configure_element,
2273         "help": "",
2274         "connector_types": [],
2275         "box_attributes": ["MaxReservations",
2276             "NumberOfRates",
2277             "RetryRate",
2278             "MaxPropDelay",
2279             "SIFS",
2280             "NumberOfNodes",
2281             "MinRetryRate",
2282             "RetryStep",
2283             "NumberOfRetryRates",
2284             "TotalRate",
2285             "RateStep",
2286             "FrameSize"],
2287     }),
2288      "ns3::NistErrorRateModel": dict({
2289         "category": "Error",
2290         "create_function": create_element,
2291         "configure_function": configure_element,
2292         "help": "",
2293         "connector_types": ["phy"],
2294         "box_attributes": [],
2295     }),
2296      "ns3::Ipv4L3Protocol": dict({
2297         "category": "Protocol",
2298         "create_function": create_ipv4protocol,
2299         "configure_function": configure_element,
2300         "help": "",
2301         "connector_types": ["node"],
2302         "box_attributes": ["DefaultTtl",
2303             "IpForward",
2304             "WeakEsModel"],
2305     }),
2306      "ns3::aodv::RoutingProtocol": dict({
2307         "category": "Protocol",
2308         "create_function": create_element,
2309         "configure_function": configure_element,
2310         "help": "",
2311         "connector_types": [],
2312         "box_attributes": ["HelloInterval",
2313             "RreqRetries",
2314             "RreqRateLimit",
2315             "NodeTraversalTime",
2316             "NextHopWait",
2317             "ActiveRouteTimeout",
2318             "MyRouteTimeout",
2319             "BlackListTimeout",
2320             "DeletePeriod",
2321             "TimeoutBuffer",
2322             "NetDiameter",
2323             "NetTraversalTime",
2324             "PathDiscoveryTime",
2325             "MaxQueueLen",
2326             "MaxQueueTime",
2327             "AllowedHelloLoss",
2328             "GratuitousReply",
2329             "DestinationOnly",
2330             "EnableHello",
2331             "EnableBroadcast"],
2332     }),
2333      "ns3::TcpL4Protocol": dict({
2334         "category": "Protocol",
2335         "create_function": create_element,
2336         "configure_function": configure_element,
2337         "help": "",
2338         "connector_types": ["node"],
2339         "box_attributes": ["RttEstimatorFactory",
2340             "ProtocolNumber"],
2341     }),
2342      "ns3::olsr::RoutingProtocol": dict({
2343         "category": "Protocol",
2344         "create_function": create_element,
2345         "configure_function": configure_element,
2346         "help": "",
2347         "connector_types": [],
2348         "box_attributes": ["HelloInterval",
2349             "TcInterval",
2350             "MidInterval",
2351             "HnaInterval",
2352             "Willingness"],
2353     }),
2354      "ns3::UdpEchoServer": dict({
2355         "category": "Application",
2356         "create_function": create_element,
2357         "configure_function": configure_element,
2358         "help": "",
2359         "connector_types": ["node"],
2360         "stop_function": stop_application,
2361         "start_function": start_application,
2362         "status_function": status_application,
2363         "box_attributes": ["Port",
2364            "StartTime",
2365            "StopTime"],
2366     }),
2367      "ns3::AmrrWifiManager": dict({
2368         "category": "Manager",
2369         "create_function": create_element,
2370         "configure_function": configure_element,
2371         "help": "",
2372         "connector_types": [],
2373         "box_attributes": ["UpdatePeriod",
2374             "FailureRatio",
2375             "SuccessRatio",
2376             "MaxSuccessThreshold",
2377             "MinSuccessThreshold",
2378             "IsLowLatency",
2379             "MaxSsrc",
2380             "MaxSlrc",
2381             "RtsCtsThreshold",
2382             "FragmentationThreshold",
2383             "NonUnicastMode"],
2384     }),
2385      "ns3::ArfWifiManager": dict({
2386         "category": "Manager",
2387         "create_function": create_element,
2388         "configure_function": configure_element,
2389         "help": "",
2390         "connector_types": ["dev"],
2391         "box_attributes": ["TimerThreshold",
2392             "SuccessThreshold",
2393             "IsLowLatency",
2394             "MaxSsrc",
2395             "MaxSlrc",
2396             "RtsCtsThreshold",
2397             "FragmentationThreshold",
2398             "NonUnicastMode"],
2399     }),
2400      "ns3::SubscriberStationNetDevice": dict({
2401         "category": "Device",
2402         "create_function": create_subscriber_station,
2403         "configure_function": configure_station,
2404         "help": "Subscriber station for mobile wireless network",
2405         "connector_types": ["node", "chan", "phy", "sflows"],
2406         "allow_addresses": True,
2407         "box_attributes": ["LostDlMapInterval",
2408             "LostUlMapInterval",
2409             "MaxDcdInterval",
2410             "MaxUcdInterval",
2411             "IntervalT1",
2412             "IntervalT2",
2413             "IntervalT3",
2414             "IntervalT7",
2415             "IntervalT12",
2416             "IntervalT20",
2417             "IntervalT21",
2418             "MaxContentionRangingRetries",
2419             "Mtu",
2420             "RTG",
2421             "TTG"],
2422         "traces": ["wimaxpcap", "wimaxascii"],
2423     }),
2424     "ns3::flame::FlameRtable": dict({
2425         "category": "",
2426         "create_function": create_element,
2427         "configure_function": configure_element,
2428         "help": "",
2429         "connector_types": [],
2430         "box_attributes": ["Lifetime"],
2431     }),
2432     "ns3::BSSchedulerRtps": dict({
2433         "category": "Service Flow",
2434         "create_function": create_element,
2435         "configure_function": configure_element,
2436         "help": "Simple downlink scheduler for rtPS flows",
2437         "connector_types": ["dev"],
2438         "box_attributes": [],
2439     }),
2440     "ns3::BSSchedulerSimple": dict({
2441         "category": "Service Flow",
2442         "create_function": create_element,
2443         "configure_function": configure_element,
2444         "help": "simple downlink scheduler for service flows",
2445         "connector_types": ["dev"],
2446         "box_attributes": [],
2447     }),
2448     "ns3::SimpleOfdmWimaxChannel": dict({
2449         "category": "Channel",
2450         "create_function": create_wimax_channel,
2451         "configure_function": configure_element,
2452         "help": "Wimax channel",
2453         "connector_types": ["devs"],
2454         "box_attributes": [],
2455     }),
2456     "ns3::SimpleOfdmWimaxPhy": dict({
2457         "category": "Phy",
2458         "create_function": create_wimax_phy,
2459         "configure_function": configure_element,
2460         "help": "Wimax Phy",
2461         "connector_types": ["dev"],
2462         "box_attributes": [],
2463     }),
2464     "ns3::UplinkSchedulerSimple": dict({
2465         "category": "Service Flow",
2466         "create_function": create_element_no_constructor,
2467         "configure_function": configure_element,
2468         "help": "Simple uplink scheduler for service flows",
2469         "connector_types": ["dev"],
2470         "box_attributes": [],
2471     }),
2472     "ns3::UplinkSchedulerRtps": dict({
2473         "category": "Service Flow",
2474         "create_function": create_element_no_constructor,
2475         "configure_function": configure_element,
2476         "help": "Simple uplink scheduler for rtPS flows",
2477         "connector_types": ["dev"],
2478         "box_attributes": [],
2479     }),
2480     "ns3::IpcsClassifierRecord": dict({
2481         "category": "Service Flow",
2482         "create_function": create_ipcs_classifier_record,
2483         "configure_function": configure_element,
2484         "help": "Classifier record for service flow",
2485         "connector_types": ["sflow"],
2486         "box_attributes": ["ClassifierSrcAddress", 
2487             "ClassifierSrcMask", 
2488             "ClassifierDstAddress",
2489             "ClassifierDstMask",
2490             "ClassifierSrcPortLow",
2491             "ClassifierSrcPortHigh",
2492             "ClassifierDstPortLow",
2493             "ClassifierDstPortHigh",
2494             "ClassifierProtocol",
2495             "ClassifierPriority"],
2496     }),   
2497     "ns3::ServiceFlow": dict({
2498         "category": "Service Flow",
2499         "create_function": create_service_flow,
2500         "configure_function": configure_element,
2501         "help": "Service flow for QoS",
2502         "connector_types": ["classif", "dev"],
2503         "box_attributes": ["ServiceFlowDirection", 
2504             "ServiceFlowSchedulingType"],
2505     }),   
2506 })
2507