IPv6 (Internet Protocol Version 6) More...

#include <string.h>
#include "core/net.h"
#include "core/ethernet.h"
#include "ipv6/ipv6_frag.h"

Go to the source code of this file.

Data Structures

struct  _Ipv6Header
 IPv6 header. More...
 
struct  _Ipv6FragmentHeader
 IPv6 Fragment header. More...
 
struct  _Ipv6PseudoHeader
 IPv6 pseudo header. More...
 
struct  Ipv6AddrEntry
 IPv6 address entry. More...
 
struct  Ipv6PrefixEntry
 Prefix list entry. More...
 
struct  Ipv6RouterEntry
 Default router list entry. More...
 
struct  Ipv6FilterEntry
 IPv6 multicast filter entry. More...
 
struct  Ipv6Context
 IPv6 context. More...
 

Macros

#define Ipv6Header   struct _Ipv6Header
 
#define Ipv6FragmentHeader   struct _Ipv6FragmentHeader
 
#define Ipv6PseudoHeader   struct _Ipv6PseudoHeader
 
#define IPV6_SUPPORT   DISABLED
 
#define IPV6_DEFAULT_HOP_LIMIT   64
 
#define IPV6_ADDR_LIST_SIZE   3
 
#define IPV6_ANYCAST_ADDR_LIST_SIZE   1
 
#define IPV6_PREFIX_LIST_SIZE   2
 
#define IPV6_ROUTER_LIST_SIZE   2
 
#define IPV6_DNS_SERVER_LIST_SIZE   2
 
#define IPV6_MULTICAST_FILTER_SIZE   8
 
#define IPV6_VERSION   6
 
#define IPV6_DEFAULT_MTU   1280
 
#define IPV6_ADDR(a, b, c, d, e, f, g, h)
 
#define ipv6CopyAddr(destIpAddr, srcIpAddr)    osMemcpy(destIpAddr, srcIpAddr, sizeof(Ipv6Addr))
 
#define ipv6CompAddr(ipAddr1, ipAddr2)    (!osMemcmp(ipAddr1, ipAddr2, sizeof(Ipv6Addr)))
 
#define ipv6IsLinkLocalUnicastAddr(ipAddr)    ((ipAddr)->b[0] == 0xFE && ((ipAddr)->b[1] & 0xC0) == 0x80)
 
#define ipv6IsSiteLocalUnicastAddr(ipAddr)    ((ipAddr)->b[0] == 0xFE && ((ipAddr)->b[1] & 0xC0) == 0xC0)
 
#define ipv6IsMulticastAddr(ipAddr)    ((ipAddr)->b[0] == 0xFF)
 
#define ipv6IsSolicitedNodeAddr(ipAddr)    ipv6CompPrefix(ipAddr, &IPV6_SOLICITED_NODE_ADDR_PREFIX, 104)
 

Typedefs

struct {
   char_t   type
 
   uint32_t   dataStart
 
   uint32_t   dataLength
 
   uint8_t   nameLength
 
   char_t   name []
 
   uint8_t   tokenLen: 4
 
   uint8_t   type: 2
 
   uint8_t   version: 2
 
   uint8_t   code
 
   uint16_t   mid
 
   uint8_t   token []
 
   union {
      uint8_t   b [6]
 
      uint16_t   w [3]
 
   } 
 
   uint16_t   srcPort
 
   uint16_t   destPort
 
   uint32_t   seqNum
 
   uint32_t   ackNum
 
   uint8_t   reserved1: 4
 
   uint8_t   dataOffset: 4
 
   uint8_t   flags: 6
 
   uint8_t   reserved2: 2
 
   uint16_t   window
 
   uint16_t   checksum
 
   uint16_t   urgentPointer
 
   uint8_t   options []
 
   uint16_t   length
 
   uint8_t   data []
 
   uint8_t   op
 
   uint8_t   htype
 
   uint8_t   hlen
 
   uint8_t   hops
 
   uint32_t   xid
 
   uint16_t   secs
 
   uint16_t   flags
 
   Ipv4Addr   ciaddr
 
   Ipv4Addr   yiaddr
 
   Ipv4Addr   siaddr
 
   Ipv4Addr   giaddr
 
   MacAddr   chaddr
 
   uint8_t   unused [10]
 
   uint8_t   sname [64]
 
   uint8_t   file [128]
 
   uint32_t   magicCookie
 
   uint16_t   type
 
   uint16_t   hardwareType
 
   uint32_t   time
 
   MacAddr   linkLayerAddr
 
   uint16_t   id
 
   uint8_t   rd: 1
 
   uint8_t   tc: 1
 
   uint8_t   aa: 1
 
   uint8_t   opcode: 4
 
   uint8_t   qr: 1
 
   uint8_t   rcode: 4
 
   uint8_t   z: 3
 
   uint8_t   ra: 1
 
   uint16_t   qdcount
 
   uint16_t   ancount
 
   uint16_t   nscount
 
   uint16_t   arcount
 
   uint8_t   questions []
 
   uint16_t   controlWord
 
   uint16_t   byteCount
 
   uint8_t   bLength
 
   uint8_t   bDescriptorType
 
   uint16_t   bcdUsb
 
   uint8_t   bDeviceClass
 
   uint8_t   bDeviceSubClass
 
   uint8_t   bDeviceProtocol
 
   uint8_t   bMaxPacketSize0
 
   uint16_t   idVendor
 
   uint16_t   idProduct
 
   uint16_t   bcdDevice
 
   uint8_t   iManufacturer
 
   uint8_t   iProduct
 
   uint8_t   iSerialNumber
 
   uint8_t   bNumConfigurations
 
   uint8_t   maxRespTime
 
   Ipv4Addr   groupAddr
 
   uint16_t   hrd
 
   uint16_t   pro
 
   uint8_t   hln
 
   uint8_t   pln
 
   uint16_t   op
 
   MacAddr   sha
 
   Ipv4Addr   spa
 
   MacAddr   tha
 
   Ipv4Addr   tpa
 
   uint8_t   length
 
   uint8_t   value []
 
   uint16_t   first
 
   uint16_t   last
 
   uint16_t   next
 
   union {
      uint8_t   b [16]
 
      uint16_t   w [8]
 
