TianoCore EDK2 master
Loading...
Searching...
No Matches
Mtftp6Option.h File Reference

Go to the source code of this file.

Data Structures

struct  MTFTP6_EXT_OPTION_INFO
 

Macros

#define MTFTP6_SUPPORTED_OPTIONS_NUM   5
 
#define MTFTP6_OPCODE_LEN   2
 
#define MTFTP6_ERRCODE_LEN   2
 
#define MTFTP6_BLKNO_LEN   2
 
#define MTFTP6_DATA_HEAD_LEN   4
 
#define MTFTP6_OPT_BLKSIZE_BIT   0x01
 
#define MTFTP6_OPT_TIMEOUT_BIT   0x02
 
#define MTFTP6_OPT_TSIZE_BIT   0x04
 
#define MTFTP6_OPT_MCAST_BIT   0x08
 
#define MTFTP6_OPT_WINDOWSIZE_BIT   0X10
 

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 declaration.

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

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

Definition in file Mtftp6Option.h.

Macro Definition Documentation

◆ MTFTP6_BLKNO_LEN

#define MTFTP6_BLKNO_LEN   2

Definition at line 26 of file Mtftp6Option.h.

◆ MTFTP6_DATA_HEAD_LEN

#define MTFTP6_DATA_HEAD_LEN   4

Definition at line 27 of file Mtftp6Option.h.

◆ MTFTP6_ERRCODE_LEN

#define MTFTP6_ERRCODE_LEN   2

Definition at line 25 of file Mtftp6Option.h.

◆ MTFTP6_OPCODE_LEN

#define MTFTP6_OPCODE_LEN   2

Definition at line 24 of file Mtftp6Option.h.

◆ MTFTP6_OPT_BLKSIZE_BIT

#define MTFTP6_OPT_BLKSIZE_BIT   0x01

Definition at line 32 of file Mtftp6Option.h.

◆ MTFTP6_OPT_MCAST_BIT

#define MTFTP6_OPT_MCAST_BIT   0x08

Definition at line 35 of file Mtftp6Option.h.

◆ MTFTP6_OPT_TIMEOUT_BIT

#define MTFTP6_OPT_TIMEOUT_BIT   0x02

Definition at line 33 of file Mtftp6Option.h.

◆ MTFTP6_OPT_TSIZE_BIT

#define MTFTP6_OPT_TSIZE_BIT   0x04

Definition at line 34 of file Mtftp6Option.h.

◆ MTFTP6_OPT_WINDOWSIZE_BIT

#define MTFTP6_OPT_WINDOWSIZE_BIT   0X10

Definition at line 36 of file Mtftp6Option.h.

◆ MTFTP6_SUPPORTED_OPTIONS_NUM

#define MTFTP6_SUPPORTED_OPTIONS_NUM   5

Definition at line 23 of file Mtftp6Option.h.

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 Ascii string of multi-cast option.

Parameters
[in]StrThe pointer to the Ascii string of multi-cast 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.

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's 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.

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_ERRORAn option is malformatted.
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.

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]
extern

Definition at line 12 of file Mtftp6Option.c.