Merge
This commit is contained in:
@@ -51,22 +51,22 @@ UdpHeader::EnableChecksums (void)
|
||||
}
|
||||
|
||||
void
|
||||
UdpHeader::SetDestination (uint16_t port)
|
||||
UdpHeader::SetDestinationPort (uint16_t port)
|
||||
{
|
||||
m_destinationPort = port;
|
||||
}
|
||||
void
|
||||
UdpHeader::SetSource (uint16_t port)
|
||||
UdpHeader::SetSourcePort (uint16_t port)
|
||||
{
|
||||
m_sourcePort = port;
|
||||
}
|
||||
uint16_t
|
||||
UdpHeader::GetSource (void) const
|
||||
UdpHeader::GetSourcePort (void) const
|
||||
{
|
||||
return m_sourcePort;
|
||||
}
|
||||
uint16_t
|
||||
UdpHeader::GetDestination (void) const
|
||||
UdpHeader::GetDestinationPort (void) const
|
||||
{
|
||||
return m_destinationPort;
|
||||
}
|
||||
|
||||
@@ -49,19 +49,19 @@ public:
|
||||
/**
|
||||
* \param port the destination port for this UdpHeader
|
||||
*/
|
||||
void SetDestination (uint16_t port);
|
||||
void SetDestinationPort (uint16_t port);
|
||||
/**
|
||||
* \param port The source port for this UdpHeader
|
||||
*/
|
||||
void SetSource (uint16_t port);
|
||||
void SetSourcePort (uint16_t port);
|
||||
/**
|
||||
* \return The source port for this UdpHeader
|
||||
*/
|
||||
uint16_t GetSource (void) const;
|
||||
uint16_t GetSourcePort (void) const;
|
||||
/**
|
||||
* \return the destination port for this UdpHeader
|
||||
*/
|
||||
uint16_t GetDestination (void) const;
|
||||
uint16_t GetDestinationPort (void) const;
|
||||
/**
|
||||
* \param size The payload size in bytes
|
||||
*/
|
||||
|
||||
@@ -155,12 +155,12 @@ UdpL4Protocol::Receive(Ptr<Packet> packet,
|
||||
UdpHeader udpHeader;
|
||||
packet->RemoveHeader (udpHeader);
|
||||
Ipv4EndPointDemux::EndPoints endPoints =
|
||||
m_endPoints->Lookup (destination, udpHeader.GetDestination (),
|
||||
source, udpHeader.GetSource (), interface);
|
||||
m_endPoints->Lookup (destination, udpHeader.GetDestinationPort (),
|
||||
source, udpHeader.GetSourcePort (), interface);
|
||||
for (Ipv4EndPointDemux::EndPointsI endPoint = endPoints.begin ();
|
||||
endPoint != endPoints.end (); endPoint++)
|
||||
{
|
||||
(*endPoint)->ForwardUp (packet->Copy (), source, udpHeader.GetSource ());
|
||||
(*endPoint)->ForwardUp (packet->Copy (), source, udpHeader.GetSourcePort ());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,8 +172,8 @@ UdpL4Protocol::Send (Ptr<Packet> packet,
|
||||
NS_LOG_FUNCTION (this << packet << saddr << daddr << sport << dport);
|
||||
|
||||
UdpHeader udpHeader;
|
||||
udpHeader.SetDestination (dport);
|
||||
udpHeader.SetSource (sport);
|
||||
udpHeader.SetDestinationPort (dport);
|
||||
udpHeader.SetSourcePort (sport);
|
||||
udpHeader.SetPayloadSize (packet->GetSize ());
|
||||
udpHeader.InitializeChecksum (saddr,
|
||||
daddr,
|
||||
|
||||
Reference in New Issue
Block a user