A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::InetSocketAddress Class Reference

an Inet address class More...

#include <inet-socket-address.h>

+ Collaboration diagram for ns3::InetSocketAddress:

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)
 
Ipv4Address GetIpv4 (void) const
 
uint16_t GetPort (void) const
 
 operator Address () const
 
void SetIpv4 (Ipv4Address address)
 
void SetPort (uint16_t port)
 

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)
 

Private Member Functions

Address ConvertTo (void) const
 Convert to an Address type. More...
 

Static Private Member Functions

static uint8_t GetType (void)
 Get the underlying address type (automatically assigned). More...
 

Private Attributes

Ipv4Address m_ipv4
 the IPv4 address More...
 
uint16_t m_port
 the port More...
 

Detailed Description

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.

Constructor & Destructor Documentation

ns3::InetSocketAddress::InetSocketAddress ( Ipv4Address  ipv4,
uint16_t  port 
)
Parameters
ipv4the ipv4 address
portthe port number

Definition at line 29 of file inet-socket-address.cc.

References NS_LOG_FUNCTION.

Referenced by ConvertFrom().

+ Here is the caller graph for this function:

ns3::InetSocketAddress::InetSocketAddress ( Ipv4Address  ipv4)
Parameters
ipv4the ipv4 address

The port number is set to zero by default.

Definition at line 35 of file inet-socket-address.cc.

References NS_LOG_FUNCTION.

ns3::InetSocketAddress::InetSocketAddress ( uint16_t  port)
Parameters
portthe port number

The ipv4 address is set to the "Any" address by default.

Definition at line 53 of file inet-socket-address.cc.

References NS_LOG_FUNCTION.

ns3::InetSocketAddress::InetSocketAddress ( const char *  ipv4,
uint16_t  port 
)
Parameters
ipv4string which represents an ipv4 address
portthe port number

Definition at line 41 of file inet-socket-address.cc.

References NS_LOG_FUNCTION.

ns3::InetSocketAddress::InetSocketAddress ( const char *  ipv4)
Parameters
ipv4string which represents an ipv4 address

The port number is set to zero.

Definition at line 47 of file inet-socket-address.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

Address ns3::InetSocketAddress::ConvertTo ( void  ) const
private

Convert to an Address type.

Definition at line 98 of file inet-socket-address.cc.

References GetType(), m_ipv4, m_port, NS_LOG_FUNCTION, and ns3::Ipv4Address::Serialize().

+ Here is the call graph for this function:

uint8_t ns3::InetSocketAddress::GetType ( void  )
staticprivate

Get the underlying address type (automatically assigned).

Returns
the address type

Definition at line 119 of file inet-socket-address.cc.

References NS_LOG_FUNCTION_NOARGS, and ns3::Address::Register().

Referenced by ConvertFrom(), ConvertTo(), and IsMatchingType().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ns3::InetSocketAddress::operator Address ( ) const
Returns
an Address instance which represents this InetSocketAddress instance.

Definition at line 92 of file inet-socket-address.cc.

void ns3::InetSocketAddress::SetIpv4 ( Ipv4Address  address)
Parameters
addressthe new ipv4 address

Definition at line 79 of file inet-socket-address.cc.

References first::address, m_ipv4, and NS_LOG_FUNCTION.

void ns3::InetSocketAddress::SetPort ( uint16_t  port)
Parameters
portthe new port number.

Definition at line 73 of file inet-socket-address.cc.

References m_port, NS_LOG_FUNCTION, and port.

Member Data Documentation

Ipv4Address ns3::InetSocketAddress::m_ipv4
private

the IPv4 address

Definition at line 121 of file inet-socket-address.h.

Referenced by ConvertTo(), GetIpv4(), and SetIpv4().

uint16_t ns3::InetSocketAddress::m_port
private

the port

Definition at line 122 of file inet-socket-address.h.

Referenced by ConvertTo(), GetPort(), and SetPort().


The documentation for this class was generated from the following files: