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

Go to the source code of this file.

Data Structures

struct  PXEBC_DHCP6_OPTION_ORO
 
struct  PXEBC_DHCP6_OPTION_UNDI
 
struct  PXEBC_DHCP6_OPTION_ARCH
 
struct  PXEBC_CLASS_ID
 
struct  PXEBC_DHCP6_OPTION_VENDOR_CLASS
 
union  PXEBC_DHCP6_OPTION_ENTRY
 
struct  PXEBC_DHCP6_OPTION_NODE
 
union  PXEBC_DHCP6_PACKET
 
struct  PXEBC_DHCP6_PACKET_CACHE
 

Macros

#define PXEBC_DHCP6_OPTION_MAX_NUM   16
 
#define PXEBC_DHCP6_OPTION_MAX_SIZE   312
 
#define PXEBC_DHCP6_PACKET_MAX_SIZE   (sizeof (EFI_PXE_BASE_CODE_PACKET))
 
#define PXEBC_IP6_POLICY_MAX   0xff
 
#define PXEBC_IP6_ROUTE_TABLE_TIMEOUT   10
 
#define PXEBC_DHCP6_S_PORT   547
 
#define PXEBC_DHCP6_C_PORT   546
 
#define PXEBC_DHCP6_ENTERPRISE_NUM   343
 
#define PXEBC_DHCP6_MAX_BOOT_FILE_SIZE   65535
 
#define PXEBC_DHCP6_IDX_IA_NA   0
 
#define PXEBC_DHCP6_IDX_BOOT_FILE_URL   1
 
#define PXEBC_DHCP6_IDX_BOOT_FILE_PARAM   2
 
#define PXEBC_DHCP6_IDX_VENDOR_CLASS   3
 
#define PXEBC_DHCP6_IDX_DNS_SERVER   4
 
#define PXEBC_DHCP6_IDX_MAX   5
 
#define PXEBC_DHCP6_BOOT_FILE_URL_PREFIX   "tftp://"
 
#define PXEBC_TFTP_URL_SEPARATOR   '/'
 
#define PXEBC_ADDR_START_DELIMITER   '['
 
#define PXEBC_ADDR_END_DELIMITER   ']'
 
#define PXEBC_MIN_SIZE_OF_DUID   (sizeof(UINT16) + 1)
 
#define PXEBC_MAX_SIZE_OF_DUID   (sizeof(UINT16) + 128)
 
#define PXEBC_COMBINED_SIZE_OF_OPT_CODE_AND_LEN
 
#define GET_NEXT_DHCP6_OPTION(Opt)
 
#define GET_DHCP6_OPTION_SIZE(Pkt)    ((Pkt)->Length - sizeof (EFI_DHCP6_HEADER))
 
#define IS_PROXY_OFFER(Type)
 
#define PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE   (OFFSET_OF (EFI_DHCP6_PACKET, Dhcp6) + PXEBC_DHCP6_PACKET_MAX_SIZE)
 

Functions

EFI_STATUS PxeBcExtractBootFileUrl (IN PXEBC_PRIVATE_DATA *Private, OUT UINT8 **FileName, IN OUT EFI_IPv6_ADDRESS *SrvAddr, IN CHAR8 *BootFile, IN UINT16 Length)
 
EFI_STATUS PxeBcExtractBootFileParam (IN CHAR8 *BootFilePara, OUT UINT16 *BootFileSize)
 
EFI_STATUS PxeBcParseDhcp6Packet (IN PXEBC_DHCP6_PACKET_CACHE *Cache6)
 
EFI_STATUS PxeBcRegisterIp6Address (IN PXEBC_PRIVATE_DATA *Private, IN EFI_IPv6_ADDRESS *Address)
 
VOID PxeBcUnregisterIp6Address (IN PXEBC_PRIVATE_DATA *Private)
 
EFI_STATUS PxeBcDhcp6Discover (IN PXEBC_PRIVATE_DATA *Private, IN UINT16 Type, IN UINT16 *Layer, IN BOOLEAN UseBis, IN EFI_IP_ADDRESS *DestIp)
 
EFI_STATUS PxeBcSetIp6Policy (IN PXEBC_PRIVATE_DATA *Private)
 
EFI_STATUS PxeBcSetIp6Address (IN PXEBC_PRIVATE_DATA *Private)
 
EFI_STATUS PxeBcDhcp6Sarr (IN PXEBC_PRIVATE_DATA *Private, IN EFI_DHCP6_PROTOCOL *Dhcp6)
 

