/** @file\r
Routines to process MTFTP4 options.\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php<BR>\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
\r
CHAR8 *mMtftp4SupportedOptions[MTFTP4_SUPPORTED_OPTIONS] = {\r
"blksize",\r
+ "windowsize",\r
"timeout",\r
"tsize",\r
"multicast"\r
@param Count The number of options in the Options\r
@param Request Whether this is a request or OACK. The format of\r
multicast is different according to this setting.\r
+ @param Operation The current performed operation.\r
@param MtftpOption The MTFTP4_OPTION for easy access.\r
\r
@retval EFI_INVALID_PARAMETER The option is mal-formated\r
IN EFI_MTFTP4_OPTION *Options,\r
IN UINT32 Count,\r
IN BOOLEAN Request,\r
+ IN UINT16 Operation,\r
OUT MTFTP4_OPTION *MtftpOption\r
)\r
{\r
\r
MtftpOption->Exist |= MTFTP4_MCAST_EXIST;\r
\r
+ } else if (NetStringEqualNoCase (This->OptionStr, (UINT8 *) "windowsize")) {\r
+ if (Operation == EFI_MTFTP4_OPCODE_WRQ) {\r
+ //\r
+ // Currently, windowsize is not supported in the write operation.\r
+ //\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
+ Value = NetStringToU32 (This->ValueStr);\r
+\r
+ if (Value < 1) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ MtftpOption->WindowSize = (UINT16) Value;\r
+ MtftpOption->Exist |= MTFTP4_WINDOWSIZE_EXIST;\r
} else if (Request) {\r
//\r
// Ignore the unsupported option if it is a reply, and return\r
\r
@param Packet The OACK packet to parse\r
@param PacketLen The length of the packet\r
+ @param Operation The current performed operation.\r
@param MtftpOption The MTFTP_OPTION for easy access.\r
\r
@retval EFI_INVALID_PARAMETER The packet option is mal-formated\r
Mtftp4ParseOptionOack (\r
IN EFI_MTFTP4_PACKET *Packet,\r
IN UINT32 PacketLen,\r
+ IN UINT16 Operation,\r
OUT MTFTP4_OPTION *MtftpOption\r
)\r
{\r
}\r
ASSERT (OptionList != NULL);\r
\r
- Status = Mtftp4ParseOption (OptionList, Count, FALSE, MtftpOption);\r
+ Status = Mtftp4ParseOption (OptionList, Count, FALSE, Operation, MtftpOption);\r
\r
FreePool (OptionList);\r
return Status;\r