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