      uint32_t   dw [4]
 
   } 
 
   uint16_t   maxRespDelay
 
   uint16_t   reserved
 
   Ipv6Addr   multicastAddr
 
   uint32_t   reserved
 
   uint16_t   pvid
 
   uint8_t   autoNegSupportStatus
 
   uint16_t   pmdAutoNegAdvCap
 
   uint16_t   operationalMauType
 
   uint16_t   capabilities
 
   uint8_t   deviceType
 
   uint8_t   lengthH: 1
 
   uint8_t   lengthL
 
   uint8_t   t: 1
 
   uint8_t   c: 1
 
   union {
      int32_t   integer
 
      uint8_t   octetString [1]
 
      uint8_t   oid [1]
 
      uint8_t   ipAddr [4]
 
      uint32_t   counter32
 
      uint32_t   gauge32
 
      uint32_t   unsigned32
 
      uint32_t   timeTicks
 
      uint64_t   counter64
 
   } 
 
   uint16_t   transactionId
 
   uint16_t   protocolId
 
   uint8_t   unitId
 
   uint8_t   pdu []
 
   uint8_t   retain: 1
 
   uint8_t   qos: 2
 
   uint8_t   dup: 1
 
   union {
      uint8_t   all
 
      struct {
         uint8_t   topicIdType: 2
 
         uint8_t   cleanSession: 1
 
         uint8_t   will: 1
 
         uint8_t   retain: 1
 
         uint8_t   qos: 2
 
         uint8_t   dup: 1
 
      } 
 
   } 
 
   uint8_t   b: 1
 
   uint8_t   identifier
 
   uint8_t   valueSize
 
   Ipv4Addr   srcIpAddr
 
   Ipv4Addr   destIpAddr
 
   Eui64   interfaceId
 
   uint16_t   mru
 
   uint8_t   peerIdLength
 
   uint8_t   peerId []
 
   uint32_t   seconds
 
   uint32_t   fraction
 
   uint16_t   opcode
 
   char_t   filename []
 
   uint8_t   reserved: 3
 
   uint8_t   fin: 1
 
   uint8_t   payloadLen: 7
 
   uint8_t   mask: 1
 
   uint8_t   extPayloadLen []
 
   uint32_t   length
 
   uint8_t   payload []
 
   uint8_t   protocolVersionId
 
   uint8_t   bpduType
 
   StpBridgeId   rootId
 
   uint32_t   rootPathCost
 
   StpBridgeId   bridgeId
 
   uint16_t   portId
 
   uint16_t   messageAge
 
   uint16_t   maxAge
 
   uint16_t   helloTime
 
   uint16_t   forwardDelay
 
   uint8_t   version1Length
 
   uint16_t   priority
 
   MacAddr   addr
 
Ipv6Addr
 IPv6 network address. More...
 
struct {
   char_t   type
 
   uint32_t   dataStart
 
   uint32_t   dataLength
 
   uint8_t   nameLength
 
   uint8_t   length: 4
 
   uint8_t   delta: 4
 
   union {
      uint8_t   b [8]
 
      uint16_t   w [4]
 
      uint32_t   dw [2]
 
   } 
 
   uint8_t   kind
 
   uint8_t   value []
 
   uint8_t   code
 
   uint16_t   type
 
   uint32_t   enterpriseNumber
 
   uint8_t   identifier []
 
   uint16_t   qtype
 
   uint16_t   qclass
 
   uint16_t   statusWord
 
   uint16_t   byteCount
 
   uint8_t   bLength
 
   uint8_t   bDescriptorType
 
   uint16_t   wTotalLength
 
   uint8_t   bNumInterfaces
 
   uint8_t   bConfigurationValue
 
   uint8_t   iConfiguration
 
   uint8_t   bmAttributes
 
   uint8_t   bMaxPower
 
   uint8_t   type
 
   uint16_t   checksum
 
   uint8_t   parameter
 
   uint8_t   unused [3]
 
   uint8_t   data []
 
   uint32_t   parameter
 
   uint8_t   nextHeader
 
   uint8_t   hdrExtLen
 
   uint8_t   options []
 
   uint8_t   curHopLimit
 
   uint8_t   reserved: 2
 
   uint8_t   p: 1
 
   uint8_t   prf: 2
 
   uint8_t   h: 1
 
   uint8_t   o: 1
 
   uint8_t   m: 1
 
   uint16_t   routerLifetime
 
   uint32_t   reachableTime
 
   uint32_t   retransTimer
 
   uint8_t   flags
 
   uint16_t   ppvid
 
   uint8_t   mdiPowerSupport
 
   uint8_t   psePowerPair
 
   uint8_t   powerClass
 
   uint8_t   appType
 
   uint8_t   vlanIdH: 5
 
   uint8_t   x: 1
 
   uint8_t   t: 1
 
   uint8_t   u: 1
 
   uint8_t   l2PriorityH: 1
 
   uint8_t   vlanIdL: 7
 
   uint8_t   dscpValue: 6
 
   uint8_t   l2PriorityL: 2
 
   uint8_t   chassisIdSubtype
 
   uint8_t   chassisId []
 
   uint8_t   functionCode
 
   uint16_t   startingAddr
 
   uint16_t   quantityOfCoils
 
   uint16_t   length
 
   uint8_t   msgType
 
   uint16_t   flags
 
   Ipv4Addr   addr
 
   uint8_t   valueSize
 
   uint16_t   protocol
 
   uint32_t   accm
 
   uint8_t   msgLength
 
   uint8_t   message []
 
   uint8_t   mode: 3
 
   uint8_t   vn: 3
 
   uint8_t   li: 2
 
   uint8_t   stratum
 
   uint8_t   poll
 
   int8_t   precision
 
   uint32_t   rootDelay
 
   uint32_t   rootDispersion
 
   uint32_t   referenceId
 
   NtpTimestamp   referenceTimestamp
 
   NtpTimestamp   originateTimestamp
 
   NtpTimestamp   receiveTimestamp
 
   NtpTimestamp   transmitTimestamp
 
   uint16_t   opcode
 
   char_t   filename []
 
   uint16_t   value []
 
   uint16_t   group
 
   uint8_t   keyExchange []
 
   uint32_t   id
 
