TianoCore EDK2 master
Loading...
Searching...
No Matches
HttpBootDhcp6.c File Reference
#include "HttpBootDxe.h"

Go to the source code of this file.

Functions

UINT32 HttpBootBuildDhcp6Options (IN HTTP_BOOT_PRIVATE_DATA *Private, OUT EFI_DHCP6_PACKET_OPTION **OptList, IN UINT8 *Buffer)
 
EFI_DHCP6_PACKET_OPTIONHttpBootParseDhcp6Options (IN UINT8 *Buffer, IN UINT32 Length, IN UINT16 OptTag)
 
EFI_STATUS HttpBootParseDhcp6Packet (IN HTTP_BOOT_DHCP6_PACKET_CACHE *Cache6)
 
EFI_STATUS HttpBootCacheDhcp6Packet (IN EFI_DHCP6_PACKET *Dst, IN EFI_DHCP6_PACKET *Src)
 
EFI_STATUS HttpBootCacheDhcp6Offer (IN HTTP_BOOT_PRIVATE_DATA *Private, IN EFI_DHCP6_PACKET *RcvdOffer)
 
EFI_STATUS EFIAPI HttpBootDhcp6CallBack (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 OPTIONAL)
 
EFI_STATUS HttpBootCheckRouteTable (IN HTTP_BOOT_PRIVATE_DATA *Private, IN UINTN TimeOutInSecond, OUT EFI_IPv6_ADDRESS *GatewayAddr)
 
EFI_STATUS HttpBootSetIp6Policy (IN HTTP_BOOT_PRIVATE_DATA *Private)
 
EFI_STATUS HttpBootSetIp6Dns (IN HTTP_BOOT_PRIVATE_DATA *Private, IN UINTN DataLength, IN VOID *DnsServerData)
 
EFI_STATUS HttpBootSetIp6Gateway (IN HTTP_BOOT_PRIVATE_DATA *Private)
 
EFI_STATUS HttpBootSetIp6Address (IN HTTP_BOOT_PRIVATE_DATA *Private)
 
EFI_STATUS HttpBootDhcp6Sarr (IN HTTP_BOOT_PRIVATE_DATA *Private)
 

Detailed Description

Functions implementation related with DHCPv6 for HTTP boot driver.

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

Definition in file HttpBootDhcp6.c.

Function Documentation

◆ HttpBootBuildDhcp6Options()

UINT32 HttpBootBuildDhcp6Options ( IN HTTP_BOOT_PRIVATE_DATA Private,
OUT EFI_DHCP6_PACKET_OPTION **  OptList,
IN UINT8 *  Buffer 
)

Build the options buffer for the DHCPv6 request packet.

Parameters
[in]PrivateThe pointer to HTTP BOOT driver private data.
[out]OptListThe pointer to the option pointer array.
[in]BufferThe pointer to the buffer to contain the option list.
Returns
Index The count of the built-in options.

Definition at line 23 of file HttpBootDhcp6.c.

◆ HttpBootCacheDhcp6Offer()

EFI_STATUS HttpBootCacheDhcp6Offer ( IN HTTP_BOOT_PRIVATE_DATA Private,
IN EFI_DHCP6_PACKET RcvdOffer 
)

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

Parameters
[in]PrivateThe pointer to HTTP_BOOT_PRIVATE_DATA.
[in]RcvdOfferThe pointer to the received offer packet.
Return values
EFI_SUCCESSCache and parse the packet successfully.
OthersOperation failed.

Definition at line 355 of file HttpBootDhcp6.c.

◆ HttpBootCacheDhcp6Packet()

EFI_STATUS HttpBootCacheDhcp6Packet ( IN EFI_DHCP6_PACKET Dst,
IN EFI_DHCP6_PACKET Src 
)

Cache the DHCPv6 packet.

Parameters
[in]DstThe pointer to the cache buffer for DHCPv6 packet.
[in]SrcThe pointer to the DHCPv6 packet to be cached.
Return values
EFI_SUCCESSPacket is copied.
EFI_BUFFER_TOO_SMALLCache buffer is not big enough to hold the packet.

Definition at line 329 of file HttpBootDhcp6.c.

◆ HttpBootCheckRouteTable()

