NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c File Reference


Functions

EFI_DHCP6_PACKET_OPTION * PxeBcParseDhcp6Options (IN UINT8 *Buffer, IN UINT32 Length, IN UINT16 OptTag)
UINT32 PxeBcBuildDhcp6Options (IN PXEBC_PRIVATE_DATA *Private, OUT EFI_DHCP6_PACKET_OPTION **OptList, IN UINT8 *Buffer)
VOID PxeBcCacheDhcp6Packet (IN EFI_DHCP6_PACKET *Dst, IN EFI_DHCP6_PACKET *Src)
VOID PxeBcFreeBootFileOption (IN LIST_ENTRY *Head)
EFI_STATUS PxeBcExtractBootFileUrl (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)
VOID PxeBcCopyDhcp6Ack (IN PXEBC_PRIVATE_DATA *Private, IN EFI_DHCP6_PACKET *Ack, IN BOOLEAN Verified)
VOID PxeBcCopyDhcp6Proxy (IN PXEBC_PRIVATE_DATA *Private, IN UINT32 OfferIndex)
UINT8 * PxeBcDhcp6SeekOption (IN UINT8 *Buf, IN UINT32 SeekLen, IN UINT16 OptType)
EFI_STATUS PxeBcRequestBootService (IN PXEBC_PRIVATE_DATA *Private, IN UINT32 Index)
EFI_STATUS PxeBcRetryDhcp6Binl (IN PXEBC_PRIVATE_DATA *Private, IN UINT32 Index)
VOID PxeBcCacheDhcp6Offer (IN PXEBC_PRIVATE_DATA *Private, IN EFI_DHCP6_PACKET *RcvdOffer)
VOID PxeBcSelectDhcp6Offer (IN PXEBC_PRIVATE_DATA *Private)
EFI_STATUS PxeBcHandleDhcp6Offer (IN PXEBC_PRIVATE_DATA *Private)
VOID PxeBcUnregisterIp6Address (IN PXEBC_PRIVATE_DATA *Private)
EFI_STATUS PxeBcCheckRouteTable (IN PXEBC_PRIVATE_DATA *Private, IN UINTN TimeOutInSecond, OUT EFI_IPv6_ADDRESS *GatewayAddr)
EFI_STATUS PxeBcRegisterIp6Address (IN PXEBC_PRIVATE_DATA *Private, IN EFI_IPv6_ADDRESS *Address)
EFI_STATUS PxeBcSetIp6Policy (IN PXEBC_PRIVATE_DATA *Private)
EFI_STATUS PxeBcSetIp6Address (IN PXEBC_PRIVATE_DATA *Private)
EFI_STATUS EFIAPI PxeBcDhcp6CallBack (IN EFI_DHCP6_PROTOCOL *This, IN VOID *Context, IN EFI_DHCP6_STATE CurrentState, IN EFI_DHCP6_EVENT Dhcp6Event, IN EFI_DHCP6_PACKET *Packet, OUT EFI_DHCP6_PACKET **NewPacket)
EFI_STATUS PxeBcDhcp6Discover (IN PXEBC_PRIVATE_DATA *Private, IN UINT16 Type, IN UINT16 *Layer, IN BOOLEAN UseBis, IN EFI_IP_ADDRESS *DestIp)
EFI_STATUS PxeBcDhcp6Sarr (IN PXEBC_PRIVATE_DATA *Private, IN EFI_DHCP6_PROTOCOL *Dhcp6)

Variables

EFI_IPv6_ADDRESS mAllDhcpRelayAndServersAddress = {{0xFF, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2}}

Detailed Description

Functions implementation related with DHCPv6 for UefiPxeBc Driver.

(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

UINT32 PxeBcBuildDhcp6Options ( IN PXEBC_PRIVATE_DATA Private,
OUT EFI_DHCP6_PACKET_OPTION **  OptList,
IN UINT8 *  Buffer 
)

VOID PxeBcCacheDhcp6Offer ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_DHCP6_PACKET *  RcvdOffer 
)

