Electroneum
epee::net_utils::ipv4_network_address Class Reference

#include <net_utils_base.h>

Public Member Functions

constexpr ipv4_network_address () noexcept
 
constexpr ipv4_network_address (uint32_t ip, uint16_t port) noexcept
 
bool equal (const ipv4_network_address &other) const noexcept
 
bool less (const ipv4_network_address &other) const noexcept
 
constexpr bool is_same_host (const ipv4_network_address &other) const noexcept
 
constexpr uint32_t ip () const noexcept
 
constexpr uint16_t port () const noexcept
 
std::string str () const
 
std::string host_str () const
 
bool is_loopback () const
 
bool is_local () const
 

Static Public Member Functions

static constexpr address_type get_type_id () noexcept
 
static constexpr zone get_zone () noexcept
 
static constexpr bool is_blockable () noexcept
 

Detailed Description

Definition at line 63 of file net_utils_base.h.

Constructor & Destructor Documentation

◆ ipv4_network_address() [1/2]

constexpr epee::net_utils::ipv4_network_address::ipv4_network_address ( )
inlinenoexcept

Definition at line 69 of file net_utils_base.h.

70  : ipv4_network_address(0, 0)
71  {}
constexpr ipv4_network_address() noexcept

◆ ipv4_network_address() [2/2]

constexpr epee::net_utils::ipv4_network_address::ipv4_network_address ( uint32_t  ip,
uint16_t  port 
)
inlinenoexcept

Definition at line 73 of file net_utils_base.h.

74  : m_ip(ip), m_port(port) {}
constexpr uint16_t port() const noexcept
constexpr uint32_t ip() const noexcept

Member Function Documentation

◆ equal()

bool epee::net_utils::ipv4_network_address::equal ( const ipv4_network_address other) const
noexcept

Definition at line 11 of file net_utils_base.cpp.

12  { return is_same_host(other) && port() == other.port(); }
constexpr uint16_t port() const noexcept
constexpr bool is_same_host(const ipv4_network_address &other) const noexcept

◆ get_type_id()

static constexpr address_type epee::net_utils::ipv4_network_address::get_type_id ( )
inlinestaticnoexcept

Definition at line 87 of file net_utils_base.h.

Here is the caller graph for this function:

◆ get_zone()

static constexpr zone epee::net_utils::ipv4_network_address::get_zone ( )
inlinestaticnoexcept

Definition at line 88 of file net_utils_base.h.

◆ host_str()

std::string epee::net_utils::ipv4_network_address::host_str ( ) const

Definition at line 20 of file net_utils_base.cpp.

std::string get_ip_string_from_int32(uint32_t ip)
constexpr uint32_t ip() const noexcept
Here is the call graph for this function:

◆ ip()

constexpr uint32_t epee::net_utils::ipv4_network_address::ip ( ) const
inlinenoexcept

Definition at line 81 of file net_utils_base.h.

81 { return m_ip; }
Here is the caller graph for this function:

◆ is_blockable()

static constexpr bool epee::net_utils::ipv4_network_address::is_blockable ( )
inlinestaticnoexcept

Definition at line 89 of file net_utils_base.h.

89 { return true; }

◆ is_local()

bool epee::net_utils::ipv4_network_address::is_local ( ) const

Definition at line 22 of file net_utils_base.cpp.

22 { return net_utils::is_ip_local(ip()); }
constexpr uint32_t ip() const noexcept
bool is_ip_local(uint32_t ip)
Definition: local_ip.h:35
Here is the call graph for this function:

◆ is_loopback()

bool epee::net_utils::ipv4_network_address::is_loopback ( ) const

Definition at line 21 of file net_utils_base.cpp.

21 { return net_utils::is_ip_loopback(ip()); }
constexpr uint32_t ip() const noexcept
bool is_ip_loopback(uint32_t ip)
Definition: local_ip.h:58
Here is the call graph for this function:

◆ is_same_host()

constexpr bool epee::net_utils::ipv4_network_address::is_same_host ( const ipv4_network_address other) const
inlinenoexcept

Definition at line 78 of file net_utils_base.h.

79  { return ip() == other.ip(); }
constexpr uint32_t ip() const noexcept
Here is the call graph for this function:

◆ less()

bool epee::net_utils::ipv4_network_address::less ( const ipv4_network_address other) const
noexcept

Definition at line 14 of file net_utils_base.cpp.

15  { return is_same_host(other) ? port() < other.port() : ip() < other.ip(); }
constexpr uint16_t port() const noexcept
constexpr uint32_t ip() const noexcept
constexpr bool is_same_host(const ipv4_network_address &other) const noexcept

◆ port()

constexpr uint16_t epee::net_utils::ipv4_network_address::port ( ) const
inlinenoexcept

Definition at line 82 of file net_utils_base.h.

82 { return m_port; }
Here is the caller graph for this function:

◆ str()

std::string epee::net_utils::ipv4_network_address::str ( ) const

Definition at line 17 of file net_utils_base.cpp.

constexpr uint16_t port() const noexcept
std::string get_ip_string_from_int32(uint32_t ip)
constexpr uint32_t ip() const noexcept
std::string to_string(t_connection_type type)
Here is the call graph for this function:

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