EtherRaw
|
Support for IPv4 addresses. More...
#include <EtherRaw.h>
Public Member Functions | |
IPv4Address () | |
IPv4Address (uint8_t octet1, uint8_t octet2, uint8_t octet3, uint8_t octet4) | |
IPv4Address (const uint8_t *address) | |
bool | operator== (const IPv4Address &addr) |
bool | operator== (const uint8_t *addr) |
IPv4Address & | operator= (const uint8_t *addr) |
const uint8_t * | address () const |
Support for IPv4 addresses.
This class allows easy access to the contents of an IPv4 address in on-the-wire format.
Sigh, the arduino IPAddress class inherits from Print, and is length 6, not 4 so we cant use it in on-the-wire structures. So we define our own similar structure
IPv4Address::IPv4Address | ( | ) |
Constructor. Clears the address to all zeros
IPv4Address::IPv4Address | ( | uint8_t | octet1, |
uint8_t | octet2, | ||
uint8_t | octet3, | ||
uint8_t | octet4 | ||
) |
Constructor Initialise the address from separate octets.
[in] | octet1 | Value for octet 1 |
[in] | octet2 | Value for octet 2 |
[in] | octet3 | Value for octet 3 |
[in] | octet4 | Value for octet 4 |
IPv4Address::IPv4Address | ( | const uint8_t * | address | ) |
Constructor. Initialise the address from some other array or structure.
[in] | address | Pointer to 4 octets of IPv4 address |
const uint8_t * IPv4Address::address | ( | ) | const |
Access the raw address as an array of octets.
IPv4Address & IPv4Address::operator= | ( | const uint8_t * | addr | ) |
Assignment operator. Copies the raw address pointed to by addr to this address.
[in] | addr | The raw address to be used to initialise this address |
bool IPv4Address::operator== | ( | const IPv4Address & | addr | ) |
Equality operator. Tests whether 2 addresses are identical.
[in] | addr | The other address |
bool IPv4Address::operator== | ( | const uint8_t * | addr | ) |
Equality operator. Tests whether 2 addresses are identical.
[in] | addr | The other address as some raw array or structure |