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

Go to the source code of this file.

Data Structures

struct  MTFTP4_OPTION
 

Macros

#define MTFTP4_SUPPORTED_OPTIONS   5
 
#define MTFTP4_OPCODE_LEN   2
 
#define MTFTP4_ERRCODE_LEN   2
 
#define MTFTP4_BLKNO_LEN   2
 
#define MTFTP4_DATA_HEAD_LEN   4
 
#define MTFTP4_BLKSIZE_EXIST   0x01
 
#define MTFTP4_TIMEOUT_EXIST   0x02
 
#define MTFTP4_TSIZE_EXIST   0x04
 
#define MTFTP4_MCAST_EXIST   0x08
 
#define MTFTP4_WINDOWSIZE_EXIST   0x10
 

Functions

EFI_STATUS Mtftp4ExtractOptions (IN EFI_MTFTP4_PACKET *Packet, IN UINT32 PacketLen, OUT UINT32 *OptionCount, OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL)
 
EFI_STATUS Mtftp4ParseOption (IN EFI_MTFTP4_OPTION *Options, IN UINT32 Count, IN BOOLEAN Request, IN UINT16 Operation, OUT MTFTP4_OPTION *MtftpOption)
 
EFI_STATUS Mtftp4ParseOptionOack (IN EFI_MTFTP4_PACKET *Packet, IN UINT32 PacketLen, IN UINT16 Operation, OUT MTFTP4_OPTION *MtftpOption)
 

Variables

CHAR8 * mMtftp4SupportedOptions [MTFTP4_SUPPORTED_OPTIONS]
 

Detailed Description

Routines to process MTFTP4 options.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Mtftp4Option.h.

Macro Definition Documentation

◆ MTFTP4_BLKNO_LEN

#define MTFTP4_BLKNO_LEN   2

Definition at line 15 of file Mtftp4Option.h.

◆ MTFTP4_BLKSIZE_EXIST

#define MTFTP4_BLKSIZE_EXIST   0x01

Definition at line 18 of file Mtftp4Option.h.

◆ MTFTP4_DATA_HEAD_LEN

#define MTFTP4_DATA_HEAD_LEN   4

Definition at line 16 of file Mtftp4Option.h.

◆ MTFTP4_ERRCODE_LEN

#define MTFTP4_ERRCODE_LEN   2

Definition at line 14 of file Mtftp4Option.h.

◆ MTFTP4_MCAST_EXIST

#define MTFTP4_MCAST_EXIST   0x08

Definition at line 21 of file Mtftp4Option.h.

◆ MTFTP4_OPCODE_LEN

#define MTFTP4_OPCODE_LEN   2

Definition at line 13 of file Mtftp4Option.h.

◆ MTFTP4_SUPPORTED_OPTIONS

#define MTFTP4_SUPPORTED_OPTIONS   5

Definition at line 12 of file Mtftp4Option.h.

◆ MTFTP4_TIMEOUT_EXIST

#define MTFTP4_TIMEOUT_EXIST   0x02

Definition at line 19 of file Mtftp4Option.h.

◆ MTFTP4_TSIZE_EXIST

#define MTFTP4_TSIZE_EXIST   0x04

Definition at line 20 of file Mtftp4Option.h.

◆ MTFTP4_WINDOWSIZE_EXIST

#define MTFTP4_WINDOWSIZE_EXIST   0x10

Definition at line 22 of file Mtftp4Option.h.

Function Documentation

◆ Mtftp4ExtractOptions()

EFI_STATUS Mtftp4ExtractOptions ( IN EFI_MTFTP4_PACKET Packet,
IN UINT32  PacketLen,
OUT UINT32 *  OptionCount,
OUT EFI_MTFTP4_OPTION **OptionList  OPTIONAL 
)

Allocate and fill in a array of Mtftp options from the Packet.

It first calls Mtftp4FillOption to get the option number, then allocate the array, at last, call Mtftp4FillOption again to save the options.

Parameters
PacketThe packet to parse
PacketLenThe length of the packet
OptionCountThe number of options in the packet
OptionListThe point to get the option array.
Return values
EFI_INVALID_PARAMETERThe parametera are invalid or packet isn't a well-formatted OACK packet.
EFI_SUCCESSThe option array is build
EFI_OUT_OF_RESOURCESFailed to allocate memory for the array

Definition at line 234 of file Mtftp4Option.c.

◆ Mtftp4ParseOption()

EFI_STATUS Mtftp4ParseOption ( IN EFI_MTFTP4_OPTION Options,
IN UINT32  Count,
IN BOOLEAN  Request,
IN UINT16  Operation,
OUT MTFTP4_OPTION MtftpOption 
)

Parse the option in Options array to MTFTP4_OPTION which program can access directly.

Parameters
OptionsThe option array, which contains addresses of each option's name/value string.
CountThe number of options in the Options
RequestWhether this is a request or OACK. The format of multicast is different according to this setting.
OperationThe current performed operation.
MtftpOptionThe MTFTP4_OPTION for easy access.
Return values
EFI_INVALID_PARAMETERThe option is malformatted
EFI_UNSUPPORTEDSome option isn't supported
EFI_SUCCESSThe option are OK and has been parsed.

Definition at line 400 of file Mtftp4Option.c.

◆ Mtftp4ParseOptionOack()

EFI_STATUS Mtftp4ParseOptionOack ( IN EFI_MTFTP4_PACKET Packet,
IN UINT32  PacketLen,
IN UINT16  Operation,
OUT MTFTP4_OPTION MtftpOption 
)

Parse the options in the OACK packet to MTFTP4_OPTION which program can access directly.

Parameters
PacketThe OACK packet to parse
PacketLenThe length of the packet
OperationThe current performed operation.
MtftpOptionThe MTFTP_OPTION for easy access.
Return values
EFI_INVALID_PARAMETERThe packet option is malformatted
EFI_UNSUPPORTEDSome option isn't supported
EFI_SUCCESSThe option are OK and has been parsed.

Definition at line 512 of file Mtftp4Option.c.

Variable Documentation

◆ mMtftp4SupportedOptions

CHAR8* mMtftp4SupportedOptions[MTFTP4_SUPPORTED_OPTIONS]
extern

Definition at line 11 of file Mtftp4Option.c.