Cache all the received DHCPv6 offers, and set OfferIndex and OfferCount.

Parameters:
[in] Private The pointer to PXEBC_PRIVATE_DATA.
[in] RcvdOffer The pointer to the received offer packet.

References IS_PROXY_OFFER, PXEBC_DHCP6_PACKET::Offer, PXEBC_DHCP6_PACKET_CACHE::OfferType, PXEBC_DHCP6_PACKET_CACHE::Packet, PXEBC_OFFER_MAX_NUM, PxeBcCacheDhcp6Packet(), PxeBcParseDhcp6Packet(), PxeOfferTypeMax, and PxeOfferTypeProxyBinl.

Referenced by PxeBcDhcp6CallBack().

VOID PxeBcCacheDhcp6Packet ( IN EFI_DHCP6_PACKET *  Dst,
IN EFI_DHCP6_PACKET *  Src 
)

Cache the DHCPv6 packet.

Parameters:
[in] Dst The pointer to the cache buffer for DHCPv6 packet.
[in] Src The pointer to the DHCPv6 packet to be cached.

Referenced by PxeBcCacheDhcp6Offer(), PxeBcCopyDhcp6Ack(), and PxeBcCopyDhcp6Proxy().

EFI_STATUS PxeBcCheckRouteTable ( IN PXEBC_PRIVATE_DATA Private,
IN UINTN  TimeOutInSecond,
OUT EFI_IPv6_ADDRESS *  GatewayAddr 
)

Check whether IP driver could route the message which will be sent to ServerIp address.

This function will check the IP6 route table every 1 seconds until specified timeout is expired, if a valid route is found in IP6 route table, the address will be filed in GatewayAddr and return.

Parameters:
[in] Private The pointer to PXEBC_PRIVATE_DATA.
[in] TimeOutInSecond Timeout value in seconds.
[out] GatewayAddr Pointer to store the gateway IP address.
Return values:
EFI_SUCCESS Found a valid gateway address successfully.
EFI_TIMEOUT The operation is time out.
Other Unexpect error happened.

Referenced by PxeBcRegisterIp6Address().

VOID PxeBcCopyDhcp6Ack ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_DHCP6_PACKET *  Ack,
IN BOOLEAN  Verified 
)

Cache the DHCPv6 ack packet, and parse it on demand.

Parameters:
[in] Private The pointer to PxeBc private data.
[in] Ack The pointer to the DHCPv6 ack packet.
[in] Verified If TRUE, parse the ACK packet and store info into mode data.

References PxeBcCacheDhcp6Packet(), and PxeBcParseDhcp6Packet().

Referenced by PxeBcDhcp6CallBack(), and PxeBcHandleDhcp6Offer().

VOID PxeBcCopyDhcp6Proxy ( IN PXEBC_PRIVATE_DATA Private,
IN UINT32  OfferIndex 
)

Cache the DHCPv6 proxy offer packet according to the received order.

Parameters:
[in] Private The pointer to PxeBc private data.
[in] OfferIndex The received order of offer packets.

References PXEBC_OFFER_MAX_NUM, PxeBcCacheDhcp6Packet(), and PxeBcParseDhcp6Packet().

Referenced by PxeBcHandleDhcp6Offer().

EFI_STATUS EFIAPI PxeBcDhcp6CallBack ( IN EFI_DHCP6_PROTOCOL *  This,
IN VOID *  Context,
IN EFI_DHCP6_STATE  CurrentState,
IN EFI_DHCP6_EVENT  Dhcp6Event,
IN EFI_DHCP6_PACKET *  Packet,
OUT EFI_DHCP6_PACKET **  NewPacket 
)

EFI_DHCP6_CALLBACK is provided by the consumer of the EFI DHCPv6 Protocol driver to intercept events that occurred in the configuration process.

