54 return EFI_INVALID_PARAMETER;
57 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
58 Mode = Private->PxeBc.
Mode;
61 return EFI_ALREADY_STARTED;
67 if (UseIpv6 && Mode->Ipv6Available && Mode->Ipv6Supported && (Private->Ip6Nic !=
NULL)) {
68 Mode->UsingIpv6 =
TRUE;
69 }
else if (!UseIpv6 && (Private->Ip4Nic !=
NULL)) {
70 Mode->UsingIpv6 =
FALSE;
72 return EFI_UNSUPPORTED;
77 EFI_IO_BUS_IP_NETWORK | EFI_IOB_PC_RECONFIG,
78 (VOID *)&(Mode->UsingIpv6),
79 sizeof (Mode->UsingIpv6)
82 if (Mode->UsingIpv6) {
87 Status = Private->Udp6Read->Configure (
91 if (EFI_ERROR (Status)) {
98 Private->BlockSize = Private->Ip6MaxPacketSize -
99 PXEBC_DEFAULT_UDP_OVERHEAD_SIZE - PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE;
104 Private->Ip6Policy = PXEBC_IP6_POLICY_MAX;
105 Private->ProxyOffer.Dhcp6.Packet.Offer.
Size = PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE;
106 Private->DhcpAck.Dhcp6.Packet.Ack.
Size = PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE;
107 Private->PxeReply.Dhcp6.Packet.Ack.
Size = PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE;
109 for (Index = 0; Index < PXEBC_OFFER_MAX_NUM; Index++) {
110 Private->OfferBuffer[Index].Dhcp6.Packet.Offer.
Size = PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE;
116 Private->Icmp6Token.
Status = EFI_NOT_READY;
117 Status =
gBS->CreateEvent (
122 &Private->Icmp6Token.
Event
124 if (EFI_ERROR (Status)) {
132 if (EFI_ERROR (Status)) {
140 Status = Private->Udp4Read->Configure (
142 &Private->Udp4CfgData
144 if (EFI_ERROR (Status)) {
151 Private->BlockSize = Private->Ip4MaxPacketSize -
152 PXEBC_DEFAULT_UDP_OVERHEAD_SIZE - PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE;
157 Private->ProxyOffer.Dhcp4.Packet.Offer.
Size = PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE;
158 Private->DhcpAck.Dhcp4.Packet.Ack.
Size = PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE;
159 Private->PxeReply.Dhcp4.Packet.Ack.
Size = PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE;
161 for (Index = 0; Index < PXEBC_OFFER_MAX_NUM; Index++) {
162 Private->OfferBuffer[Index].Dhcp4.Packet.Offer.
Size = PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE;
170 Status =
gBS->CreateEvent (
171 EVT_TIMER | EVT_NOTIFY_SIGNAL,
175 &Private->ArpUpdateEvent
177 if (EFI_ERROR (Status)) {
184 Status =
gBS->SetTimer (
185 Private->ArpUpdateEvent,
189 if (EFI_ERROR (Status)) {
196 Private->Icmp6Token.
Status = EFI_NOT_READY;
197 Status =
gBS->CreateEvent (
202 &Private->IcmpToken.
Event
204 if (EFI_ERROR (Status)) {
216 if (EFI_ERROR (Status)) {
224 if (
PcdGet64 (PcdTftpBlockSize) != 0) {
231 Status =
gBS->CreateEvent (
236 &Private->UdpTimeOutEvent
238 if (EFI_ERROR (Status)) {
242 Private->IsAddressOk =
FALSE;
243 Mode->Started =
TRUE;
248 if (Mode->UsingIpv6) {
250 gBS->CloseEvent (Private->Icmp6Token.
Event);
254 Private->Udp6Read->Configure (Private->Udp6Read,
NULL);
255 Private->Ip6->Configure (Private->Ip6,
NULL);
257 if (Private->ArpUpdateEvent !=
NULL) {
258 gBS->CloseEvent (Private->ArpUpdateEvent);
259 Private->ArpUpdateEvent =
NULL;
263 gBS->CloseEvent (Private->IcmpToken.
Event);
267 Private->Udp4Read->Configure (Private->Udp4Read,
NULL);
268 Private->Ip4->Configure (Private->Ip4,
NULL);
299 BOOLEAN Ipv6Supported;
300 BOOLEAN Ipv6Available;
303 return EFI_INVALID_PARAMETER;
306 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
307 Mode = Private->PxeBc.
Mode;
308 Ipv6Supported = Mode->Ipv6Supported;
309 Ipv6Available = Mode->Ipv6Available;
311 if (!Mode->Started) {
312 return EFI_NOT_STARTED;
315 if (Mode->UsingIpv6) {
321 Private->Dhcp6->Stop (Private->Dhcp6);
322 Private->Dhcp6->Configure (Private->Dhcp6,
NULL);
323 Private->Udp6Write->Configure (Private->Udp6Write,
NULL);
324 Private->Udp6Read->Groups (Private->Udp6Read,
FALSE,
NULL);
325 Private->Udp6Read->Configure (Private->Udp6Read,
NULL);
326 Private->Ip6->Cancel (Private->Ip6, &Private->Icmp6Token);
327 Private->Ip6->Configure (Private->Ip6,
NULL);
330 gBS->CloseEvent (Private->Icmp6Token.
Event);
334 if (Private->Dhcp6Request !=
NULL) {
336 Private->Dhcp6Request =
NULL;
339 if (Private->BootFileName !=
NULL) {
341 Private->BootFileName =
NULL;
351 Private->Dhcp4->Stop (Private->Dhcp4);
352 Private->Dhcp4->Configure (Private->Dhcp4,
NULL);
353 Private->Udp4Write->Configure (Private->Udp4Write,
NULL);
354 Private->Udp4Read->Groups (Private->Udp4Read,
FALSE,
NULL);
355 Private->Udp4Read->Configure (Private->Udp4Read,
NULL);
356 Private->Ip4->Cancel (Private->Ip4, &Private->IcmpToken);
357 Private->Ip4->Configure (Private->Ip4,
NULL);
358 if (Private->ArpUpdateEvent !=
NULL) {
359 gBS->CloseEvent (Private->ArpUpdateEvent);
360 Private->ArpUpdateEvent =
NULL;
364 gBS->CloseEvent (Private->IcmpToken.
Event);
368 Private->BootFileName =
NULL;
371 gBS->CloseEvent (Private->UdpTimeOutEvent);
372 Private->CurSrcPort = 0;
373 Private->BootFileSize = 0;
374 Private->SolicitTimes = 0;
375 Private->ElapsedTime = 0;
385 Mode->Ipv6Available = Ipv6Available;
386 Mode->Ipv6Supported = Ipv6Supported;
387 Mode->AutoArp =
TRUE;
389 Mode->ToS = DEFAULT_ToS;
426 IN BOOLEAN SortOffers
435 return EFI_INVALID_PARAMETER;
439 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
440 Mode = Private->PxeBc.
Mode;
441 Mode->IcmpErrorReceived =
FALSE;
442 Private->Function = EFI_PXE_BASE_CODE_FUNCTION_DHCP;
443 Private->IsOfferSorted = SortOffers;
444 Private->SolicitTimes = 0;
445 Private->ElapsedTime = 0;
447 if (!Mode->Started) {
448 return EFI_NOT_STARTED;
451 if (Mode->UsingIpv6) {
455 Private->Udp6Read->Configure (Private->Udp6Read,
NULL);
465 Private->Udp4Read->Configure (Private->Udp4Read,
NULL);
476 if (Mode->UsingIpv6) {
477 Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData);
479 Private->Udp4Read->Configure (Private->Udp4Read, &Private->Udp4CfgData);
487 IpFilter.Filters = EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP;
488 This->SetIpFilter (This, &IpFilter);
558 return EFI_INVALID_PARAMETER;
561 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
562 Mode = Private->PxeBc.
Mode;
563 Mode->IcmpErrorReceived =
FALSE;
566 Status = EFI_DEVICE_ERROR;
567 Private->Function = EFI_PXE_BASE_CODE_FUNCTION_DISCOVER;
568 NewCreatedInfo =
NULL;
570 if (!Mode->Started) {
571 return EFI_NOT_STARTED;
577 if (!Private->IsAddressOk) {
578 return EFI_INVALID_PARAMETER;
581 if (Mode->UsingIpv6) {
585 Private->Udp6Read->Configure (Private->Udp6Read,
NULL);
590 Private->Udp4Read->Configure (Private->Udp4Read,
NULL);
597 if (*Layer != EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL) {
601 if (!Mode->PxeDiscoverValid ||
602 !Mode->PxeReplyReceived ||
603 (!Mode->PxeBisReplyReceived && UseBis))
605 Status = EFI_INVALID_PARAMETER;
611 Info->UseUCast =
TRUE;
612 SrvList = Info->SrvList;
613 SrvList[0].Type = Type;
614 SrvList[0].AcceptAnyResponse =
FALSE;
617 }
else if (Info ==
NULL) {
621 NewCreatedInfo = &DefaultInfo;
623 if (EFI_ERROR (Status)) {
627 ASSERT (NewCreatedInfo !=
NULL);
628 Info = NewCreatedInfo;
633 SrvList = Info->SrvList;
635 if (!SrvList[0].AcceptAnyResponse) {
636 for (Index = 1; Index < Info->IpCnt; Index++) {
637 if (SrvList[Index].AcceptAnyResponse) {
642 if (Index != Info->IpCnt) {
647 Status = EFI_INVALID_PARAMETER;
656 if ((!Info->UseUCast && !Info->UseBCast && !Info->UseMCast) ||
657 (Info->MustUseList && (Info->IpCnt == 0)))
659 Status = EFI_INVALID_PARAMETER;
663 Private->IsDoDiscover =
TRUE;
665 if (Info->UseMCast) {
674 &Info->ServerMCastIp,
678 }
else if (Info->UseBCast) {
682 ASSERT (!Mode->UsingIpv6);
692 }
else if (Info->UseUCast) {
696 for (Index = 0; Index < Info->IpCnt; Index++) {
697 if (BootSvrEntry ==
NULL) {
700 ASSERT (!Mode->UsingIpv6);
717 if (!EFI_ERROR (Status)) {
721 if (Mode->UsingIpv6) {
723 if (!EFI_ERROR (Status)) {
725 &Mode->PxeReply.Dhcpv6,
726 &Private->PxeReply.Dhcp6.Packet.Ack.Dhcp6,
727 Private->PxeReply.Dhcp6.Packet.Ack.
Length
729 Mode->PxeReplyReceived =
TRUE;
730 Mode->PxeDiscoverValid =
TRUE;
734 if (!EFI_ERROR (Status)) {
736 &Mode->PxeReply.Dhcpv4,
737 &Private->PxeReply.Dhcp4.Packet.Ack.Dhcp4,
738 Private->PxeReply.Dhcp4.Packet.Ack.
Length
740 Mode->PxeReplyReceived =
TRUE;
741 Mode->PxeDiscoverValid =
TRUE;
748 if ((NewCreatedInfo !=
NULL) && (NewCreatedInfo != &DefaultInfo)) {
752 if (Mode->UsingIpv6) {
753 Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData);
755 Private->Udp4Read->Configure (Private->Udp4Read, &Private->Udp4CfgData);
763 IpFilter.Filters = EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP;
764 This->SetIpFilter (This, &IpFilter);
837 IN OUT VOID *BufferPtr OPTIONAL,
838 IN BOOLEAN Overwrite,
839 IN OUT UINT64 *BufferSize,
844 IN BOOLEAN DontUseBuffer
856 if ((This ==
NULL) ||
857 (Filename ==
NULL) ||
858 (BufferSize ==
NULL) ||
859 (ServerIp ==
NULL) ||
860 ((BlockSize !=
NULL) && (*BlockSize < PXE_MTFTP_DEFAULT_BLOCK_SIZE)))
862 return EFI_INVALID_PARAMETER;
865 if ((Operation == EFI_PXE_BASE_CODE_TFTP_READ_FILE) ||
866 (Operation == EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY) ||
867 (Operation == EFI_PXE_BASE_CODE_MTFTP_READ_FILE) ||
868 (Operation == EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY))
870 if ((BufferPtr ==
NULL) && !DontUseBuffer) {
871 return EFI_INVALID_PARAMETER;
876 Status = EFI_DEVICE_ERROR;
877 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
878 Mode = Private->PxeBc.
Mode;
885 if (Mode->UsingIpv6) {
887 return EFI_INVALID_PARAMETER;
890 if (IP4_IS_UNSPECIFIED (NTOHL (ServerIp->Addr[0])) || IP4_IS_LOCAL_BROADCAST (NTOHL (ServerIp->Addr[0]))) {
891 return EFI_INVALID_PARAMETER;
895 if (Mode->UsingIpv6) {
900 Config = &Mtftp6Config;
902 Mtftp6Config.
TryCount = PXEBC_MTFTP_RETRIES;
908 Private->Udp6Read->Configure (Private->Udp6Read,
NULL);
914 Config = &Mtftp4Config;
915 Mtftp4Config.UseDefaultSetting =
FALSE;
916 Mtftp4Config.TimeoutValue = PXEBC_MTFTP_TIMEOUT;
917 Mtftp4Config.TryCount = PXEBC_MTFTP_RETRIES;
925 Private->Udp4Read->Configure (Private->Udp4Read,
NULL);
928 Mode->TftpErrorReceived =
FALSE;
929 Mode->IcmpErrorReceived =
FALSE;
932 case EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE:
941 (WindowSize > 1) ? &WindowSize :
NULL,
947 case EFI_PXE_BASE_CODE_TFTP_READ_FILE:
956 (WindowSize > 1) ? &WindowSize :
NULL,
964 case EFI_PXE_BASE_CODE_TFTP_WRITE_FILE:
980 case EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY:
989 (WindowSize > 1) ? &WindowSize :
NULL,
997 case EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE:
998 case EFI_PXE_BASE_CODE_MTFTP_READ_FILE:
999 case EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY:
1000 Status = EFI_UNSUPPORTED;
1005 Status = EFI_INVALID_PARAMETER;
1010 if (Status == EFI_ICMP_ERROR) {
1011 Mode->IcmpErrorReceived =
TRUE;
1017 if (Mode->UsingIpv6) {
1018 Private->Udp6Read->Configure (Private->Udp6Read, &Private->Udp6CfgData);
1020 Private->Udp4Read->Configure (Private->Udp4Read, &Private->Udp4CfgData);
1028 IpFilter.Filters = EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP;
1029 This->SetIpFilter (This, &IpFilter);
1077 IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort,
1080 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL,
1081 IN UINTN *HeaderSize OPTIONAL,
1082 IN VOID *HeaderPtr OPTIONAL,
1092 BOOLEAN DoNotFragment;
1094 if ((This ==
NULL) || (DestIp ==
NULL) || (DestPort ==
NULL)) {
1095 return EFI_INVALID_PARAMETER;
1098 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
1099 Mode = Private->PxeBc.
Mode;
1101 if ((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT) != 0) {
1102 DoNotFragment =
FALSE;
1104 DoNotFragment =
TRUE;
1107 if (!Mode->UsingIpv6 && (GatewayIp !=
NULL) && (Mode->SubnetMask.Addr[0] != 0) &&
1108 !
NetIp4IsUnicast (NTOHL (GatewayIp->Addr[0]), EFI_NTOHL (Mode->SubnetMask)))
1113 return EFI_INVALID_PARAMETER;
1116 if ((HeaderSize !=
NULL) && ((*HeaderSize == 0) || (HeaderPtr ==
NULL))) {
1117 return EFI_INVALID_PARAMETER;
1120 if ((BufferSize ==
NULL) || ((*BufferSize != 0) && (BufferPtr ==
NULL))) {
1121 return EFI_INVALID_PARAMETER;
1124 if (!Mode->Started) {
1125 return EFI_NOT_STARTED;
1128 if (!Private->IsAddressOk && (SrcIp ==
NULL)) {
1129 return EFI_INVALID_PARAMETER;
1132 if ((Private->CurSrcPort == 0) ||
1133 ((SrcPort !=
NULL) && (*SrcPort != Private->CurSrcPort)))
1138 if (SrcPort !=
NULL) {
1139 Private->CurSrcPort = *SrcPort;
1143 if (Mode->UsingIpv6) {
1146 &Private->StationIp.v6,
1147 &Private->CurSrcPort
1155 &Private->StationIp.v4,
1156 &Private->SubnetMask.v4,
1157 &Private->GatewayIp.v4,
1158 &Private->CurSrcPort,
1165 if (EFI_ERROR (Status)) {
1166 Private->CurSrcPort = 0;
1167 return EFI_INVALID_PARAMETER;
1168 }
else if (SrcPort !=
NULL) {
1169 *SrcPort = Private->CurSrcPort;
1175 gBS->SetTimer (Private->UdpTimeOutEvent,
TimerRelative, PXEBC_UDP_TIMEOUT);
1177 if (Mode->UsingIpv6) {
1184 if (SrcIp !=
NULL) {
1188 if (SrcPort !=
NULL) {
1195 Private->UdpTimeOutEvent,
1207 Udp4Session.DestinationPort = *DestPort;
1208 if (SrcIp !=
NULL) {
1212 if (SrcPort !=
NULL) {
1213 Udp4Session.SourcePort = *SrcPort;
1222 Private->UdpTimeOutEvent,
1236 if (Mode->UsingIpv6) {
1237 Private->Udp6Write->Configure (Private->Udp6Write,
NULL);
1239 Private->Udp4Write->Configure (Private->Udp4Write,
NULL);
1288 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL,
1290 IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL,
1291 IN UINTN *HeaderSize OPTIONAL,
1292 IN VOID *HeaderPtr OPTIONAL,
1308 UINTN HeaderCopiedLen;
1309 UINTN BufferCopiedLen;
1310 UINT32 FragmentLength;
1311 UINTN FragmentIndex;
1312 UINT8 *FragmentBuffer;
1315 return EFI_INVALID_PARAMETER;
1318 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
1319 Mode = Private->PxeBc.
Mode;
1325 if ((((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT) == 0) && (DestPort ==
NULL)) ||
1326 (((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP) == 0) && (SrcIp ==
NULL)) ||
1327 (((OpFlags & EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT) == 0) && (SrcPort ==
NULL)))
1329 return EFI_INVALID_PARAMETER;
1332 if (((HeaderSize !=
NULL) && (*HeaderSize == 0)) || ((HeaderSize !=
NULL) && (HeaderPtr ==
NULL))) {
1333 return EFI_INVALID_PARAMETER;
1336 if ((BufferSize ==
NULL) || (BufferPtr ==
NULL)) {
1337 return EFI_INVALID_PARAMETER;
1340 if (!Mode->Started) {
1341 return EFI_NOT_STARTED;
1347 if (Mode->UsingIpv6) {
1348 Status =
gBS->CreateEvent (
1355 if (EFI_ERROR (Status)) {
1356 return EFI_OUT_OF_RESOURCES;
1359 Status =
gBS->CreateEvent (
1366 if (EFI_ERROR (Status)) {
1367 return EFI_OUT_OF_RESOURCES;
1374 gBS->SetTimer (Private->UdpTimeOutEvent,
TimerRelative, PXEBC_UDP_TIMEOUT);
1375 Mode->IcmpErrorReceived =
FALSE;
1380 while (!IsMatched && !EFI_ERROR (Status)) {
1381 if (Mode->UsingIpv6) {
1386 Private->UdpTimeOutEvent,
1400 Private->UdpTimeOutEvent,
1412 if ((Status == EFI_ICMP_ERROR) ||
1414 (Status == EFI_HOST_UNREACHABLE) ||
1415 (Status == EFI_PROTOCOL_UNREACHABLE) ||
1416 (Status == EFI_PORT_UNREACHABLE))
1421 Mode->IcmpErrorReceived =
TRUE;
1430 if (Mode->UsingIpv6) {
1431 Udp6Rx = Udp6Token.Packet.
RxData;
1432 ASSERT (Udp6Rx !=
NULL);
1435 if (HeaderSize !=
NULL) {
1439 if (Udp6Rx->
DataLength - HeaderLen > *BufferSize) {
1440 Status = EFI_BUFFER_TOO_SMALL;
1442 if (HeaderSize !=
NULL) {
1443 *HeaderSize = HeaderLen;
1446 *BufferSize = Udp6Rx->
DataLength - HeaderLen;
1448 HeaderCopiedLen = 0;
1449 BufferCopiedLen = 0;
1450 for (FragmentIndex = 0; FragmentIndex < Udp6Rx->
FragmentCount; FragmentIndex++) {
1453 if (HeaderCopiedLen + FragmentLength < HeaderLen) {
1457 CopyMem ((UINT8 *)HeaderPtr + HeaderCopiedLen, FragmentBuffer, FragmentLength);
1458 HeaderCopiedLen += FragmentLength;
1459 }
else if (HeaderCopiedLen < HeaderLen) {
1463 CopiedLen = HeaderLen - HeaderCopiedLen;
1464 CopyMem ((UINT8 *)HeaderPtr + HeaderCopiedLen, FragmentBuffer, CopiedLen);
1465 HeaderCopiedLen += CopiedLen;
1470 CopyMem ((UINT8 *)BufferPtr + BufferCopiedLen, FragmentBuffer + CopiedLen, FragmentLength - CopiedLen);
1471 BufferCopiedLen += (FragmentLength - CopiedLen);
1476 CopyMem ((UINT8 *)BufferPtr + BufferCopiedLen, FragmentBuffer, FragmentLength);
1477 BufferCopiedLen += FragmentLength;
1487 Udp4Rx = Udp4Token.Packet.RxData;
1488 ASSERT (Udp4Rx !=
NULL);
1491 if (HeaderSize !=
NULL) {
1492 HeaderLen =
MIN (*HeaderSize, Udp4Rx->DataLength);
1495 if (Udp4Rx->DataLength - HeaderLen > *BufferSize) {
1496 Status = EFI_BUFFER_TOO_SMALL;
1498 if (HeaderSize !=
NULL) {
1499 *HeaderSize = HeaderLen;
1502 *BufferSize = Udp4Rx->DataLength - HeaderLen;
1504 HeaderCopiedLen = 0;
1505 BufferCopiedLen = 0;
1506 for (FragmentIndex = 0; FragmentIndex < Udp4Rx->FragmentCount; FragmentIndex++) {
1507 FragmentLength = Udp4Rx->FragmentTable[FragmentIndex].FragmentLength;
1508 FragmentBuffer = Udp4Rx->FragmentTable[FragmentIndex].FragmentBuffer;
1509 if (HeaderCopiedLen + FragmentLength < HeaderLen) {
1513 CopyMem ((UINT8 *)HeaderPtr + HeaderCopiedLen, FragmentBuffer, FragmentLength);
1514 HeaderCopiedLen += FragmentLength;
1515 }
else if (HeaderCopiedLen < HeaderLen) {
1519 CopiedLen = HeaderLen - HeaderCopiedLen;
1520 CopyMem ((UINT8 *)HeaderPtr + HeaderCopiedLen, FragmentBuffer, CopiedLen);
1521 HeaderCopiedLen += CopiedLen;
1526 CopyMem ((UINT8 *)BufferPtr + BufferCopiedLen, FragmentBuffer + CopiedLen, FragmentLength - CopiedLen);
1527 BufferCopiedLen += (FragmentLength - CopiedLen);
1532 CopyMem ((UINT8 *)BufferPtr + BufferCopiedLen, FragmentBuffer, FragmentLength);
1533 BufferCopiedLen += FragmentLength;
1541 gBS->SignalEvent (Udp4Rx->RecycleSignal);
1545 if (Mode->UsingIpv6) {
1546 Private->Udp6Read->Cancel (Private->Udp6Read, &Udp6Token);
1549 Private->Udp4Read->Cancel (Private->Udp4Read, &Udp4Token);
1550 gBS->CloseEvent (Udp4Token.Event);
1601 BOOLEAN NeedPromiscuous;
1602 BOOLEAN AcceptPromiscuous;
1603 BOOLEAN AcceptBroadcast;
1604 BOOLEAN MultiCastUpdate;
1606 if ((This ==
NULL) || (NewFilter ==
NULL)) {
1607 return EFI_INVALID_PARAMETER;
1610 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
1611 Mode = Private->PxeBc.
Mode;
1613 NeedPromiscuous =
FALSE;
1615 if (!Mode->Started) {
1616 return EFI_NOT_STARTED;
1619 for (Index = 0; Index < NewFilter->IpCnt; Index++) {
1621 if (!Mode->UsingIpv6 &&
1622 IP4_IS_LOCAL_BROADCAST (EFI_IP4 (NewFilter->IpList[Index].v4)))
1627 return EFI_INVALID_PARAMETER;
1630 if (Mode->UsingIpv6) {
1631 if (((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP) != 0) &&
1634 NeedPromiscuous =
TRUE;
1636 }
else if ((EFI_NTOHL (Mode->StationIp) != 0) &&
1637 (EFI_NTOHL (Mode->SubnetMask) != 0) &&
1638 IP4_NET_EQUAL (EFI_NTOHL (Mode->StationIp), EFI_NTOHL (NewFilter->IpList[Index].v4), EFI_NTOHL (Mode->SubnetMask.v4)) &&
1639 NetIp4IsUnicast (EFI_IP4 (NewFilter->IpList[Index].v4), EFI_NTOHL (Mode->SubnetMask)) &&
1640 ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP) != 0))
1642 NeedPromiscuous =
TRUE;
1646 AcceptPromiscuous =
FALSE;
1647 AcceptBroadcast =
FALSE;
1648 MultiCastUpdate =
FALSE;
1650 if (NeedPromiscuous ||
1651 ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS) != 0) ||
1652 ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST) != 0))
1657 AcceptPromiscuous =
TRUE;
1658 }
else if ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST) != 0) {
1662 AcceptBroadcast =
TRUE;
1671 if (!AcceptPromiscuous) {
1672 if ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP) != 0) {
1673 if (Mode->IpFilter.IpCnt != NewFilter->IpCnt) {
1674 MultiCastUpdate =
TRUE;
1675 }
else if (
CompareMem (Mode->IpFilter.IpList, NewFilter->IpList, NewFilter->IpCnt * sizeof (
EFI_IP_ADDRESS)) != 0 ) {
1676 MultiCastUpdate =
TRUE;
1681 if (!Mode->UsingIpv6) {
1685 Udp4Cfg = &Private->Udp4CfgData;
1686 if ((AcceptPromiscuous != Udp4Cfg->AcceptPromiscuous) ||
1687 (AcceptBroadcast != Udp4Cfg->AcceptBroadcast) || MultiCastUpdate)
1693 Private->Udp4Read->Configure (Private->Udp4Read,
NULL);
1698 Udp4Cfg->AcceptPromiscuous = AcceptPromiscuous;
1699 Udp4Cfg->AcceptBroadcast = AcceptBroadcast;
1700 Status = Private->Udp4Read->Configure (Private->Udp4Read, Udp4Cfg);
1701 if (EFI_ERROR (Status)) {
1708 if (!AcceptPromiscuous) {
1709 for (Index = 0; Index < NewFilter->IpCnt; ++Index) {
1710 if (IP4_IS_MULTICAST (EFI_NTOHL (NewFilter->IpList[Index].v4))) {
1714 Status = Private->Udp4Read->Groups (Private->Udp4Read,
TRUE, &NewFilter->IpList[Index].v4);
1715 if (EFI_ERROR (Status)) {
1726 Udp6Cfg = &Private->Udp6CfgData;
1732 Private->Udp6Read->Configure (Private->Udp6Read,
NULL);
1738 Status = Private->Udp6Read->Configure (Private->Udp6Read, Udp6Cfg);
1739 if (EFI_ERROR (Status)) {
1746 if (!AcceptPromiscuous) {
1747 for (Index = 0; Index < NewFilter->IpCnt; ++Index) {
1748 if (IP6_IS_MULTICAST (&NewFilter->IpList[Index].v6)) {
1752 Status = Private->Udp6Read->Groups (Private->Udp6Read,
TRUE, &NewFilter->IpList[Index].v6);
1753 if (EFI_ERROR (Status)) {
1765 CopyMem (&Mode->IpFilter, NewFilter, sizeof (Mode->IpFilter));
1811 if ((This ==
NULL) || (IpAddr ==
NULL)) {
1812 return EFI_INVALID_PARAMETER;
1815 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
1816 Mode = Private->PxeBc.
Mode;
1817 ResolvedEvent =
NULL;
1821 if (!Mode->Started) {
1822 return EFI_NOT_STARTED;
1825 if (Mode->UsingIpv6) {
1826 return EFI_UNSUPPORTED;
1832 if (!Private->IsAddressOk) {
1833 return EFI_INVALID_PARAMETER;
1836 Mode->IcmpErrorReceived =
FALSE;
1840 if (!Mode->AutoArp) {
1846 Status = EFI_DEVICE_ERROR;
1850 Status =
gBS->CreateEvent (
1857 if (EFI_ERROR (Status)) {
1864 Status = Private->Arp->Request (Private->Arp, &IpAddr->v4, ResolvedEvent, &TempMac);
1865 if (EFI_ERROR (Status) && (Status != EFI_NOT_READY)) {
1869 while (!IsResolved) {
1878 Status = EFI_TIMEOUT;
1885 if ((MacAddr !=
NULL) && !EFI_ERROR (Status)) {
1890 if (ResolvedEvent !=
NULL) {
1891 gBS->CloseEvent (ResolvedEvent);
1933 IN BOOLEAN *NewAutoArp OPTIONAL,
1934 IN BOOLEAN *NewSendGUID OPTIONAL,
1935 IN UINT8 *NewTTL OPTIONAL,
1936 IN UINT8 *NewToS OPTIONAL,
1937 IN BOOLEAN *NewMakeCallback OPTIONAL
1946 return EFI_INVALID_PARAMETER;
1949 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
1950 Mode = Private->PxeBc.
Mode;
1952 if (!Mode->Started) {
1953 return EFI_NOT_STARTED;
1956 if (NewMakeCallback !=
NULL) {
1957 if (*NewMakeCallback) {
1961 Status =
gBS->HandleProtocol (
1962 Mode->UsingIpv6 ? Private->Ip6Nic->Controller : Private->Ip4Nic->Controller,
1963 &gEfiPxeBaseCodeCallbackProtocolGuid,
1964 (VOID **)&Private->PxeBcCallback
1967 if (EFI_ERROR (Status) || (Private->PxeBcCallback->Callback ==
NULL)) {
1968 return EFI_INVALID_PARAMETER;
1971 Private->PxeBcCallback =
NULL;
1974 Mode->MakeCallbacks = *NewMakeCallback;
1977 if (NewSendGUID !=
NULL) {
1979 DEBUG ((DEBUG_WARN,
"PXE: Failed to read system GUID from the smbios table!\n"));
1980 return EFI_INVALID_PARAMETER;
1983 Mode->SendGUID = *NewSendGUID;
1986 if (NewAutoArp !=
NULL) {
1987 Mode->AutoArp = *NewAutoArp;
1990 if (NewTTL !=
NULL) {
1991 Mode->TTL = *NewTTL;
1994 if (NewToS !=
NULL) {
1995 Mode->ToS = *NewToS;
2035 return EFI_INVALID_PARAMETER;
2039 return EFI_INVALID_PARAMETER;
2042 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
2043 Mode = Private->PxeBc.
Mode;
2046 if (!Mode->UsingIpv6 &&
2047 (NewSubnetMask !=
NULL) &&
2048 !IP4_IS_VALID_NETMASK (NTOHL (NewSubnetMask->Addr[0])))
2050 return EFI_INVALID_PARAMETER;
2053 if (!Mode->UsingIpv6 && (NewStationIp !=
NULL)) {
2054 if (IP4_IS_UNSPECIFIED (NTOHL (NewStationIp->Addr[0])) ||
2055 IP4_IS_LOCAL_BROADCAST (NTOHL (NewStationIp->Addr[0])) ||
2056 ((NewSubnetMask !=
NULL) && (NewSubnetMask->Addr[0] != 0) && !
NetIp4IsUnicast (NTOHL (NewStationIp->Addr[0]), NTOHL (NewSubnetMask->Addr[0]))))
2058 return EFI_INVALID_PARAMETER;
2062 if (!Mode->Started) {
2063 return EFI_NOT_STARTED;
2066 if (Mode->UsingIpv6 && (NewStationIp !=
NULL)) {
2071 if (EFI_ERROR (Status)) {
2076 if (NewStationIp !=
NULL) {
2081 if (!Mode->UsingIpv6 && (NewSubnetMask !=
NULL)) {
2087 if (!EFI_ERROR (Status)) {
2088 Private->IsAddressOk =
TRUE;
2131 IN BOOLEAN *NewDhcpDiscoverValid OPTIONAL,
2132 IN BOOLEAN *NewDhcpAckReceived OPTIONAL,
2133 IN BOOLEAN *NewProxyOfferReceived OPTIONAL,
2134 IN BOOLEAN *NewPxeDiscoverValid OPTIONAL,
2135 IN BOOLEAN *NewPxeReplyReceived OPTIONAL,
2136 IN BOOLEAN *NewPxeBisReplyReceived OPTIONAL,
2149 return EFI_INVALID_PARAMETER;
2152 Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This);
2153 Mode = Private->PxeBc.
Mode;
2155 if (!Mode->Started) {
2156 return EFI_NOT_STARTED;
2159 if (NewDhcpDiscoverValid !=
NULL) {
2160 Mode->DhcpDiscoverValid = *NewDhcpDiscoverValid;
2163 if (NewDhcpAckReceived !=
NULL) {
2164 Mode->DhcpAckReceived = *NewDhcpAckReceived;
2167 if (NewProxyOfferReceived !=
NULL) {
2168 Mode->ProxyOfferReceived = *NewProxyOfferReceived;
2171 if (NewPxeDiscoverValid !=
NULL) {
2172 Mode->PxeDiscoverValid = *NewPxeDiscoverValid;
2175 if (NewPxeReplyReceived !=
NULL) {
2176 Mode->PxeReplyReceived = *NewPxeReplyReceived;
2179 if (NewPxeBisReplyReceived !=
NULL) {
2180 Mode->PxeBisReplyReceived = *NewPxeBisReplyReceived;
2183 if (NewDhcpDiscover !=
NULL) {
2187 if (NewDhcpAck !=
NULL) {
2191 if (NewProxyOffer !=
NULL) {
2195 if (NewPxeDiscover !=
NULL) {
2199 if (NewPxeReply !=
NULL) {
2203 if (NewPxeBisReply !=
NULL) {
2211 EFI_PXE_BASE_CODE_PROTOCOL_REVISION,
2259 IN BOOLEAN Received,
2260 IN UINT32 PacketLength,
2272 if (!EFI_ERROR (Status)) {
2273 if ((Key.ScanCode == SCAN_ESC) || (Key.UnicodeChar == (0x1F &
'c'))) {
2274 return EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT;
2282 return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE;
2289 case EFI_PXE_BASE_CODE_FUNCTION_MTFTP:
2293 if ((PacketLength != 0) && (PacketPtr !=
NULL)) {
2294 if ((PacketPtr->Raw[0x1C] != 0x00) || (PacketPtr->Raw[0x1D] != 0x01)) {
2295 return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE;
2301 case EFI_PXE_BASE_CODE_FUNCTION_DHCP:
2302 case EFI_PXE_BASE_CODE_FUNCTION_DISCOVER:
2306 return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE;
2309 if ((PacketLength != 0) && (PacketPtr !=
NULL)) {
2316 return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE;
2357 IN BOOLEAN BootPolicy,
2359 IN VOID *Buffer OPTIONAL
2370 return EFI_INVALID_PARAMETER;
2377 return EFI_UNSUPPORTED;
2380 VirtualNic = PXEBC_VIRTUAL_NIC_FROM_LOADFILE (This);
2381 Private = VirtualNic->Private;
2382 PxeBc = &Private->PxeBc;
2384 Status = EFI_DEVICE_ERROR;
2392 return EFI_NO_MEDIA;
2398 if (VirtualNic == Private->Ip6Nic) {
2405 Status = PxeBc->Start (PxeBc, UsingIpv6);
2406 if ((Status == EFI_ALREADY_STARTED) && (UsingIpv6 != PxeBc->
Mode->UsingIpv6)) {
2410 Status = PxeBc->Stop (PxeBc);
2411 if (!EFI_ERROR (Status)) {
2412 Status = PxeBc->Start (PxeBc, UsingIpv6);
2416 if ((Status ==
EFI_SUCCESS) || (Status == EFI_ALREADY_STARTED)) {
2421 (Status != EFI_UNSUPPORTED) &&
2422 (Status != EFI_BUFFER_TOO_SMALL))
2430 PxeBc->Stop (PxeBc);
2437 if (!PxeBc->
Mode->UsingIpv6) {
2438 Private->Dhcp4->Stop (Private->Dhcp4);
2439 Private->Dhcp4->Configure (Private->Dhcp4,
NULL);
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define DEBUG(Expression)
#define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type, Value, ExtendedData, ExtendedDataSize)
BOOLEAN EFIAPI NetIp4IsUnicast(IN IP4_ADDR Ip, IN IP4_ADDR NetMask)
BOOLEAN EFIAPI NetIp6IsValidUnicast(IN EFI_IPv6_ADDRESS *Ip6)
EFI_STATUS EFIAPI NetLibDetectMediaWaitTimeout(IN EFI_HANDLE ServiceHandle, IN UINT64 Timeout, OUT EFI_STATUS *MediaState)
EFI_STATUS EFIAPI NetLibGetSystemGuid(OUT EFI_GUID *SystemGuid)
#define PcdGet64(TokenName)
#define EFI_PROGRESS_CODE
EFI_PXE_BASE_CODE_TFTP_OPCODE
#define EFI_PXE_BASE_CODE_MAX_IPCNT
#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION
EFI_PXE_BASE_CODE_FUNCTION
EFI_PXE_BASE_CODE_CALLBACK_STATUS
EFI_STATUS PxeBcDiscoverBootServer(IN PXEBC_PRIVATE_DATA *Private, IN UINT16 Type, IN UINT16 *Layer, IN BOOLEAN UseBis, IN EFI_IP_ADDRESS *DestIp, IN UINT16 IpCount, IN EFI_PXE_BASE_CODE_SRVLIST *SrvList)
EFI_STATUS PxeBcExtractDiscoverInfo(IN PXEBC_PRIVATE_DATA *Private, IN UINT16 Type, IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO **DiscoverInfo, OUT PXEBC_BOOT_SVR_ENTRY **BootEntry, OUT EFI_PXE_BASE_CODE_SRVLIST **SrvList)
EFI_STATUS PxeBcLoadBootFile(IN PXEBC_PRIVATE_DATA *Private, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL)
EFI_STATUS PxeBcSetIp4Policy(IN PXEBC_PRIVATE_DATA *Private)
VOID PxeBcSeedDhcp4Packet(OUT EFI_DHCP4_PACKET *Seed, IN EFI_UDP4_PROTOCOL *Udp4)
EFI_STATUS PxeBcDhcp4Dora(IN PXEBC_PRIVATE_DATA *Private, IN EFI_DHCP4_PROTOCOL *Dhcp4)
EFI_STATUS PxeBcParseDhcp4Packet(IN PXEBC_DHCP4_PACKET_CACHE *Cache4)
EFI_STATUS PxeBcRegisterIp6Address(IN PXEBC_PRIVATE_DATA *Private, IN EFI_IPv6_ADDRESS *Address)
VOID PxeBcUnregisterIp6Address(IN PXEBC_PRIVATE_DATA *Private)
EFI_STATUS PxeBcSetIp6Policy(IN PXEBC_PRIVATE_DATA *Private)
EFI_STATUS PxeBcParseDhcp6Packet(IN PXEBC_DHCP6_PACKET_CACHE *Cache6)
EFI_STATUS PxeBcDhcp6Sarr(IN PXEBC_PRIVATE_DATA *Private, IN EFI_DHCP6_PROTOCOL *Dhcp6)
EFI_STATUS EFIAPI EfiPxeBcUdpRead(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN UINT16 OpFlags, IN OUT EFI_IP_ADDRESS *DestIp OPTIONAL, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL, IN OUT EFI_IP_ADDRESS *SrcIp OPTIONAL, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL, IN UINTN *HeaderSize OPTIONAL, IN VOID *HeaderPtr OPTIONAL, IN OUT UINTN *BufferSize, IN VOID *BufferPtr)
EFI_STATUS EFIAPI EfiPxeBcSetStationIP(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_IP_ADDRESS *NewStationIp OPTIONAL, IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL)
EFI_STATUS EFIAPI EfiPxeBcStart(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN UseIpv6)
EFI_STATUS EFIAPI EfiPxeBcSetIpFilter(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter)
EFI_STATUS EFIAPI EfiPxeBcSetParameters(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN *NewAutoArp OPTIONAL, IN BOOLEAN *NewSendGUID OPTIONAL, IN UINT8 *NewTTL OPTIONAL, IN UINT8 *NewToS OPTIONAL, IN BOOLEAN *NewMakeCallback OPTIONAL)
EFI_STATUS EFIAPI EfiPxeBcSetPackets(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN *NewDhcpDiscoverValid OPTIONAL, IN BOOLEAN *NewDhcpAckReceived OPTIONAL, IN BOOLEAN *NewProxyOfferReceived OPTIONAL, IN BOOLEAN *NewPxeDiscoverValid OPTIONAL, IN BOOLEAN *NewPxeReplyReceived OPTIONAL, IN BOOLEAN *NewPxeBisReplyReceived OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply OPTIONAL, IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL)
EFI_STATUS EFIAPI EfiPxeLoadFile(IN EFI_LOAD_FILE_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize, IN VOID *Buffer OPTIONAL)
EFI_STATUS EFIAPI EfiPxeBcDhcp(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN BOOLEAN SortOffers)
EFI_STATUS EFIAPI EfiPxeBcMtftp(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation, IN OUT VOID *BufferPtr OPTIONAL, IN BOOLEAN Overwrite, IN OUT UINT64 *BufferSize, IN UINTN *BlockSize OPTIONAL, IN EFI_IP_ADDRESS *ServerIp, IN UINT8 *Filename, IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL, IN BOOLEAN DontUseBuffer)
EFI_STATUS EFIAPI EfiPxeBcStop(IN EFI_PXE_BASE_CODE_PROTOCOL *This)
EFI_STATUS EFIAPI EfiPxeBcUdpWrite(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN UINT16 OpFlags, IN EFI_IP_ADDRESS *DestIp, IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort, IN EFI_IP_ADDRESS *GatewayIp OPTIONAL, IN EFI_IP_ADDRESS *SrcIp OPTIONAL, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL, IN UINTN *HeaderSize OPTIONAL, IN VOID *HeaderPtr OPTIONAL, IN UINTN *BufferSize, IN VOID *BufferPtr)
EFI_PXE_BASE_CODE_CALLBACK_STATUS EFIAPI EfiPxeLoadFileCallback(IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *This, IN EFI_PXE_BASE_CODE_FUNCTION Function, IN BOOLEAN Received, IN UINT32 PacketLength, IN EFI_PXE_BASE_CODE_PACKET *PacketPtr OPTIONAL)
EFI_STATUS EFIAPI EfiPxeBcArp(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN EFI_IP_ADDRESS *IpAddr, IN EFI_MAC_ADDRESS *MacAddr OPTIONAL)
EFI_STATUS EFIAPI EfiPxeBcDiscover(IN EFI_PXE_BASE_CODE_PROTOCOL *This, IN UINT16 Type, IN UINT16 *Layer, IN BOOLEAN UseBis, IN EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL)
EFI_STATUS PxeBcTftpGetFileSize(IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN UINTN *WindowSize, IN OUT UINT64 *BufferSize)
EFI_STATUS PxeBcTftpReadDirectory(IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN UINTN *WindowSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer)
EFI_STATUS PxeBcTftpReadFile(IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, IN UINTN *WindowSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer)
EFI_STATUS PxeBcTftpWriteFile(IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN BOOLEAN Overwrite, IN UINTN *BlockSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize)
VOID EFIAPI PxeBcArpCacheUpdate(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS PxeBcUdp4Read(IN EFI_UDP4_PROTOCOL *Udp4, IN EFI_UDP4_COMPLETION_TOKEN *Token, IN EFI_PXE_BASE_CODE_MODE *Mode, IN EFI_EVENT TimeoutEvent, IN UINT16 OpFlags, IN BOOLEAN *IsDone, OUT BOOLEAN *IsMatched, IN OUT EFI_IP_ADDRESS *DestIp OPTIONAL, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL, IN OUT EFI_IP_ADDRESS *SrcIp OPTIONAL, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL)
EFI_STATUS PxeBcUdp4Write(IN EFI_UDP4_PROTOCOL *Udp4, IN EFI_UDP4_SESSION_DATA *Session, IN EFI_EVENT TimeoutEvent, IN EFI_IPv4_ADDRESS *Gateway OPTIONAL, IN UINTN *HeaderSize OPTIONAL, IN VOID *HeaderPtr OPTIONAL, IN UINTN *BufferSize, IN VOID *BufferPtr)
EFI_STATUS PxeBcFlushStationIp(PXEBC_PRIVATE_DATA *Private, EFI_IP_ADDRESS *StationIp OPTIONAL, EFI_IP_ADDRESS *SubnetMask OPTIONAL)
EFI_STATUS PxeBcUdp6Write(IN EFI_UDP6_PROTOCOL *Udp6, IN EFI_UDP6_SESSION_DATA *Session, IN EFI_EVENT TimeoutEvent, IN UINTN *HeaderSize OPTIONAL, IN VOID *HeaderPtr OPTIONAL, IN UINTN *BufferSize, IN VOID *BufferPtr)
EFI_STATUS PxeBcUdp6Read(IN EFI_UDP6_PROTOCOL *Udp6, IN EFI_UDP6_COMPLETION_TOKEN *Token, IN EFI_PXE_BASE_CODE_MODE *Mode, IN EFI_EVENT TimeoutEvent, IN UINT16 OpFlags, IN BOOLEAN *IsDone, OUT BOOLEAN *IsMatched, IN OUT EFI_IP_ADDRESS *DestIp OPTIONAL, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL, IN OUT EFI_IP_ADDRESS *SrcIp OPTIONAL, IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL)
VOID EFIAPI PxeBcIcmp6ErrorUpdate(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS PxeBcConfigUdp6Write(IN EFI_UDP6_PROTOCOL *Udp6, IN EFI_IPv6_ADDRESS *StationIp, IN OUT UINT16 *SrcPort)
VOID EFIAPI PxeBcCommonNotify(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI PxeBcIcmpErrorUpdate(IN EFI_EVENT Event, IN VOID *Context)
BOOLEAN PxeBcCheckArpCache(IN EFI_PXE_BASE_CODE_MODE *Mode, IN EFI_IPv4_ADDRESS *Ip4Addr, OUT EFI_MAC_ADDRESS *MacAddress)
EFI_STATUS PxeBcConfigUdp4Write(IN EFI_UDP4_PROTOCOL *Udp4, IN EFI_IPv4_ADDRESS *StationIp, IN EFI_IPv4_ADDRESS *SubnetMask, IN EFI_IPv4_ADDRESS *Gateway, IN OUT UINT16 *SrcPort, IN BOOLEAN DoNotFragment, IN UINT8 Ttl, IN UINT8 ToS)
#define EFI_NETWORK_UNREACHABLE
UINTN EFIAPI AsciiPrint(IN CONST CHAR8 *Format,...)
EFI_PXE_BASE_CODE_MODE * Mode
EFI_IPv4_ADDRESS SubnetMask
EFI_IPv4_ADDRESS StationAddress
EFI_IPv6_ADDRESS StationAddress
EFI_IPv6_ADDRESS StationIp
EFI_IPv6_ADDRESS ServerIp
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
EFI_UDP6_RECEIVE_DATA * RxData
BOOLEAN AcceptPromiscuous
EFI_IPv6_ADDRESS StationAddress
UINT32 FragmentLength
Length of the fragment data buffer.
VOID * FragmentBuffer
Pointer to the fragment data buffer.
EFI_UDP6_FRAGMENT_DATA FragmentTable[1]
EFI_IPv6_ADDRESS DestinationAddress
EFI_IPv6_ADDRESS SourceAddress