Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

ipv6_misc.c File Reference

ipv6_misc.c File Reference

Helper functions for IPv6. More...

Go to the source code of this file.

Functions

Ipv6AddrState ipv6GetAddrState (NetInterface *interface, const Ipv6Addr *addr)
 Get the state of the specified IPv6 address.
error_t ipv6SetAddr (NetInterface *interface, uint_t index, const Ipv6Addr *addr, Ipv6AddrState state, systime_t validLifetime, systime_t preferredLifetime, bool_t permanent)
 Set IPv6 address and address state.
void ipv6AddAddr (NetInterface *interface, const Ipv6Addr *addr, uint32_t validLifetime, uint32_t preferredLifetime)
 Add a new entry to the list of IPv6 addresses.
void ipv6RemoveAddr (NetInterface *interface, const Ipv6Addr *addr)
 Remove an entry from the list of IPv6 addresses.
void ipv6AddPrefix (NetInterface *interface, const Ipv6Addr *prefix, uint_t length, uint32_t validLifetime, uint32_t preferredLifetime)
 Add a new entry to the Prefix List.
void ipv6RemovePrefix (NetInterface *interface, const Ipv6Addr *prefix, uint_t length)
 Remove an entry from the Prefix List.
void ipv6AddDefaultRouter (NetInterface *interface, const Ipv6Addr *addr, uint16_t lifetime)
 Add a new entry to the Default Router List.
void ipv6RemoveDefaultRouter (NetInterface *interface, const Ipv6Addr *addr)
 Remove an entry from the Default Router List.
void ipv6FlushAddrList (NetInterface *interface)
 Flush the list of IPv6 addresses.
void ipv6FlushPrefixList (NetInterface *interface)
 Flush the Prefix List.
void ipv6FlushDefaultRouterList (NetInterface *interface)
 Flush the Default Router List.
void ipv6FlushDnsServerList (NetInterface *interface)
 Flush the list of DNS servers.
error_t ipv6CheckSourceAddr (NetInterface *interface, const Ipv6Addr *ipAddr)
 Source IPv6 address filtering.
error_t ipv6CheckDestAddr (NetInterface *interface, const Ipv6Addr *ipAddr)
 Destination IPv6 address filtering.
error_t ipv6SelectSourceAddr (NetInterface **interface, const Ipv6Addr *destAddr, Ipv6Addr *srcAddr)
 IPv6 source address selection.
bool_t ipv6IsOnLink (NetInterface *interface, const Ipv6Addr *ipAddr)
 Check whether an IPv6 address is on-link.
bool_t ipv6IsTentativeAddr (NetInterface *interface, const Ipv6Addr *ipAddr)
 Check whether an IPv6 address is a tentative address.
bool_t ipv6IsAnycastAddr (NetInterface *interface, const Ipv6Addr *ipAddr)
 Check whether an IPv6 address is an anycast address.
bool_t ipv6CompPrefix (const Ipv6Addr *ipAddr1, const Ipv6Addr *ipAddr2, size_t length)
 Compare IPv6 address prefixes.
uint_t ipv6GetAddrScope (const Ipv6Addr *ipAddr)
 Retrieve the scope of an IPv6 address.
uint_t ipv6GetMulticastAddrScope (const Ipv6Addr *ipAddr)
 Retrieve the scope of an IPv6 multicast address.
uint_t ipv6GetCommonPrefixLength (const Ipv6Addr *ipAddr1, const Ipv6Addr *ipAddr2)
 Compute the length of the longest common prefix.
error_t ipv6ComputeSolicitedNodeAddr (const Ipv6Addr *ipAddr, Ipv6Addr *solicitedNodeAddr)
 Form a solicited-node address from an IPv6 address.
error_t ipv6MapMulticastAddrToMac (const Ipv6Addr *ipAddr, MacAddr *macAddr)
 Map an IPv6 multicast address to a MAC-layer multicast address.
void ipv6GenerateLinkLocalAddr (const Eui64 *interfaceId, Ipv6Addr *ipAddr)
 Generate a IPv6 link-local address from an interface identifier.

Detailed Description

Helper functions for IPv6.

License

Copyright (C) 2010-2017 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:
1.7.6

Definition in file ipv6_misc.c.


Function Documentation

void ipv6AddAddr ( NetInterface *  interface,
const Ipv6Addr *  addr,
uint32_t  validLifetime,
uint32_t  preferredLifetime 
)

