brite, click: Fix clang-tidy warnings
This commit is contained in:
@@ -412,8 +412,8 @@ BriteTopologyHelper::BuildBriteTopology(InternetStackHelper& stack, const uint32
|
||||
NS_LOG_LOGIC("Assigning << " << m_numAs << " AS to " << systemCount << " MPI instances");
|
||||
for (uint32_t i = 0; i < m_numAs; ++i)
|
||||
{
|
||||
int val = i % systemCount;
|
||||
m_systemForAs.push_back(val);
|
||||
uint32_t val = i % systemCount;
|
||||
m_systemForAs.push_back(static_cast<int>(val));
|
||||
NS_LOG_INFO("AS: " << i << " System: " << val);
|
||||
}
|
||||
|
||||
|
||||
@@ -227,14 +227,7 @@ Ipv4ClickRouting::GetInterfaceId(const char* ifname)
|
||||
bool
|
||||
Ipv4ClickRouting::IsInterfaceReady(int ifid)
|
||||
{
|
||||
if (ifid >= 0 && ifid < (int)m_ipv4->GetNInterfaces())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return ifid >= 0 && ifid < static_cast<int>(m_ipv4->GetNInterfaces());
|
||||
}
|
||||
|
||||
std::string
|
||||
@@ -288,7 +281,7 @@ Ipv4ClickRouting::GetTimevalFromNow() const
|
||||
curtime.tv_sec = Simulator::Now().GetSeconds();
|
||||
curtime.tv_usec = Simulator::Now().GetMicroSeconds() % 1000000;
|
||||
|
||||
switch (Simulator::Now().GetResolution())
|
||||
switch (Simulator::Now()::GetResolution())
|
||||
{
|
||||
case Time::NS:
|
||||
remainder = Simulator::Now().GetNanoSeconds() % 1000;
|
||||
|
||||
@@ -229,11 +229,10 @@ Ipv4L3ClickProtocol::IsDestinationAddress(Ipv4Address address, uint32_t iif) con
|
||||
#ifdef NOTYET
|
||||
if (MulticastCheckGroup(iif, address))
|
||||
#endif
|
||||
if (true)
|
||||
{
|
||||
NS_LOG_LOGIC("For me (Ipv4Addr multicast address");
|
||||
return true;
|
||||
}
|
||||
{
|
||||
NS_LOG_LOGIC("For me (Ipv4Addr multicast address");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (address.IsBroadcast())
|
||||
@@ -470,7 +469,7 @@ Ipv4L3ClickProtocol::SourceAddressSelection(uint32_t interfaceIdx, Ipv4Address d
|
||||
Ipv4InterfaceAddress test = GetAddress(interfaceIdx, i);
|
||||
if (test.GetLocal().CombineMask(test.GetMask()) == dest.CombineMask(test.GetMask()))
|
||||
{
|
||||
if (test.IsSecondary() == false)
|
||||
if (!test.IsSecondary())
|
||||
{
|
||||
return test.GetLocal();
|
||||
}
|
||||
@@ -677,7 +676,7 @@ Ipv4L3ClickProtocol::BuildHeader(Ipv4Address source,
|
||||
ipHeader.SetProtocol(protocol);
|
||||
ipHeader.SetPayloadSize(payloadSize);
|
||||
ipHeader.SetTtl(ttl);
|
||||
if (mayFragment == true)
|
||||
if (mayFragment)
|
||||
{
|
||||
ipHeader.SetMayFragment();
|
||||
ipHeader.SetIdentification(m_identification);
|
||||
@@ -786,7 +785,7 @@ Ipv4L3ClickProtocol::Receive(Ptr<NetDevice> device,
|
||||
NS_LOG_LOGIC("Packet from " << from << " received on node " << m_node->GetId());
|
||||
|
||||
// Forward packet to raw sockets, if any
|
||||
if (protocol == Ipv4L3ClickProtocol::PROT_NUMBER && m_sockets.size() > 0)
|
||||
if (protocol == Ipv4L3ClickProtocol::PROT_NUMBER && !m_sockets.empty())
|
||||
{
|
||||
Ptr<Packet> packetForRawSocket = p->Copy();
|
||||
int32_t interface = GetInterfaceForDevice(device);
|
||||
@@ -854,8 +853,7 @@ Ipv4L3ClickProtocol::LocalDeliver(Ptr<const Packet> packet, const Ipv4Header& ip
|
||||
case IpL4Protocol::RX_CSUM_FAILED:
|
||||
break;
|
||||
case IpL4Protocol::RX_ENDPOINT_UNREACH:
|
||||
if (ip.GetDestination().IsBroadcast() == true ||
|
||||
ip.GetDestination().IsMulticast() == true)
|
||||
if (ip.GetDestination().IsBroadcast() || ip.GetDestination().IsMulticast())
|
||||
{
|
||||
break; // Do not reply to broadcast or multicast
|
||||
}
|
||||
@@ -871,7 +869,7 @@ Ipv4L3ClickProtocol::LocalDeliver(Ptr<const Packet> packet, const Ipv4Header& ip
|
||||
subnetDirected = true;
|
||||
}
|
||||
}
|
||||
if (subnetDirected == false)
|
||||
if (!subnetDirected)
|
||||
{
|
||||
GetIcmp()->SendDestUnreachPort(ip, copy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user