SDK  23.9.2
For IoT System Software Development
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
IPv6 Class Reference

Internet Protocol Version 6 Stack. More...

#include <IPv6.hpp>


struct  Header_t
 IPv6 Header. More...
struct  OptHeaderMPL_t
 MPL Option. More...
struct  OptHeaderRPL_t
 RPL Option Header for Carrying RPL Information in Data-Plane Datagrams. More...
struct  Reassembly_t
struct  ReassemblyBuf_t
struct  RecentDst_t
class  Route
class  RoutingEntry
struct  TLVHeader_t
 IPv6 Options' TL (Type and Length) More...

Public Types

enum  { MAX_NUM_IP6_RSM = 1, MAX_NUM_IP6_DC = 3 }

Public Member Functions

 IPv6 (uint16_t nrt=0)
 Initialize IPv6 functionality. More...
void begin ()
 Initialize the IPv6 network layer.
error_t getRoutingEntry (uint16_t idx, IPv6Address *prefix, uint8_t *prefixLen, IPv6Interface **outInf)
 Get an IPv6 routing entry. More...
error_t addRoute (const IPv6Address *prefix, uint8_t prefixLen, IPv6Interface &egressInf, const IPv6Address &nexthop)
 Add an IPv6 route to the main IPv6 routing table. More...
error_t addRoute (const IPv6Address *prefix, uint8_t prefix_len, IPv6Interface &egressInterface, uint8_t nxhop)

Static Public Member Functions

static uint16_t PseudoHeaderChecksum (Header_t &ip6, IPv6PacketBuffer *upper)

Public Attributes

const uint16_t MAX_NUM_RT
 Size (number of entries) of the routing table.
IPv6::Reassembly_t rsm [MAX_NUM_IP6_RSM]
Route defRoute
IPv6::RecentDst_t dc [MAX_NUM_IP6_DC]
Timer lifetime
void(* fwd_state_cleanup )(void)
error_t(* icmp6_recv_echo_reply )(IPv6Interface &input, IPv6::Header_t &ip6, IPv6PacketBuffer *icmp_pkt)
void(* ping_tick )(void)
bool(* rpl_opt_check )(OptHeaderRPL_t *ro, const IPv6::Header_t &ip6, IPv6Interface &input, uint8_t sender)
error_t(* rpl_recv_msg )(IPv6Interface &input, IPv6::Header_t &ip6, void *icmpv6Msg, uint16_t msg_len)
bool(* mpl_opt_check )(OptHeaderMPL_t *mo, IPv6PacketBuffer *ip6_pkt, IPv6Interface &input, uint8_t sender)
error_t(* mpl_recv_ctrl_msg )(IPv6Interface &input, IPv6::Header_t &ip6, void *msg, uint16_t msg_len)
void(* udp_input )(IPv6Interface &input, IPv6PacketBuffer *head, IPv6PacketBuffer *ippkt, IPv6PacketBuffer *udppkt)
void(* tcp_input )(uint8_t ip6_inf, IPv6PacketBuffer *head, IPv6PacketBuffer *ippkt, IPv6PacketBuffer *tcppkt, uint8_t sender)

Detailed Description

Internet Protocol Version 6 Stack.

Constructor & Destructor Documentation

◆ IPv6()

IPv6::IPv6 ( uint16_t  nrt = 0)

Initialize IPv6 functionality.

[in]nrtNumber of main IPv6 routing table entries

Member Function Documentation

◆ addRoute()

error_t IPv6::addRoute ( const IPv6Address prefix,
uint8_t  prefixLen,
IPv6Interface egressInf,
const IPv6Address nexthop 

Add an IPv6 route to the main IPv6 routing table.

[in]prefixDestination prefix
[in]prefixLenDestination prefix's valid length in bits
[in]egressInfEgress IPv6 interface ID
[in]nexthopIPv6 address of nexthop
  • ERROR_SUCCESS: Success
  • ERROR_FAIL: Failure due to table full

◆ getRoutingEntry()

error_t IPv6::getRoutingEntry ( uint16_t  idx,
IPv6Address prefix,
uint8_t *  prefixLen,
IPv6Interface **  outInf 

Get an IPv6 routing entry.

[in]idxIndex of the routing table. If it is out of range of the table, the default entry will be returned.
[out]prefixPointer where the entry's prefix will be stored at.
[out]prefixLenPointer where the entry's prefix length will be stored at.
[out]out_infPointer where the entry's output interface pointer will be stored at.
  • ERROR_SUCCESS: Success
  • ERROR_INVALID_ARGS: Arguments are not invalid.
  • ERROR_FAIL: The entry of the idx is not valid.

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