Add a new entry to the list of IPv6 addresses.

Parameters:
[in]interfaceUnderlying network interface
[in]addrIPv6 address
[in]validLifetimeValid lifetime, in seconds
[in]preferredLifetimePreferred lifetime, in seconds

Definition at line 213 of file ipv6_misc.c.

void ipv6AddDefaultRouter ( NetInterface *  interface,
const Ipv6Addr *  addr,
uint16_t  lifetime 
)

Add a new entry to the Default Router List.

Parameters:
[in]interfaceUnderlying network interface
[in]addrIPv6 address of the router
[in]lifetimeRouter lifetime, in seconds

Definition at line 504 of file ipv6_misc.c.

void ipv6AddPrefix ( NetInterface *  interface,
const Ipv6Addr *  prefix,
uint_t  length,
uint32_t  validLifetime,
uint32_t  preferredLifetime 
)

Add a new entry to the Prefix List.

Parameters:
[in]interfaceUnderlying network interface
[in]prefixIPv6 prefix
[in]lengthThe number of leading bits in the prefix that are valid
[in]validLifetimeValid lifetime, in seconds
[in]preferredLifetimePreferred lifetime, in seconds

Definition at line 362 of file ipv6_misc.c.

error_t ipv6CheckDestAddr ( NetInterface *  interface,
const Ipv6Addr *  ipAddr 
)

Destination IPv6 address filtering.

Parameters:
[in]interfaceUnderlying network interface
[in]ipAddrDestination IPv6 address to be checked
Returns:
Error code

Definition at line 754 of file ipv6_misc.c.

error_t ipv6CheckSourceAddr ( NetInterface *  interface,
const Ipv6Addr *  ipAddr 
)

Source IPv6 address filtering.

Parameters:
[in]interfaceUnderlying network interface
[in]ipAddrSource IPv6 address to be checked
Returns:
Error code

Definition at line 731 of file ipv6_misc.c.

bool_t ipv6CompPrefix ( const Ipv6Addr *  ipAddr1,
const Ipv6Addr *  ipAddr2,
size_t  length 
)

Compare IPv6 address prefixes.

Parameters:
[in]ipAddr1Pointer to the first IPv6 address
[in]ipAddr2Pointer to the second IPv6 address
[in]lengthPrefix length
Returns:
TRUE if the prefixes match each other, else FALSE

Definition at line 1121 of file ipv6_misc.c.

error_t ipv6ComputeSolicitedNodeAddr ( const Ipv6Addr *  ipAddr,
Ipv6Addr *  solicitedNodeAddr 
)

Form a solicited-node address from an IPv6 address.

Parameters:
[in]ipAddrUnicast or anycast address
[out]solicitedNodeAddrCorresponding solicited-node address
Returns:
Error code

Definition at line 1273 of file ipv6_misc.c.

void ipv6FlushAddrList ( NetInterface *  interface )

Flush the list of IPv6 addresses.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 620 of file ipv6_misc.c.

void ipv6FlushDefaultRouterList ( NetInterface *  interface )

Flush the Default Router List.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 684 of file ipv6_misc.c.

void ipv6FlushDnsServerList ( NetInterface *  interface )

Flush the list of DNS servers.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 716 of file ipv6_misc.c.

void ipv6FlushPrefixList ( NetInterface *  interface )

Flush the Prefix List.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 651 of file ipv6_misc.c.

void ipv6GenerateLinkLocalAddr ( const Eui64 *  interfaceId,
Ipv6Addr *  ipAddr 
)

Generate a IPv6 link-local address from an interface identifier.

Parameters:
[in]interfaceIdInterface identifier
[out]ipAddrCorresponding IPv6 link-local address

Definition at line 1331 of file ipv6_misc.c.

uint_t ipv6GetAddrScope ( const Ipv6Addr *  ipAddr )

Retrieve the scope of an IPv6 address.

Parameters:
[in]ipAddrPointer to an IPv6 address
Returns:
IPv6 address scope

Definition at line 1159 of file ipv6_misc.c.

Ipv6AddrState ipv6GetAddrState ( NetInterface *  interface,
const Ipv6Addr *  addr 
)

Get the state of the specified IPv6 address.

Parameters:
[in]interfaceUnderlying network interface
[in]addrIPv6 address
Returns:
Address state

Definition at line 52 of file ipv6_misc.c.

uint_t ipv6GetCommonPrefixLength ( const Ipv6Addr *  ipAddr1,
const Ipv6Addr *  ipAddr2 
)

