TianoCore EDK2 master
Loading...
Searching...
No Matches
Mtftp6Wrq.c File Reference
#include "Mtftp6Impl.h"

Go to the source code of this file.

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)
 

Detailed Description

Mtftp6 Wrq process functions implementation.

Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Mtftp6Wrq.c.

Function Documentation

◆ Mtftp6WrqHandleAck()

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.

Parameters
[in]InstanceThe pointer to the Mtftp6 instance.
[in]PacketThe pointer to the received packet.
[in]LenThe length of the packet.
[out]UdpPacketThe net buf of received packet.
[out]IsCompletedIf TRUE, the upload has been completed. Otherwise, the upload has not been completed.
Return values
EFI_SUCCESSThe ACK packet successfully processed.
EFI_TFTP_ERRORThe block number loops back.
OthersFailed to transmit the next data packet.

Definition at line 137 of file Mtftp6Wrq.c.

◆ Mtftp6WrqHandleOack()

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.

Parameters
[in]InstanceThe pointer to the Mtftp6 instance.
[in]PacketThe pointer to the received packet.
[in]LenThe length of the packet.
[out]UdpPacketThe net buf of received packet.
[out]IsCompletedIf TRUE, the upload has been completed. Otherwise, the upload has not been completed.
Return values
EFI_SUCCESSThe OACK packet successfully processed.
EFI_TFTP_ERRORAn TFTP communication error happened.
OthersFailed to process the OACK packet.

Definition at line 270 of file Mtftp6Wrq.c.

◆ 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.

Parameters
[in]UdpPacketThe pointer to the packet received.
[in]UdpEptThe pointer to the Udp6 access point.
[in]IoStatusThe status from Udp6 instance.
[in]ContextThe pointer to the context.

Definition at line 372 of file Mtftp6Wrq.c.

◆ Mtftp6WrqOackValid()

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.
Parameters
[in]ReplyInfoThe pointer to options information in reply packet.
[in]RequestInfoThe pointer to requested options information.
Return values
TRUEIf the option in OACK is valid.
FALSEIf the option is invalid.

Definition at line 228 of file Mtftp6Wrq.c.

◆ Mtftp6WrqSendBlock()

EFI_STATUS Mtftp6WrqSendBlock ( IN MTFTP6_INSTANCE Instance,
IN UINT16  BlockNum 
)

Build and send a Mtftp6 data packet for upload.

Parameters
[in]InstanceThe pointer to the Mtftp6 instance.
[in]BlockNumThe block num to be sent.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate memory for the packet.
EFI_SUCCESSThe data packet was sent.
EFI_ABORTEDThe user aborted this process.

Definition at line 24 of file Mtftp6Wrq.c.

◆ Mtftp6WrqStart()

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.

Parameters
[in]InstanceThe pointer to the Mtftp6 instance.
[in]OperationThe operation code of the current packet.
Return values
EFI_SUCCESSThe Mtftp6 was started to upload.
OthersFailed to start to upload.

Definition at line 561 of file Mtftp6Wrq.c.