);\r
\r
/**\r
- Initialize a random seed using current time.\r
+ Initialize a random seed using current time and monotonic count.\r
\r
- Get current time first. Then initialize a random seed based on some basic\r
- mathematical operations on the hour, day, minute, second, nanosecond and year\r
- of the current time.\r
+ Get current time and monotonic count first. Then initialize a random seed \r
+ based on some basic mathematics operation on the hour, day, minute, second,\r
+ nanosecond and year of the current time and the monotonic count value.\r
\r
- @return The random seed, initialized with current time.\r
+ @return The random seed initialized with current time.\r
\r
**/\r
UINT32\r
IN OUT LIST_ENTRY *NewEntry\r
);\r
\r
+/**\r
+ Callback function which provided by user to remove one node in NetDestroyLinkList process.\r
+ \r
+ @param[in] Entry The entry to be removed.\r
+ @param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.\r
+\r
+ @retval EFI_SUCCESS The entry has been removed successfully.\r
+ @retval Others Fail to remove the entry.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *NET_DESTROY_LINK_LIST_CALLBACK) (\r
+ IN LIST_ENTRY *Entry,\r
+ IN VOID *Context OPTIONAL\r
+ );\r
+\r
+/**\r
+ Safe destroy nodes in a linked list, and return the length of the list after all possible operations finished.\r
+\r
+ Destroy network children list by list traversals is not safe due to graph dependencies between nodes.\r
+ This function performs a safe traversal to destroy these nodes by checking to see if the node being destroyed\r
+ has been removed from the list or not.\r
+ If it has been removed, then restart the traversal from the head.\r
+ If it hasn't been removed, then continue with the next node directly.\r
+ This function will end the iterate and return the CallBack's last return value if error happens,\r
+ or retrun EFI_SUCCESS if 2 complete passes are made with no changes in the number of children in the list. \r
+\r
+ @param[in] List The head of the list.\r
+ @param[in] CallBack Pointer to the callback function to destroy one node in the list.\r
+ @param[in] Context Pointer to the callback function's context: corresponds to the\r
+ parameter Context in NET_DESTROY_LINK_LIST_CALLBACK.\r
+ @param[out] ListLength The length of the link list if the function returns successfully.\r
+\r
+ @retval EFI_SUCCESS Two complete passes are made with no changes in the number of children.\r
+ @retval EFI_INVALID_PARAMETER The input parameter is invalid.\r
+ @retval Others Return the CallBack's last return value.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+NetDestroyLinkList (\r
+ IN LIST_ENTRY *List,\r
+ IN NET_DESTROY_LINK_LIST_CALLBACK CallBack,\r
+ IN VOID *Context, OPTIONAL\r
+ OUT UINTN *ListLength OPTIONAL\r
+ );\r
+\r
+/**\r
+ This function checks the input Handle to see if it's one of these handles in ChildHandleBuffer.\r
+\r
+ @param[in] Handle Handle to be checked.\r
+ @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer.\r
+ @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r
+ if NumberOfChildren is 0.\r
+\r
+ @retval TURE Found the input Handle in ChildHandleBuffer.\r
+ @retval FALSE Can't find the input Handle in ChildHandleBuffer.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+NetIsInHandleBuffer (\r
+ IN EFI_HANDLE Handle,\r
+ IN UINTN NumberOfChildren,\r
+ IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
+ );\r
\r
//\r
// Object container: EFI network stack spec defines various kinds of\r
OUT UINT8 *PrefixLength\r
);\r
\r
+/**\r
+\r
+ Convert one EFI_IPv6_ADDRESS to Null-terminated Unicode string.\r
+ The text representation of address is defined in RFC 4291.\r
+ \r
+ @param[in] Ip6Address The pointer to the IPv6 address.\r
+ @param[out] String The buffer to return the converted string.\r
+ @param[in] StringSize The length in bytes of the input String.\r
+ \r
+ @retval EFI_SUCCESS Convert to string successfully.\r
+ @retval EFI_INVALID_PARAMETER The input parameter is invalid.\r
+ @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result. BufferSize has been \r
+ updated with the size needed to complete the request.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+NetLibIp6ToStr (\r
+ IN EFI_IPv6_ADDRESS *Ip6Address,\r
+ OUT CHAR16 *String,\r
+ IN UINTN StringSize\r
+ );\r
+\r
//\r
// Various signatures\r
//\r