Compute the length of the longest common prefix.

Parameters:
[in]ipAddr1Pointer to the first IPv6 address
[in]ipAddr2Pointer to the second IPv6 address
Returns:
The length of the longest common prefix, in bits

Definition at line 1230 of file ipv6_misc.c.

uint_t ipv6GetMulticastAddrScope ( const Ipv6Addr *  ipAddr )

Retrieve the scope of an IPv6 multicast address.

Parameters:
[in]ipAddrPointer to an IPv6 multicast address
Returns:
IPv6 address scope

Definition at line 1205 of file ipv6_misc.c.

bool_t ipv6IsAnycastAddr ( NetInterface *  interface,
const Ipv6Addr *  ipAddr 
)

Check whether an IPv6 address is an anycast address.

Parameters:
[in]interfaceUnderlying network interface
[in]ipAddrIPv6 address to be checked
Returns:
TRUE if the IPv6 address is an anycast address, else FALSE

Definition at line 1084 of file ipv6_misc.c.

bool_t ipv6IsOnLink ( NetInterface *  interface,
const Ipv6Addr *  ipAddr 
)

Check whether an IPv6 address is on-link.

Parameters:
[in]interfaceUnderlying network interface
[in]ipAddrIPv6 address to be checked
Returns:
TRUE if the IPv6 address is on-link, else FALSE

Definition at line 1004 of file ipv6_misc.c.

bool_t ipv6IsTentativeAddr ( NetInterface *  interface,
const Ipv6Addr *  ipAddr 
)

Check whether an IPv6 address is a tentative address.

Parameters:
[in]interfaceUnderlying network interface
[in]ipAddrIPv6 address to be checked
Returns:
TRUE if the IPv6 address is a tentative address, else FALSE

Definition at line 1048 of file ipv6_misc.c.

error_t ipv6MapMulticastAddrToMac ( const Ipv6Addr *  ipAddr,
MacAddr *  macAddr 
)

Map an IPv6 multicast address to a MAC-layer multicast address.

Parameters:
[in]ipAddrIPv6 multicast address
[out]macAddrCorresponding MAC-layer multicast address
Returns:
Error code

Definition at line 1301 of file ipv6_misc.c.

void ipv6RemoveAddr ( NetInterface *  interface,
const Ipv6Addr *  addr 
)

Remove an entry from the list of IPv6 addresses.

Parameters:
[in]interfaceUnderlying network interface
[in]addrIPv6 address

Definition at line 323 of file ipv6_misc.c.

void ipv6RemoveDefaultRouter ( NetInterface *  interface,
const Ipv6Addr *  addr 
)

Remove an entry from the Default Router List.

Parameters:
[in]interfaceUnderlying network interface
[in]addrIPv6 address of the router to be removed from the list

Definition at line 566 of file ipv6_misc.c.

void ipv6RemovePrefix ( NetInterface *  interface,
const Ipv6Addr *  prefix,
uint_t  length 
)

Remove an entry from the Prefix List.

Parameters:
[in]interfaceUnderlying network interface
[in]prefixIPv6 prefix
[in]lengthThe number of leading bits in the prefix that are valid

Definition at line 461 of file ipv6_misc.c.

error_t ipv6SelectSourceAddr ( NetInterface **  interface,
const Ipv6Addr *  destAddr,
Ipv6Addr *  srcAddr 
)

IPv6 source address selection.

This function selects the source address and the relevant network interface to be used in order to join the specified destination address

Parameters:
[in,out]interfaceA pointer to a valid network interface may be provided as a hint. The function returns a pointer identifying the interface to be used
[in]destAddrDestination IPv6 address
[out]srcAddrLocal IPv6 address to be used
Returns:
Error code

Definition at line 860 of file ipv6_misc.c.

error_t ipv6SetAddr ( NetInterface *  interface,
uint_t  index,
const Ipv6Addr *  addr,
Ipv6AddrState  state,
systime_t  validLifetime,
systime_t  preferredLifetime,
bool_t  permanent 
)

Set IPv6 address and address state.

Parameters:
[in]interfacePointer to the desired network interface
[in]indexZero-based index
[in]addrIPv6 address
[in]stateState of the IPv6 address
[in]validLifetimeValid lifetime
[in]preferredLifetimePreferred lifetime
[in]permanentPermanently assigned address
Returns:
Error code

Definition at line 92 of file ipv6_misc.c.