Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

ndp_misc.c File Reference

ndp_misc.c File Reference

Helper functions for NDP (Neighbor Discovery Protocol) More...

Go to the source code of this file.

Functions

void ndpParsePrefixInfoOption (NetInterface *interface, NdpPrefixInfoOption *option)
 Parse Prefix Information Option.
void ndpUpdateAddrList (NetInterface *interface)
 Manage the lifetime of IPv6 addresses.
void ndpUpdatePrefixList (NetInterface *interface)
 Periodically update Prefix List.
void ndpUpdateDefaultRouterList (NetInterface *interface)
 Periodically update Default Router List.
error_t ndpSelectDefaultRouter (NetInterface *interface, const Ipv6Addr *unreachableAddr, Ipv6Addr *addr)
 Default Router Selection.
bool_t ndpIsFirstHopRouter (NetInterface *interface, const Ipv6Addr *destAddr, const Ipv6Addr *nextHop)
 Check whether an address is the first-hop router for the specified destination.
error_t ndpSelectNextHop (NetInterface *interface, const Ipv6Addr *destAddr, const Ipv6Addr *unreachableNextHop, Ipv6Addr *nextHop)
 Next-hop determination.
void ndpUpdateNextHop (NetInterface *interface, const Ipv6Addr *unreachableNextHop)
 Update next-hop field of Destination Cache entries.
void ndpAddOption (void *message, size_t *messageLength, uint8_t type, const void *value, size_t length)
 Append an option to a NDP message.
void * ndpGetOption (uint8_t *options, size_t length, uint8_t type)
 Find a specified option in a NDP message.
error_t ndpCheckOptions (const uint8_t *options, size_t length)
 Check NDP message options.

Detailed Description

Helper functions for NDP (Neighbor Discovery Protocol)

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 ndp_misc.c.


Function Documentation

void ndpAddOption ( void *  message,
size_t *  messageLength,
uint8_t  type,
const void *  value,
size_t  length 
)

Append an option to a NDP message.

Parameters:
[in]messagePointer to the NDP message
[in,out]messageLengthLength of the entire message
[in]typeOption type
[in]valueOption value
[in]lengthLength of the option value

Definition at line 588 of file ndp_misc.c.

error_t ndpCheckOptions ( const uint8_t *  options,
size_t  length 
)

Check NDP message options.

Parameters:
[in]optionsPointer to the Options field
[in]lengthLength of the Options field
Returns:
Error code

Definition at line 678 of file ndp_misc.c.

void* ndpGetOption ( uint8_t *  options,
size_t  length,
uint8_t  type 
)

Find a specified option in a NDP message.

Parameters:
[in]optionsPointer to the Options field
[in]lengthLength of the Options field
[in]typeType of the option to find
Returns:
If the specified option is found, a pointer to the corresponding option is returned. Otherwise NULL pointer is returned

Definition at line 636 of file ndp_misc.c.

bool_t ndpIsFirstHopRouter ( NetInterface *  interface,
const Ipv6Addr *  destAddr,
const Ipv6Addr *  nextHop 
)

Check whether an address is the first-hop router for the specified destination.

Parameters:
[in]interfaceUnderlying network interface
[in]destAddrDestination address
[in]nextHopFirst-hop address to be checked
Returns:
TRUE if the address is the first-hop router, else FALSE

Definition at line 443 of file ndp_misc.c.

void ndpParsePrefixInfoOption ( NetInterface *  interface,
NdpPrefixInfoOption *  option 
)

Parse Prefix Information Option.

Parameters:
[in]interfaceUnderlying network interface
[in]optionPointer to the Prefix Information option

Definition at line 52 of file ndp_misc.c.

error_t ndpSelectDefaultRouter ( NetInterface *  interface,
const Ipv6Addr *  unreachableAddr,
Ipv6Addr *  addr 
)

Default Router Selection.

Parameters:
[in]interfaceUnderlying network interface
[in]unreachableAddrIPv6 address of the unreachable router (optional parameter)
[out]addrIPv6 address of the default router to be used
Returns:
Error code

Definition at line 341 of file ndp_misc.c.

error_t ndpSelectNextHop ( NetInterface *  interface,
const Ipv6Addr *  destAddr,
const Ipv6Addr *  unreachableNextHop,
Ipv6Addr *  nextHop 
)

Next-hop determination.

Parameters:
[in]interfaceUnderlying network interface
[in]destAddrDestination address
[in]unreachableNextHopAddress of the unreachable next-hop (optional parameter)
[out]nextHopNext-hop address to be used
Returns:
Error code

Definition at line 503 of file ndp_misc.c.

void ndpUpdateAddrList ( NetInterface *  interface )

Manage the lifetime of IPv6 addresses.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 95 of file ndp_misc.c.

void ndpUpdateDefaultRouterList ( NetInterface *  interface )

Periodically update Default Router List.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 285 of file ndp_misc.c.

void ndpUpdateNextHop ( NetInterface *  interface,
const Ipv6Addr *  unreachableNextHop 
)

Update next-hop field of Destination Cache entries.

Parameters:
[in]interfaceUnderlying network interface
[in]unreachableNextHopAddress of the unreachable next-hop

Definition at line 549 of file ndp_misc.c.

void ndpUpdatePrefixList ( NetInterface *  interface )

Periodically update Prefix List.

Parameters:
[in]interfaceUnderlying network interface

Definition at line 249 of file ndp_misc.c.