Bugs 458, swap 2 LOC for 526
This commit is contained in:
1 parent
d92febd97f
commit
04022b35bf
10 files changed
+62
-13
No files matched your search
@@ -54,6 +54,8 @@ AddUdpStack(Ptr<Node> node)
|
||||
Ptr<UdpL4Protocol> udp = CreateObject<UdpL4Protocol> ();
|
||||
udp->SetNode (node);
|
||||
ipv4->Insert (udp);
|
||||
node->AggregateObject (udp);
|
||||
|
||||
Ptr<UdpSocketFactoryImpl> udpFactory = CreateObject<UdpSocketFactoryImpl> ();
|
||||
udpFactory->SetUdp (udp);
|
||||
node->AggregateObject (udpFactory);
|
||||
@@ -66,6 +68,8 @@ AddIcmpStack (Ptr<Node> node)
|
||||
Ptr<Icmpv4L4Protocol> icmp = CreateObject<Icmpv4L4Protocol> ();
|
||||
icmp->SetNode (node);
|
||||
ipv4->Insert (icmp);
|
||||
node->AggregateObject (icmp);
|
||||
|
||||
Ptr<Ipv4RawSocketFactoryImpl> rawFactory = CreateObject<Ipv4RawSocketFactoryImpl> ();
|
||||
node->AggregateObject (rawFactory);
|
||||
}
|
||||
@@ -76,8 +80,8 @@ AddTcpStack(Ptr<Node> node)
|
||||
Ptr<Ipv4L3Protocol> ipv4 = node->GetObject<Ipv4L3Protocol> ();
|
||||
Ptr<TcpL4Protocol> tcp = CreateObject<TcpL4Protocol> ();
|
||||
tcp->SetNode (node);
|
||||
|
||||
ipv4->Insert (tcp);
|
||||
node->AggregateObject (tcp);
|
||||
|
||||
Ptr<TcpSocketFactoryImpl> tcpFactory = CreateObject<TcpSocketFactoryImpl> ();
|
||||
tcpFactory->SetTcp (tcp);
|
||||
@@ -114,6 +118,8 @@ AddNscStack(Ptr<Node> node, const std::string &soname)
|
||||
tcp->SetNscLibrary(soname);
|
||||
tcp->SetNode (node);
|
||||
ipv4->Insert (tcp);
|
||||
node->AggregateObject (tcp);
|
||||
|
||||
Ptr<NscTcpSocketFactoryImpl> tcpFactory = CreateObject<NscTcpSocketFactoryImpl> ();
|
||||
tcpFactory->SetTcp (tcp);
|
||||
node->AggregateObject (tcpFactory);
|
||||
|
||||
@@ -152,15 +152,13 @@ Ipv4L3Protocol::DoDispose (void)
|
||||
NS_LOG_FUNCTION (this);
|
||||
for (L4List_t::iterator i = m_protocols.begin(); i != m_protocols.end(); ++i)
|
||||
{
|
||||
(*i)->Dispose ();
|
||||
*i = 0;
|
||||
}
|
||||
m_protocols.clear ();
|
||||
|
||||
for (Ipv4InterfaceList::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); ++i)
|
||||
for (Ipv4InterfaceList::iterator i = m_interfaces.begin (); i != m_interfaces.end (); ++i)
|
||||
{
|
||||
Ptr<Ipv4Interface> interface = *i;
|
||||
interface->Dispose ();
|
||||
*i = 0;
|
||||
}
|
||||
m_interfaces.clear ();
|
||||
m_node = 0;
|
||||
|
||||
@@ -24,12 +24,13 @@
|
||||
#include "ns3/packet.h"
|
||||
#include "ns3/node.h"
|
||||
|
||||
#include "ns3/object-vector.h"
|
||||
|
||||
#include "tcp-header.h"
|
||||
#include "ipv4-end-point-demux.h"
|
||||
#include "ipv4-end-point.h"
|
||||
#include "ipv4-l3-protocol.h"
|
||||
#include "nsc-tcp-l4-protocol.h"
|
||||
#include "nsc-tcp-socket-impl.h"
|
||||
#include "nsc-sysctl.h"
|
||||
|
||||
#include "tcp-typedefs.h"
|
||||
@@ -70,6 +71,10 @@ NscTcpL4Protocol::GetTypeId (void)
|
||||
ObjectFactoryValue (GetDefaultRttEstimatorFactory ()),
|
||||
MakeObjectFactoryAccessor (&NscTcpL4Protocol::m_rttFactory),
|
||||
MakeObjectFactoryChecker ())
|
||||
.AddAttribute ("SocketList", "The list of sockets associated to this protocol.",
|
||||
ObjectVectorValue (),
|
||||
MakeObjectVectorAccessor (&NscTcpL4Protocol::m_sockets),
|
||||
MakeObjectVectorChecker<NscTcpSocketImpl> ())
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
@@ -154,6 +159,14 @@ void
|
||||
NscTcpL4Protocol::DoDispose (void)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
|
||||
for (std::vector<Ptr<NscTcpSocketImpl> >::iterator i = m_sockets.begin (); i != m_sockets.end (); i++)
|
||||
{
|
||||
*i = 0;
|
||||
}
|
||||
m_sockets.clear ();
|
||||
|
||||
|
||||
if (m_endPoints != 0)
|
||||
{
|
||||
delete m_endPoints;
|
||||
@@ -173,6 +186,7 @@ NscTcpL4Protocol::CreateSocket (void)
|
||||
socket->SetNode (m_node);
|
||||
socket->SetTcp (this);
|
||||
socket->SetRtt (rtt);
|
||||
m_sockets.push_back (socket);
|
||||
return socket;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include "ns3/timer.h"
|
||||
#include "sim_interface.h"
|
||||
#include "nsc-tcp-socket-impl.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -116,6 +117,7 @@ private:
|
||||
INetStack* m_nscStack;
|
||||
void *m_dlopenHandle;
|
||||
Timer m_softTimer;
|
||||
std::vector<Ptr<NscTcpSocketImpl> > m_sockets;
|
||||
};
|
||||
|
||||
}; // namespace ns3
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "nsc-tcp-socket-factory-impl.h"
|
||||
#include "nsc-tcp-l4-protocol.h"
|
||||
#include "nsc-tcp-socket-factory-impl.h"
|
||||
#include "ns3/socket.h"
|
||||
#include "ns3/assert.h"
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/nstime.h"
|
||||
#include "ns3/boolean.h"
|
||||
#include "ns3/object-vector.h"
|
||||
|
||||
#include "ns3/packet.h"
|
||||
#include "ns3/node.h"
|
||||
@@ -31,7 +32,6 @@
|
||||
#include "ipv4-end-point-demux.h"
|
||||
#include "ipv4-end-point.h"
|
||||
#include "ipv4-l3-protocol.h"
|
||||
#include "tcp-socket-impl.h"
|
||||
|
||||
#include "tcp-typedefs.h"
|
||||
|
||||
@@ -334,6 +334,10 @@ TcpL4Protocol::GetTypeId (void)
|
||||
BooleanValue (false),
|
||||
MakeBooleanAccessor (&TcpL4Protocol::m_calcChecksum),
|
||||
MakeBooleanChecker ())
|
||||
.AddAttribute ("SocketList", "The list of sockets associated to this protocol.",
|
||||
ObjectVectorValue (),
|
||||
MakeObjectVectorAccessor (&TcpL4Protocol::m_sockets),
|
||||
MakeObjectVectorChecker<TcpSocketImpl> ())
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
@@ -366,11 +370,18 @@ void
|
||||
TcpL4Protocol::DoDispose (void)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
for (std::vector<Ptr<TcpSocketImpl> >::iterator i = m_sockets.begin (); i != m_sockets.end (); i++)
|
||||
{
|
||||
*i = 0;
|
||||
}
|
||||
m_sockets.clear ();
|
||||
|
||||
if (m_endPoints != 0)
|
||||
{
|
||||
delete m_endPoints;
|
||||
m_endPoints = 0;
|
||||
}
|
||||
|
||||
m_node = 0;
|
||||
Ipv4L4Protocol::DoDispose ();
|
||||
}
|
||||
@@ -384,6 +395,7 @@ TcpL4Protocol::CreateSocket (void)
|
||||
socket->SetNode (m_node);
|
||||
socket->SetTcp (this);
|
||||
socket->SetRtt (rtt);
|
||||
m_sockets.push_back (socket);
|
||||
return socket;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "ipv4-l4-protocol.h"
|
||||
#include "ipv4-interface.h"
|
||||
|
||||
#include "tcp-socket-impl.h"
|
||||
#include "tcp-header.h"
|
||||
#include "tcp-typedefs.h"
|
||||
|
||||
@@ -120,6 +121,7 @@ private:
|
||||
|
||||
bool m_goodChecksum;
|
||||
bool m_calcChecksum;
|
||||
std::vector<Ptr<TcpSocketImpl> > m_sockets;
|
||||
};
|
||||
|
||||
}; // namespace ns3
|
||||
|
||||
Reference in new issue
Block a user