Parameters:
[in] This The pointer to the EFI DHCPv6 Protocol.
[in] Context The pointer to the context set by EFI_DHCP6_PROTOCOL.Configure().
[in] CurrentState The current operational state of the EFI DHCPv Protocol driver.
[in] Dhcp6Event The event that occurs in the current state, which usually means a state transition.
[in] Packet The DHCPv6 packet that is going to be sent or was already received.
[out] NewPacket The packet that is used to replace the Packet above.
Return values:
EFI_SUCCESS Told the EFI DHCPv6 Protocol driver to continue the DHCP process.
EFI_NOT_READY Only used in the Dhcp6Selecting state. The EFI DHCPv6 Protocol driver will continue to wait for more packets.
EFI_ABORTED Told the EFI DHCPv6 Protocol driver to abort the current process.

References CalcElapsedTime(), PXEBC_DHCP_PACKET_CACHE::Dhcp6, _PXEBC_PRIVATE_DATA::Dhcp6Request, _PXEBC_PRIVATE_DATA::Function, PXEBC_DHCP6_PACKET::Offer, _PXEBC_PRIVATE_DATA::OfferBuffer, _PXEBC_PRIVATE_DATA::OfferNum, PXEBC_DHCP6_PACKET_CACHE::Packet, _PXEBC_PRIVATE_DATA::PxeBc, PXEBC_OFFER_MAX_NUM, PxeBcCacheDhcp6Offer(), _PXEBC_PRIVATE_DATA::PxeBcCallback, PxeBcCopyDhcp6Ack(), PxeBcSelectDhcp6Offer(), _PXEBC_PRIVATE_DATA::SelectIndex, and _PXEBC_PRIVATE_DATA::SolicitTimes.

Referenced by PxeBcDhcp6Sarr().

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] Private The pointer to PxeBc private data.
[in] Type PxeBc option boot item type.
[in] Layer The pointer to option boot item layer.
[in] UseBis Use BIS or not.
[in] DestIp The pointer to the server address.
Return values:
EFI_SUCCESS Successfully discovered the boot file.
EFI_OUT_OF_RESOURCES Failed to allocate resources.
EFI_NOT_FOUND Can't get the PXE reply packet.
Others Failed to discover the boot file.

References PXEBC_BS_DISCOVER_PORT.

Referenced by PxeBcDiscoverBootServer().

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] Private The pointer to PxeBc private data.
[in] Dhcp6 The pointer to the EFI_DHCP6_PROTOCOL
Return values:
EFI_SUCCESS The S.A.R.R. process successfully finished.
Others Failed to finish the S.A.R.R. process.

References PXEBC_DAD_ADDITIONAL_DELAY, PXEBC_DHCP6_OPTION_MAX_NUM, PXEBC_DHCP6_OPTION_MAX_SIZE, PxeBcBuildDhcp6Options(), PxeBcDhcp6CallBack(), and PxeBcHandleDhcp6Offer().

Referenced by EfiPxeBcDhcp().

UINT8* PxeBcDhcp6SeekOption ( IN UINT8 *  Buf,
IN UINT32  SeekLen,
IN UINT16  OptType 
)

Seek the address of the first byte of the option header.

Parameters:
[in] Buf The pointer to the buffer.
[in] SeekLen The length to seek.
[in] OptType The option type.
Return values:
NULL If it failed to seek the option.
others The position to the option.

Referenced by PxeBcRequestBootService().

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

Parse the Boot File Parameter option.

Parameters:
[in] BootFilePara The pointer to boot file parameter option data.
[out] BootFileSize The pointer to the parsed boot file size.
Return values:
EFI_SUCCESS Successfully obtained the boot file size from parameter option.
EFI_NOT_FOUND Failed to extract the boot file size from parameter option.

References PXEBC_DHCP6_MAX_BOOT_FILE_SIZE, and PxeBcUniHexToUint8().

