Bugzilla – Attachment #248: patch by liu for bug #283
: m_endPoint (0),
m_node (0),
m_tcp (0),
m_localAddress (Ipv4Address::GetZero ()),
m_localPort (0),
m_peerAddress ("0.0.0.0", 0),
m_errno (ERROR_NOTERROR),
m_shutdownSend (false),
fromAddress = tag.GetAddress ();
}
return packet;
int
NscTcpSocketImpl::GetSockName (Address &address) const
{
NS_LOG_FUNCTION_NOARGS ();
address = InetSocketAddress(m_localAddress, m_localPort);
return 0;
uint32_t
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:
void NSCWakeup(void);
m_endPoint (0),
m_shutdownRecv (false),
TcpSocketImpl::GetSockName (Address &address) const
void
friend class Tcp;
UdpSocketImpl::GetSockName (Address &address) const
if (m_endPoint != 0)
address = InetSocketAddress (m_endPoint->GetLocalAddress (), m_endPoint->GetLocalPort());
else
address = InetSocketAddress(Ipv4Address::GetZero(), 0);
UdpSocketImpl::ForwardUp (Ptr<Packet> packet, Ipv4Address ipv4, uint16_t port)
// Attributes set through UdpSocket base class
m_shutdownSend = false;
m_shutdownRecv = false;
m_errno = ERROR_NOTERROR;
m_isSingleDevice = false;
m_device = 0;
PacketSocket::GetSockName (Address &address) const
PacketSocketAddress ad = PacketSocketAddress::ConvertFrom(address);
ad.SetProtocol (m_protocol);
if (m_isSingleDevice)
Ptr<NetDevice> device = m_node->GetDevice (ad.GetSingleDevice ());
ad.SetPhysicalAddress(device->GetAddress());
ad.SetSingleDevice (m_device);
ad.SetPhysicalAddress(Address());
ad.SetAllDevices ();
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);