|
|
| 25 |
|
25 |
|
| 26 |
#include "ns3/ipv6-address.h" |
26 |
#include "ns3/ipv6-address.h" |
| 27 |
#include "ns3/callback.h" |
27 |
#include "ns3/callback.h" |
|
|
28 |
#include "ns3/net-device.h" |
| 28 |
|
29 |
|
| 29 |
namespace ns3 |
30 |
namespace ns3 |
| 30 |
{ |
31 |
{ |
|
|
| 95 |
void SetPeer (Ipv6Address addr, uint16_t port); |
96 |
void SetPeer (Ipv6Address addr, uint16_t port); |
| 96 |
|
97 |
|
| 97 |
/** |
98 |
/** |
|
|
99 |
* \brief Bind a socket to specific device. |
| 100 |
* |
| 101 |
* This method corresponds to using setsockopt() SO_BINDTODEVICE |
| 102 |
* of real network or BSD sockets. If set on a socket, this option will |
| 103 |
* force packets to leave the bound device regardless of the device that |
| 104 |
* IP routing would naturally choose. In the receive direction, only |
| 105 |
* packets received from the bound interface will be delivered. |
| 106 |
* |
| 107 |
* This option has no particular relationship to binding sockets to |
| 108 |
* an address via Socket::Bind (). It is possible to bind sockets to a |
| 109 |
* specific IP address on the bound interface by calling both |
| 110 |
* Socket::Bind (address) and Socket::BindToNetDevice (device), but it |
| 111 |
* is also possible to bind to mismatching device and address, even if |
| 112 |
* the socket can not receive any packets as a result. |
| 113 |
* |
| 114 |
* \param netdevice Pointer to Netdevice of desired interface |
| 115 |
* \returns nothing |
| 116 |
*/ |
| 117 |
void BindToNetDevice (Ptr<NetDevice> netdevice); |
| 118 |
|
| 119 |
/** |
| 120 |
* \brief Returns socket's bound netdevice, if any. |
| 121 |
* |
| 122 |
* This method corresponds to using getsockopt() SO_BINDTODEVICE |
| 123 |
* of real network or BSD sockets. |
| 124 |
* |
| 125 |
* |
| 126 |
* \returns Pointer to interface. |
| 127 |
*/ |
| 128 |
Ptr<NetDevice> GetBoundNetDevice (void); |
| 129 |
|
| 130 |
/** |
| 98 |
* \brief Set the reception callback. |
131 |
* \brief Set the reception callback. |
| 99 |
* \param callback callback function |
132 |
* \param callback callback function |
| 100 |
*/ |
133 |
*/ |
|
|
| 175 |
uint16_t m_peerPort; |
208 |
uint16_t m_peerPort; |
| 176 |
|
209 |
|
| 177 |
/** |
210 |
/** |
|
|
211 |
* \brief The NetDevice the EndPoint is bound to (if any). |
| 212 |
*/ |
| 213 |
Ptr<NetDevice> m_boundnetdevice; |
| 214 |
|
| 215 |
/** |
| 178 |
* \brief The RX callback. |
216 |
* \brief The RX callback. |
| 179 |
*/ |
217 |
*/ |
| 180 |
Callback<void, Ptr<Packet>, Ipv6Address, Ipv6Address, uint16_t> m_rxCallback; |
218 |
Callback<void, Ptr<Packet>, Ipv6Address, Ipv6Address, uint16_t> m_rxCallback; |