'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class mac_addr

odtone::mih::mac_addr

Synopsis

// In header: </home/carlos/Projectos/odtone/inc/odtone/mih/types/address.hpp>


class mac_addr : public odtone::mih::transport_addr {
public:
  // construct/copy/destruct
  mac_addr();
  explicit mac_addr(const octet_string &);
  mac_addr(const void *, size_t);

  // public member functions
  octet_string address() const;
  void address(const octet_string &);
  bool operator==(const mac_addr &) const;

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

Description

MAC_ADDR data type.

mac_addr public construct/copy/destruct

  1. mac_addr();

    Construct an empty MAC_ADDR data type.

    [Note] Note

    Transport address type = 6

  2. explicit mac_addr(const octet_string & addr);

    Construct an empty MAC_ADDR data type.

    [Note] Note

    Transport address type = 6

    Parameters:

    addr

    address MAC address string (format: XX:XX:XX:XX:XX:XX).

  3. mac_addr(const void * raw, size_t len);

    Construct an empty MAC_ADDR data type.

    [Note] Note

    Transport address type = 6

    Parameters:

    len

    Lenght of the MAC address raw bytes.

    raw

    Raw bytes of the MAC address.

mac_addr public member functions

  1. octet_string address() const;

    Get the MAC address string (format: XX:XX:XX:XX:XX:XX).

    Returns:

    The MAC address string.

  2. void address(const octet_string & addr);

    Set the MAC address.

    Parameters:

    addr

    The MAC address string (format: XX:XX:XX:XX:XX:XX).

  3. bool operator==(const mac_addr & other) const;

    Check if the MAC_ADDR is equal to another MAC_ADDR.

    Parameters:

    other

    The MAC_ADDR to compare with.

    Returns:

    True if they are equal or false otherwise.

mac_addr friend functions

  1. friend std::ostream & operator<<(std::ostream & out, const mac_addr & tp);

    MAC_ADDR data type output.

    Parameters:

    out

    ostream.

    tp

    MAC_ADDR data type.

    Returns:

    ostream reference.


PrevUpHomeNext