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_mtu_set 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 mtu size set function call. */ 46 /* */ 47 /* INPUT */ 48 /* */ 49 /* ip_ptr IP control block pointer */ 50 /* interface_index Index to the network interface*/ 51 /* mtu_size IP MTU size, in bytes */ 52 /* */ 53 /* OUTPUT */ 54 /* */ 55 /* status Completion status */ 56 /* */ 57 /* CALLS */ 58 /* */ 59 /* _nx_ip_interface_mtu_set */ 60 /* */ 61 /* CALLED BY */ 62 /* */ 63 /* Application Code */ 64 /* */ 65 /* RELEASE HISTORY */ 66 /* */ 67 /* DATE NAME DESCRIPTION */ 68 /* */ 69 /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ 70 /* 09-30-2020 Yuxin Zhou Modified comment(s), */ 71 /* resulting in version 6.1 */ 72 /* */ 73 /**************************************************************************/ _nxe_ip_interface_mtu_set(NX_IP * ip_ptr,UINT interface_index,ULONG mtu_size)74UINT _nxe_ip_interface_mtu_set(NX_IP *ip_ptr, UINT interface_index, ULONG mtu_size) 75 { 76 77 UINT status; 78 79 /* Check for invalid input pointers. */ 80 if ((ip_ptr == NX_NULL) || (ip_ptr -> nx_ip_id != NX_IP_ID)) 81 { 82 return(NX_PTR_ERROR); 83 } 84 85 /* Check for invalid interface index. */ 86 if (interface_index >= NX_MAX_PHYSICAL_INTERFACES) 87 { 88 return(NX_INVALID_INTERFACE); 89 } 90 91 /* Check for appropriate caller. */ 92 NX_INIT_AND_THREADS_CALLER_CHECKING 93 94 status = _nx_ip_interface_mtu_set(ip_ptr, interface_index, mtu_size); 95 96 /* Return completion status. */ 97 return(status); 98 } 99 100