an Inet address class More...
#include "inet-socket-address.h"
Public Member Functions | |
InetSocketAddress (const char *ipv4) | |
InetSocketAddress (const char *ipv4, uint16_t port) | |
InetSocketAddress (Ipv4Address ipv4) | |
InetSocketAddress (Ipv4Address ipv4, uint16_t port) | |
InetSocketAddress (uint16_t port) | |
Address | ConvertTo () const |
Convert to an Address type. More... | |
Ipv4Address | GetIpv4 () const |
uint16_t | GetPort () const |
uint8_t | GetTos () const |
operator Address () const | |
void | SetIpv4 (Ipv4Address address) |
void | SetPort (uint16_t port) |
void | SetTos (uint8_t tos) |
Static Public Member Functions | |
static InetSocketAddress | ConvertFrom (const Address &address) |
Returns an InetSocketAddress which corresponds to the input Address. More... | |
static bool | IsMatchingType (const Address &address) |
Static Private Member Functions | |
static uint8_t | GetType () |
Get the underlying address type (automatically assigned). More... | |
Private Attributes | |
Ipv4Address | m_ipv4 |
the IPv4 address More... | |
uint16_t | m_port |
the port More... | |
uint8_t | m_tos |
the ToS More... | |
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 41 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 30 of file inet-socket-address.cc.
References nsclick-simple-lan::ipv4, NS_LOG_FUNCTION, and port.
ns3::InetSocketAddress::InetSocketAddress | ( | Ipv4Address | ipv4 | ) |
ipv4 | the ipv4 address |
The port number is set to zero by default.
Definition at line 38 of file inet-socket-address.cc.
References nsclick-simple-lan::ipv4, and NS_LOG_FUNCTION.
ns3::InetSocketAddress::InetSocketAddress | ( | uint16_t | port | ) |
port | the port number |
The ipv4 address is set to the "Any" address by default.
Definition at line 62 of file inet-socket-address.cc.
References NS_LOG_FUNCTION, and port.
ns3::InetSocketAddress::InetSocketAddress | ( | const char * | ipv4, |
uint16_t | port | ||
) |
ipv4 | string which represents an ipv4 address |
port | the port number |
Definition at line 46 of file inet-socket-address.cc.
References nsclick-simple-lan::ipv4, NS_LOG_FUNCTION, and port.
ns3::InetSocketAddress::InetSocketAddress | ( | const char * | ipv4 | ) |
ipv4 | string which represents an ipv4 address |
The port number is set to zero.
Definition at line 54 of file inet-socket-address.cc.
References nsclick-simple-lan::ipv4, and NS_LOG_FUNCTION.
|
static |
Returns an InetSocketAddress which corresponds to the input Address.
address | the Address instance to convert from. |
Definition at line 137 of file inet-socket-address.cc.
References first::address, ns3::Ipv4Address::Deserialize(), GetType(), nsclick-simple-lan::ipv4, NS_ASSERT, NS_LOG_FUNCTION, port, and SetTos().
Referenced by ns3::DhcpClient::AcceptAck(), ns3::QKDKeyManagerSystemApplication::AddNewLink(), ns3::Ipv4RawSocketImpl::Bind(), ns3::TcpSocketBase::Bind(), ns3::UdpSocketImpl::Bind(), ns3::QKDKeyManagerSystemApplication::CheckDoSAttack(), ns3::QKDApp004::Close(), ns3::TcpSocketBase::CompleteFork(), ns3::Ipv4RawSocketImpl::Connect(), ns3::TcpSocketBase::Connect(), ns3::UdpSocketImpl::Connect(), ns3::QKDApp004::ConnectionRequestedFromKMS(), ns3::QKDApp014::ConnectionRequestedFromKMS(), ns3::QKDKeyManagerSystemApplication::ConnectToSDNController(), ns3::QKDApp004::CreateKeyQueues(), dstSocketRecv(), ns3::aodv::LoopbackTestCase::EchoData(), ns3::SinkTracer::FormatAddress(), ns3::QKDApp004::GetKeyFromKMS(), ns3::QKDApp014::GetKeysFromKMS(), ns3::QKDApp014::GetKeyWithKeyIDs(), ns3::QKDApp014::GetStatusFromKMS(), ns3::QKDKeyManagerSystemApplication::HandleAccept(), ns3::QKDSDNController::HandleAccept(), ns3::QKDApp004::HandleAcceptFromApp(), ns3::QKDApp014::HandleAcceptFromApp(), ns3::QKDApp004::HandleAcceptFromKMS(), ns3::QKDApp014::HandleAcceptFromKMS(), ns3::QKDKeyManagerSystemApplication::HandleAcceptKMSs(), ns3::QKDKeyManagerSystemApplication::HandleAcceptSDN(), ns3::QKDApp004::HandleAcceptSignalingFromApp(), ns3::QKDApp014::HandleAcceptSignalingFromApp(), ns3::PacketSink::HandleRead(), ns3::QKDKeyManagerSystemApplication::HandleRead(), ns3::QKDSDNController::HandleRead(), ns3::UdpEchoClient::HandleRead(), ns3::UdpEchoServer::HandleRead(), ns3::UdpServer::HandleRead(), ns3::QKDApp004::HandleReadFromApp(), ns3::QKDApp014::HandleReadFromApp(), ns3::QKDApp004::HandleReadFromKMS(), ns3::QKDApp014::HandleReadFromKMS(), ns3::QKDKeyManagerSystemApplication::HandleReadKMSs(), ns3::QKDKeyManagerSystemApplication::HandleReadSDN(), ns3::QKDApp004::HandleReadSignalingFromApp(), ns3::QKDApp014::HandleReadSignalingFromApp(), ns3::addressUtils::IsMulticast(), ns3::DhcpServer::NetHandler(), ns3::QKDApp004::OpenConnect(), ns3::PacketSink::AddressHash::operator()(), ns3::QKDApp004::AddressHash::operator()(), ns3::QKDApp014::AddressHash::operator()(), ns3::QKDKeyManagerSystemApplication::AddressHash::operator()(), ns3::QKDSDNController::AddressHash::operator()(), ns3::QKDApp004::PrepareSendSocketToApp(), ns3::QKDApp004::PrepareSendSocketToKMS(), ns3::QKDApp014::PrepareSendSocketToKMS(), ns3::QKDApp004::PrepareSinkSocketFromApp(), ns3::QKDApp004::PrepareSinkSocketFromKMS(), ns3::QKDApp014::PrepareSinkSocketFromKMS(), PrintReceivedPacket(), ns3::QKDKeyManagerSystemApplication::ProcessRequest(), ns3::TcpSocketBase::ProcessSynRcvd(), Receiver::Receive(), ns3::Ping::Receive(), ns3::V4TraceRoute::Receive(), ns3::Rip::Receive(), ns3::olsr::Bug780Test::Receive(), ns3::ThreeGppHttpClient::ReceivedDataCallback(), ns3::ThreeGppHttpServer::ReceivedDataCallback(), ns3::aodv::RoutingProtocol::RecvAodv(), ns3::dsdv::RoutingProtocol::RecvDsdv(), ns3::olsr::RoutingProtocol::RecvOlsr(), ns3::QKDKeyManagerSystemApplication::RegisterApplicationEntry(), ns3::UdpEchoClient::Send(), ns3::QKDApp004::SendKsidRequest(), ns3::QKDApp004::SendMaliciousRequestToKMS(), ns3::OnOffApplication::SendPacket(), ns3::TcpL4Protocol::SendPacket(), ns3::QKDKeyManagerSystemApplication::SendQKDLinkStatusToSDN(), ns3::UdpSocketImpl::SendTo(), ns3::Ipv4RawSocketImpl::SendTo(), ns3::QKDApp004::Setup(), ns3::QKDApp014::Setup(), srcSocketRecv(), ns3::PacketSink::StartApplication(), ns3::UdpClient::StartApplication(), and ns3::QKDPostprocessingApplication::StartApplication().
Address ns3::InetSocketAddress::ConvertTo | ( | ) | const |
Convert to an Address type.
Definition at line 125 of file inet-socket-address.cc.
References GetType(), m_ipv4, m_port, m_tos, NS_LOG_FUNCTION, and ns3::Ipv4Address::Serialize().
Ipv4Address ns3::InetSocketAddress::GetIpv4 | ( | ) | const |
Definition at line 78 of file inet-socket-address.cc.
References m_ipv4, and NS_LOG_FUNCTION.
Referenced by ns3::DhcpClient::AcceptAck(), ns3::QKDKeyManagerSystemApplication::AddNewLink(), ns3::Ipv4RawSocketImpl::Bind(), ns3::TcpSocketBase::Bind(), ns3::UdpSocketImpl::Bind(), ns3::QKDKeyManagerSystemApplication::CheckDoSAttack(), ns3::QKDApp004::Close(), ns3::Ipv4RawSocketImpl::Connect(), ns3::TcpSocketBase::Connect(), ns3::UdpSocketImpl::Connect(), ns3::QKDKeyManagerSystemApplication::ConnectToSDNController(), ns3::QKDApp004::CreateKeyQueues(), ns3::aodv::LoopbackTestCase::EchoData(), ns3::SinkTracer::FormatAddress(), ns3::QKDApp004::GetKeyFromKMS(), ns3::QKDApp014::GetKeysFromKMS(), ns3::QKDApp014::GetKeyWithKeyIDs(), ns3::QKDApp014::GetStatusFromKMS(), ns3::QKDKeyManagerSystemApplication::HandleAcceptKMSs(), ns3::PacketSink::HandleRead(), ns3::QKDKeyManagerSystemApplication::HandleRead(), ns3::QKDSDNController::HandleRead(), ns3::UdpEchoClient::HandleRead(), ns3::UdpEchoServer::HandleRead(), ns3::QKDApp004::HandleReadFromApp(), ns3::QKDApp014::HandleReadFromApp(), ns3::QKDApp004::HandleReadFromKMS(), ns3::QKDApp014::HandleReadFromKMS(), ns3::QKDKeyManagerSystemApplication::HandleReadKMSs(), ns3::QKDKeyManagerSystemApplication::HandleReadSDN(), ns3::QKDApp004::HandleReadSignalingFromApp(), ns3::QKDApp014::HandleReadSignalingFromApp(), ns3::addressUtils::IsMulticast(), ns3::QKDApp004::OpenConnect(), ns3::PacketSink::AddressHash::operator()(), ns3::QKDApp004::AddressHash::operator()(), ns3::QKDApp014::AddressHash::operator()(), ns3::QKDKeyManagerSystemApplication::AddressHash::operator()(), ns3::QKDSDNController::AddressHash::operator()(), PrintReceivedPacket(), ns3::Ping::PrintReport(), ns3::QKDKeyManagerSystemApplication::ProcessRequest(), Receiver::Receive(), ns3::Ping::Receive(), ns3::V4TraceRoute::Receive(), ns3::Rip::Receive(), ns3::ThreeGppHttpClient::ReceivedDataCallback(), ns3::ThreeGppHttpServer::ReceivedDataCallback(), ns3::aodv::RoutingProtocol::RecvAodv(), ns3::dsdv::RoutingProtocol::RecvDsdv(), ns3::olsr::RoutingProtocol::RecvOlsr(), ns3::QKDKeyManagerSystemApplication::RegisterApplicationEntry(), ns3::DhcpServer::SendAck(), ns3::QKDApp004::SendKsidRequest(), ns3::QKDApp004::SendMaliciousRequestToKMS(), ns3::DhcpServer::SendOffer(), ns3::OnOffApplication::SendPacket(), ns3::TcpL4Protocol::SendPacket(), ns3::QKDKeyManagerSystemApplication::SendQKDLinkStatusToSDN(), ns3::UdpSocketImpl::SendTo(), ns3::Ipv4RawSocketImpl::SendTo(), srcSocketRecv(), ns3::UdpClient::StartApplication(), and ns3::Ping::StartApplication().
uint16_t ns3::InetSocketAddress::GetPort | ( | ) | const |
Definition at line 71 of file inet-socket-address.cc.
References m_port, and NS_LOG_FUNCTION.
Referenced by ns3::TcpSocketBase::Bind(), ns3::UdpSocketImpl::Bind(), ns3::TcpSocketBase::Connect(), ns3::UdpSocketImpl::Connect(), ns3::QKDKeyManagerSystemApplication::ConnectToSDNController(), ns3::SinkTracer::FormatAddress(), ns3::PacketSink::HandleRead(), ns3::QKDKeyManagerSystemApplication::HandleRead(), ns3::QKDSDNController::HandleRead(), ns3::UdpEchoClient::HandleRead(), ns3::UdpEchoServer::HandleRead(), ns3::QKDApp004::HandleReadFromApp(), ns3::QKDApp014::HandleReadFromApp(), ns3::QKDApp004::HandleReadFromKMS(), ns3::QKDApp014::HandleReadFromKMS(), ns3::QKDKeyManagerSystemApplication::HandleReadKMSs(), ns3::QKDKeyManagerSystemApplication::HandleReadSDN(), ns3::QKDApp004::HandleReadSignalingFromApp(), ns3::QKDApp014::HandleReadSignalingFromApp(), PrintReceivedPacket(), ns3::V4TraceRoute::Receive(), ns3::Rip::Receive(), ns3::olsr::Bug780Test::Receive(), ns3::ThreeGppHttpClient::ReceivedDataCallback(), ns3::ThreeGppHttpServer::ReceivedDataCallback(), ns3::olsr::RoutingProtocol::RecvOlsr(), ns3::DhcpServer::SendAck(), ns3::DhcpServer::SendOffer(), ns3::OnOffApplication::SendPacket(), ns3::UdpSocketImpl::SendTo(), and ns3::PacketSink::StartApplication().
uint8_t ns3::InetSocketAddress::GetTos | ( | ) | const |
Definition at line 85 of file inet-socket-address.cc.
References m_tos, and NS_LOG_FUNCTION.
Referenced by ns3::TcpSocketBase::Bind(), ns3::UdpSocketImpl::Bind(), ns3::Ipv4RawSocketImpl::Connect(), ns3::TcpSocketBase::Connect(), ns3::UdpSocketImpl::Connect(), ns3::UdpSocketImpl::SendTo(), and ns3::Ipv4RawSocketImpl::SendTo().
|
staticprivate |
Get the underlying address type (automatically assigned).
Definition at line 152 of file inet-socket-address.cc.
References NS_LOG_FUNCTION_NOARGS, ns3::Address::Register(), and check-style-clang-format::type.
Referenced by ConvertFrom(), ConvertTo(), and IsMatchingType().
|
static |
address | address to test |
Definition at line 113 of file inet-socket-address.cc.
References first::address, GetType(), and NS_LOG_FUNCTION.
Referenced by ns3::Ipv4RawSocketImpl::Bind(), ns3::TcpSocketBase::Bind(), ns3::UdpSocketImpl::Bind(), ns3::TcpSocketBase::CompleteFork(), ns3::Ipv4RawSocketImpl::Connect(), ns3::TcpSocketBase::Connect(), ns3::UdpSocketImpl::Connect(), ns3::SinkTracer::FormatAddress(), ns3::PacketSink::HandleRead(), ns3::QKDKeyManagerSystemApplication::HandleRead(), ns3::QKDSDNController::HandleRead(), ns3::UdpEchoClient::HandleRead(), ns3::UdpEchoServer::HandleRead(), ns3::UdpServer::HandleRead(), ns3::QKDApp004::HandleReadFromApp(), ns3::QKDApp014::HandleReadFromApp(), ns3::QKDApp004::HandleReadFromKMS(), ns3::QKDApp014::HandleReadFromKMS(), ns3::QKDKeyManagerSystemApplication::HandleReadKMSs(), ns3::QKDKeyManagerSystemApplication::HandleReadSDN(), ns3::QKDApp004::HandleReadSignalingFromApp(), ns3::QKDApp014::HandleReadSignalingFromApp(), ns3::addressUtils::IsMulticast(), ns3::PacketSink::AddressHash::operator()(), ns3::QKDApp004::AddressHash::operator()(), ns3::QKDApp014::AddressHash::operator()(), ns3::QKDKeyManagerSystemApplication::AddressHash::operator()(), ns3::QKDSDNController::AddressHash::operator()(), PrintReceivedPacket(), Receiver::Receive(), ns3::Ping::Receive(), ns3::V4TraceRoute::Receive(), ns3::olsr::Bug780Test::Receive(), ns3::ThreeGppHttpClient::ReceivedDataCallback(), ns3::ThreeGppHttpServer::ReceivedDataCallback(), ns3::UdpEchoClient::Send(), ns3::OnOffApplication::SendPacket(), ns3::TcpL4Protocol::SendPacket(), ns3::UdpSocketImpl::SendTo(), ns3::Ipv4RawSocketImpl::SendTo(), ns3::BulkSendApplication::StartApplication(), ns3::OnOffApplication::StartApplication(), ns3::PacketSink::StartApplication(), ns3::UdpClient::StartApplication(), ns3::UdpEchoClient::StartApplication(), and ns3::UdpTraceClient::StartApplication().
ns3::InetSocketAddress::operator Address | ( | ) | const |
Definition at line 119 of file inet-socket-address.cc.
void ns3::InetSocketAddress::SetIpv4 | ( | Ipv4Address | address | ) |
address | the new ipv4 address |
Definition at line 99 of file inet-socket-address.cc.
References first::address, m_ipv4, and NS_LOG_FUNCTION.
Referenced by Ipv4FragmentationTest::SendClient().
void ns3::InetSocketAddress::SetPort | ( | uint16_t | port | ) |
port | the new port number. |
Definition at line 92 of file inet-socket-address.cc.
References m_port, NS_LOG_FUNCTION, and port.
Referenced by Ipv4RawSocketImplTest::DoRun().
void ns3::InetSocketAddress::SetTos | ( | uint8_t | tos | ) |
tos | the new ToS. |
Definition at line 106 of file inet-socket-address.cc.
References m_tos, and NS_LOG_FUNCTION.
Referenced by ConvertFrom(), UdpSocketImplTest::DoRun(), WifiAcMappingTest::DoRun(), ns3::UdpSocketImpl::GetPeerName(), and ns3::Ipv4RawSocketImpl::Send().
|
private |
the IPv4 address
Definition at line 132 of file inet-socket-address.h.
Referenced by ConvertTo(), GetIpv4(), and SetIpv4().
|
private |
the port
Definition at line 133 of file inet-socket-address.h.
Referenced by ConvertTo(), GetPort(), and SetPort().
|
private |
the ToS
Definition at line 134 of file inet-socket-address.h.
Referenced by ConvertTo(), GetTos(), and SetTos().