Electroneum
Loading...
Searching...
No Matches
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]

epee::net_utils::ipv4_network_address::ipv4_network_address ( )
inlineconstexprnoexcept

Definition at line 69 of file net_utils_base.h.

71 {}
constexpr ipv4_network_address() noexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ipv4_network_address() [2/2]

epee::net_utils::ipv4_network_address::ipv4_network_address ( uint32_t ip,
uint16_t port )
inlineconstexprnoexcept

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
Here is the call graph for this function:

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 bool is_same_host(const ipv4_network_address &other) const noexcept
Here is the call graph for this function:

◆ get_type_id()

constexpr address_type epee::net_utils::ipv4_network_address::get_type_id ( )
inlinestaticconstexprnoexcept

Definition at line 87 of file net_utils_base.h.

Here is the caller graph for this function:

◆ get_zone()

constexpr zone epee::net_utils::ipv4_network_address::get_zone ( )
inlinestaticconstexprnoexcept

Definition at line 88 of file net_utils_base.h.

88{ return zone::public_; }

◆ 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)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ip()

uint32_t epee::net_utils::ipv4_network_address::ip ( ) const
inlineconstexprnoexcept

Definition at line 81 of file net_utils_base.h.

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

◆ is_blockable()

constexpr bool epee::net_utils::ipv4_network_address::is_blockable ( )
inlinestaticconstexprnoexcept

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()); }
bool is_ip_local(uint32_t ip)
Definition local_ip.h:35
Here is the call graph for this function:
Here is the caller 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()); }
bool is_ip_loopback(uint32_t ip)
Definition local_ip.h:58
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_same_host()

bool epee::net_utils::ipv4_network_address::is_same_host ( const ipv4_network_address & other) const
inlineconstexprnoexcept

Definition at line 78 of file net_utils_base.h.

79 { return ip() == other.ip(); }
Here is the call graph for this function:
Here is the caller 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(); }
Here is the call graph for this function:

◆ port()

uint16_t epee::net_utils::ipv4_network_address::port ( ) const
inlineconstexprnoexcept

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.

18 { return string_tools::get_ip_string_from_int32(ip()) + ":" + std::to_string(port()); }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/contrib/epee/include/net/net_utils_base.h
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/contrib/epee/src/net_utils_base.cpp