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 NX_CALLER_CHECKING_EXTERNS 32 33 /**************************************************************************/ 34 /* */ 35 /* FUNCTION RELEASE */ 36 /* */ 37 /* _nxe_ip_interface_address_mapping_configure PORTABLE C */ 38 /* 6.1 */ 39 /* AUTHOR */ 40 /* */ 41 /* Yuxin Zhou, Microsoft Corporation */ 42 /* */ 43 /* DESCRIPTION */ 44 /* */ 45 /* This function checks errors in the IP address mapping configure */ 46 /* function call. */ 47 /* */ 48 /* INPUT */ 49 /* */ 50 /* ip_ptr IP control block pointer */ 51 /* interface_index Index to the network interface*/ 52 /* mapping_needed Whether or not IP address to */ 53 /* MAC address mapping needed */ 54 /* */ 55 /* */ 56 /* OUTPUT */ 57 /* */ 58 /* status Completion status */ 59 /* */ 60 /* CALLS */ 61 /* */ 62 /* _nx_ip_interface_address_mapping_configure */ 63 /* */ 64 /* CALLED BY */ 65 /* */ 66 /* Application Code */ 67 /* */ 68 /* RELEASE HISTORY */ 69 /* */ 70 /* DATE NAME DESCRIPTION */ 71 /* */ 72 /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ 73 /* 09-30-2020 Yuxin Zhou Modified comment(s), */ 74 /* resulting in version 6.1 */ 75 /* */ 76 /**************************************************************************/ _nxe_ip_interface_address_mapping_configure(NX_IP * ip_ptr,UINT interface_index,UINT mapping_needed)77UINT _nxe_ip_interface_address_mapping_configure(NX_IP *ip_ptr, UINT interface_index, UINT mapping_needed) 78 { 79 80 UINT status; 81 82 /* Check for invalid input pointers. */ 83 if ((ip_ptr == NX_NULL) || (ip_ptr -> nx_ip_id != NX_IP_ID)) 84 { 85 return(NX_PTR_ERROR); 86 } 87 88 /* Check for invalid interface index */ 89 if (interface_index >= NX_MAX_PHYSICAL_INTERFACES) 90 { 91 return(NX_INVALID_INTERFACE); 92 } 93 94 /* Check for appropriate caller. */ 95 NX_INIT_AND_THREADS_CALLER_CHECKING 96 97 status = _nx_ip_interface_address_mapping_configure(ip_ptr, interface_index, mapping_needed); 98 99 /* Return completion status. */ 100 return(status); 101 } 102 103