EtherRaw
Public Member Functions
IPv4Address Class Reference

Support for IPv4 addresses. More...

#include <EtherRaw.h>

List of all members.

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)
IPv4Addressoperator= (const uint8_t *addr)
const uint8_t * address () const

Detailed Description

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


Constructor & Destructor Documentation

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.

Parameters:
[in]octet1Value for octet 1
[in]octet2Value for octet 2
[in]octet3Value for octet 3
[in]octet4Value for octet 4
IPv4Address::IPv4Address ( const uint8_t *  address)

Constructor. Initialise the address from some other array or structure.

Parameters:
[in]addressPointer to 4 octets of IPv4 address

Member Function Documentation

const uint8_t * IPv4Address::address ( ) const

Access the raw address as an array of octets.

Returns:
The raw address
IPv4Address & IPv4Address::operator= ( const uint8_t *  addr)

Assignment operator. Copies the raw address pointed to by addr to this address.

Parameters:
[in]addrThe raw address to be used to initialise this address
Returns:
This address
bool IPv4Address::operator== ( const IPv4Address addr)

Equality operator. Tests whether 2 addresses are identical.

Parameters:
[in]addrThe other address
Returns:
true if address is identical to this address
bool IPv4Address::operator== ( const uint8_t *  addr)

Equality operator. Tests whether 2 addresses are identical.

Parameters:
[in]addrThe other address as some raw array or structure
Returns:
true if address is identical to this address

The documentation for this class was generated from the following files: