mn::net::basic_ip_address Class Referenceabstract

Wrapper class around lwip implementation of a ip address. More...

#include <mn_basic_ip_address.hpp>

+ Inheritance diagram for mn::net::basic_ip_address:

Public Member Functions

 basic_ip_address (address_family fam)
 Constructor. More...
 
virtual const char * to_string ()=0
 Returns a string containing a representation of the address in presentation format. More...
 
virtual uint8_t * get_bytes ()=0
 Get the ip address as byte array. More...
 
virtual bool is_loopback ()=0
 Is the this address a loopback address? More...
 
virtual bool is_broadcast ()=0
 Is the this address a broadcast address? More...
 
virtual address_family get_family ()
 Get the address family (AF_INET or AF_INET6) of the address. More...
 
virtual int length () const =0
 Returns the length in bytes of the ip address. More...
 
virtual void swap (basic_ip_address &rhs) noexcept
 

Protected Attributes

address_family m_aFamily
 A saved / cached copy of the address family type of this socket. More...
 

Detailed Description

Wrapper class around lwip implementation of a ip address.

Note
To use this, you need to subclass it. All of your ip address should be derived from the basic_ip_address class. Then implement the all virtual abstracted functions.
Author
Amber-Sophia Schröck

Constructor & Destructor Documentation

◆ basic_ip_address()

mn::net::basic_ip_address::basic_ip_address ( address_family  fam)
inline

Constructor.

Member Function Documentation

◆ get_bytes()

virtual uint8_t* mn::net::basic_ip_address::get_bytes ( )
pure virtual

Get the ip address as byte array.

Returns
The ip address as byte array

Implemented in mn::net::basic_ip6_address, and mn::net::basic_ip4_address.

◆ get_family()

virtual address_family mn::net::basic_ip_address::get_family ( )
inlinevirtual

Get the address family (AF_INET or AF_INET6) of the address.

Returns
The address family

◆ is_broadcast()

virtual bool mn::net::basic_ip_address::is_broadcast ( )
pure virtual

Is the this address a broadcast address?

Returns
if true then yes and false if not

Implemented in mn::net::basic_ip6_address, and mn::net::basic_ip4_address.

◆ is_loopback()

virtual bool mn::net::basic_ip_address::is_loopback ( )
pure virtual

Is the this address a loopback address?

Returns
if true then yes and false if not

Implemented in mn::net::basic_ip6_address, and mn::net::basic_ip4_address.

◆ length()

virtual int mn::net::basic_ip_address::length ( ) const
pure virtual

Returns the length in bytes of the ip address.

Returns
The length in bytes of the ip address

Implemented in mn::net::basic_ip6_address, and mn::net::basic_ip4_address.

◆ swap()

virtual void mn::net::basic_ip_address::swap ( basic_ip_address rhs)
inlinevirtualnoexcept

◆ to_string()

virtual const char* mn::net::basic_ip_address::to_string ( )
pure virtual

Returns a string containing a representation of the address in presentation format.

Returns
The ip address as string

Implemented in mn::net::basic_ip6_address, and mn::net::basic_ip4_address.

Member Data Documentation

◆ m_aFamily

address_family mn::net::basic_ip_address::m_aFamily
protected

A saved / cached copy of the address family type of this socket.


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