13LIST_ENTRY mIp4Config2InstanceList = { &mIp4Config2InstanceList, &mIp4Config2InstanceList };
48 Dhcp4 = Instance->Dhcp4;
49 ASSERT (Dhcp4 !=
NULL);
52 Dhcp4->Configure (Dhcp4,
NULL);
53 Instance->Dhcp4 =
NULL;
55 IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
60 Status =
gBS->CloseProtocol (
61 Instance->Dhcp4Handle,
62 &gEfiDhcp4ProtocolGuid,
66 if (EFI_ERROR (Status)) {
73 &gEfiDhcp4ServiceBindingProtocolGuid,
77 Instance->Dhcp4Handle =
NULL;
106 if (IpSb->DefaultInterface !=
NULL) {
107 if (IpSb->DefaultRouteTable !=
NULL) {
109 IpSb->DefaultRouteTable =
NULL;
115 IpSb->DefaultInterface =
NULL;
129 if (RouteTable ==
NULL) {
134 IpSb->DefaultInterface = IpIf;
136 IpSb->DefaultRouteTable = RouteTable;
139 if ((IpSb->State == IP4_SERVICE_CONFIGED) || (IpSb->State == IP4_SERVICE_STARTED)) {
140 IpSb->State = IP4_SERVICE_UNSTARTED;
205 Status =
gRT->GetVariable (
207 &gEfiIp4Config2ProtocolGuid,
213 if (Status == EFI_BUFFER_TOO_SMALL) {
218 if (Variable ==
NULL) {
219 return EFI_OUT_OF_RESOURCES;
222 Status =
gRT->GetVariable (
224 &gEfiIp4Config2ProtocolGuid,
229 if (EFI_ERROR (Status) || ((UINT16)(~
NetblockChecksum ((UINT8 *)Variable, (UINT32)VarSize)) != 0)) {
242 &gEfiIp4Config2ProtocolGuid,
243 IP4_CONFIG2_VARIABLE_ATTRIBUTE,
248 return EFI_NOT_FOUND;
251 for (Index = 0; Index < Variable->DataRecordCount; Index++) {
252 CopyMem (&DataRecord, &Variable->DataRecord[Index], sizeof (DataRecord));
254 DataItem = &Instance->DataItem[DataRecord.DataType];
255 if (DATA_ATTRIB_SET (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED) &&
256 (DataItem->DataSize != DataRecord.DataSize)
265 if (!DATA_ATTRIB_SET (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED)) {
269 DataItem->Data.Ptr =
AllocatePool (DataRecord.DataSize);
270 if (DataItem->Data.Ptr ==
NULL) {
278 Data = (CHAR8 *)Variable + DataRecord.Offset;
279 CopyMem (DataItem->Data.Ptr, Data, DataRecord.DataSize);
281 DataItem->DataSize = DataRecord.DataSize;
318 for (Index = 0; Index < Ip4Config2DataTypeMaximum; Index++) {
319 DataItem = &Instance->DataItem[Index];
320 if (!DATA_ATTRIB_SET (DataItem->Attribute, DATA_ATTRIB_VOLATILE) && !EFI_ERROR (DataItem->Status)) {
326 if (Variable ==
NULL) {
327 return EFI_OUT_OF_RESOURCES;
330 Heap = (CHAR8 *)Variable + VarSize;
331 Variable->DataRecordCount = 0;
333 for (Index = 0; Index < Ip4Config2DataTypeMaximum; Index++) {
334 DataItem = &Instance->DataItem[Index];
335 if (!DATA_ATTRIB_SET (DataItem->Attribute, DATA_ATTRIB_VOLATILE) && !EFI_ERROR (DataItem->Status)) {
336 Heap -= DataItem->DataSize;
337 CopyMem (Heap, DataItem->Data.Ptr, DataItem->DataSize);
339 DataRecord = &Variable->DataRecord[Variable->DataRecordCount];
341 DataRecord->DataSize = (UINT32)DataItem->DataSize;
342 DataRecord->Offset = (UINT16)(Heap - (CHAR8 *)Variable);
344 Variable->DataRecordCount++;
348 Variable->Checksum = 0;
349 Variable->Checksum = (UINT16) ~
NetblockChecksum ((UINT8 *)Variable, (UINT32)VarSize);
351 Status =
gRT->SetVariable (
353 &gEfiIp4Config2ProtocolGuid,
354 IP4_CONFIG2_VARIABLE_ATTRIBUTE,
387 if (IpSb->DefaultRouteTable ==
NULL) {
388 return EFI_NOT_FOUND;
391 Count = IpSb->DefaultRouteTable->TotalNum;
394 return EFI_NOT_FOUND;
405 for (Index = IP4_MASK_MAX; Index >= 0; Index--) {
406 NET_LIST_FOR_EACH (Entry, &(IpSb->DefaultRouteTable->RouteArea[Index])) {
409 EFI_IP4 (Table[Count].SubnetAddress) = HTONL (RtEntry->Dest & RtEntry->Netmask);
410 EFI_IP4 (Table[Count].SubnetMask) = HTONL (RtEntry->Netmask);
411 EFI_IP4 (Table[Count].GatewayAddress) = HTONL (RtEntry->NextHop);
463 IN IP4_ADDR StationAddress,
464 IN IP4_ADDR SubnetMask
475 IpIf = IpSb->DefaultInterface;
476 ASSERT (IpIf !=
NULL);
478 if ((IpIf->Ip == StationAddress) && (IpIf->SubnetMask == SubnetMask)) {
479 IpSb->State = IP4_SERVICE_CONFIGED;
483 if (IpSb->Reconfig) {
487 if (IpSb->DefaultRouteTable !=
NULL) {
489 IpSb->DefaultRouteTable =
NULL;
494 IpSb->DefaultInterface =
NULL;
500 return EFI_OUT_OF_RESOURCES;
504 if (RouteTable ==
NULL) {
506 return EFI_OUT_OF_RESOURCES;
509 IpSb->DefaultInterface = IpIf;
511 IpSb->DefaultRouteTable = RouteTable;
515 if (IpSb->State == IP4_SERVICE_CONFIGED) {
516 IpSb->State = IP4_SERVICE_UNSTARTED;
520 if (EFI_ERROR (Status)) {
524 if (IpIf->Arp !=
NULL) {
531 NET_LIST_FOR_EACH (Entry, &IpIf->IpInstances) {
532 Ip4Instance = NET_LIST_USER_STRUCT_S (Entry,
IP4_PROTOCOL, AddrLink, IP4_PROTOCOL_SIGNATURE);
533 Status =
gBS->OpenProtocol (
535 &gEfiArpProtocolGuid,
539 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
541 if (EFI_ERROR (Status)) {
550 Subnet = StationAddress & SubnetMask;
553 IpSb->DefaultRouteTable,
559 IpSb->State = IP4_SERVICE_CONFIGED;
560 IpSb->Reconfig =
FALSE;
580 IN IP4_ADDR StationAddress,
581 IN IP4_ADDR SubnetMask,
582 IN IP4_ADDR GatewayAddress
588 IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
594 return EFI_INVALID_PARAMETER;
598 if (EFI_ERROR (Status)) {
605 if (GatewayAddress != IP4_ALLZERO_ADDRESS) {
607 IpSb->DefaultRouteTable,
632 IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
634 if (Instance->Dhcp4 !=
NULL) {
635 Instance->Dhcp4->Stop (Instance->Dhcp4);
638 Instance->Dhcp4Handle,
639 &gEfiDhcp4ProtocolGuid,
644 Instance->Dhcp4 =
NULL;
647 if (Instance->Dhcp4Handle !=
NULL) {
651 &gEfiDhcp4ServiceBindingProtocolGuid,
652 Instance->Dhcp4Handle
655 Instance->Dhcp4Handle =
NULL;
658 if (Instance->Dhcp4Event !=
NULL) {
659 gBS->CloseEvent (Instance->Dhcp4Event);
660 Instance->Dhcp4Event =
NULL;
702 return EFI_BAD_BUFFER_SIZE;
707 OldDns = Item->Data.DnsServers;
712 if (NewDnsCount != OldDnsCount) {
715 return EFI_OUT_OF_RESOURCES;
721 for (NewIndex = 0; NewIndex < NewDnsCount; NewIndex++) {
722 CopyMem (&DnsAddress, NewDns + NewIndex,
sizeof (IP4_ADDR));
723 if (IP4_IS_UNSPECIFIED (NTOHL (DnsAddress)) || IP4_IS_LOCAL_BROADCAST (NTOHL (DnsAddress))) {
731 return EFI_INVALID_PARAMETER;
742 for (OldIndex = 0; OldIndex < OldDnsCount; OldIndex++) {
743 if (EFI_IP4_EQUAL (NewDns + NewIndex, OldDns + OldIndex)) {
751 if (OldIndex == OldDnsCount) {
756 if (!OneAdded && (DataSize == Item->DataSize)) {
764 if (Item->Data.Ptr !=
NULL) {
768 Item->Data.Ptr = Tmp;
771 CopyMem (Item->Data.Ptr, Data, DataSize);
772 Item->DataSize = DataSize;
798 IP4_ADDR StationAddress;
800 IP4_ADDR GatewayAddress;
806 ASSERT (Instance->Dhcp4 !=
NULL);
811 Status = Instance->Dhcp4->GetModeData (Instance->Dhcp4, &Dhcp4Mode);
813 if (EFI_ERROR (Status)) {
819 SubnetMask = EFI_NTOHL (Dhcp4Mode.
SubnetMask);
823 if (EFI_ERROR (Status)) {
833 Status = Instance->Dhcp4->Parse (Instance->Dhcp4, Dhcp4Mode.
ReplyPacket, &OptionCount, OptionList);
834 if (Status != EFI_BUFFER_TOO_SMALL) {
839 if (OptionList ==
NULL) {
843 Status = Instance->Dhcp4->Parse (Instance->Dhcp4, Dhcp4Mode.
ReplyPacket, &OptionCount, OptionList);
844 if (EFI_ERROR (Status)) {
849 for (Index = 0; Index < OptionCount; Index++) {
853 if (OptionList[Index]->OpCode == DHCP4_TAG_DNS_SERVER) {
854 if (((OptionList[Index]->Length & 0x3) != 0) || (OptionList[Index]->Length == 0)) {
865 Instance->DhcpSuccess =
TRUE;
896 IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
898 if (IpSb->State > IP4_SERVICE_UNSTARTED) {
906 if (Instance->Dhcp4Handle !=
NULL) {
913 &gEfiDhcp4ServiceBindingProtocolGuid,
914 &Instance->Dhcp4Handle
917 if (Status == EFI_UNSUPPORTED) {
921 if (Instance->Dhcp4SbNotifyEvent ==
NULL) {
923 &gEfiDhcp4ServiceBindingProtocolGuid,
927 &Instance->Registration
932 if (EFI_ERROR (Status)) {
936 if (Instance->Dhcp4SbNotifyEvent !=
NULL) {
937 gBS->CloseEvent (Instance->Dhcp4SbNotifyEvent);
940 Status =
gBS->OpenProtocol (
941 Instance->Dhcp4Handle,
942 &gEfiDhcp4ProtocolGuid,
943 (VOID **)&Instance->Dhcp4,
946 EFI_OPEN_PROTOCOL_BY_DRIVER
948 if (EFI_ERROR (Status)) {
952 &gEfiDhcp4ServiceBindingProtocolGuid,
953 Instance->Dhcp4Handle
956 Instance->Dhcp4Handle =
NULL;
965 Dhcp4 = Instance->Dhcp4;
966 Status = Dhcp4->GetModeData (Dhcp4, &Dhcp4Mode);
978 ParaList.Head.
OpCode = DHCP4_TAG_PARA_LIST;
980 ParaList.Head.
Data[0] = DHCP4_TAG_NETMASK;
981 ParaList.Route = DHCP4_TAG_ROUTER;
982 ParaList.Dns = DHCP4_TAG_DNS_SERVER;
983 OptionList[0] = &ParaList.Head;
987 Status = Dhcp4->Configure (Dhcp4, &Dhcp4Mode.
ConfigData);
988 if (EFI_ERROR (Status)) {
990 Instance->Dhcp4Handle,
991 &gEfiDhcp4ProtocolGuid,
999 &gEfiDhcp4ServiceBindingProtocolGuid,
1000 Instance->Dhcp4Handle
1003 Instance->Dhcp4 =
NULL;
1005 Instance->Dhcp4Handle =
NULL;
1013 Status =
gBS->CreateEvent (
1018 &Instance->Dhcp4Event
1020 if (EFI_ERROR (Status)) {
1025 Status = Dhcp4->Start (Dhcp4, Instance->Dhcp4Event);
1026 if (EFI_ERROR (Status)) {
1028 gBS->CloseEvent (Instance->Dhcp4Event);
1029 Instance->Dhcp4Event =
NULL;
1034 IpSb->State = IP4_SERVICE_STARTED;
1061 IN VOID *Data OPTIONAL
1070 IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
1073 if (IpSb->DefaultRouteTable !=
NULL) {
1077 if (*DataSize < Length) {
1079 return EFI_BUFFER_TOO_SMALL;
1092 if (IpSb->DefaultInterface !=
NULL) {
1093 Address = HTONL (IpSb->DefaultInterface->Ip);
1095 Address = HTONL (IpSb->DefaultInterface->SubnetMask);
1099 if (IpSb->DefaultRouteTable !=
NULL) {
1137 return EFI_BAD_BUFFER_SIZE;
1142 if (NewPolicy >= Ip4Config2PolicyMax) {
1143 return EFI_INVALID_PARAMETER;
1146 if (NewPolicy == Instance->Policy) {
1156 if (DataItem->Data.Ptr !=
NULL) {
1160 DataItem->Data.Ptr =
NULL;
1161 DataItem->DataSize = 0;
1162 DataItem->Status = EFI_NOT_FOUND;
1166 if (DataItem->Data.Ptr !=
NULL) {
1170 DataItem->Data.Ptr =
NULL;
1171 DataItem->DataSize = 0;
1172 DataItem->Status = EFI_NOT_FOUND;
1176 if (DataItem->Data.Ptr !=
NULL) {
1180 DataItem->Data.Ptr =
NULL;
1181 DataItem->DataSize = 0;
1182 DataItem->Status = EFI_NOT_FOUND;
1186 SET_DATA_ATTRIB (DataItem->Attribute, DATA_ATTRIB_VOLATILE);
1192 if (Instance->Dhcp4Handle !=
NULL) {
1199 if (Instance->Dhcp4Event !=
NULL) {
1200 gBS->CloseEvent (Instance->Dhcp4Event);
1201 Instance->Dhcp4Event =
NULL;
1206 IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
1209 Instance->Policy = NewPolicy;
1245 IP4_ADDR StationAddress;
1246 IP4_ADDR SubnetMask;
1258 IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
1263 return EFI_BAD_BUFFER_SIZE;
1267 return EFI_WRITE_PROTECTED;
1272 if ((Data !=
NULL) && (DataSize != 0)) {
1275 StationAddress = EFI_NTOHL (NewAddress.
Address);
1276 SubnetMask = EFI_NTOHL (NewAddress.
SubnetMask);
1282 return EFI_INVALID_PARAMETER;
1291 return EFI_OUT_OF_RESOURCES;
1294 if (DataItem->Data.Ptr !=
NULL) {
1298 DataItem->Data.Ptr = Ptr;
1299 DataItem->DataSize = DataSize;
1300 DataItem->Status = EFI_NOT_READY;
1302 IpSb->Reconfig =
TRUE;
1305 DataItem->Status = Status;
1307 if (EFI_ERROR (DataItem->Status) && (DataItem->Status != EFI_NOT_READY)) {
1312 DataItem->Data.Ptr =
NULL;
1318 if (DataItem->Data.Ptr !=
NULL) {
1322 DataItem->Data.Ptr =
NULL;
1323 DataItem->DataSize = 0;
1324 DataItem->Status = EFI_NOT_FOUND;
1329 if (IpSb->DefaultInterface !=
NULL) {
1330 if (IpSb->DefaultRouteTable !=
NULL) {
1332 IpSb->DefaultRouteTable =
NULL;
1338 IpSb->DefaultInterface =
NULL;
1348 return EFI_OUT_OF_RESOURCES;
1352 if (RouteTable ==
NULL) {
1354 return EFI_OUT_OF_RESOURCES;
1357 IpSb->DefaultInterface = IpIf;
1359 IpSb->DefaultRouteTable = RouteTable;
1365 if ((IpSb->State == IP4_SERVICE_CONFIGED) || (IpSb->State == IP4_SERVICE_STARTED)) {
1366 IpSb->State = IP4_SERVICE_UNSTARTED;
1410 UINTN OldGatewayCount;
1411 UINTN NewGatewayCount;
1423 return EFI_BAD_BUFFER_SIZE;
1427 return EFI_WRITE_PROTECTED;
1430 IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
1433 OldGateway = DataItem->Data.Gateway;
1436 for (Index1 = 0; Index1 < OldGatewayCount; Index1++) {
1440 CopyMem (&Gateway, OldGateway + Index1,
sizeof (IP4_ADDR));
1442 IpSb->DefaultRouteTable,
1443 IP4_ALLZERO_ADDRESS,
1444 IP4_ALLZERO_ADDRESS,
1450 if ((Data !=
NULL) && (DataSize != 0)) {
1453 for (Index1 = 0; Index1 < NewGatewayCount; Index1++) {
1454 CopyMem (&Gateway, NewGateway + Index1,
sizeof (IP4_ADDR));
1456 if ((IpSb->DefaultInterface->SubnetMask != 0) &&
1457 !
NetIp4IsUnicast (NTOHL (Gateway), IpSb->DefaultInterface->SubnetMask))
1459 return EFI_INVALID_PARAMETER;
1462 for (Index2 = Index1 + 1; Index2 < NewGatewayCount; Index2++) {
1463 if (EFI_IP4_EQUAL (NewGateway + Index1, NewGateway + Index2)) {
1464 return EFI_INVALID_PARAMETER;
1469 if (NewGatewayCount != OldGatewayCount) {
1472 return EFI_OUT_OF_RESOURCES;
1478 for (Index1 = 0; Index1 < NewGatewayCount; Index1++) {
1482 CopyMem (&Gateway, NewGateway + Index1,
sizeof (IP4_ADDR));
1484 IpSb->DefaultRouteTable,
1485 IP4_ALLZERO_ADDRESS,
1486 IP4_ALLZERO_ADDRESS,
1493 if (!OneRemoved && !OneAdded) {
1498 if (DataItem->Data.Ptr !=
NULL) {
1502 DataItem->Data.Ptr = Tmp;
1505 CopyMem (DataItem->Data.Ptr, Data, DataSize);
1506 DataItem->DataSize = DataSize;
1513 if (DataItem->Data.Ptr !=
NULL) {
1517 DataItem->Data.Ptr =
NULL;
1518 DataItem->DataSize = 0;
1519 DataItem->Status = EFI_NOT_FOUND;
1561 return EFI_WRITE_PROTECTED;
1566 if (DATA_ATTRIB_SET (Item->Attribute, DATA_ATTRIB_VOLATILE)) {
1567 REMOVE_DATA_ATTRIB (Item->Attribute, DATA_ATTRIB_VOLATILE);
1570 if ((Data !=
NULL) && (DataSize != 0)) {
1576 if (Item->Data.Ptr !=
NULL) {
1580 Item->Data.Ptr =
NULL;
1582 Item->Status = EFI_NOT_FOUND;
1606 IpSb->Ip4Config2Instance.IfIndex
1609 IfInfo->IfType = IpSb->SnpMode.IfType;
1610 IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;
1611 CopyMem (&IfInfo->HwAddress, &IpSb->SnpMode.CurrentAddress, IfInfo->HwAddressSize);
1675 if ((This ==
NULL) || ((Data ==
NULL) && (DataSize != 0)) || ((Data !=
NULL) && (DataSize == 0))) {
1676 return EFI_INVALID_PARAMETER;
1679 if (DataType >= Ip4Config2DataTypeMaximum) {
1680 return EFI_UNSUPPORTED;
1683 Instance = IP4_CONFIG2_INSTANCE_FROM_PROTOCOL (This);
1684 IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
1685 NET_CHECK_SIGNATURE (IpSb, IP4_SERVICE_SIGNATURE);
1687 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1689 Status = Instance->DataItem[DataType].Status;
1690 if (Status != EFI_NOT_READY) {
1691 if (Instance->DataItem[DataType].SetData ==
NULL) {
1695 Status = EFI_WRITE_PROTECTED;
1697 Status = Instance->DataItem[DataType].SetData (Instance, DataSize, Data);
1698 if (!EFI_ERROR (Status)) {
1704 }
else if (Status == EFI_ABORTED) {
1717 Status = EFI_ACCESS_DENIED;
1720 gBS->RestoreTPL (OldTpl);
1769 IN VOID *Data OPTIONAL
1777 if ((This ==
NULL) || (DataSize ==
NULL) || ((*DataSize != 0) && (Data ==
NULL))) {
1778 return EFI_INVALID_PARAMETER;
1781 if (DataType >= Ip4Config2DataTypeMaximum) {
1782 return EFI_NOT_FOUND;
1785 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1787 Instance = IP4_CONFIG2_INSTANCE_FROM_PROTOCOL (This);
1788 DataItem = &Instance->DataItem[DataType];
1790 Status = Instance->DataItem[DataType].Status;
1791 if (!EFI_ERROR (Status)) {
1792 if (DataItem->GetData !=
NULL) {
1793 Status = DataItem->GetData (Instance, DataSize, Data);
1794 }
else if (*DataSize < Instance->DataItem[DataType].DataSize) {
1798 *DataSize = Instance->DataItem[DataType].DataSize;
1799 Status = EFI_BUFFER_TOO_SMALL;
1801 *DataSize = Instance->DataItem[DataType].DataSize;
1802 CopyMem (Data, Instance->DataItem[DataType].Data.Ptr, *DataSize);
1806 gBS->RestoreTPL (OldTpl);
1847 if ((This ==
NULL) || (Event ==
NULL)) {
1848 return EFI_INVALID_PARAMETER;
1851 if (DataType >= Ip4Config2DataTypeMaximum) {
1852 return EFI_UNSUPPORTED;
1855 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1857 Instance = IP4_CONFIG2_INSTANCE_FROM_PROTOCOL (This);
1858 EventMap = &Instance->DataItem[DataType].EventMap;
1867 if (EFI_ERROR (Status)) {
1868 Status = EFI_OUT_OF_RESOURCES;
1871 Status = EFI_ACCESS_DENIED;
1874 gBS->RestoreTPL (OldTpl);
1907 if ((This ==
NULL) || (Event ==
NULL)) {
1908 return EFI_INVALID_PARAMETER;
1911 if (DataType >= Ip4Config2DataTypeMaximum) {
1912 return EFI_NOT_FOUND;
1915 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1917 Instance = IP4_CONFIG2_INSTANCE_FROM_PROTOCOL (This);
1919 Item =
NetMapFindKey (&Instance->DataItem[DataType].EventMap, Event);
1924 Status = EFI_NOT_FOUND;
1927 gBS->RestoreTPL (OldTpl);
1954 IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
1956 Instance->Signature = IP4_CONFIG2_INSTANCE_SIGNATURE;
1962 NET_LIST_FOR_EACH (Entry, &mIp4Config2InstanceList) {
1963 TmpInstance = NET_LIST_USER_STRUCT_S (Entry,
IP4_CONFIG2_INSTANCE, Link, IP4_CONFIG2_INSTANCE_SIGNATURE);
1965 if (TmpInstance->IfIndex > IfIndex) {
1975 Instance->IfIndex = IfIndex;
1978 for (Index = 0; Index < Ip4Config2DataTypeMaximum; Index++) {
1982 NetMapInit (&Instance->DataItem[Index].EventMap);
1991 DataItem->Data.Ptr = &Instance->InterfaceInfo;
1992 DataItem->DataSize =
sizeof (Instance->InterfaceInfo);
1993 SET_DATA_ATTRIB (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED | DATA_ATTRIB_VOLATILE);
1998 DataItem->Data.Ptr = &Instance->Policy;
1999 DataItem->DataSize =
sizeof (Instance->Policy);
2001 SET_DATA_ATTRIB (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED);
2005 DataItem->Status = EFI_NOT_FOUND;
2009 DataItem->Status = EFI_NOT_FOUND;
2013 DataItem->Status = EFI_NOT_FOUND;
2015 Instance->Configured =
TRUE;
2023 if (Status == EFI_NOT_FOUND) {
2027 if (EFI_ERROR (Status)) {
2056 if (Instance->DeclineAddress !=
NULL) {
2057 FreePool (Instance->DeclineAddress);
2060 if (!Instance->Configured) {
2064 if (Instance->Dhcp4Handle !=
NULL) {
2071 if (Instance->Dhcp4Event !=
NULL) {
2072 gBS->CloseEvent (Instance->Dhcp4Event);
2073 Instance->Dhcp4Event =
NULL;
2076 for (Index = 0; Index < Ip4Config2DataTypeMaximum; Index++) {
2077 DataItem = &Instance->DataItem[Index];
2079 if (!DATA_ATTRIB_SET (DataItem->Attribute, DATA_ATTRIB_SIZE_FIXED)) {
2080 if (DataItem->Data.Ptr !=
NULL) {
2084 DataItem->Data.Ptr =
NULL;
2085 DataItem->DataSize = 0;
2088 NetMapClean (&Instance->DataItem[Index].EventMap);
2112 NET_CHECK_SIGNATURE (IpSb, IP4_SERVICE_SIGNATURE);
2114 if (IpSb->State > IP4_SERVICE_UNSTARTED) {
2115 IpSb->State = IP4_SERVICE_UNSTARTED;
2118 IpSb->Reconfig =
TRUE;
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS EFIAPI DispatchDpc(VOID)
EFI_STATUS EFIAPI QueueDpc(IN EFI_TPL DpcTpl, IN EFI_DPC_PROCEDURE DpcProcedure, IN VOID *DpcContext OPTIONAL)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
BOOLEAN Ip4StationAddressValid(IN IP4_ADDR Ip, IN IP4_ADDR Netmask)
EFI_IP4_CONFIG2_DATA_TYPE
@ Ip4Config2DataTypeManualAddress
@ Ip4Config2DataTypeGateway
@ Ip4Config2DataTypePolicy
@ Ip4Config2DataTypeInterfaceInfo
@ Ip4Config2DataTypeDnsServer
#define EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE
EFI_STATUS Ip4Config2ReadConfigData(IN CHAR16 *VarName, IN OUT IP4_CONFIG2_INSTANCE *Instance)
EFI_STATUS Ip4Config2SetGateway(IN IP4_CONFIG2_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
VOID EFIAPI Ip4Config2OnDhcp4SbInstalled(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI Ip4Config2SignalEvent(IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Arg)
EFI_STATUS Ip4Config2SetDnsServerWorker(IN IP4_CONFIG2_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS Ip4Config2BuildDefaultRouteTable(IN IP4_SERVICE *IpSb, OUT EFI_IP4_ROUTE_TABLE *Table)
EFI_STATUS Ip4Config2SetDefaultAddr(IN IP4_SERVICE *IpSb, IN IP4_ADDR StationAddress, IN IP4_ADDR SubnetMask)
EFI_STATUS Ip4Config2SetPolicy(IN IP4_CONFIG2_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS Ip4Config2InitInstance(OUT IP4_CONFIG2_INSTANCE *Instance)
EFI_STATUS EFIAPI EfiIp4Config2UnregisterDataNotify(IN EFI_IP4_CONFIG2_PROTOCOL *This, IN EFI_IP4_CONFIG2_DATA_TYPE DataType, IN EFI_EVENT Event)
EFI_STATUS Ip4Config2DestroyDhcp4(IN OUT IP4_CONFIG2_INSTANCE *Instance)
VOID EFIAPI Ip4AutoReconfigCallBackDpc(IN VOID *Context)
EFI_STATUS Ip4Config2WriteConfigData(IN CHAR16 *VarName, IN IP4_CONFIG2_INSTANCE *Instance)
EFI_STATUS EFIAPI EfiIp4Config2SetData(IN EFI_IP4_CONFIG2_PROTOCOL *This, IN EFI_IP4_CONFIG2_DATA_TYPE DataType, IN UINTN DataSize, IN VOID *Data)
VOID Ip4Config2InitIfInfo(IN IP4_SERVICE *IpSb, OUT EFI_IP4_CONFIG2_INTERFACE_INFO *IfInfo)
EFI_STATUS Ip4Config2SetDefaultIf(IN IP4_CONFIG2_INSTANCE *Instance, IN IP4_ADDR StationAddress, IN IP4_ADDR SubnetMask, IN IP4_ADDR GatewayAddress)
VOID Ip4Config2CleanInstance(IN OUT IP4_CONFIG2_INSTANCE *Instance)
EFI_STATUS Ip4Config2SetDnsServer(IN IP4_CONFIG2_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS EFIAPI EfiIp4Config2RegisterDataNotify(IN EFI_IP4_CONFIG2_PROTOCOL *This, IN EFI_IP4_CONFIG2_DATA_TYPE DataType, IN EFI_EVENT Event)
EFI_STATUS EFIAPI EfiIp4Config2GetData(IN EFI_IP4_CONFIG2_PROTOCOL *This, IN EFI_IP4_CONFIG2_DATA_TYPE DataType, IN OUT UINTN *DataSize, IN VOID *Data OPTIONAL)
VOID Ip4Config2OnPolicyChanged(IN IP4_SERVICE *IpSb, IN EFI_IP4_CONFIG2_POLICY NewPolicy)
EFI_STATUS Ip4Config2GetIfInfo(IN IP4_CONFIG2_INSTANCE *Instance, IN OUT UINTN *DataSize, IN VOID *Data OPTIONAL)
VOID Ip4Config2CleanDhcp4(IN IP4_CONFIG2_INSTANCE *Instance)
VOID EFIAPI Ip4Config2OnDhcp4Complete(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS Ip4Config2SetManualAddress(IN IP4_CONFIG2_INSTANCE *Instance, IN UINTN DataSize, IN VOID *Data)
VOID EFIAPI Ip4AutoReconfigCallBack(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS Ip4StartAutoConfig(IN IP4_CONFIG2_INSTANCE *Instance)
EFI_STATUS Ip4Config2FormInit(IN OUT IP4_CONFIG2_INSTANCE *Instance)
VOID Ip4Config2FormUnload(IN OUT IP4_CONFIG2_INSTANCE *Instance)
EFI_STATUS Ip4FreeInterface(IN IP4_INTERFACE *Interface, IN IP4_PROTOCOL *IpInstance OPTIONAL)
EFI_STATUS Ip4ReceiveFrame(IN IP4_INTERFACE *Interface, IN IP4_PROTOCOL *IpInstance OPTIONAL, IN IP4_FRAME_CALLBACK CallBack, IN VOID *Context)
IP4_INTERFACE * Ip4CreateInterface(IN EFI_MANAGED_NETWORK_PROTOCOL *Mnp, IN EFI_HANDLE Controller, IN EFI_HANDLE ImageHandle)
EFI_STATUS Ip4SetAddress(IN OUT IP4_INTERFACE *Interface, IN IP4_ADDR IpAddr, IN IP4_ADDR SubnetMask)
VOID Ip4CancelReceive(IN IP4_INTERFACE *Interface)
EFI_STATUS Ip4DelRoute(IN OUT IP4_ROUTE_TABLE *RtTable, IN IP4_ADDR Dest, IN IP4_ADDR Netmask, IN IP4_ADDR Gateway)
IP4_ROUTE_TABLE * Ip4CreateRouteTable(VOID)
EFI_STATUS Ip4AddRoute(IN OUT IP4_ROUTE_TABLE *RtTable, IN IP4_ADDR Dest, IN IP4_ADDR Netmask, IN IP4_ADDR Gateway)
VOID Ip4FreeRouteTable(IN IP4_ROUTE_TABLE *RtTable)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
EFI_RUNTIME_SERVICES * gRT
UINT16 EFIAPI NetblockChecksum(IN UINT8 *Bulk, IN UINT32 Len)
BOOLEAN EFIAPI NetIp4IsUnicast(IN IP4_ADDR Ip, IN IP4_ADDR NetMask)
VOID EFIAPI NetMapClean(IN OUT NET_MAP *Map)
EFI_STATUS EFIAPI NetLibCreateServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN OUT EFI_HANDLE *ChildHandle)
NET_MAP_ITEM *EFIAPI NetMapFindKey(IN NET_MAP *Map, IN VOID *Key)
EFI_STATUS EFIAPI NetLibDestroyServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN EFI_HANDLE ChildHandle)
VOID EFIAPI NetMapInit(IN OUT NET_MAP *Map)
VOID *EFIAPI NetMapRemoveItem(IN OUT NET_MAP *Map, IN OUT NET_MAP_ITEM *Item, OUT VOID **Value OPTIONAL)
EFI_STATUS EFIAPI NetMapInsertTail(IN OUT NET_MAP *Map, IN VOID *Key, IN VOID *Value OPTIONAL)
EFI_STATUS EFIAPI NetMapIterate(IN NET_MAP *Map, IN NET_MAP_CALLBACK CallBack, IN VOID *Arg OPTIONAL)
VOID EFIAPI NetListInsertBefore(IN OUT LIST_ENTRY *PostEntry, IN OUT LIST_ENTRY *NewEntry)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID EFIAPI Exit(IN EFI_STATUS Status)
IPv4_ADDRESS EFI_IPv4_ADDRESS
EFI_EVENT EFIAPI EfiCreateProtocolNotifyEvent(IN EFI_GUID *ProtocolGuid, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext OPTIONAL, OUT VOID **Registration)
EFI_HANDLE DriverBindingHandle
EFI_DHCP4_PACKET_OPTION ** OptionList
EFI_IPv4_ADDRESS SubnetMask
EFI_DHCP4_CONFIG_DATA ConfigData
EFI_IPv4_ADDRESS RouterAddress
EFI_IPv4_ADDRESS ClientAddress
EFI_DHCP4_PACKET * ReplyPacket
EFI_IPv4_ADDRESS SubnetMask
EFI_IPv4_ADDRESS StationAddress
EFI_IPv4_ADDRESS SubnetMask