Helper functions for NDP (Neighbor Discovery Protocol) More...
#include "core/net.h"
#include "ipv6/ipv6.h"
#include "ipv6/ipv6_misc.h"
#include "ipv6/ndp.h"
#include "ipv6/ndp_cache.h"
#include "ipv6/ndp_misc.h"
#include "mld/mld_node_misc.h"
#include "mdns/mdns_responder.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL NDP_TRACE_LEVEL |
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, bool_t dontRoute) |
Next-hop determination. More... | |
void | ndpUpdateNextHop (NetInterface *interface, const Ipv6Addr *unreachableNextHop) |
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) |
Search a NDP message for a given option. 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
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 ndp_misc.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL NDP_TRACE_LEVEL |
Definition at line 32 of file ndp_misc.c.
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] message Pointer to the NDP message [in,out] messageLen Length of the entire message [in] type Option type [in] value Option value [in] length Length of the option value
Definition at line 605 of file ndp_misc.c.
◆ ndpCheckOptions()
error_t ndpCheckOptions | ( | const uint8_t * | options, |
size_t | length | ||
) |
Check NDP message options.
- Parameters
-
[in] options Pointer to the Options field [in] length Length of the Options field
- Returns
- Error code
Definition at line 696 of file ndp_misc.c.
◆ ndpGetOption()
void* ndpGetOption | ( | uint8_t * | options, |
size_t | length, | ||
uint8_t | type | ||
) |
Search a NDP message for a given option.
- Parameters
-
[in] options Pointer to the Options field [in] length Length of the Options field [in] type Type 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 653 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] interface Underlying network interface [in] destAddr Destination address [in] nextHop First-hop address to be checked
- Returns
- TRUE if the address is the first-hop router, else FALSE
Definition at line 455 of file ndp_misc.c.
◆ ndpParsePrefixInfoOption()
void ndpParsePrefixInfoOption | ( | NetInterface * | interface, |
NdpPrefixInfoOption * | option | ||
) |
Parse Prefix Information Option.
- Parameters
-
[in] interface Underlying network interface [in] option Pointer to the Prefix Information option
Definition at line 55 of file ndp_misc.c.
◆ ndpSelectDefaultRouter()
error_t ndpSelectDefaultRouter | ( | NetInterface * | interface, |
const Ipv6Addr * | unreachableAddr, | ||
Ipv6Addr * | addr | ||
) |
Default Router Selection.
- Parameters
-
[in] interface Underlying network interface [in] unreachableAddr IPv6 address of the unreachable router (optional parameter) [out] addr IPv6 address of the default router to be used
- Returns
- Error code
Definition at line 353 of file ndp_misc.c.
◆ ndpSelectNextHop()
error_t ndpSelectNextHop | ( | NetInterface * | interface, |
const Ipv6Addr * | destAddr, | ||
const Ipv6Addr * | unreachableNextHop, | ||
Ipv6Addr * | nextHop, | ||
bool_t | dontRoute | ||
) |
Next-hop determination.
- Parameters
-
[in] interface Underlying network interface [in] destAddr Destination address [in] unreachableNextHop Address of the unreachable next-hop (optional parameter) [out] nextHop Next-hop address to be used [in] dontRoute Do not send the packet via a router
- Returns
- Error code
Definition at line 517 of file ndp_misc.c.
◆ ndpUpdateAddrList()
void ndpUpdateAddrList | ( | NetInterface * | interface | ) |
Manage the lifetime of IPv6 addresses.
- Parameters
-
[in] interface Underlying network interface
Definition at line 98 of file ndp_misc.c.
◆ ndpUpdateDefaultRouterList()
void ndpUpdateDefaultRouterList | ( | NetInterface * | interface | ) |
Periodically update Default Router List.
- Parameters
-
[in] interface Underlying network interface
Definition at line 297 of file ndp_misc.c.
◆ ndpUpdateNextHop()
void ndpUpdateNextHop | ( | NetInterface * | interface, |
const Ipv6Addr * | unreachableNextHop | ||
) |
Update next-hop field of Destination Cache entries.
- Parameters
-
[in] interface Underlying network interface [in] unreachableNextHop Address of the unreachable next-hop
Definition at line 566 of file ndp_misc.c.
◆ ndpUpdatePrefixList()
void ndpUpdatePrefixList | ( | NetInterface * | interface | ) |
Periodically update Prefix List.
- Parameters
-
[in] interface Underlying network interface
Definition at line 261 of file ndp_misc.c.