EFI_STATUS HttpBootCheckRouteTable ( IN HTTP_BOOT_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]PrivateThe pointer to HTTP_BOOT_PRIVATE_DATA.
[in]TimeOutInSecondTimeout value in seconds.
[out]GatewayAddrPointer to store the gateway IP address.
Return values
EFI_SUCCESSFound a valid gateway address successfully.
EFI_TIMEOUTThe operation is time out.
OtherUnexpected error happened.

Definition at line 524 of file HttpBootDhcp6.c.

◆ HttpBootDhcp6CallBack()

EFI_STATUS EFIAPI HttpBootDhcp6CallBack ( 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  OPTIONAL 
)

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]ThisThe pointer to the EFI DHCPv6 Protocol.
[in]ContextThe pointer to the context set by EFI_DHCP6_PROTOCOL.Configure().
[in]CurrentStateThe current operational state of the EFI DHCPv Protocol driver.
[in]Dhcp6EventThe event that occurs in the current state, which usually means a state transition.
[in]PacketThe DHCPv6 packet that is going to be sent or was already received.
[out]NewPacketThe packet that is used to replace the Packet above.
Return values
EFI_SUCCESSTold the EFI DHCPv6 Protocol driver to continue the DHCP process.
EFI_NOT_READYOnly used in the Dhcp6Selecting state. The EFI DHCPv6 Protocol driver will continue to wait for more packets.
EFI_ABORTEDTold the EFI DHCPv6 Protocol driver to abort the current process.
EFI_OUT_OF_RESOURCESThere are not enough resources.

Definition at line 417 of file HttpBootDhcp6.c.

◆ HttpBootDhcp6Sarr()

EFI_STATUS HttpBootDhcp6Sarr ( IN HTTP_BOOT_PRIVATE_DATA Private)

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

Parameters
[in]PrivatePointer to HTTP_BOOT private data.
Return values
EFI_SUCCESSThe S.A.R.R process successfully finished.
OthersFailed to finish the S.A.R.R process.

Definition at line 943 of file HttpBootDhcp6.c.

◆ HttpBootParseDhcp6Options()

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

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

Parameters
[in]BufferThe pointer to the option buffer.
[in]LengthLength of the option buffer.
[in]OptTagThe required option tag.
Return values
NULLFailed to parse the required option.
OthersThe position of the required option in buffer.

Definition at line 134 of file HttpBootDhcp6.c.

◆ HttpBootParseDhcp6Packet()

EFI_STATUS HttpBootParseDhcp6Packet ( IN HTTP_BOOT_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 the packet.

Definition at line 171 of file HttpBootDhcp6.c.

◆ HttpBootSetIp6Address()

EFI_STATUS HttpBootSetIp6Address ( IN HTTP_BOOT_PRIVATE_DATA Private)

This function will register the station IP address.

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

Definition at line 767 of file HttpBootDhcp6.c.

◆ HttpBootSetIp6Dns()

EFI_STATUS HttpBootSetIp6Dns ( IN HTTP_BOOT_PRIVATE_DATA Private,
IN UINTN  DataLength,
IN VOID *  DnsServerData 
)

This function will register the default DNS addresses to the network device.

Parameters
[in]PrivateThe pointer to HTTP_BOOT_PRIVATE_DATA.
[in]DataLengthSize of the buffer pointed to by DnsServerData in bytes.
[in]DnsServerDataPoint a list of DNS server address in an array of EFI_IPv6_ADDRESS instances.
Return values
EFI_SUCCESSThe DNS configuration has been configured successfully.
OthersFailed to configure the address.

Definition at line 699 of file HttpBootDhcp6.c.

◆ HttpBootSetIp6Gateway()

EFI_STATUS HttpBootSetIp6Gateway ( IN HTTP_BOOT_PRIVATE_DATA Private)

This function will register the IPv6 gateway address to the network device.

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

Definition at line 729 of file HttpBootDhcp6.c.

◆ HttpBootSetIp6Policy()

EFI_STATUS HttpBootSetIp6Policy ( IN HTTP_BOOT_PRIVATE_DATA Private)

Set the IP6 policy to Automatic.

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

Definition at line 645 of file HttpBootDhcp6.c.