Referenced by PxeBcDhcp6BootInfo().

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

Parse the Boot File URL option.

Parameters:
[out] FileName The pointer to the boot file name.
[in,out] SrvAddr The pointer to the boot server address.
[in] BootFile The pointer to the boot file URL option data.
[in] Length The length of the boot file URL option data.
Return values:
EFI_ABORTED User cancel operation.
EFI_SUCCESS Selected the boot menu successfully.
EFI_NOT_READY Read the input key from the keybroad has not finish.

References PXEBC_ADDR_END_DELIMITER, PXEBC_ADDR_START_DELIMITER, PXEBC_DHCP6_BOOT_FILE_URL_PREFIX, and PXEBC_TFTP_URL_SEPARATOR.

Referenced by PxeBcDhcp6BootInfo(), and PxeBcRetryDhcp6Binl().

VOID PxeBcFreeBootFileOption ( IN LIST_ENTRY *  Head  ) 

Free all the nodes in the list for boot file.

Parameters:
[in] Head The pointer to the head of list.

EFI_STATUS PxeBcHandleDhcp6Offer ( IN PXEBC_PRIVATE_DATA Private  ) 

Handle the DHCPv6 offer packet.

Parameters:
[in] Private The pointer to PXEBC_PRIVATE_DATA.
Return values:
EFI_SUCCESS Handled the DHCPv6 offer packet successfully.
EFI_NO_RESPONSE No response to the following request packet.

References IS_PROXY_OFFER, PXEBC_DHCP6_PACKET_CACHE::OfferType, PXEBC_DHCP6_PACKET_CACHE::OptList, PXEBC_DHCP6_IDX_BOOT_FILE_URL, PXEBC_OFFER_MAX_NUM, PxeBcCopyDhcp6Ack(), PxeBcCopyDhcp6Proxy(), PxeBcRetryDhcp6Binl(), PxeOfferTypeDhcpBinl, PxeOfferTypeDhcpOnly, and PxeOfferTypeProxyBinl.

Referenced by PxeBcDhcp6Sarr().

EFI_DHCP6_PACKET_OPTION* PxeBcParseDhcp6Options ( IN UINT8 *  Buffer,
IN UINT32  Length,
IN UINT16  OptTag 
)

Parse out a DHCPv6 option by OptTag, and find the position in buffer.

Parameters:
[in] Buffer The pointer to the option buffer.
[in] Length Length of the option buffer.
[in] OptTag The required option tag.
Return values:
NULL Failed to parse the required option.
Others The postion of the required option in buffer.

Referenced by PxeBcParseDhcp6Packet().

EFI_STATUS PxeBcParseDhcp6Packet ( IN PXEBC_DHCP6_PACKET_CACHE Cache6  ) 

EFI_STATUS PxeBcRegisterIp6Address ( IN PXEBC_PRIVATE_DATA Private,
IN EFI_IPv6_ADDRESS *  Address 
)

Register the ready station address and gateway by Ip6Config protocol.

Parameters:
[in] Private The pointer to PXEBC_PRIVATE_DATA.
[in] Address The pointer to the ready address.
Return values:
EFI_SUCCESS Registered the address succesfully.
Others Failed to register the address.

References Policy, PXEBC_DAD_ADDITIONAL_DELAY, PXEBC_IP6_POLICY_MAX, PXEBC_IP6_ROUTE_TABLE_TIMEOUT, PxeBcCheckRouteTable(), and PxeBcCommonNotify().

Referenced by EfiPxeBcSetStationIP(), and PxeBcSetIp6Address().

EFI_STATUS PxeBcRequestBootService ( IN PXEBC_PRIVATE_DATA Private,
IN UINT32  Index 
)

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