Detailed Description

Functions declaration related with DHCPv6 for UefiPxeBc Driver.

Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PxeBcDhcp6.h.

Macro Definition Documentation

◆ GET_DHCP6_OPTION_SIZE

#define GET_DHCP6_OPTION_SIZE (   Pkt)     ((Pkt)->Length - sizeof (EFI_DHCP6_HEADER))

Definition at line 58 of file PxeBcDhcp6.h.

◆ GET_NEXT_DHCP6_OPTION

#define GET_NEXT_DHCP6_OPTION (   Opt)
Value:
(EFI_DHCP6_PACKET_OPTION *) ((UINT8 *) (Opt) + \
sizeof (EFI_DHCP6_PACKET_OPTION) + (NTOHS ((Opt)->OpLen)) - 1)

Definition at line 54 of file PxeBcDhcp6.h.

◆ IS_PROXY_OFFER

#define IS_PROXY_OFFER (   Type)
Value:
((Type) == PxeOfferTypeProxyBinl || \
(Type) == PxeOfferTypeProxyPxe10 || \
(Type) == PxeOfferTypeProxyWfm11a)

Definition at line 61 of file PxeBcDhcp6.h.

◆ PXEBC_ADDR_END_DELIMITER

#define PXEBC_ADDR_END_DELIMITER   ']'

Definition at line 35 of file PxeBcDhcp6.h.

◆ PXEBC_ADDR_START_DELIMITER

#define PXEBC_ADDR_START_DELIMITER   '['

Definition at line 34 of file PxeBcDhcp6.h.

◆ PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE

#define PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE   (OFFSET_OF (EFI_DHCP6_PACKET, Dhcp6) + PXEBC_DHCP6_PACKET_MAX_SIZE)

Definition at line 113 of file PxeBcDhcp6.h.

◆ PXEBC_COMBINED_SIZE_OF_OPT_CODE_AND_LEN

#define PXEBC_COMBINED_SIZE_OF_OPT_CODE_AND_LEN
Value:
(sizeof (((EFI_DHCP6_PACKET_OPTION *)0)->OpCode) + \
sizeof (((EFI_DHCP6_PACKET_OPTION *)0)->OpLen))

Definition at line 50 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_BOOT_FILE_URL_PREFIX

#define PXEBC_DHCP6_BOOT_FILE_URL_PREFIX   "tftp://"

Definition at line 32 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_C_PORT

#define PXEBC_DHCP6_C_PORT   546

Definition at line 20 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_ENTERPRISE_NUM

#define PXEBC_DHCP6_ENTERPRISE_NUM   343

Definition at line 22 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_IDX_BOOT_FILE_PARAM

#define PXEBC_DHCP6_IDX_BOOT_FILE_PARAM   2

Definition at line 27 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_IDX_BOOT_FILE_URL

#define PXEBC_DHCP6_IDX_BOOT_FILE_URL   1

Definition at line 26 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_IDX_DNS_SERVER

#define PXEBC_DHCP6_IDX_DNS_SERVER   4

Definition at line 29 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_IDX_IA_NA

#define PXEBC_DHCP6_IDX_IA_NA   0

Definition at line 25 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_IDX_MAX

#define PXEBC_DHCP6_IDX_MAX   5

Definition at line 30 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_IDX_VENDOR_CLASS

#define PXEBC_DHCP6_IDX_VENDOR_CLASS   3

Definition at line 28 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_MAX_BOOT_FILE_SIZE

#define PXEBC_DHCP6_MAX_BOOT_FILE_SIZE   65535

Definition at line 23 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_OPTION_MAX_NUM

#define PXEBC_DHCP6_OPTION_MAX_NUM   16

Definition at line 13 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_OPTION_MAX_SIZE

#define PXEBC_DHCP6_OPTION_MAX_SIZE   312

Definition at line 14 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_PACKET_MAX_SIZE

#define PXEBC_DHCP6_PACKET_MAX_SIZE   (sizeof (EFI_PXE_BASE_CODE_PACKET))

Definition at line 15 of file PxeBcDhcp6.h.

◆ PXEBC_DHCP6_S_PORT

#define PXEBC_DHCP6_S_PORT   547

Definition at line 19 of file PxeBcDhcp6.h.

◆ PXEBC_IP6_POLICY_MAX

#define PXEBC_IP6_POLICY_MAX   0xff

