TianoCore EDK2 master
Loading...
Searching...
No Matches
DnsDhcp.h File Reference

Go to the source code of this file.

Data Structures

struct  DNS4_SERVER_INFOR
 
struct  DNS6_SERVER_INFOR
 

Macros

#define IP4_ETHER_PROTO   0x0800
 
#define DHCP4_OPCODE_REQUEST   1
 
#define DHCP4_MAGIC   0x63538263
 
#define DHCP4_TAG_EOP   255
 
#define DHCP4_TAG_TYPE   53
 
#define DHCP4_MSG_REQUEST   3
 
#define DHCP4_MSG_INFORM   8
 
#define DHCP4_TAG_PARA_LIST   55
 
#define DHCP4_TAG_DNS_SERVER   6
 
#define DHCP6_TAG_DNS_REQUEST   6
 
#define DHCP6_TAG_DNS_SERVER   23
 
#define DNS_CHECK_MEDIA_GET_DHCP_WAITING_TIME   EFI_TIMER_PERIOD_SECONDS(20)
 

Functions

EFI_STATUS ParseDhcp4Ack (IN EFI_DHCP4_PROTOCOL *Dhcp4, IN EFI_DHCP4_PACKET *Packet, IN DNS4_SERVER_INFOR *DnsServerInfor)
 
EFI_STATUS EFIAPI ParseDhcp6Ack (IN EFI_DHCP6_PROTOCOL *This, IN VOID *Context, IN EFI_DHCP6_PACKET *Packet)
 
EFI_STATUS GetDns4ServerFromDhcp4 (IN DNS_INSTANCE *Instance, OUT UINT32 *DnsServerCount, OUT EFI_IPv4_ADDRESS **DnsServerList)
 
EFI_STATUS GetDns6ServerFromDhcp6 (IN EFI_HANDLE Image, IN EFI_HANDLE Controller, OUT UINT32 *DnsServerCount, OUT EFI_IPv6_ADDRESS **DnsServerList)
 

Detailed Description

Functions implementation related with DHCPv4/v6 for DNS driver.

Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DnsDhcp.h.

Macro Definition Documentation

◆ DHCP4_MAGIC

#define DHCP4_MAGIC   0x63538263

Definition at line 20 of file DnsDhcp.h.

◆ DHCP4_MSG_INFORM

#define DHCP4_MSG_INFORM   8

Definition at line 25 of file DnsDhcp.h.

◆ DHCP4_MSG_REQUEST

#define DHCP4_MSG_REQUEST   3

Definition at line 24 of file DnsDhcp.h.

◆ DHCP4_OPCODE_REQUEST

#define DHCP4_OPCODE_REQUEST   1

Definition at line 19 of file DnsDhcp.h.

◆ DHCP4_TAG_DNS_SERVER

#define DHCP4_TAG_DNS_SERVER   6

Definition at line 28 of file DnsDhcp.h.

◆ DHCP4_TAG_EOP

#define DHCP4_TAG_EOP   255

Definition at line 21 of file DnsDhcp.h.

◆ DHCP4_TAG_PARA_LIST

#define DHCP4_TAG_PARA_LIST   55

Definition at line 27 of file DnsDhcp.h.

◆ DHCP4_TAG_TYPE

#define DHCP4_TAG_TYPE   53

Definition at line 23 of file DnsDhcp.h.

◆ DHCP6_TAG_DNS_REQUEST

#define DHCP6_TAG_DNS_REQUEST   6

Definition at line 30 of file DnsDhcp.h.

◆ DHCP6_TAG_DNS_SERVER

#define DHCP6_TAG_DNS_SERVER   23

Definition at line 31 of file DnsDhcp.h.

◆ DNS_CHECK_MEDIA_GET_DHCP_WAITING_TIME

#define DNS_CHECK_MEDIA_GET_DHCP_WAITING_TIME   EFI_TIMER_PERIOD_SECONDS(20)

Definition at line 33 of file DnsDhcp.h.

◆ IP4_ETHER_PROTO

#define IP4_ETHER_PROTO   0x0800

Definition at line 17 of file DnsDhcp.h.

Function Documentation

◆ GetDns4ServerFromDhcp4()

EFI_STATUS GetDns4ServerFromDhcp4 ( IN DNS_INSTANCE Instance,
OUT UINT32 *  DnsServerCount,
OUT EFI_IPv4_ADDRESS **  DnsServerList 
)

Parse the DHCP ACK to get Dns4 server information.

Parameters
InstanceThe DNS instance.
DnsServerCountRetrieved Dns4 server Ip count.
DnsServerListRetrieved Dns4 server Ip list.
Return values
EFI_SUCCESSThe Dns4 information is got from the DHCP ACK.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NO_MEDIAThere was a media error.
OthersOther errors as indicated.

Definition at line 255 of file DnsDhcp.c.

◆ GetDns6ServerFromDhcp6()

EFI_STATUS GetDns6ServerFromDhcp6 ( IN EFI_HANDLE  Image,
IN EFI_HANDLE  Controller,
OUT UINT32 *  DnsServerCount,
OUT EFI_IPv6_ADDRESS **  DnsServerList 
)

Parse the DHCP ACK to get Dns6 server information.

Parameters
ImageThe handle of the driver image.
ControllerThe handle of the controller.
DnsServerCountRetrieved Dns6 server Ip count.
DnsServerListRetrieved Dns6 server Ip list.
Return values
EFI_SUCCESSThe Dns6 information is got from the DHCP ACK.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NO_MEDIAThere was a media error.
OthersOther errors as indicated.

Definition at line 608 of file DnsDhcp.c.

◆ ParseDhcp4Ack()

EFI_STATUS ParseDhcp4Ack ( IN EFI_DHCP4_PROTOCOL Dhcp4,
IN EFI_DHCP4_PACKET Packet,
IN DNS4_SERVER_INFOR DnsServerInfor 
)

Parse the ACK to get required information

Parameters
Dhcp4The DHCP4 protocol.
PacketPacket waiting for parse.
DnsServerInforThe required Dns4 server information.
Return values
EFI_SUCCESSThe DNS information is got from the DHCP ACK.
EFI_NO_MAPPINGDHCP failed to acquire address and other information.
EFI_DEVICE_ERROROther errors as indicated.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 80 of file DnsDhcp.c.

◆ ParseDhcp6Ack()

EFI_STATUS EFIAPI ParseDhcp6Ack ( IN EFI_DHCP6_PROTOCOL This,
IN VOID *  Context,
IN EFI_DHCP6_PACKET Packet 
)

EFI_DHCP6_INFO_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol instance to intercept events that occurs in the DHCPv6 Information Request exchange process.

Parameters
ThisPointer to the EFI_DHCP6_PROTOCOL instance that is used to configure this callback function.
ContextPointer to the context that is initialized in the EFI_DHCP6_PROTOCOL.InfoRequest().
PacketPointer to Reply packet that has been received. The EFI DHCPv6 Protocol instance is responsible for freeing the buffer.
Return values
EFI_SUCCESSThe DNS information is got from the DHCP ACK.
EFI_DEVICE_ERROROther errors as indicated.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 169 of file DnsDhcp.c.