Dhcp6Utility.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
Dhcp6 support functions declaration.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __EFI_DHCP6_UTILITY_H__
#define __EFI_DHCP6_UTILITY_H__
#define DHCP6_10_BIT_MASK 0x3ff
/**
Generate client Duid in the format of Duid-llt.
@param[in] Mode The pointer to the mode of SNP.
@retval NULL if failed to generate client Id.
@retval Others The pointer to the new client id.
**/
);
/**
Copy the Dhcp6 configure data.
@param[in] DstCfg The pointer to the destination configure data.
@param[in] SorCfg The pointer to the source configure data.
@retval EFI_SUCCESS Copy the content from SorCfg from DstCfg successfully.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
**/
);
/**
Clean up the configure data.
@param[in, out] CfgData The pointer to the configure data.
**/
);
/**
Clean up the mode data.
@param[in, out] ModeData The pointer to the mode data.
**/
);
/**
Calculate the expire time by the algorithm defined in rfc.
@param[in] Base The base value of the time.
@param[in] IsFirstRt If TRUE, it is the first time to calculate expire time.
@param[in] NeedSigned If TRUE, the the signed factor is needed.
@return Expire The calculated result for the new expire time.
**/
);
/**
Calculate the lease time by the algorithm defined in rfc.
@param[in] IaCb The pointer to the Ia control block.
**/
);
/**
Check whether the addresses are all included by the configured Ia.
@param[in] Ia The pointer to the Ia.
@param[in] AddressCount The number of addresses.
@param[in] Addresses The pointer to the addresses buffer.
@retval EFI_SUCCESS The addresses are all included by the configured IA.
@retval EFI_NOT_FOUND The addresses are not included by the configured IA.
**/
);
/**
Deprive the addresses from current Ia, and generate another eliminated Ia.
@param[in] Ia The pointer to the Ia.
@param[in] AddressCount The number of addresses.
@param[in] Addresses The pointer to the addresses buffer.
@retval NULL If failed to generate the deprived Ia.
@retval others The pointer to the deprived Ia.
**/
);
/**
The dummy ext buffer free callback routine.
@param[in] Arg The pointer to the parameter.
**/
);
/**
The callback routine once message transmitted.
@param[in] Wrap The pointer to the received net buffer.
@param[in] EndPoint The pointer to the udp end point.
@param[in] IoStatus The return status from udp io.
@param[in] Context The opaque parameter to the function.
**/
);
/**
Append the appointed option to the buf, and move the buf to the end.
@param[in, out] Buf The pointer to buffer.
@param[in] OptType The option type.
@param[in] OptLen The lenght of option content.s
@param[in] Data The pointer to the option content.
@return Buf The position to append the next option.
**/
UINT8 *
);
/**
Append the Ia option to Buf, and move Buf to the end.
@param[in, out] Buf The pointer to the position to append.
@param[in] Ia The pointer to the Ia.
@param[in] T1 The time of T1.
@param[in] T2 The time of T2.
@return Buf The position to append the next Ia option.
**/
UINT8 *
);
/**
Append the appointed Elapsed time option to Buf, and move Buf to the end.
@param[in, out] Buf The pointer to the position to append.
@param[in] Instance The pointer to the Dhcp6 instance.
@param[out] Elapsed The pointer to the elapsed time value in
the generated packet.
@return Buf The position to append the next Ia option.
**/
UINT8 *
);
/**
Set the elapsed time based on the given instance and the pointer to the
elapsed time option.
@param[in] Elapsed The pointer to the position to append.
@param[in] Instance The pointer to the Dhcp6 instance.
**/
);
/**
Seek the address of the first byte of the option header.
@param[in] Buf The pointer to buffer.
@param[in] SeekLen The length to seek.
@param[in] OptType The option type.
@retval NULL If failed to seek the option.
@retval others The position to the option.
**/
UINT8 *
);
/**
Seek the address of the first byte of the Ia option header.
@param[in] Buf The pointer to the buffer.
@param[in] SeekLen The length to seek.
@param[in] IaDesc The pointer to the Ia descriptor.
@retval NULL If failed to seek the Ia option.
@retval others The position to the Ia option.
**/
UINT8 *
);
/**
Parse the address option and update the address info.
@param[in] IaInnerOpt The pointer to the buffer.
@param[in] IaInnerLen The length to parse.
@param[out] AddrNum The number of addresses.
@param[in, out] AddrBuf The pointer to the address buffer.
**/
);
/**
Create a control blcok for the Ia according to the corresponding options.
@param[in] Instance The pointer to DHCP6 Instance.
@param[in] IaInnerOpt The pointer to the inner options in the Ia option.
@param[in] IaInnerLen The length of all the inner options in the Ia option.
@param[in] T1 T1 time in the Ia option.
@param[in] T2 T2 time in the Ia option.
@retval EFI_NOT_FOUND No valid IA option is found.
@retval EFI_SUCCESS Create an IA control block successfully.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
**/
);
/**
Cache the current IA configuration information.
@param[in] Instance The pointer to DHCP6 Instance.
@retval EFI_SUCCESS Cache the current IA successfully.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
**/
);
/**
Append CacheIa to the currrent IA. Meanwhile, clear CacheIa.ValidLifetime to 0.
@param[in] Instance The pointer to DHCP6 instance.
**/
);
#endif