an Inet address class More...
#include <inet-socket-address.h>
Public Member Functions | |
InetSocketAddress (Ipv4Address ipv4, uint16_t port) | |
InetSocketAddress (Ipv4Address ipv4) | |
InetSocketAddress (uint16_t port) | |
InetSocketAddress (const char *ipv4, uint16_t port) | |
InetSocketAddress (const char *ipv4) | |
uint16_t | GetPort (void) const |
Ipv4Address | GetIpv4 (void) const |
void | SetPort (uint16_t port) |
void | SetIpv4 (Ipv4Address address) |
operator Address () const | |
Static Public Member Functions | |
static bool | IsMatchingType (const Address &address) |
static InetSocketAddress | ConvertFrom (const Address &address) |
Private Member Functions | |
Address | ConvertTo (void) const |
Static Private Member Functions | |
static uint8_t | GetType (void) |
Private Attributes | |
Ipv4Address | m_ipv4 |
uint16_t | m_port |
an Inet address class
This class is similar to inet_sockaddr in the BSD socket API. i.e., this class holds an Ipv4Address and a port number to form an ipv4 transport endpoint.
Definition at line 40 of file inet-socket-address.h.
ns3::InetSocketAddress::InetSocketAddress | ( | Ipv4Address | ipv4, | |
uint16_t | port | |||
) |
ipv4 | the ipv4 address | |
port | the port number |
Definition at line 24 of file inet-socket-address.cc.
ns3::InetSocketAddress::InetSocketAddress | ( | Ipv4Address | ipv4 | ) |
ipv4 | the ipv4 address |
The port number is set to zero by default.
Definition at line 28 of file inet-socket-address.cc.
ns3::InetSocketAddress::InetSocketAddress | ( | uint16_t | port | ) |
port | the port number |
The ipv4 address is set to the "Any" address by default.
Definition at line 40 of file inet-socket-address.cc.
ns3::InetSocketAddress::InetSocketAddress | ( | const char * | ipv4, | |
uint16_t | port | |||
) |
ipv4 | string which represents an ipv4 address | |
port | the port number |
Definition at line 32 of file inet-socket-address.cc.
ns3::InetSocketAddress::InetSocketAddress | ( | const char * | ipv4 | ) |
ipv4 | string which represents an ipv4 address |
The port number is set to zero.
Definition at line 36 of file inet-socket-address.cc.
InetSocketAddress ns3::InetSocketAddress::ConvertFrom | ( | const Address & | address | ) | [static] |
address | the Address instance to convert from. |
Returns an InetSocketAddress which corresponds to the input Address
Definition at line 87 of file inet-socket-address.cc.
Referenced by ns3::UdpSocketImpl::Bind(), ns3::TcpSocketImpl::Bind(), ns3::NscTcpSocketImpl::Bind(), ns3::Ipv4RawSocketImpl::Bind(), ns3::TcpSocketImpl::CompleteFork(), ns3::UdpSocketImpl::Connect(), ns3::TcpSocketImpl::Connect(), ns3::NscTcpSocketImpl::Connect(), ns3::Ipv4RawSocketImpl::Connect(), ns3::UdpSocketImpl::DoSendTo(), ns3::TcpSocketImpl::DoSendTo(), ns3::UdpEchoServer::HandleRead(), ns3::UdpEchoClient::HandleRead(), ns3::PacketSink::HandleRead(), ns3::olsr::AgentImpl::RecvOlsr(), ns3::UdpSocketImpl::SendTo(), and ns3::Ipv4RawSocketImpl::SendTo().
Address ns3::InetSocketAddress::ConvertTo | ( | void | ) | const [private] |
Definition at line 78 of file inet-socket-address.cc.
References GetType(), m_ipv4, m_port, and ns3::Ipv4Address::Serialize().
Ipv4Address ns3::InetSocketAddress::GetIpv4 | ( | void | ) | const |
Definition at line 50 of file inet-socket-address.cc.
Referenced by ns3::UdpSocketImpl::Bind(), ns3::TcpSocketImpl::Bind(), ns3::NscTcpSocketImpl::Bind(), ns3::Ipv4RawSocketImpl::Bind(), ns3::TcpSocketImpl::CompleteFork(), ns3::UdpSocketImpl::Connect(), ns3::TcpSocketImpl::Connect(), ns3::NscTcpSocketImpl::Connect(), ns3::Ipv4RawSocketImpl::Connect(), ns3::UdpSocketImpl::DoSendTo(), ns3::TcpSocketImpl::DoSendTo(), ns3::UdpEchoServer::HandleRead(), ns3::UdpEchoClient::HandleRead(), ns3::PacketSink::HandleRead(), ns3::olsr::AgentImpl::RecvOlsr(), ns3::UdpSocketImpl::SendTo(), and ns3::Ipv4RawSocketImpl::SendTo().
uint16_t ns3::InetSocketAddress::GetPort | ( | void | ) | const |
Definition at line 45 of file inet-socket-address.cc.
Referenced by ns3::UdpSocketImpl::Bind(), ns3::TcpSocketImpl::Bind(), ns3::NscTcpSocketImpl::Bind(), ns3::TcpSocketImpl::CompleteFork(), ns3::UdpSocketImpl::Connect(), ns3::TcpSocketImpl::Connect(), ns3::NscTcpSocketImpl::Connect(), ns3::UdpSocketImpl::DoSendTo(), ns3::TcpSocketImpl::DoSendTo(), ns3::olsr::AgentImpl::RecvOlsr(), and ns3::UdpSocketImpl::SendTo().
uint8_t ns3::InetSocketAddress::GetType | ( | void | ) | [static, private] |
Definition at line 97 of file inet-socket-address.cc.
Referenced by ConvertTo(), and IsMatchingType().
bool ns3::InetSocketAddress::IsMatchingType | ( | const Address & | address | ) | [static] |
Definition at line 67 of file inet-socket-address.cc.
References ns3::Address::CheckCompatible(), and GetType().
Referenced by ns3::UdpSocketImpl::Bind(), ns3::TcpSocketImpl::Bind(), ns3::NscTcpSocketImpl::Bind(), ns3::Ipv4RawSocketImpl::Bind(), ns3::Ipv4RawSocketImpl::Connect(), ns3::UdpEchoServer::HandleRead(), ns3::UdpEchoClient::HandleRead(), ns3::PacketSink::HandleRead(), and ns3::Ipv4RawSocketImpl::SendTo().
ns3::InetSocketAddress::operator Address | ( | ) | const |
Definition at line 72 of file inet-socket-address.cc.
void ns3::InetSocketAddress::SetIpv4 | ( | Ipv4Address | address | ) |
address | the new ipv4 address |
Definition at line 61 of file inet-socket-address.cc.
void ns3::InetSocketAddress::SetPort | ( | uint16_t | port | ) |
port | the new port number. |
Definition at line 56 of file inet-socket-address.cc.
References m_port.
Ipv4Address ns3::InetSocketAddress::m_ipv4 [private] |
Definition at line 111 of file inet-socket-address.h.
Referenced by ConvertTo().
uint16_t ns3::InetSocketAddress::m_port [private] |
Definition at line 112 of file inet-socket-address.h.
Referenced by ConvertTo(), and SetPort().