UNISTDX_NET_INTERFACE_ADDRESS
template <class Addr>
class sys::interface_address

Network interface address.

Types
  • using iterator = subnet_iterator< addr_type >

    Address iterator type.

  • using rep_type = addr_type::rep_type

    Address representation type.

  • using traits_type = ipaddr_traits< Addr >

    Address traits type.

  • using addr_type = Addr

    Address type.

Methods
  • operator<(const interface_address & rhs) const -> constexpr bool

    Compares addresses and network masks.

  • operator!=(const interface_address & rhs) const -> constexpr bool

    Compares addresses and network masks.

  • operator==(const interface_address & rhs) const -> constexpr bool

    Compares addresses and network masks.

  • operator!() const -> constexpr bool

    Returns true, if either address or network mask is invalid (equals nought).

  • operator bool() const -> constexprexplicit

    Returns true, if both address and network mask are valid (non-nought).

  • is_widearea() const -> constexpr bool

    Returns true, if the subnetwork is widearea.

  • is_loopback() const -> constexpr bool

    Returns true, if the subnetwork is loopback.

  • last() const -> constexpr rep_type

    Get the last address in the network (broadcast address).

  • first() const -> constexpr rep_type

    Get the first address in the network (gateway address).

  • contains(const addr_type & rhs) const -> constexpr bool

    Returns true, of the subnetwork contains address rhs.

  • count() const -> constexpr rep_type

    Return the number of addresses in the subnetwork, including gateway and broadcast addresses.

  • end() const -> constexpr iterator

    Get iterator to the end of the subnetwork.

  • middle() const -> constexpr iterator

    Get iterator to this interface address in the subnetwork.

  • begin() const -> constexpr iterator

    Get iterator to the beginning of the subnetwork.

  • position() const -> constexpr rep_type

    Get position of interface address in its subnetwork.

  • gateway() const -> constexpr const addr_type &

    Get network gateway address.

  • prefix() const -> prefix_type

    Get network prefix.

  • netmask() const -> constexpr const addr_type &

    Get network mask.

  • address() const -> constexpr const addr_type &

    Get address.

  • operator=(const interface_address &) -> interface_address &

    Assignment.

  • interface_address(interface_address &&) -> constexpr

    Move-constructor.

  • interface_address(const interface_address &) -> constexpr

    Copy-constructor.

  • interface_address() -> constexpr
  • interface_address(const addr_type & addr, const prefix_type prefix) -> constexpr

    Construct interface address from address addr and network prefix prefix.

  • interface_address(const addr_type & addr, const addr_type & netmask) -> constexpr

    Construct interface address from address addr and network mask netmask.

Friends
  • operator>>

    Get interface address in binary form.

  • operator<<

    Put interface address in binary form.

  • operator>>

    Get address and network prefix.

  • operator<<

    Put address and network prefix.

  • template <class X>
    std::hash
template <class Addr>
struct std::hash< sys::interface_address< Addr > >

Specialisation of std::hash for sys::interface_address.

Base classes
  • public std::hash< Addr >
Types
  • using argument_type = sys::interface_address< Addr >

    Hash function argument type.

  • using result_type = size_t

    Hash function return value type.

Methods