HosrDiretta
Loading...
Searching...
No Matches
ACQUA::IPAddress Class Reference

IP address handling class (Based on IPv6. More...

#include <IPAddress.hpp>

Inheritance diagram for ACQUA::IPAddress:
DIRETTA::Connection::IfInfo

Public Member Functions

 IPAddress (std::uint16_t)
 
 IPAddress (std::uint8_t, std::uint8_t, std::uint8_t, std::uint8_t, std::uint16_t=0)
 
 IPAddress (std::uint16_t, std::uint16_t, std::uint16_t, std::uint16_t, std::uint16_t, std::uint16_t, std::uint16_t, std::uint16_t, std::uint16_t=0)
 
void set_V4 (std::uint32_t)
 
void set_V4_host (std::uint32_t)
 
void set_V6 (const std::uint16_t[8])
 
void set_V6_host (int, std::uint16_t)
 
std::uint32_t get_V4 () const
 
std::uint32_t get_V4_host () const
 
void get_V6 (std::uint16_t[8]) const
 
std::uint16_t get_V6_host (int) const
 
void get (std::uint16_t[9]) const
 
void set (const std::uint16_t[9])
 
void get_V6_str (std::string &) const
 get ipv6 from string format
 
bool set_V6_str (const std::string &)
 set ipv6 from string format
 
void get_V6IFN_str (std::string &) const
 get ipv6 with interface number from string format
 
bool set_V4_str (const std::string &)
 set ipv4 from string format
 
bool set_V4_str (const std::string &, int &)
 set ipv4 from string format. When the netmask is set, obtain
 
void get_V4_str (std::string &) const
 get ipv4 from string format
 
bool eq_address (const IPAddress &in) const
 compare address only
 
bool eq_port (const IPAddress &in) const
 compare port only
 
bool eq_ifno (const IPAddress &in) const
 compare interface number only
 
bool operator== (const IPAddress &in) const
 compare all
 
bool operator!= (const IPAddress &in) const
 compare all
 
bool operator< (const IPAddress &in) const
 compare all
 
bool operator> (const IPAddress &in) const
 compare all
 
bool operator<= (const IPAddress &in) const
 compare all
 
bool operator>= (const IPAddress &in) const
 compare all
 
bool much_address (const IPAddress &, int) const
 Check whether they are in the same segment within the mask.
 
bool is_V4 () const
 Check V4.
 
bool is_V6 () const
 Check V6.
 
bool is_empty () const
 Check empty.
 
bool is_empty_address () const
 Check empty address.
 
bool is_empty_port () const
 Check empty port.
 
bool is_linklocal () const
 Check linklocal address.
 
bool is_loopback () const
 Check loopback address.
 
void clear ()
 Clear.
 
void set_port (std::uint16_t)
 set port in network byte order
 
void set_port_host (std::uint16_t)
 set port in host byte order
 
std::uint16_t get_port () const
 get port in network byte order
 
std::uint16_t get_port_host () const
 get port in host byte order
 
void get_port_str (std::string &) const
 get port string
 
bool set_port_str (const std::string &)
 set port from string
 
void get_if_str (std::string &) const
 get interface number string
 
void get_str (std::string &) const
 get address and port string:
 
void get_add_str (std::string &) const
 get address string:
 
void get_full_str (std::string &) const
 get full string format:
 
bool set_str (const std::string &)
 set string format:
 
bool set_full_str (std::string)
 set full string format:
 
std::string get_str () const
 Get the IP(V6orV4) string.
 
std::string get_V6_str () const
 Get the IPv6 string.
 
std::string get_full_str () const
 Get the full string.
 
void set_ifno (std::uint32_t)
 set interface number
 
std::uint32_t get_ifno () const
 get interface number
 
COMP_CODE comp (const IPAddress &) const
 compare all
 

Static Public Member Functions

static IPAddress loopback (std::uint16_t po=0)
 make the loopback address
 
static IPAddress loopbackV6 (std::uint16_t po=0)
 make the loopback address IPv6
 
static IPAddress loopbackV4 (std::uint16_t po=0)
 make the loopback address IPv4
 

Detailed Description

IP address handling class (Based on IPv6.

Member Function Documentation

◆ get_full_str()

std::string ACQUA::IPAddress::get_full_str ( ) const
inline

Get the full string.

Returns
string IPADDRESSINTERFACENO,PORT

◆ loopback()

static IPAddress ACQUA::IPAddress::loopback ( std::uint16_t po = 0)
inlinestatic

make the loopback address

Parameters
poPort number

◆ loopbackV4()

IPAddress ACQUA::IPAddress::loopbackV4 ( std::uint16_t po = 0)
inlinestatic

make the loopback address IPv4

Parameters
poPort number

◆ loopbackV6()

IPAddress ACQUA::IPAddress::loopbackV6 ( std::uint16_t po = 0)
inlinestatic

make the loopback address IPv6

Parameters
poPort number

◆ much_address()

bool ACQUA::IPAddress::much_address ( const IPAddress & ,
int  ) const

Check whether they are in the same segment within the mask.

Parameters
inComparison target IP address
maskMask length

◆ set_full_str()

bool ACQUA::IPAddress::set_full_str ( std::string )

set full string format:

Parameters
stringIPADDRESSINTERFACENO,PORT
Returns
success

◆ set_str()

bool ACQUA::IPAddress::set_str ( const std::string & )

set string format:

Parameters
stringIPADDRESS,PORT
Returns
success

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