/** @file\r
Mtftp6 option parse functions implementation.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
CHAR8 *mMtftp6SupportedOptions[MTFTP6_SUPPORTED_OPTIONS_NUM] = {\r
"blksize",\r
+ "windowsize",\r
"timeout",\r
"tsize",\r
"multicast"\r
@param[in] Count The num of the extension options.\r
@param[in] IsRequest If FALSE, the extension options is included\r
by a request packet.\r
+ @param[in] Operation The current performed operation.\r
@param[in] ExtInfo The pointer to the option information to be filled.\r
\r
@retval EFI_SUCCESS Parse the multicast option successfully.\r
IN EFI_MTFTP6_OPTION *Options,\r
IN UINT32 Count,\r
IN BOOLEAN IsRequest,\r
+ IN UINT16 Operation,\r
IN MTFTP6_EXT_OPTION_INFO *ExtInfo\r
)\r
{\r
\r
ExtInfo->BitMap |= MTFTP6_OPT_MCAST_BIT;\r
\r
+ } else if (AsciiStriCmp ((CHAR8 *) Opt->OptionStr, "windowsize") == 0) {\r
+ if (Operation == EFI_MTFTP6_OPCODE_WRQ) {\r
+ //\r
+ // Currently, windowsize is not supported in the write operation.\r
+ //\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
+ Value = (UINT32) AsciiStrDecimalToUintn ((CHAR8 *) Opt->ValueStr);\r
+\r
+ if ((Value < 1)) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+\r
+ ExtInfo->WindowSize = (UINT16) Value;\r
+ ExtInfo->BitMap |= MTFTP6_OPT_WINDOWSIZE_BIT;\r
+\r
} else if (IsRequest) {\r
//\r
// If it's a request, unsupported; else if it's a reply, ignore.\r