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

Go to the source code of this file.

Functions

EFI_STATUS Mtftp6RrqSendAck (IN MTFTP6_INSTANCE *Instance, IN UINT16 BlockNum)
 
EFI_STATUS Mtftp6RrqSaveBlock (IN MTFTP6_INSTANCE *Instance, IN EFI_MTFTP6_PACKET *Packet, IN UINT32 Len, OUT NET_BUF **UdpPacket)
 
EFI_STATUS Mtftp6RrqHandleData (IN MTFTP6_INSTANCE *Instance, IN EFI_MTFTP6_PACKET *Packet, IN UINT32 Len, OUT NET_BUF **UdpPacket, OUT BOOLEAN *IsCompleted)
 
BOOLEAN Mtftp6RrqOackValid (IN MTFTP6_INSTANCE *Instance, IN MTFTP6_EXT_OPTION_INFO *ReplyInfo, IN MTFTP6_EXT_OPTION_INFO *RequestInfo)
 
EFI_STATUS EFIAPI Mtftp6RrqConfigMcastUdpIo (IN UDP_IO *McastIo, IN VOID *Context)
 
EFI_STATUS Mtftp6RrqHandleOack (IN MTFTP6_INSTANCE *Instance, IN EFI_MTFTP6_PACKET *Packet, IN UINT32 Len, OUT NET_BUF **UdpPacket, OUT BOOLEAN *IsCompleted)
 
VOID EFIAPI Mtftp6RrqInput (IN NET_BUF *UdpPacket, IN UDP_END_POINT *UdpEpt, IN EFI_STATUS IoStatus, IN VOID *Context)
 
EFI_STATUS Mtftp6RrqStart (IN MTFTP6_INSTANCE *Instance, IN UINT16 Operation)
 

Detailed Description

Mtftp6 Rrq process functions implementation.

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

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

Definition in file Mtftp6Rrq.c.

Function Documentation

◆ Mtftp6RrqConfigMcastUdpIo()

EFI_STATUS EFIAPI Mtftp6RrqConfigMcastUdpIo ( IN UDP_IO McastIo,
IN VOID *  Context 
)

Configure Udp6Io to receive a packet from a multicast address.

Parameters
[in]McastIoThe pointer to the mcast Udp6Io.
[in]ContextThe pointer to the context.
Return values
EFI_SUCCESSThe mcast Udp6Io was successfully configured.
OthersFailed to configure the Udp6Io.

Definition at line 382 of file Mtftp6Rrq.c.

◆ Mtftp6RrqHandleData()

EFI_STATUS Mtftp6RrqHandleData ( IN MTFTP6_INSTANCE Instance,
IN EFI_MTFTP6_PACKET Packet,
IN UINT32  Len,
OUT NET_BUF **  UdpPacket,
OUT BOOLEAN *  IsCompleted 
)

Process the received data packets. It will save the block then send back an ACK if it is active.

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 download has been completed. Otherwise, the download has not been completed.
Return values
EFI_SUCCESSThe data packet was successfully processed.
EFI_ABORTEDThe download was aborted by the user.
EFI_BUFFER_TOO_SMALLThe user-provided buffer is too small.

Definition at line 212 of file Mtftp6Rrq.c.

◆ Mtftp6RrqHandleOack()

EFI_STATUS Mtftp6RrqHandleOack ( IN MTFTP6_INSTANCE Instance,
IN EFI_MTFTP6_PACKET Packet,
IN UINT32  Len,
OUT NET_BUF **  UdpPacket,
OUT BOOLEAN *  IsCompleted 
)

Process the OACK packet for Rrq.

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 download has been completed. Otherwise, the download has not been completed.
Return values
EFI_DEVICE_ERRORFailed to create/start a multicast Udp6 child.
EFI_TFTP_ERRORAn error happened during the process.
EFI_SUCCESSThe OACK packet successfully processed.

Definition at line 451 of file Mtftp6Rrq.c.

◆ Mtftp6RrqInput()

VOID EFIAPI Mtftp6RrqInput ( IN NET_BUF UdpPacket,
IN UDP_END_POINT UdpEpt,
IN EFI_STATUS  IoStatus,
IN VOID *  Context 
)

The packet process callback for Mtftp6 download.

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 670 of file Mtftp6Rrq.c.

◆ Mtftp6RrqOackValid()

BOOLEAN Mtftp6RrqOackValid ( IN MTFTP6_INSTANCE Instance,
IN MTFTP6_EXT_OPTION_INFO ReplyInfo,
IN MTFTP6_EXT_OPTION_INFO RequestInfo 
)

Validate whether the options received in the server's OACK packet is valid. The options are valid only if:

  1. The server doesn't include options not requested by us.
  2. The server can only use smaller blksize than that is requested.
  3. The server can only use the same timeout as requested.
  4. The server doesn't change its multicast channel.
Parameters
[in]InstanceThe pointer to the Mtftp6 instance.
[in]ReplyInfoThe pointer to options information in reply packet.
[in]RequestInfoThe pointer to requested options info.
Return values
TRUEIf the option in the OACK is valid.
FALSEIf the option is invalid.

Definition at line 322 of file Mtftp6Rrq.c.

◆ Mtftp6RrqSaveBlock()

EFI_STATUS Mtftp6RrqSaveBlock ( IN MTFTP6_INSTANCE Instance,
IN EFI_MTFTP6_PACKET Packet,
IN UINT32  Len,
OUT NET_BUF **  UdpPacket 
)

Deliver the received data block to the user, which can be saved in the user provide buffer or through the CheckPacket callback.

Parameters
[in]InstanceThe pointer to the Mtftp6 instance.
[in]PacketThe pointer to the received packet.
[in]LenThe packet length.
[out]UdpPacketThe net buf of the received packet.
Return values
EFI_SUCCESSThe data was saved successfully.
EFI_ABORTEDThe user tells to abort by return an error through CheckPacket.
EFI_BUFFER_TOO_SMALLThe user's buffer is too small, and buffer length is updated to the actual buffer size needed.

Definition at line 85 of file Mtftp6Rrq.c.

◆ Mtftp6RrqSendAck()

EFI_STATUS Mtftp6RrqSendAck ( IN MTFTP6_INSTANCE Instance,
IN UINT16  BlockNum 
)

Build and send a ACK packet for download.

Parameters
[in]InstanceThe pointer to the Mtftp6 instance.
[in]BlockNumThe block number to be acked.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate memory for the packet.
EFI_SUCCESSThe ACK has been sent.
OthersFailed to send the ACK.

Definition at line 24 of file Mtftp6Rrq.c.

◆ Mtftp6RrqStart()

EFI_STATUS Mtftp6RrqStart ( IN MTFTP6_INSTANCE Instance,
IN UINT16  Operation 
)

Start the Mtftp6 instance to download. It first initializes some of the internal states, then builds and sends an RRQ request packet. Finally, it starts receive for the downloading.

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

Definition at line 905 of file Mtftp6Rrq.c.