TianoCore EDK2 master
|
#include "Mtftp4Impl.h"
Go to the source code of this file.
Functions | |
EFI_STATUS | Mtftp4WrqSendBlock (IN OUT MTFTP4_PROTOCOL *Instance, IN UINT16 BlockNum) |
EFI_STATUS | Mtftp4WrqHandleAck (IN MTFTP4_PROTOCOL *Instance, IN EFI_MTFTP4_PACKET *Packet, IN UINT32 Len, OUT BOOLEAN *Completed) |
BOOLEAN | Mtftp4WrqOackValid (IN MTFTP4_OPTION *Reply, IN MTFTP4_OPTION *Request) |
EFI_STATUS | Mtftp4WrqHandleOack (IN OUT MTFTP4_PROTOCOL *Instance, IN EFI_MTFTP4_PACKET *Packet, IN UINT32 Len, OUT BOOLEAN *Completed) |
VOID EFIAPI | Mtftp4WrqInput (IN NET_BUF *UdpPacket, IN UDP_END_POINT *EndPoint, IN EFI_STATUS IoStatus, IN VOID *Context) |
EFI_STATUS | Mtftp4WrqStart (IN MTFTP4_PROTOCOL *Instance, IN UINT16 Operation) |
Routines to process Wrq (upload).
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Mtftp4Wrq.c.
EFI_STATUS Mtftp4WrqHandleAck | ( | IN MTFTP4_PROTOCOL * | Instance, |
IN EFI_MTFTP4_PACKET * | Packet, | ||
IN UINT32 | Len, | ||
OUT BOOLEAN * | Completed | ||
) |
Function to handle received ACK packet.
If the ACK number matches the expected block number, and there are more data pending, send the next block. Otherwise tell the caller that we are done.
Instance | The MTFTP upload session |
Packet | The MTFTP packet received |
Len | The packet length |
Completed | Return whether the upload has finished. |
EFI_SUCCESS | The ACK is successfully processed. |
EFI_TFTP_ERROR | The block number loops back. |
Others | Failed to transmit the next data packet. |
Definition at line 133 of file Mtftp4Wrq.c.
EFI_STATUS Mtftp4WrqHandleOack | ( | IN OUT MTFTP4_PROTOCOL * | Instance, |
IN EFI_MTFTP4_PACKET * | Packet, | ||
IN UINT32 | Len, | ||
OUT BOOLEAN * | Completed | ||
) |
Function to handle the MTFTP OACK packet.
It parses the packet's options, and update the internal states of the session.
Instance | The MTFTP session |
Packet | The received OACK packet |
Len | The length of the packet |
Completed | Whether the transmission has completed. NOT used by this function. |
EFI_SUCCESS | The OACK process is OK |
EFI_TFTP_ERROR | Some error occurred, and the session reset. |
Definition at line 249 of file Mtftp4Wrq.c.
VOID EFIAPI Mtftp4WrqInput | ( | IN NET_BUF * | UdpPacket, |
IN UDP_END_POINT * | EndPoint, | ||
IN EFI_STATUS | IoStatus, | ||
IN VOID * | Context | ||
) |
The input process routine for MTFTP upload.
UdpPacket | The received MTFTP packet. |
EndPoint | The local/remote access point |
IoStatus | The result of the packet receiving |
Context | Opaque parameter for the callback, which is the MTFTP session. |
Definition at line 330 of file Mtftp4Wrq.c.
BOOLEAN Mtftp4WrqOackValid | ( | IN MTFTP4_OPTION * | Reply, |
IN MTFTP4_OPTION * | Request | ||
) |
Check whether the received OACK is valid.
The OACK is valid only if:
Reply | The options included in the OACK |
Request | The options we requested |
TRUE | The options included in OACK is valid. |
FALSE | The options included in OACK is invalid. |
Definition at line 208 of file Mtftp4Wrq.c.
EFI_STATUS Mtftp4WrqSendBlock | ( | IN OUT MTFTP4_PROTOCOL * | Instance, |
IN UINT16 | BlockNum | ||
) |
Build then send a MTFTP data packet for the MTFTP upload session.
Instance | The MTFTP upload session. |
BlockNum | The block number to send. |
EFI_OUT_OF_RESOURCES | Failed to build the packet. |
EFI_ABORTED | The consumer of this child directs to abort the transmission by return an error through PacketNeeded. |
EFI_SUCCESS | The data is sent. |
Definition at line 24 of file Mtftp4Wrq.c.
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.
Instance | The MTFTP session |
Operation | Redundant parameter, which is always EFI_MTFTP4_OPCODE_WRQ here. |
EFI_SUCCESS | The upload process has been started. |
Others | Failed to start the upload. |
Definition at line 491 of file Mtftp4Wrq.c.