'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class prefix_v6

odtone::net::ip::prefix_v6

Synopsis

// In header: </home/carlos/Projectos/odtone/inc/odtone/net/ip/prefix.hpp>


class prefix_v6 {
public:
  // types
  typedef address_v6::bytes_type bytes_type;

  // construct/copy/destruct
  prefix_v6();
  prefix_v6(const bytes_type &, uint);
  prefix_v6(const address_v6 &, uint);

  // public static functions
  static prefix_v6 from_string(const std::string &);

  // public member functions
  const bytes_type & bytes() const;
  uint length() const;
  operator undefined_bool() const;
  bool operator!() const;
  bool match(const address_v6 &) const;

  // friend functions
  friend std::ostream & operator<<(std::ostream &, const prefix_v6 &);
};

Description

This class represents the base IPv6 Prefix.

prefix_v6 public construct/copy/destruct

  1. prefix_v6();

    Construct an empty IPv6 Prefix.

  2. prefix_v6(const bytes_type & addr, uint length);

    Construct an IPv6 Prefix.

    Parameters:

    addr

    The IPv6 Prefix raw bytes.

    length

    The IPv6 Prefix byte length.

  3. prefix_v6(const address_v6 & addr, uint length);

    Construct an IPv6 Prefix.

    Parameters:

    addr

    The IPv6 Prefix.

    length

    The IPv6 Prefix byte length.

prefix_v6 public static functions

  1. static prefix_v6 from_string(const std::string & str);

    Get the IPv6 Prefix from a string.

    Parameters:

    str

    The input string.

    Returns:

    The extracted IPv6 Prefix.

prefix_v6 public member functions

  1. const bytes_type & bytes() const;

    Get the IPv6 Prefix raw bytes.

    Returns:

    The IPv6 Prefix raw bytes.

  2. uint length() const;

    Get the IPv6 Prefix length.

    Returns:

    The IPv6 Prefix length.

  3. operator undefined_bool() const;
  4. bool operator!() const;
  5. bool match(const address_v6 & addr) const;

    Check if the IPv6 Prefix is equal to another IPv6 Prefix.

    Parameters:

    addr

    The IPv6 Prefix to compare with.

    Returns:

    True if they are equal or false otherwise.

prefix_v6 friend functions

  1. friend std::ostream & operator<<(std::ostream & out, const prefix_v6 & lhr);

    IPv6 Prefix output.

    Parameters:

    lhr

    The IPv6 Prefix.

    out

    ostream.

    Returns:

    ostream reference.


PrevUpHomeNext