   uint32_t   dataLen
 
Ipv6HopByHopOptHeader
 IPv6 Hop-by-Hop Options header. More...
 
struct {
   uint32_t   totalSize
 
   ResRootEntry   rootEntry
 
   MacAddr   destAddr
 
   MacAddr   srcAddr
 
   uint16_t   type
 
   uint8_t   data []
 
   uint16_t   hardwareType
 
   MacAddr   linkLayerAddr
 
   uint16_t   rtype
 
   uint16_t   rclass
 
   uint32_t   ttl
 
   uint16_t   rdlength
 
   uint8_t   rdata []
 
   uint8_t   bLength
 
   uint8_t   bDescriptorType
 
   uint8_t   bInterfaceNumber
 
   uint8_t   bAlternateSetting
 
   uint8_t   bNumEndpoints
 
   uint8_t   bInterfaceClass
 
   uint8_t   bInterfaceSubClass
 
   uint8_t   bInterfaceProtocol
 
   uint8_t   iInterface
 
   uint8_t   type
 
   uint8_t   code
 
   uint16_t   checksum
 
   uint32_t   unused
 
   uint8_t   nextHeader
 
   uint8_t   hdrExtLen
 
   uint8_t   options []
 
   uint32_t   reserved
 
   Ipv6Addr   targetAddr
 
   uint16_t   vlanId
 
   uint8_t   vlanNameLen
 
   char_t   vlanName []
 
   uint8_t   aggregationStatus
 
   uint32_t   aggregatedPortId
 
   uint8_t   locationDataFormat
 
   uint8_t   locationId []
 
   uint8_t   portIdSubtype
 
   uint8_t   portId []
 
   uint8_t   functionCode
 
   uint8_t   byteCount
 
   uint8_t   coilStatus []
 
   uint8_t   prefix
 
   uint16_t   length
 
   uint8_t   msgType
 
   uint8_t   identifier
 
   uint8_t   message []
 
   uint8_t   length
 
   Ipv4Addr   ipAddr
 
   uint16_t   protocol
 
   uint8_t   msgLength
 
   uint8_t   rejectedPacket []
 
   uint32_t   keyId
 
   uint8_t   messageDigest [16]
 
   uint16_t   opcode
 
   uint16_t   block
 
   uint16_t   value []
 
   uint8_t   value []
 
Ipv6DestOptHeader
 IPv6 Destination Options header. More...
 
struct {
   uint8_t   dsap
 
   uint8_t   ssap
 
   uint8_t   control
 
   uint8_t   msgType
 
   uint8_t   transactionId [3]
 
   uint8_t   options []
 
   uint16_t   rtype
 
   uint16_t   rclass
 
   uint32_t   ttl
 
   uint16_t   rdlength
 
   uint8_t   rdata [4]
 
   uint8_t   bLength
 
   uint8_t   bDescriptorType
 
   uint8_t   bEndpointAddress
 
   uint8_t   bmAttributes
 
   uint16_t   wMaxPacketSize
 
   uint8_t   bInterval
 
   uint8_t   type
 
   uint8_t   code
 
   uint16_t   checksum
 
   uint32_t   unused
 
   uint8_t   data []
 
   uint32_t   mtu
 
   uint8_t   nextHeader
 
   uint8_t   hdrExtLen
 
   uint8_t   routingType
 
   uint8_t   segmentsLeft
 
   uint32_t   reserved
 
   Ipv6Addr   address []
 
   uint8_t   reserved1: 5
 
   uint8_t   o: 1
 
   uint8_t   s: 1
 
   uint8_t   r: 1
 
   uint8_t   reserved2 [3]
 
   Ipv6Addr   targetAddr
 
   uint8_t   protocolIdLen
 
   uint8_t   protocolId []
 
   uint16_t   maxFrameSize
 
   uint8_t   powerPriority: 4
 
   uint8_t   powerSource: 2
 
   uint8_t   powerType: 2
 
   uint16_t   powerValue
 
   uint16_t   ttl
 
   uint8_t   functionCode
 
   uint16_t   startingAddr
 
   uint16_t   quantityOfInputs
 
   uint8_t   gwId
 
   uint16_t   duration
 
   uint8_t   identifier
 
   uint16_t   length
 
   uint8_t   message []
 
   uint8_t   length
 
   Ipv4Addr   ipAddr
 
   uint16_t   protocol
 
   uint16_t   rejectedProtocol
 
   uint8_t   rejectedInfo []
 
   uint16_t   opcode
 
   uint16_t   block
 
   uint16_t   version
 
   uint16_t   epoch
 
   DtlsSequenceNumber   seqNum
 
   uint8_t   hash
 
   uint8_t   signature
 
   uint8_t   value []
 
Ipv6RoutingHeader
 IPv6 Type 0 Routing header. More...
 
struct {
   uint16_t   tci
 
   uint16_t   type
 
   uint8_t   msgType
 
   uint8_t   hopCount
 
   Ipv6Addr   linkAddress
 
   Ipv6Addr   peerAddress
 
   uint8_t   options []
 
   uint16_t   rtype
 
   uint16_t   rclass
 
   uint32_t   ttl
 
   uint16_t   rdlength
 
   uint8_t   rdata [16]
 
   uint8_t   bLength
 
   uint8_t   bDescriptorType
 
   uint16_t   bString []
 
   uint8_t   type
 
   uint8_t   code
 
   uint16_t   checksum
 
   uint8_t   pointer
 
   uint8_t   unused [3]
 
   uint8_t   data []
 
   uint32_t   unused
 
   uint8_t   nextHeader
 
   uint8_t   payloadLen
 
   uint16_t   reserved
 
   uint32_t   securityParamIndex
 
   uint32_t   sequenceNumber
 
   uint8_t   authData []
 
   uint32_t   reserved
 
   Ipv6Addr   targetAddr
 
   Ipv6Addr   destAddr
 
   uint8_t   measurements [20]
 
   uint16_t   psePowerPriceIndex
 
   uint16_t   supportedCap
 
   uint16_t   enabledCap
 
   uint8_t   functionCode
 
   uint8_t   byteCount
 
   uint8_t   inputStatus []
 
   uint8_t   radius
 
   uint8_t   length
 
   Ipv4Addr   ipAddr
 
   uint32_t   magicNumber
 
