18 { 0xFF, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2 }
76 return EFI_INVALID_PARAMETER;
79 Instance = DHCP6_INSTANCE_FROM_THIS (This);
80 Service = Instance->Service;
85 if (Instance->Config ==
NULL) {
86 return EFI_ACCESS_DENIED;
89 ASSERT (Instance->IaCb.Ia !=
NULL);
95 return EFI_ALREADY_STARTED;
98 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
106 Status = EFI_NO_MEDIA;
110 Instance->UdpSts = EFI_ALREADY_STARTED;
117 if (EFI_ERROR (Status)) {
131 if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
135 gBS->RestoreTPL (OldTpl);
141 while (Instance->UdpSts == EFI_ALREADY_STARTED) {
142 Service->UdpIo->Protocol.Udp6->Poll (Service->UdpIo->Protocol.Udp6);
145 return Instance->UdpSts;
152 gBS->RestoreTPL (OldTpl);
184 return EFI_INVALID_PARAMETER;
187 Instance = DHCP6_INSTANCE_FROM_THIS (This);
188 Service = Instance->Service;
189 Udp6 = Service->UdpIo->Protocol.Udp6;
195 if (Instance->Config ==
NULL) {
199 ASSERT (Instance->IaCb.Ia !=
NULL);
215 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
217 Instance->UdpSts = EFI_ALREADY_STARTED;
219 gBS->RestoreTPL (OldTpl);
220 if (EFI_ERROR (Status)) {
228 ASSERT (Udp6 !=
NULL);
229 while (Instance->UdpSts == EFI_ALREADY_STARTED) {
233 Status = Instance->UdpSts;
240 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
242 gBS->RestoreTPL (OldTpl);
277 if ((This ==
NULL) || ((Dhcp6ModeData ==
NULL) && (Dhcp6ConfigData ==
NULL))) {
278 return EFI_INVALID_PARAMETER;
281 Instance = DHCP6_INSTANCE_FROM_THIS (This);
282 Service = Instance->Service;
284 if ((Instance->Config ==
NULL) && (Dhcp6ConfigData !=
NULL)) {
285 return EFI_ACCESS_DENIED;
288 ASSERT (Service->ClientId !=
NULL);
290 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
295 if (Dhcp6ConfigData !=
NULL) {
308 if (Dhcp6ModeData !=
NULL) {
313 IdSize = Service->ClientId->
Length +
sizeof (Service->ClientId->
Length);
316 if (Dhcp6ModeData->ClientId ==
NULL) {
321 Dhcp6ModeData->ClientId,
326 Ia = Instance->IaCb.Ia;
334 if (Dhcp6ModeData->Ia ==
NULL) {
349 if (Dhcp6ModeData->Ia->ReplyPacket ==
NULL) {
354 Dhcp6ModeData->Ia->ReplyPacket,
362 gBS->RestoreTPL (OldTpl);
368 if (Dhcp6ConfigData !=
NULL) {
372 if (Dhcp6ModeData !=
NULL) {
376 gBS->RestoreTPL (OldTpl);
378 return EFI_OUT_OF_RESOURCES;
425 return EFI_INVALID_PARAMETER;
428 Instance = DHCP6_INSTANCE_FROM_THIS (This);
429 Service = Instance->Service;
434 if (Dhcp6CfgData !=
NULL) {
435 if ((Dhcp6CfgData->OptionCount > 0) && (Dhcp6CfgData->OptionList ==
NULL)) {
436 return EFI_INVALID_PARAMETER;
439 if (Dhcp6CfgData->OptionList !=
NULL) {
440 for (Index = 0; Index < Dhcp6CfgData->OptionCount; Index++) {
441 if ((Dhcp6CfgData->OptionList[Index]->OpCode == Dhcp6OptClientId) ||
442 (Dhcp6CfgData->OptionList[Index]->OpCode == Dhcp6OptRapidCommit) ||
443 (Dhcp6CfgData->OptionList[Index]->OpCode == Dhcp6OptReconfigureAccept) ||
444 (Dhcp6CfgData->OptionList[Index]->OpCode == Dhcp6OptIana) ||
445 (Dhcp6CfgData->OptionList[Index]->OpCode == Dhcp6OptIata)
448 return EFI_INVALID_PARAMETER;
457 return EFI_INVALID_PARAMETER;
460 if ((Dhcp6CfgData->IaInfoEvent ==
NULL) && (Dhcp6CfgData->SolicitRetransmission ==
NULL)) {
461 return EFI_INVALID_PARAMETER;
464 if ((Dhcp6CfgData->SolicitRetransmission !=
NULL) &&
465 (Dhcp6CfgData->SolicitRetransmission->Mrc == 0) &&
466 (Dhcp6CfgData->SolicitRetransmission->Mrd == 0)
469 return EFI_INVALID_PARAMETER;
475 NET_LIST_FOR_EACH (Entry, &Service->Child) {
477 if ((Other->IaCb.Ia !=
NULL) &&
478 (Other->IaCb.Ia->
Descriptor.
Type == Dhcp6CfgData->IaDescriptor.Type) &&
479 (Other->IaCb.Ia->
Descriptor.
IaId == Dhcp6CfgData->IaDescriptor.IaId)
482 return EFI_INVALID_PARAMETER;
487 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
489 if (Dhcp6CfgData !=
NULL) {
493 if (Instance->Config !=
NULL) {
494 gBS->RestoreTPL (OldTpl);
495 return EFI_ACCESS_DENIED;
502 if (Instance->Config ==
NULL) {
503 gBS->RestoreTPL (OldTpl);
504 return EFI_OUT_OF_RESOURCES;
508 if (EFI_ERROR (Status)) {
510 gBS->RestoreTPL (OldTpl);
511 return EFI_OUT_OF_RESOURCES;
519 if (Instance->IaCb.Ia ==
NULL) {
522 gBS->RestoreTPL (OldTpl);
523 return EFI_OUT_OF_RESOURCES;
528 &Dhcp6CfgData->IaDescriptor,
532 if (Instance->Config ==
NULL) {
533 ASSERT (Instance->IaCb.Ia ==
NULL);
534 gBS->RestoreTPL (OldTpl);
542 gBS->RestoreTPL (OldTpl);
543 return EFI_ACCESS_DENIED;
548 Instance->Config =
NULL;
551 Instance->IaCb.Ia =
NULL;
554 gBS->RestoreTPL (OldTpl);
604 IN BOOLEAN SendClientId,
606 IN UINT32 OptionCount,
611 IN VOID *CallbackContext OPTIONAL
620 UINTN GetMappingTimeOut;
622 if ((This ==
NULL) || (OptionRequest ==
NULL) || (Retransmission ==
NULL) || (ReplyCallback ==
NULL)) {
623 return EFI_INVALID_PARAMETER;
626 if ((Retransmission !=
NULL) && (Retransmission->Mrc == 0) && (Retransmission->Mrd == 0)) {
627 return EFI_INVALID_PARAMETER;
630 if ((OptionCount > 0) && (OptionList ==
NULL)) {
631 return EFI_INVALID_PARAMETER;
634 if (OptionList !=
NULL) {
635 for (Index = 0; Index < OptionCount; Index++) {
636 if ((OptionList[Index]->OpCode == Dhcp6OptClientId) || (OptionList[Index]->OpCode == Dhcp6OptRequestOption)) {
637 return EFI_INVALID_PARAMETER;
642 Instance = DHCP6_INSTANCE_FROM_THIS (This);
643 Service = Instance->Service;
656 if (Status == EFI_NO_MAPPING) {
662 if (EFI_ERROR (Status)) {
666 Status =
gBS->CreateEvent (EVT_TIMER, TPL_CALLBACK,
NULL,
NULL, &Timer);
667 if (EFI_ERROR (Status)) {
675 if (EFI_ERROR (Status)) {
676 gBS->CloseEvent (Timer);
681 TimerStatus =
gBS->CheckEvent (Timer);
682 if (!EFI_ERROR (TimerStatus)) {
695 }
while (TimerStatus == EFI_NOT_READY);
697 gBS->CloseEvent (Timer);
700 if (EFI_ERROR (Status)) {
707 if (TimeoutEvent ==
NULL) {
708 while (Instance->UdpSts == EFI_ALREADY_STARTED) {
709 Service->UdpIo->Protocol.Udp6->Poll (Service->UdpIo->Protocol.Udp6);
712 return Instance->UdpSts;
767 IN BOOLEAN RebindRequest
776 return EFI_INVALID_PARAMETER;
779 Instance = DHCP6_INSTANCE_FROM_THIS (This);
780 Service = Instance->Service;
785 if (Instance->Config ==
NULL) {
786 return EFI_ACCESS_DENIED;
789 ASSERT (Instance->IaCb.Ia !=
NULL);
798 return EFI_ALREADY_STARTED;
802 return EFI_ACCESS_DENIED;
805 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
806 Instance->UdpSts = EFI_ALREADY_STARTED;
813 if (EFI_ERROR (Status)) {
827 if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
831 gBS->RestoreTPL (OldTpl);
837 while (Instance->UdpSts == EFI_ALREADY_STARTED) {
838 Service->UdpIo->Protocol.Udp6->Poll (Service->UdpIo->Protocol.Udp6);
841 return Instance->UdpSts;
848 gBS->RestoreTPL (OldTpl);
888 IN UINT32 AddressCount,
898 if ((This ==
NULL) || (AddressCount == 0) || (Addresses ==
NULL)) {
899 return EFI_INVALID_PARAMETER;
902 Instance = DHCP6_INSTANCE_FROM_THIS (This);
903 Service = Instance->Service;
908 if (Instance->Config ==
NULL) {
909 return EFI_ACCESS_DENIED;
912 ASSERT (Instance->IaCb.Ia !=
NULL);
915 return EFI_ACCESS_DENIED;
923 if (EFI_ERROR (Status)) {
927 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
928 Instance->UdpSts = EFI_ALREADY_STARTED;
937 Status = EFI_OUT_OF_RESOURCES;
946 if (EFI_ERROR (Status)) {
960 if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
965 gBS->RestoreTPL (OldTpl);
971 while (Instance->UdpSts == EFI_ALREADY_STARTED) {
972 Service->UdpIo->Protocol.Udp6->Poll (Service->UdpIo->Protocol.Udp6);
975 return Instance->UdpSts;
986 gBS->RestoreTPL (OldTpl);
1029 IN UINT32 AddressCount,
1039 if ((This ==
NULL) || ((AddressCount != 0) && (Addresses ==
NULL))) {
1040 return EFI_INVALID_PARAMETER;
1043 Instance = DHCP6_INSTANCE_FROM_THIS (This);
1044 Service = Instance->Service;
1049 if (Instance->Config ==
NULL) {
1050 return EFI_ACCESS_DENIED;
1053 ASSERT (Instance->IaCb.Ia !=
NULL);
1056 return EFI_ACCESS_DENIED;
1064 if (EFI_ERROR (Status)) {
1068 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1069 Instance->UdpSts = EFI_ALREADY_STARTED;
1077 if (RelIa ==
NULL) {
1078 Status = EFI_OUT_OF_RESOURCES;
1087 if (EFI_ERROR (Status)) {
1101 if (EFI_ERROR (Status) && (Status != EFI_ALREADY_STARTED)) {
1106 gBS->RestoreTPL (OldTpl);
1112 while (Instance->UdpSts == EFI_ALREADY_STARTED) {
1113 Service->UdpIo->Protocol.Udp6->Poll (Service->UdpIo->Protocol.Udp6);
1116 return Instance->UdpSts;
1123 if (RelIa !=
NULL) {
1127 gBS->RestoreTPL (OldTpl);
1153 IN OUT UINT32 *OptionCount,
1163 if ((This ==
NULL) || (Packet ==
NULL) || (OptionCount ==
NULL)) {
1164 return EFI_INVALID_PARAMETER;
1167 if ((*OptionCount != 0) && (PacketOptionList ==
NULL)) {
1168 return EFI_INVALID_PARAMETER;
1171 if ((Packet->Length > Packet->Size) || (Packet->Length < sizeof (
EFI_DHCP6_HEADER))) {
1172 return EFI_INVALID_PARAMETER;
1189 Start = Packet->Dhcp6.Option;
1190 End = Start + OptLen;
1195 while (Start < End) {
1197 Start += (NTOHS (DataLen) + 4);
1205 if (OptCnt > *OptionCount) {
1206 *OptionCount = OptCnt;
1207 return EFI_BUFFER_TOO_SMALL;
1216 Start = Packet->Dhcp6.Option;
1218 while (Start < End) {
1221 Start += (NTOHS (DataLen) + 4);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define EFI_DHCP6_IA_TYPE_NA
EFI_STATUS(EFIAPI * EFI_DHCP6_INFO_CALLBACK)(IN EFI_DHCP6_PROTOCOL *This, IN VOID *Context, IN EFI_DHCP6_PACKET *Packet)
#define EFI_DHCP6_IA_TYPE_TA
EFI_STATUS EFIAPI EfiDhcp6Release(IN EFI_DHCP6_PROTOCOL *This, IN UINT32 AddressCount, IN EFI_IPv6_ADDRESS *Addresses)
EFI_STATUS EFIAPI EfiDhcp6Decline(IN EFI_DHCP6_PROTOCOL *This, IN UINT32 AddressCount, IN EFI_IPv6_ADDRESS *Addresses)
EFI_STATUS EFIAPI EfiDhcp6Parse(IN EFI_DHCP6_PROTOCOL *This, IN EFI_DHCP6_PACKET *Packet, IN OUT UINT32 *OptionCount, OUT EFI_DHCP6_PACKET_OPTION *PacketOptionList[] OPTIONAL)
EFI_STATUS EFIAPI EfiDhcp6Configure(IN EFI_DHCP6_PROTOCOL *This, IN EFI_DHCP6_CONFIG_DATA *Dhcp6CfgData OPTIONAL)
EFI_STATUS EFIAPI EfiDhcp6InfoRequest(IN EFI_DHCP6_PROTOCOL *This, IN BOOLEAN SendClientId, IN EFI_DHCP6_PACKET_OPTION *OptionRequest, IN UINT32 OptionCount, IN EFI_DHCP6_PACKET_OPTION *OptionList[] OPTIONAL, IN EFI_DHCP6_RETRANSMISSION *Retransmission, IN EFI_EVENT TimeoutEvent OPTIONAL, IN EFI_DHCP6_INFO_CALLBACK ReplyCallback, IN VOID *CallbackContext OPTIONAL)
EFI_STATUS EFIAPI EfiDhcp6RenewRebind(IN EFI_DHCP6_PROTOCOL *This, IN BOOLEAN RebindRequest)
EFI_STATUS EFIAPI EfiDhcp6Start(IN EFI_DHCP6_PROTOCOL *This)
EFI_STATUS EFIAPI EfiDhcp6GetModeData(IN EFI_DHCP6_PROTOCOL *This, OUT EFI_DHCP6_MODE_DATA *Dhcp6ModeData OPTIONAL, OUT EFI_DHCP6_CONFIG_DATA *Dhcp6ConfigData OPTIONAL)
EFI_STATUS EFIAPI EfiDhcp6Stop(IN EFI_DHCP6_PROTOCOL *This)
EFI_STATUS Dhcp6SendReleaseMsg(IN DHCP6_INSTANCE *Instance, IN EFI_DHCP6_IA *RelIa)
VOID EFIAPI Dhcp6ReceivePacket(IN NET_BUF *Udp6Wrap, IN UDP_END_POINT *EndPoint, IN EFI_STATUS IoStatus, IN VOID *Context)
VOID Dhcp6CleanupSession(IN OUT DHCP6_INSTANCE *Instance, IN EFI_STATUS Status)
EFI_STATUS Dhcp6StartInfoRequest(IN DHCP6_INSTANCE *Instance, IN BOOLEAN SendClientId, IN EFI_DHCP6_PACKET_OPTION *OptionRequest, IN UINT32 OptionCount, IN EFI_DHCP6_PACKET_OPTION *OptionList[] OPTIONAL, IN EFI_DHCP6_RETRANSMISSION *Retransmission, IN EFI_EVENT TimeoutEvent OPTIONAL, IN EFI_DHCP6_INFO_CALLBACK ReplyCallback, IN VOID *CallbackContext OPTIONAL)
EFI_STATUS Dhcp6SendDeclineMsg(IN DHCP6_INSTANCE *Instance, IN EFI_DHCP6_IA *DecIa)
EFI_STATUS Dhcp6SendSolicitMsg(IN DHCP6_INSTANCE *Instance)
EFI_STATUS Dhcp6SendRenewRebindMsg(IN DHCP6_INSTANCE *Instance, IN BOOLEAN RebindRequest)
EFI_STATUS Dhcp6CopyConfigData(IN EFI_DHCP6_CONFIG_DATA *DstCfg, IN EFI_DHCP6_CONFIG_DATA *SorCfg)
EFI_DHCP6_IA * Dhcp6DepriveAddress(IN EFI_DHCP6_IA *Ia, IN UINT32 AddressCount, IN EFI_IPv6_ADDRESS *Addresses)
VOID Dhcp6CleanupModeData(IN OUT EFI_DHCP6_MODE_DATA *ModeData)
EFI_STATUS Dhcp6CheckAddress(IN EFI_DHCP6_IA *Ia, IN UINT32 AddressCount, IN EFI_IPv6_ADDRESS *Addresses)
EFI_STATUS Dhcp6GetMappingTimeOut(IN EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg, OUT UINTN *TimeOut)
VOID Dhcp6CleanupConfigData(IN OUT EFI_DHCP6_CONFIG_DATA *CfgData)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS EFIAPI NetLibDetectMediaWaitTimeout(IN EFI_HANDLE ServiceHandle, IN UINT64 Timeout, OUT EFI_STATUS *MediaState)
EFI_STATUS EFIAPI UdpIoRecvDatagram(IN UDP_IO *UdpIo, IN UDP_IO_CALLBACK CallBack, IN VOID *Context, IN UINT32 HeadLen)
UINT16 Type
Type for an IA.
UINT32 IaId
The identifier for an IA.
EFI_DHCP6_PACKET * ReplyPacket
EFI_DHCP6_IA_DESCRIPTOR Descriptor