TianoCore EDK2 master
Loading...
Searching...
No Matches
Mtftp6Option.c File Reference
#include "Mtftp6Impl.h"

Go to the source code of this file.

Functions

EFI_STATUS Mtftp6ParseMcastOption (IN UINT8 *Str, IN MTFTP6_EXT_OPTION_INFO *ExtInfo)
 
EFI_STATUS Mtftp6ParseExtensionOption (IN EFI_MTFTP6_OPTION *Options, IN UINT32 Count, IN BOOLEAN IsRequest, IN UINT16 Operation, IN MTFTP6_EXT_OPTION_INFO *ExtInfo)
 
EFI_STATUS Mtftp6ParsePacketOption (IN EFI_MTFTP6_PACKET *Packet, IN UINT32 PacketLen, IN OUT UINT32 *Count, IN EFI_MTFTP6_OPTION *Options OPTIONAL)
 
EFI_STATUS Mtftp6ParseStart (IN EFI_MTFTP6_PACKET *Packet, IN UINT32 PacketLen, IN OUT UINT32 *OptionCount, OUT EFI_MTFTP6_OPTION **OptionList OPTIONAL)
 

Variables

CHAR8 * mMtftp6SupportedOptions [MTFTP6_SUPPORTED_OPTIONS_NUM]
 

Detailed Description

Mtftp6 option parse functions implementation.

Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Mtftp6Option.c.

Function Documentation

◆ Mtftp6ParseExtensionOption()

EFI_STATUS Mtftp6ParseExtensionOption ( IN EFI_MTFTP6_OPTION Options,
IN UINT32  Count,
IN BOOLEAN  IsRequest,
IN UINT16  Operation,
IN MTFTP6_EXT_OPTION_INFO ExtInfo 
)

Parse the MTFTP6 extension options.

Parameters
[in]OptionsThe pointer to the extension options list.
[in]CountThe num of the extension options.
[in]IsRequestIf FALSE, the extension options is included by a request packet.
[in]OperationThe current performed operation.
[in]ExtInfoThe pointer to the option information to be filled.
Return values
EFI_SUCCESSParse the multicast option successfully.
EFI_INVALID_PARAMETERThere is one option is malformatted at least.
EFI_UNSUPPORTEDThere is one option is not supported at least.

Definition at line 147 of file Mtftp6Option.c.

◆ Mtftp6ParseMcastOption()

EFI_STATUS Mtftp6ParseMcastOption ( IN UINT8 *  Str,
IN MTFTP6_EXT_OPTION_INFO ExtInfo 
)

Parse the NULL terminated ASCII string of multicast option.

Parameters
[in]StrThe pointer to the Ascii string of multicast option.
[in]ExtInfoThe pointer to the option information to be filled.
Return values
EFI_SUCCESSParse the multicast option successfully.
EFI_INVALID_PARAMETERThe string is malformatted.
EFI_OUT_OF_RESOURCESFailed to perform the operation due to lack of resources.

Definition at line 33 of file Mtftp6Option.c.

◆ Mtftp6ParsePacketOption()

EFI_STATUS Mtftp6ParsePacketOption ( IN EFI_MTFTP6_PACKET Packet,
IN UINT32  PacketLen,
IN OUT UINT32 *  Count,
IN EFI_MTFTP6_OPTION *Options  OPTIONAL 
)

Go through the packet to fill the options array with the start addresses of each MTFTP option name/value pair.

Parameters
[in]PacketThe packet to be checked.
[in]PacketLenThe length of the packet.
[in,out]CountThe num of the Options on input. The actual one on output.
[in]OptionsThe option array to be filled. It is optional.
Return values
EFI_SUCCESSThe packet has been parsed successfully.
EFI_INVALID_PARAMETERThe packet is malformatted.
EFI_BUFFER_TOO_SMALLThe Options array is too small.
EFI_PROTOCOL_ERRORAn unexpected MTFTPv6 packet was received.

Definition at line 260 of file Mtftp6Option.c.

◆ Mtftp6ParseStart()

EFI_STATUS Mtftp6ParseStart ( IN EFI_MTFTP6_PACKET Packet,
IN UINT32  PacketLen,
IN OUT UINT32 *  OptionCount,
OUT EFI_MTFTP6_OPTION **OptionList  OPTIONAL 
)

Go through the packet, generate option list array and fill it by the result of parse options.

Parameters
[in]PacketThe packet to be checked.
[in]PacketLenThe length of the packet.
[in,out]OptionCountThe num of the Options on input. The actual one on output.
[out]OptionListThe option list array to be generated and filled. It is optional.
Return values
EFI_SUCCESSThe packet has been parsed successfully.
EFI_INVALID_PARAMETERThe packet is malformatted.
EFI_PROTOCOL_ERRORThere is one option is malformatted at least.
EFI_NOT_FOUNDThe packet has no options.
EFI_OUT_OF_RESOURCESFailed to allocate memory for the array.
EFI_BUFFER_TOO_SMALLThe size of option list array is too small.

Definition at line 340 of file Mtftp6Option.c.

Variable Documentation

◆ mMtftp6SupportedOptions

CHAR8* mMtftp6SupportedOptions[MTFTP6_SUPPORTED_OPTIONS_NUM]
Initial value:
= {
"blksize",
"windowsize",
"timeout",
"tsize",
"multicast"
}

Definition at line 12 of file Mtftp6Option.c.