rerun check-style.py with uncrustify-0.58

This commit is contained in:
Tom Henderson
2011-05-22 22:28:15 -07:00
parent 83d8c4b27c
commit 944e69073f
110 changed files with 475 additions and 475 deletions
+2 -2
View File
@@ -90,7 +90,7 @@ void
RemainingEnergy (double oldValue, double remainingEnergy)
{
NS_LOG_UNCOND (Simulator::Now ().GetSeconds ()
<< "s Current remaining energy = " << remainingEnergy << "J");
<< "s Current remaining energy = " << remainingEnergy << "J");
}
/// Trace function for total energy consumption at node.
@@ -98,7 +98,7 @@ void
TotalEnergy (double oldValue, double totalEnergy)
{
NS_LOG_UNCOND (Simulator::Now ().GetSeconds ()
<< "s Total energy consumed by radio = " << totalEnergy << "J");
<< "s Total energy consumed by radio = " << totalEnergy << "J");
}
int
+1 -1
View File
@@ -78,7 +78,7 @@ public:
std::cout << "Destination\t\t\t\t" << "Gateway\t\t\t\t\t" << "Interface\t" << "Prefix to use" << std::endl;
nbRoutes = routing->GetNRoutes ();
for (uint32_t i = 0 ; i < nbRoutes ; i++)
for (uint32_t i = 0; i < nbRoutes; i++)
{
route = routing->GetRoute (i);
std::cout << route.GetDest () << "\t"
+1 -1
View File
@@ -78,7 +78,7 @@ public:
std::cout << "Destination\t\t\t\t" << "Gateway\t\t\t\t\t" << "Interface\t" << "Prefix to use" << std::endl;
nbRoutes = routing->GetNRoutes ();
for(uint32_t i = 0 ; i < nbRoutes ; i++)
for(uint32_t i = 0; i < nbRoutes; i++)
{
route = routing->GetRoute (i);
std::cout << route.GetDest () << "\t"
+1 -1
View File
@@ -85,7 +85,7 @@ public:
std::cout << "Destination\t\t\t\t" << "Gateway\t\t\t\t\t" << "Interface\t" << "Prefix to use" << std::endl;
nbRoutes = routing->GetNRoutes ();
for (uint32_t i = 0 ; i < nbRoutes ; i++)
for (uint32_t i = 0; i < nbRoutes; i++)
{
route = routing->GetRoute (i);
std::cout << route.GetDest () << "\t"
+2 -2
View File
@@ -50,7 +50,7 @@ main (int argc, char *argv[])
Ipv6Address prefix1 ("2001:1::");
NS_LOG_INFO ("prefix = " << prefix1);
for (uint32_t i = 0; i < 10 ; ++i)
for (uint32_t i = 0; i < 10; ++i)
{
NS_LOG_INFO ("address = " << m_addresses[i]);
Ipv6Address ipv6address = Ipv6Address::MakeAutoconfiguredAddress (m_addresses[i], prefix1);
@@ -60,7 +60,7 @@ main (int argc, char *argv[])
Ipv6Address prefix2 ("2002:1:1::");
NS_LOG_INFO ("prefix = " << prefix2);
for (uint32_t i = 0; i < 10 ; ++i)
for (uint32_t i = 0; i < 10; ++i)
{
Ipv6Address ipv6address = Ipv6Address::MakeAutoconfiguredAddress (m_addresses[i], prefix2);
NS_LOG_INFO ("address = " << ipv6address);
+1 -1
View File
@@ -79,7 +79,7 @@ public:
std::cout << "Destination\t\t\t\t" << "Gateway\t\t\t\t\t" << "Interface\t" << "Prefix to use" << std::endl;
nbRoutes = routing->GetNRoutes ();
for (uint32_t i = 0 ; i < nbRoutes ; i++)
for (uint32_t i = 0; i < nbRoutes; i++)
{
route = routing->GetRoute (i);
std::cout << route.GetDest () << "\t"
+2 -2
View File
@@ -99,7 +99,7 @@ void Sender::StartApplication()
if (m_socket == 0) {
Ptr<SocketFactory> socketFactory = GetNode()->GetObject<SocketFactory>
(UdpSocketFactory::GetTypeId());
(UdpSocketFactory::GetTypeId());
m_socket = socketFactory->CreateSocket ();
m_socket->Bind ();
}
@@ -196,7 +196,7 @@ Receiver::StartApplication()
if (m_socket == 0) {
Ptr<SocketFactory> socketFactory = GetNode()->GetObject<SocketFactory>
(UdpSocketFactory::GetTypeId());
(UdpSocketFactory::GetTypeId());
m_socket = socketFactory->CreateSocket();
InetSocketAddress local =
InetSocketAddress(Ipv4Address::GetAny(), m_port);
+2 -2
View File
@@ -271,8 +271,8 @@ int main(int argc, char *argv[]) {
appTxPkts->SetContext("node[0]");
Config::Connect("/NodeList/0/ApplicationList/*/$Sender/Tx",
MakeCallback
(&PacketSizeMinMaxAvgTotalCalculator::PacketUpdate,
appTxPkts));
(&PacketSizeMinMaxAvgTotalCalculator::PacketUpdate,
appTxPkts));
data.AddDataCalculator(appTxPkts);
+4 -4
View File
@@ -115,9 +115,9 @@ int main(int argc, char *argv[])
sinkApp.Stop (Seconds (30.0));
// This tells every node on the network to start a flow to all other nodes on the network ...
for (unsigned int i = 0 ; i < MaxNodes; i++)
for (unsigned int i = 0; i < MaxNodes; i++)
{
for (unsigned int j = 0 ; j < MaxNodes; j++)
for (unsigned int j = 0; j < MaxNodes; j++)
{
if (i == j)
{ // ...but we don't want a node to talk to itself.
@@ -126,9 +126,9 @@ int main(int argc, char *argv[])
Address remoteAddress(InetSocketAddress(ipv4Interfaces.GetAddress (j), servPort));
OnOffHelper clientHelper ("ns3::TcpSocketFactory", remoteAddress);
clientHelper.SetAttribute
("OnTime", RandomVariableValue (ConstantVariable (1)));
("OnTime", RandomVariableValue (ConstantVariable (1)));
clientHelper.SetAttribute
("OffTime", RandomVariableValue (ConstantVariable (0)));
("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer clientApp = clientHelper.Install(n.Get(i));
clientApp.Start (Seconds (j)); /* delay startup depending on node number */
clientApp.Stop (Seconds (j + runtime));
+3 -3
View File
@@ -137,16 +137,16 @@ main (int argc, char *argv[])
// Create the OnOff applications to send TCP to the server
OnOffHelper clientHelper ("ns3::TcpSocketFactory", Address ());
clientHelper.SetAttribute
("OnTime", RandomVariableValue (ConstantVariable (1)));
("OnTime", RandomVariableValue (ConstantVariable (1)));
clientHelper.SetAttribute
("OffTime", RandomVariableValue (ConstantVariable (0)));
("OffTime", RandomVariableValue (ConstantVariable (0)));
//normally wouldn't need a loop here but the server IP address is different
//on each p2p subnet
ApplicationContainer clientApps;
for(uint32_t i=0; i<clientNodes.GetN(); ++i)
{
AddressValue remoteAddress
(InetSocketAddress (interfaceAdjacencyList[i].GetAddress (0), port));
(InetSocketAddress (interfaceAdjacencyList[i].GetAddress (0), port));
clientHelper.SetAttribute ("Remote", remoteAddress);
clientApps.Add(clientHelper.Install (clientNodes.Get(i)));
}
+1 -1
View File
@@ -202,7 +202,7 @@ int main (int argc, char *argv[])
wifiMac.SetType ("ns3::AdhocWifiMac");
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel ;
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel.AddPropagationLoss ("ns3::FixedRssLossModel","Rss",DoubleValue(rss));
+1 -1
View File
@@ -163,7 +163,7 @@ int main (int argc, char *argv[])
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
YansWifiChannelHelper wifiChannel ;
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel");
wifiPhy.SetChannel (wifiChannel.Create ());
+1 -1
View File
@@ -136,7 +136,7 @@ int main (int argc, char *argv[])
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
YansWifiChannelHelper wifiChannel ;
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
// The below FixedRssLossModel will cause the rss to be fixed regardless
// of the distance between the two stations, and the transmit power
+1 -1
View File
@@ -137,7 +137,7 @@ int main (int argc, char *argv[])
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
YansWifiChannelHelper wifiChannel ;
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
// The below FixedRssLossModel will cause the rss to be fixed regardless
// of the distance between the two stations, and the transmit power
@@ -184,7 +184,7 @@ int main (int argc, char *argv[])
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
YansWifiChannelHelper wifiChannel ;
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel.AddPropagationLoss ("ns3::LogDistancePropagationLossModel");
wifiPhy.SetChannel (wifiChannel.Create ());
+1 -1
View File
@@ -87,7 +87,7 @@ public:
///\name Handle link failure callback
//\{
void SetCallback (Callback<void, Ipv4Address> cb) { m_handleLinkFailure = cb;}
void SetCallback (Callback<void, Ipv4Address> cb) { m_handleLinkFailure = cb; }
Callback<void, Ipv4Address> GetCallback () const { return m_handleLinkFailure; }
//\}
private:
+3 -3
View File
@@ -1007,7 +1007,7 @@ RoutingProtocol::RecvRequest (Ptr<Packet> p, Ipv4Address receiver, Ipv4Address s
{
NS_LOG_DEBUG ("Ignoring RREQ from node in blacklist");
return;
}
}
}
uint32_t id = rreqHeader.GetId ();
@@ -1065,8 +1065,8 @@ RoutingProtocol::RecvRequest (Ptr<Packet> p, Ipv4Address receiver, Ipv4Address s
m_routingTable.Update (toOrigin);
}
NS_LOG_LOGIC (receiver << " receive RREQ with hop count " << static_cast<uint32_t>(rreqHeader.GetHopCount ())
<< " ID " << rreqHeader.GetId ()
<< " to destination " << rreqHeader.GetDst ());
<< " ID " << rreqHeader.GetId ()
<< " to destination " << rreqHeader.GetDst ());
// A node generates a RREP if either:
// (i) it is itself the destination,
+1 -1
View File
@@ -110,7 +110,7 @@ public:
Ipv4Address GetNextHop () const { return m_ipv4Route->GetGateway(); }
void SetOutputDevice (Ptr<NetDevice> dev) { m_ipv4Route->SetOutputDevice(dev); }
Ptr<NetDevice> GetOutputDevice () const { return m_ipv4Route->GetOutputDevice(); }
Ipv4InterfaceAddress GetInterface () const { return m_iface;}
Ipv4InterfaceAddress GetInterface () const { return m_iface; }
void SetInterface (Ipv4InterfaceAddress iface) { m_iface = iface; }
void SetValidSeqNo (bool s) { m_validSeqNo = s; }
bool GetValidSeqNo () const { return m_validSeqNo; }
+1 -1
View File
@@ -76,7 +76,7 @@ RadvdInterface::RadvdInterface (uint32_t interface, uint32_t maxRtrAdvInterval,
RadvdInterface::~RadvdInterface ()
{
/* clear prefixes */
for (RadvdPrefixListI it = m_prefixes.begin () ; it != m_prefixes.end () ; ++it)
for (RadvdPrefixListI it = m_prefixes.begin (); it != m_prefixes.end (); ++it)
{
(*it) = 0;
}
+5 -5
View File
@@ -60,7 +60,7 @@ Radvd::Radvd ()
Radvd::~Radvd ()
{
NS_LOG_FUNCTION_NOARGS ();
for (RadvdInterfaceListI it = m_configurations.begin () ; it != m_configurations.end () ; ++it)
for (RadvdInterfaceListI it = m_configurations.begin (); it != m_configurations.end (); ++it)
{
*it = 0;
}
@@ -91,7 +91,7 @@ void Radvd::StartApplication ()
m_socket->SetRecvCallback (MakeCallback (&Radvd::HandleRead, this));
}
for (RadvdInterfaceListCI it = m_configurations.begin () ; it != m_configurations.end () ; it++)
for (RadvdInterfaceListCI it = m_configurations.begin (); it != m_configurations.end (); it++)
{
m_eventIds[(*it)->GetInterface ()] = EventId ();
ScheduleTransmit (Seconds (0.), (*it), m_eventIds[(*it)->GetInterface ()], Ipv6Address::GetAllNodesMulticast (), true);
@@ -107,7 +107,7 @@ void Radvd::StopApplication ()
m_socket->SetRecvCallback (MakeNullCallback<void, Ptr<Socket> > ());
}
for (EventIdMapI it = m_eventIds.begin () ; it != m_eventIds.end () ; ++it)
for (EventIdMapI it = m_eventIds.begin (); it != m_eventIds.end (); ++it)
{
Simulator::Cancel ((*it).second);
}
@@ -168,7 +168,7 @@ void Radvd::Send (Ptr<RadvdInterface> config, Ipv6Address dst, bool reschedule)
}
/* add list of prefixes */
for (std::list<Ptr<RadvdPrefix> >::const_iterator jt = prefixes.begin () ; jt != prefixes.end () ; jt++)
for (std::list<Ptr<RadvdPrefix> >::const_iterator jt = prefixes.begin (); jt != prefixes.end (); jt++)
{
uint8_t flags = 0;
prefixHdr = Icmpv6OptionPrefixInformation ();
@@ -257,7 +257,7 @@ void Radvd::HandleRead (Ptr<Socket> socket)
NS_LOG_INFO ("Received ICMPv6 Router Solicitation from " << hdr.GetSourceAddress () << " code = " << (uint32_t)rsHdr.GetCode ());
/* XXX advertise just prefix(es) for the interface not all */
for (RadvdInterfaceListCI it = m_configurations.begin () ; it != m_configurations.end () ; it++)
for (RadvdInterfaceListCI it = m_configurations.begin (); it != m_configurations.end (); it++)
{
/* calculate minimum delay between RA */
delay = static_cast<uint64_t> (rnd.GetValue (0, MAX_RA_DELAY_TIME) + 0.5);
+1 -1
View File
@@ -153,7 +153,7 @@ UdpServer::HandleRead (Ptr<Socket> socket)
" Uid: " << packet->GetUid () <<
" TXtime: " << seqTs.GetTs () <<
" RXtime: " << Simulator::Now () <<
" Delay: " << Simulator::Now () - seqTs.GetTs ()) ;
" Delay: " << Simulator::Now () - seqTs.GetTs ());
m_lossCounter.NotifyReceived (currentSequenceNumber);
m_received++;
+2 -2
View File
@@ -180,13 +180,13 @@ private: \
return ns3::Create<name ## Value> (*this); \
} \
std::string \
name ## Value::SerializeToString (Ptr<const AttributeChecker> checker) const { \
name ## Value::SerializeToString (Ptr<const AttributeChecker> checker) const { \
std::ostringstream oss; \
oss << m_value; \
return oss.str (); \
} \
bool \
name ## Value::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker) { \
name ## Value::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker) { \
std::istringstream iss; \
iss.str (value); \
iss >> m_value; \
+3 -3
View File
@@ -45,13 +45,13 @@ namespace ns3 {
*/
#if (defined (__i386__) || defined (__amd64__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2
# define NS_BREAKPOINT() \
do { __asm__ __volatile__ ("int $03"); }while(false)
do { __asm__ __volatile__ ("int $03"); } while(false)
#elif defined (_MSC_VER) && defined (_M_IX86)
# define NS_BREAKPOINT() \
do { __asm int 3h }while(false)
do { __asm int 3h } while(false)
#elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2
# define NS_BREAKPOINT() \
do { __asm__ __volatile__ ("bpt"); }while(false)
do { __asm__ __volatile__ ("bpt"); } while(false)
#else /* !__i386__ && !__alpha__ */
# define NS_BREAKPOINT() ns3::BreakpointFallback ()
#endif
+10 -10
View File
@@ -323,7 +323,7 @@ private:
class CallbackBase {
public:
CallbackBase () : m_impl () {}
Ptr<CallbackImplBase> GetImpl (void) const { return m_impl;}
Ptr<CallbackImplBase> GetImpl (void) const { return m_impl; }
protected:
CallbackBase (Ptr<CallbackImplBase> impl) : m_impl (impl) {}
Ptr<CallbackImplBase> m_impl;
@@ -894,7 +894,7 @@ Callback<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> MakeNullCallback (void) {
template <typename R, typename TX, typename ARG>
Callback<R> MakeBoundCallback (R (*fnPtr)(TX), ARG a) {
Ptr<CallbackImpl<R,empty,empty,empty,empty,empty,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX),R,TX,empty,empty,empty,empty,empty,empty,empty,empty> >(fnPtr, a);
Create<BoundFunctorCallbackImpl<R (*)(TX),R,TX,empty,empty,empty,empty,empty,empty,empty,empty> >(fnPtr, a);
return Callback<R> (impl);
}
@@ -902,56 +902,56 @@ template <typename R, typename TX, typename ARG,
typename T1>
Callback<R,T1> MakeBoundCallback (R (*fnPtr)(TX,T1), ARG a) {
Ptr<CallbackImpl<R,T1,empty,empty,empty,empty,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1),R,TX,T1,empty,empty,empty,empty,empty,empty,empty> > (fnPtr, a);
Create<BoundFunctorCallbackImpl<R (*)(TX,T1),R,TX,T1,empty,empty,empty,empty,empty,empty,empty> > (fnPtr, a);
return Callback<R,T1> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2>
Callback<R,T1,T2> MakeBoundCallback (R (*fnPtr)(TX,T1,T2), ARG a) {
Ptr<CallbackImpl<R,T1,T2,empty,empty,empty,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2),R,TX,T1,T2,empty,empty,empty,empty,empty,empty> > (fnPtr, a);
Create<BoundFunctorCallbackImpl<R (*)(TX,T1,T2),R,TX,T1,T2,empty,empty,empty,empty,empty,empty> > (fnPtr, a);
return Callback<R,T1,T2> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3>
Callback<R,T1,T2,T3> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,empty,empty,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3),R,TX,T1,T2,T3,empty,empty,empty,empty,empty> > (fnPtr, a);
Create<BoundFunctorCallbackImpl<R (*)(TX,T1,T2,T3),R,TX,T1,T2,T3,empty,empty,empty,empty,empty> > (fnPtr, a);
return Callback<R,T1,T2,T3> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3,typename T4>
Callback<R,T1,T2,T3,T4> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3,T4), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,T4,empty,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3,T4),R,TX,T1,T2,T3,T4,empty,empty,empty,empty> > (fnPtr, a);
Create<BoundFunctorCallbackImpl<R (*)(TX,T1,T2,T3,T4),R,TX,T1,T2,T3,T4,empty,empty,empty,empty> > (fnPtr, a);
return Callback<R,T1,T2,T3,T4> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3,typename T4,typename T5>
Callback<R,T1,T2,T3,T4,T5> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3,T4,T5), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,T4,T5,empty,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3,T4,T5),R,TX,T1,T2,T3,T4,T5,empty,empty,empty> > (fnPtr, a);
Create<BoundFunctorCallbackImpl<R (*)(TX,T1,T2,T3,T4,T5),R,TX,T1,T2,T3,T4,T5,empty,empty,empty> > (fnPtr, a);
return Callback<R,T1,T2,T3,T4,T5> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3,typename T4,typename T5, typename T6>
Callback<R,T1,T2,T3,T4,T5,T6> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3,T4,T5,T6), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,T4,T5,T6,empty,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3,T4,T5,T6),R,TX,T1,T2,T3,T4,T5,T6,empty,empty> > (fnPtr, a);
Create<BoundFunctorCallbackImpl<R (*)(TX,T1,T2,T3,T4,T5,T6),R,TX,T1,T2,T3,T4,T5,T6,empty,empty> > (fnPtr, a);
return Callback<R,T1,T2,T3,T4,T5,T6> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3,typename T4,typename T5, typename T6, typename T7>
Callback<R,T1,T2,T3,T4,T5,T6,T7> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3,T4,T5,T6,T7), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,empty,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3,T4,T5,T6,T7),R,TX,T1,T2,T3,T4,T5,T6,T7,empty> > (fnPtr, a);
Create<BoundFunctorCallbackImpl<R (*)(TX,T1,T2,T3,T4,T5,T6,T7),R,TX,T1,T2,T3,T4,T5,T6,T7,empty> > (fnPtr, a);
return Callback<R,T1,T2,T3,T4,T5,T6,T7> (impl);
}
template <typename R, typename TX, typename ARG,
typename T1, typename T2,typename T3,typename T4,typename T5, typename T6, typename T7, typename T8>
Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> MakeBoundCallback (R (*fnPtr)(TX,T1,T2,T3,T4,T5,T6,T7,T8), ARG a) {
Ptr<CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,empty> > impl =
Create<BoundFunctorCallbackImpl<R (*) (TX,T1,T2,T3,T4,T5,T6,T7,T8),R,TX,T1,T2,T3,T4,T5,T6,T7,T8> > (fnPtr, a);
Create<BoundFunctorCallbackImpl<R (*)(TX,T1,T2,T3,T4,T5,T6,T7,T8),R,TX,T1,T2,T3,T4,T5,T6,T7,T8> > (fnPtr, a);
return Callback<R,T1,T2,T3,T4,T5,T6,T7,T8> (impl);
}
} // namespace ns3
+1 -1
View File
@@ -10,7 +10,7 @@ namespace ns3 {
negB = sb < 0; \
ua = negA ? -sa : sa; \
ub = negB ? -sb : sb; \
(negA && !negB) || (!negA && negB);})
(negA && !negB) || (!negA && negB); })
#define MASK_LO ((((int128_t)1)<<64)-1)
+1 -1
View File
@@ -34,7 +34,7 @@ namespace ns3 {
ub = _cairo_int128_to_uint128 (sb); \
ua = negA ? _cairo_uint128_negate (ua) : ua; \
ub = negB ? _cairo_uint128_negate (ub) : ub; \
(negA && !negB) || (!negA && negB);})
(negA && !negB) || (!negA && negB); })
void
int64x64_t::Mul (int64x64_t const &o)
+3 -3
View File
@@ -19,13 +19,13 @@ namespace ns3 {
inline int64x64_t operator op (const int64x64_t &lhs, const type rhs) \
{ \
int64x64_t tmp = lhs; \
tmp op ##= int64x64_t (rhs); \
tmp op ## = int64x64_t (rhs); \
return tmp; \
} \
inline int64x64_t operator op (const type lhs, const int64x64_t &rhs) \
{ \
int64x64_t tmp = int64x64_t (lhs); \
tmp op ##= rhs; \
tmp op ## = rhs; \
return tmp; \
}
@@ -33,7 +33,7 @@ namespace ns3 {
inline int64x64_t operator op (const int64x64_t &lhs, const int64x64_t &rhs) \
{ \
int64x64_t tmp = lhs; \
tmp op ##= rhs; \
tmp op ## = rhs; \
return tmp; \
} \
INT64X64_OP_ARITH_TYPE(op,double) \
+1 -1
View File
@@ -294,7 +294,7 @@ void LogComponentDisableAll (enum LogLevel level);
NS_LOG_APPEND_CONTEXT; \
std::clog << g_log.Name () << ":" \
<< __FUNCTION__ << "("; \
ns3::ParameterLogger (std::clog) << parameters; \
ns3::ParameterLogger (std::clog) << parameters; \
std::clog << ")" << std::endl; \
} \
} \
+123 -123
View File
@@ -318,19 +318,19 @@ Ns2CalendarScheduler::head (void)
do { \
head_search_++; \
if ((e = buckets_[i].list_) != NULL) { \
diff = e->event.key.m_ts - cal_clock_.m_ts; \
if (diff < diff ## x ## _) { \
l = i; \
goto found_l; \
} \
if (min_e == NULL || min_e->event.key > e->event.key) { \
min_e = e; \
l = i; \
} \
} \
if (++i == nbuckets_) { i = 0; } \
} \
while (0)
diff = e->event.key.m_ts - cal_clock_.m_ts; \
if (diff < diff ## x ## _) { \
l = i; \
goto found_l; \
} \
if (min_e == NULL || min_e->event.key > e->event.key) { \
min_e = e; \
l = i; \
} \
} \
if (++i == nbuckets_) { i = 0; } \
} \
while (0)
// CAL_DEQUEUE applied successively will find the event to
// dequeue (within one year) and keep track of the
@@ -341,22 +341,22 @@ Ns2CalendarScheduler::head (void)
CAL_DEQUEUE (0);
CAL_DEQUEUE (1);
for (; i != lastbucket_dec; )
{
CAL_DEQUEUE (2);
}
{
CAL_DEQUEUE (2);
}
// one last bucket is left unchecked - take the minimum
// [could have done CAL_DEQUEUE(3) with diff3_ = bwidth*(nbuck*3/2-1)]
e = buckets_[i].list_;
if (min_e != NULL
&& (e == NULL || min_e->event.key < e->event.key))
{
e = min_e;
}
{
e = min_e;
}
else
{
// assert(e);
l = i;
}
{
// assert(e);
l = i;
}
found_l:
// assert(buckets_[l].count_ >= 0);
// assert(buckets_[l].list_ == e);
@@ -401,49 +401,49 @@ Ns2CalendarScheduler::resize (int newsize, Scheduler::EventKey start)
{
uint64_t bwidth;
if (newsize == nbuckets_)
{
/* we resize for bwidth*/
if (head_search_)
{
bwidth = head_search_;
}
else
{
bwidth = 1;
}
if (insert_search_)
{
bwidth = bwidth / insert_search_;
}
bwidth = static_cast<uint64_t> (sqrt (bwidth) * width_);
if (bwidth < min_bin_width_)
{
if (time_to_newwidth_ > 0)
{
time_to_newwidth_--;
head_search_ = 0;
insert_search_ = 0;
round_num_ = 0;
return; // failed to adjust bwidth
}
/* we resize for bwidth*/
if (head_search_)
{
bwidth = head_search_;
}
else
{
// We have many (adjust_new_width_interval_) times failure in adjusting bwidth.
// should do a reshuffle with newwidth
bwidth = newwidth (newsize);
}
{
bwidth = 1;
}
if (insert_search_)
{
bwidth = bwidth / insert_search_;
}
bwidth = static_cast<uint64_t> (sqrt (bwidth) * width_);
if (bwidth < min_bin_width_)
{
if (time_to_newwidth_ > 0)
{
time_to_newwidth_--;
head_search_ = 0;
insert_search_ = 0;
round_num_ = 0;
return; // failed to adjust bwidth
}
else
{
// We have many (adjust_new_width_interval_) times failure in adjusting bwidth.
// should do a reshuffle with newwidth
bwidth = newwidth (newsize);
}
}
// snoopy queue calculation
}
// snoopy queue calculation
}
else
{
/* we resize for size */
bwidth = newwidth (newsize);
if (newsize < 4)
{
newsize = 4;
/* we resize for size */
bwidth = newwidth (newsize);
if (newsize < 4)
{
newsize = 4;
}
}
}
Bucket *oldb = buckets_;
int oldn = nbuckets_;
@@ -454,24 +454,24 @@ Ns2CalendarScheduler::resize (int newsize, Scheduler::EventKey start)
int i;
for (i = 0; i < oldn; ++i)
{
// we can do inserts faster, if we use insert2, but to
// preserve FIFO, we have to start from the end of
// each bucket and use insert2
if (oldb[i].list_)
{
BucketItem *tail = oldb[i].list_->prev_;
BucketItem *e = tail;
do
{
BucketItem* ep = e->prev_;
e->next_ = e->prev_ = 0;
insert2 (e);
e = ep;
}
while (e != tail);
// we can do inserts faster, if we use insert2, but to
// preserve FIFO, we have to start from the end of
// each bucket and use insert2
if (oldb[i].list_)
{
BucketItem *tail = oldb[i].list_->prev_;
BucketItem *e = tail;
do
{
BucketItem* ep = e->prev_;
e->next_ = e->prev_ = 0;
insert2 (e);
e = ep;
}
while (e != tail);
}
}
}
head_search_ = 0;
insert_search_ = 0;
round_num_ = 0;
@@ -489,46 +489,46 @@ Ns2CalendarScheduler::insert2 (Ns2CalendarScheduler::BucketItem* e)
BucketItem *head = buckets_[i].list_;
BucketItem *before = 0;
if (!head)
{
buckets_[i].list_ = e;
e->next_ = e->prev_ = e;
++stat_qsize_;
++buckets_[i].count_;
}
else
{
bool newhead;
if (e->event.key > head->prev_->event.key) // strict LIFO, so > and not >=
{ // insert at the tail
before = head;
newhead = false;
}
else
{
// insert event in time sorted order, LIFO for sim-time events
for (before = head; e->event.key > before->event.key; before = before->next_)
{
}
newhead = (before == head);
}
e->next_ = before;
e->prev_ = before->prev_;
before->prev_ = e;
e->prev_->next_ = e;
if (newhead)
{
buckets_[i].list_ = e;
// assert(e->time_ <= e->next_->time_);
}
if (e != e->next_ && e->next_->event.key != e->event.key)
{
// unique timing
e->next_ = e->prev_ = e;
++stat_qsize_;
++buckets_[i].count_;
}
}
else
{
bool newhead;
if (e->event.key > head->prev_->event.key) // strict LIFO, so > and not >=
{ // insert at the tail
before = head;
newhead = false;
}
else
{
// insert event in time sorted order, LIFO for sim-time events
for (before = head; e->event.key > before->event.key; before = before->next_)
{
}
newhead = (before == head);
}
e->next_ = before;
e->prev_ = before->prev_;
before->prev_ = e;
e->prev_->next_ = e;
if (newhead)
{
buckets_[i].list_ = e;
// assert(e->time_ <= e->next_->time_);
}
if (e != e->next_ && e->next_->event.key != e->event.key)
{
// unique timing
++stat_qsize_;
++buckets_[i].count_;
}
}
// assert(e == buckets_[i].list_ || e->prev_->time_ <= e->time_);
// assert(e == buckets_[i].list_->prev_ || e->next_->time_ >= e->time_);
@@ -540,28 +540,28 @@ uint64_t
Ns2CalendarScheduler::newwidth (int newsize)
{
if (adjust_new_width_interval_)
{
time_to_newwidth_ = adjust_new_width_interval_;
if (avg_gap_ > 0)
{
return avg_gap_ * 4;
time_to_newwidth_ = adjust_new_width_interval_;
if (avg_gap_ > 0)
{
return avg_gap_ * 4;
}
}
}
int i;
int max_bucket = 0; // index of the fullest bucket
for (i = 1; i < nbuckets_; ++i)
{
if (buckets_[i].count_ > buckets_[max_bucket].count_)
{
max_bucket = i;
if (buckets_[i].count_ > buckets_[max_bucket].count_)
{
max_bucket = i;
}
}
}
int nsamples = buckets_[max_bucket].count_;
if (nsamples <= 4)
{
return width_;
}
{
return width_;
}
uint64_t nw = (buckets_[max_bucket].list_->prev_->event.key.m_ts
- buckets_[max_bucket].list_->event.key.m_ts) * 4;
+1 -1
View File
@@ -29,7 +29,7 @@
* defines a new GetTypeId method.
*/
#define NS_OBJECT_ENSURE_REGISTERED(type) \
static struct X## type ## RegistrationClass \
static struct X ## type ## RegistrationClass \
{ \
X ## type ## RegistrationClass () { \
ns3::TypeId tid = type::GetTypeId (); \
+1 -1
View File
@@ -100,7 +100,7 @@ public:
// allow conversions from T to T const.
template <typename U>
Ptr (Ptr<U> const &o);
~Ptr () ;
~Ptr ();
Ptr<T> &operator = (Ptr const& o);
T *operator -> () const;
+1 -1
View File
@@ -110,7 +110,7 @@ double MultModM (double a, double s, double c, double m)
a1 = static_cast<int32_t> (v / m);
/* in case v < 0)*/
if ((v -= a1 * m) < 0.0) return v += m;else return v;
if ((v -= a1 * m) < 0.0) return v += m; else return v;
}
+13 -13
View File
@@ -62,7 +62,7 @@ extern bool gBreakOnFailure;
do { \
if (!((actual) == (limit))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -114,7 +114,7 @@ extern bool gBreakOnFailure;
do { \
if (!((actual) == (limit))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -172,7 +172,7 @@ extern bool gBreakOnFailure;
do { \
if (!((actual) == (limit))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -225,7 +225,7 @@ extern bool gBreakOnFailure;
do { \
if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -301,7 +301,7 @@ extern bool gBreakOnFailure;
do { \
if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -383,7 +383,7 @@ extern bool gBreakOnFailure;
do { \
if ((actual) > (limit) + (tol) || (actual) < (limit) - (tol)) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -459,7 +459,7 @@ extern bool gBreakOnFailure;
do { \
if (!((actual) != (limit))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -510,7 +510,7 @@ extern bool gBreakOnFailure;
do { \
if (!((actual) != (limit))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -567,7 +567,7 @@ extern bool gBreakOnFailure;
do { \
if (!((actual) != (limit))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -618,7 +618,7 @@ extern bool gBreakOnFailure;
do { \
if (!((actual) < (limit))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -662,7 +662,7 @@ extern bool gBreakOnFailure;
do { \
if (!((actual) < (limit))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -702,7 +702,7 @@ extern bool gBreakOnFailure;
do { \
if (!((actual) > (limit))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
@@ -746,7 +746,7 @@ extern bool gBreakOnFailure;
do { \
if (!((actual) > (limit))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream msgStream; \
msgStream << msg; \
std::ostringstream actualStream; \
+21 -21
View File
@@ -39,14 +39,14 @@ private:
enum { IsFunctionPointer = 0};
};
template <typename U>
struct FunctionPtrTraits <U (*) (void)>
struct FunctionPtrTraits <U (*)(void)>
{
enum { IsFunctionPointer = 1};
enum { nArgs = 0};
typedef U ReturnType;
};
template <typename U, typename V1>
struct FunctionPtrTraits <U (*) (V1)>
struct FunctionPtrTraits <U (*)(V1)>
{
enum { IsFunctionPointer = 1};
enum { nArgs = 1};
@@ -54,7 +54,7 @@ private:
typedef V1 Arg1Type;
};
template <typename U, typename V1, typename V2>
struct FunctionPtrTraits <U (*) (V1,V2)>
struct FunctionPtrTraits <U (*)(V1,V2)>
{
enum { IsFunctionPointer = 1};
enum { nArgs = 2};
@@ -64,7 +64,7 @@ private:
};
template <typename U, typename V1, typename V2,
typename V3>
struct FunctionPtrTraits <U (*) (V1,V2,V3)>
struct FunctionPtrTraits <U (*)(V1,V2,V3)>
{
enum { IsFunctionPointer = 1};
enum { nArgs = 3};
@@ -75,7 +75,7 @@ private:
};
template <typename U, typename V1, typename V2,
typename V3, typename V4>
struct FunctionPtrTraits <U (*) (V1,V2,V3,V4)>
struct FunctionPtrTraits <U (*)(V1,V2,V3,V4)>
{
enum { IsFunctionPointer = 1};
enum { nArgs = 4};
@@ -88,7 +88,7 @@ private:
template <typename U, typename V1, typename V2,
typename V3, typename V4,
typename V5>
struct FunctionPtrTraits <U (*) (V1,V2,V3,V4,V5)>
struct FunctionPtrTraits <U (*)(V1,V2,V3,V4,V5)>
{
enum { IsFunctionPointer = 1};
enum { nArgs = 5};
@@ -102,7 +102,7 @@ private:
template <typename U, typename V1, typename V2,
typename V3, typename V4,
typename V5, typename V6>
struct FunctionPtrTraits <U (*) (V1,V2,V3,V4,V5,V6)>
struct FunctionPtrTraits <U (*)(V1,V2,V3,V4,V5,V6)>
{
enum { IsFunctionPointer = 1};
enum { nArgs = 6};
@@ -119,21 +119,21 @@ private:
enum { IsPointerToMember = 0};
};
template <typename U, typename V>
struct PtrToMemberTraits <U (V::*)(void)>
struct PtrToMemberTraits <U (V::*) (void)>
{
enum { IsPointerToMember = 1};
enum { nArgs = 0};
typedef U ReturnType;
};
template <typename U, typename V>
struct PtrToMemberTraits <U (V::*)(void) const>
struct PtrToMemberTraits <U (V::*) (void) const>
{
enum { IsPointerToMember = 1};
enum { nArgs = 0};
typedef U ReturnType;
};
template <typename U, typename V,typename W1>
struct PtrToMemberTraits <U (V::*)(W1)>
struct PtrToMemberTraits <U (V::*) (W1)>
{
enum { IsPointerToMember = 1};
enum { nArgs = 1};
@@ -141,7 +141,7 @@ private:
typedef W1 Arg1Type;
};
template <typename U, typename V,typename W1>
struct PtrToMemberTraits <U (V::*)(W1) const>
struct PtrToMemberTraits <U (V::*) (W1) const>
{
enum { IsPointerToMember = 1};
enum { nArgs = 1};
@@ -149,7 +149,7 @@ private:
typedef W1 Arg1Type;
};
template <typename U, typename V,typename W1, typename W2>
struct PtrToMemberTraits <U (V::*)(W1,W2)>
struct PtrToMemberTraits <U (V::*) (W1,W2)>
{
enum { IsPointerToMember = 1};
enum { nArgs = 2};
@@ -158,7 +158,7 @@ private:
typedef W2 Arg2Type;
};
template <typename U, typename V,typename W1, typename W2>
struct PtrToMemberTraits <U (V::*)(W1,W2) const>
struct PtrToMemberTraits <U (V::*) (W1,W2) const>
{
enum { IsPointerToMember = 1};
enum { nArgs = 2};
@@ -169,7 +169,7 @@ private:
template <typename U, typename V,
typename W1, typename W2,
typename W3>
struct PtrToMemberTraits <U (V::*)(W1,W2,W3)>
struct PtrToMemberTraits <U (V::*) (W1,W2,W3)>
{
enum { IsPointerToMember = 1};
enum { nArgs = 3};
@@ -181,7 +181,7 @@ private:
template <typename U, typename V,
typename W1, typename W2,
typename W3>
struct PtrToMemberTraits <U (V::*)(W1,W2,W3) const>
struct PtrToMemberTraits <U (V::*) (W1,W2,W3) const>
{
enum { IsPointerToMember = 1};
enum { nArgs = 3};
@@ -193,7 +193,7 @@ private:
template <typename U, typename V,
typename W1, typename W2,
typename W3, typename W4>
struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4)>
struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4)>
{
enum { IsPointerToMember = 1};
enum { nArgs = 4};
@@ -206,7 +206,7 @@ private:
template <typename U, typename V,
typename W1, typename W2,
typename W3, typename W4>
struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4) const>
struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4) const>
{
enum { IsPointerToMember = 1};
enum { nArgs = 4};
@@ -220,7 +220,7 @@ private:
typename W1, typename W2,
typename W3, typename W4,
typename W5>
struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4,W5)>
struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5)>
{
enum { IsPointerToMember = 1};
enum { nArgs = 5};
@@ -235,7 +235,7 @@ private:
typename W1, typename W2,
typename W3, typename W4,
typename W5>
struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4,W5) const>
struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5) const>
{
enum { IsPointerToMember = 1};
enum { nArgs = 5};
@@ -250,7 +250,7 @@ private:
typename W1, typename W2,
typename W3, typename W4,
typename W5, typename W6>
struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4,W5,W6)>
struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5,W6)>
{
enum { IsPointerToMember = 1};
enum { nArgs = 6};
@@ -266,7 +266,7 @@ private:
typename W1, typename W2,
typename W3, typename W4,
typename W5, typename W6>
struct PtrToMemberTraits <U (V::*)(W1,W2,W3,W4,W5,W6) const>
struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5,W6) const>
{
enum { IsPointerToMember = 1};
enum { nArgs = 6};
+15 -15
View File
@@ -175,9 +175,9 @@ public:
return tid;
}
void AddToVector1 (void) { m_vector1.push_back (CreateObject<Derived> ());}
void AddToVector2 (void) { m_vector2.push_back (CreateObject<Derived> ());}
void InvokeCb (double a, int b, float c) { m_cb (a,b,c);}
void AddToVector1 (void) { m_vector1.push_back (CreateObject<Derived> ()); }
void AddToVector2 (void) { m_vector2.push_back (CreateObject<Derived> ()); }
void InvokeCb (double a, int b, float c) { m_cb (a,b,c); }
void InvokeCbValue (int8_t a)
{
@@ -187,14 +187,14 @@ public:
}
private:
void DoSetTestB (bool v) { m_boolTestA = v;}
bool DoGetTestB (void) const { return m_boolTestA;}
int16_t DoGetInt16 (void) const { return m_int16SetGet;}
void DoSetInt16 (int16_t v) { m_int16SetGet = v;}
uint32_t DoGetVectorN (void) const { return m_vector2.size ();}
Ptr<Derived> DoGetVector (uint32_t i) const { return m_vector2[i];}
bool DoSetIntSrc (int8_t v) { m_intSrc2 = v; return true;}
int8_t DoGetIntSrc (void) const { return m_intSrc2;}
void DoSetTestB (bool v) { m_boolTestA = v; }
bool DoGetTestB (void) const { return m_boolTestA; }
int16_t DoGetInt16 (void) const { return m_int16SetGet; }
void DoSetInt16 (int16_t v) { m_int16SetGet = v; }
uint32_t DoGetVectorN (void) const { return m_vector2.size (); }
Ptr<Derived> DoGetVector (uint32_t i) const { return m_vector2[i]; }
bool DoSetIntSrc (int8_t v) { m_intSrc2 = v; return true; }
int8_t DoGetIntSrc (void) const { return m_intSrc2; }
bool m_boolTestA;
bool m_boolTest;
@@ -836,7 +836,7 @@ public:
private:
virtual void DoRun (void);
void NotifySource1 (int8_t old, int8_t n) { m_got1 = n;}
void NotifySource1 (int8_t old, int8_t n) { m_got1 = n; }
int64_t m_got1;
};
@@ -908,7 +908,7 @@ public:
private:
virtual void DoRun (void);
void NotifySource2 (double a, int b, float c) { m_got2 = a;}
void NotifySource2 (double a, int b, float c) { m_got2 = a; }
double m_got2;
};
@@ -982,7 +982,7 @@ public:
private:
virtual void DoRun (void);
void NotifySource2 (double a, int b, float c) { m_got2 = a;}
void NotifySource2 (double a, int b, float c) { m_got2 = a; }
double m_got2;
};
@@ -1078,7 +1078,7 @@ private:
Callback<void,int8_t> m_cbValue;
void NotifyCallbackValue (int8_t a) { m_gotCbValue = a;}
void NotifyCallbackValue (int8_t a) { m_gotCbValue = a; }
int16_t m_gotCbValue;
};
+10 -10
View File
@@ -31,10 +31,10 @@ public:
BasicCallbackTestCase ();
virtual ~BasicCallbackTestCase () {}
void Target1 (void) { m_test1 = true;}
int Target2 (void) { m_test2 = true; return 2;}
void Target3 (double a) { m_test3 = true;}
int Target4 (double a, int b) { m_test4 = true; return 4;}
void Target1 (void) { m_test1 = true; }
int Target2 (void) { m_test2 = true; return 2; }
void Target3 (double a) { m_test3 = true; }
int Target4 (double a, int b) { m_test4 = true; return 4; }
private:
virtual void DoRun (void);
@@ -161,10 +161,10 @@ public:
MakeCallbackTestCase ();
virtual ~MakeCallbackTestCase () {}
void Target1 (void) { m_test1 = true;}
int Target2 (void) { m_test2 = true; return 2;}
void Target3 (double a) { m_test3 = true;}
int Target4 (double a, int b) { m_test4 = true; return 4;}
void Target1 (void) { m_test1 = true; }
int Target2 (void) { m_test2 = true; return 2; }
void Target3 (double a) { m_test3 = true; }
int Target4 (double a, int b) { m_test4 = true; return 4; }
private:
virtual void DoRun (void);
@@ -387,7 +387,7 @@ public:
NullifyCallbackTestCase ();
virtual ~NullifyCallbackTestCase () {}
void Target1 (void) { m_test1 = true;}
void Target1 (void) { m_test1 = true; }
private:
virtual void DoRun (void);
@@ -435,7 +435,7 @@ public:
MakeCallbackTemplatesTestCase ();
virtual ~MakeCallbackTemplatesTestCase () {}
void Target1 (void) { m_test1 = true;}
void Target1 (void) { m_test1 = true; }
private:
virtual void DoRun (void);
+2 -2
View File
@@ -457,8 +457,8 @@ public:
ObjectVectorTraceConfigTestCase ();
virtual ~ObjectVectorTraceConfigTestCase () {}
void Trace (int16_t oldValue, int16_t newValue) { m_newValue = newValue;}
void TraceWithPath (std::string path, int16_t old, int16_t newValue) { m_newValue = newValue; m_path = path;}
void Trace (int16_t oldValue, int16_t newValue) { m_newValue = newValue; }
void TraceWithPath (std::string path, int16_t old, int16_t newValue) { m_newValue = newValue; m_path = path; }
private:
virtual void DoRun (void);
+6 -6
View File
@@ -39,12 +39,12 @@ TypeTraitsTestCase::TypeTraitsTestCase (void)
void
TypeTraitsTestCase::DoRun (void)
{
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(void)>::IsPointerToMember, 1, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(void) const>::IsPointerToMember, 1, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(int)>::IsPointerToMember, 1, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(int) const>::IsPointerToMember, 1, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(void) const>::PointerToMemberTraits::nArgs, 0, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*)(int) const>::PointerToMemberTraits::nArgs, 1, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (void)>::IsPointerToMember, 1, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (void) const>::IsPointerToMember, 1, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (int)>::IsPointerToMember, 1, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (int) const>::IsPointerToMember, 1, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (void) const>::PointerToMemberTraits::nArgs, 0, "Check");
NS_TEST_ASSERT_MSG_EQ (TypeTraits<void (TypeTraitsTestCase::*) (int) const>::PointerToMemberTraits::nArgs, 1, "Check");
}
class TypeTraitsTestSuite : public TestSuite
+1 -1
View File
@@ -312,7 +312,7 @@ BasicEnergyDepletionTest::DepletionTestCase (double simTimeS,
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
YansWifiChannelHelper wifiChannel ;
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiPhy.SetChannel (wifiChannel.Create ());
+2 -2
View File
@@ -721,7 +721,7 @@ BatteryLifetimeTest::ConstantLoadTest (double load, Time expLifetime)
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
YansWifiChannelHelper wifiChannel ;
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiPhy.SetChannel (wifiChannel.Create ());
@@ -808,7 +808,7 @@ BatteryLifetimeTest::VariableLoadTest (std::vector<double> loads,
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
YansWifiChannelHelper wifiChannel ;
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiPhy.SetChannel (wifiChannel.Create ());
+6 -6
View File
@@ -285,7 +285,7 @@ FlowMonitor::CheckForLostPackets (Time maxDelay)
{
// packet is considered lost, add it to the loss statistics
std::map<FlowId, FlowStats>::iterator
flow = m_flowStats.find (iter->first.first);
flow = m_flowStats.find (iter->first.first);
NS_ASSERT (flow != m_flowStats.end ());
flow->second.lostPackets++;
@@ -412,7 +412,7 @@ FlowMonitor::SerializeToXmlStream (std::ostream &os, int indent, bool enableHist
ATTRIB(rxPackets)
ATTRIB(lostPackets)
ATTRIB(timesForwarded)
<< ">\n";
<< ">\n";
#undef ATTRIB
@@ -421,15 +421,15 @@ FlowMonitor::SerializeToXmlStream (std::ostream &os, int indent, bool enableHist
{
INDENT(indent);
os << "<packetsDropped reasonCode=\"" << reasonCode << "\""
<< " number=\"" << flowI->second.packetsDropped[reasonCode]
<< "\" />\n";
<< " number=\"" << flowI->second.packetsDropped[reasonCode]
<< "\" />\n";
}
for (uint32_t reasonCode = 0; reasonCode < flowI->second.bytesDropped.size (); reasonCode++)
{
INDENT(indent);
os << "<bytesDropped reasonCode=\"" << reasonCode << "\""
<< " bytes=\"" << flowI->second.bytesDropped[reasonCode]
<< "\" />\n";
<< " bytes=\"" << flowI->second.bytesDropped[reasonCode]
<< "\" />\n";
}
if (enableHistograms)
{
@@ -73,7 +73,7 @@ void Ipv6InterfaceContainer::Add (std::string ipv6Name, uint32_t interface)
void Ipv6InterfaceContainer::Add (Ipv6InterfaceContainer& c)
{
for (InterfaceVector::const_iterator it = c.m_interfaces.begin () ; it != c.m_interfaces.end () ; it++)
for (InterfaceVector::const_iterator it = c.m_interfaces.begin (); it != c.m_interfaces.end (); it++)
{
m_interfaces.push_back (*it);
}
@@ -90,7 +90,7 @@ void Ipv6InterfaceContainer::SetRouter (uint32_t i, bool router)
/* assume first global address is index 1 (0 is link-local) */
Ipv6Address routerAddress = ipv6->GetAddress (m_interfaces[i].second, 1).GetAddress ();
for (other = 0 ; other < m_interfaces.size () ; other++)
for (other = 0; other < m_interfaces.size (); other++)
{
if (other != i)
{
+3 -3
View File
@@ -50,9 +50,9 @@ operator<< (std::ostream& os, const CandidateQueue& q)
for (CIter_t iter = list.begin (); iter != list.end (); iter++)
{
os << "<"
<< (*iter)->GetVertexId () << ", "
<< (*iter)->GetDistanceFromRoot () << ", "
<< (*iter)->GetVertexType () << ">" << std::endl;
<< (*iter)->GetVertexId () << ", "
<< (*iter)->GetDistanceFromRoot () << ", "
<< (*iter)->GetVertexType () << ">" << std::endl;
}
os << "*** CandidateQueue End ***";
return os;
@@ -296,7 +296,7 @@ SPFVertex::GetRootExitDirection (uint32_t i) const
NS_ASSERT_MSG (i < m_ecmpRootExits.size (), "Index out-of-range when accessing SPFVertex::m_ecmpRootExits!");
CIter_t iter = m_ecmpRootExits.begin ();
while (i-- > 0) { iter++;}
while (i-- > 0) { iter++; }
return *iter;
}
@@ -805,7 +805,7 @@ GlobalRouteManagerImpl::SPFNext (SPFVertex* v, CandidateQueue& candidate)
if (v->GetVertexType () == SPFVertex::VertexNetwork)
{
w_lsa = m_lsdb->GetLSAByLinkData
(v->GetLSA ()->GetAttachedRouter (i));
(v->GetLSA ()->GetAttachedRouter (i));
if (!w_lsa)
{
continue;
@@ -871,7 +871,7 @@ GlobalRouteManagerImpl::SPFNext (SPFVertex* v, CandidateQueue& candidate)
}
else
NS_ASSERT_MSG (0, "SPFNexthopCalculation never "
<< "return false, but it does now!");
<< "return false, but it does now!");
}
else if (w_lsa->GetStatus () == GlobalRoutingLSA::LSA_SPF_CANDIDATE)
{
@@ -1535,11 +1535,11 @@ GlobalRouteManagerImpl::SPFAddASExternal (GlobalRoutingLSA *extlsa, SPFVertex *v
if (v->GetVertexId () == m_spfroot->GetVertexId ())
{
NS_LOG_LOGIC ("External is on local host: "
<< v->GetVertexId () << "; returning");
<< v->GetVertexId () << "; returning");
return;
}
NS_LOG_LOGIC ("External is on remote host: "
<< extlsa->GetAdvertisingRouter () << "; installing");
<< extlsa->GetAdvertisingRouter () << "; installing");
Ipv4Address routerId = m_spfroot->GetVertexId ();
+5 -5
View File
@@ -90,7 +90,7 @@ Icmpv6L4Protocol::~Icmpv6L4Protocol ()
void Icmpv6L4Protocol::DoDispose ()
{
NS_LOG_FUNCTION_NOARGS ();
for (CacheList::const_iterator it = m_cacheList.begin () ; it != m_cacheList.end () ; it++)
for (CacheList::const_iterator it = m_cacheList.begin (); it != m_cacheList.end (); it++)
{
Ptr<NdiscCache> cache = *it;
cache->Dispose ();
@@ -413,7 +413,7 @@ void Icmpv6L4Protocol::HandleNS (Ptr<Packet> packet, Ipv6Address const &src, Ipv
Ipv6Address target = nsHeader.GetIpv6Target ();
for (i = 0 ; i < nb ; i++)
for (i = 0; i < nb; i++)
{
ifaddr = interface->GetAddress (i);
@@ -558,7 +558,7 @@ void Icmpv6L4Protocol::HandleNA (Ptr<Packet> packet, Ipv6Address const &src, Ipv
uint32_t i = 0;
uint32_t nb = 0;
for (i = 0 ; i < nb ; i++)
for (i = 0; i < nb; i++)
{
if (ifaddr.GetAddress () == target)
{
@@ -1093,7 +1093,7 @@ Ptr<NdiscCache> Icmpv6L4Protocol::FindCache (Ptr<NetDevice> device)
{
NS_LOG_FUNCTION (this << device);
for (CacheList::const_iterator i = m_cacheList.begin () ; i != m_cacheList.end () ; i++)
for (CacheList::const_iterator i = m_cacheList.begin (); i != m_cacheList.end (); i++)
{
if ((*i)->GetDevice () == device)
{
@@ -1209,7 +1209,7 @@ void Icmpv6L4Protocol::FunctionDadTimeout (Ptr<Icmpv6L4Protocol> icmpv6, Ipv6Int
uint32_t i = 0;
uint32_t nb = interface->GetNAddresses ();
for (i = 0 ; i < nb ; i++)
for (i = 0; i < nb; i++)
{
ifaddr = interface->GetAddress (i);
+1 -1
View File
@@ -708,7 +708,7 @@ Ipv4StaticRouting::PrintRoutingTable (Ptr<OutputStreamWrapper> stream) const
std::ostream* os = stream->GetStream();
if (GetNRoutes () > 0)
{
*os << "Destination Gateway Genmask Flags Metric Ref Use Iface" << std::endl;
*os << "Destination Gateway Genmask Flags Metric Ref Use Iface" << std::endl;
for (uint32_t j = 0; j < GetNRoutes (); j++)
{
std::ostringstream dest, gw, mask, flags;
+1 -1
View File
@@ -255,7 +255,7 @@ Ipv6EndPoint* Ipv6EndPointDemux::SimpleLookup (Ipv6Address dst, uint16_t dport,
uint32_t genericity = 3;
Ipv6EndPoint *generic = 0;
for (EndPointsI i = m_endPoints.begin () ; i != m_endPoints.end () ; i++)
for (EndPointsI i = m_endPoints.begin (); i != m_endPoints.end (); i++)
{
uint32_t tmp = 0;
+1 -1
View File
@@ -558,7 +558,7 @@ void Ipv6ExtensionLooseRoutingHeader::Serialize (Buffer::Iterator start) const
i.WriteU8 (GetSegmentsLeft ());
i.WriteU32 (0);
for (VectorIpv6Address_t::const_iterator it = m_routersAddress.begin (); it != m_routersAddress.end () ; it++)
for (VectorIpv6Address_t::const_iterator it = m_routersAddress.begin (); it != m_routersAddress.end (); it++)
{
it->Serialize (buff);
i.Write (buff, 16);
+8 -8
View File
@@ -182,7 +182,7 @@ bool Ipv6Interface::AddAddress (Ipv6InterfaceAddress iface)
/* DAD handling */
if (!addr.IsAny ())
{
for (Ipv6InterfaceAddressListCI it = m_addresses.begin () ; it != m_addresses.end () ; ++it)
for (Ipv6InterfaceAddressListCI it = m_addresses.begin (); it != m_addresses.end (); ++it)
{
if ((*it).GetAddress () == addr)
{
@@ -215,7 +215,7 @@ Ipv6InterfaceAddress Ipv6Interface::GetLinkLocalAddress () const
/* IPv6 interface has always at least one IPv6 link-local address */
NS_LOG_FUNCTION_NOARGS ();
for (Ipv6InterfaceAddressListCI it = m_addresses.begin () ; it != m_addresses.end () ; ++it)
for (Ipv6InterfaceAddressListCI it = m_addresses.begin (); it != m_addresses.end (); ++it)
{
if ((*it).GetAddress ().IsLinkLocal ())
{
@@ -234,7 +234,7 @@ Ipv6InterfaceAddress Ipv6Interface::GetAddress (uint32_t index) const
if (m_addresses.size () > index)
{
for (Ipv6InterfaceAddressListCI it = m_addresses.begin () ; it != m_addresses.end () ; ++it)
for (Ipv6InterfaceAddressListCI it = m_addresses.begin (); it != m_addresses.end (); ++it)
{
if (i == index)
{
@@ -265,7 +265,7 @@ Ipv6InterfaceAddress Ipv6Interface::RemoveAddress (uint32_t index)
NS_ASSERT_MSG (false, "Try to remove index that don't exist in Ipv6Interface::RemoveAddress");
}
for (Ipv6InterfaceAddressListI it = m_addresses.begin () ; it != m_addresses.end () ; ++it)
for (Ipv6InterfaceAddressListI it = m_addresses.begin (); it != m_addresses.end (); ++it)
{
if (i == index)
{
@@ -286,7 +286,7 @@ Ipv6InterfaceAddress Ipv6Interface::GetAddressMatchingDestination (Ipv6Address d
{
NS_LOG_FUNCTION (this << dst);
for (Ipv6InterfaceAddressList::const_iterator it = m_addresses.begin () ; it != m_addresses.end () ; ++it)
for (Ipv6InterfaceAddressList::const_iterator it = m_addresses.begin (); it != m_addresses.end (); ++it)
{
Ipv6InterfaceAddress ifaddr = (*it);
@@ -322,7 +322,7 @@ void Ipv6Interface::Send (Ptr<Packet> p, Ipv6Address dest)
}
/* check if destination is for one of our interface */
for (Ipv6InterfaceAddressListCI it = m_addresses.begin () ; it != m_addresses.end () ; ++it)
for (Ipv6InterfaceAddressListCI it = m_addresses.begin (); it != m_addresses.end (); ++it)
{
if (dest == (*it).GetAddress ())
{
@@ -424,7 +424,7 @@ void Ipv6Interface::SetState (Ipv6Address address, Ipv6InterfaceAddress::State_e
{
NS_LOG_FUNCTION (this << address << state);
for (Ipv6InterfaceAddressListI it = m_addresses.begin () ; it != m_addresses.end () ; ++it)
for (Ipv6InterfaceAddressListI it = m_addresses.begin (); it != m_addresses.end (); ++it)
{
if ((*it).GetAddress () == address)
{
@@ -439,7 +439,7 @@ void Ipv6Interface::SetNsDadUid (Ipv6Address address, uint32_t uid)
{
NS_LOG_FUNCTION (this << address << uid);
for (Ipv6InterfaceAddressListI it = m_addresses.begin () ; it != m_addresses.end () ; ++it)
for (Ipv6InterfaceAddressListI it = m_addresses.begin (); it != m_addresses.end (); ++it)
{
if ((*it).GetAddress () == address)
{
+19 -19
View File
@@ -90,28 +90,28 @@ void Ipv6L3Protocol::DoDispose ()
NS_LOG_FUNCTION_NOARGS ();
/* clear protocol and interface list */
for (L4List_t::iterator it = m_protocols.begin () ; it != m_protocols.end () ; ++it)
for (L4List_t::iterator it = m_protocols.begin (); it != m_protocols.end (); ++it)
{
*it = 0;
}
m_protocols.clear ();
/* remove interfaces */
for (Ipv6InterfaceList::iterator it = m_interfaces.begin () ; it != m_interfaces.end (); ++it)
for (Ipv6InterfaceList::iterator it = m_interfaces.begin (); it != m_interfaces.end (); ++it)
{
*it = 0;
}
m_interfaces.clear ();
/* remove raw sockets */
for (SocketList::iterator it = m_sockets.begin () ; it != m_sockets.end () ; ++it)
for (SocketList::iterator it = m_sockets.begin (); it != m_sockets.end (); ++it)
{
*it = 0;
}
m_sockets.clear ();
/* remove list of prefix */
for (Ipv6AutoconfiguredPrefixListI it = m_prefixes.begin () ; it != m_prefixes.end () ; ++it)
for (Ipv6AutoconfiguredPrefixListI it = m_prefixes.begin (); it != m_prefixes.end (); ++it)
{
(*it)->StopValidTimer ();
(*it)->StopPreferredTimer ();
@@ -165,7 +165,7 @@ Ptr<Ipv6Interface> Ipv6L3Protocol::GetInterface (uint32_t index) const
NS_LOG_FUNCTION (this << index);
uint32_t tmp = 0;
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin () ; it != m_interfaces.end () ; it++)
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin (); it != m_interfaces.end (); it++)
{
if (index == tmp)
{
@@ -187,12 +187,12 @@ int32_t Ipv6L3Protocol::GetInterfaceForAddress (Ipv6Address address) const
NS_LOG_FUNCTION (this << address);
int32_t index = 0;
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin () ; it != m_interfaces.end () ; it++)
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin (); it != m_interfaces.end (); it++)
{
uint32_t j = 0;
uint32_t max = (*it)->GetNAddresses ();
for (j = 0 ; j < max ; j++)
for (j = 0; j < max; j++)
{
if ((*it)->GetAddress (j).GetAddress () == address)
{
@@ -209,10 +209,10 @@ int32_t Ipv6L3Protocol::GetInterfaceForPrefix (Ipv6Address address, Ipv6Prefix m
NS_LOG_FUNCTION (this << address << mask);
int32_t index = 0;
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin () ; it != m_interfaces.end () ; it++)
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin (); it != m_interfaces.end (); it++)
{
uint32_t j = 0;
for (j = 0 ; j < (*it)->GetNAddresses () ; j++)
for (j = 0; j < (*it)->GetNAddresses (); j++)
{
if ((*it)->GetAddress (j).GetAddress ().CombinePrefix (mask) == address.CombinePrefix (mask))
{
@@ -235,7 +235,7 @@ int32_t Ipv6L3Protocol::GetInterfaceForDevice (Ptr<const NetDevice> device) cons
NS_LOG_FUNCTION (this << device);
int32_t index = 0;
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin () ; it != m_interfaces.end () ; it++)
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin (); it != m_interfaces.end (); it++)
{
if ((*it)->GetDevice () == device)
{
@@ -267,7 +267,7 @@ void Ipv6L3Protocol::AddAutoconfiguredAddress (uint32_t interface, Ipv6Address n
}
/* see if we have already the prefix */
for (Ipv6AutoconfiguredPrefixListI it = m_prefixes.begin () ; it != m_prefixes.end () ; ++it)
for (Ipv6AutoconfiguredPrefixListI it = m_prefixes.begin (); it != m_prefixes.end (); ++it)
{
if ((*it)->GetInterface () == interface && (*it)->GetPrefix () == network && (*it)->GetMask () == mask)
{
@@ -303,7 +303,7 @@ void Ipv6L3Protocol::RemoveAutoconfiguredAddress (uint32_t interface, Ipv6Addres
uint32_t i = 0;
Ipv6Address toFound = Ipv6Address::MakeAutoconfiguredAddress (Mac48Address::ConvertFrom (addr), network);
for (i = 0 ; i < max ; i++)
for (i = 0; i < max; i++)
{
if (iface->GetAddress (i).GetAddress () == toFound)
{
@@ -313,7 +313,7 @@ void Ipv6L3Protocol::RemoveAutoconfiguredAddress (uint32_t interface, Ipv6Addres
}
/* remove from list of autoconfigured address */
for (Ipv6AutoconfiguredPrefixListI it = m_prefixes.begin () ; it != m_prefixes.end () ; ++it)
for (Ipv6AutoconfiguredPrefixListI it = m_prefixes.begin (); it != m_prefixes.end (); ++it)
{
if ((*it)->GetInterface () == interface && (*it)->GetPrefix () == network && (*it)->GetMask () == mask)
{
@@ -432,7 +432,7 @@ void Ipv6L3Protocol::SetupLoopback ()
uint32_t i = 0;
/* see if we have already an loopback NetDevice */
for (i = 0 ; i < m_node->GetNDevices () ; i++)
for (i = 0; i < m_node->GetNDevices (); i++)
{
if (device = DynamicCast<LoopbackNetDevice> (m_node->GetDevice (i)))
{
@@ -482,7 +482,7 @@ void Ipv6L3Protocol::SetIpForward (bool forward)
NS_LOG_FUNCTION (this << forward);
m_ipForward = forward;
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin () ; it != m_interfaces.end (); it++)
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin (); it != m_interfaces.end (); it++)
{
(*it)->SetForwarding (forward);
}
@@ -535,7 +535,7 @@ Ptr<Ipv6L4Protocol> Ipv6L3Protocol::GetProtocol (int protocolNumber) const
{
NS_LOG_FUNCTION (this << protocolNumber);
for (L4List_t::const_iterator i = m_protocols.begin () ; i != m_protocols.end () ; ++i)
for (L4List_t::const_iterator i = m_protocols.begin (); i != m_protocols.end (); ++i)
{
if ((*i)->GetProtocolNumber () == protocolNumber)
{
@@ -558,7 +558,7 @@ void Ipv6L3Protocol::DeleteRawSocket (Ptr<Socket> socket)
{
NS_LOG_FUNCTION (this << socket);
for (SocketList::iterator it = m_sockets.begin () ; it != m_sockets.end () ; ++it)
for (SocketList::iterator it = m_sockets.begin (); it != m_sockets.end (); ++it)
{
if ((*it) == socket)
{
@@ -669,7 +669,7 @@ void Ipv6L3Protocol::Receive (Ptr<NetDevice> device, Ptr<const Packet> p, uint16
Ptr<Packet> packet = p->Copy ();
Ptr<Ipv6Interface> ipv6Interface = 0;
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin () ; it != m_interfaces.end () ; it++)
for (Ipv6InterfaceList::const_iterator it = m_interfaces.begin (); it != m_interfaces.end (); it++)
{
ipv6Interface = *it;
@@ -702,7 +702,7 @@ void Ipv6L3Protocol::Receive (Ptr<NetDevice> device, Ptr<const Packet> p, uint16
}
/* forward up to IPv6 raw sockets */
for (SocketList::iterator it = m_sockets.begin () ; it != m_sockets.end () ; ++it)
for (SocketList::iterator it = m_sockets.begin (); it != m_sockets.end (); ++it)
{
Ptr<Ipv6RawSocketImpl> socket = *it;
socket->ForwardUp (packet, hdr, device);
+1 -1
View File
@@ -296,7 +296,7 @@ uint32_t Ipv6RawSocketImpl::GetRxAvailable () const
NS_LOG_FUNCTION_NOARGS ();
uint32_t rx = 0;
for (std::list<Data>::const_iterator it = m_data.begin () ; it != m_data.end () ; ++it)
for (std::list<Data>::const_iterator it = m_data.begin (); it != m_data.end (); ++it)
{
rx+= (it->packet)->GetSize ();
}
+18 -18
View File
@@ -59,7 +59,7 @@ void Ipv6StaticRouting::SetIpv6 (Ptr<Ipv6> ipv6)
uint32_t i = 0;
m_ipv6 = ipv6;
for (i = 0 ; i < m_ipv6->GetNInterfaces () ; i++)
for (i = 0; i < m_ipv6->GetNInterfaces (); i++)
{
if (m_ipv6->IsUp (i))
{
@@ -146,7 +146,7 @@ Ipv6MulticastRoutingTableEntry Ipv6StaticRouting::GetMulticastRoute (uint32_t in
if (index < m_multicastRoutes.size ())
{
uint32_t tmp = 0;
for (MulticastRoutesCI i = m_multicastRoutes.begin () ; i != m_multicastRoutes.end () ; i++)
for (MulticastRoutesCI i = m_multicastRoutes.begin (); i != m_multicastRoutes.end (); i++)
{
if (tmp == index)
{
@@ -181,7 +181,7 @@ void Ipv6StaticRouting::RemoveMulticastRoute (uint32_t index)
NS_LOG_FUNCTION (this << index);
uint32_t tmp = 0;
for (MulticastRoutesI i = m_multicastRoutes.begin () ; i != m_multicastRoutes.end () ; i++)
for (MulticastRoutesI i = m_multicastRoutes.begin (); i != m_multicastRoutes.end (); i++)
{
if (tmp == index)
{
@@ -198,7 +198,7 @@ bool Ipv6StaticRouting::HasNetworkDest (Ipv6Address network, uint32_t interfaceI
NS_LOG_FUNCTION (this << network << interfaceIndex);
/* in the network table */
for (NetworkRoutesI j = m_networkRoutes.begin () ; j != m_networkRoutes.end () ; j++)
for (NetworkRoutesI j = m_networkRoutes.begin (); j != m_networkRoutes.end (); j++)
{
Ipv6RoutingTableEntry* rtentry = j->first;
Ipv6Prefix prefix = rtentry->GetDestNetworkPrefix ();
@@ -234,7 +234,7 @@ Ptr<Ipv6Route> Ipv6StaticRouting::LookupStatic (Ipv6Address dst, Ptr<NetDevice>
return rtentry;
}
for (NetworkRoutesI it = m_networkRoutes.begin () ; it != m_networkRoutes.end () ; it++)
for (NetworkRoutesI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
{
Ipv6RoutingTableEntry* j = it->first;
uint32_t metric = it->second;
@@ -305,13 +305,13 @@ void Ipv6StaticRouting::DoDispose ()
{
NS_LOG_FUNCTION_NOARGS ();
for (NetworkRoutesI j = m_networkRoutes.begin () ; j != m_networkRoutes.end () ; j = m_networkRoutes.erase (j))
for (NetworkRoutesI j = m_networkRoutes.begin (); j != m_networkRoutes.end (); j = m_networkRoutes.erase (j))
{
delete j->first;
}
m_networkRoutes.clear ();
for (MulticastRoutesI i = m_multicastRoutes.begin () ; i != m_multicastRoutes.end () ; i = m_multicastRoutes.erase (i))
for (MulticastRoutesI i = m_multicastRoutes.begin (); i != m_multicastRoutes.end (); i = m_multicastRoutes.erase (i))
{
delete (*i);
}
@@ -326,7 +326,7 @@ Ptr<Ipv6MulticastRoute> Ipv6StaticRouting::LookupStatic (Ipv6Address origin, Ipv
NS_LOG_FUNCTION (this << origin << group << interface);
Ptr<Ipv6MulticastRoute> mrtentry = 0;
for (MulticastRoutesI i = m_multicastRoutes.begin () ; i != m_multicastRoutes.end () ; i++)
for (MulticastRoutesI i = m_multicastRoutes.begin (); i != m_multicastRoutes.end (); i++)
{
Ipv6MulticastRoutingTableEntry* route = *i;
@@ -355,7 +355,7 @@ Ptr<Ipv6MulticastRoute> Ipv6StaticRouting::LookupStatic (Ipv6Address origin, Ipv
mrtentry->SetGroup (route->GetGroup ());
mrtentry->SetOrigin (route->GetOrigin ());
mrtentry->SetParent (route->GetInputInterface ());
for (uint32_t j = 0 ; j < route->GetNOutputInterfaces () ; j++)
for (uint32_t j = 0; j < route->GetNOutputInterfaces (); j++)
{
if (route->GetOutputInterface (j))
{
@@ -382,7 +382,7 @@ Ipv6RoutingTableEntry Ipv6StaticRouting::GetDefaultRoute ()
uint32_t shortestMetric = 0xffffffff;
Ipv6RoutingTableEntry* result = 0;
for (NetworkRoutesI it = m_networkRoutes.begin () ; it != m_networkRoutes.end () ; it++)
for (NetworkRoutesI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
{
Ipv6RoutingTableEntry* j = it->first;
uint32_t metric = it->second;
@@ -418,7 +418,7 @@ Ipv6RoutingTableEntry Ipv6StaticRouting::GetRoute (uint32_t index)
NS_LOG_FUNCTION (this << index);
uint32_t tmp = 0;
for (NetworkRoutesI it = m_networkRoutes.begin () ; it != m_networkRoutes.end () ; it++)
for (NetworkRoutesI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
{
if (tmp == index)
{
@@ -436,7 +436,7 @@ uint32_t Ipv6StaticRouting::GetMetric (uint32_t index)
NS_LOG_FUNCTION_NOARGS ();
uint32_t tmp = 0;
for (NetworkRoutesI it = m_networkRoutes.begin () ; it != m_networkRoutes.end () ; it++)
for (NetworkRoutesI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
{
if (tmp == index)
{
@@ -454,7 +454,7 @@ void Ipv6StaticRouting::RemoveRoute (uint32_t index)
NS_LOG_FUNCTION (this << index);
uint32_t tmp = 0;
for (NetworkRoutesI it = m_networkRoutes.begin () ; it != m_networkRoutes.end () ; it++)
for (NetworkRoutesI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
{
if (tmp == index)
{
@@ -471,7 +471,7 @@ void Ipv6StaticRouting::RemoveRoute (Ipv6Address network, Ipv6Prefix prefix, uin
{
NS_LOG_FUNCTION (this << network << prefix << ifIndex);
for (NetworkRoutesI it = m_networkRoutes.begin () ; it != m_networkRoutes.end () ; it++)
for (NetworkRoutesI it = m_networkRoutes.begin (); it != m_networkRoutes.end (); it++)
{
Ipv6RoutingTableEntry* rtentry = it->first;
if (network == rtentry->GetDest () && rtentry->GetInterface () == ifIndex &&
@@ -597,7 +597,7 @@ bool Ipv6StaticRouting::RouteInput (Ptr<const Packet> p, const Ipv6Header &heade
void Ipv6StaticRouting::NotifyInterfaceUp (uint32_t i)
{
for (uint32_t j = 0 ; j < m_ipv6->GetNAddresses (i) ; j++)
for (uint32_t j = 0; j < m_ipv6->GetNAddresses (i); j++)
{
if (m_ipv6->GetAddress (i, j).GetAddress () != Ipv6Address () &&
m_ipv6->GetAddress (i, j).GetPrefix () != Ipv6Prefix ())
@@ -666,7 +666,7 @@ void Ipv6StaticRouting::NotifyRemoveAddress (uint32_t interface, Ipv6InterfaceAd
// Remove all static routes that are going through this interface
// which reference this network
for (uint32_t j = 0 ; j < GetNRoutes () ; j++)
for (uint32_t j = 0; j < GetNRoutes (); j++)
{
Ipv6RoutingTableEntry route = GetRoute (j);
@@ -706,7 +706,7 @@ void Ipv6StaticRouting::NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv
NS_LOG_FUNCTION (this << dst << mask << nextHop << interface);
if (dst != Ipv6Address::GetZero ())
{
for (NetworkRoutesI j = m_networkRoutes.begin () ; j != m_networkRoutes.end () ; j++)
for (NetworkRoutesI j = m_networkRoutes.begin (); j != m_networkRoutes.end (); j++)
{
Ipv6RoutingTableEntry* rtentry = j->first;
Ipv6Prefix prefix = rtentry->GetDestNetworkPrefix ();
@@ -741,7 +741,7 @@ Ipv6Address Ipv6StaticRouting::SourceAddressSelection (uint32_t interface, Ipv6A
/* useally IPv6 interfaces have one link-local address and one global address */
for (uint32_t i = 1 ; i < m_ipv6->GetNAddresses (interface) ; i++)
for (uint32_t i = 1; i < m_ipv6->GetNAddresses (interface); i++)
{
Ipv6InterfaceAddress test = m_ipv6->GetAddress (interface, i);
+2 -2
View File
@@ -113,7 +113,7 @@ void NdiscCache::Remove (NdiscCache::Entry* entry)
{
NS_LOG_FUNCTION_NOARGS ();
for (CacheI i = m_ndCache.begin () ; i != m_ndCache.end () ; i++)
for (CacheI i = m_ndCache.begin (); i != m_ndCache.end (); i++)
{
if ((*i).second == entry)
{
@@ -129,7 +129,7 @@ void NdiscCache::Flush ()
{
NS_LOG_FUNCTION_NOARGS ();
for (CacheI i = m_ndCache.begin () ; i != m_ndCache.end () ; i++)
for (CacheI i = m_ndCache.begin (); i != m_ndCache.end (); i++)
{
delete (*i).second; /* delete the pointer NdiscCache::Entry */
}
+1 -1
View File
@@ -106,7 +106,7 @@ Ns3NscStack::GetInstanceTypeId (void) const
tid = TypeId (name.c_str ());
tid.SetParent<Ns3NscStack> ();
char buf[256];
for (int i=0; m_stack->sysctl_getnum(i, buf, sizeof(buf)) > 0 ; i++)
for (int i=0; m_stack->sysctl_getnum(i, buf, sizeof(buf)) > 0; i++)
{
char value[256];
if (m_stack->sysctl_get (buf, value, sizeof(value)) > 0)
+1 -1
View File
@@ -33,7 +33,7 @@ class Ns3NscStack : public Object
public:
static TypeId GetTypeId (void);
virtual TypeId GetInstanceTypeId (void) const;
void SetStack (INetStack *stack) { m_stack = stack;}
void SetStack (INetStack *stack) { m_stack = stack; }
private:
friend class NscStackStringAccessor;
+1 -1
View File
@@ -46,7 +46,7 @@ public:
PendingData (uint8_t*, uint32_t&, Packet*); // Construct from serialized buffer
PendingData (const PendingData&); // Copy constructor
virtual ~PendingData (); // Destructor
uint32_t Size () const { return size;}
uint32_t Size () const { return size; }
// Serialization
uint8_t* Serialize (uint8_t*, uint32_t&); // Serialize to a buffer
uint8_t* Construct (uint8_t*, uint32_t&); // Construct from buffer
+2 -2
View File
@@ -63,7 +63,7 @@ public:
virtual void ClearSent();
virtual void Measurement(Time t) = 0;
virtual Time RetransmitTimeout() = 0;
void Init(SequenceNumber32 s) { next = s;}
void Init(SequenceNumber32 s) { next = s; }
virtual Ptr<RttEstimator> Copy() const = 0;
virtual void IncreaseMultiplier();
virtual void ResetMultiplier();
@@ -107,7 +107,7 @@ public:
Time RetransmitTimeout ();
Ptr<RttEstimator> Copy () const;
void Reset ();
void Gain (double g) { gain = g;}
void Gain (double g) { gain = g; }
public:
double gain; // Filter gain
+1 -1
View File
@@ -1270,7 +1270,7 @@ bool
TcpSocketBase::SendPendingData (bool withAck)
{
NS_LOG_FUNCTION (this << withAck);
if (m_txBuffer.Size () == 0) return false; // Nothing to send
if (m_txBuffer.Size () == 0) return false; // Nothing to send
if (m_endPoint == 0)
{
NS_LOG_INFO ("TcpSocketBase::SendPendingData: No endpoint; m_shutdownSend=" << m_shutdownSend);
@@ -25,10 +25,10 @@ namespace ns3 {
class Ipv4ARouting : public Ipv4RoutingProtocol {
public:
Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0;}
Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0; }
bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev,
UnicastForwardCallback ucb, MulticastForwardCallback mcb,
LocalDeliverCallback lcb, ErrorCallback ecb) { return false;}
LocalDeliverCallback lcb, ErrorCallback ecb) { return false; }
void NotifyInterfaceUp (uint32_t interface) {}
void NotifyInterfaceDown (uint32_t interface) {}
void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address) {}
@@ -39,10 +39,10 @@ public:
class Ipv4BRouting : public Ipv4RoutingProtocol {
public:
Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0;}
Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0; }
bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev,
UnicastForwardCallback ucb, MulticastForwardCallback mcb,
LocalDeliverCallback lcb, ErrorCallback ecb) { return false;}
LocalDeliverCallback lcb, ErrorCallback ecb) { return false; }
void NotifyInterfaceUp (uint32_t interface) {}
void NotifyInterfaceDown (uint32_t interface) {}
void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address) {}
@@ -26,10 +26,10 @@ namespace ns3 {
class Ipv6ARouting : public Ipv6RoutingProtocol {
public:
Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0;}
Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0; }
bool RouteInput (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev,
UnicastForwardCallback ucb, MulticastForwardCallback mcb,
LocalDeliverCallback lcb, ErrorCallback ecb) { return false;}
LocalDeliverCallback lcb, ErrorCallback ecb) { return false; }
void NotifyInterfaceUp (uint32_t interface) {}
void NotifyInterfaceDown (uint32_t interface) {}
void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) {}
@@ -42,10 +42,10 @@ public:
class Ipv6BRouting : public Ipv6RoutingProtocol {
public:
Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0;}
Ptr<Ipv6Route> RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<NetDevice> oif, Socket::SocketErrno &sockerr) { return 0; }
bool RouteInput (Ptr<const Packet> p, const Ipv6Header &header, Ptr<const NetDevice> idev,
UnicastForwardCallback ucb, MulticastForwardCallback mcb,
LocalDeliverCallback lcb, ErrorCallback ecb) { return false;}
LocalDeliverCallback lcb, ErrorCallback ecb) { return false; }
void NotifyInterfaceUp (uint32_t interface) {}
void NotifyInterfaceDown (uint32_t interface) {}
void NotifyAddAddress (uint32_t interface, Ipv6InterfaceAddress address) {}
+1 -1
View File
@@ -55,7 +55,7 @@ void
DiscreteTimeLossModel::SetLastUpdate (void)
{
NS_LOG_FUNCTION (this);
m_lastUpdate = Simulator::Now () ;
m_lastUpdate = Simulator::Now ();
}
+1 -1
View File
@@ -51,7 +51,7 @@ NS_OBJECT_ENSURE_REGISTERED ( EnbNetDevice);
TypeId EnbNetDevice::GetTypeId (void)
{
static TypeId
tid =
tid =
TypeId ("ns3::EnbNetDevice")
.SetParent<LteNetDevice> ();
return tid;
+1 -1
View File
@@ -46,7 +46,7 @@ NS_OBJECT_ENSURE_REGISTERED ( LteNetDevice);
TypeId LteNetDevice::GetTypeId (void)
{
static TypeId
tid =
tid =
TypeId ("ns3::LteNetDevice")
.SetParent<NetDevice> ()
+1 -1
View File
@@ -53,7 +53,7 @@ NS_OBJECT_ENSURE_REGISTERED ( UeNetDevice);
TypeId UeNetDevice::GetTypeId (void)
{
static TypeId
tid =
tid =
TypeId ("ns3::UeNetDevice")
.SetParent<LteNetDevice> ();
return tid;
@@ -68,7 +68,7 @@ public:
uint16_t GetPeerLinkId () const;
bool SubtypeIsOpen () const;
bool SubtypeIsClose () const;
bool SubtypeIsConfirm () const ;
bool SubtypeIsConfirm () const;
uint8_t GetSubtype () const;
/**
* \name Inherited from WifiInformationElement
+1 -1
View File
@@ -53,7 +53,7 @@ public:
uint32_t GetLifetime () const;
uint32_t GetMetric () const;
Mac48Address GetOriginatorAddress () const;
uint32_t GetOriginatorSeqNumber () const ;
uint32_t GetOriginatorSeqNumber () const;
void DecrementTtl ();
void IncrementMetric (uint32_t metric);
+1 -1
View File
@@ -101,7 +101,7 @@ public:
bool IsUnicastPreq () const;
bool IsNeedNotPrep () const;
uint8_t GetHopCount () const;
uint8_t GetTtl () const ;
uint8_t GetTtl () const;
uint32_t GetPreqID () const;
Mac48Address GetOriginatorAddress () const;
uint32_t GetOriginatorSeqNumber () const;
+2 -2
View File
@@ -35,8 +35,8 @@ NS_LOG_COMPONENT_DEFINE ("MobilityHelper");
MobilityHelper::MobilityHelper ()
{
m_position = CreateObjectWithAttributes<RandomRectanglePositionAllocator>
("X", RandomVariableValue (ConstantVariable (0.0)),
"Y", RandomVariableValue (ConstantVariable (0.0)));
("X", RandomVariableValue (ConstantVariable (0.0)),
"Y", RandomVariableValue (ConstantVariable (0.0)));
m_mobility.SetTypeId ("ns3::ConstantPositionMobilityModel");
}
MobilityHelper::~MobilityHelper ()
@@ -31,7 +31,7 @@ class WaypointMobilityModelNotifyTest : public TestCase
public:
WaypointMobilityModelNotifyTest (bool lazy)
: TestCase (lazy ? "Check Waypoint Mobility Model LAZY notification accuracy"
: "Check Waypoint Mobility Model NON-LAZY notification accuracy"),
: "Check Waypoint Mobility Model NON-LAZY notification accuracy"),
lazyNotify (lazy)
{
}
+13 -13
View File
@@ -429,7 +429,7 @@ main (int argc, char *argv[])
{
OnOffHelper client ("ns3::UdpSocketFactory", Address ());
AddressValue remoteAddress
(InetSocketAddress (ifs1[1][0].GetAddress (0), 9999));
(InetSocketAddress (ifs1[1][0].GetAddress (0), 9999));
cout << "Remote Address is " << ifs1[1][0].GetAddress (0) << endl;
client.SetAttribute ("Remote", remoteAddress);
@@ -461,8 +461,8 @@ main (int argc, char *argv[])
if (systemCount == 1)
{
PacketSinkHelper sinkHelper
("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), 9999));
("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), 9999));
ApplicationContainer sinkApp =
sinkHelper.Install (nodes_net2LAN[z][i][j].Get (0));
@@ -472,8 +472,8 @@ main (int argc, char *argv[])
else if (systemId == z % systemCount)
{
PacketSinkHelper sinkHelper
("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), 9999));
("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), 9999));
ApplicationContainer sinkApp =
sinkHelper.Install (nodes_net2LAN[z][i][j].Get (0));
@@ -488,7 +488,7 @@ main (int argc, char *argv[])
OnOffHelper client ("ns3::UdpSocketFactory", Address ());
AddressValue remoteAddress
(InetSocketAddress (ifs2LAN[z][i][j].GetAddress (0), 9999));
(InetSocketAddress (ifs2LAN[z][i][j].GetAddress (0), 9999));
client.SetAttribute ("Remote", remoteAddress);
ApplicationContainer clientApp;
@@ -502,7 +502,7 @@ main (int argc, char *argv[])
OnOffHelper client ("ns3::UdpSocketFactory", Address ());
AddressValue remoteAddress
(InetSocketAddress (ifs2LAN[z][i][j].GetAddress (0), 9999));
(InetSocketAddress (ifs2LAN[z][i][j].GetAddress (0), 9999));
client.SetAttribute ("Remote", remoteAddress);
ApplicationContainer clientApp;
@@ -521,8 +521,8 @@ main (int argc, char *argv[])
if (systemCount == 1)
{
PacketSinkHelper sinkHelper
("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), 9999));
("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), 9999));
ApplicationContainer sinkApp =
sinkHelper.Install (nodes_net3LAN[z][i][j].Get (0));
@@ -532,8 +532,8 @@ main (int argc, char *argv[])
else if (systemId == z % systemCount)
{
PacketSinkHelper sinkHelper
("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), 9999));
("ns3::UdpSocketFactory",
InetSocketAddress (Ipv4Address::GetAny (), 9999));
ApplicationContainer sinkApp =
sinkHelper.Install (nodes_net3LAN[z][i][j].Get (0));
@@ -548,7 +548,7 @@ main (int argc, char *argv[])
OnOffHelper client ("ns3::UdpSocketFactory", Address ());
AddressValue remoteAddress
(InetSocketAddress (ifs3LAN[z][i][j].GetAddress (0), 9999));
(InetSocketAddress (ifs3LAN[z][i][j].GetAddress (0), 9999));
client.SetAttribute ("Remote", remoteAddress);
ApplicationContainer clientApp;
@@ -562,7 +562,7 @@ main (int argc, char *argv[])
OnOffHelper client ("ns3::UdpSocketFactory", Address ());
AddressValue remoteAddress
(InetSocketAddress (ifs3LAN[z][i][j].GetAddress (0), 9999));
(InetSocketAddress (ifs3LAN[z][i][j].GetAddress (0), 9999));
client.SetAttribute ("Remote", remoteAddress);
ApplicationContainer clientApp;
+3 -3
View File
@@ -226,15 +226,15 @@ main (int argc, char *argv[])
{
OnOffHelper clientHelper ("ns3::UdpSocketFactory", Address ());
clientHelper.SetAttribute
("OnTime", RandomVariableValue (ConstantVariable (1)));
("OnTime", RandomVariableValue (ConstantVariable (1)));
clientHelper.SetAttribute
("OffTime", RandomVariableValue (ConstantVariable (0)));
("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer clientApps;
for (uint32_t i = 0; i < 4; ++i)
{
AddressValue remoteAddress
(InetSocketAddress (rightLeafInterfaces.GetAddress (i), port));
(InetSocketAddress (rightLeafInterfaces.GetAddress (i), port));
clientHelper.SetAttribute ("Remote", remoteAddress);
clientApps.Add (clientHelper.Install (leftLeafNodes.Get (i)));
}
+1 -1
View File
@@ -288,7 +288,7 @@ void
MpiInterface::Disable ()
{
#ifdef NS3_MPI
int flag = 0 ;
int flag = 0;
MPI_Initialized (&flag);
if (flag)
{
+2 -2
View File
@@ -77,9 +77,9 @@ int main (int argc, char *argv[])
// Install on/off app on all right side nodes
OnOffHelper clientHelper ("ns3::UdpSocketFactory", Address ());
clientHelper.SetAttribute
("OnTime", RandomVariableValue (UniformVariable (0, 1)));
("OnTime", RandomVariableValue (UniformVariable (0, 1)));
clientHelper.SetAttribute
("OffTime", RandomVariableValue (UniformVariable (0, 1)));
("OffTime", RandomVariableValue (UniformVariable (0, 1)));
ApplicationContainer clientApps;
for (uint32_t i = 0; i < d.RightCount (); ++i)
+2 -2
View File
@@ -68,9 +68,9 @@ int main (int argc, char *argv[])
OnOffHelper clientHelper ("ns3::UdpSocketFactory", Address ());
clientHelper.SetAttribute
("OnTime", RandomVariableValue (ConstantVariable (1)));
("OnTime", RandomVariableValue (ConstantVariable (1)));
clientHelper.SetAttribute
("OffTime", RandomVariableValue (ConstantVariable (0)));
("OffTime", RandomVariableValue (ConstantVariable (0)));
ApplicationContainer clientApps;
// Create an on/off app sending packets
+1 -1
View File
@@ -171,7 +171,7 @@ NixVector::ExtractNeighborIndex (uint32_t numberOfBits)
if (numberOfBits > totalRemainingBits)
{
NS_FATAL_ERROR ("You've tried to extract too many bits of the Nix-vector, " << this << ". NumberBits: "
<< numberOfBits << " Remaining: " << totalRemainingBits);
<< numberOfBits << " Remaining: " << totalRemainingBits);
}
if (numberOfBits <= 0)
+1 -1
View File
@@ -330,7 +330,7 @@ PacketMetadataTest::CheckHistory (Ptr<Packet> p, const char *file, int line, uin
}
for (std::list<int>::iterator i = got.begin (),
j = expected.begin ();
j = expected.begin ();
i != got.end (); i++, j++)
{
NS_ASSERT (j != expected.end ());
+19 -19
View File
@@ -408,7 +408,7 @@ Ipv6Address Ipv6Address::CombinePrefix (Ipv6Prefix const& prefix)
((Ipv6Prefix)prefix).GetBytes (pref);
/* a little bit ugly... */
for (i = 0 ; i < 16 ; i++)
for (i = 0; i < 16; i++)
{
addr[i] = addr[i] & pref[i];
}
@@ -609,7 +609,7 @@ Ipv6Prefix::Ipv6Prefix (uint8_t prefix)
if (nb < 16)
{
nb++;
for (i = nb; i < 16 ; i++)
for (i = nb; i < 16; i++)
{
m_prefix[i] = 0x00;
}
@@ -641,7 +641,7 @@ bool Ipv6Prefix::IsMatch (Ipv6Address a, Ipv6Address b) const
b.GetBytes (addrB);
/* a little bit ugly... */
for (i = 0 ; i < 16 ; i++)
for (i = 0; i < 16; i++)
{
if ((addrA[i] & m_prefix[i]) != (addrB[i] & m_prefix[i]))
{
@@ -654,21 +654,21 @@ bool Ipv6Prefix::IsMatch (Ipv6Address a, Ipv6Address b) const
void Ipv6Prefix::Print (std::ostream &os) const
{
os << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[0]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[1] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[2]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[3] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[4]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[5] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[6]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[7] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[8]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[9] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[10]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[11] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[12]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[13] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[14]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[15];
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[1] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[2]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[3] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[4]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[5] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[6]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[7] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[8]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[9] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[10]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[11] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[12]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[13] << ":"
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[14]
<< std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[15];
}
Ipv6Prefix Ipv6Prefix::GetLoopback ()
@@ -699,7 +699,7 @@ uint8_t Ipv6Prefix::GetPrefixLength () const
uint8_t i = 0;
uint8_t prefixLength = 0;
for(i = 0 ; i < 16 ; i++)
for(i = 0; i < 16; i++)
{
uint8_t mask = m_prefix[i];
+1 -1
View File
@@ -140,7 +140,7 @@ PacketSocket::DoBind (const PacketSocketAddress &address)
m_errno = ERROR_BADF;
return -1;
}
Ptr<NetDevice> dev ;
Ptr<NetDevice> dev;
if (address.IsSingleDevice ())
{
dev = m_node->GetDevice (address.GetSingleDevice ());
@@ -679,7 +679,7 @@ Ipv4NixVectorRouting::PrintRoutingTable(Ptr<OutputStreamWrapper> stream) const
*os << "Ipv4RouteCache:" << std::endl;
if (m_ipv4RouteCache.size () > 0)
{
*os << "Destination Gateway Source OutputDevice" << std::endl;
*os << "Destination Gateway Source OutputDevice" << std::endl;
for (Ipv4RouteMap_t::const_iterator it = m_ipv4RouteCache.begin (); it != m_ipv4RouteCache.end (); it++)
{
std::ostringstream dest, gw, src;
+1 -1
View File
@@ -145,7 +145,7 @@ int main (int argc, char *argv[])
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
YansWifiChannelHelper wifiChannel ;
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
// The below FixedRssLossModel will cause the rss to be fixed regardless
// of the distance between the two stations, and the transmit power
+22 -22
View File
@@ -60,8 +60,8 @@ namespace ns3 { namespace olsr {
operator << (std::ostream &os, const IfaceAssocTuple &tuple)
{
os << "IfaceAssocTuple(ifaceAddr=" << tuple.ifaceAddr
<< ", mainAddr=" << tuple.mainAddr
<< ", time=" << tuple.time << ")";
<< ", mainAddr=" << tuple.mainAddr
<< ", time=" << tuple.time << ")";
return os;
}
@@ -91,11 +91,11 @@ namespace ns3 { namespace olsr {
operator << (std::ostream &os, const LinkTuple &tuple)
{
os << "LinkTuple(localIfaceAddr=" << tuple.localIfaceAddr
<< ", neighborIfaceAddr=" << tuple.neighborIfaceAddr
<< ", symTime=" << tuple.symTime
<< ", asymTime=" << tuple.asymTime
<< ", expTime=" << tuple.time
<< ")";
<< ", neighborIfaceAddr=" << tuple.neighborIfaceAddr
<< ", symTime=" << tuple.symTime
<< ", asymTime=" << tuple.asymTime
<< ", expTime=" << tuple.time
<< ")";
return os;
}
@@ -125,8 +125,8 @@ namespace ns3 { namespace olsr {
operator << (std::ostream &os, const NeighborTuple &tuple)
{
os << "NeighborTuple(neighborMainAddr=" << tuple.neighborMainAddr
<< ", status=" << (tuple.status == NeighborTuple::STATUS_SYM ? "SYM" : "NOT_SYM")
<< ", willingness=" << (int) tuple.willingness << ")";
<< ", status=" << (tuple.status == NeighborTuple::STATUS_SYM ? "SYM" : "NOT_SYM")
<< ", willingness=" << (int) tuple.willingness << ")";
return os;
}
@@ -145,9 +145,9 @@ namespace ns3 { namespace olsr {
operator << (std::ostream &os, const TwoHopNeighborTuple &tuple)
{
os << "TwoHopNeighborTuple(neighborMainAddr=" << tuple.neighborMainAddr
<< ", twoHopNeighborAddr=" << tuple.twoHopNeighborAddr
<< ", expirationTime=" << tuple.expirationTime
<< ")";
<< ", twoHopNeighborAddr=" << tuple.twoHopNeighborAddr
<< ", expirationTime=" << tuple.expirationTime
<< ")";
return os;
}
@@ -224,10 +224,10 @@ namespace ns3 { namespace olsr {
operator << (std::ostream &os, const TopologyTuple &tuple)
{
os << "TopologyTuple(destAddr=" << tuple.destAddr
<< ", lastAddr=" << tuple.lastAddr
<< ", sequenceNumber=" << (int) tuple.sequenceNumber
<< ", expirationTime=" << tuple.expirationTime
<< ")";
<< ", lastAddr=" << tuple.lastAddr
<< ", sequenceNumber=" << (int) tuple.sequenceNumber
<< ", expirationTime=" << tuple.expirationTime
<< ")";
return os;
}
@@ -249,8 +249,8 @@ namespace ns3 { namespace olsr {
operator << (std::ostream &os, const Association &tuple)
{
os << "Association(networkAddr=" << tuple.networkAddr
<< ", netmask=" << tuple.netmask
<< ")";
<< ", netmask=" << tuple.netmask
<< ")";
return os;
}
@@ -279,10 +279,10 @@ namespace ns3 { namespace olsr {
operator << (std::ostream &os, const AssociationTuple &tuple)
{
os << "AssociationTuple(gatewayAddr=" << tuple.gatewayAddr
<< ", networkAddr=" << tuple.networkAddr
<< ", netmask=" << tuple.netmask
<< ", expirationTime=" << tuple.expirationTime
<< ")";
<< ", networkAddr=" << tuple.networkAddr
<< ", netmask=" << tuple.netmask
<< ", expirationTime=" << tuple.expirationTime
<< ")";
return os;
}
+14 -14
View File
@@ -393,9 +393,9 @@ RoutingProtocol::RecvOlsr (Ptr<Socket> socket)
sizeLeft -= messageHeader.GetSerializedSize ();
NS_LOG_DEBUG ("Olsr Msg received with type "
<< std::dec << int (messageHeader.GetMessageType ())
<< " TTL=" << int (messageHeader.GetTimeToLive ())
<< " origAddr=" << messageHeader.GetOriginatorAddress ());
<< std::dec << int (messageHeader.GetMessageType ())
<< " TTL=" << int (messageHeader.GetTimeToLive ())
<< " origAddr=" << messageHeader.GetOriginatorAddress ());
messages.push_back (messageHeader);
}
@@ -419,8 +419,8 @@ RoutingProtocol::RecvOlsr (Ptr<Socket> socket)
// If the message has been processed it must not be processed again
bool do_forwarding = true;
DuplicateTuple *duplicated = m_state.FindDuplicateTuple
(messageHeader.GetOriginatorAddress (),
messageHeader.GetMessageSequenceNumber ());
(messageHeader.GetOriginatorAddress (),
messageHeader.GetMessageSequenceNumber ());
// Get main address of the peer, which may be different from the packet source address
// const IfaceAssocTuple *ifaceAssoc = m_state.FindIfaceAssocTuple (inetSourceAddr.GetIpv4 ());
@@ -1025,7 +1025,7 @@ RoutingProtocol::RoutingTableComputation ()
}
}
for (uint32_t h = 2; ; h++)
for (uint32_t h = 2;; h++)
{
bool added = false;
@@ -1130,7 +1130,7 @@ RoutingProtocol::RoutingTableComputation ()
if (localHnaAssoc.networkAddr == tuple.networkAddr && localHnaAssoc.netmask == tuple.netmask)
{
NS_LOG_DEBUG ("HNA association received from another GW is part of local HNA associations: no route added for network "
<< tuple.networkAddr << "/" << tuple.netmask);
<< tuple.networkAddr << "/" << tuple.netmask);
goToNextAssociationTuple = true;
}
}
@@ -1447,7 +1447,7 @@ RoutingProtocol::ProcessHna (const olsr::MessageHeader &msg,
// message:
for (std::vector<olsr::MessageHeader::Hna::Association>::const_iterator it = hna.associations.begin();
it != hna.associations.end() ; it++)
it != hna.associations.end(); it++)
{
AssociationTuple *tuple = m_state.FindAssociationTuple(msg.GetOriginatorAddress(),it->address,it->mask);
@@ -1745,14 +1745,14 @@ RoutingProtocol::SendHello ()
olsr::MessageHeader::Hello::LinkMessage linkMessage;
linkMessage.linkCode = (link_type & 0x03) | ((nb_type << 2) & 0x0f);
linkMessage.neighborInterfaceAddresses.push_back
(link_tuple->neighborIfaceAddr);
(link_tuple->neighborIfaceAddr);
std::vector<Ipv4Address> interfaces =
m_state.FindNeighborInterfaces (link_tuple->neighborIfaceAddr);
linkMessage.neighborInterfaceAddresses.insert
(linkMessage.neighborInterfaceAddresses.end (),
interfaces.begin (), interfaces.end ());
(linkMessage.neighborInterfaceAddresses.end (),
interfaces.begin (), interfaces.end ());
linkMessages.push_back (linkMessage);
}
@@ -2280,9 +2280,9 @@ RoutingProtocol::PopulateMprSelectorSet (const olsr::MessageHeader &msg,
// Schedules mpr selector tuple deletion
m_events.Track (Simulator::Schedule
(DELAY (mprsel_tuple.expirationTime),
&RoutingProtocol::MprSelTupleTimerExpire, this,
mprsel_tuple.mainAddr));
(DELAY (mprsel_tuple.expirationTime),
&RoutingProtocol::MprSelTupleTimerExpire, this,
mprsel_tuple.mainAddr));
}
else
{
+3 -3
View File
@@ -42,13 +42,13 @@ std::ostream& operator<< (std::ostream& os, AlohaNoackNetDevice::State state)
switch (state)
{
case AlohaNoackNetDevice::IDLE:
os << "IDLE" ;
os << "IDLE";
break;
case AlohaNoackNetDevice::TX:
os << "TX" ;
os << "TX";
break;
case AlohaNoackNetDevice::RX:
os << "RX" ;
os << "RX";
break;
}
return os;
+1 -1
View File
@@ -402,7 +402,7 @@ operator << (std::ostream& os, const SpectrumValue& pvf)
Values::const_iterator it1 = pvf.ConstValuesBegin ();
while (it1 != pvf.ConstValuesEnd ())
{
os << *it1 << " " ;
os << *it1 << " ";
++it1;
}
os << std::endl;
+2 -2
View File
@@ -56,7 +56,7 @@
|| (i->fc > j->fc + (tol)) || (i->fc < j->fc - (tol)) \
|| (i->fh > j->fh + (tol)) || (i->fh < j->fh - (tol))) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream indexStream; \
indexStream << "[" << k << "]"; \
std::ostringstream msgStream; \
@@ -117,7 +117,7 @@
{ \
if ((*i) > (*j) + (tol) || (*i) < (*j) - (tol)) \
{ \
if (gBreakOnFailure) { *(int *)0 = 0;} \
if (gBreakOnFailure) { *(int *)0 = 0; } \
std::ostringstream indexStream; \
indexStream << "[" << k << "]"; \
std::ostringstream msgStream; \
+1 -1
View File
@@ -136,7 +136,7 @@ OmnetDataOutput::Output(DataCollector &dc)
OmnetDataOutput::OmnetOutputCallback::OmnetOutputCallback
(std::ostream *scalar) :
(std::ostream *scalar) :
m_scalar(scalar)
{
}
+1 -1
View File
@@ -145,7 +145,7 @@ SqliteDataOutput::Output(DataCollector &dc)
}
SqliteDataOutput::SqliteOutputCallback::SqliteOutputCallback
(Ptr<SqliteDataOutput> owner, std::string run) :
(Ptr<SqliteDataOutput> owner, std::string run) :
m_owner(owner),
m_runLabel(run)
{
+4 -4
View File
@@ -266,8 +266,8 @@ Ns3TcpLossTestCase::StartFlow (Ptr<Socket> localSocket,
// tell the tcp implementation to call WriteUntilBufferFull again
// if we blocked and new tx buffer space becomes available
localSocket->SetSendCallback (MakeCallback
(&Ns3TcpLossTestCase::WriteUntilBufferFull,
this));
(&Ns3TcpLossTestCase::WriteUntilBufferFull,
this));
WriteUntilBufferFull (localSocket, localSocket->GetTxAvailable ());
}
@@ -363,8 +363,8 @@ Ns3TcpLossTestCase::DoRun (void)
MakeCallback (&Ns3TcpLossTestCase::Ipv4L3Tx, this));
Config::ConnectWithoutContext
("/NodeList/0/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",
MakeCallback (&Ns3TcpLossTestCase::CwndTracer, this));
("/NodeList/0/$ns3::TcpL4Protocol/SocketList/0/CongestionWindow",
MakeCallback (&Ns3TcpLossTestCase::CwndTracer, this));
////////////////////////////////////////////////////////
// Set up loss model at node k1
+2 -2
View File
@@ -253,8 +253,8 @@ Ns3TcpStateTestCase::StartFlow (Ptr<Socket> localSocket,
// tell the tcp implementation to call WriteUntilBufferFull again
// if we blocked and new tx buffer space becomes available
localSocket->SetSendCallback (MakeCallback
(&Ns3TcpStateTestCase::WriteUntilBufferFull,
this));
(&Ns3TcpStateTestCase::WriteUntilBufferFull,
this));
WriteUntilBufferFull (localSocket, localSocket->GetTxAvailable ());
}
@@ -155,7 +155,7 @@ WifiInterferenceTestCase::WifiSimpleInterference (std::string phyMode,double Prs
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
YansWifiChannelHelper wifiChannel ;
YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel.AddPropagationLoss ("ns3::LogDistancePropagationLossModel");
wifiPhy.SetChannel (wifiChannel.Create ());
+2 -2
View File
@@ -84,7 +84,7 @@ public:
/// Unbiased estimate of variance
double Var () const { return Count() / (double)(Count() - 1) * (m_avg2 - m_avg*m_avg); }
/// Standard deviation
double Stddev () const { return sqrt (Var ());}
double Stddev () const { return sqrt (Var ()); }
//\}
/**
@@ -117,7 +117,7 @@ std::ostream & operator<< (std::ostream & os, Average<T> const & x)
if (x.Count () != 0)
os << x.Avg () << " (" << x.Stddev () << ") [" << x.Min () << ", " << x.Max () << "]";
else
os << "NA"; // not available
os << "NA"; // not available
return os;
}
}
+1 -1
View File
@@ -65,7 +65,7 @@ EventGarbageCollector::Cleanup ()
m_events.erase (iter++);
}
else
break; // EventIds are sorted by timestamp => further events are not expired for sure
break; // EventIds are sorted by timestamp => further events are not expired for sure
}
// If after cleanup we are still over the limit, increase the limit.
@@ -65,9 +65,9 @@ void EventGarbageCollectorTestCase::DoRun (void)
for (int n = 0; n < 100; n++)
{
m_events->Track (Simulator::Schedule
(Simulator::Now (),
&EventGarbageCollectorTestCase::EventGarbageCollectorCallback,
this));
(Simulator::Now (),
&EventGarbageCollectorTestCase::EventGarbageCollectorCallback,
this));
}
Simulator::Run ();
NS_TEST_EXPECT_MSG_EQ (m_events, 0, "");
+2 -2
View File
@@ -714,7 +714,7 @@ PyViz::TraceNetDevRxCommon (std::string const &context, Ptr<const Packet> packet
#endif
std::map<TransmissionSampleKey,TransmissionSampleValue>::iterator
iter = m_transmissionSamples.find (key);
iter = m_transmissionSamples.find (key);
if (iter == m_transmissionSamples.end ())
{
@@ -893,7 +893,7 @@ PyViz::GetLastPackets (uint32_t nodeId) const
NS_LOG_DEBUG ("GetLastPackets: " << nodeId);
std::map<uint32_t, LastPacketsSample>::const_iterator
iter = m_lastPackets.find(nodeId);
iter = m_lastPackets.find(nodeId);
if (iter != m_lastPackets.end ())
{
return iter->second;
+1 -1
View File
@@ -38,7 +38,7 @@
NS_LOG_COMPONENT_DEFINE ("DcaTxop");
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT if (m_low != 0) { std::clog << "[mac=" << m_low->GetAddress () << "] ";}
#define NS_LOG_APPEND_CONTEXT if (m_low != 0) { std::clog << "[mac=" << m_low->GetAddress () << "] "; }
namespace ns3 {
+3 -3
View File
@@ -38,7 +38,7 @@
NS_LOG_COMPONENT_DEFINE ("EdcaTxopN");
#undef NS_LOG_APPEND_CONTEXT
#define NS_LOG_APPEND_CONTEXT if (m_low != 0) { std::clog << "[mac=" << m_low->GetAddress () << "] ";}
#define NS_LOG_APPEND_CONTEXT if (m_low != 0) { std::clog << "[mac=" << m_low->GetAddress () << "] "; }
namespace ns3 {
@@ -143,7 +143,7 @@ EdcaTxopN::GetTypeId (void)
.SetParent (ns3::Dcf::GetTypeId ())
.AddConstructor<EdcaTxopN> ()
.AddAttribute ("BlockAckThreshold", "If number of packets in this queue reaches this value,\
block ack mechanism is used. If this value is 0, block ack is never used." ,
block ack mechanism is used. If this value is 0, block ack is never used.",
UintegerValue (0),
MakeUintegerAccessor (&EdcaTxopN::SetBlockAckThreshold,
&EdcaTxopN::GetBlockAckThreshold),
@@ -151,7 +151,7 @@ EdcaTxopN::GetTypeId (void)
.AddAttribute ("BlockAckInactivityTimeout", "Represents max time (blocks of 1024 micro seconds) allowed for block ack\
inactivity. If this value isn't equal to 0 a timer start after that a\
block ack setup is completed and will be reset every time that a block\
ack frame is received. If this value is 0, block ack inactivity timeout won't be used." ,
ack frame is received. If this value is 0, block ack inactivity timeout won't be used.",
UintegerValue (0),
MakeUintegerAccessor (&EdcaTxopN::SetBlockAckInactivityTimeout),
MakeUintegerChecker<uint16_t> ())
+4 -4
View File
@@ -277,10 +277,10 @@ MacLowTransmissionParameters::GetNextPacketSize (void) const
std::ostream &operator << (std::ostream &os, const MacLowTransmissionParameters &params)
{
os << "["
<< "send rts=" << params.m_sendRts << ", "
<< "next size=" << params.m_nextSize << ", "
<< "dur=" << params.m_overrideDurationId << ", "
<< "ack=";
<< "send rts=" << params.m_sendRts << ", "
<< "next size=" << params.m_nextSize << ", "
<< "dur=" << params.m_overrideDurationId << ", "
<< "ack=";
switch (params.m_waitAck)
{
case MacLowTransmissionParameters::ACK_NONE:
+1 -1
View File
@@ -639,7 +639,7 @@ MinstrelWifiManager::UpdateStats (MinstrelWifiRemoteStation *station)
m_minstrelTable[i].adjustedRetryCount = m_minstrelTable[i].retryCount >> 1;
if (m_minstrelTable[i].adjustedRetryCount > 2)
{
m_minstrelTable[i].adjustedRetryCount = 2 ;
m_minstrelTable[i].adjustedRetryCount = 2;
}
}
else
+1 -1
View File
@@ -181,7 +181,7 @@ OnoeWifiManager::UpdateMode (OnoeWifiRemoteStation *station)
station->m_tx_upper--;
}
break;
case - 1:
case -1:
if (nrate > 0)
{
nrate--;
+1 -1
View File
@@ -190,7 +190,7 @@ WifiModeFactory::Search (std::string name)
// is a fatal problem, but we try to be helpful by displaying the
// list of WifiModes that are supported.
NS_LOG_UNCOND ("Could not find match for WifiMode named \""
<< name << "\". Valid options are:");
<< name << "\". Valid options are:");
for (i = m_itemList.begin (); i != m_itemList.end (); i++)
{
NS_LOG_UNCOND (" " << i->uniqueUid);

Some files were not shown because too many files have changed in this diff Show More