Bugzilla – Attachment #235: patch by liu jian for bug #283
fromAddress = tag.GetAddress ();
}
return packet;
int
TcpSocketImpl::GetSockName (Address &address) const
{
NS_LOG_FUNCTION_NOARGS ();
address = InetSocketAddress(m_localAddress, m_localPort);
return 0;
void
virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags);
virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags,
Address &fromAddress);
virtual int GetSockName (Address &address) const;
private:
friend class Tcp;
UdpSocketImpl::GetSockName (Address &address) const
address = InetSocketAddress (m_endPoint->GetLocalAddress (), m_endPoint->GetLocalPort());
UdpSocketImpl::ForwardUp (Ptr<Packet> packet, Ipv4Address ipv4, uint16_t port)
// Attributes set through UdpSocket base class
PacketSocket::GetSockName (Address &address) const
PacketSocketAddress ad;
ad.SetProtocol (m_protocol);
if (m_isSingleDevice)
ad.SetSingleDevice (m_device);
else
ad.SetAllDevices ();
//not sure about this line
ad.SetPhysicalAddress (m_destAddr);
address = ad;
}//namespace ns3
void ForwardUp (Ptr<NetDevice> device, Ptr<const Packet> packet,
int RecvFrom (uint8_t* buf, uint32_t size, uint32_t flags,
/**
* \returns the address name this socket is associated with.
*/
virtual int GetSockName (Address &address) const = 0;
protected:
void NotifyConnectionSucceeded (void);
void NotifyConnectionFailed (void);