NetworkPkg/Mtftp6Dxe: Support windowsize in read request operation.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886

This patch is to support the TFTP windowsize option described in RFC 7440.
The feature allows the client and server to negotiate a window size of
consecutive blocks to send as an alternative for replacing the single-block
lockstep schema.

Currently, the windowsize for write request operation is not supported since
there is no real use cases.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Shao Ming <ming.shao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
Jiaxin Wu
2018-09-14 15:47:52 +08:00
parent 6c047cfab1
commit f3427f12a4
6 changed files with 90 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Mtftp6 option parse functions declaration.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -26,7 +26,7 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#define MTFTP6_SUPPORTED_OPTIONS_NUM 4
#define MTFTP6_SUPPORTED_OPTIONS_NUM 5
#define MTFTP6_OPCODE_LEN 2
#define MTFTP6_ERRCODE_LEN 2
#define MTFTP6_BLKNO_LEN 2
@@ -39,11 +39,13 @@
#define MTFTP6_OPT_TIMEOUT_BIT 0x02
#define MTFTP6_OPT_TSIZE_BIT 0x04
#define MTFTP6_OPT_MCAST_BIT 0x08
#define MTFTP6_OPT_WINDOWSIZE_BIT 0X10
extern CHAR8 *mMtftp6SupportedOptions[MTFTP6_SUPPORTED_OPTIONS_NUM];
typedef struct {
UINT16 BlkSize;
UINT16 WindowSize;
UINT8 Timeout;
UINT32 Tsize;
EFI_IPv6_ADDRESS McastIp;
@@ -76,11 +78,12 @@ Mtftp6ParseMcastOption (
@param[in] Count The num of the extension options.
@param[in] IsRequest If FALSE, the extension options is included
by a request packet.
@param[in] Operation The current performed operation.
@param[in] ExtInfo The pointer to the option information to be filled.
@retval EFI_SUCCESS Parse the multi-cast option successfully.
@retval EFI_INVALID_PARAMETER An option is malformatted.
@retval EFI_UNSUPPORTED An option is not supported.
@retval EFI_SUCCESS Parse the multicast option successfully.
@retval EFI_INVALID_PARAMETER There is one option is malformatted at least.
@retval EFI_UNSUPPORTED There is one option is not supported at least.
**/
EFI_STATUS
@@ -88,6 +91,7 @@ Mtftp6ParseExtensionOption (
IN EFI_MTFTP6_OPTION *Options,
IN UINT32 Count,
IN BOOLEAN IsRequest,
IN UINT16 Operation,
IN MTFTP6_EXT_OPTION_INFO *ExtInfo
);