Skip to content

Commit

Permalink
tap-bridge: Deprecate unused 'Gateway' attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
a-andre authored and tomhenderson committed Dec 30, 2024
1 parent b17fc02 commit 223e0ad
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/tap-bridge/examples/tap-wifi-dumbbell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 0 additions & 1 deletion src/tap-bridge/helper/tap-bridge-helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
1 change: 1 addition & 0 deletions src/tap-bridge/helper/tap-bridge-helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/**
Expand Down
30 changes: 11 additions & 19 deletions src/tap-bridge/model/tap-bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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. "
Expand Down Expand Up @@ -374,7 +375,6 @@ TapBridge::CreateTap()
// quite a bit of information.
//
// -d<device-name> The name of the tap device we want to create;
// -g<gateway-address> The IP address to use as the default gateway;
// -i<IP-address> The IP address to assign to the new tap device;
// -m<MAC-address> The MAC-48 address to assign to the new tap device;
// -n<network-mask> The network mask to assign to the new tap device;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -506,23 +499,22 @@ 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.
//
status = ::execlp(TAP_CREATOR,
TAP_CREATOR, // argv[0] (filename)
ossDeviceName.str().c_str(), // argv[1] (-d<device name>)
ossGateway.str().c_str(), // argv[2] (-g<gateway>)
ossIp.str().c_str(), // argv[3] (-i<IP address>)
ossMac.str().c_str(), // argv[4] (-m<MAC address>)
ossNetmask.str().c_str(), // argv[5] (-n<net mask>)
ossMode.str().c_str(), // argv[6] (-o<operating mode>)
ossPath.str().c_str(), // argv[7] (-p<path>)
ossVerbose.str().c_str(), // argv[8] (-v)
ossIp.str().c_str(), // argv[2] (-i<IP address>)
ossMac.str().c_str(), // argv[3] (-m<MAC address>)
ossNetmask.str().c_str(), // argv[4] (-n<net mask>)
ossMode.str().c_str(), // argv[5] (-o<operating mode>)
ossPath.str().c_str(), // argv[6] (-p<path>)
ossVerbose.str().c_str(), // argv[7] (-v)
(char*)nullptr);

//
Expand Down
2 changes: 1 addition & 1 deletion src/tap-bridge/model/tap-bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 223e0ad

Please sign in to comment.