userver: utils::ip::InetNetwork Class Reference
Loading...
Searching...
No Matches
utils::ip::InetNetwork Class Referencefinal

#include <userver/utils/ip.hpp>

Detailed Description

INET IPv4/IPv4 network.

Warning
InetNetwork class is deprecated. You should use InetNetwork class via transformation function to/from NetworkV4/NetworkV6. Use this class only if you need to work with INET PostgreSQL format.

Definition at line 179 of file ip.hpp.

Public Types

enum class  AddressFamily : unsigned char {
  kIPv4 = AF_INET ,
  kIPv6 = AF_INET6
}
 

Public Member Functions

 InetNetwork (std::vector< unsigned char > &&bytes, unsigned char prefix_length, AddressFamily address_family)
 
const std::vector< unsigned char > & GetBytes () const noexcept USERVER_IMPL_LIFETIME_BOUND
 Get the address in bytes.
 
unsigned char GetPrefixLength () const noexcept
 Get the prefix length of network.
 
AddressFamily GetAddressFamily () const noexcept
 Get the address family.
 

Member Enumeration Documentation

◆ AddressFamily

enum class utils::ip::InetNetwork::AddressFamily : unsigned char
strong

Definition at line 181 of file ip.hpp.

Member Function Documentation

◆ GetAddressFamily()

AddressFamily utils::ip::InetNetwork::GetAddressFamily ( ) const
inlinenoexcept

Get the address family.

Definition at line 194 of file ip.hpp.

◆ GetBytes()

const std::vector< unsigned char > & utils::ip::InetNetwork::GetBytes ( ) const
inlinenoexcept

Get the address in bytes.

Definition at line 188 of file ip.hpp.

◆ GetPrefixLength()

unsigned char utils::ip::InetNetwork::GetPrefixLength ( ) const
inlinenoexcept

Get the prefix length of network.

Definition at line 191 of file ip.hpp.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const InetNetwork & lhs,
const InetNetwork & rhs )
friend

Definition at line 201 of file ip.hpp.

◆ operator==

bool operator== ( const InetNetwork & lhs,
const InetNetwork & rhs )
friend

Definition at line 196 of file ip.hpp.


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