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

Go to the source code of this file.

Data Structures

struct  _MTFTP4_SERVICE
 
struct  MTFTP4_GETINFO_STATE
 
struct  _MTFTP4_PROTOCOL
 
struct  MTFTP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT
 

Macros

#define MTFTP4_SERVICE_SIGNATURE   SIGNATURE_32 ('T', 'F', 'T', 'P')
 
#define MTFTP4_PROTOCOL_SIGNATURE   SIGNATURE_32 ('t', 'f', 't', 'p')
 
#define MTFTP4_DEFAULT_SERVER_PORT   69
 
#define MTFTP4_DEFAULT_TIMEOUT   3
 
#define MTFTP4_DEFAULT_RETRY   5
 
#define MTFTP4_DEFAULT_BLKSIZE   512
 
#define MTFTP4_DEFAULT_WINDOWSIZE   1
 
#define MTFTP4_TIME_TO_GETMAP   5
 
#define MTFTP4_STATE_UNCONFIGED   0
 
#define MTFTP4_STATE_CONFIGED   1
 
#define MTFTP4_STATE_DESTROY   2
 
#define MTFTP4_SERVICE_FROM_THIS(a)    CR (a, MTFTP4_SERVICE, ServiceBinding, MTFTP4_SERVICE_SIGNATURE)
 
#define MTFTP4_PROTOCOL_FROM_THIS(a)    CR (a, MTFTP4_PROTOCOL, Mtftp4, MTFTP4_PROTOCOL_SIGNATURE)
 

Typedefs

typedef struct _MTFTP4_SERVICE MTFTP4_SERVICE
 
typedef struct _MTFTP4_PROTOCOL MTFTP4_PROTOCOL
 

Functions

VOID Mtftp4CleanOperation (IN OUT MTFTP4_PROTOCOL *Instance, IN EFI_STATUS Result)
 
EFI_STATUS Mtftp4WrqStart (IN MTFTP4_PROTOCOL *Instance, IN UINT16 Operation)
 
EFI_STATUS Mtftp4RrqStart (IN MTFTP4_PROTOCOL *Instance, IN UINT16 Operation)
 

Variables

EFI_MTFTP4_PROTOCOL gMtftp4ProtocolTemplate
 

Detailed Description

Mtftp4 Implementation.

Mtftp4 Implementation, it supports the following RFCs: RFC1350 - THE TFTP PROTOCOL (REVISION 2) RFC2090 - TFTP Multicast Option RFC2347 - TFTP Option Extension RFC2348 - TFTP Blocksize Option RFC2349 - TFTP Timeout Interval and Transfer Size Options RFC7440 - TFTP Windowsize Option

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

Definition in file Mtftp4Impl.h.

Macro Definition Documentation

◆ MTFTP4_DEFAULT_BLKSIZE

#define MTFTP4_DEFAULT_BLKSIZE   512

Definition at line 51 of file Mtftp4Impl.h.

◆ MTFTP4_DEFAULT_RETRY

#define MTFTP4_DEFAULT_RETRY   5

Definition at line 50 of file Mtftp4Impl.h.

◆ MTFTP4_DEFAULT_SERVER_PORT

#define MTFTP4_DEFAULT_SERVER_PORT   69

Definition at line 48 of file Mtftp4Impl.h.

◆ MTFTP4_DEFAULT_TIMEOUT

#define MTFTP4_DEFAULT_TIMEOUT   3

Definition at line 49 of file Mtftp4Impl.h.

◆ MTFTP4_DEFAULT_WINDOWSIZE

#define MTFTP4_DEFAULT_WINDOWSIZE   1

Definition at line 52 of file Mtftp4Impl.h.

◆ MTFTP4_PROTOCOL_FROM_THIS

#define MTFTP4_PROTOCOL_FROM_THIS (   a)     CR (a, MTFTP4_PROTOCOL, Mtftp4, MTFTP4_PROTOCOL_SIGNATURE)

Definition at line 220 of file Mtftp4Impl.h.

◆ MTFTP4_PROTOCOL_SIGNATURE

#define MTFTP4_PROTOCOL_SIGNATURE   SIGNATURE_32 ('t', 'f', 't', 'p')

Definition at line 46 of file Mtftp4Impl.h.

◆ MTFTP4_SERVICE_FROM_THIS

#define MTFTP4_SERVICE_FROM_THIS (   a)     CR (a, MTFTP4_SERVICE, ServiceBinding, MTFTP4_SERVICE_SIGNATURE)

Definition at line 217 of file Mtftp4Impl.h.

◆ MTFTP4_SERVICE_SIGNATURE

#define MTFTP4_SERVICE_SIGNATURE   SIGNATURE_32 ('T', 'F', 'T', 'P')

Some constant value of Mtftp service.

Definition at line 45 of file Mtftp4Impl.h.

◆ MTFTP4_STATE_CONFIGED

#define MTFTP4_STATE_CONFIGED   1

Definition at line 56 of file Mtftp4Impl.h.

◆ MTFTP4_STATE_DESTROY

#define MTFTP4_STATE_DESTROY   2

Definition at line 57 of file Mtftp4Impl.h.

◆ MTFTP4_STATE_UNCONFIGED

#define MTFTP4_STATE_UNCONFIGED   0

Definition at line 55 of file Mtftp4Impl.h.

◆ MTFTP4_TIME_TO_GETMAP

#define MTFTP4_TIME_TO_GETMAP   5

Definition at line 53 of file Mtftp4Impl.h.

Typedef Documentation

◆ MTFTP4_PROTOCOL

Definition at line 36 of file Mtftp4Impl.h.

◆ MTFTP4_SERVICE

Definition at line 35 of file Mtftp4Impl.h.

Function Documentation

◆ Mtftp4CleanOperation()

VOID Mtftp4CleanOperation ( IN OUT MTFTP4_PROTOCOL Instance,
IN EFI_STATUS  Result 
)

Clean up the MTFTP session to get ready for new operation.

Parameters
InstanceThe MTFTP session to clean up
ResultThe result to return to the caller who initiated the operation.

Definition at line 20 of file Mtftp4Impl.c.

◆ Mtftp4RrqStart()

EFI_STATUS Mtftp4RrqStart ( IN MTFTP4_PROTOCOL Instance,
IN UINT16  Operation 
)

Start the MTFTP session to download.

It will first initialize some of the internal states then build and send a RRQ request packet, at last, it will start receive for the downloading.

Parameters
InstanceThe Mtftp session
OperationThe MTFTP opcode, it may be a EFI_MTFTP4_OPCODE_RRQ or EFI_MTFTP4_OPCODE_DIR.
Return values
EFI_SUCCESSThe mtftp download session is started.
OthersFailed to start downloading.

Definition at line 45 of file Mtftp4Rrq.c.

◆ Mtftp4WrqStart()

EFI_STATUS Mtftp4WrqStart ( IN MTFTP4_PROTOCOL Instance,
IN UINT16  Operation 
)

Start the MTFTP session for upload.

It will first init some states, then send the WRQ request packet, and start receiving the packet.

Parameters
InstanceThe MTFTP session
OperationRedundant parameter, which is always EFI_MTFTP4_OPCODE_WRQ here.
Return values
EFI_SUCCESSThe upload process has been started.
OthersFailed to start the upload.

Definition at line 491 of file Mtftp4Wrq.c.

Variable Documentation

◆ gMtftp4ProtocolTemplate

EFI_MTFTP4_PROTOCOL gMtftp4ProtocolTemplate
extern

Definition at line 1093 of file Mtftp4Impl.c.