'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class address_mac

odtone::net::link::address_mac

Synopsis

// In header: </home/carlos/Projectos/odtone/inc/odtone/net/link/address_mac.hpp>


class address_mac {
public:
  // types
  typedef boost::array< uint8, 6 > bytes_type;

  // construct/copy/destruct
  address_mac();
  explicit address_mac(const uint8);
  explicit address_mac(const bytes_type &);

  // public static functions
  static address_mac from_string(const char *);
  static address_mac from_string(const std::string &);

  // public member functions
  bool operator<(const address_mac &) const;
  std::string to_string() const;
  bytes_type to_bytes() const;

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

  // public data members
  bytes_type _address;
};

Description

This class represents the MAC address.

address_mac public construct/copy/destruct

  1. address_mac();

    Construct an empty MAC address.

  2. explicit address_mac(const uint8 address);

    Construct a MAC address.

    Parameters:

    address

    The MAC address raw bytes.

  3. explicit address_mac(const bytes_type & address);

    Construct a MAC address.

    Parameters:

    address

    The MAC address raw bytes.

address_mac public static functions

  1. static address_mac from_string(const char * str);

    Get the MAC address from a string.

    Parameters:

    str

    The input string.

    Returns:

    The extracted MAC address.

  2. static address_mac from_string(const std::string & str);

    Get the MAC address from a string.

    Parameters:

    str

    The input string.

    Returns:

    The extracted MAC address.

address_mac public member functions

  1. bool operator<(const address_mac & lhs) const;

    Check if the MAC address is smaller than another MAC address.

    Parameters:

    lhs

    The MAC address to compare with.

    Returns:

    True if they are equal or false otherwise.

  2. std::string to_string() const;

    Convert the MAC address to a string.

    Returns:

    A string representation of this object.

  3. bytes_type to_bytes() const;

    Get the MAC address raw bytes.

    Returns:

    The MAC address raw bytes.

address_mac friend functions

  1. friend std::ostream & operator<<(std::ostream & out, const address_mac & mac);

    MAC address output.

    Parameters:

    mac

    The IPv6 Prefix.

    out

    ostream.

    Returns:

    ostream reference.

address_mac public public data members

  1. bytes_type _address;

    The MAC address raw bytes.


PrevUpHomeNext