From 9a0d17186b80902f17e4927ba7126d9f57b48c95 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Tue, 6 Dec 2022 19:41:27 +0000 Subject: [PATCH] Fix clang-tidy readability-static-accessed-through-instance warnings --- examples/energy/energy-model-example.cc | 2 +- .../energy-model-with-harvesting-example.cc | 2 +- examples/ipv6/fragmentation-ipv6-PMTU.cc | 3 +-- examples/ipv6/fragmentation-ipv6-two-MTU.cc | 3 +-- examples/ipv6/fragmentation-ipv6.cc | 3 +-- examples/ipv6/icmpv6-redirect.cc | 4 +-- examples/ipv6/radvd-two-prefix.cc | 5 ++-- examples/routing/dynamic-global-routing.cc | 3 +-- ...global-routing-multi-switch-plus-router.cc | 3 +-- examples/routing/rip-simple-network.cc | 26 +++++++++---------- examples/routing/ripng-simple-network.cc | 26 +++++++++---------- examples/wireless/wifi-simple-adhoc-grid.cc | 6 ++--- examples/wireless/wifi-simple-adhoc.cc | 2 +- examples/wireless/wifi-simple-infra.cc | 2 +- examples/wireless/wifi-simple-interference.cc | 2 +- examples/wireless/wifi-sleep.cc | 2 +- src/antenna/model/angles.cc | 2 +- src/aodv/examples/aodv.cc | 2 +- src/dsdv/examples/dsdv-manet.cc | 2 +- src/dsr/model/dsr-routing.cc | 2 +- src/fd-net-device/examples/fd-emu-tc.cc | 3 +-- .../examples/traceroute-example.cc | 2 +- src/internet/model/ipv4-interface.cc | 2 +- src/internet/model/ipv6-interface.cc | 2 +- src/netanim/model/animation-interface.cc | 4 +-- .../examples/nix-simple-multi-address.cc | 4 +-- src/nix-vector-routing/examples/nix-simple.cc | 4 +-- src/nix-vector-routing/test/nix-test.cc | 4 +-- src/olsr/examples/olsr-hna.cc | 2 +- src/uan/examples/uan-cw-example.cc | 2 +- src/visualizer/model/pyviz.cc | 2 +- src/wave/examples/vanet-routing-compare.cc | 10 +++---- src/wave/examples/wave-simple-80211p.cc | 2 +- src/wimax/examples/wimax-ipv4.cc | 2 +- src/wimax/examples/wimax-multicast.cc | 2 +- src/wimax/examples/wimax-simple.cc | 2 +- 36 files changed, 70 insertions(+), 81 deletions(-) diff --git a/examples/energy/energy-model-example.cc b/examples/energy/energy-model-example.cc index 54eb780a6..8890db98e 100644 --- a/examples/energy/energy-model-example.cc +++ b/examples/energy/energy-model-example.cc @@ -186,7 +186,7 @@ main(int argc, char* argv[]) WifiHelper wifi; if (verbose) { - wifi.EnableLogComponents(); + WifiHelper::EnableLogComponents(); } wifi.SetStandard(WIFI_STANDARD_80211b); diff --git a/examples/energy/energy-model-with-harvesting-example.cc b/examples/energy/energy-model-with-harvesting-example.cc index 67f1b2ec8..35ac1c077 100644 --- a/examples/energy/energy-model-with-harvesting-example.cc +++ b/examples/energy/energy-model-with-harvesting-example.cc @@ -234,7 +234,7 @@ main(int argc, char* argv[]) WifiHelper wifi; if (verbose) { - wifi.EnableLogComponents(); + WifiHelper::EnableLogComponents(); } wifi.SetStandard(WIFI_STANDARD_80211b); diff --git a/examples/ipv6/fragmentation-ipv6-PMTU.cc b/examples/ipv6/fragmentation-ipv6-PMTU.cc index ae07d171f..be64d391c 100644 --- a/examples/ipv6/fragmentation-ipv6-PMTU.cc +++ b/examples/ipv6/fragmentation-ipv6-PMTU.cc @@ -120,9 +120,8 @@ main(int argc, char** argv) i3.SetForwarding(0, true); i3.SetDefaultRouteInAllNodes(0); - Ipv6StaticRoutingHelper routingHelper; Ptr routingStream = Create(&std::cout); - routingHelper.PrintRoutingTableAt(Seconds(0), r1, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(0), r1, routingStream); // Create an UDP Echo server on n2 UdpEchoServerHelper echoServer(42); diff --git a/examples/ipv6/fragmentation-ipv6-two-MTU.cc b/examples/ipv6/fragmentation-ipv6-two-MTU.cc index 346f923a3..a3205c008 100644 --- a/examples/ipv6/fragmentation-ipv6-two-MTU.cc +++ b/examples/ipv6/fragmentation-ipv6-two-MTU.cc @@ -95,9 +95,8 @@ main(int argc, char** argv) i2.SetForwarding(0, true); i2.SetDefaultRouteInAllNodes(0); - Ipv6StaticRoutingHelper routingHelper; Ptr routingStream = Create(&std::cout); - routingHelper.PrintRoutingTableAt(Seconds(0), n0, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(0), n0, routingStream); /* Create a UdpEchoClient and UdpEchoServer application to send packets from n0 to n1 via r */ uint32_t packetSize = 4096; diff --git a/examples/ipv6/fragmentation-ipv6.cc b/examples/ipv6/fragmentation-ipv6.cc index ab5c77c2f..3cbd9f708 100644 --- a/examples/ipv6/fragmentation-ipv6.cc +++ b/examples/ipv6/fragmentation-ipv6.cc @@ -92,9 +92,8 @@ main(int argc, char** argv) i2.SetForwarding(0, true); i2.SetDefaultRouteInAllNodes(0); - Ipv6StaticRoutingHelper routingHelper; Ptr routingStream = Create(&std::cout); - routingHelper.PrintRoutingTableAt(Seconds(0), n0, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(0), n0, routingStream); /* Create a UdpEchoClient and UdpEchoServer application to send packets from n0 to n1 via r */ uint32_t packetSize = 4096; diff --git a/examples/ipv6/icmpv6-redirect.cc b/examples/ipv6/icmpv6-redirect.cc index 0d11e5831..4497f5e63 100644 --- a/examples/ipv6/icmpv6-redirect.cc +++ b/examples/ipv6/icmpv6-redirect.cc @@ -114,8 +114,8 @@ main(int argc, char** argv) iic1.GetInterfaceIndex(1)); Ptr routingStream = Create(&std::cout); - routingHelper.PrintRoutingTableAt(Seconds(0.0), r1, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(3.0), sta1, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(0.0), r1, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(3.0), sta1, routingStream); NS_LOG_INFO("Create Applications."); uint32_t packetSize = 1024; diff --git a/examples/ipv6/radvd-two-prefix.cc b/examples/ipv6/radvd-two-prefix.cc index 19a9c2cac..d6087aebf 100644 --- a/examples/ipv6/radvd-two-prefix.cc +++ b/examples/ipv6/radvd-two-prefix.cc @@ -203,10 +203,9 @@ main(int argc, char** argv) apps.Start(Seconds(2.0)); apps.Stop(Seconds(5.0)); - Ipv6StaticRoutingHelper routingHelper; Ptr routingStream = Create(&std::cout); - routingHelper.PrintRoutingTableAt(Seconds(2.0), n0, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(10.0), n0, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(2.0), n0, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(10.0), n0, routingStream); IpAddressHelper ipAddressHelper; /* RA should be received, two prefixes + routes + default route should be present */ diff --git a/examples/routing/dynamic-global-routing.cc b/examples/routing/dynamic-global-routing.cc index 9e2744726..a4484df3a 100644 --- a/examples/routing/dynamic-global-routing.cc +++ b/examples/routing/dynamic-global-routing.cc @@ -210,10 +210,9 @@ main(int argc, char* argv[]) Simulator::Schedule(Seconds(14), &Ipv4::SetUp, ipv41, ipv4ifIndex1); // Trace routing tables - Ipv4GlobalRoutingHelper g; Ptr routingStream = Create("dynamic-global-routing.routes", std::ios::out); - g.PrintRoutingTableAllAt(Seconds(12), routingStream); + Ipv4RoutingHelper::PrintRoutingTableAllAt(Seconds(12), routingStream); NS_LOG_INFO("Run Simulation."); Simulator::Run(); diff --git a/examples/routing/global-routing-multi-switch-plus-router.cc b/examples/routing/global-routing-multi-switch-plus-router.cc index b76a19147..a6528ee80 100644 --- a/examples/routing/global-routing-multi-switch-plus-router.cc +++ b/examples/routing/global-routing-multi-switch-plus-router.cc @@ -710,8 +710,7 @@ main(int argc, char* argv[]) Create("global-routing-multi-switch-plus-router.routes", std::ios::out); - Ipv4GlobalRoutingHelper g; - g.PrintRoutingTableAllAt(Seconds(0.1), routingStream); + Ipv4RoutingHelper::PrintRoutingTableAllAt(Seconds(0.1), routingStream); // ====================================================================== // Configure PCAP traces diff --git a/examples/routing/rip-simple-network.cc b/examples/routing/rip-simple-network.cc index 47cbf336b..5c4c52786 100644 --- a/examples/routing/rip-simple-network.cc +++ b/examples/routing/rip-simple-network.cc @@ -213,24 +213,22 @@ main(int argc, char** argv) if (printRoutingTables) { - RipHelper routingHelper; - Ptr routingStream = Create(&std::cout); - routingHelper.PrintRoutingTableAt(Seconds(30.0), a, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(30.0), b, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(30.0), c, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(30.0), d, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30.0), a, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30.0), b, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30.0), c, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(30.0), d, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(60.0), a, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(60.0), b, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(60.0), c, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(60.0), d, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60.0), a, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60.0), b, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60.0), c, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(60.0), d, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(90.0), a, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(90.0), b, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(90.0), c, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(90.0), d, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90.0), a, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90.0), b, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90.0), c, routingStream); + Ipv4RoutingHelper::PrintRoutingTableAt(Seconds(90.0), d, routingStream); } NS_LOG_INFO("Create Applications."); diff --git a/examples/routing/ripng-simple-network.cc b/examples/routing/ripng-simple-network.cc index 4d49ca0fe..b336af7af 100644 --- a/examples/routing/ripng-simple-network.cc +++ b/examples/routing/ripng-simple-network.cc @@ -218,24 +218,22 @@ main(int argc, char** argv) if (printRoutingTables) { - RipNgHelper routingHelper; - Ptr routingStream = Create(&std::cout); - routingHelper.PrintRoutingTableAt(Seconds(30.0), a, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(30.0), b, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(30.0), c, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(30.0), d, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30.0), a, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30.0), b, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30.0), c, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(30.0), d, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(60.0), a, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(60.0), b, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(60.0), c, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(60.0), d, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60.0), a, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60.0), b, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60.0), c, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(60.0), d, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(90.0), a, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(90.0), b, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(90.0), c, routingStream); - routingHelper.PrintRoutingTableAt(Seconds(90.0), d, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90.0), a, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90.0), b, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90.0), c, routingStream); + Ipv6RoutingHelper::PrintRoutingTableAt(Seconds(90.0), d, routingStream); } NS_LOG_INFO("Create Applications."); diff --git a/examples/wireless/wifi-simple-adhoc-grid.cc b/examples/wireless/wifi-simple-adhoc-grid.cc index e63530dd4..7f7e2fb2d 100644 --- a/examples/wireless/wifi-simple-adhoc-grid.cc +++ b/examples/wireless/wifi-simple-adhoc-grid.cc @@ -168,7 +168,7 @@ main(int argc, char* argv[]) WifiHelper wifi; if (verbose) { - wifi.EnableLogComponents(); // Turn on all Wifi logging + WifiHelper::EnableLogComponents(); // Turn on all Wifi logging } YansWifiPhyHelper wifiPhy; @@ -246,10 +246,10 @@ main(int argc, char* argv[]) // Trace routing tables Ptr routingStream = Create("wifi-simple-adhoc-grid.routes", std::ios::out); - olsr.PrintRoutingTableAllEvery(Seconds(2), routingStream); + Ipv4RoutingHelper::PrintRoutingTableAllEvery(Seconds(2), routingStream); Ptr neighborStream = Create("wifi-simple-adhoc-grid.neighbors", std::ios::out); - olsr.PrintNeighborCacheAllEvery(Seconds(2), neighborStream); + Ipv4RoutingHelper::PrintNeighborCacheAllEvery(Seconds(2), neighborStream); // To do-- enable an IP-level trace that shows forwarding events only } diff --git a/examples/wireless/wifi-simple-adhoc.cc b/examples/wireless/wifi-simple-adhoc.cc index a7f880e47..b24b7d7c4 100644 --- a/examples/wireless/wifi-simple-adhoc.cc +++ b/examples/wireless/wifi-simple-adhoc.cc @@ -137,7 +137,7 @@ main(int argc, char* argv[]) WifiHelper wifi; if (verbose) { - wifi.EnableLogComponents(); // Turn on all Wifi logging + WifiHelper::EnableLogComponents(); // Turn on all Wifi logging } wifi.SetStandard(WIFI_STANDARD_80211b); diff --git a/examples/wireless/wifi-simple-infra.cc b/examples/wireless/wifi-simple-infra.cc index c66c4a915..208203bf9 100644 --- a/examples/wireless/wifi-simple-infra.cc +++ b/examples/wireless/wifi-simple-infra.cc @@ -168,7 +168,7 @@ main(int argc, char* argv[]) WifiHelper wifi; if (verbose) { - wifi.EnableLogComponents(); // Turn on all Wifi logging + WifiHelper::EnableLogComponents(); // Turn on all Wifi logging } wifi.SetStandard(WIFI_STANDARD_80211b); diff --git a/examples/wireless/wifi-simple-interference.cc b/examples/wireless/wifi-simple-interference.cc index 575efbd8f..cdc054298 100644 --- a/examples/wireless/wifi-simple-interference.cc +++ b/examples/wireless/wifi-simple-interference.cc @@ -198,7 +198,7 @@ main(int argc, char* argv[]) WifiHelper wifi; if (verbose) { - wifi.EnableLogComponents(); // Turn on all Wifi logging + WifiHelper::EnableLogComponents(); // Turn on all Wifi logging } wifi.SetStandard(WIFI_STANDARD_80211b); diff --git a/examples/wireless/wifi-sleep.cc b/examples/wireless/wifi-sleep.cc index cc3a5260e..857ea2039 100644 --- a/examples/wireless/wifi-sleep.cc +++ b/examples/wireless/wifi-sleep.cc @@ -147,7 +147,7 @@ main(int argc, char* argv[]) WifiHelper wifi; if (verbose) { - wifi.EnableLogComponents(); // Turn on all Wifi logging + WifiHelper::EnableLogComponents(); // Turn on all Wifi logging } wifi.SetStandard(WIFI_STANDARD_80211b); diff --git a/src/antenna/model/angles.cc b/src/antenna/model/angles.cc index 7b4bf5122..18e7e86f8 100644 --- a/src/antenna/model/angles.cc +++ b/src/antenna/model/angles.cc @@ -132,7 +132,7 @@ operator<<(std::ostream& os, const Angles& a) double incl; std::string unit; - if (a.m_printDeg) + if (Angles::m_printDeg) { azim = RadiansToDegrees(a.m_azimuth); incl = RadiansToDegrees(a.m_inclination); diff --git a/src/aodv/examples/aodv.cc b/src/aodv/examples/aodv.cc index 498d65a3b..0d32222d4 100644 --- a/src/aodv/examples/aodv.cc +++ b/src/aodv/examples/aodv.cc @@ -234,7 +234,7 @@ AodvExample::InstallInternetStack() { Ptr routingStream = Create("aodv.routes", std::ios::out); - aodv.PrintRoutingTableAllAt(Seconds(8), routingStream); + Ipv4RoutingHelper::PrintRoutingTableAllAt(Seconds(8), routingStream); } } diff --git a/src/dsdv/examples/dsdv-manet.cc b/src/dsdv/examples/dsdv-manet.cc index cff66e7ac..63ca9ef19 100644 --- a/src/dsdv/examples/dsdv-manet.cc +++ b/src/dsdv/examples/dsdv-manet.cc @@ -377,7 +377,7 @@ DsdvManetExample::InstallInternetStack(std::string tr_name) { Ptr routingStream = Create((tr_name + ".routes"), std::ios::out); - dsdv.PrintRoutingTableAllAt(Seconds(m_periodicUpdateInterval), routingStream); + Ipv4RoutingHelper::PrintRoutingTableAllAt(Seconds(m_periodicUpdateInterval), routingStream); } } diff --git a/src/dsr/model/dsr-routing.cc b/src/dsr/model/dsr-routing.cc index 4ec41cba5..7694fadd4 100644 --- a/src/dsr/model/dsr-routing.cc +++ b/src/dsr/model/dsr-routing.cc @@ -551,7 +551,7 @@ DsrRouting::GetElementsFromContext(std::string context) std::vector elements; size_t pos1 = 0; size_t pos2; - while (pos1 != context.npos) + while (pos1 != std::string::npos) { pos1 = context.find('/', pos1); pos2 = context.find('/', pos1 + 1); diff --git a/src/fd-net-device/examples/fd-emu-tc.cc b/src/fd-net-device/examples/fd-emu-tc.cc index e05754ffc..2e5cb304d 100644 --- a/src/fd-net-device/examples/fd-emu-tc.cc +++ b/src/fd-net-device/examples/fd-emu-tc.cc @@ -304,10 +304,9 @@ main(int argc, char* argv[]) } #endif - Ipv4GlobalRoutingHelper g; Ptr routingStream = Create("router-routes.txt", std::ios::out); - g.PrintRoutingTableAllAt(Seconds(3), routingStream); + Ipv4RoutingHelper::PrintRoutingTableAllAt(Seconds(3), routingStream); } NS_LOG_INFO("Run Emulation."); diff --git a/src/internet-apps/examples/traceroute-example.cc b/src/internet-apps/examples/traceroute-example.cc index 6514326af..88e62473a 100644 --- a/src/internet-apps/examples/traceroute-example.cc +++ b/src/internet-apps/examples/traceroute-example.cc @@ -236,7 +236,7 @@ TracerouteExample::InstallInternetStack() { Ptr routingStream = Create("aodv.routes", std::ios::out); - aodv.PrintRoutingTableAllAt(Seconds(8), routingStream); + Ipv4RoutingHelper::PrintRoutingTableAllAt(Seconds(8), routingStream); } } diff --git a/src/internet/model/ipv4-interface.cc b/src/internet/model/ipv4-interface.cc index d1ca62671..8790e1409 100644 --- a/src/internet/model/ipv4-interface.cc +++ b/src/internet/model/ipv4-interface.cc @@ -387,7 +387,7 @@ Ipv4Interface::RemoveAddress(Ipv4Address address) { NS_LOG_FUNCTION(this << address); - if (address == address.GetLoopback()) + if (address == Ipv4Address::GetLoopback()) { NS_LOG_WARN("Cannot remove loopback address."); return Ipv4InterfaceAddress(); diff --git a/src/internet/model/ipv6-interface.cc b/src/internet/model/ipv6-interface.cc index 81b0efeae..3e137a5d4 100644 --- a/src/internet/model/ipv6-interface.cc +++ b/src/internet/model/ipv6-interface.cc @@ -361,7 +361,7 @@ Ipv6Interface::RemoveAddress(Ipv6Address address) { NS_LOG_FUNCTION(this << address); - if (address == address.GetLoopback()) + if (address == Ipv6Address::GetLoopback()) { NS_LOG_WARN("Cannot remove loopback address."); return Ipv6InterfaceAddress(); diff --git a/src/netanim/model/animation-interface.cc b/src/netanim/model/animation-interface.cc index 2e5a2af85..772209e8c 100644 --- a/src/netanim/model/animation-interface.cc +++ b/src/netanim/model/animation-interface.cc @@ -611,13 +611,13 @@ AnimationInterface::GetElementsFromContext(const std::string& context) const std::vector elements; std::size_t pos1 = 0; std::size_t pos2; - while (pos1 != context.npos) + while (pos1 != std::string::npos) { pos1 = context.find('/', pos1); pos2 = context.find('/', pos1 + 1); elements.push_back(context.substr(pos1 + 1, pos2 - (pos1 + 1))); pos1 = pos2; - pos2 = context.npos; + pos2 = std::string::npos; } return elements; } diff --git a/src/nix-vector-routing/examples/nix-simple-multi-address.cc b/src/nix-vector-routing/examples/nix-simple-multi-address.cc index 2330d2735..6f1521adc 100644 --- a/src/nix-vector-routing/examples/nix-simple-multi-address.cc +++ b/src/nix-vector-routing/examples/nix-simple-multi-address.cc @@ -214,7 +214,7 @@ main(int argc, char* argv[]) interfaces12.GetAddress(1, 1), routingStream); // Trace routing tables. - nixRouting.PrintRoutingTableAllAt(Seconds(4), routingStream); + Ipv4NixVectorHelper::PrintRoutingTableAllAt(Seconds(4), routingStream); // Assign address5 addresses to n2 and n3. // n2 gets 10.2.3.1 and n3 gets 10.2.3.2 on the same interface. Simulator::Schedule(Seconds(5), &Ipv4AddressHelper::Assign, &address5, devices34); @@ -223,7 +223,7 @@ main(int argc, char* argv[]) // Notice that NixCache and Ipv4RouteCache becomes empty for each node. // This happens because new addresses are added at t = +5s, due to which // existing caches get flushed. - nixRouting.PrintRoutingTableAllAt(Seconds(6), routingStream); + Ipv4NixVectorHelper::PrintRoutingTableAllAt(Seconds(6), routingStream); // Check the path from n0 to n3 (10.2.3.2). nixRouting.PrintRoutingPathAt(Seconds(7), diff --git a/src/nix-vector-routing/examples/nix-simple.cc b/src/nix-vector-routing/examples/nix-simple.cc index f7eaf399a..87e323782 100644 --- a/src/nix-vector-routing/examples/nix-simple.cc +++ b/src/nix-vector-routing/examples/nix-simple.cc @@ -255,7 +255,7 @@ main(int argc, char* argv[]) interfaces01.GetAddress(1), routingStream); // Trace routing tables - nixRouting.PrintRoutingTableAllAt(Seconds(8), routingStream); + Ipv4NixVectorHelper::PrintRoutingTableAllAt(Seconds(8), routingStream); } else { @@ -302,7 +302,7 @@ main(int argc, char* argv[]) interfaces01.GetAddress(1, 1), routingStream); // Trace routing tables - nixRouting.PrintRoutingTableAllAt(Seconds(8), routingStream); + Ipv6NixVectorHelper::PrintRoutingTableAllAt(Seconds(8), routingStream); } UdpEchoServerHelper echoServer(9); diff --git a/src/nix-vector-routing/test/nix-test.cc b/src/nix-vector-routing/test/nix-test.cc index 9e0e9d5d5..c412e1403 100644 --- a/src/nix-vector-routing/test/nix-test.cc +++ b/src/nix-vector-routing/test/nix-test.cc @@ -297,8 +297,8 @@ NixVectorRoutingTest::DoRun() ifIndex = ipv6->GetInterfaceForDevice(dAdC.Get(0)); Simulator::Schedule(Seconds(5), &Ipv6::SetDown, ipv6, ifIndex); - ipv4NixRouting.PrintRoutingTableAllAt(Seconds(7), cacheStreamv4); - ipv6NixRouting.PrintRoutingTableAllAt(Seconds(7), cacheStreamv6); + Ipv4NixVectorHelper::PrintRoutingTableAllAt(Seconds(7), cacheStreamv4); + Ipv6NixVectorHelper::PrintRoutingTableAllAt(Seconds(7), cacheStreamv6); SendData(Seconds(8), txSocket, Ipv4Address("10.1.3.2")); SendData(Seconds(8), txSocket, Ipv6Address("2001:3::200:ff:fe00:8")); diff --git a/src/olsr/examples/olsr-hna.cc b/src/olsr/examples/olsr-hna.cc index 187288fa3..457ecb23d 100644 --- a/src/olsr/examples/olsr-hna.cc +++ b/src/olsr/examples/olsr-hna.cc @@ -138,7 +138,7 @@ main(int argc, char* argv[]) WifiHelper wifi; if (verbose) { - wifi.EnableLogComponents(); // Turn on all Wifi logging + WifiHelper::EnableLogComponents(); // Turn on all Wifi logging } wifi.SetStandard(WIFI_STANDARD_80211b); diff --git a/src/uan/examples/uan-cw-example.cc b/src/uan/examples/uan-cw-example.cc index 91b5d7044..7423fb62d 100644 --- a/src/uan/examples/uan-cw-example.cc +++ b/src/uan/examples/uan-cw-example.cc @@ -227,7 +227,7 @@ Experiment::Run(UanHelper& uan) { NS_FATAL_ERROR("Could not open ascii trace file: " << m_asciitracefile); } - uan.EnableAsciiAll(ascii); + UanHelper::EnableAsciiAll(ascii); Simulator::Run(); sinkNode = nullptr; diff --git a/src/visualizer/model/pyviz.cc b/src/visualizer/model/pyviz.cc index 11928bcdc..8090d9a89 100644 --- a/src/visualizer/model/pyviz.cc +++ b/src/visualizer/model/pyviz.cc @@ -43,7 +43,7 @@ PathSplit(std::string str) { std::vector results; size_t cutAt; - while ((cutAt = str.find_first_of('/')) != str.npos) + while ((cutAt = str.find_first_of('/')) != std::string::npos) { if (cutAt > 0) { diff --git a/src/wave/examples/vanet-routing-compare.cc b/src/wave/examples/vanet-routing-compare.cc index 31fc5cc3d..d3e380614 100644 --- a/src/wave/examples/vanet-routing-compare.cc +++ b/src/wave/examples/vanet-routing-compare.cc @@ -549,7 +549,7 @@ RoutingHelper::SetupRoutingProtocol(NodeContainer& c) case 1: if (m_routingTables) { - olsr.PrintRoutingTableAllAt(rtt, rtw); + Ipv4RoutingHelper::PrintRoutingTableAllAt(rtt, rtw); } list.Add(olsr, 100); m_protocolName = "OLSR"; @@ -557,7 +557,7 @@ RoutingHelper::SetupRoutingProtocol(NodeContainer& c) case 2: if (m_routingTables) { - aodv.PrintRoutingTableAllAt(rtt, rtw); + Ipv4RoutingHelper::PrintRoutingTableAllAt(rtt, rtw); } list.Add(aodv, 100); m_protocolName = "AODV"; @@ -565,7 +565,7 @@ RoutingHelper::SetupRoutingProtocol(NodeContainer& c) case 3: if (m_routingTables) { - dsdv.PrintRoutingTableAllAt(rtt, rtw); + ns3::DsdvHelper::PrintRoutingTableAllAt(rtt, rtw); } list.Add(dsdv, 100); m_protocolName = "DSDV"; @@ -2293,9 +2293,9 @@ VanetRoutingExperiment::SetupAdhocDevices() Wifi80211pHelper wifi80211p = Wifi80211pHelper::Default(); if (m_verbose) { - wifi80211p.EnableLogComponents(); // Turn on all Wifi 802.11p logging + Wifi80211pHelper::EnableLogComponents(); // Turn on all Wifi 802.11p logging // likewise, turn on WAVE PHY logging - waveHelper.EnableLogComponents(); + WaveHelper::EnableLogComponents(); } WifiHelper wifi; diff --git a/src/wave/examples/wave-simple-80211p.cc b/src/wave/examples/wave-simple-80211p.cc index 3804a1fa0..db036b783 100644 --- a/src/wave/examples/wave-simple-80211p.cc +++ b/src/wave/examples/wave-simple-80211p.cc @@ -146,7 +146,7 @@ main(int argc, char* argv[]) Wifi80211pHelper wifi80211p = Wifi80211pHelper::Default(); if (verbose) { - wifi80211p.EnableLogComponents(); // Turn on all Wifi 802.11p logging + Wifi80211pHelper::EnableLogComponents(); // Turn on all Wifi 802.11p logging } wifi80211p.SetRemoteStationManager("ns3::ConstantRateWifiManager", diff --git a/src/wimax/examples/wimax-ipv4.cc b/src/wimax/examples/wimax-ipv4.cc index 2c0d98f30..4de5b58ac 100644 --- a/src/wimax/examples/wimax-ipv4.cc +++ b/src/wimax/examples/wimax-ipv4.cc @@ -144,7 +144,7 @@ main(int argc, char* argv[]) Ipv4InterfaceContainer BSinterface = address.Assign(bsDevs); if (verbose) { - wimax.EnableLogComponents(); // Turn on all wimax logging + WimaxHelper::EnableLogComponents(); // Turn on all wimax logging } /*------------------------------*/ UdpServerHelper* udpServer = new UdpServerHelper[nbSS / 2]; diff --git a/src/wimax/examples/wimax-multicast.cc b/src/wimax/examples/wimax-multicast.cc index 3aa060745..b4ad8b714 100644 --- a/src/wimax/examples/wimax-multicast.cc +++ b/src/wimax/examples/wimax-multicast.cc @@ -157,7 +157,7 @@ main(int argc, char* argv[]) bsDevs.Add(dev); if (verbose) { - wimax.EnableLogComponents(); // Turn on all wimax logging + WimaxHelper::EnableLogComponents(); // Turn on all wimax logging } for (int i = 0; i < nbSS; i++) diff --git a/src/wimax/examples/wimax-simple.cc b/src/wimax/examples/wimax-simple.cc index 3a575e374..e917ce313 100644 --- a/src/wimax/examples/wimax-simple.cc +++ b/src/wimax/examples/wimax-simple.cc @@ -136,7 +136,7 @@ main(int argc, char* argv[]) if (verbose) { - wimax.EnableLogComponents(); // Turn on all wimax logging + WimaxHelper::EnableLogComponents(); // Turn on all wimax logging } /*------------------------------*/ UdpServerHelper udpServer;