1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** NetX Component                                                        */
16 /**                                                                       */
17 /**   Internet Control Message Protocol (ICMP) v6                         */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 #define NX_SOURCE_CODE
23 
24 /* Include necessary system files.  */
25 
26 #include "nx_api.h"
27 #include "nx_nd_cache.h"
28 #ifdef FEATURE_NX_IPV6
29 #include "nx_ip.h"
30 #include "nx_icmpv6.h"
31 
32 /* Bring in externs for caller checking code.  */
33 NX_CALLER_CHECKING_EXTERNS
34 
35 
36 #endif /* FEATURE_NX_IPV6 */
37 
38 
39 /**************************************************************************/
40 /*                                                                        */
41 /*  FUNCTION                                               RELEASE        */
42 /*                                                                        */
43 /*    _nxde_nd_cache_invalidate                           PORTABLE C      */
44 /*                                                           6.1          */
45 /*  AUTHOR                                                                */
46 /*                                                                        */
47 /*    Yuxin Zhou, Microsoft Corporation                                   */
48 /*                                                                        */
49 /*  DESCRIPTION                                                           */
50 /*                                                                        */
51 /*    This function performs error checking services on the neighbor      */
52 /*    discovery cache invalidate service.                                 */
53 /*                                                                        */
54 /*  INPUT                                                                 */
55 /*                                                                        */
56 /*    ip_ptr                                Pointer to IP instance        */
57 /*                                                                        */
58 /*  OUTPUT                                                                */
59 /*                                                                        */
60 /*    status                                Completion status             */
61 /*                                                                        */
62 /*  CALLS                                                                 */
63 /*                                                                        */
64 /*    _nxd_nd_cache_invalidate              Actual nd cache invalidate    */
65 /*                                            function.                   */
66 /*                                                                        */
67 /*  CALLED BY                                                             */
68 /*                                                                        */
69 /*    Application Code                                                    */
70 /*                                                                        */
71 /*  RELEASE HISTORY                                                       */
72 /*                                                                        */
73 /*    DATE              NAME                      DESCRIPTION             */
74 /*                                                                        */
75 /*  05-19-2020     Yuxin Zhou               Initial Version 6.0           */
76 /*  09-30-2020     Yuxin Zhou               Modified comment(s),          */
77 /*                                            resulting in version 6.1    */
78 /*                                                                        */
79 /**************************************************************************/
_nxde_nd_cache_invalidate(NX_IP * ip_ptr)80 UINT _nxde_nd_cache_invalidate(NX_IP *ip_ptr)
81 {
82 #ifdef FEATURE_NX_IPV6
83 
84     /* Check for invalid input pointers.  */
85     if ((ip_ptr == NX_NULL) || (ip_ptr -> nx_ip_id != NX_IP_ID))
86     {
87         return(NX_PTR_ERROR);
88     }
89 
90     /* Check for appropriate caller.  */
91     NX_THREADS_ONLY_CALLER_CHECKING
92 
93     /* Call the actual service and return the completion status. */
94     return(_nxd_nd_cache_invalidate(ip_ptr));
95 
96 #else /* !FEATURE_NX_IPV6 */
97     NX_PARAMETER_NOT_USED(ip_ptr);
98 
99     return(NX_NOT_SUPPORTED);
100 
101 #endif /* FEATURE_NX_IPV6 */
102 }
103 
104