39 UINTN DnsServerListCount;
43 Service = HttpInstance->Service;
44 ASSERT (Service !=
NULL);
47 DnsServerListCount = 0;
53 Status =
gBS->HandleProtocol (Service->ControllerHandle, &gEfiIp4Config2ProtocolGuid, (VOID **)&Ip4Config2);
54 if (!EFI_ERROR (Status)) {
60 if (Status == EFI_BUFFER_TOO_SMALL) {
62 if (DnsServerList ==
NULL) {
63 return EFI_OUT_OF_RESOURCES;
67 if (EFI_ERROR (Status)) {
83 Service->ControllerHandle,
84 Service->Ip4DriverBindingHandle,
85 &gEfiDns4ServiceBindingProtocolGuid,
88 if (EFI_ERROR (Status)) {
92 Status =
gBS->OpenProtocol (
94 &gEfiDns4ProtocolGuid,
96 Service->Ip4DriverBindingHandle,
97 Service->ControllerHandle,
98 EFI_OPEN_PROTOCOL_BY_DRIVER
100 if (EFI_ERROR (Status)) {
107 ZeroMem (&Dns4CfgData,
sizeof (Dns4CfgData));
114 IP4_COPY_ADDRESS (&Dns4CfgData.
StationIp, &HttpInstance->IPv4Node.LocalAddress);
115 IP4_COPY_ADDRESS (&Dns4CfgData.
SubnetMask, &HttpInstance->IPv4Node.LocalSubnet);
119 Dns4CfgData.
Protocol = EFI_IP_PROTO_UDP;
120 Status = Dns4->Configure (
124 if (EFI_ERROR (Status)) {
131 ZeroMem (&Token,
sizeof (Token));
132 Status =
gBS->CreateEvent (
139 if (EFI_ERROR (Status)) {
146 Token.
Status = EFI_NOT_READY;
148 Status = Dns4->HostNameToIp (Dns4, HostName, &Token);
149 if (EFI_ERROR (Status)) {
161 if (!EFI_ERROR (Status)) {
163 Status = EFI_DEVICE_ERROR;
168 Status = EFI_DEVICE_ERROR;
194 Dns4->Configure (Dns4,
NULL);
198 &gEfiDns4ProtocolGuid,
199 Service->Ip4DriverBindingHandle,
200 Service->ControllerHandle
204 if (Dns4Handle !=
NULL) {
206 Service->ControllerHandle,
207 Service->Ip4DriverBindingHandle,
208 &gEfiDns4ServiceBindingProtocolGuid,
213 if (DnsServerList !=
NULL) {
248 UINTN DnsServerListCount;
252 Service = HttpInstance->Service;
253 ASSERT (Service !=
NULL);
255 DnsServerList =
NULL;
256 DnsServerListCount = 0;
264 Status =
gBS->HandleProtocol (Service->ControllerHandle, &gEfiIp6ConfigProtocolGuid, (VOID **)&Ip6Config);
265 if (!EFI_ERROR (Status)) {
271 if (Status == EFI_BUFFER_TOO_SMALL) {
273 if (DnsServerList ==
NULL) {
274 return EFI_OUT_OF_RESOURCES;
278 if (EFI_ERROR (Status)) {
280 DnsServerList =
NULL;
291 Service->ControllerHandle,
292 Service->Ip6DriverBindingHandle,
293 &gEfiDns6ServiceBindingProtocolGuid,
296 if (EFI_ERROR (Status)) {
300 Status =
gBS->OpenProtocol (
302 &gEfiDns6ProtocolGuid,
304 Service->Ip6DriverBindingHandle,
305 Service->ControllerHandle,
306 EFI_OPEN_PROTOCOL_BY_DRIVER
308 if (EFI_ERROR (Status)) {
319 Dns6ConfigData.
Protocol = EFI_IP_PROTO_UDP;
322 IP6_COPY_ADDRESS (&Dns6ConfigData.
StationIp, &HttpInstance->Ipv6Node.LocalAddress);
323 Status = Dns6->Configure (
327 if (EFI_ERROR (Status)) {
331 Token.
Status = EFI_NOT_READY;
336 Status =
gBS->CreateEvent (
343 if (EFI_ERROR (Status)) {
350 Status = Dns6->HostNameToIp (Dns6, HostName, &Token);
351 if (EFI_ERROR (Status)) {
363 if (!EFI_ERROR (Status)) {
365 Status = EFI_DEVICE_ERROR;
370 Status = EFI_DEVICE_ERROR;
396 Dns6->Configure (Dns6,
NULL);
400 &gEfiDns6ProtocolGuid,
401 Service->Ip6DriverBindingHandle,
402 Service->ControllerHandle
406 if (Dns6Handle !=
NULL) {
408 Service->ControllerHandle,
409 Service->Ip6DriverBindingHandle,
410 &gEfiDns6ServiceBindingProtocolGuid,
415 if (DnsServerList !=
NULL) {
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS HttpDns4(IN HTTP_PROTOCOL *HttpInstance, IN CHAR16 *HostName, OUT EFI_IPv4_ADDRESS *IpAddress)
EFI_STATUS HttpDns6(IN HTTP_PROTOCOL *HttpInstance, IN CHAR16 *HostName, OUT EFI_IPv6_ADDRESS *IpAddress)
VOID EFIAPI HttpCommonNotify(IN EFI_EVENT Event, IN VOID *Context)
@ Ip4Config2DataTypeDnsServer
@ Ip6ConfigDataTypeDnsServer
EFI_STATUS EFIAPI NetLibCreateServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN OUT EFI_HANDLE *ChildHandle)
EFI_STATUS EFIAPI NetLibDestroyServiceChild(IN EFI_HANDLE Controller, IN EFI_HANDLE Image, IN EFI_GUID *ServiceBindingGuid, IN EFI_HANDLE ChildHandle)
#define PcdGet32(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID EFIAPI Exit(IN EFI_STATUS Status)
IPv6_ADDRESS EFI_IPv6_ADDRESS
IPv4_ADDRESS EFI_IPv4_ADDRESS
EFI_IPv6_ADDRESS * IpList
EFI_IPv4_ADDRESS * IpList
DNS_HOST_TO_ADDR_DATA * H2AData
union EFI_DNS4_COMPLETION_TOKEN::@573 RspData
EFI_IPv4_ADDRESS * DnsServerList
BOOLEAN UseDefaultSetting
EFI_IPv4_ADDRESS SubnetMask
EFI_IPv4_ADDRESS StationIp
DNS6_HOST_TO_ADDR_DATA * H2AData
union EFI_DNS6_COMPLETION_TOKEN::@574 RspData
EFI_IPv6_ADDRESS * DnsServerList
EFI_IPv6_ADDRESS StationIp