ndp_cache.h
Go to the documentation of this file.
1 /**
2  * @file ndp_cache.h
3  * @brief Neighbor and destination cache management
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.0
29  **/
30 
31 #ifndef _NDP_CACHE_H
32 #define _NDP_CACHE_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "ipv6/ndp.h"
37 
38 //C++ guard
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 //NDP related functions
44 void ndpChangeState(NdpNeighborCacheEntry *entry, NdpState newState);
45 
47 
49  const Ipv6Addr *ipAddr);
50 
51 void ndpUpdateNeighborCache(NetInterface *interface);
52 void ndpFlushNeighborCache(NetInterface *interface);
53 
56 
58 
60  const Ipv6Addr *destAddr);
61 
62 void ndpFlushDestCache(NetInterface *interface);
63 
64 //C++ guard
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif
unsigned int uint_t
Definition: compiler_port.h:50
Ipv4Addr ipAddr
Definition: ipcp.h:105
Ipv4Addr destAddr
Definition: ipv4.h:299
Ipv6Addr
Definition: ipv6.h:251
NDP (Neighbor Discovery Protocol)
NdpState
Neighbor cache entry states.
Definition: ndp.h:248
uint_t ndpSendQueuedPackets(NetInterface *interface, NdpNeighborCacheEntry *entry)
Send packets that are waiting for address resolution.
Definition: ndp_cache.c:350
void ndpFlushDestCache(NetInterface *interface)
Flush Destination Cache.
Definition: ndp_cache.c:532
void ndpFlushNeighborCache(NetInterface *interface)
Flush Neighbor cache.
Definition: ndp_cache.c:315
NdpNeighborCacheEntry * ndpFindNeighborCacheEntry(NetInterface *interface, const Ipv6Addr *ipAddr)
Search the Neighbor cache for a given IPv6 address.
Definition: ndp_cache.c:154
NdpDestCacheEntry * ndpFindDestCacheEntry(NetInterface *interface, const Ipv6Addr *destAddr)
Search the Destination Cache for a given destination address.
Definition: ndp_cache.c:503
void ndpFlushQueuedPackets(NetInterface *interface, NdpNeighborCacheEntry *entry)
Flush packet queue.
Definition: ndp_cache.c:409
NdpNeighborCacheEntry * ndpCreateNeighborCacheEntry(NetInterface *interface)
Create a new entry in the Neighbor cache.
Definition: ndp_cache.c:72
void ndpChangeState(NdpNeighborCacheEntry *entry, NdpState newState)
Update Neighbor cache entry state.
Definition: ndp_cache.c:53
void ndpUpdateNeighborCache(NetInterface *interface)
Periodically update Neighbor cache.
Definition: ndp_cache.c:187
NdpDestCacheEntry * ndpCreateDestCacheEntry(NetInterface *interface)
Create a new entry in the Destination Cache.
Definition: ndp_cache.c:452
TCP/IP stack core.
#define NetInterface
Definition: net.h:36
Destination cache entry.
Definition: ndp.h:567
Neighbor cache entry.
Definition: ndp.h:549