ndp_misc.h File Reference

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

#include "core/net.h"
#include "ipv6/ndp.h"

Go to the source code of this file.

Functions

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

Detailed Description

Helper functions for NDP (Neighbor Discovery Protocol)

License

Copyright (C) 2010-2018 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.9.0

Definition in file ndp_misc.h.

Function Documentation

◆ ndpAddOption()

void ndpAddOption ( void *  message,
size_t *  messageLen,
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]messageLenLength 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.

◆ ndpCheckOptions()

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.

◆ ndpGetOption()

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.

◆ ndpIsFirstHopRouter()

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.

◆ ndpParsePrefixInfoOption()

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.

◆ ndpSelectDefaultRouter()

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.

◆ ndpSelectNextHop()

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.

◆ ndpUpdateAddrList()

void ndpUpdateAddrList ( NetInterface interface)

Manage the lifetime of IPv6 addresses.

Parameters
[in]interfaceUnderlying network interface

Definition at line 95 of file ndp_misc.c.

◆ ndpUpdateDefaultRouterList()

void ndpUpdateDefaultRouterList ( NetInterface interface)

Periodically update Default Router List.

Parameters
[in]interfaceUnderlying network interface

Definition at line 285 of file ndp_misc.c.

◆ ndpUpdateNextHop()

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.

◆ ndpUpdatePrefixList()

void ndpUpdatePrefixList ( NetInterface interface)

Periodically update Prefix List.

Parameters
[in]interfaceUnderlying network interface

Definition at line 249 of file ndp_misc.c.