From 223e0ad68aa4e9c422fd6731c81943d3012579e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Wed, 11 Dec 2024 17:10:01 +0100 Subject: [PATCH] tap-bridge: Deprecate unused 'Gateway' attribute --- CHANGES.md | 1 + src/tap-bridge/examples/tap-wifi-dumbbell.cc | 2 +- src/tap-bridge/helper/tap-bridge-helper.cc | 1 - src/tap-bridge/helper/tap-bridge-helper.h | 1 + src/tap-bridge/model/tap-bridge.cc | 30 +++++++------------- src/tap-bridge/model/tap-bridge.h | 2 +- 6 files changed, 15 insertions(+), 22 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a93cdf56a..c4bd0f405 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,7 @@ This file is a best-effort approach to solving this issue; we will do our best b * (applications) Deprecated attributes `ThreeGppHttpClient::RemoteServerAddress` and `ThreeGppHttpClient::RemoteServerPort`. They have been combined into a single `ThreeGppHttpClient::Remote` attribute. * (lr-wpan) ``LrWpanMac`` is now also aggregated to ``LrWpanNetDevice``. * (stats) Deprecated ns3::NaN and ns3::isNaN to use std::nan and std::isnan in their place +* (tap-bridge) Deprecated "Gateway" attribute. * (wifi) Added a new **ProtectedIfResponded** attribute to `FrameExchangeManager` to disable RTS/CTS protection for stations that have already responded to a frame requiring acknowledgment in the same TXOP, even if such frame had not been protected by RTS/CTS. The default value is true, even though it represents a change with respect to the previous behavior, because it is likely a more realistic choice. * (wifi) Deprecated setters/getters of the {Ht,Vht,He}Configuration classes that trivially set/get member variables, which have been made public and hence accessible to users. diff --git a/src/tap-bridge/examples/tap-wifi-dumbbell.cc b/src/tap-bridge/examples/tap-wifi-dumbbell.cc index d0292a201..ef1504885 100644 --- a/src/tap-bridge/examples/tap-wifi-dumbbell.cc +++ b/src/tap-bridge/examples/tap-wifi-dumbbell.cc @@ -158,7 +158,7 @@ main(int argc, char* argv[]) ipv4Left.SetBase("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer interfacesLeft = ipv4Left.Assign(devicesLeft); - TapBridgeHelper tapBridge(interfacesLeft.GetAddress(1)); + TapBridgeHelper tapBridge; tapBridge.SetAttribute("Mode", StringValue(mode)); tapBridge.SetAttribute("DeviceName", StringValue(tapName)); tapBridge.Install(nodesLeft.Get(0), devicesLeft.Get(0)); diff --git a/src/tap-bridge/helper/tap-bridge-helper.cc b/src/tap-bridge/helper/tap-bridge-helper.cc index 5b0c94211..f6171909d 100644 --- a/src/tap-bridge/helper/tap-bridge-helper.cc +++ b/src/tap-bridge/helper/tap-bridge-helper.cc @@ -27,7 +27,6 @@ TapBridgeHelper::TapBridgeHelper(Ipv4Address gateway) { NS_LOG_FUNCTION_NOARGS(); m_deviceFactory.SetTypeId("ns3::TapBridge"); - SetAttribute("Gateway", Ipv4AddressValue(gateway)); SetAttribute("Mode", EnumValue(TapBridge::CONFIGURE_LOCAL)); } diff --git a/src/tap-bridge/helper/tap-bridge-helper.h b/src/tap-bridge/helper/tap-bridge-helper.h index 2bee4c046..b49f46648 100644 --- a/src/tap-bridge/helper/tap-bridge-helper.h +++ b/src/tap-bridge/helper/tap-bridge-helper.h @@ -41,6 +41,7 @@ class TapBridgeHelper * @param gateway An Ipv4Address to be used as the default gateway for * the created bridges, */ + NS_DEPRECATED_3_44("Use TapBridgeHelper()") TapBridgeHelper(Ipv4Address gateway); /** diff --git a/src/tap-bridge/model/tap-bridge.cc b/src/tap-bridge/model/tap-bridge.cc index 7f1785244..a35fdb73f 100644 --- a/src/tap-bridge/model/tap-bridge.cc +++ b/src/tap-bridge/model/tap-bridge.cc @@ -89,7 +89,8 @@ TapBridge::GetTypeId() "when in ConfigureLocal mode.", Ipv4AddressValue("255.255.255.255"), MakeIpv4AddressAccessor(&TapBridge::m_tapGateway), - MakeIpv4AddressChecker()) + MakeIpv4AddressChecker(), + TypeId::OBSOLETE) .AddAttribute( "IpAddress", "The IP address to assign to the tap device, when in ConfigureLocal mode. " @@ -374,7 +375,6 @@ TapBridge::CreateTap() // quite a bit of information. // // -d The name of the tap device we want to create; - // -g The IP address to use as the default gateway; // -i The IP address to assign to the new tap device; // -m The MAC-48 address to assign to the new tap device; // -n The network mask to assign to the new tap device; @@ -439,13 +439,6 @@ TapBridge::CreateTap() std::ostringstream ossDeviceName; ossDeviceName << "-d" << m_tapDeviceName; - // - // The gateway-address is something we can't derive, so we rely on it - // being configured via an Attribute through the helper. - // - std::ostringstream ossGateway; - ossGateway << "-g" << m_tapGateway; - // // For flexibility, we do allow a client to override any of the values // above via attributes, so only use our found values if the Attribute @@ -506,9 +499,9 @@ TapBridge::CreateTap() ossPath << "-p" << path; NS_LOG_DEBUG("Executing: " << TAP_CREATOR << " " << ossDeviceName.str() << " " - << ossGateway.str() << " " << ossIp.str() << " " << ossMac.str() - << " " << ossNetmask.str() << " " << ossMode.str() << " " - << ossPath.str() << " " << ossVerbose.str()); + << ossIp.str() << " " << ossMac.str() << " " << ossNetmask.str() + << " " << ossMode.str() << " " << ossPath.str() << " " + << ossVerbose.str()); // // Execute the socket creation process image. @@ -516,13 +509,12 @@ TapBridge::CreateTap() status = ::execlp(TAP_CREATOR, TAP_CREATOR, // argv[0] (filename) ossDeviceName.str().c_str(), // argv[1] (-d) - ossGateway.str().c_str(), // argv[2] (-g) - ossIp.str().c_str(), // argv[3] (-i) - ossMac.str().c_str(), // argv[4] (-m) - ossNetmask.str().c_str(), // argv[5] (-n) - ossMode.str().c_str(), // argv[6] (-o) - ossPath.str().c_str(), // argv[7] (-p) - ossVerbose.str().c_str(), // argv[8] (-v) + ossIp.str().c_str(), // argv[2] (-i) + ossMac.str().c_str(), // argv[3] (-m) + ossNetmask.str().c_str(), // argv[4] (-n) + ossMode.str().c_str(), // argv[5] (-o) + ossPath.str().c_str(), // argv[6] (-p) + ossVerbose.str().c_str(), // argv[7] (-v) (char*)nullptr); // diff --git a/src/tap-bridge/model/tap-bridge.h b/src/tap-bridge/model/tap-bridge.h index c76f5ce30..5d303d920 100644 --- a/src/tap-bridge/model/tap-bridge.h +++ b/src/tap-bridge/model/tap-bridge.h @@ -401,7 +401,7 @@ class TapBridge : public NetDevice /** * The IP address to use as the device default gateway on the host. */ - Ipv4Address m_tapGateway; + Ipv4Address m_tapGateway; // NS_DEPRECATED_3_44 /** * The IP address to use as the device IP on the host.