'ODTONE - Open Dot Twenty One'

PrevUpHomeNext

Class ip_addr

odtone::mih::ip_addr

Synopsis

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


class ip_addr : public odtone::mih::transport_addr {
public:
  enum type_ip_enum;
  // construct/copy/destruct
  ip_addr(type_ip_enum = none);
  ip_addr(type_ip_enum, const void *, size_t);
  explicit ip_addr(type_ip_enum, const octet_string &);

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

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

Description

IP_ADDR data type.

ip_addr public construct/copy/destruct

  1. ip_addr(type_ip_enum tp = none);

    Construct a IP_ADDR data type.

    Parameters:

    tp

    IP address type.

  2. ip_addr(type_ip_enum tp, const void * raw, size_t len);

    Construct a IP_ADDR data type.

    Parameters:

    len

    Size of the IP address raw bytes.

    raw

    Raw bytes of the IP address.

    tp

    IP address type.

  3. explicit ip_addr(type_ip_enum tp, const octet_string & addr);

    Construct a IP_ADDR data type.

    Parameters:

    tp

    IP address type.

ip_addr public member functions

  1. octet_string address() const;

    Get the IP address string.

    Returns:

    The IP address string.

  2. void address(const octet_string & addr);

    Set the IP address.

    Parameters:

    addr

    The IP address string.

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

    Check if the IP_ADDR is equal to another IP_ADDR.

    Parameters:

    other

    The IP_ADDR to compare with.

    Returns:

    True if they are equal or false otherwise.

ip_addr friend functions

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

    IP_ADDR data type output.

    Parameters:

    out

    ostream.

    tp

    IP_ADDR data type.

    Returns:

    ostream reference.


PrevUpHomeNext