   uint8_t   identifier
 
   uint16_t   length
 
   uint16_t   opcode
 
   uint16_t   errorCode
 
   char_t   errorMsg []
 
   uint16_t   msgSeq
 
   uint8_t   fragOffset [3]
 
   uint8_t   fragLength [3]
 
   TlsSignHashAlgo   value []
 
   uint8_t   value []
 
Ipv6AuthHeader
 IPv6 Authentication header. More...
 
struct {
   uint16_t   code
 
   uint16_t   length
 
   uint8_t   value []
 
   uint16_t   rtype
 
   uint16_t   rclass
 
   uint32_t   ttl
 
   uint16_t   rdlength
 
   uint16_t   priority
 
   uint16_t   weight
 
   uint16_t   port
 
   uint8_t   target []
 
   uint8_t   bFunctionLength
 
   uint8_t   bDescriptorType
 
   uint8_t   bDescriptorSubtype
 
   uint16_t   bcdCdc
 
   uint8_t   type
 
   uint8_t   code
 
   uint16_t   checksum
 
   uint16_t   identifier
 
   uint16_t   sequenceNumber
 
   uint8_t   data []
 
   uint32_t   pointer
 
   uint32_t   securityParamIndex
 
   uint32_t   sequenceNumber
 
   uint8_t   payloadData []
 
   uint8_t   length
 
   uint8_t   powerPriority: 2
 
   uint8_t   pd4pid: 1
 
   uint8_t   reserved: 1
 
   uint8_t   powerSource: 2
 
   uint8_t   powerType: 2
 
   uint16_t   pdRequestedPower
 
   uint16_t   pseAllocatedPower
 
   uint8_t   mgmtAddrLen
 
   uint8_t   mgmtAddrSubtype
 
   uint8_t   mgmtAddr []
 
   uint8_t   functionCode
 
   uint16_t   startingAddr
 
   uint16_t   quantityOfRegs
 
   uint8_t   gwId
 
   uint8_t   gwAdd []
 
   Ipv4Addr   ipAddr
 
   uint8_t   identifier
 
   uint32_t   magicNumber
 
   uint16_t   serverVersion
 
   uint8_t   cookieLength
 
   uint8_t   cookie []
 
Ipv6EspHeader
 IPv6 Encapsulating Security Payload header. More...
 
struct {
   uint32_t   iaId
 
   uint32_t   t1
 
   uint32_t   t2
 
   uint8_t   options []
 
   uint8_t   bFunctionLength
 
   uint8_t   bDescriptorType
 
   uint8_t   bDescriptorSubtype
 
   uint8_t   bmCapabilities
 
   uint8_t   bDataInterface
 
   uint8_t   type
 
   uint8_t   code
 
   uint16_t   checksum
 
   uint16_t   identifier
 
   uint16_t   sequenceNumber
 
   uint8_t   data []
 
   uint8_t   length
 
   MacAddr   linkLayerAddr
 
   uint16_t   pdRequestedPowerA
 
   uint16_t   pdRequestedPowerB
 
   uint16_t   pseAllocatedPowerA
 
   uint16_t   pseAllocatedPowerB
 
   uint16_t   powerStatus
 
   uint8_t   systemSetup
 
   uint16_t   pseMaxAvailablePower
 
   uint8_t   autoclass
 
   uint8_t   powerDown [3]
 
   uint8_t   ifNumSubtype
 
   uint32_t   ifNum
 
   uint8_t   oidLen
 
   uint8_t   oid []
 
   uint8_t   functionCode
 
   uint8_t   byteCount
 
   uint16_t   regValue []
 
   MqttSnFlags   flags
 
   uint8_t   protocolId
 
   uint16_t   duration
 
   char_t   clientId []
 
   Ipv4Addr   ipAddr
 
   uint16_t   length
 
