ndp_cache.c File Reference

Neighbor and destination cache management. More...

#include "core/net.h"
#include "ipv6/ipv6_misc.h"
#include "ipv6/icmpv6.h"
#include "ipv6/ndp.h"
#include "ipv6/ndp_cache.h"
#include "ipv6/ndp_misc.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NDP_TRACE_LEVEL
 

Functions

void ndpChangeState (NdpNeighborCacheEntry *entry, NdpState newState)
 Update Neighbor cache entry state. More...
 
NdpNeighborCacheEntryndpCreateNeighborCacheEntry (NetInterface *interface)
 Create a new entry in the Neighbor cache. More...
 
NdpNeighborCacheEntryndpFindNeighborCacheEntry (NetInterface *interface, const Ipv6Addr *ipAddr)
 Search the Neighbor cache for a given IPv6 address. More...
 
void ndpUpdateNeighborCache (NetInterface *interface)
 Periodically update Neighbor cache. More...
 
void ndpFlushNeighborCache (NetInterface *interface)
 Flush Neighbor cache. More...
 
uint_t ndpSendQueuedPackets (NetInterface *interface, NdpNeighborCacheEntry *entry)
 Send packets that are waiting for address resolution. More...
 
void ndpFlushQueuedPackets (NetInterface *interface, NdpNeighborCacheEntry *entry)
 Flush packet queue. More...
 
NdpDestCacheEntryndpCreateDestCacheEntry (NetInterface *interface)
 Create a new entry in the Destination Cache. More...
 
NdpDestCacheEntryndpFindDestCacheEntry (NetInterface *interface, const Ipv6Addr *destAddr)
 Search the Destination Cache for a given destination address. More...
 
void ndpFlushDestCache (NetInterface *interface)
 Flush Destination Cache. More...
 

Detailed Description

Neighbor and destination cache management.

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.

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

Definition in file ndp_cache.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NDP_TRACE_LEVEL

Definition at line 32 of file ndp_cache.c.

Function Documentation

◆ ndpChangeState()

void ndpChangeState ( NdpNeighborCacheEntry entry,
NdpState  newState 
)

Update Neighbor cache entry state.

Parameters
[in]entryPointer to a Neighbor cache entry
[in]newStateNew state to switch to

Definition at line 53 of file ndp_cache.c.

◆ ndpCreateDestCacheEntry()

NdpDestCacheEntry* ndpCreateDestCacheEntry ( NetInterface interface)

Create a new entry in the Destination Cache.

Parameters
[in]interfaceUnderlying network interface
Returns
Pointer to the newly created entry

Definition at line 452 of file ndp_cache.c.

◆ ndpCreateNeighborCacheEntry()

NdpNeighborCacheEntry* ndpCreateNeighborCacheEntry ( NetInterface interface)

Create a new entry in the Neighbor cache.

Parameters
[in]interfaceUnderlying network interface
Returns
Pointer to the newly created entry

Definition at line 72 of file ndp_cache.c.

◆ ndpFindDestCacheEntry()

NdpDestCacheEntry* ndpFindDestCacheEntry ( NetInterface interface,
const Ipv6Addr destAddr 
)

Search the Destination Cache for a given destination address.

Parameters
[in]interfaceUnderlying network interface
[in]destAddrDestination IPv6 address
Returns
A pointer to the matching entry is returned. NULL is returned if the specified address could not be found in the Destination cache

Definition at line 503 of file ndp_cache.c.

◆ ndpFindNeighborCacheEntry()

NdpNeighborCacheEntry* ndpFindNeighborCacheEntry ( NetInterface interface,
const Ipv6Addr ipAddr 
)

Search the Neighbor cache for a given IPv6 address.

Parameters
[in]interfaceUnderlying network interface
[in]ipAddrIPv6 address
Returns
A pointer to the matching entry is returned. NULL is returned if the specified IPv6 address could not be found in the Neighbor cache

Definition at line 154 of file ndp_cache.c.

◆ ndpFlushDestCache()

void ndpFlushDestCache ( NetInterface interface)

Flush Destination Cache.

Parameters
[in]interfaceUnderlying network interface

Definition at line 532 of file ndp_cache.c.

◆ ndpFlushNeighborCache()

void ndpFlushNeighborCache ( NetInterface interface)

Flush Neighbor cache.

Parameters
[in]interfaceUnderlying network interface

Definition at line 315 of file ndp_cache.c.

◆ ndpFlushQueuedPackets()

void ndpFlushQueuedPackets ( NetInterface interface,
NdpNeighborCacheEntry entry 
)

Flush packet queue.

Parameters
[in]interfaceUnderlying network interface
[in]entryPointer to a Neighbor cache entry

Definition at line 409 of file ndp_cache.c.

◆ ndpSendQueuedPackets()

uint_t ndpSendQueuedPackets ( NetInterface interface,
NdpNeighborCacheEntry entry 
)

Send packets that are waiting for address resolution.

Parameters
[in]interfaceUnderlying network interface
[in]entryPointer to a Neighbor cache entry
Returns
The number of packets that have been sent

Definition at line 350 of file ndp_cache.c.

◆ ndpUpdateNeighborCache()

void ndpUpdateNeighborCache ( NetInterface interface)

Periodically update Neighbor cache.

Parameters
[in]interfaceUnderlying network interface

Definition at line 187 of file ndp_cache.c.