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