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 Protocol (IP) */
18 /** */
19 /**************************************************************************/
20 /**************************************************************************/
21
22 #define NX_SOURCE_CODE
23
24
25 /* Include necessary system files. */
26
27 #include "nx_api.h"
28 #include "nx_ip.h"
29
30 /* Bring in externs for caller checking code. */
31
32 NX_CALLER_CHECKING_EXTERNS
33
34
35 /**************************************************************************/
36 /* */
37 /* FUNCTION RELEASE */
38 /* */
39 /* _nxe_ip_address_change_notify PORTABLE C */
40 /* 6.1 */
41 /* AUTHOR */
42 /* */
43 /* Yuxin Zhou, Microsoft Corporation */
44 /* */
45 /* DESCRIPTION */
46 /* */
47 /* This function checks for errors in the IP address change notify */
48 /* function call. */
49 /* */
50 /* INPUT */
51 /* */
52 /* ip_ptr IP control block pointer */
53 /* ip_address_change_notify Application callback function */
54 /* additional_info Optional additional information */
55 /* for the callback function */
56 /* */
57 /* OUTPUT */
58 /* */
59 /* status Completion status */
60 /* */
61 /* CALLS */
62 /* */
63 /* _nx_ip_address_change_notify Actual IP address change notify */
64 /* function */
65 /* */
66 /* CALLED BY */
67 /* */
68 /* Application Code */
69 /* */
70 /* RELEASE HISTORY */
71 /* */
72 /* DATE NAME DESCRIPTION */
73 /* */
74 /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */
75 /* 09-30-2020 Yuxin Zhou Modified comment(s), */
76 /* resulting in version 6.1 */
77 /* */
78 /**************************************************************************/
_nxe_ip_address_change_notify(NX_IP * ip_ptr,VOID (* ip_address_change_notify)(NX_IP *,VOID *),VOID * additional_info)79 UINT _nxe_ip_address_change_notify(NX_IP *ip_ptr, VOID (*ip_address_change_notify)(NX_IP *, VOID *), VOID *additional_info)
80 {
81
82 #ifndef NX_DISABLE_IPV4
83 UINT status;
84
85
86 /* Check for invalid input pointers. */
87 if ((ip_ptr == NX_NULL) || (ip_ptr -> nx_ip_id != NX_IP_ID))
88 {
89 return(NX_PTR_ERROR);
90 }
91
92 /* Check for appropriate caller. */
93 NX_INIT_AND_THREADS_CALLER_CHECKING
94
95 /* Call actual IP address change notify function. */
96 status = _nx_ip_address_change_notify(ip_ptr, ip_address_change_notify, additional_info);
97
98 /* Return completion status. */
99 return(status);
100 #else /* NX_DISABLE_IPV4 */
101 NX_PARAMETER_NOT_USED(ip_ptr);
102 NX_PARAMETER_NOT_USED(ip_address_change_notify);
103 NX_PARAMETER_NOT_USED(additional_info);
104
105 return(NX_NOT_SUPPORTED);
106 #endif /* !NX_DISABLE_IPV4 */
107 }
108
109