TianoCore EDK2 master
|
#include "Mtftp4Impl.h"
Go to the source code of this file.
Functions | |
VOID EFIAPI | Mtftp4RrqInput (IN NET_BUF *UdpPacket, IN UDP_END_POINT *EndPoint, IN EFI_STATUS IoStatus, IN VOID *Context) |
EFI_STATUS | Mtftp4RrqStart (IN MTFTP4_PROTOCOL *Instance, IN UINT16 Operation) |
EFI_STATUS | Mtftp4RrqSendAck (IN MTFTP4_PROTOCOL *Instance, IN UINT16 BlkNo) |
EFI_STATUS | Mtftp4RrqSaveBlock (IN OUT MTFTP4_PROTOCOL *Instance, IN EFI_MTFTP4_PACKET *Packet, IN UINT32 Len) |
EFI_STATUS | Mtftp4RrqHandleData (IN MTFTP4_PROTOCOL *Instance, IN EFI_MTFTP4_PACKET *Packet, IN UINT32 Len, IN BOOLEAN Multicast, OUT BOOLEAN *Completed) |
BOOLEAN | Mtftp4RrqOackValid (IN MTFTP4_PROTOCOL *This, IN MTFTP4_OPTION *Reply, IN MTFTP4_OPTION *Request) |
EFI_STATUS EFIAPI | Mtftp4RrqConfigMcastPort (IN UDP_IO *McastIo, IN VOID *Context) |
EFI_STATUS | Mtftp4RrqHandleOack (IN OUT MTFTP4_PROTOCOL *Instance, IN EFI_MTFTP4_PACKET *Packet, IN UINT32 Len, IN BOOLEAN Multicast, OUT BOOLEAN *Completed) |
Routines to process Rrq (download).
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Mtftp4Rrq.c.
EFI_STATUS EFIAPI Mtftp4RrqConfigMcastPort | ( | IN UDP_IO * | McastIo, |
IN VOID * | Context | ||
) |
Configure a UDP IO port to receive the multicast.
McastIo | The UDP IO to configure |
Context | The opaque parameter to the function which is the MTFTP session. |
EFI_SUCCESS | The UDP child is successfully configured. |
Others | Failed to configure the UDP child. |
Definition at line 396 of file Mtftp4Rrq.c.
EFI_STATUS Mtftp4RrqHandleData | ( | IN MTFTP4_PROTOCOL * | Instance, |
IN EFI_MTFTP4_PACKET * | Packet, | ||
IN UINT32 | Len, | ||
IN BOOLEAN | Multicast, | ||
OUT BOOLEAN * | Completed | ||
) |
Function to process the received data packets.
It will save the block then send back an ACK if it is active.
Instance | The downloading MTFTP session |
Packet | The packet received |
Len | The length of the packet |
Multicast | Whether this packet is multicast or unicast |
Completed | Return whether the download has completed |
EFI_SUCCESS | The data packet is successfully processed |
EFI_ABORTED | The download is aborted by the user |
EFI_BUFFER_TOO_SMALL | The user provided buffer is too small |
Definition at line 242 of file Mtftp4Rrq.c.
EFI_STATUS Mtftp4RrqHandleOack | ( | IN OUT MTFTP4_PROTOCOL * | Instance, |
IN EFI_MTFTP4_PACKET * | Packet, | ||
IN UINT32 | Len, | ||
IN BOOLEAN | Multicast, | ||
OUT BOOLEAN * | Completed | ||
) |
Function to process the OACK.
It will first validate the OACK packet, then update the various negotiated parameters.
Instance | The download MTFTP session |
Packet | The packet received |
Len | The packet length |
Multicast | Whether this packet is received as a multicast |
Completed | Returns whether the download has completed. NOT used by this function. |
EFI_DEVICE_ERROR | Failed to create/start a multicast UDP child |
EFI_TFTP_ERROR | Some error happened during the process |
EFI_SUCCESS | The OACK is successfully processed. |
Definition at line 483 of file Mtftp4Rrq.c.
VOID EFIAPI Mtftp4RrqInput | ( | IN NET_BUF * | UdpPacket, |
IN UDP_END_POINT * | EndPoint, | ||
IN EFI_STATUS | IoStatus, | ||
IN VOID * | Context | ||
) |
The packet process callback for MTFTP download.
UdpPacket | The packet received |
EndPoint | The local/remote access point of the packet |
IoStatus | The status of the receiving |
Context | Opaque parameter, which is the MTFTP session |
Definition at line 647 of file Mtftp4Rrq.c.
BOOLEAN Mtftp4RrqOackValid | ( | IN MTFTP4_PROTOCOL * | This, |
IN MTFTP4_OPTION * | Reply, | ||
IN MTFTP4_OPTION * | Request | ||
) |
Validate whether the options received in the server's OACK packet is valid.
The options are valid only if:
This | The downloading Mtftp session |
Reply | The options in the OACK packet |
Request | The requested options |
TRUE | The options in the OACK is OK. |
FALSE | The options in the OACK is invalid. |
Definition at line 340 of file Mtftp4Rrq.c.
EFI_STATUS Mtftp4RrqSaveBlock | ( | IN OUT MTFTP4_PROTOCOL * | Instance, |
IN EFI_MTFTP4_PACKET * | Packet, | ||
IN UINT32 | Len | ||
) |
Deliver the received data block to the user, which can be saved in the user provide buffer or through the CheckPacket callback.
Instance | The Mtftp session |
Packet | The received data packet |
Len | The packet length |
EFI_SUCCESS | The data is saved successfully |
EFI_ABORTED | The user tells to abort by return an error through CheckPacket |
EFI_BUFFER_TOO_SMALL | The user's buffer is too small and buffer length is updated to the actual buffer size needed. |
Definition at line 135 of file Mtftp4Rrq.c.
EFI_STATUS Mtftp4RrqSendAck | ( | IN MTFTP4_PROTOCOL * | Instance, |
IN UINT16 | BlkNo | ||
) |
Build and send a ACK packet for the download session.
Instance | The Mtftp session |
BlkNo | The BlkNo to ack. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory for the packet |
EFI_SUCCESS | The ACK has been sent |
Others | Failed to send the ACK. |
Definition at line 85 of file Mtftp4Rrq.c.
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.
Instance | The Mtftp session |
Operation | The MTFTP opcode, it may be a EFI_MTFTP4_OPCODE_RRQ or EFI_MTFTP4_OPCODE_DIR. |
EFI_SUCCESS | The mtftp download session is started. |
Others | Failed to start downloading. |
Definition at line 45 of file Mtftp4Rrq.c.