Definition at line 16 of file PxeBcDhcp6.h.

◆ PXEBC_IP6_ROUTE_TABLE_TIMEOUT

#define PXEBC_IP6_ROUTE_TABLE_TIMEOUT   10

Definition at line 17 of file PxeBcDhcp6.h.

◆ PXEBC_MAX_SIZE_OF_DUID

#define PXEBC_MAX_SIZE_OF_DUID   (sizeof(UINT16) + 128)

Definition at line 44 of file PxeBcDhcp6.h.

◆ PXEBC_MIN_SIZE_OF_DUID

#define PXEBC_MIN_SIZE_OF_DUID   (sizeof(UINT16) + 1)

Definition at line 43 of file PxeBcDhcp6.h.

◆ PXEBC_TFTP_URL_SEPARATOR

#define PXEBC_TFTP_URL_SEPARATOR   '/'

Definition at line 33 of file PxeBcDhcp6.h.

Function Documentation

◆ PxeBcDhcp6Discover()

EFI_STATUS PxeBcDhcp6Discover ( IN PXEBC_PRIVATE_DATA Private,
IN UINT16  Type,
IN UINT16 *  Layer,
IN BOOLEAN  UseBis,
IN EFI_IP_ADDRESS DestIp 
)

Build and send out the request packet for the bootfile, and parse the reply.

Parameters
[in]PrivateThe pointer to the PxeBc private data.
[in]TypePxeBc option boot item type.
[in]LayerThe pointer to the option boot item layer.
[in]UseBisUse BIS or not.
[in]DestIpThe pointer to the server address.
Return values
EFI_SUCCESSSuccessfully discovered theboot file.
EFI_OUT_OF_RESOURCESFailed to allocate resource.
EFI_NOT_FOUNDCan't get the PXE reply packet.
OthersFailed to discover boot file.

Build and send out the request packet for the bootfile, and parse the reply.

Parameters
[in]PrivateThe pointer to PxeBc private data.
[in]TypePxeBc option boot item type.
[in]LayerThe pointer to option boot item layer.
[in]UseBisUse BIS or not.
[in]DestIpThe pointer to the server address.
Return values
EFI_SUCCESSSuccessfully discovered the boot file.
EFI_OUT_OF_RESOURCESFailed to allocate resources.
EFI_NOT_FOUNDCan't get the PXE reply packet.
OthersFailed to discover the boot file.

Definition at line 2161 of file PxeBcDhcp6.c.

◆ PxeBcDhcp6Sarr()

EFI_STATUS PxeBcDhcp6Sarr ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_DHCP6_PROTOCOL Dhcp6 
)

Start the DHCPv6 S.A.R.R. process to acquire the IPv6 address and other PXE boot information.

Parameters
[in]PrivateThe pointer to the PxeBc private data.
[in]Dhcp6The pointer to EFI_DHCP6_PROTOCOL.
Return values
EFI_SUCCESSThe S.A.R.R. process successfully finished.
OthersFailed to finish the S.A.R.R. process.

Start the DHCPv6 S.A.R.R. process to acquire the IPv6 address and other PXE boot information.

Parameters
[in]PrivateThe pointer to PxeBc private data.
[in]Dhcp6The pointer to the EFI_DHCP6_PROTOCOL
Return values
EFI_SUCCESSThe S.A.R.R. process successfully finished.
OthersFailed to finish the S.A.R.R. process.

Definition at line 2335 of file PxeBcDhcp6.c.

◆ PxeBcExtractBootFileParam()

EFI_STATUS PxeBcExtractBootFileParam ( IN CHAR8 *  BootFilePara,
OUT UINT16 *  BootFileSize 
)

Parse the Boot File Parameter option.

Parameters
[in]BootFileParaThe pointer to the boot file parameter option data.
[out]BootFileSizeThe pointer to the parsed boot file size.
Return values
EFI_SUCCESSSuccessfully obtained the boot file size from parameter option.
EFI_NOT_FOUNDFailed to extract the boot file size from parameter option.

Parse the Boot File Parameter option.

Parameters
[in]BootFileParaThe pointer to boot file parameter option data.
[out]BootFileSizeThe pointer to the parsed boot file size.
Return values
EFI_SUCCESSSuccessfully obtained the boot file size from parameter option.
EFI_NOT_FOUNDFailed to extract the boot file size from parameter option.

Definition at line 580 of file PxeBcDhcp6.c.

