TianoCore EDK2 master
Loading...
Searching...
No Matches
Mtftp4Impl.c
Go to the documentation of this file.
1
10#include "Mtftp4Impl.h"
11
19VOID
21 IN OUT MTFTP4_PROTOCOL *Instance,
22 IN EFI_STATUS Result
23 )
24{
25 LIST_ENTRY *Entry;
26 LIST_ENTRY *Next;
27 MTFTP4_BLOCK_RANGE *Block;
28 EFI_MTFTP4_TOKEN *Token;
29
30 //
31 // Free various resources.
32 //
33 Token = Instance->Token;
34
35 if (Token != NULL) {
36 Token->Status = Result;
37
38 if (Token->Event != NULL) {
39 gBS->SignalEvent (Token->Event);
40 }
41
42 Instance->Token = NULL;
43 }
44
45 ASSERT (Instance->UnicastPort != NULL);
46 UdpIoCleanIo (Instance->UnicastPort);
47
48 if (Instance->LastPacket != NULL) {
49 NetbufFree (Instance->LastPacket);
50 Instance->LastPacket = NULL;
51 }
52
53 if (Instance->McastUdpPort != NULL) {
54 gBS->CloseProtocol (
55 Instance->McastUdpPort->UdpHandle,
56 &gEfiUdp4ProtocolGuid,
57 gMtftp4DriverBinding.DriverBindingHandle,
58 Instance->Handle
59 );
60 UdpIoFreeIo (Instance->McastUdpPort);
61 Instance->McastUdpPort = NULL;
62 }
63
64 NET_LIST_FOR_EACH_SAFE (Entry, Next, &Instance->Blocks) {
65 Block = NET_LIST_USER_STRUCT (Entry, MTFTP4_BLOCK_RANGE, Link);
66 RemoveEntryList (Entry);
67 FreePool (Block);
68 }
69
70 ZeroMem (&Instance->RequestOption, sizeof (MTFTP4_OPTION));
71
72 Instance->Operation = 0;
73
74 Instance->BlkSize = MTFTP4_DEFAULT_BLKSIZE;
75 Instance->WindowSize = 1;
76 Instance->TotalBlock = 0;
77 Instance->AckedBlock = 0;
78 Instance->LastBlock = 0;
79 Instance->ServerIp = 0;
80 Instance->ListeningPort = 0;
81 Instance->ConnectedPort = 0;
82 Instance->Gateway = 0;
83 Instance->PacketToLive = 0;
84 Instance->MaxRetry = 0;
85 Instance->CurRetry = 0;
86 Instance->Timeout = 0;
87 Instance->McastIp = 0;
88 Instance->McastPort = 0;
89 Instance->Master = TRUE;
90}
91
107EFIAPI
110 IN EFI_MTFTP4_TOKEN *Token,
111 IN UINT16 PacketLen,
112 IN EFI_MTFTP4_PACKET *Packet
113 )
114{
116 EFI_STATUS Status;
117 UINT16 OpCode;
118 EFI_MTFTP4_ERROR_HEADER *ErrorHeader;
119
120 State = (MTFTP4_GETINFO_STATE *)Token->Context;
121 OpCode = NTOHS (Packet->OpCode);
122
123 //
124 // Set the GetInfo's return status according to the OpCode.
125 //
126 switch (OpCode) {
127 case EFI_MTFTP4_OPCODE_ERROR:
128 ErrorHeader = (EFI_MTFTP4_ERROR_HEADER *)Packet;
129 if (ErrorHeader->ErrorCode == EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND) {
130 DEBUG ((DEBUG_ERROR, "TFTP error code 1 (File Not Found)\n"));
131 } else {
132 DEBUG ((DEBUG_ERROR, "TFTP error code %d\n", ErrorHeader->ErrorCode));
133 }
134
135 State->Status = EFI_TFTP_ERROR;
136 break;
137
138 case EFI_MTFTP4_OPCODE_OACK:
139 State->Status = EFI_SUCCESS;
140 break;
141
142 default:
143 State->Status = EFI_PROTOCOL_ERROR;
144 }
145
146 //
147 // Allocate buffer then copy the packet over. Use gBS->AllocatePool
148 // in case AllocatePool will implements something tricky.
149 //
150 Status = gBS->AllocatePool (EfiBootServicesData, PacketLen, (VOID **)State->Packet);
151
152 if (EFI_ERROR (Status)) {
153 State->Status = EFI_OUT_OF_RESOURCES;
154 return EFI_ABORTED;
155 }
156
157 *(State->PacketLen) = PacketLen;
158 CopyMem (*(State->Packet), Packet, PacketLen);
159
160 return EFI_ABORTED;
161}
162
177BOOLEAN
179 IN MTFTP4_PROTOCOL *Instance,
181 )
182{
184 IP4_ADDR Ip;
185 IP4_ADDR Netmask;
186 IP4_ADDR Gateway;
187
188 CopyMem (&Ip, &Override->ServerIp, sizeof (IP4_ADDR));
189 if (IP4_IS_UNSPECIFIED (NTOHL (Ip)) || IP4_IS_LOCAL_BROADCAST (NTOHL (Ip))) {
190 return FALSE;
191 }
192
193 Config = &Instance->Config;
194
195 CopyMem (&Gateway, &Override->GatewayIp, sizeof (IP4_ADDR));
196 Gateway = NTOHL (Gateway);
197
198 if (!Config->UseDefaultSetting && (Gateway != 0)) {
199 CopyMem (&Netmask, &Config->SubnetMask, sizeof (IP4_ADDR));
200 CopyMem (&Ip, &Config->StationIp, sizeof (IP4_ADDR));
201
202 Netmask = NTOHL (Netmask);
203 Ip = NTOHL (Ip);
204
205 if (((Netmask != 0) && !NetIp4IsUnicast (Gateway, Netmask)) || !IP4_NET_EQUAL (Gateway, Ip, Netmask)) {
206 return FALSE;
207 }
208 }
209
210 return TRUE;
211}
212
228BOOLEAN
230 IN MTFTP4_PROTOCOL *Instance,
231 IN UDP_IO *UdpIo,
232 IN EFI_UDP4_CONFIG_DATA *UdpCfgData
233 )
234{
235 MTFTP4_SERVICE *Service;
236 EFI_IP4_MODE_DATA Ip4Mode;
238 EFI_STATUS Status;
239
240 ASSERT (Instance->Config.UseDefaultSetting);
241
242 Service = Instance->Service;
243 Udp = UdpIo->Protocol.Udp4;
244
245 Status = gBS->SetTimer (
246 Service->TimerToGetMap,
248 MTFTP4_TIME_TO_GETMAP * TICKS_PER_SECOND
249 );
250 if (EFI_ERROR (Status)) {
251 return FALSE;
252 }
253
254 while (EFI_ERROR (gBS->CheckEvent (Service->TimerToGetMap))) {
255 Udp->Poll (Udp);
256
257 if (!EFI_ERROR (Udp->GetModeData (Udp, NULL, &Ip4Mode, NULL, NULL)) &&
258 Ip4Mode.IsConfigured)
259 {
260 Udp->Configure (Udp, NULL);
261 return (BOOLEAN)(Udp->Configure (Udp, UdpCfgData) == EFI_SUCCESS);
262 }
263 }
264
265 return FALSE;
266}
267
280 IN UDP_IO *UdpIo,
281 IN MTFTP4_PROTOCOL *Instance
282 )
283{
285 EFI_UDP4_CONFIG_DATA UdpConfig;
286 EFI_STATUS Status;
287 IP4_ADDR Ip;
288
289 Config = &Instance->Config;
290
291 UdpConfig.AcceptBroadcast = FALSE;
292 UdpConfig.AcceptPromiscuous = FALSE;
293 UdpConfig.AcceptAnyPort = FALSE;
294 UdpConfig.AllowDuplicatePort = FALSE;
295 UdpConfig.TypeOfService = 0;
296 UdpConfig.TimeToLive = 64;
297 UdpConfig.DoNotFragment = FALSE;
298 UdpConfig.ReceiveTimeout = 0;
299 UdpConfig.TransmitTimeout = 0;
300 UdpConfig.UseDefaultAddress = Config->UseDefaultSetting;
301 IP4_COPY_ADDRESS (&UdpConfig.StationAddress, &Config->StationIp);
302 IP4_COPY_ADDRESS (&UdpConfig.SubnetMask, &Config->SubnetMask);
303 UdpConfig.StationPort = Config->LocalPort;
304 UdpConfig.RemotePort = 0;
305
306 Ip = HTONL (Instance->ServerIp);
307 IP4_COPY_ADDRESS (&UdpConfig.RemoteAddress, &Ip);
308
309 Status = UdpIo->Protocol.Udp4->Configure (UdpIo->Protocol.Udp4, &UdpConfig);
310
311 if ((Status == EFI_NO_MAPPING) && Mtftp4GetMapping (Instance, UdpIo, &UdpConfig)) {
312 return EFI_SUCCESS;
313 }
314
315 if (!Config->UseDefaultSetting && !EFI_IP4_EQUAL (&mZeroIp4Addr, &Config->GatewayIp)) {
316 //
317 // The station IP address is manually configured and the Gateway IP is not 0.
318 // Add the default route for this UDP instance.
319 //
320 Status = UdpIo->Protocol.Udp4->Routes (
321 UdpIo->Protocol.Udp4,
322 FALSE,
323 &mZeroIp4Addr,
324 &mZeroIp4Addr,
325 &Config->GatewayIp
326 );
327 if (EFI_ERROR (Status)) {
328 UdpIo->Protocol.Udp4->Configure (UdpIo->Protocol.Udp4, NULL);
329 }
330 }
331
332 return Status;
333}
334
352 IN EFI_MTFTP4_TOKEN *Token,
353 IN UINT16 Operation
354 )
355{
356 MTFTP4_PROTOCOL *Instance;
357 EFI_MTFTP4_OVERRIDE_DATA *Override;
359 EFI_TPL OldTpl;
360 EFI_STATUS Status;
361 EFI_STATUS TokenStatus;
362
363 //
364 // Validate the parameters
365 //
366 if ((This == NULL) || (Token == NULL) || (Token->Filename == NULL) ||
367 ((Token->OptionCount != 0) && (Token->OptionList == NULL)))
368 {
369 return EFI_INVALID_PARAMETER;
370 }
371
372 //
373 // User must provide at least one method to collect the data for download.
374 //
375 if (((Operation == EFI_MTFTP4_OPCODE_RRQ) || (Operation == EFI_MTFTP4_OPCODE_DIR)) &&
376 ((Token->Buffer == NULL) && (Token->CheckPacket == NULL)))
377 {
378 return EFI_INVALID_PARAMETER;
379 }
380
381 //
382 // User must provide at least one method to provide the data for upload.
383 //
384 if ((Operation == EFI_MTFTP4_OPCODE_WRQ) &&
385 ((Token->Buffer == NULL) && (Token->PacketNeeded == NULL)))
386 {
387 return EFI_INVALID_PARAMETER;
388 }
389
390 Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
391
392 Status = EFI_SUCCESS;
393 TokenStatus = EFI_SUCCESS;
394
395 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
396
397 if (Instance->State != MTFTP4_STATE_CONFIGED) {
398 Status = EFI_NOT_STARTED;
399 }
400
401 if (Instance->Operation != 0) {
402 Status = EFI_ACCESS_DENIED;
403 }
404
405 if ((Token->OverrideData != NULL) && !Mtftp4OverrideValid (Instance, Token->OverrideData)) {
406 Status = EFI_INVALID_PARAMETER;
407 }
408
409 if (EFI_ERROR (Status)) {
410 gBS->RestoreTPL (OldTpl);
411 return Status;
412 }
413
414 //
415 // Set the Operation now to prevent the application start other
416 // operations.
417 //
418 Instance->Operation = Operation;
419 Override = Token->OverrideData;
420
421 if (Token->OptionCount != 0) {
422 Status = Mtftp4ParseOption (
423 Token->OptionList,
424 Token->OptionCount,
425 TRUE,
426 Instance->Operation,
427 &Instance->RequestOption
428 );
429
430 if (EFI_ERROR (Status)) {
431 TokenStatus = EFI_DEVICE_ERROR;
432 goto ON_ERROR;
433 }
434 }
435
436 //
437 // Set the operation parameters from the configuration or override data.
438 //
439 Config = &Instance->Config;
440 Instance->Token = Token;
441 Instance->BlkSize = MTFTP4_DEFAULT_BLKSIZE;
442 Instance->WindowSize = MTFTP4_DEFAULT_WINDOWSIZE;
443
444 CopyMem (&Instance->ServerIp, &Config->ServerIp, sizeof (IP4_ADDR));
445 Instance->ServerIp = NTOHL (Instance->ServerIp);
446
447 Instance->ListeningPort = Config->InitialServerPort;
448 Instance->ConnectedPort = 0;
449
450 CopyMem (&Instance->Gateway, &Config->GatewayIp, sizeof (IP4_ADDR));
451 Instance->Gateway = NTOHL (Instance->Gateway);
452
453 Instance->MaxRetry = Config->TryCount;
454 Instance->Timeout = Config->TimeoutValue;
455 Instance->Master = TRUE;
456
457 if (Override != NULL) {
458 CopyMem (&Instance->ServerIp, &Override->ServerIp, sizeof (IP4_ADDR));
459 CopyMem (&Instance->Gateway, &Override->GatewayIp, sizeof (IP4_ADDR));
460
461 Instance->ServerIp = NTOHL (Instance->ServerIp);
462 Instance->Gateway = NTOHL (Instance->Gateway);
463
464 Instance->ListeningPort = Override->ServerPort;
465 Instance->MaxRetry = Override->TryCount;
466 Instance->Timeout = Override->TimeoutValue;
467 }
468
469 if (Instance->ListeningPort == 0) {
470 Instance->ListeningPort = MTFTP4_DEFAULT_SERVER_PORT;
471 }
472
473 if (Instance->MaxRetry == 0) {
474 Instance->MaxRetry = MTFTP4_DEFAULT_RETRY;
475 }
476
477 if (Instance->Timeout == 0) {
478 Instance->Timeout = MTFTP4_DEFAULT_TIMEOUT;
479 }
480
481 //
482 // Config the unicast UDP child to send initial request
483 //
484 Status = Mtftp4ConfigUnicastPort (Instance->UnicastPort, Instance);
485 if (EFI_ERROR (Status)) {
486 TokenStatus = EFI_DEVICE_ERROR;
487 goto ON_ERROR;
488 }
489
490 //
491 // Set initial status.
492 //
493 Token->Status = EFI_NOT_READY;
494
495 //
496 // Build and send an initial requests
497 //
498 if (Operation == EFI_MTFTP4_OPCODE_WRQ) {
499 Status = Mtftp4WrqStart (Instance, Operation);
500 } else {
501 Status = Mtftp4RrqStart (Instance, Operation);
502 }
503
504 if (EFI_ERROR (Status)) {
505 TokenStatus = EFI_DEVICE_ERROR;
506 goto ON_ERROR;
507 }
508
509 gBS->RestoreTPL (OldTpl);
510
511 if (Token->Event != NULL) {
512 return EFI_SUCCESS;
513 }
514
515 //
516 // Return immediately for asynchronous operation or poll the
517 // instance for synchronous operation.
518 //
519 while (Token->Status == EFI_NOT_READY) {
520 This->Poll (This);
521 }
522
523 return Token->Status;
524
525ON_ERROR:
526 Mtftp4CleanOperation (Instance, TokenStatus);
527 gBS->RestoreTPL (OldTpl);
528
529 return Status;
530}
531
548EFIAPI
551 OUT EFI_MTFTP4_MODE_DATA *ModeData
552 )
553{
554 MTFTP4_PROTOCOL *Instance;
555 EFI_TPL OldTpl;
556
557 if ((This == NULL) || (ModeData == NULL)) {
558 return EFI_INVALID_PARAMETER;
559 }
560
561 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
562
563 Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
564 CopyMem (&ModeData->ConfigData, &Instance->Config, sizeof (Instance->Config));
565 ModeData->SupportedOptionCount = MTFTP4_SUPPORTED_OPTIONS;
566 ModeData->SupportedOptoins = (UINT8 **)mMtftp4SupportedOptions;
567 ModeData->UnsupportedOptionCount = 0;
568 ModeData->UnsupportedOptoins = NULL;
569
570 gBS->RestoreTPL (OldTpl);
571
572 return EFI_SUCCESS;
573}
574
623EFIAPI
626 IN EFI_MTFTP4_CONFIG_DATA *ConfigData
627 )
628{
629 MTFTP4_PROTOCOL *Instance;
630 EFI_TPL OldTpl;
631 IP4_ADDR Ip;
632 IP4_ADDR Netmask;
633 IP4_ADDR Gateway;
634 IP4_ADDR ServerIp;
635
636 if (This == NULL) {
637 return EFI_INVALID_PARAMETER;
638 }
639
640 Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
641
642 if (ConfigData == NULL) {
643 //
644 // Reset the operation if ConfigData is NULL
645 //
646 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
647
648 Mtftp4CleanOperation (Instance, EFI_ABORTED);
649 ZeroMem (&Instance->Config, sizeof (EFI_MTFTP4_CONFIG_DATA));
650 Instance->State = MTFTP4_STATE_UNCONFIGED;
651
652 gBS->RestoreTPL (OldTpl);
653 } else {
654 //
655 // Configure the parameters for new operation.
656 //
657 CopyMem (&Ip, &ConfigData->StationIp, sizeof (IP4_ADDR));
658 CopyMem (&Netmask, &ConfigData->SubnetMask, sizeof (IP4_ADDR));
659 CopyMem (&Gateway, &ConfigData->GatewayIp, sizeof (IP4_ADDR));
660 CopyMem (&ServerIp, &ConfigData->ServerIp, sizeof (IP4_ADDR));
661
662 Ip = NTOHL (Ip);
663 Netmask = NTOHL (Netmask);
664 Gateway = NTOHL (Gateway);
665 ServerIp = NTOHL (ServerIp);
666
667 if ((ServerIp == 0) || IP4_IS_LOCAL_BROADCAST (ServerIp)) {
668 return EFI_INVALID_PARAMETER;
669 }
670
671 if (!ConfigData->UseDefaultSetting &&
672 ((!IP4_IS_VALID_NETMASK (Netmask) || ((Netmask != 0) && !NetIp4IsUnicast (Ip, Netmask)))))
673 {
674 return EFI_INVALID_PARAMETER;
675 }
676
677 if ((Gateway != 0) &&
678 (((Netmask != 0xFFFFFFFF) && !IP4_NET_EQUAL (Gateway, Ip, Netmask)) || ((Netmask != 0) && !NetIp4IsUnicast (Gateway, Netmask))))
679 {
680 return EFI_INVALID_PARAMETER;
681 }
682
683 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
684
685 if ((Instance->State == MTFTP4_STATE_CONFIGED) && (Instance->Operation != 0)) {
686 gBS->RestoreTPL (OldTpl);
687 return EFI_ACCESS_DENIED;
688 }
689
690 CopyMem (&Instance->Config, ConfigData, sizeof (*ConfigData));
691 Instance->State = MTFTP4_STATE_CONFIGED;
692
693 gBS->RestoreTPL (OldTpl);
694 }
695
696 return EFI_SUCCESS;
697}
698
730EFIAPI
733 IN UINT32 PacketLen,
734 IN EFI_MTFTP4_PACKET *Packet,
735 OUT UINT32 *OptionCount,
736 OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL
737 )
738{
739 EFI_STATUS Status;
740
741 if ((This == NULL) || (PacketLen < MTFTP4_OPCODE_LEN) ||
742 (Packet == NULL) || (OptionCount == NULL))
743 {
744 return EFI_INVALID_PARAMETER;
745 }
746
747 Status = Mtftp4ExtractOptions (Packet, PacketLen, OptionCount, OptionList);
748
749 if (EFI_ERROR (Status)) {
750 return Status;
751 }
752
753 if (*OptionCount == 0) {
754 return EFI_NOT_FOUND;
755 }
756
757 return EFI_SUCCESS;
758}
759
791EFIAPI
794 IN EFI_MTFTP4_TOKEN *Token
795 )
796{
797 return Mtftp4Start (This, Token, EFI_MTFTP4_OPCODE_RRQ);
798}
799
851EFIAPI
854 IN EFI_MTFTP4_TOKEN *Token
855 )
856{
857 return Mtftp4Start (This, Token, EFI_MTFTP4_OPCODE_WRQ);
858}
859
920EFIAPI
923 IN EFI_MTFTP4_TOKEN *Token
924 )
925{
926 return Mtftp4Start (This, Token, EFI_MTFTP4_OPCODE_DIR);
927}
928
984EFIAPI
987 IN EFI_MTFTP4_OVERRIDE_DATA *OverrideData OPTIONAL,
988 IN UINT8 *Filename,
989 IN UINT8 *ModeStr OPTIONAL,
990 IN UINT8 OptionCount,
991 IN EFI_MTFTP4_OPTION *OptionList OPTIONAL,
992 OUT UINT32 *PacketLength,
993 OUT EFI_MTFTP4_PACKET **Packet OPTIONAL
994 )
995{
996 EFI_MTFTP4_TOKEN Token;
998 EFI_STATUS Status;
999
1000 if ((This == NULL) || (Filename == NULL) || (PacketLength == NULL) ||
1001 ((OptionCount != 0) && (OptionList == NULL)))
1002 {
1003 return EFI_INVALID_PARAMETER;
1004 }
1005
1006 if (Packet != NULL) {
1007 *Packet = NULL;
1008 }
1009
1010 *PacketLength = 0;
1011 State.Packet = Packet;
1012 State.PacketLen = PacketLength;
1013 State.Status = EFI_SUCCESS;
1014
1015 //
1016 // Fill in the Token to issue an synchronous ReadFile operation
1017 //
1018 Token.Status = EFI_SUCCESS;
1019 Token.Event = NULL;
1020 Token.OverrideData = OverrideData;
1021 Token.Filename = Filename;
1022 Token.ModeStr = ModeStr;
1023 Token.OptionCount = OptionCount;
1024 Token.OptionList = OptionList;
1025 Token.BufferSize = 0;
1026 Token.Buffer = NULL;
1027 Token.Context = &State;
1029 Token.TimeoutCallback = NULL;
1030 Token.PacketNeeded = NULL;
1031
1032 Status = EfiMtftp4ReadFile (This, &Token);
1033
1034 if (EFI_ABORTED == Status) {
1035 return State.Status;
1036 }
1037
1038 return Status;
1039}
1040
1066EFIAPI
1069 )
1070{
1071 MTFTP4_PROTOCOL *Instance;
1072 EFI_UDP4_PROTOCOL *Udp;
1073 EFI_STATUS Status;
1074
1075 if (This == NULL) {
1076 return EFI_INVALID_PARAMETER;
1077 }
1078
1079 Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
1080
1081 if (Instance->State == MTFTP4_STATE_UNCONFIGED) {
1082 return EFI_NOT_STARTED;
1083 } else if (Instance->State == MTFTP4_STATE_DESTROY) {
1084 return EFI_DEVICE_ERROR;
1085 }
1086
1087 Udp = Instance->UnicastPort->Protocol.Udp4;
1088 Status = Udp->Poll (Udp);
1089 Mtftp4OnTimerTick (NULL, Instance->Service);
1090 return Status;
1091}
1092
1093EFI_MTFTP4_PROTOCOL gMtftp4ProtocolTemplate = {
1102};
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
Definition: LinkedList.c:590
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define NULL
Definition: Base.h:319
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_STATUS EFIAPI EfiMtftp4ReadDirectory(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token)
Definition: Mtftp4Impl.c:921
EFI_STATUS EFIAPI EfiMtftp4ParseOptions(IN EFI_MTFTP4_PROTOCOL *This, IN UINT32 PacketLen, IN EFI_MTFTP4_PACKET *Packet, OUT UINT32 *OptionCount, OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL)
Definition: Mtftp4Impl.c:731
EFI_STATUS EFIAPI EfiMtftp4WriteFile(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token)
Definition: Mtftp4Impl.c:852
EFI_STATUS EFIAPI EfiMtftp4Poll(IN EFI_MTFTP4_PROTOCOL *This)
Definition: Mtftp4Impl.c:1067
EFI_STATUS EFIAPI EfiMtftp4ReadFile(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token)
Definition: Mtftp4Impl.c:792
BOOLEAN Mtftp4GetMapping(IN MTFTP4_PROTOCOL *Instance, IN UDP_IO *UdpIo, IN EFI_UDP4_CONFIG_DATA *UdpCfgData)
Definition: Mtftp4Impl.c:229
EFI_STATUS EFIAPI EfiMtftp4GetModeData(IN EFI_MTFTP4_PROTOCOL *This, OUT EFI_MTFTP4_MODE_DATA *ModeData)
Definition: Mtftp4Impl.c:549
EFI_STATUS EFIAPI EfiMtftp4GetInfo(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_OVERRIDE_DATA *OverrideData OPTIONAL, IN UINT8 *Filename, IN UINT8 *ModeStr OPTIONAL, IN UINT8 OptionCount, IN EFI_MTFTP4_OPTION *OptionList OPTIONAL, OUT UINT32 *PacketLength, OUT EFI_MTFTP4_PACKET **Packet OPTIONAL)
Definition: Mtftp4Impl.c:985
EFI_STATUS Mtftp4Start(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token, IN UINT16 Operation)
Definition: Mtftp4Impl.c:350
EFI_STATUS Mtftp4ConfigUnicastPort(IN UDP_IO *UdpIo, IN MTFTP4_PROTOCOL *Instance)
Definition: Mtftp4Impl.c:279
EFI_STATUS EFIAPI EfiMtftp4Configure(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_CONFIG_DATA *ConfigData)
Definition: Mtftp4Impl.c:624
BOOLEAN Mtftp4OverrideValid(IN MTFTP4_PROTOCOL *Instance, IN EFI_MTFTP4_OVERRIDE_DATA *Override)
Definition: Mtftp4Impl.c:178
EFI_STATUS EFIAPI Mtftp4GetInfoCheckPacket(IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_TOKEN *Token, IN UINT16 PacketLen, IN EFI_MTFTP4_PACKET *Packet)
Definition: Mtftp4Impl.c:108
VOID Mtftp4CleanOperation(IN OUT MTFTP4_PROTOCOL *Instance, IN EFI_STATUS Result)
Definition: Mtftp4Impl.c:20
EFI_STATUS Mtftp4RrqStart(IN MTFTP4_PROTOCOL *Instance, IN UINT16 Operation)
Definition: Mtftp4Rrq.c:45
EFI_STATUS Mtftp4WrqStart(IN MTFTP4_PROTOCOL *Instance, IN UINT16 Operation)
Definition: Mtftp4Wrq.c:491
EFI_STATUS Mtftp4ExtractOptions(IN EFI_MTFTP4_PACKET *Packet, IN UINT32 PacketLen, OUT UINT32 *OptionCount, OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL)
Definition: Mtftp4Option.c:234
EFI_STATUS Mtftp4ParseOption(IN EFI_MTFTP4_OPTION *Options, IN UINT32 Count, IN BOOLEAN Request, IN UINT16 Operation, OUT MTFTP4_OPTION *MtftpOption)
Definition: Mtftp4Option.c:400
VOID EFIAPI Mtftp4OnTimerTick(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI NetbufFree(IN NET_BUF *Nbuf)
Definition: NetBuffer.c:195
BOOLEAN EFIAPI NetIp4IsUnicast(IN IP4_ADDR Ip, IN IP4_ADDR NetMask)
Definition: DxeNetLib.c:683
VOID EFIAPI UdpIoCleanIo(IN UDP_IO *UdpIo)
Definition: DxeUdpIoLib.c:915
EFI_STATUS EFIAPI UdpIoFreeIo(IN UDP_IO *UdpIo)
Definition: DxeUdpIoLib.c:809
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
UINTN EFI_TPL
Definition: UefiBaseType.h:41
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
@ EfiBootServicesData
@ TimerRelative
Definition: UefiSpec.h:539
EFI_MTFTP4_CHECK_PACKET CheckPacket
Definition: Mtftp4.h:562
EFI_STATUS Status
Definition: Mtftp4.h:515
UINT32 OptionCount
Definition: Mtftp4.h:539
UINT64 BufferSize
Definition: Mtftp4.h:547
UINT8 * ModeStr
Definition: Mtftp4.h:535
EFI_MTFTP4_PACKET_NEEDED PacketNeeded
Definition: Mtftp4.h:570
VOID * Context
Definition: Mtftp4.h:558
VOID * Buffer
Definition: Mtftp4.h:553
EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback
Definition: Mtftp4.h:566
EFI_MTFTP4_OVERRIDE_DATA * OverrideData
Definition: Mtftp4.h:527
EFI_EVENT Event
Definition: Mtftp4.h:523
EFI_MTFTP4_OPTION * OptionList
Definition: Mtftp4.h:543
UINT8 * Filename
Definition: Mtftp4.h:531
BOOLEAN IsConfigured
Definition: Ip4.h:157