103 IN VOID *Arg OPTIONAL
110 if ((Arg !=
NULL) && (Item->Key != Arg)) {
114 if (Item->Value !=
NULL) {
119 Packet = (
NET_BUF *)(Item->Value);
120 UdpIo = (
UDP_IO *)(*((
UINTN *)&Packet->ProtoData[0]));
130 TokenEntry->Token->
Status = EFI_ABORTED;
131 gBS->SignalEvent (TokenEntry->Token->
Event);
163 IN VOID *Arg OPTIONAL
170 if ((Arg !=
NULL) && (Item->Key != Arg)) {
174 if (Item->Value !=
NULL) {
179 Packet = (
NET_BUF *)(Item->Value);
180 UdpIo = (
UDP_IO *)(*((
UINTN *)&Packet->ProtoData[0]));
190 TokenEntry->Token->
Status = EFI_ABORTED;
191 gBS->SignalEvent (TokenEntry->Token->
Event);
225 NET_LIST_FOR_EACH (Entry, &TokensMap->Used) {
226 Item = NET_LIST_USER_STRUCT (Entry,
NET_MAP_ITEM, Link);
228 if ((*TokenEntry)->Token == Token) {
235 return EFI_NOT_FOUND;
261 NET_LIST_FOR_EACH (Entry, &TokensMap->Used) {
262 Item = NET_LIST_USER_STRUCT (Entry,
NET_MAP_ITEM, Link);
264 if ((*TokenEntry)->Token == Token) {
271 return EFI_NOT_FOUND;
297 if (Token !=
NULL ) {
299 if (EFI_ERROR (Status)) {
311 if ((TokenEntry !=
NULL) && (Status == EFI_ABORTED)) {
317 Instance->UdpIo->Protocol.Udp4->Cancel (Instance->UdpIo->Protocol.Udp4, &Instance->UdpIo->RecvRequest->Token.Udp4);
326 Instance->UdpIo->Protocol.Udp4->Cancel (Instance->UdpIo->Protocol.Udp4, &Instance->UdpIo->RecvRequest->Token.Udp4);
355 if (Token !=
NULL ) {
357 if (EFI_ERROR (Status)) {
369 if ((TokenEntry !=
NULL) && (Status == EFI_ABORTED)) {
375 Instance->UdpIo->Protocol.Udp6->Cancel (Instance->UdpIo->Protocol.Udp6, &Instance->UdpIo->RecvRequest->Token.Udp6);
384 Instance->UdpIo->Protocol.Udp6->Cancel (Instance->UdpIo->Protocol.Udp6, &Instance->UdpIo->RecvRequest->Token.Udp6);
401 if (Config->DnsServerList !=
NULL) {
419 if (Config->DnsServerList !=
NULL) {
446 CopyMem (Dst, Src,
sizeof (*Dst));
447 Dst->DnsServerList =
NULL;
452 if (Src->DnsServerList !=
NULL) {
455 if (Dst->DnsServerList ==
NULL) {
457 return EFI_OUT_OF_RESOURCES;
460 for (Index = 0; Index < Src->DnsServerListCount; Index++) {
488 CopyMem (Dst, Src,
sizeof (*Dst));
489 Dst->DnsServerList =
NULL;
494 if (Src->DnsServerList !=
NULL) {
497 if (Dst->DnsServerList ==
NULL) {
499 return EFI_OUT_OF_RESOURCES;
502 for (Index = 0; Index < Src->DnsServerCount; Index++) {
551 ASSERT (Instance->Dns4CfgData.UseDefaultSetting);
553 Service = Instance->Service;
554 Udp = UdpIo->Protocol.Udp4;
556 Status =
gBS->SetTimer (
557 Service->TimerToGetMap,
559 DNS_TIME_TO_GETMAP * TICKS_PER_SECOND
561 if (EFI_ERROR (Status)) {
565 while (EFI_ERROR (
gBS->CheckEvent (Service->TimerToGetMap))) {
568 if (!EFI_ERROR (Udp->GetModeData (Udp,
NULL, &Ip4Mode,
NULL,
NULL)) &&
571 Udp->Configure (Udp,
NULL);
572 return (BOOLEAN)(Udp->Configure (Udp, UdpCfgData) ==
EFI_SUCCESS);
603 Service = Instance->Service;
604 Udp = UdpIo->Protocol.Udp6;
606 Status =
gBS->SetTimer (
607 Service->TimerToGetMap,
609 DNS_TIME_TO_GETMAP * TICKS_PER_SECOND
611 if (EFI_ERROR (Status)) {
615 while (EFI_ERROR (
gBS->CheckEvent (Service->TimerToGetMap))) {
618 if (!EFI_ERROR (Udp->GetModeData (Udp,
NULL, &Ip6Mode,
NULL,
NULL))) {
644 Udp->Configure (Udp,
NULL);
645 if (Udp->Configure (Udp, UdpCfgData) ==
EFI_SUCCESS) {
675 Config = &Instance->Dns4CfgData;
677 UdpConfig.AcceptBroadcast =
FALSE;
678 UdpConfig.AcceptPromiscuous =
FALSE;
679 UdpConfig.AcceptAnyPort =
FALSE;
680 UdpConfig.AllowDuplicatePort =
FALSE;
681 UdpConfig.TypeOfService = 0;
682 UdpConfig.TimeToLive = 128;
683 UdpConfig.DoNotFragment =
FALSE;
684 UdpConfig.ReceiveTimeout = 0;
685 UdpConfig.TransmitTimeout = 0;
688 UdpConfig.StationPort = Config->
LocalPort;
689 UdpConfig.RemotePort = DNS_SERVER_PORT;
694 Status = UdpIo->Protocol.Udp4->Configure (UdpIo->Protocol.Udp4, &UdpConfig);
696 if ((Status == EFI_NO_MAPPING) &&
Dns4GetMapping (Instance, UdpIo, &UdpConfig)) {
723 Config = &Instance->Dns6CfgData;
737 Status = UdpIo->Protocol.Udp6->Configure (UdpIo->Protocol.Udp6, &UdpConfig);
739 if ((Status == EFI_NO_MAPPING) &&
Dns6GetMapping (Instance, UdpIo, &UdpConfig)) {
764 IN BOOLEAN DeleteFlag,
780 NET_LIST_FOR_EACH_SAFE (Entry, Next, Dns4CacheList) {
781 Item = NET_LIST_USER_STRUCT (Entry,
DNS4_CACHE, AllCacheLink);
782 if ((
StrCmp (DnsCacheEntry.HostName, Item->DnsCache.
HostName) == 0) && \
799 }
else if (Override) {
803 Item->DnsCache.
Timeout = DnsCacheEntry.Timeout;
807 return EFI_ACCESS_DENIED;
816 if (NewDnsCache ==
NULL) {
817 return EFI_OUT_OF_RESOURCES;
825 return EFI_OUT_OF_RESOURCES;
834 return EFI_OUT_OF_RESOURCES;
839 NewDnsCache->DnsCache.
Timeout = DnsCacheEntry.Timeout;
863 IN BOOLEAN DeleteFlag,
879 NET_LIST_FOR_EACH_SAFE (Entry, Next, Dns6CacheList) {
880 Item = NET_LIST_USER_STRUCT (Entry,
DNS6_CACHE, AllCacheLink);
881 if ((
StrCmp (DnsCacheEntry.HostName, Item->DnsCache.
HostName) == 0) && \
898 }
else if (Override) {
902 Item->DnsCache.
Timeout = DnsCacheEntry.Timeout;
906 return EFI_ACCESS_DENIED;
915 if (NewDnsCache ==
NULL) {
916 return EFI_OUT_OF_RESOURCES;
924 return EFI_OUT_OF_RESOURCES;
933 return EFI_OUT_OF_RESOURCES;
938 NewDnsCache->DnsCache.
Timeout = DnsCacheEntry.Timeout;
973 NET_LIST_FOR_EACH_SAFE (Entry, Next, Dns4ServerList) {
974 Item = NET_LIST_USER_STRUCT (Entry,
DNS4_SERVER_IP, AllServerLink);
987 if (NewServerIp ==
NULL) {
988 return EFI_OUT_OF_RESOURCES;
1028 NET_LIST_FOR_EACH_SAFE (Entry, Next, Dns6ServerList) {
1029 Item = NET_LIST_USER_STRUCT (Entry,
DNS6_SERVER_IP, AllServerLink);
1042 if (NewServerIp ==
NULL) {
1043 return EFI_OUT_OF_RESOURCES;
1071 IN UINT16 Identification,
1085 NET_LIST_FOR_EACH (Entry, &TokensMap->Used) {
1086 *Item = NET_LIST_USER_STRUCT (Entry,
NET_MAP_ITEM, Link);
1087 Packet = (
NET_BUF *)((*Item)->Value);
1088 if (Packet ==
NULL) {
1092 ASSERT (TxString !=
NULL);
1094 QueryName = (CHAR8 *)(TxString +
sizeof (*DnsHeader));
1097 if ((NTOHS (DnsHeader->Identification) == Identification) &&
1098 (NTOHS (QuerySection->Type) == Type) &&
1099 (NTOHS (QuerySection->Class) == Class))
1128 OUT BOOLEAN *Completed
1134 UINT32 QueryNameLen;
1147 UINT32 AnswerSectionNum;
1160 UINT32 RemainingLength;
1165 Dns4TokenEntry =
NULL;
1166 Dns6TokenEntry =
NULL;
1170 AnswerSectionNum = 0;
1176 Dns4CacheEntry =
NULL;
1177 Dns6CacheEntry =
NULL;
1184 RemainingLength = Length;
1189 if (RemainingLength <=
sizeof (
DNS_HEADER)) {
1201 DnsHeader->Identification = NTOHS (DnsHeader->Identification);
1202 DnsHeader->Flags.Uint16 = NTOHS (DnsHeader->Flags.Uint16);
1203 DnsHeader->QuestionsNum = NTOHS (DnsHeader->QuestionsNum);
1204 DnsHeader->AnswersNum = NTOHS (DnsHeader->AnswersNum);
1205 DnsHeader->AuthorityNum = NTOHS (DnsHeader->AuthorityNum);
1206 DnsHeader->AditionalNum = NTOHS (DnsHeader->AditionalNum);
1212 if (DnsHeader->QuestionsNum > 1) {
1214 return EFI_UNSUPPORTED;
1220 QueryName = (CHAR8 *)(RxString +
sizeof (*DnsHeader));
1222 QueryNameLen = (UINT32)
AsciiStrLen (QueryName) + 1;
1238 QuerySection->Type = NTOHS (QuerySection->Type);
1239 QuerySection->Class = NTOHS (QuerySection->Class);
1241 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
1246 if (Instance->Service->IpVersion == IP_VERSION_4) {
1248 &Instance->Dns4TxTokens,
1249 DnsHeader->Identification,
1251 QuerySection->Class,
1256 Status = EFI_ABORTED;
1260 ASSERT (Item !=
NULL);
1264 &Instance->Dns6TxTokens,
1265 DnsHeader->Identification,
1267 QuerySection->Class,
1272 Status = EFI_ABORTED;
1276 ASSERT (Item !=
NULL);
1283 if ((DnsHeader->Flags.Bits.RCode != DNS_FLAGS_RCODE_NO_ERROR) || (DnsHeader->AnswersNum < 1) || \
1284 (DnsHeader->Flags.Bits.QR != DNS_FLAGS_QR_RESPONSE))
1289 if (DnsHeader->Flags.Bits.RCode == DNS_FLAGS_RCODE_NAME_ERROR) {
1290 Status = EFI_NOT_FOUND;
1292 Status = EFI_DEVICE_ERROR;
1301 if (Instance->Service->IpVersion == IP_VERSION_4) {
1302 ASSERT (Dns4TokenEntry !=
NULL);
1304 if (Dns4TokenEntry->GeneralLookUp) {
1310 Status = EFI_OUT_OF_RESOURCES;
1316 Status = EFI_OUT_OF_RESOURCES;
1323 if (QuerySection->Type == DNS_TYPE_A) {
1326 Status = EFI_OUT_OF_RESOURCES;
1332 Status = EFI_OUT_OF_RESOURCES;
1336 Status = EFI_UNSUPPORTED;
1341 ASSERT (Dns6TokenEntry !=
NULL);
1343 if (Dns6TokenEntry->GeneralLookUp) {
1349 Status = EFI_OUT_OF_RESOURCES;
1355 Status = EFI_OUT_OF_RESOURCES;
1362 if (QuerySection->Type == DNS_TYPE_AAAA) {
1365 Status = EFI_OUT_OF_RESOURCES;
1371 Status = EFI_OUT_OF_RESOURCES;
1375 Status = EFI_UNSUPPORTED;
1381 Status = EFI_NOT_FOUND;
1386 AnswerName = (CHAR8 *)QuerySection +
sizeof (*QuerySection);
1391 while (AnswerSectionNum < DnsHeader->AnswersNum) {
1397 Status = EFI_ABORTED;
1406 if ((*(UINT8 *)AnswerName & 0xC0) != 0xC0) {
1407 Status = EFI_UNSUPPORTED;
1415 AnswerSection->Type = NTOHS (AnswerSection->Type);
1416 AnswerSection->Class = NTOHS (AnswerSection->Class);
1417 AnswerSection->Ttl = NTOHL (AnswerSection->Ttl);
1418 AnswerSection->DataLength = NTOHS (AnswerSection->DataLength);
1423 if (RemainingLength < AnswerSection->DataLength) {
1425 Status = EFI_ABORTED;
1428 RemainingLength -= AnswerSection->DataLength;
1434 if ((Instance->Service->IpVersion == IP_VERSION_4) && Dns4TokenEntry->GeneralLookUp) {
1436 AnswerData = (UINT8 *)AnswerSection +
sizeof (*AnswerSection);
1442 if (Dns4RR[RRCount].QName ==
NULL) {
1443 Status = EFI_OUT_OF_RESOURCES;
1448 Dns4RR[RRCount].
QType = AnswerSection->Type;
1449 Dns4RR[RRCount].
QClass = AnswerSection->Class;
1450 Dns4RR[RRCount].
TTL = AnswerSection->Ttl;
1451 Dns4RR[RRCount].
DataLength = AnswerSection->DataLength;
1453 if (Dns4RR[RRCount].RData ==
NULL) {
1454 Status = EFI_OUT_OF_RESOURCES;
1458 CopyMem (Dns4RR[RRCount].RData, AnswerData, Dns4RR[RRCount].DataLength);
1462 }
else if ((Instance->Service->IpVersion == IP_VERSION_6) && Dns6TokenEntry->GeneralLookUp) {
1464 AnswerData = (UINT8 *)AnswerSection +
sizeof (*AnswerSection);
1470 if (Dns6RR[RRCount].QName ==
NULL) {
1471 Status = EFI_OUT_OF_RESOURCES;
1476 Dns6RR[RRCount].
QType = AnswerSection->Type;
1477 Dns6RR[RRCount].
QClass = AnswerSection->Class;
1478 Dns6RR[RRCount].
TTL = AnswerSection->Ttl;
1479 Dns6RR[RRCount].
DataLength = AnswerSection->DataLength;
1481 if (Dns6RR[RRCount].RData ==
NULL) {
1482 Status = EFI_OUT_OF_RESOURCES;
1486 CopyMem (Dns6RR[RRCount].RData, AnswerData, Dns6RR[RRCount].DataLength);
1495 switch (AnswerSection->Type) {
1500 ASSERT (Dns4TokenEntry !=
NULL);
1502 if (AnswerSection->DataLength != 4) {
1503 Status = EFI_ABORTED;
1508 AnswerData = (UINT8 *)AnswerSection +
sizeof (*AnswerSection);
1515 if (Dns4CacheEntry ==
NULL) {
1516 Status = EFI_OUT_OF_RESOURCES;
1522 Status = EFI_OUT_OF_RESOURCES;
1526 CopyMem (Dns4CacheEntry->
HostName, Dns4TokenEntry->QueryHostName, 2 * (
StrLen (Dns4TokenEntry->QueryHostName) + 1));
1529 Status = EFI_OUT_OF_RESOURCES;
1535 if ((CNameTtl != 0) && (AnswerSection->Ttl != 0)) {
1536 Dns4CacheEntry->
Timeout =
MIN (CNameTtl, AnswerSection->Ttl);
1538 Dns4CacheEntry->
Timeout =
MAX (CNameTtl, AnswerSection->Ttl);
1553 Dns4CacheEntry =
NULL;
1562 ASSERT (Dns6TokenEntry !=
NULL);
1564 if (AnswerSection->DataLength != 16) {
1565 Status = EFI_ABORTED;
1570 AnswerData = (UINT8 *)AnswerSection +
sizeof (*AnswerSection);
1577 if (Dns6CacheEntry ==
NULL) {
1578 Status = EFI_OUT_OF_RESOURCES;
1584 Status = EFI_OUT_OF_RESOURCES;
1588 CopyMem (Dns6CacheEntry->
HostName, Dns6TokenEntry->QueryHostName, 2 * (
StrLen (Dns6TokenEntry->QueryHostName) + 1));
1591 Status = EFI_OUT_OF_RESOURCES;
1597 if ((CNameTtl != 0) && (AnswerSection->Ttl != 0)) {
1598 Dns6CacheEntry->
Timeout =
MIN (CNameTtl, AnswerSection->Ttl);
1600 Dns6CacheEntry->
Timeout =
MAX (CNameTtl, AnswerSection->Ttl);
1615 Dns6CacheEntry =
NULL;
1620 case DNS_TYPE_CNAME:
1626 CNameTtl = AnswerSection->Ttl;
1629 Status = EFI_UNSUPPORTED;
1637 AnswerName = (CHAR8 *)AnswerSection +
sizeof (*AnswerSection) + AnswerSection->DataLength;
1641 if (Instance->Service->IpVersion == IP_VERSION_4) {
1642 ASSERT (Dns4TokenEntry !=
NULL);
1644 if (Dns4TokenEntry->GeneralLookUp) {
1647 if (QuerySection->Type == DNS_TYPE_A) {
1650 Status = EFI_UNSUPPORTED;
1655 ASSERT (Dns6TokenEntry !=
NULL);
1657 if (Dns6TokenEntry->GeneralLookUp) {
1660 if (QuerySection->Type == DNS_TYPE_AAAA) {
1663 Status = EFI_UNSUPPORTED;
1673 if ((Item !=
NULL) && (Item->Value !=
NULL)) {
1677 if (Instance->Service->IpVersion == IP_VERSION_4) {
1678 ASSERT (Dns4TokenEntry !=
NULL);
1680 Dns4TokenEntry->Token->
Status = Status;
1681 if (Dns4TokenEntry->Token->
Event !=
NULL) {
1682 gBS->SignalEvent (Dns4TokenEntry->Token->
Event);
1686 ASSERT (Dns6TokenEntry !=
NULL);
1688 Dns6TokenEntry->Token->
Status = Status;
1689 if (Dns6TokenEntry->Token->
Event !=
NULL) {
1690 gBS->SignalEvent (Dns6TokenEntry->Token->
Event);
1699 if (EFI_ERROR (Status)) {
1700 if (Dns4TokenEntry !=
NULL) {
1701 if (Dns4TokenEntry->GeneralLookUp) {
1704 while (RRCount != 0) {
1721 if ((QuerySection->Type == DNS_TYPE_A) && (Dns4TokenEntry->Token->
RspData.
H2AData !=
NULL)) {
1732 if (Dns6TokenEntry !=
NULL) {
1733 if (Dns6TokenEntry->GeneralLookUp) {
1736 while (RRCount != 0) {
1753 if ((QuerySection->Type == DNS_TYPE_AAAA) && (Dns6TokenEntry->Token->
RspData.
H2AData !=
NULL)) {
1764 if (Dns4CacheEntry !=
NULL) {
1776 if (Dns6CacheEntry !=
NULL) {
1789 gBS->RestoreTPL (OldTpl);
1819 NET_CHECK_SIGNATURE (Instance, DNS_INSTANCE_SIGNATURE);
1824 if (EFI_ERROR (IoStatus)) {
1828 ASSERT (Packet !=
NULL);
1830 Len = Packet->TotalSize;
1833 ASSERT (RcvString !=
NULL);
1842 if (Packet !=
NULL) {
1875 Dns4TokenEntry =
NULL;
1876 Dns6TokenEntry =
NULL;
1879 NET_CHECK_SIGNATURE (Instance, DNS_INSTANCE_SIGNATURE);
1881 if (Instance->Service->
IpVersion == IP_VERSION_4) {
1882 NET_LIST_FOR_EACH (Entry, &Instance->Dns4TxTokens.Used) {
1883 Item = NET_LIST_USER_STRUCT (Entry,
NET_MAP_ITEM, Link);
1884 if (Packet == (
NET_BUF *)(Item->Value)) {
1886 Dns4TokenEntry->PacketToLive = Dns4TokenEntry->Token->
RetryInterval;
1891 NET_LIST_FOR_EACH (Entry, &Instance->Dns6TxTokens.Used) {
1892 Item = NET_LIST_USER_STRUCT (Entry,
NET_MAP_ITEM, Link);
1893 if (Packet == (
NET_BUF *)(Item->Value)) {
1895 Dns6TokenEntry->PacketToLive = Dns6TokenEntry->Token->
RetryInterval;
1925 if (Instance->UdpIo->RecvRequest ==
NULL) {
1927 if (EFI_ERROR (Status)) {
1935 NET_GET_REF (Packet);
1958 IN CHAR8 *QueryName,
1971 if (EFI_ERROR (Status)) {
1972 DEBUG ((DEBUG_ERROR,
"%a failed to generate random number: %r\n", __func__, Status));
1980 Frag.Bulk =
AllocatePool (DNS_MAX_MESSAGE_SIZE *
sizeof (UINT8));
1981 if (Frag.Bulk ==
NULL) {
1982 return EFI_OUT_OF_RESOURCES;
1989 DnsHeader->Identification = (UINT16)Random;
1990 DnsHeader->Flags.Uint16 = 0x0000;
1991 DnsHeader->Flags.Bits.RD = 1;
1992 DnsHeader->Flags.Bits.OpCode = DNS_FLAGS_OPCODE_STANDARD;
1993 DnsHeader->Flags.Bits.QR = DNS_FLAGS_QR_QUERY;
1994 DnsHeader->QuestionsNum = 1;
1995 DnsHeader->AnswersNum = 0;
1996 DnsHeader->AuthorityNum = 0;
1997 DnsHeader->AditionalNum = 0;
1999 DnsHeader->Identification = HTONS (DnsHeader->Identification);
2000 DnsHeader->Flags.Uint16 = HTONS (DnsHeader->Flags.Uint16);
2001 DnsHeader->QuestionsNum = HTONS (DnsHeader->QuestionsNum);
2002 DnsHeader->AnswersNum = HTONS (DnsHeader->AnswersNum);
2003 DnsHeader->AuthorityNum = HTONS (DnsHeader->AuthorityNum);
2004 DnsHeader->AditionalNum = HTONS (DnsHeader->AditionalNum);
2006 Frag.Len =
sizeof (*DnsHeader);
2012 Frag.Len = (UINT32)(Frag.Len +
AsciiStrLen (QueryName));
2013 *(Frag.Bulk + Frag.Len) = 0;
2021 DnsQuery->Type = HTONS (Type);
2022 DnsQuery->Class = HTONS (Class);
2024 Frag.Len +=
sizeof (*DnsQuery);
2030 if (*Packet ==
NULL) {
2032 return EFI_OUT_OF_RESOURCES;
2038 *((
UINTN *)&((*Packet)->ProtoData[0])) = (
UINTN)(Instance->UdpIo);
2063 ASSERT (Packet !=
NULL);
2069 ASSERT (Buffer !=
NULL);
2071 NET_GET_REF (Packet);
2082 if (EFI_ERROR (Status)) {
2083 NET_PUT_REF (Packet);
2114 Dns4TokenEntry =
NULL;
2115 Dns6TokenEntry =
NULL;
2119 if (Service->
IpVersion == IP_VERSION_4) {
2124 NET_LIST_FOR_EACH_SAFE (Entry, Next, &Service->Dns4ChildrenList) {
2125 Instance = NET_LIST_USER_STRUCT (Entry,
DNS_INSTANCE, Link);
2127 EntryNetMap = Instance->Dns4TxTokens.Used.ForwardLink;
2128 while (EntryNetMap != &Instance->Dns4TxTokens.Used) {
2129 ItemNetMap = NET_LIST_USER_STRUCT (EntryNetMap,
NET_MAP_ITEM, Link);
2131 if ((Dns4TokenEntry->PacketToLive == 0) || (--Dns4TokenEntry->PacketToLive > 0)) {
2132 EntryNetMap = EntryNetMap->ForwardLink;
2140 if (++Dns4TokenEntry->RetryCounting <= Dns4TokenEntry->Token->
RetryCount) {
2142 EntryNetMap = EntryNetMap->ForwardLink;
2148 Dns4TokenEntry->Token->
Status = EFI_TIMEOUT;
2149 gBS->SignalEvent (Dns4TokenEntry->Token->
Event);
2155 if (ItemNetMap->Value !=
NULL) {
2159 EntryNetMap = Instance->Dns4TxTokens.Used.ForwardLink;
2168 NET_LIST_FOR_EACH_SAFE (Entry, Next, &Service->Dns6ChildrenList) {
2169 Instance = NET_LIST_USER_STRUCT (Entry,
DNS_INSTANCE, Link);
2171 EntryNetMap = Instance->Dns6TxTokens.Used.ForwardLink;
2172 while (EntryNetMap != &Instance->Dns6TxTokens.Used) {
2173 ItemNetMap = NET_LIST_USER_STRUCT (EntryNetMap,
NET_MAP_ITEM, Link);
2175 if ((Dns6TokenEntry->PacketToLive == 0) || (--Dns6TokenEntry->PacketToLive > 0)) {
2176 EntryNetMap = EntryNetMap->ForwardLink;
2184 if (++Dns6TokenEntry->RetryCounting <= Dns6TokenEntry->Token->
RetryCount) {
2186 EntryNetMap = EntryNetMap->ForwardLink;
2192 Dns6TokenEntry->Token->
Status = EFI_TIMEOUT;
2193 gBS->SignalEvent (Dns6TokenEntry->Token->
Event);
2199 if (ItemNetMap->Value !=
NULL) {
2203 EntryNetMap = Instance->Dns6TxTokens.Used.ForwardLink;
2235 NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->
Dns4CacheList) {
2236 Item4 = NET_LIST_USER_STRUCT (Entry,
DNS4_CACHE, AllCacheLink);
2242 Item4 = NET_LIST_USER_STRUCT (Entry,
DNS4_CACHE, AllCacheLink);
2243 if (Item4->DnsCache.
Timeout == 0) {
2250 Entry = Entry->ForwardLink;
2257 NET_LIST_FOR_EACH_SAFE (Entry, Next, &mDriverData->Dns6CacheList) {
2258 Item6 = NET_LIST_USER_STRUCT (Entry,
DNS6_CACHE, AllCacheLink);
2262 Entry = mDriverData->Dns6CacheList.ForwardLink;
2263 while (Entry != &mDriverData->Dns6CacheList) {
2264 Item6 = NET_LIST_USER_STRUCT (Entry,
DNS6_CACHE, AllCacheLink);
2265 if (Item6->DnsCache.
Timeout == 0) {
2270 Entry = mDriverData->Dns6CacheList.ForwardLink;
2272 Entry = Entry->ForwardLink;
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
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)
EFI_STATUS DoDnsQuery(IN DNS_INSTANCE *Instance, IN NET_BUF *Packet)
EFI_STATUS EFIAPI GetDns4TokenEntry(IN NET_MAP *TokensMap, IN EFI_DNS4_COMPLETION_TOKEN *Token, OUT DNS4_TOKEN_ENTRY **TokenEntry)
EFI_STATUS EFIAPI Dns4CancelTokens(IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Arg OPTIONAL)
EFI_STATUS DnsRetransmit(IN DNS_INSTANCE *Instance, IN NET_BUF *Packet)
EFI_STATUS EFIAPI AddDns6ServerIp(IN LIST_ENTRY *Dns6ServerList, IN EFI_IPv6_ADDRESS ServerIp)
EFI_STATUS ConstructDNSQuery(IN DNS_INSTANCE *Instance, IN CHAR8 *QueryName, IN UINT16 Type, IN UINT16 Class, OUT NET_BUF **Packet)
EFI_STATUS Dns4InstanceCancelToken(IN DNS_INSTANCE *Instance, IN EFI_DNS4_COMPLETION_TOKEN *Token)
EFI_STATUS ParseDnsResponse(IN OUT DNS_INSTANCE *Instance, IN UINT8 *RxString, IN UINT32 Length, OUT BOOLEAN *Completed)
VOID Dns6CleanConfigure(IN OUT EFI_DNS6_CONFIG_DATA *Config)
EFI_STATUS Dns6InstanceCancelToken(IN DNS_INSTANCE *Instance, IN EFI_DNS6_COMPLETION_TOKEN *Token)
EFI_STATUS Dns4CopyConfigure(OUT EFI_DNS4_CONFIG_DATA *Dst, IN EFI_DNS4_CONFIG_DATA *Src)
EFI_STATUS EFIAPI AddDns4ServerIp(IN LIST_ENTRY *Dns4ServerList, IN EFI_IPv4_ADDRESS ServerIp)
EFI_STATUS Dns6CopyConfigure(OUT EFI_DNS6_CONFIG_DATA *Dst, IN EFI_DNS6_CONFIG_DATA *Src)
VOID EFIAPI DnsOnTimerUpdate(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI DnsOnPacketReceived(NET_BUF *Packet, UDP_END_POINT *EndPoint, EFI_STATUS IoStatus, VOID *Context)
EFI_STATUS Dns6RemoveTokenEntry(IN NET_MAP *TokenMap, IN DNS6_TOKEN_ENTRY *TokenEntry)
EFI_STATUS Dns4ConfigUdp(IN DNS_INSTANCE *Instance, IN UDP_IO *UdpIo)
VOID EFIAPI DnsOnPacketSent(NET_BUF *Packet, UDP_END_POINT *EndPoint, EFI_STATUS IoStatus, VOID *Context)
VOID Dns4CleanConfigure(IN OUT EFI_DNS4_CONFIG_DATA *Config)
EFI_STATUS EFIAPI Dns6CancelTokens(IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Arg OPTIONAL)
BOOLEAN Dns4GetMapping(IN DNS_INSTANCE *Instance, IN UDP_IO *UdpIo, IN EFI_UDP4_CONFIG_DATA *UdpCfgData)
VOID EFIAPI DnsDummyExtFree(IN VOID *Arg)
BOOLEAN IsValidDnsResponse(IN NET_MAP *TokensMap, IN UINT16 Identification, IN UINT16 Type, IN UINT16 Class, OUT NET_MAP_ITEM **Item)
EFI_STATUS EFIAPI UpdateDns4Cache(IN LIST_ENTRY *Dns4CacheList, IN BOOLEAN DeleteFlag, IN BOOLEAN Override, IN EFI_DNS4_CACHE_ENTRY DnsCacheEntry)
EFI_STATUS EFIAPI UpdateDns6Cache(IN LIST_ENTRY *Dns6CacheList, IN BOOLEAN DeleteFlag, IN BOOLEAN Override, IN EFI_DNS6_CACHE_ENTRY DnsCacheEntry)
EFI_STATUS Dns4RemoveTokenEntry(IN NET_MAP *TokenMap, IN DNS4_TOKEN_ENTRY *TokenEntry)
VOID EFIAPI DnsOnTimerRetransmit(IN EFI_EVENT Event, IN VOID *Context)
BOOLEAN Dns6GetMapping(IN DNS_INSTANCE *Instance, IN UDP_IO *UdpIo, IN EFI_UDP6_CONFIG_DATA *UdpCfgData)
EFI_STATUS Dns6ConfigUdp(IN DNS_INSTANCE *Instance, IN UDP_IO *UdpIo)
EFI_STATUS EFIAPI GetDns6TokenEntry(IN NET_MAP *TokensMap, IN EFI_DNS6_COMPLETION_TOKEN *Token, OUT DNS6_TOKEN_ENTRY **TokenEntry)
EFI_STATUS EFIAPI DispatchDpc(VOID)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define DEBUG(Expression)
VOID EFIAPI NetbufFree(IN NET_BUF *Nbuf)
NET_MAP_ITEM *EFIAPI NetMapFindKey(IN NET_MAP *Map, IN VOID *Key)
NET_BUF *EFIAPI NetbufFromExt(IN NET_FRAGMENT *ExtFragment, IN UINT32 ExtNum, IN UINT32 HeadSpace, IN UINT32 HeadLen, IN NET_VECTOR_EXT_FREE ExtFree, IN VOID *Arg OPTIONAL)
BOOLEAN EFIAPI NetMapIsEmpty(IN NET_MAP *Map)
EFI_STATUS EFIAPI PseudoRandomU32(OUT UINT32 *Output)
UINT8 *EFIAPI NetbufGetByte(IN NET_BUF *Nbuf, IN UINT32 Offset, OUT UINT32 *Index OPTIONAL)
VOID *EFIAPI NetMapRemoveItem(IN OUT NET_MAP *Map, IN OUT NET_MAP_ITEM *Item, OUT VOID **Value OPTIONAL)
EFI_STATUS EFIAPI NetMapIterate(IN NET_MAP *Map, IN NET_MAP_CALLBACK CallBack, IN VOID *Arg OPTIONAL)
UINTN EFIAPI NetMapGetCount(IN NET_MAP *Map)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID EFIAPI UdpIoCancelSentDatagram(IN UDP_IO *UdpIo, IN NET_BUF *Packet)
EFI_STATUS EFIAPI UdpIoRecvDatagram(IN UDP_IO *UdpIo, IN UDP_IO_CALLBACK CallBack, IN VOID *Context, IN UINT32 HeadLen)
EFI_STATUS EFIAPI UdpIoSendDatagram(IN UDP_IO *UdpIo, IN NET_BUF *Packet, IN UDP_END_POINT *EndPoint OPTIONAL, IN EFI_IP_ADDRESS *Gateway OPTIONAL, IN UDP_IO_CALLBACK CallBack, IN VOID *Context)
IPv6_ADDRESS EFI_IPv6_ADDRESS
IPv4_ADDRESS EFI_IPv4_ADDRESS
LIST_ENTRY Dns4CacheList
Ticking timer for DNS cache update.
UINT8 IpVersion
Ticking timer for packet retransmission.
DNS6_RESOURCE_RECORD * RRList
EFI_IPv6_ADDRESS * IpList
DNS_RESOURCE_RECORD * RRList
EFI_IPv4_ADDRESS * IpList
EFI_IPv4_ADDRESS * IpAddress
DNS_HOST_TO_ADDR_DATA * H2AData
union EFI_DNS4_COMPLETION_TOKEN::@573 RspData
DNS_GENERAL_LOOKUP_DATA * GLookupData
BOOLEAN UseDefaultSetting
EFI_IPv4_ADDRESS SubnetMask
EFI_IPv4_ADDRESS StationIp
EFI_IPv6_ADDRESS * IpAddress
DNS6_HOST_TO_ADDR_DATA * H2AData
union EFI_DNS6_COMPLETION_TOKEN::@574 RspData
DNS6_GENERAL_LOOKUP_DATA * GLookupData
EFI_IPv6_ADDRESS StationIp
EFI_IP6_NEIGHBOR_CACHE * NeighborCache
EFI_IP6_ICMP_TYPE * IcmpTypeList
EFI_IP6_ADDRESS_INFO * AddressList
EFI_IP6_ROUTE_TABLE * RouteTable
EFI_IPv6_ADDRESS * GroupTable
EFI_IP6_ADDRESS_INFO * PrefixTable
BOOLEAN AcceptPromiscuous
BOOLEAN AllowDuplicatePort
EFI_IPv6_ADDRESS RemoteAddress
EFI_IPv6_ADDRESS StationAddress