   uint8_t   value []
 
Ipv6Option
 IPv6 option. More...
 

Enumerations

enum  Ipv6AddrScope {
  IPV6_ADDR_SCOPE_INTERFACE_LOCAL = 1, IPV6_ADDR_SCOPE_LINK_LOCAL = 2, IPV6_ADDR_SCOPE_ADMIN_LOCAL = 4, IPV6_ADDR_SCOPE_SITE_LOCAL = 5,
  IPV6_ADDR_SCOPE_ORGANIZATION_LOCAL = 8, IPV6_ADDR_SCOPE_GLOBAL = 14
}
 IPv6 address scopes. More...
 
enum  Ipv6AddrState { IPV6_ADDR_STATE_INVALID = 0, IPV6_ADDR_STATE_TENTATIVE = 1, IPV6_ADDR_STATE_PREFERRED = 2, IPV6_ADDR_STATE_DEPRECATED = 3 }
 IPv6 address state. More...
 
enum  Ipv6NextHeaderType {
  IPV6_HOP_BY_HOP_OPT_HEADER = 0, IPV6_TCP_HEADER = 6, IPV6_UDP_HEADER = 17, IPV6_ROUTING_HEADER = 43,
  IPV6_FRAGMENT_HEADER = 44, IPV6_ESP_HEADER = 50, IPV6_AH_HEADER = 51, IPV6_ICMPV6_HEADER = 58,
  IPV6_NO_NEXT_HEADER = 59, IPV6_DEST_OPT_HEADER = 60
}
 IPv6 Next Header types. More...
 
enum  Ipv6FragmentOffset { IPV6_OFFSET_MASK = 0xFFF8, IPV6_FLAG_RES1 = 0x0004, IPV6_FLAG_RES2 = 0x0002, IPV6_FLAG_M = 0x0001 }
 IPv6 fragment offset field. More...
 
enum  Ipv6OptionType { IPV6_OPTION_TYPE_MASK = 0x1F, IPV6_OPTION_TYPE_PAD1 = 0x00, IPV6_OPTION_TYPE_PADN = 0x01 }
 IPv6 option types. More...
 
enum  Ipv6Actions {
  IPV6_ACTION_MASK = 0xC0, IPV6_ACTION_SKIP_OPTION = 0x00, IPV6_ACTION_DISCARD_PACKET = 0x40, IPV6_ACTION_SEND_ICMP_ERROR_ALL = 0x80,
  IPV6_ACTION_SEND_ICMP_ERROR_UNI = 0xC0
}
 Actions to be taken for unrecognized options. 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 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, Ipv6PseudoHeader *pseudoHeader, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
 Send an IPv6 datagram. More...
 
error_t ipv6SendPacket (NetInterface *interface, Ipv6PseudoHeader *pseudoHeader, uint32_t fragId, size_t fragOffset, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
 Send an IPv6 packet. More...
 
error_t ipv6JoinMulticastGroup (NetInterface *interface, const Ipv6Addr *groupAddr)
 Join an IPv6 multicast group. More...
 
error_t ipv6LeaveMulticastGroup (NetInterface *interface, const Ipv6Addr *groupAddr)
 Leave an IPv6 multicast group. 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_tipv6AddrToString (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

__start_packed struct _Ipv6Header __end_packed
 
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-2022 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.2.0

Definition in file ipv6.h.

Macro Definition Documentation

◆ IPV6_ADDR

#define IPV6_ADDR (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h 
)
Value:
{{{ \
MSB(a), LSB(a), MSB(b), LSB(b), MSB(c), LSB(c), MSB(d), LSB(d), \
MSB(e), LSB(e), MSB(f), LSB(f), MSB(g), LSB(g), MSB(h), LSB(h)}}}

Definition at line 112 of file ipv6.h.

◆ IPV6_ADDR_LIST_SIZE

#define IPV6_ADDR_LIST_SIZE   3

Definition at line 66 of file ipv6.h.

◆ IPV6_ANYCAST_ADDR_LIST_SIZE

#define IPV6_ANYCAST_ADDR_LIST_SIZE   1

Definition at line 73 of file ipv6.h.

◆ IPV6_DEFAULT_HOP_LIMIT

#define IPV6_DEFAULT_HOP_LIMIT   64

Definition at line 59 of file ipv6.h.

◆ IPV6_DEFAULT_MTU

#define IPV6_DEFAULT_MTU   1280

Definition at line 109 of file ipv6.h.

◆ IPV6_DNS_SERVER_LIST_SIZE

#define IPV6_DNS_SERVER_LIST_SIZE   2

Definition at line 94 of file ipv6.h.

◆ IPV6_MULTICAST_FILTER_SIZE

#define IPV6_MULTICAST_FILTER_SIZE   8

Definition at line 101 of file ipv6.h.

◆ IPV6_PREFIX_LIST_SIZE

#define IPV6_PREFIX_LIST_SIZE   2

Definition at line 80 of file ipv6.h.

◆ IPV6_ROUTER_LIST_SIZE

#define IPV6_ROUTER_LIST_SIZE   2

Definition at line 87 of file ipv6.h.

◆ IPV6_SUPPORT

#define IPV6_SUPPORT   DISABLED

Definition at line 52 of file ipv6.h.

◆ IPV6_VERSION

#define IPV6_VERSION   6

Definition at line 107 of file ipv6.h.

◆ ipv6CompAddr

#define ipv6CompAddr (   ipAddr1,
  ipAddr2 
)     (!osMemcmp(ipAddr1, ipAddr2, sizeof(Ipv6Addr)))

Definition at line 121 of file ipv6.h.

◆ ipv6CopyAddr

#define ipv6CopyAddr (   destIpAddr,
  srcIpAddr 
)     osMemcpy(destIpAddr, srcIpAddr, sizeof(Ipv6Addr))

Definition at line 117 of file ipv6.h.

◆ Ipv6FragmentHeader

#define Ipv6FragmentHeader   struct _Ipv6FragmentHeader

Definition at line 39 of file ipv6.h.

◆ Ipv6Header

#define Ipv6Header   struct _Ipv6Header

Definition at line 36 of file ipv6.h.

◆ ipv6IsLinkLocalUnicastAddr

#define ipv6IsLinkLocalUnicastAddr (   ipAddr)     ((ipAddr)->b[0] == 0xFE && ((ipAddr)->b[1] & 0xC0) == 0x80)

Definition at line 125 of file ipv6.h.

◆ ipv6IsMulticastAddr

#define ipv6IsMulticastAddr (   ipAddr)     ((ipAddr)->b[0] == 0xFF)

Definition at line 133 of file ipv6.h.

◆ ipv6IsSiteLocalUnicastAddr

#define ipv6IsSiteLocalUnicastAddr (   ipAddr)     ((ipAddr)->b[0] == 0xFE && ((ipAddr)->b[1] & 0xC0) == 0xC0)

Definition at line 129 of file ipv6.h.

◆ ipv6IsSolicitedNodeAddr

#define ipv6IsSolicitedNodeAddr (   ipAddr)     ipv6CompPrefix(ipAddr, &IPV6_SOLICITED_NODE_ADDR_PREFIX, 104)

Definition at line 137 of file ipv6.h.

◆ Ipv6PseudoHeader

#define Ipv6PseudoHeader   struct _Ipv6PseudoHeader

Definition at line 42 of file ipv6.h.

Typedef Documentation

◆ Ipv6Addr

typedef { ... } Ipv6Addr

IPv6 network address.

◆ Ipv6AuthHeader

typedef { ... } Ipv6AuthHeader

IPv6 Authentication header.

◆ Ipv6DestOptHeader

typedef { ... } Ipv6DestOptHeader

IPv6 Destination Options header.

◆ Ipv6EspHeader

typedef { ... } Ipv6EspHeader

IPv6 Encapsulating Security Payload header.

◆ Ipv6HopByHopOptHeader

typedef { ... } Ipv6HopByHopOptHeader

IPv6 Hop-by-Hop Options header.

◆ Ipv6Option

typedef { ... } Ipv6Option

IPv6 option.

◆ Ipv6RoutingHeader

typedef { ... } Ipv6RoutingHeader

IPv6 Type 0 Routing header.

Enumeration Type Documentation

◆ Ipv6Actions

Actions to be taken for unrecognized options.

Enumerator
IPV6_ACTION_MASK 
IPV6_ACTION_SKIP_OPTION 
IPV6_ACTION_DISCARD_PACKET 
IPV6_ACTION_SEND_ICMP_ERROR_ALL 
IPV6_ACTION_SEND_ICMP_ERROR_UNI 

Definition at line 222 of file ipv6.h.

◆ Ipv6AddrScope

IPv6 address scopes.

Enumerator
IPV6_ADDR_SCOPE_INTERFACE_LOCAL 
IPV6_ADDR_SCOPE_LINK_LOCAL 
IPV6_ADDR_SCOPE_ADMIN_LOCAL 
IPV6_ADDR_SCOPE_SITE_LOCAL 
IPV6_ADDR_SCOPE_ORGANIZATION_LOCAL 
IPV6_ADDR_SCOPE_GLOBAL 

Definition at line 150 of file ipv6.h.

◆ Ipv6AddrState

IPv6 address state.

Enumerator
IPV6_ADDR_STATE_INVALID 

An address that is not assigned to any interface.

IPV6_ADDR_STATE_TENTATIVE 

An address whose uniqueness on a link is being verified.

IPV6_ADDR_STATE_PREFERRED 

An address assigned to an interface whose use is unrestricted.

IPV6_ADDR_STATE_DEPRECATED 

An address assigned to an interface whose use is discouraged.

Definition at line 165 of file ipv6.h.

◆ Ipv6FragmentOffset

IPv6 fragment offset field.

Enumerator
IPV6_OFFSET_MASK 
IPV6_FLAG_RES1 
IPV6_FLAG_RES2 
IPV6_FLAG_M 

Definition at line 197 of file ipv6.h.

◆ Ipv6NextHeaderType

IPv6 Next Header types.

Enumerator
IPV6_HOP_BY_HOP_OPT_HEADER 
IPV6_TCP_HEADER 
IPV6_UDP_HEADER 
IPV6_ROUTING_HEADER 
IPV6_FRAGMENT_HEADER 
IPV6_ESP_HEADER 
IPV6_AH_HEADER 
IPV6_ICMPV6_HEADER 
IPV6_NO_NEXT_HEADER 
IPV6_DEST_OPT_HEADER 

Definition at line 178 of file ipv6.h.

◆ Ipv6OptionType

IPv6 option types.

Enumerator
IPV6_OPTION_TYPE_MASK 
IPV6_OPTION_TYPE_PAD1 
IPV6_OPTION_TYPE_PADN 

Definition at line 210 of file ipv6.h.

Function Documentation

◆ ipv6AddrToString()

char_t* ipv6AddrToString ( const Ipv6Addr ipAddr,
char_t str 
)

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]ipAddrBinary representation of the IPv6 address
[out]strNULL-terminated string representing the IPv6 address
Returns
Pointer to the formatted string

Definition at line 2333 of file ipv6.c.

◆ ipv6DumpHeader()

void ipv6DumpHeader ( const Ipv6Header ipHeader)

Dump IPv6 header for debugging purpose.

Parameters
[in]ipHeaderIPv6 header

Definition at line 2402 of file ipv6.c.

◆ ipv6GetAnycastAddr()

error_t ipv6GetAnycastAddr ( NetInterface interface,
uint_t  index,
Ipv6Addr addr 
)

Retrieve anycast address.

Parameters
[in]interfacePointer to the desired network interface
[in]indexZero-based index
[out]addrAnycast address
Returns
Error code

Definition at line 519 of file ipv6.c.

◆ ipv6GetDefaultRouter()

error_t ipv6GetDefaultRouter ( NetInterface interface,
uint_t  index,
Ipv6Addr addr 
)

Retrieve default router.

Parameters
[in]interfacePointer to the desired network interface
[in]indexZero-based index
[out]addrDefault router address
Returns
Error code

Definition at line 730 of file ipv6.c.

◆ ipv6GetDnsServer()

error_t ipv6GetDnsServer ( NetInterface interface,
uint_t  index,
Ipv6Addr addr 
)

Retrieve DNS server.

Parameters
[in]interfacePointer to the desired network interface
[in]indexThis parameter selects between the primary and secondary DNS server
[out]addrDNS server address
Returns
Error code

Definition at line 815 of file ipv6.c.

◆ ipv6GetGlobalAddr()

error_t ipv6GetGlobalAddr ( NetInterface interface,
uint_t  index,
Ipv6Addr addr 
)

Retrieve global address.

Parameters
[in]interfacePointer to the desired network interface
[in]indexZero-based index
[out]addrGlobal address
Returns
Error code

Definition at line 363 of file ipv6.c.

◆ ipv6GetGlobalAddrState()

Ipv6AddrState ipv6GetGlobalAddrState ( NetInterface interface,
uint_t  index 
)

Get the state of the specified global address.

Parameters
[in]interfacePointer to the desired network interface
[in]indexZero-based index
Returns
Address state

Definition at line 414 of file ipv6.c.

◆ ipv6GetLinkLocalAddr()

error_t ipv6GetLinkLocalAddr ( NetInterface interface,
Ipv6Addr addr 
)

Retrieve link-local address.

Parameters
[in]interfacePointer to the desired network interface
[out]addrlink-local address
Returns
Error code

Definition at line 256 of file ipv6.c.

◆ ipv6GetLinkLocalAddrState()

Ipv6AddrState ipv6GetLinkLocalAddrState ( NetInterface interface)

Get the state of the link-local address.

Parameters
[in]interfacePointer to the desired network interface
Returns
Address state

Definition at line 297 of file ipv6.c.

◆ ipv6GetMtu()

error_t ipv6GetMtu ( NetInterface interface,
size_t *  mtu 
)

Retrieve the MTU for the specified interface.

Parameters
[in]interfacePointer to the desired network interface
[out]mtuMaximum transmit unit
Returns
Error code

Definition at line 193 of file ipv6.c.

◆ ipv6GetPrefix()

error_t ipv6GetPrefix ( NetInterface interface,
uint_t  index,
Ipv6Addr prefix,
uint_t length 
)

Retrieve IPv6 prefix.

Parameters
[in]interfacePointer to the desired network interface
[in]indexZero-based index
[out]prefixIPv6 prefix
[out]lengthThe number of leading bits in the prefix that are valid
Returns
Error code

Definition at line 618 of file ipv6.c.

◆ ipv6Init()

error_t ipv6Init ( NetInterface interface)

IPv6 related initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 96 of file ipv6.c.

◆ ipv6JoinMulticastGroup()

error_t ipv6JoinMulticastGroup ( NetInterface interface,
const Ipv6Addr groupAddr 
)

Join an IPv6 multicast group.

Parameters
[in]interfaceUnderlying network interface
[in]groupAddrIPv6 Multicast address to join
Returns
Error code

Definition at line 2001 of file ipv6.c.

◆ ipv6LeaveMulticastGroup()

error_t ipv6LeaveMulticastGroup ( NetInterface interface,
const Ipv6Addr groupAddr 
)

Leave an IPv6 multicast group.

Parameters
[in]interfaceUnderlying network interface
[in]groupAddrIPv6 multicast address to drop
Returns
Error code

Definition at line 2111 of file ipv6.c.

◆ ipv6LinkChangeEvent()

void ipv6LinkChangeEvent ( NetInterface interface)

Callback function for link change event.

Parameters
[in]interfaceUnderlying network interface

Definition at line 847 of file ipv6.c.

◆ ipv6ParseAhHeader()

error_t ipv6ParseAhHeader ( NetInterface interface,
const NetBuffer ipPacket,
size_t  ipPacketOffset,
size_t *  headerOffset,
size_t *  nextHeaderOffset 
)

Parse AH header.

Parameters
[in]interfaceUnderlying network interface
[in]ipPacketMulti-part buffer containing the IPv6 packet
[in]ipPacketOffsetOffset to the first byte of the IPv6 packet
[in,out]headerOffsetOffset to the Authentication header
[in,out]nextHeaderOffsetOffset to the Next Header field

Error code

Definition at line 1470 of file ipv6.c.

◆ ipv6ParseDestOptHeader()

error_t ipv6ParseDestOptHeader ( NetInterface interface,
const NetBuffer ipPacket,
size_t  ipPacketOffset,
size_t *  headerOffset,
size_t *  nextHeaderOffset 
)

Parse Destination Options header.

Parameters
[in]interfaceUnderlying network interface
[in]ipPacketMulti-part buffer containing the IPv6 packet
[in]ipPacketOffsetOffset to the first byte of the IPv6 packet
[in,out]headerOffsetOffset to the Destination Options header
[in,out]nextHeaderOffsetOffset to the Next Header field

Error code

Definition at line 1336 of file ipv6.c.

◆ ipv6ParseEspHeader()

error_t ipv6ParseEspHeader ( NetInterface interface,
const NetBuffer ipPacket,
size_t  ipPacketOffset,
size_t *  headerOffset,
size_t *  nextHeaderOffset 
)

Parse ESP header.

Parameters
[in]interfaceUnderlying network interface
[in]ipPacketMulti-part buffer containing the IPv6 packet
[in]ipPacketOffsetOffset to the first byte of the IPv6 packet
[in,out]headerOffsetOffset to the Encapsulating Security Payload header
[in,out]nextHeaderOffsetOffset to the Next Header field

Error code

Definition at line 1490 of file ipv6.c.

◆ 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]interfaceUnderlying network interface
[in]ipPacketMulti-part buffer containing the IPv6 packet
[in]ipPacketOffsetOffset to the first byte of the IPv6 packet
[in,out]headerOffsetOffset to the Hop-by-Hop Options header
[in,out]nextHeaderOffsetOffset to the Next Header field

Error code

Definition at line 1258 of file ipv6.c.

◆ ipv6ParseOptions()

error_t ipv6ParseOptions ( NetInterface interface,
const NetBuffer ipPacket,
size_t  ipPacketOffset,
size_t  optionOffset,
size_t  optionLen 
)

Parse IPv6 options.

Parameters
[in]interfaceUnderlying network interface
[in]ipPacketMulti-part buffer containing the IPv6 packet
[in]ipPacketOffsetOffset to the first byte of the IPv6 packet
[in]optionOffsetOffset to the first byte of the Options field
[in]optionLenLength of the Options field

Error code

Definition at line 1510 of file ipv6.c.

◆ ipv6ParseRoutingHeader()

error_t ipv6ParseRoutingHeader ( NetInterface interface,
const NetBuffer ipPacket,
size_t  ipPacketOffset,
size_t *  headerOffset,
size_t *  nextHeaderOffset 
)

Parse Routing header.

Parameters
[in]interfaceUnderlying network interface
[in]ipPacketMulti-part buffer containing the IPv6 packet
[in]ipPacketOffsetOffset to the first byte of the IPv6 packet
[in,out]headerOffsetOffset to the Routing header
[in,out]nextHeaderOffsetOffset to the Next Header field

Error code

Definition at line 1399 of file ipv6.c.

◆ ipv6ProcessPacket()

void ipv6ProcessPacket ( NetInterface interface,
NetBuffer ipPacket,
size_t  ipPacketOffset,
NetRxAncillary ancillary 
)

Incoming IPv6 packet processing.

Parameters
[in]interfaceUnderlying network interface
[in]ipPacketMulti-part buffer that holds the incoming IPv6 packet
[in]ipPacketOffsetOffset to the first byte of the IPv6 packet
[in]ancillaryAdditional options passed to the stack along with the packet

Definition at line 939 of file ipv6.c.

◆ ipv6SendDatagram()

error_t ipv6SendDatagram ( NetInterface interface,
Ipv6PseudoHeader pseudoHeader,
NetBuffer buffer,
size_t  offset,
NetTxAncillary ancillary 
)

Send an IPv6 datagram.

Parameters
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv6 pseudo header
[in]bufferMulti-part buffer containing the payload
[in]offsetOffset to the first byte of the payload
[in]ancillaryAdditional options passed to the stack along with the packet
Returns
Error code

Definition at line 1636 of file ipv6.c.

◆ ipv6SendPacket()

error_t ipv6SendPacket ( NetInterface interface,
Ipv6PseudoHeader pseudoHeader,
uint32_t  fragId,
size_t  fragOffset,
NetBuffer buffer,
size_t  offset,
NetTxAncillary ancillary 
)

Send an IPv6 packet.

Parameters
[in]interfaceUnderlying network interface
[in]pseudoHeaderIPv6 pseudo header
[in]fragIdFragment identification field
[in]fragOffsetFragment offset field
[in]bufferMulti-part buffer containing the payload
[in]offsetOffset to the first byte of the payload
[in]ancillaryAdditional options passed to the stack along with the packet
Returns
Error code

Definition at line 1705 of file ipv6.c.

◆ ipv6SetAnycastAddr()

error_t ipv6SetAnycastAddr ( NetInterface interface,
uint_t  index,
const Ipv6Addr addr 
)

Assign anycast address.

Parameters
[in]interfacePointer to the desired network interface
[in]indexZero-based index
[in]addrAnycast address
Returns
Error code

Definition at line 441 of file ipv6.c.

◆ ipv6SetDefaultRouter()

error_t ipv6SetDefaultRouter ( NetInterface interface,
uint_t  index,
const Ipv6Addr addr 
)

Configure default router.

Parameters
[in]interfacePointer to the desired network interface
[in]indexZero-based index
[in]addrDefault router address
Returns
Error code

Definition at line 673 of file ipv6.c.

◆ ipv6SetDnsServer()

error_t ipv6SetDnsServer ( NetInterface interface,
uint_t  index,
const Ipv6Addr addr 
)

Configure DNS server.

Parameters
[in]interfacePointer to the desired network interface
[in]indexThis parameter selects between the primary and secondary DNS server
[in]addrDNS server address
Returns
Error code

Definition at line 781 of file ipv6.c.

◆ ipv6SetGlobalAddr()

error_t ipv6SetGlobalAddr ( NetInterface interface,
uint_t  index,
const Ipv6Addr addr 
)

Assign global address.

Parameters
[in]interfacePointer to the desired network interface
[in]indexZero-based index
[in]addrGlobal address
Returns
Error code

Definition at line 324 of file ipv6.c.

◆ ipv6SetLinkLocalAddr()

error_t ipv6SetLinkLocalAddr ( NetInterface interface,
const Ipv6Addr addr 
)

Assign link-local address.

Parameters
[in]interfacePointer to the desired network interface
[in]addrLink-local address
Returns
Error code

Definition at line 218 of file ipv6.c.

◆ ipv6SetMtu()

error_t ipv6SetMtu ( NetInterface interface,
size_t  mtu 
)

Change the MTU of a network interface.

Parameters
[in]interfacePointer to the desired network interface
[in]mtuMaximum transmit unit
Returns
Error code

Definition at line 148 of file ipv6.c.

◆ ipv6SetPrefix()

error_t ipv6SetPrefix ( NetInterface interface,
uint_t  index,
const Ipv6Addr prefix,
uint_t  length 
)

Configure IPv6 prefix.

Parameters
[in]interfacePointer to the desired network interface
[in]indexZero-based index
[in]prefixIPv6 prefix
[in]lengthThe number of leading bits in the prefix that are valid

Definition at line 554 of file ipv6.c.

◆ ipv6StringToAddr()

error_t ipv6StringToAddr ( const char_t str,
Ipv6Addr ipAddr 
)

Convert a string representation of an IPv6 address to a binary IPv6 address.

Parameters
[in]strNULL-terminated string representing the IPv6 address
[out]ipAddrBinary representation of the IPv6 address
Returns
Error code

Definition at line 2187 of file ipv6.c.

Variable Documentation

◆ __end_packed

__start_packed struct _Ipv6PseudoHeader __end_packed

◆ address

Ipv6Addr address[]

Definition at line 315 of file ipv6.h.

◆ authData

uint8_t authData[]

Definition at line 343 of file ipv6.h.

◆ b

uint8_t b[16]

Definition at line 246 of file ipv6.h.

◆ data

uint8_t data[]

Definition at line 367 of file ipv6.h.

◆ dw

uint32_t dw[4]

Definition at line 248 of file ipv6.h.

◆ hdrExtLen

uint8_t hdrExtLen

Definition at line 287 of file ipv6.h.

◆ IPV6_LINK_LOCAL_ADDR_PREFIX

const Ipv6Addr IPV6_LINK_LOCAL_ADDR_PREFIX
extern

Definition at line 82 of file ipv6.c.

◆ IPV6_LINK_LOCAL_ALL_NODES_ADDR

const Ipv6Addr IPV6_LINK_LOCAL_ALL_NODES_ADDR
extern

Definition at line 74 of file ipv6.c.

◆ IPV6_LINK_LOCAL_ALL_ROUTERS_ADDR

const Ipv6Addr IPV6_LINK_LOCAL_ALL_ROUTERS_ADDR
extern

Definition at line 78 of file ipv6.c.

◆ IPV6_LOOPBACK_ADDR

const Ipv6Addr IPV6_LOOPBACK_ADDR
extern

Definition at line 70 of file ipv6.c.

◆ IPV6_SOLICITED_NODE_ADDR_PREFIX

const Ipv6Addr IPV6_SOLICITED_NODE_ADDR_PREFIX
extern

Definition at line 86 of file ipv6.c.

◆ IPV6_UNSPECIFIED_ADDR

const Ipv6Addr IPV6_UNSPECIFIED_ADDR
extern

Definition at line 66 of file ipv6.c.

◆ length

uint8_t length

Definition at line 366 of file ipv6.h.

◆ nextHeader

uint8_t nextHeader

Definition at line 286 of file ipv6.h.

◆ options

uint8_t options[]

Definition at line 288 of file ipv6.h.

◆ payloadData

uint8_t payloadData[]

Definition at line 355 of file ipv6.h.

◆ payloadLen

uint8_t payloadLen

Definition at line 339 of file ipv6.h.

◆ reserved

uint16_t reserved

Definition at line 314 of file ipv6.h.

◆ routingType

uint8_t routingType

Definition at line 312 of file ipv6.h.

◆ securityParamIndex

uint32_t securityParamIndex

Definition at line 341 of file ipv6.h.

◆ segmentsLeft

uint8_t segmentsLeft

Definition at line 313 of file ipv6.h.

◆ sequenceNumber

uint32_t sequenceNumber

Definition at line 342 of file ipv6.h.

◆ type

uint8_t type

Definition at line 365 of file ipv6.h.

◆ w

uint16_t w[8]

Definition at line 247 of file ipv6.h.

uint8_t a
Definition: ndp.h:409
uint8_t h
Definition: ndp.h:300
uint8_t b[16]
Definition: ipv6.h:246
#define MSB(x)
Definition: os_port.h:58
#define LSB(x)
Definition: os_port.h:54
uint8_t c
Definition: ndp.h:512