wimax support.. still ongoing...
[nepi.git] / src / nepi / testbeds / ns3 / factories_metadata.py
index fe38f4a..006d252 100644 (file)
@@ -6,7 +6,7 @@ from nepi.util.constants import AF_INET, ApplicationStatus as AS, \
         FactoryCategories as FC
 from nepi.util.tunchannel_impl import \
     preconfigure_tunchannel, postconfigure_tunchannel, \
-    wait_tunchannel, create_tunchannel
+    prestart_tunchannel, create_tunchannel
 import re
 
 wifi_standards = dict({
@@ -126,9 +126,20 @@ def fdpcap_trace(testbed_instance, guid, trace_id):
     element = testbed_instance._elements[guid]
     filename = "trace-fd-node-%d-dev-%d.pcap" % (node_guid, interface_number)
     filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
-    helper = testbed_instance.ns3.FileDescriptorHelper()
+    helper = testbed_instance.ns3.FdNetDeviceHelper()
     helper.EnablePcap(filepath, element, explicitFilename = True)
 
+def fdascii_trace(testbed_instance, guid, trace_id):
+    node_guid = _get_node_guid(testbed_instance, guid)
+    interface_number = _get_dev_number(testbed_instance, guid)
+    element = testbed_instance._elements[guid]
+    filename = "trace-fd-node-%d-dev-%d.tr" % (node_guid, interface_number)
+    filepath = _follow_trace(testbed_instance, guid, trace_id, filename)
+    helper = testbed_instance.ns3.FdNetDeviceHelper()
+    asciiHelper = testbed_instance.ns3.AsciiTraceHelper()
+    stream = asciiHelper.CreateFileStream(filepath)
+    helper.EnableAscii(stream, element)
+
 def yanswifipcap_trace(testbed_instance, guid, trace_id):
     dev_guid = testbed_instance.get_connected(guid, "dev", "phy")[0]
     node_guid = _get_node_guid(testbed_instance, dev_guid)
@@ -174,7 +185,8 @@ trace_functions = dict({
     "P2PAsciiTrace": p2pascii_trace,
     "CsmaPcapTrace": csmapcap_trace,
     "CsmaPcapPromiscTrace": csmapcap_promisc_trace,
-    "FileDescriptorPcapTrace": fdpcap_trace,
+    "FdPcapTrace": fdpcap_trace,
+    "FdAsciiTrace": fdascii_trace,
     "YansWifiPhyPcapTrace": yanswifipcap_trace,
     "WimaxPcapTrace": wimaxpcap_trace,
     "WimaxAsciiTrace": wimaxascii_trace,
@@ -395,7 +407,6 @@ def configure_element(testbed_instance, guid):
 
 def configure_device(testbed_instance, guid):
     configure_traces(testbed_instance, guid)
-
     element = testbed_instance._elements[guid]
 
     parameters = testbed_instance._get_parameters(guid)
@@ -485,7 +496,7 @@ def configure_node(testbed_instance, guid):
                         break
             if ifindex < 0:
                 # Check previous ptp routes
-                for chaindest, chainprefix, chainhop in routes:
+                for chaindest, chainprefix, chainhop, metric in routes:
                     if chaindest == nexthop and chainprefix == 32:
                         chainhop_address = ns3.Ipv4Address(chainhop)
                         for ifidx in xrange(nifaces):
@@ -518,7 +529,7 @@ def configure_station(testbed_instance, guid):
 
 ###  Factories  ###
 
-factories_order = ["ns3::BasicEnergySource",
+factories_create_order = ["ns3::BasicEnergySource",
     "ns3::WifiRadioEnergyModel",
     "ns3::BSSchedulerRtps",
     "ns3::BSSchedulerSimple",
@@ -566,8 +577,8 @@ factories_order = ["ns3::BasicEnergySource",
     "ns3::SingleModelSpectrumChannel",
     "ns3::MsduStandardAggregator",
     "ns3::EdcaTxopN",
-    "ns3::QstaWifiMac",
-    "ns3::QapWifiMac",
+    "ns3::StaWifiMac",
+    "ns3::ApWifiMac",
     "ns3::QadhocWifiMac",
     "ns3::MinstrelWifiManager",
     "ns3::CaraWifiManager",
@@ -579,8 +590,6 @@ factories_order = ["ns3::BasicEnergySource",
     "ns3::AarfWifiManager",
     "ns3::ArfWifiManager",
     "ns3::WifiNetDevice",
-    "ns3::NqstaWifiMac",
-    "ns3::NqapWifiMac",
     "ns3::AdhocWifiMac",
     "ns3::DcaTxop",
     "ns3::WifiMacQueue",
@@ -610,7 +619,7 @@ factories_order = ["ns3::BasicEnergySource",
     "ns3::PacketSink",
     "ns3::OnOffApplication",
     "ns3::VirtualNetDevice",
-    "ns3::FileDescriptorNetDevice",
+    "ns3::FdNetDevice",
     "ns3::Nepi::TunChannel",
     "ns3::TapBridge",
     "ns3::BridgeChannel",
@@ -679,6 +688,166 @@ factories_order = ["ns3::BasicEnergySource",
     "ns3::SubscriberStationNetDevice",
  ]
 
+factories_configure_order = ["ns3::BasicEnergySource",
+    "ns3::WifiRadioEnergyModel",
+    "ns3::BSSchedulerRtps",
+    "ns3::BSSchedulerSimple",
+    "ns3::UdpTraceClient",
+    "ns3::UdpServer",
+    "ns3::UdpClient",
+    "ns3::FlowMonitor",
+    "ns3::Radvd",
+    "ns3::Ping6",
+    "ns3::flame::FlameProtocol",
+    "ns3::flame::FlameRtable",
+    "ns3::dot11s::AirtimeLinkMetricCalculator",
+    "ns3::dot11s::HwmpProtocol",
+    "ns3::dot11s::HwmpRtable",
+    "ns3::dot11s::PeerManagementProtocol",
+    "ns3::dot11s::PeerLink",
+    "ns3::MeshWifiInterfaceMac",
+    "ns3::MeshPointDevice",
+    "ns3::UanMacRcGw",
+    "ns3::UanMacRc",
+    "ns3::UanPhyCalcSinrDual",
+    "ns3::UanPhyPerGenDefault",
+    "ns3::UanPhyDual",
+    "ns3::UanPropModelThorp",
+    "ns3::UanMacCw",
+    "ns3::UanNoiseModelDefault",
+    "ns3::UanMacAloha",
+    "ns3::UanPropModelIdeal",
+    "ns3::UanTransducerHd",
+    "ns3::UanPhyCalcSinrDefault",
+    "ns3::UanPhyGen",
+    "ns3::UanPhyCalcSinrFhFsk",
+    "ns3::UanPhyPerUmodem",
+    "ns3::UanChannel",
+    "ns3::V4Ping",
+    "ns3::AthstatsWifiTraceSink",
+    "ns3::FlameStack",
+    "ns3::Dot11sStack",
+    "ns3::NonCommunicatingNetDevice",
+    "ns3::HalfDuplexIdealPhy",
+    "ns3::AlohaNoackNetDevice",
+    "ns3::SpectrumAnalyzer",
+    "ns3::WaveformGenerator",
+    "ns3::MultiModelSpectrumChannel",
+    "ns3::SingleModelSpectrumChannel",
+    "ns3::MsduStandardAggregator",
+    "ns3::EdcaTxopN",
+    "ns3::StaWifiMac",
+    "ns3::ApWifiMac",
+    "ns3::QadhocWifiMac",
+    "ns3::MinstrelWifiManager",
+    "ns3::CaraWifiManager",
+    "ns3::AarfcdWifiManager",
+    "ns3::OnoeWifiManager",
+    "ns3::AmrrWifiManager",
+    "ns3::ConstantRateWifiManager",
+    "ns3::IdealWifiManager",
+    "ns3::AarfWifiManager",
+    "ns3::ArfWifiManager",
+    "ns3::WifiNetDevice",
+    "ns3::AdhocWifiMac",
+    "ns3::DcaTxop",
+    "ns3::WifiMacQueue",
+    "ns3::YansWifiChannel",
+    "ns3::YansWifiPhy",
+    "ns3::NistErrorRateModel",
+    "ns3::YansErrorRateModel",
+    "ns3::WaypointMobilityModel",
+    "ns3::ConstantAccelerationMobilityModel",
+    "ns3::RandomDirection2dMobilityModel",
+    "ns3::RandomWalk2dMobilityModel",
+    "ns3::SteadyStateRandomWaypointMobilityModel",
+    "ns3::RandomWaypointMobilityModel",
+    "ns3::GaussMarkovMobilityModel",
+    "ns3::ConstantVelocityMobilityModel",
+    "ns3::ConstantPositionMobilityModel",
+    "ns3::ListPositionAllocator",
+    "ns3::GridPositionAllocator",
+    "ns3::RandomRectanglePositionAllocator",
+    "ns3::RandomBoxPositionAllocator",
+    "ns3::RandomDiscPositionAllocator",
+    "ns3::UniformDiscPositionAllocator",
+    "ns3::HierarchicalMobilityModel",
+    "ns3::aodv::RoutingProtocol",
+    "ns3::UdpEchoServer",
+    "ns3::UdpEchoClient",
+    "ns3::PacketSink",
+    "ns3::OnOffApplication",
+    "ns3::VirtualNetDevice",
+    "ns3::FdNetDevice",
+    "ns3::Nepi::TunChannel",
+    "ns3::TapBridge",
+    "ns3::BridgeChannel",
+    "ns3::BridgeNetDevice",
+    "ns3::EmuNetDevice",
+    "ns3::CsmaChannel",
+    "ns3::CsmaNetDevice",
+    "ns3::PointToPointRemoteChannel",
+    "ns3::PointToPointChannel",
+    "ns3::PointToPointNetDevice",
+    "ns3::BaseStationNetDevice",
+    "ns3::SubscriberStationNetDevice",
+    "ns3::NscTcpL4Protocol",
+    "ns3::Icmpv6L4Protocol",
+    "ns3::Ipv6OptionPad1",
+    "ns3::Ipv6OptionPadn",
+    "ns3::Ipv6OptionJumbogram",
+    "ns3::Ipv6OptionRouterAlert",
+    "ns3::Ipv6ExtensionHopByHop",
+    "ns3::Ipv6ExtensionDestination",
+    "ns3::Ipv6ExtensionFragment",
+    "ns3::Ipv6ExtensionRouting",
+    "ns3::Ipv6ExtensionLooseRouting",
+    "ns3::Ipv6ExtensionESP",
+    "ns3::Ipv6ExtensionAH",
+    "ns3::Ipv6L3Protocol",
+    "ns3::LoopbackNetDevice",
+    "ns3::Icmpv4L4Protocol",
+    "ns3::RttMeanDeviation",
+    "ns3::ArpL3Protocol",
+    "ns3::TcpL4Protocol",
+    "ns3::UdpL4Protocol",
+    "ns3::Ipv4L3Protocol",
+    "ns3::SimpleNetDevice",
+    "ns3::SimpleChannel",
+    "ns3::PacketSocket",
+    "ns3::DropTailQueue",
+    "ns3::Node",
+    "ns3::FriisSpectrumPropagationLossModel",
+    "ns3::Cost231PropagationLossModel",
+    "ns3::JakesPropagationLossModel",
+    "ns3::RandomPropagationLossModel",
+    "ns3::FriisPropagationLossModel",
+    "ns3::TwoRayGroundPropagationLossModel",
+    "ns3::LogDistancePropagationLossModel",
+    "ns3::ThreeLogDistancePropagationLossModel",
+    "ns3::NakagamiPropagationLossModel",
+    "ns3::FixedRssLossModel",
+    "ns3::MatrixPropagationLossModel",
+    "ns3::RangePropagationLossModel",
+    "ns3::RandomPropagationDelayModel",
+    "ns3::ConstantSpeedPropagationDelayModel",
+    "ns3::RateErrorModel",
+    "ns3::ListErrorModel",
+    "ns3::ReceiveListErrorModel",
+    "ns3::PacketBurst",
+    "ns3::EnergySourceContainer",
+    "ns3::BSSchedulerRtps",
+    "ns3::BSSchedulerSimple",
+    "ns3::SimpleOfdmWimaxChannel",
+    "ns3::SimpleOfdmWimaxPhy",
+    "ns3::UplinkSchedulerMBQoS",
+    "ns3::UplinkSchedulerRtps",
+    "ns3::UplinkSchedulerSimple",
+    "ns3::IpcsClassifierRecord",
+    "ns3::ServiceFlow",
+ ]
+
+
 factories_info = dict({
     "ns3::Ping6": dict({
         "category": FC.CATEGORY_APPLICATIONS,
@@ -1031,16 +1200,15 @@ factories_info = dict({
             "WaypointList"],
         "tags": [tags.MOBILE],
     }),
-     "ns3::FileDescriptorNetDevice": dict({
+     "ns3::FdNetDevice": dict({
         "category": FC.CATEGORY_DEVICES,
         "create_function": create_element,
         "configure_function": configure_device,
         "help": "Network interface associated to a file descriptor",
         "connector_types": ["node", "->fd"],
         "box_attributes": ["Address", 
-            "LinuxSocketAddress",
-            "tun_proto", "tun_addr", "tun_port", "tun_key"],
-        "traces": ["fdpcap"],
+            "tun_proto", "tun_addr", "tun_port", "tun_key", "tun_cipher_fdnd"],
+        "traces": ["fdpcap", "fdascii"],
         "tags": [tags.INTERFACE, tags.ALLOW_ADDRESSES],
     }),
      "ns3::Nepi::TunChannel": dict({
@@ -1048,12 +1216,12 @@ factories_info = dict({
         "create_function": create_tunchannel,
         "preconfigure_function": preconfigure_tunchannel,
         "configure_function": postconfigure_tunchannel,
-        "prestart_function": wait_tunchannel,
-        "help": "Channel to forward FileDescriptorNetDevice data to "
+        "prestart_function": prestart_tunchannel,
+        "help": "Channel to forward FdNetDevice data to "
                 "other TAP interfaces supporting the NEPI tunneling protocol.",
         "connector_types": ["fd->", "udp", "tcp"],
         "allow_addresses": False,
-        "box_attributes": ["tun_proto", "tun_addr", "tun_port", "tun_key"],
+        "box_attributes": ["tun_proto", "tun_addr", "tun_port", "tun_key","tun_cipher"],
         "tags": [tags.TUNNEL],
  
     }),
@@ -1077,26 +1245,6 @@ factories_info = dict({
         "help": "",
         "connector_types": [],
         "box_attributes": ["SpreadCoef"],
-    }),
-     "ns3::NqstaWifiMac": dict({
-        "category": FC.CATEGORY_MAC_MODELS,
-        "create_function": create_wifi_standard_model,
-        "configure_function": configure_element,
-        "help": "",
-        "connector_types": ["dev"],
-        "box_attributes": ["ProbeRequestTimeout",
-            "AssocRequestTimeout",
-            "MaxMissedBeacons",
-            "CtsTimeout",
-            "AckTimeout",
-            "BasicBlockAckTimeout",
-            "CompressedBlockAckTimeout",
-            "Sifs",
-            "EifsNoDifs",
-            "Slot",
-            "Pifs",
-            "MaxPropagationDelay",
-            "Ssid"],
     }),
      "ns3::Icmpv6L4Protocol": dict({
         "category": FC.CATEGORY_PROTOCOLS,
@@ -1338,25 +1486,6 @@ factories_info = dict({
         "box_attributes": ["X",
            "Y"],
         "tags": [tags.MOBILE],
-    }),
-     "ns3::NqapWifiMac": dict({
-        "category": FC.CATEGORY_MAC_MODELS,
-        "create_function": create_wifi_standard_model,
-        "configure_function": configure_element,
-        "help": "",
-        "connector_types": ["dev"],
-        "box_attributes": ["BeaconInterval",
-            "BeaconGeneration",
-            "CtsTimeout",
-            "AckTimeout",
-            "BasicBlockAckTimeout",
-            "CompressedBlockAckTimeout",
-            "Sifs",
-            "EifsNoDifs",
-            "Slot",
-            "Pifs",
-            "MaxPropagationDelay",
-            "Ssid"],
     }),
      "ns3::HierarchicalMobilityModel": dict({
         "category": FC.CATEGORY_MOBILITY_MODELS,
@@ -1611,7 +1740,7 @@ factories_info = dict({
         "connector_types": [],
         "box_attributes": ["ExtensionNumber"],
     }),
-     "ns3::QstaWifiMac": dict({
+     "ns3::StaWifiMac": dict({
         "category": FC.CATEGORY_MAC_MODELS,
         "create_function": create_wifi_standard_model,
         "configure_function": configure_element,
@@ -1780,7 +1909,7 @@ factories_info = dict({
         "connector_types": [],
         "box_attributes": ["OptionNumber"],
     }),
-     "ns3::QapWifiMac": dict({
+     "ns3::ApWifiMac": dict({
         "category": FC.CATEGORY_MAC_MODELS,
         "create_function": create_wifi_standard_model,
         "configure_function": configure_element,