Class IpAddress

Class Documentation

class IpAddress

A simple wrapper class for IpAddress objects.

Public Functions

IpAddress() = default

Creates IPv4 address 0.0.0.0.

inline IpAddress(uint32_t address_raw)
inline bool setToString(const std::string &ip_str)

Sets the value of the current IpAddress to the value given in ‘ip_str’.

This value must be a valid string of format a.b.c.d, where ‘a’ - ‘d’ are integers from 0-255.

Returns:

‘true’ on success (valid ip_str), ‘false’ on failure.

inline std::string toString() const

Returns a string representation of the IP address.

inline uint32_t getLittleEndian() const

Returns the IP Address as a little endian uint32_t.

inline uint32_t getBigEndian() const

Returns the IP Address as a big endian (network order) uint32_t.

Public Static Functions

static inline IpAddress fromBytes(uint8_t a, uint8_t b, uint8_t c, uint8_t d)

Creates an IpAddress from individual bytes.

static inline IpAddress fromLittleEndian(uint32_t raw)

Creates an IpAddress from a little endian uint32_t.