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

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)
 
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)
 
static bool IsMatchingType (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
 

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().

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

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 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 NS_LOG_FUNCTION.


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