remove Ipv4L3Protocol class.
This commit is contained in:
1 parent
534ab7ea84
commit
18a7a7c367
8 files changed
+18
-120
No files matched your search
@@ -23,7 +23,6 @@
|
||||
|
||||
#include "net-device-list.h"
|
||||
#include "l3-demux.h"
|
||||
#include "ipv4-l3-protocol.h"
|
||||
#include "ipv4-l4-demux.h"
|
||||
#include "internet-node.h"
|
||||
#include "udp.h"
|
||||
@@ -42,9 +41,8 @@ InternetNode::InternetNode()
|
||||
m_l3Demux = new L3Demux(this);
|
||||
m_ipv4L4Demux = new Ipv4L4Demux(this);
|
||||
m_udp = new Udp (this);
|
||||
m_ipv4 = new Ipv4 (this);
|
||||
m_arp = new Arp (this);
|
||||
m_l3Demux->Insert (Ipv4L3Protocol (this));
|
||||
m_l3Demux->Insert (Ipv4 (this));
|
||||
m_l3Demux->Insert (ArpL3Protocol (this));
|
||||
m_ipv4L4Demux->Insert (UdpIpv4L4Protocol (this));
|
||||
SetupLoopback ();
|
||||
@@ -56,7 +54,6 @@ InternetNode::InternetNode (InternetNode const &o)
|
||||
m_l3Demux = o.m_l3Demux->Copy (this);
|
||||
m_ipv4L4Demux = o.m_ipv4L4Demux->Copy (this);
|
||||
m_udp = o.m_udp->Copy (this);
|
||||
m_ipv4 = o.m_ipv4->Copy (this);
|
||||
m_arp = o.m_arp->Copy (this);
|
||||
SetupLoopback ();
|
||||
}
|
||||
@@ -67,7 +64,6 @@ InternetNode::~InternetNode ()
|
||||
delete m_l3Demux;
|
||||
delete m_ipv4L4Demux;
|
||||
delete m_udp;
|
||||
delete m_ipv4;
|
||||
delete m_arp;
|
||||
}
|
||||
|
||||
@@ -77,8 +73,8 @@ InternetNode::SetupLoopback (void)
|
||||
Ipv4LoopbackInterface * interface = new Ipv4LoopbackInterface (this);
|
||||
interface->SetAddress (Ipv4Address::GetLoopback ());
|
||||
interface->SetNetworkMask (Ipv4Mask::GetLoopback ());
|
||||
uint32_t index = m_ipv4->AddInterface (interface);
|
||||
m_ipv4->AddHostRouteTo (Ipv4Address::GetLoopback (), index);
|
||||
uint32_t index = GetIpv4 ()->AddInterface (interface);
|
||||
GetIpv4 ()->AddHostRouteTo (Ipv4Address::GetLoopback (), index);
|
||||
interface->SetUp ();
|
||||
}
|
||||
|
||||
@@ -112,7 +108,7 @@ InternetNode::GetIpv4L4Demux() const
|
||||
Ipv4 *
|
||||
InternetNode::GetIpv4 (void) const
|
||||
{
|
||||
return m_ipv4;
|
||||
return static_cast<Ipv4*> (m_l3Demux->Lookup (Ipv4::PROT_NUMBER));
|
||||
}
|
||||
Udp *
|
||||
InternetNode::GetUdp (void) const
|
||||
|
||||
Reference in new issue
Block a user