◆ PxeBcExtractBootFileUrl()

EFI_STATUS PxeBcExtractBootFileUrl ( IN PXEBC_PRIVATE_DATA Private,
OUT UINT8 **  FileName,
IN OUT EFI_IPv6_ADDRESS SrvAddr,
IN CHAR8 *  BootFile,
IN UINT16  Length 
)

Parse the Boot File URL option.

Parameters
[in]PrivatePointer to PxeBc private data.
[out]FileNameThe pointer to the boot file name.
[in,out]SrvAddrThe pointer to the boot server address.
[in]BootFileThe pointer to the boot file URL option data.
[in]LengthLength of the boot file URL option data.
Return values
EFI_ABORTEDUser canceled the operation.
EFI_SUCCESSSelected the boot menu successfully.
EFI_NOT_READYRead the input key from the keyboard has not finish.

Parse the Boot File URL option.

Parameters
[in]PrivatePointer to PxeBc private data.
[out]FileNameThe pointer to the boot file name.
[in,out]SrvAddrThe pointer to the boot server address.
[in]BootFileThe pointer to the boot file URL option data.
[in]LengthThe length of the boot file URL option data.
Return values
EFI_ABORTEDUser cancel operation.
EFI_SUCCESSSelected the boot menu successfully.
EFI_NOT_READYRead the input key from the keyboard has not finish.

Definition at line 380 of file PxeBcDhcp6.c.

◆ PxeBcParseDhcp6Packet()

EFI_STATUS PxeBcParseDhcp6Packet ( IN PXEBC_DHCP6_PACKET_CACHE Cache6)

Parse the cached DHCPv6 packet, including all the options.

Parameters
[in]Cache6The pointer to a cached DHCPv6 packet.
Return values
EFI_SUCCESSParsed the DHCPv6 packet successfully.
EFI_DEVICE_ERRORFailed to parse and invalid packet.

Parse the cached DHCPv6 packet, including all the options.

Parameters
[in]Cache6The pointer to a cached DHCPv6 packet.
Return values
EFI_SUCCESSParsed the DHCPv6 packet successfully.
EFI_DEVICE_ERRORFailed to parse and invalid the packet.

Definition at line 632 of file PxeBcDhcp6.c.

◆ PxeBcRegisterIp6Address()

EFI_STATUS PxeBcRegisterIp6Address ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_IPv6_ADDRESS Address 
)

Register the ready address by Ip6Config protocol.

Parameters
[in]PrivateThe pointer to the PxeBc private data.
[in]AddressThe pointer to the ready address.
Return values
EFI_SUCCESSRegistered the address successfully.
OthersFailed to register the address.

Register the ready station address and gateway by Ip6Config protocol.

Parameters
[in]PrivateThe pointer to PXEBC_PRIVATE_DATA.
[in]AddressThe pointer to the ready address.
Return values
EFI_SUCCESSRegistered the address successfully.
OthersFailed to register the address.

Definition at line 1696 of file PxeBcDhcp6.c.

◆ PxeBcSetIp6Address()

EFI_STATUS PxeBcSetIp6Address ( IN PXEBC_PRIVATE_DATA Private)

This function will register the station IP address and flush IP instance to start using the new IP address.

Parameters
[in]PrivateThe pointer to PXEBC_PRIVATE_DATA.
Return values
EFI_SUCCESSThe new IP address has been configured successfully.
OthersFailed to configure the address.

Definition at line 1935 of file PxeBcDhcp6.c.

◆ PxeBcSetIp6Policy()

EFI_STATUS PxeBcSetIp6Policy ( IN PXEBC_PRIVATE_DATA Private)

Set the IP6 policy to Automatic.

Parameters
[in]PrivateThe pointer to PXEBC_PRIVATE_DATA.
Return values
EFI_SUCCESSSwitch the IP policy successfully.
OthersUnexpected error happened.

Definition at line 1881 of file PxeBcDhcp6.c.

◆ PxeBcUnregisterIp6Address()

VOID PxeBcUnregisterIp6Address ( IN PXEBC_PRIVATE_DATA Private)

Unregister the address by Ip6Config protocol.

Parameters
[in]PrivateThe pointer to the PxeBc private data.

Unregister the address by Ip6Config protocol.

Parameters
[in]PrivateThe pointer to PXEBC_PRIVATE_DATA.

Definition at line 1547 of file PxeBcDhcp6.c.