Functions | |
EFI_STATUS | Mtftp6WrqSendBlock (IN MTFTP6_INSTANCE *Instance, IN UINT16 BlockNum) |
EFI_STATUS | Mtftp6WrqHandleAck (IN MTFTP6_INSTANCE *Instance, IN EFI_MTFTP6_PACKET *Packet, IN UINT32 Len, OUT NET_BUF **UdpPacket, OUT BOOLEAN *IsCompleted) |
BOOLEAN | Mtftp6WrqOackValid (IN MTFTP6_EXT_OPTION_INFO *ReplyInfo, IN MTFTP6_EXT_OPTION_INFO *RequestInfo) |
EFI_STATUS | Mtftp6WrqHandleOack (IN MTFTP6_INSTANCE *Instance, IN EFI_MTFTP6_PACKET *Packet, IN UINT32 Len, OUT NET_BUF **UdpPacket, OUT BOOLEAN *IsCompleted) |
VOID EFIAPI | Mtftp6WrqInput (IN NET_BUF *UdpPacket, IN UDP_END_POINT *UdpEpt, IN EFI_STATUS IoStatus, IN VOID *Context) |
EFI_STATUS | Mtftp6WrqStart (IN MTFTP6_INSTANCE *Instance, IN UINT16 Operation) |
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
EFI_STATUS Mtftp6WrqHandleAck | ( | IN MTFTP6_INSTANCE * | Instance, | |
IN EFI_MTFTP6_PACKET * | Packet, | |||
IN UINT32 | Len, | |||
OUT NET_BUF ** | UdpPacket, | |||
OUT BOOLEAN * | IsCompleted | |||
) |
Function to handle received ACK packet. If the ACK number matches the expected block number, with more data pending, send the next block. Otherwise, tell the caller that we are done.
[in] | Instance | The pointer to the Mtftp6 instance. |
[in] | Packet | The pointer to the received packet. |
[in] | Len | The length of the packet. |
[out] | UdpPacket | The net buf of received packet. |
[out] | IsCompleted | If TRUE, the upload has been completed. Otherwise, the upload has not been completed. |
EFI_SUCCESS | The ACK packet successfully processed. | |
EFI_TFTP_ERROR | The block number loops back. | |
Others | Failed to transmit the next data packet. |
References Mtftp6GetNextBlockNum(), Mtftp6RemoveBlockNum(), Mtftp6SendError(), and Mtftp6WrqSendBlock().
Referenced by Mtftp6WrqHandleOack(), and Mtftp6WrqInput().
EFI_STATUS Mtftp6WrqHandleOack | ( | IN MTFTP6_INSTANCE * | Instance, | |
IN EFI_MTFTP6_PACKET * | Packet, | |||
IN UINT32 | Len, | |||
OUT NET_BUF ** | UdpPacket, | |||
OUT BOOLEAN * | IsCompleted | |||
) |
Process the OACK packet for Wrq.
[in] | Instance | The pointer to the Mtftp6 instance. |
[in] | Packet | The pointer to the received packet. |
[in] | Len | The length of the packet. |
[out] | UdpPacket | The net buf of received packet. |
[out] | IsCompleted | If TRUE, the upload has been completed. Otherwise, the upload has not been completed. |
EFI_SUCCESS | The OACK packet successfully processed. | |
EFI_TFTP_ERROR | An TFTP communication error happened. | |
Others | Failed to process the OACK packet. |
References MTFTP6_EXT_OPTION_INFO::BlkSize, Mtftp6GetNextBlockNum(), Mtftp6ParseExtensionOption(), Mtftp6ParseStart(), Mtftp6SendError(), Mtftp6WrqHandleAck(), Mtftp6WrqOackValid(), and MTFTP6_EXT_OPTION_INFO::Timeout.
Referenced by Mtftp6WrqInput().
VOID EFIAPI Mtftp6WrqInput | ( | IN NET_BUF * | UdpPacket, | |
IN UDP_END_POINT * | UdpEpt, | |||
IN EFI_STATUS | IoStatus, | |||
IN VOID * | Context | |||
) |
The packet process callback for Mtftp6 upload.
[in] | UdpPacket | The pointer to the packet received. |
[in] | UdpEpt | The pointer to the Udp6 access point. |
[in] | IoStatus | The status from Udp6 instance. |
[in] | Context | The pointer to the context. |
References _MTFTP6_INSTANCE::Mtftp6, MTFTP6_BLKNO_LEN, MTFTP6_INSTANCE_SIGNATURE, MTFTP6_OPCODE_LEN, Mtftp6OperationClean(), Mtftp6SendError(), Mtftp6WrqHandleAck(), Mtftp6WrqHandleOack(), Mtftp6WrqInput(), _MTFTP6_INSTANCE::ServerDataPort, _MTFTP6_INSTANCE::Token, and _MTFTP6_INSTANCE::UdpIo.
Referenced by Mtftp6WrqInput(), and Mtftp6WrqStart().
BOOLEAN Mtftp6WrqOackValid | ( | IN MTFTP6_EXT_OPTION_INFO * | ReplyInfo, | |
IN MTFTP6_EXT_OPTION_INFO * | RequestInfo | |||
) |
Check whether the received OACK is valid. The OACK is valid only if: 1. It only include options requested by us. 2. It can only include a smaller block size. 3. It can't change the proposed time out value. 4. Other requirements of the individal MTFTP6 options as required.
[in] | ReplyInfo | The pointer to options information in reply packet. |
[in] | RequestInfo | The pointer to requested options information. |
TRUE | If the option in OACK is valid. | |
FALSE | If the option is invalid. |
References MTFTP6_OPT_BLKSIZE_BIT, and MTFTP6_OPT_TIMEOUT_BIT.
Referenced by Mtftp6WrqHandleOack().
EFI_STATUS Mtftp6WrqSendBlock | ( | IN MTFTP6_INSTANCE * | Instance, | |
IN UINT16 | BlockNum | |||
) |
Build and send a Mtftp6 data packet for upload.
[in] | Instance | The pointer to the Mtftp6 instance. |
[in] | BlockNum | The block num to be sent. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory for the packet. | |
EFI_SUCCESS | The data packet was sent. | |
EFI_ABORTED | The user aborted this process. |
References MTFTP6_DATA_HEAD_LEN, Mtftp6SendError(), Mtftp6SetLastBlockNum(), and Mtftp6TransmitPacket().
Referenced by Mtftp6WrqHandleAck().
EFI_STATUS Mtftp6WrqStart | ( | IN MTFTP6_INSTANCE * | Instance, | |
IN UINT16 | Operation | |||
) |
Start the Mtftp6 instance to upload. It will first init some states, then send the WRQ request packet, and start to receive the packet.
[in] | Instance | The pointer to the Mtftp6 instance. |
[in] | Operation | The operation code of the current packet. |
EFI_SUCCESS | The Mtftp6 was started to upload. | |
Others | Failed to start to upload. |
References Mtftp6InitBlockRange(), Mtftp6SendRequest(), and Mtftp6WrqInput().
Referenced by Mtftp6OperationStart().