ip_impl

Warning

doxygenfile: Cannot find file “eos/ip_impl.h

Type definitions in ip_impl

namespace eos
class ip_addr_mask_impl_t
#include <ip_impl.h>

An IP address with a subnet mask.

This allows for contiguous subnet masks only for IPv4 and IPv6 addresses.

IPv6 addresses in EOS only support contiguous masks, so for IPv6 addresses mask() provides the same value as mask_length().

Public Functions

ip_addr_mask_impl_t()
ip_addr_mask_impl_t(ip_addr_t const & addr, uint8_t mask_length)
ip_addr_t addr() const

Getter for ‘addr’: the address/mask’s IP address.

uint8_t mask_length() const

Getter for ‘mask_length’: the bit mask length, e.g., 24.

af_t af() const

The address family of the prefix.

uint32_be_t mask() const

The bit mask itself, e.g., 0xFFFFFF00 (IPv4). For IPv6, same as mask_length().

std::string to_string() const

The IP address and mask as a string, e.g., “192.0.2.1/0xFFFFFF00”.

bool operator==(ip_addr_mask_impl_t const & other) const
bool operator!=(ip_addr_mask_impl_t const & other) const
bool operator<(ip_addr_mask_impl_t const & other) const
uint32_t hash() const

The hash function for type ip_addr_mask_t.

void mix_me(hash_mix & h) const

The hash mix function for type ip_addr_mask_t.

Private Members

ip_addr_t addr_
uint8_t mask_length_

Friends

friend std::ostream & operator<<

A utility stream operator that adds a string representation of ip_addr_mask_t to the ostream.