swap SendTo parameters
This commit is contained in:
1 parent
231fce4b4d
commit
de36a7fdbc
9 files changed
+20
-20
No files matched your search
@@ -237,7 +237,7 @@ PacketSocket::Send (Ptr<Packet> p)
|
||||
m_errno = ERROR_NOTCONN;
|
||||
return -1;
|
||||
}
|
||||
return SendTo (m_destAddr, p);
|
||||
return SendTo (p, m_destAddr);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
@@ -248,7 +248,7 @@ PacketSocket::GetTxAvailable (void) const
|
||||
}
|
||||
|
||||
int
|
||||
PacketSocket::SendTo(const Address &address, Ptr<Packet> p)
|
||||
PacketSocket::SendTo(Ptr<Packet> p, const Address &address)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
PacketSocketAddress ad;
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
virtual int Send (Ptr<Packet> p);
|
||||
virtual uint32_t GetTxAvailable (void) const;
|
||||
|
||||
virtual int SendTo(const Address &address,Ptr<Packet> p);
|
||||
virtual int SendTo(Ptr<Packet> p, const Address &address);
|
||||
|
||||
virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags);
|
||||
virtual uint32_t GetRxAvailable (void) const;
|
||||
|
||||
+2
-2
@@ -185,7 +185,7 @@ Socket::Recv (void)
|
||||
return Recv (std::numeric_limits<uint32_t>::max(), 0);
|
||||
}
|
||||
|
||||
int Socket::SendTo (const Address &address, const uint8_t* buf, uint32_t size)
|
||||
int Socket::SendTo (const uint8_t* buf, uint32_t size, const Address &address)
|
||||
{
|
||||
NS_LOG_FUNCTION_NOARGS ();
|
||||
Ptr<Packet> p;
|
||||
@@ -197,7 +197,7 @@ int Socket::SendTo (const Address &address, const uint8_t* buf, uint32_t size)
|
||||
{
|
||||
p = Create<Packet> (size);
|
||||
}
|
||||
return SendTo (address,p);
|
||||
return SendTo (p, address);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+4
-4
@@ -282,26 +282,26 @@ public:
|
||||
|
||||
/**
|
||||
* \brief Send data to a specified peer.
|
||||
* \param address IP Address of remote host
|
||||
* \param p packet to send
|
||||
* \param address IP Address of remote host
|
||||
* \returns -1 in case of error or the number of bytes copied in the
|
||||
* internal buffer and accepted for transmission.
|
||||
*/
|
||||
virtual int SendTo (const Address &address,Ptr<Packet> p) = 0;
|
||||
virtual int SendTo (Ptr<Packet> p, const Address &address) = 0;
|
||||
|
||||
/**
|
||||
* \brief Send data to a specified peer.
|
||||
* \param address IP Address of remote host
|
||||
* \param buf A pointer to a raw byte buffer of some data to send. If this
|
||||
* is 0, we send dummy data whose size is specified by the third parameter
|
||||
* \param size the number of bytes to copy from the buffer
|
||||
* \param address IP Address of remote host
|
||||
* \returns -1 in case of error or the number of bytes copied in the
|
||||
* internal buffer and accepted for transmission.
|
||||
*
|
||||
* This is provided so as to have an API which is closer in appearance
|
||||
* to that of real network or BSD sockets.
|
||||
*/
|
||||
int SendTo (const Address &address, const uint8_t* buf, uint32_t size);
|
||||
int SendTo (const uint8_t* buf, uint32_t size, const Address &address);
|
||||
|
||||
/**
|
||||
* \brief Read a single packet from the socket
|
||||
|
||||
Reference in new issue
Block a user