SDK  23.9.2
For IoT System Software Development
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IPv6Interface Class Referenceabstract

IPv6 Network Interface. More...

#include <IPv6Interface.hpp>

Inheritance diagram for IPv6Interface:
IPv6LoRaWAN IPv6LoWPAN IPv6PPPoS

Public Types

enum  Type_t {
  TYPE_UNKNOWN = 0, TYPE_6LOWPAN = 1, TYPE_ETHERNET = 2, TYPE_PPP = 3,
  TYPE_6LPWAN = 4
}
 
enum  State_t {
  STATE_NONE = 0, STATE_BECOMING_HOST = 1, STATE_DUPLICATE = 2, STATE_HOST = 3,
  STATE_BECOMING_ROUTER = 4, STATE_ROUTER = 5
}
 

Public Member Functions

 IPv6Interface (Type_t type, uint8_t neigh_list_len, uint8_t prefix_list_len, uint16_t mtu)
 
error_t getAddress (IPv6Address::Type_t type, IPv6Address &dst)
 Get an IPv6 address assigned to the inf interface. More...
 
error_t getAddress (IPv6Address::Type_t type, uint8_t *dst)
 
uint8_t setPrefix (const IPv6Address &prefix_addr, uint8_t prefix_len, uint32_t lifetime, uint32_t pref_lifetime, bool autoconf)
 Set a prefix to an IPv6 interface. More...
 
void setStateNotifier (void(*func)(IPv6Interface &, State_t))
 
bool isAttached ()
 
State_t setState (State_t s)
 

Static Public Member Functions

static const char * GetStateString (State_t)
 

Protected Member Functions

virtual error_t getIID (uint8_t *dst)=0
 
bool hasIID (const uint8_t *iid)
 
virtual bool isInMulticastGroup (const IPv6Address &mcaddr)=0
 
virtual error_t send (uint8_t nxhop, IPv6PacketBuffer *ippkt)=0
 
virtual void receiveRS (IPv6::Header_t &ip6, void *msg, uint16_t len)=0
 
virtual void receiveRA (IPv6::Header_t &ip6, void *msg, uint16_t len)=0
 
virtual void receiveNS (IPv6::Header_t &ip6, void *msg, uint16_t len)=0
 
virtual void receiveNA (IPv6::Header_t &ip6, void *msg, uint16_t len)=0
 
virtual void receiveRedirect (IPv6::Header_t &ip6, void *msg, uint16_t len)=0
 
virtual void confirmReach (uint8_t neigh)=0
 
virtual void onTick ()=0
 
virtual void onStateChanged ()=0
 
virtual uint8_t addNeighbor (const IPv6Address &addr)
 
void removeNeighbor (uint8_t n)
 
IPv6Neighbor * getNeighbor (const IPv6Address &addr)
 
uint8_t getNeighborIndex (const IPv6Address &addr)
 

Protected Attributes

bool ll_dad_passed
 
uint8_t def_hop_limit
 
const uint16_t MTU
 
uint16_t pmtu
 
Type_t dev_type
 
IPv6Prefix ** prefix = NULL
 
const uint8_t MAX_NUM_PREFIX
 
uint8_t num_valid_prefix
 
IPv6Neighbor ** neighbor = NULL
 
const uint8_t MAX_NUM_NEIGH
 
State_t state
 
void(* notify )(IPv6Interface &, State_t) = NULL
 
IPv6Interfacenext = NULL
 

Detailed Description

IPv6 Network Interface.

Member Function Documentation

◆ getAddress()

error_t IPv6Interface::getAddress ( IPv6Address::Type_t  type,
IPv6Address dst 
)

Get an IPv6 address assigned to the inf interface.

Parameters
[in]typeAddress type
[in]infNetwork interface
[out]dstPointer where the output address is stored
Returns
  • ERROR_SUCCESS: Success
  • ERROR_INVALID_ARGS: Invalid arguments

◆ setPrefix()

uint8_t IPv6Interface::setPrefix ( const IPv6Address prefix_addr,
uint8_t  prefix_len,
uint32_t  lifetime,
uint32_t  pref_lifetime,
bool  autoconf 
)

Set a prefix to an IPv6 interface.

Parameters
[in]prefixPrefix to be registered
[in]lenPrefix length
[in]lifetimePrefix lifetime
[in]pref_lifetimePrefix preferred lifetime
[in]autoconfWhether the prefix can be advertised for IPv6 address auto-configuration
Returns
Whether my prefix is created or updated (< MAX_NUM_PREFIX), or not (>= MAX_NUM_PREFIX).

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