]> git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrFileUtil.h
NetworkPkg: Add WiFi Connection Manager to NetworkPkg
[mirror_edk2.git] / NetworkPkg / WifiConnectionManagerDxe / WifiConnectionMgrFileUtil.h
1 /** @file
2 The file operation functions for WiFi Connection Manager.
3
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __EFI_WIFI_MGR_FILE_UTIL__
17 #define __EFI_WIFI_MGR_FILE_UTIL__
18
19 #include "WifiConnectionMgrDxe.h"
20
21 /**
22 Read file content into BufferPtr, the size of the allocate buffer
23 is *FileSize plus AddtionAllocateSize.
24
25 @param[in] FileHandle The file to be read.
26 @param[in, out] BufferPtr Pointers to the pointer of allocated buffer.
27 @param[out] FileSize Size of input file
28 @param[in] AddtionAllocateSize Addtion size the buffer need to be allocated.
29 In case the buffer need to contain others besides the file content.
30
31 @retval EFI_SUCCESS The file was read into the buffer.
32 @retval EFI_INVALID_PARAMETER A parameter was invalid.
33 @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
34 @retval others Unexpected error.
35
36 **/
37 EFI_STATUS
38 ReadFileContent (
39 IN EFI_FILE_HANDLE FileHandle,
40 IN OUT VOID **BufferPtr,
41 OUT UINTN *FileSize,
42 IN UINTN AddtionAllocateSize
43 );
44
45 /**
46 Update the CA cert base on the input file path info.
47
48 @param[in] Private The pointer to the global private data structure.
49 @param[in] FilePath Point to the file path.
50
51 @retval TRUE Exit caller function.
52 @retval FALSE Not exit caller function.
53
54 **/
55 BOOLEAN
56 UpdateCAFromFile (
57 IN WIFI_MGR_PRIVATE_DATA *Private,
58 IN EFI_DEVICE_PATH_PROTOCOL *FilePath
59 );
60
61 /**
62 Update the Private Key base on the input file path info.
63
64 @param[in] Private The pointer to the global private data structure.
65 @param[in] FilePath Point to the file path.
66
67 @retval TRUE Exit caller function.
68 @retval FALSE Not exit caller function.
69
70 **/
71 BOOLEAN
72 UpdatePrivateKeyFromFile (
73 IN WIFI_MGR_PRIVATE_DATA *Private,
74 IN EFI_DEVICE_PATH_PROTOCOL *FilePath
75 );
76
77 #endif