Parameters:
[in] Private The pointer to PxeBc private data.
[in] Index PxeBc option boot item type.
Return values:
EFI_SUCCESS Successfully discovered the boot file.
EFI_OUT_OF_RESOURCES Failed to allocate resources.
EFI_NOT_FOUND Can't get the PXE reply packet.
Others Failed to discover the boot file.

References CalcElapsedTime(), PXEBC_BS_DISCOVER_PORT, PXEBC_DHCP6_OPT_ELAPSED_TIME, PXEBC_DHCP6_OPT_SERVER_ID, and PxeBcDhcp6SeekOption().

Referenced by PxeBcRetryDhcp6Binl().

EFI_STATUS PxeBcRetryDhcp6Binl ( IN PXEBC_PRIVATE_DATA Private,
IN UINT32  Index 
)

Retry to request bootfile name by the BINL offer.

Parameters:
[in] Private The pointer to PxeBc private data.
[in] Index The received order of offer packets.
Return values:
EFI_SUCCESS Successfully retried a request for the bootfile name.
EFI_DEVICE_ERROR Failed to retry the bootfile name.

References mAllDhcpRelayAndServersAddress, PXEBC_DHCP6_PACKET::Offer, PXEBC_DHCP6_PACKET_CACHE::OfferType, PXEBC_DHCP6_PACKET_CACHE::OptList, PXEBC_DHCP6_PACKET_CACHE::Packet, PXEBC_DHCP6_IDX_BOOT_FILE_URL, PXEBC_OFFER_MAX_NUM, PxeBcExtractBootFileUrl(), PxeBcParseDhcp6Packet(), PxeBcRequestBootService(), PxeOfferTypeDhcpBinl, PxeOfferTypeProxyBinl, PxeOfferTypeProxyPxe10, and PxeOfferTypeProxyWfm11a.

Referenced by PxeBcHandleDhcp6Offer().

VOID PxeBcSelectDhcp6Offer ( IN PXEBC_PRIVATE_DATA Private  ) 

Select an DHCPv6 offer, and record SelectIndex and SelectProxyType.

Parameters:
[in] Private The pointer to PXEBC_PRIVATE_DATA.

References IS_PROXY_OFFER, PXEBC_DHCP6_IDX_BOOT_FILE_URL, PxeOfferTypeDhcpBinl, PxeOfferTypeDhcpOnly, PxeOfferTypeDhcpPxe10, PxeOfferTypeDhcpWfm11a, PxeOfferTypeProxyBinl, PxeOfferTypeProxyPxe10, and PxeOfferTypeProxyWfm11a.

Referenced by PxeBcDhcp6CallBack().

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] Private The pointer to PXEBC_PRIVATE_DATA.
Return values:
EFI_SUCCESS The new IP address has been configured successfully.
Others Failed to configure the address.

References PxeBcFlushStationIp(), PxeBcRegisterIp6Address(), PxeBcShowIp6Addr(), and PxeBcUnregisterIp6Address().

Referenced by PxeBcDhcp6BootInfo().

EFI_STATUS PxeBcSetIp6Policy ( IN PXEBC_PRIVATE_DATA Private  ) 

Set the IP6 policy to Automatic.

Parameters:
[in] Private The pointer to PXEBC_PRIVATE_DATA.
Return values:
EFI_SUCCESS Switch the IP policy succesfully.
Others Unexpect error happened.

References Policy, and PXEBC_IP6_POLICY_MAX.

Referenced by EfiPxeBcStart().

VOID PxeBcUnregisterIp6Address ( IN PXEBC_PRIVATE_DATA Private  ) 

Unregister the address by Ip6Config protocol.

Parameters:
[in] Private The pointer to PXEBC_PRIVATE_DATA.

References PXEBC_IP6_POLICY_MAX.

Referenced by EfiPxeBcStop(), and PxeBcSetIp6Address().


Variable Documentation

EFI_IPv6_ADDRESS mAllDhcpRelayAndServersAddress = {{0xFF, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2}}


Generated on Mon Sep 28 08:49:07 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1