IPv6 (Internet Protocol Version 6) More...
Go to the source code of this file.
Data Structures | |
struct | Ipv6AddrEntry |
IPv6 address entry. More... | |
struct | Ipv6PrefixEntry |
Prefix list entry. More... | |
struct | Ipv6RouterEntry |
Default router list entry. More... | |
struct | Ipv6SrcAddrList |
Source address list. More... | |
struct | Ipv6FilterEntry |
IPv6 multicast filter entry. More... | |
struct | Ipv6Context |
IPv6 context. More... | |
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... | |
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.
- Version
- 2.4.4
Definition in file ipv6.h.
Macro Definition Documentation
◆ IPV6_ADDR
◆ IPV6_ADDR_LIST_SIZE
◆ IPV6_ANYCAST_ADDR_LIST_SIZE
◆ IPV6_DEFAULT_HOP_LIMIT
◆ IPV6_DEFAULT_MTU
◆ IPV6_DNS_SERVER_LIST_SIZE
◆ IPV6_MAX_MULTICAST_SOURCES
◆ IPV6_MULTICAST_FILTER_SIZE
◆ IPV6_PREFIX_LIST_SIZE
◆ IPV6_ROUTER_LIST_SIZE
◆ IPV6_SUPPORT
◆ IPV6_VERSION
◆ ipv6CompAddr
◆ ipv6CopyAddr
#define ipv6CopyAddr | ( | destIpAddr, | |
srcIpAddr | |||
) | osMemcpy(destIpAddr, srcIpAddr, sizeof(Ipv6Addr)) |
◆ Ipv6FragmentHeader
#define Ipv6FragmentHeader struct _Ipv6FragmentHeader |
◆ Ipv6Header
#define Ipv6Header struct _Ipv6Header |
◆ ipv6IsLinkLocalUnicastAddr
◆ ipv6IsMulticastAddr
◆ ipv6IsSiteLocalUnicastAddr
◆ ipv6IsSolicitedNodeAddr
#define ipv6IsSolicitedNodeAddr | ( | ipAddr | ) | ipv6CompPrefix(ipAddr, &IPV6_SOLICITED_NODE_ADDR_PREFIX, 104) |
◆ Ipv6PseudoHeader
#define Ipv6PseudoHeader struct _Ipv6PseudoHeader |
Enumeration Type Documentation
◆ Ipv6Actions
enum Ipv6Actions |
◆ Ipv6AddrScope
enum Ipv6AddrScope |
◆ Ipv6AddrState
enum Ipv6AddrState |
IPv6 address state.
◆ Ipv6FragmentOffset
enum Ipv6FragmentOffset |
◆ Ipv6NextHeaderType
enum Ipv6NextHeaderType |
◆ Ipv6OptionType
enum Ipv6OptionType |
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
◆ __packed_struct
typedef __packed_struct |
IPv6 network address.
IPv6 Router Alert option.
IPv6 option.
IPv6 Encapsulating Security Payload header.
IPv6 Authentication header.
IPv6 Type 0 Routing header.
IPv6 Destination Options header.
IPv6 Hop-by-Hop Options header.
◆ _Ipv6FragmentHeader
__packed_struct _Ipv6FragmentHeader |
◆ _Ipv6Header
__packed_struct _Ipv6Header |
◆ _Ipv6PseudoHeader
__packed_struct _Ipv6PseudoHeader |