IPv6 (Internet Protocol Version 6) More...
#include "core/net.h"
#include "core/ip.h"
#include "core/udp.h"
#include "core/tcp_fsm.h"
#include "core/raw_socket.h"
#include "ipv6/ipv6.h"
#include "ipv6/ipv6_frag.h"
#include "ipv6/ipv6_multicast.h"
#include "ipv6/ipv6_pmtu.h"
#include "ipv6/ipv6_routing.h"
#include "ipv6/ipv6_misc.h"
#include "ipv6/icmpv6.h"
#include "ipv6/ndp.h"
#include "ipv6/ndp_cache.h"
#include "ipv6/ndp_misc.h"
#include "ipv6/ndp_router_adv_misc.h"
#include "ipv6/slaac_misc.h"
#include "mld/mld_node.h"
#include "dhcpv6/dhcpv6_client_misc.h"
#include "mibs/ip_mib_module.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL IPV6_TRACE_LEVEL |
Functions | |
error_t | ipv6Init (NetInterface *interface) |
IPv6 related initialization. More... | |
error_t | ipv6SetMtu (NetInterface *interface, size_t mtu) |
Change the MTU of a network interface. More... | |
error_t | ipv6GetMtu (NetInterface *interface, size_t *mtu) |
Retrieve the MTU for the specified interface. More... | |
error_t | ipv6SetDefaultHopLimit (NetInterface *interface, uint8_t hopLimit) |
Set default Hop Limit value for outgoing IPv6 packets. More... | |
error_t | ipv6SetLinkLocalAddr (NetInterface *interface, const Ipv6Addr *addr) |
Assign link-local address. More... | |
error_t | ipv6GetLinkLocalAddr (NetInterface *interface, Ipv6Addr *addr) |
Retrieve link-local address. More... | |
Ipv6AddrState | ipv6GetLinkLocalAddrState (NetInterface *interface) |
Get the state of the link-local address. More... | |
error_t | ipv6SetGlobalAddr (NetInterface *interface, uint_t index, const Ipv6Addr *addr) |
Assign global address. More... | |
error_t | ipv6GetGlobalAddr (NetInterface *interface, uint_t index, Ipv6Addr *addr) |
Retrieve global address. More... | |
Ipv6AddrState | ipv6GetGlobalAddrState (NetInterface *interface, uint_t index) |
Get the state of the specified global address. More... | |
error_t | ipv6SetAnycastAddr (NetInterface *interface, uint_t index, const Ipv6Addr *addr) |
Assign anycast address. More... | |
error_t | ipv6GetAnycastAddr (NetInterface *interface, uint_t index, Ipv6Addr *addr) |
Retrieve anycast address. More... | |
error_t | ipv6SetPrefix (NetInterface *interface, uint_t index, const Ipv6Addr *prefix, uint_t length) |
Configure IPv6 prefix. More... | |
error_t | ipv6GetPrefix (NetInterface *interface, uint_t index, Ipv6Addr *prefix, uint_t *length) |
Retrieve IPv6 prefix. More... | |
error_t | ipv6SetDefaultRouter (NetInterface *interface, uint_t index, const Ipv6Addr *addr) |
Configure default router. More... | |
error_t | ipv6GetDefaultRouter (NetInterface *interface, uint_t index, Ipv6Addr *addr) |
Retrieve default router. More... | |
error_t | ipv6SetDnsServer (NetInterface *interface, uint_t index, const Ipv6Addr *addr) |
Configure DNS server. More... | |
error_t | ipv6GetDnsServer (NetInterface *interface, uint_t index, Ipv6Addr *addr) |
Retrieve DNS server. More... | |
void | ipv6LinkChangeEvent (NetInterface *interface) |
Callback function for link change event. More... | |
void | ipv6ProcessPacket (NetInterface *interface, NetBuffer *ipPacket, size_t ipPacketOffset, NetRxAncillary *ancillary) |
Incoming IPv6 packet processing. More... | |
error_t | ipv6ParseHopByHopOptHeader (NetInterface *interface, const NetBuffer *ipPacket, size_t ipPacketOffset, size_t *headerOffset, size_t *nextHeaderOffset) |
Parse Hop-by-Hop Options header. More... | |
error_t | ipv6ParseDestOptHeader (NetInterface *interface, const NetBuffer *ipPacket, size_t ipPacketOffset, size_t *headerOffset, size_t *nextHeaderOffset) |
Parse Destination Options header. More... | |
error_t | ipv6ParseRoutingHeader (NetInterface *interface, const NetBuffer *ipPacket, size_t ipPacketOffset, size_t *headerOffset, size_t *nextHeaderOffset) |
Parse Routing header. More... | |
error_t | ipv6ParseAhHeader (NetInterface *interface, const NetBuffer *ipPacket, size_t ipPacketOffset, size_t *headerOffset, size_t *nextHeaderOffset) |
Parse AH header. More... | |
error_t | ipv6ParseEspHeader (NetInterface *interface, const NetBuffer *ipPacket, size_t ipPacketOffset, size_t *headerOffset, size_t *nextHeaderOffset) |
Parse ESP header. More... | |
error_t | ipv6ParseOptions (NetInterface *interface, const NetBuffer *ipPacket, size_t ipPacketOffset, size_t optionOffset, size_t optionLen) |
Parse IPv6 options. More... | |
error_t | ipv6SendDatagram (NetInterface *interface, const Ipv6PseudoHeader *pseudoHeader, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary) |
Send an IPv6 datagram. More... | |
error_t | ipv6SendPacket (NetInterface *interface, const Ipv6PseudoHeader *pseudoHeader, uint32_t fragId, size_t fragOffset, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary) |
Send an IPv6 packet. More... | |
error_t | ipv6FormatHopByHopOptHeader (uint8_t *nextHeader, NetBuffer *buffer, size_t *offset) |
Format Hop-by-Hop Options header. More... | |
error_t | ipv6FormatFragmentHeader (uint32_t fragId, size_t fragOffset, uint8_t *nextHeader, NetBuffer *buffer, size_t *offset) |
Format Fragment header. More... | |
error_t | ipv6StringToAddr (const char_t *str, Ipv6Addr *ipAddr) |
Convert a string representation of an IPv6 address to a binary IPv6 address. More... | |
char_t * | ipv6AddrToString (const Ipv6Addr *ipAddr, char_t *str) |
Convert a binary IPv6 address to a string representation. More... | |
void | ipv6DumpHeader (const Ipv6Header *ipHeader) |
Dump IPv6 header for debugging purpose. More... | |
Variables | |
const Ipv6Addr | IPV6_UNSPECIFIED_ADDR |
const Ipv6Addr | IPV6_LOOPBACK_ADDR |
const Ipv6Addr | IPV6_LINK_LOCAL_ALL_NODES_ADDR |
const Ipv6Addr | IPV6_LINK_LOCAL_ALL_ROUTERS_ADDR |
const Ipv6Addr | IPV6_LINK_LOCAL_ADDR_PREFIX |
const Ipv6Addr | IPV6_SOLICITED_NODE_ADDR_PREFIX |
Detailed Description
IPv6 (Internet Protocol Version 6)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Description
IP version 6 (IPv6) is a new version of the Internet Protocol, designed as the successor to IP version 4 (IPv4). Refer to RFC 2460
- Version
- 2.4.4
Definition in file ipv6.c.
Macro Definition Documentation
◆ TRACE_LEVEL
Function Documentation
◆ ipv6AddrToString()
Convert a binary IPv6 address to a string representation.
Call ipv6AddrToString() to convert an IPv6 address to a text representation. The implementation of ipv6AddrToString() function follows RFC 5952 recommendations
- Parameters
-
[in] ipAddr Binary representation of the IPv6 address [out] str NULL-terminated string representing the IPv6 address
- Returns
- Pointer to the formatted string
◆ ipv6DumpHeader()
void ipv6DumpHeader | ( | const Ipv6Header * | ipHeader | ) |
◆ ipv6FormatFragmentHeader()
error_t ipv6FormatFragmentHeader | ( | uint32_t | fragId, |
size_t | fragOffset, | ||
uint8_t * | nextHeader, | ||
NetBuffer * | buffer, | ||
size_t * | offset | ||
) |
Format Fragment header.
- Parameters
-
[in] fragId Fragment identification field [in] fragOffset Fragment offset field [in,out] nextHeader Value of the Next Header field [in] buffer Multi-part buffer containing the payload [in,out] offset Offset to the first payload byte
- Returns
- Error code
◆ ipv6FormatHopByHopOptHeader()
◆ ipv6GetAnycastAddr()
error_t ipv6GetAnycastAddr | ( | NetInterface * | interface, |
uint_t | index, | ||
Ipv6Addr * | addr | ||
) |
◆ ipv6GetDefaultRouter()
error_t ipv6GetDefaultRouter | ( | NetInterface * | interface, |
uint_t | index, | ||
Ipv6Addr * | addr | ||
) |
◆ ipv6GetDnsServer()
error_t ipv6GetDnsServer | ( | NetInterface * | interface, |
uint_t | index, | ||
Ipv6Addr * | addr | ||
) |
◆ ipv6GetGlobalAddr()
error_t ipv6GetGlobalAddr | ( | NetInterface * | interface, |
uint_t | index, | ||
Ipv6Addr * | addr | ||
) |
◆ ipv6GetGlobalAddrState()
Ipv6AddrState ipv6GetGlobalAddrState | ( | NetInterface * | interface, |
uint_t | index | ||
) |
◆ ipv6GetLinkLocalAddr()
error_t ipv6GetLinkLocalAddr | ( | NetInterface * | interface, |
Ipv6Addr * | addr | ||
) |
◆ ipv6GetLinkLocalAddrState()
Ipv6AddrState ipv6GetLinkLocalAddrState | ( | NetInterface * | interface | ) |
◆ ipv6GetMtu()
error_t ipv6GetMtu | ( | NetInterface * | interface, |
size_t * | mtu | ||
) |
◆ ipv6GetPrefix()
error_t ipv6GetPrefix | ( | NetInterface * | interface, |
uint_t | index, | ||
Ipv6Addr * | prefix, | ||
uint_t * | length | ||
) |
◆ ipv6Init()
error_t ipv6Init | ( | NetInterface * | interface | ) |
◆ ipv6LinkChangeEvent()
void ipv6LinkChangeEvent | ( | NetInterface * | interface | ) |
◆ ipv6ParseAhHeader()
error_t ipv6ParseAhHeader | ( | NetInterface * | interface, |
const NetBuffer * | ipPacket, | ||
size_t | ipPacketOffset, | ||
size_t * | headerOffset, | ||
size_t * | nextHeaderOffset | ||
) |
Parse AH header.
- Parameters
-
[in] interface Underlying network interface [in] ipPacket Multi-part buffer containing the IPv6 packet [in] ipPacketOffset Offset to the first byte of the IPv6 packet [in,out] headerOffset Offset to the Authentication header [in,out] nextHeaderOffset Offset to the Next Header field
Error code
◆ ipv6ParseDestOptHeader()
error_t ipv6ParseDestOptHeader | ( | NetInterface * | interface, |
const NetBuffer * | ipPacket, | ||
size_t | ipPacketOffset, | ||
size_t * | headerOffset, | ||
size_t * | nextHeaderOffset | ||
) |
Parse Destination Options header.
- Parameters
-
[in] interface Underlying network interface [in] ipPacket Multi-part buffer containing the IPv6 packet [in] ipPacketOffset Offset to the first byte of the IPv6 packet [in,out] headerOffset Offset to the Destination Options header [in,out] nextHeaderOffset Offset to the Next Header field
Error code
◆ ipv6ParseEspHeader()
error_t ipv6ParseEspHeader | ( | NetInterface * | interface, |
const NetBuffer * | ipPacket, | ||
size_t | ipPacketOffset, | ||
size_t * | headerOffset, | ||
size_t * | nextHeaderOffset | ||
) |
Parse ESP header.
- Parameters
-
[in] interface Underlying network interface [in] ipPacket Multi-part buffer containing the IPv6 packet [in] ipPacketOffset Offset to the first byte of the IPv6 packet [in,out] headerOffset Offset to the Encapsulating Security Payload header [in,out] nextHeaderOffset Offset to the Next Header field
Error code
◆ ipv6ParseHopByHopOptHeader()
error_t ipv6ParseHopByHopOptHeader | ( | NetInterface * | interface, |
const NetBuffer * | ipPacket, | ||
size_t | ipPacketOffset, | ||
size_t * | headerOffset, | ||
size_t * | nextHeaderOffset | ||
) |
Parse Hop-by-Hop Options header.
- Parameters
-
[in] interface Underlying network interface [in] ipPacket Multi-part buffer containing the IPv6 packet [in] ipPacketOffset Offset to the first byte of the IPv6 packet [in,out] headerOffset Offset to the Hop-by-Hop Options header [in,out] nextHeaderOffset Offset to the Next Header field
Error code
◆ ipv6ParseOptions()
error_t ipv6ParseOptions | ( | NetInterface * | interface, |
const NetBuffer * | ipPacket, | ||
size_t | ipPacketOffset, | ||
size_t | optionOffset, | ||
size_t | optionLen | ||
) |
Parse IPv6 options.
- Parameters
-
[in] interface Underlying network interface [in] ipPacket Multi-part buffer containing the IPv6 packet [in] ipPacketOffset Offset to the first byte of the IPv6 packet [in] optionOffset Offset to the first byte of the Options field [in] optionLen Length of the Options field
Error code
◆ ipv6ParseRoutingHeader()
error_t ipv6ParseRoutingHeader | ( | NetInterface * | interface, |
const NetBuffer * | ipPacket, | ||
size_t | ipPacketOffset, | ||
size_t * | headerOffset, | ||
size_t * | nextHeaderOffset | ||
) |
Parse Routing header.
- Parameters
-
[in] interface Underlying network interface [in] ipPacket Multi-part buffer containing the IPv6 packet [in] ipPacketOffset Offset to the first byte of the IPv6 packet [in,out] headerOffset Offset to the Routing header [in,out] nextHeaderOffset Offset to the Next Header field
Error code
◆ ipv6ProcessPacket()
void ipv6ProcessPacket | ( | NetInterface * | interface, |
NetBuffer * | ipPacket, | ||
size_t | ipPacketOffset, | ||
NetRxAncillary * | ancillary | ||
) |
Incoming IPv6 packet processing.
- Parameters
-
[in] interface Underlying network interface [in] ipPacket Multi-part buffer that holds the incoming IPv6 packet [in] ipPacketOffset Offset to the first byte of the IPv6 packet [in] ancillary Additional options passed to the stack along with the packet
◆ ipv6SendDatagram()
error_t ipv6SendDatagram | ( | NetInterface * | interface, |
const Ipv6PseudoHeader * | pseudoHeader, | ||
NetBuffer * | buffer, | ||
size_t | offset, | ||
NetTxAncillary * | ancillary | ||
) |
Send an IPv6 datagram.
- Parameters
-
[in] interface Underlying network interface [in] pseudoHeader IPv6 pseudo header [in] buffer Multi-part buffer containing the payload [in] offset Offset to the first byte of the payload [in] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
◆ ipv6SendPacket()
error_t ipv6SendPacket | ( | NetInterface * | interface, |
const Ipv6PseudoHeader * | pseudoHeader, | ||
uint32_t | fragId, | ||
size_t | fragOffset, | ||
NetBuffer * | buffer, | ||
size_t | offset, | ||
NetTxAncillary * | ancillary | ||
) |
Send an IPv6 packet.
- Parameters
-
[in] interface Underlying network interface [in] pseudoHeader IPv6 pseudo header [in] fragId Fragment identification field [in] fragOffset Fragment offset field [in] buffer Multi-part buffer containing the payload [in] offset Offset to the first byte of the payload [in] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
◆ ipv6SetAnycastAddr()
error_t ipv6SetAnycastAddr | ( | NetInterface * | interface, |
uint_t | index, | ||
const Ipv6Addr * | addr | ||
) |
◆ ipv6SetDefaultHopLimit()
error_t ipv6SetDefaultHopLimit | ( | NetInterface * | interface, |
uint8_t | hopLimit | ||
) |
◆ ipv6SetDefaultRouter()
error_t ipv6SetDefaultRouter | ( | NetInterface * | interface, |
uint_t | index, | ||
const Ipv6Addr * | addr | ||
) |
◆ ipv6SetDnsServer()
error_t ipv6SetDnsServer | ( | NetInterface * | interface, |
uint_t | index, | ||
const Ipv6Addr * | addr | ||
) |
◆ ipv6SetGlobalAddr()
error_t ipv6SetGlobalAddr | ( | NetInterface * | interface, |
uint_t | index, | ||
const Ipv6Addr * | addr | ||
) |
◆ ipv6SetLinkLocalAddr()
error_t ipv6SetLinkLocalAddr | ( | NetInterface * | interface, |
const Ipv6Addr * | addr | ||
) |
◆ ipv6SetMtu()
error_t ipv6SetMtu | ( | NetInterface * | interface, |
size_t | mtu | ||
) |
◆ ipv6SetPrefix()
error_t ipv6SetPrefix | ( | NetInterface * | interface, |
uint_t | index, | ||
const Ipv6Addr * | prefix, | ||
uint_t | length | ||
) |
◆ ipv6StringToAddr()
Variable Documentation
◆ IPV6_LINK_LOCAL_ADDR_PREFIX
const Ipv6Addr IPV6_LINK_LOCAL_ADDR_PREFIX |
◆ IPV6_LINK_LOCAL_ALL_NODES_ADDR
const Ipv6Addr IPV6_LINK_LOCAL_ALL_NODES_ADDR |
◆ IPV6_LINK_LOCAL_ALL_ROUTERS_ADDR
const Ipv6Addr IPV6_LINK_LOCAL_ALL_ROUTERS_ADDR |
◆ IPV6_LOOPBACK_ADDR
const Ipv6Addr IPV6_LOOPBACK_ADDR |
◆ IPV6_SOLICITED_NODE_ADDR_PREFIX
const Ipv6Addr IPV6_SOLICITED_NODE_ADDR_PREFIX |