secStoreAdmin_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file secStoreAdmin_common.h
12  *
13  * Type definitions for secStoreAdmin.
14  *
15  */
16 #ifndef SECSTOREADMIN_COMMON_H_INCLUDE_GUARD
17 #define SECSTOREADMIN_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_secStore_common.h"
24 
25 #define IFGEN_SECSTOREADMIN_PROTOCOL_ID "7ebaf4fccd725db56e692bd8d3b59d8e"
26 #define IFGEN_SECSTOREADMIN_MSG_SIZE 8719
27 /** @addtogroup secStoreAdmin
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Maximum number of characters and byte storage size permitted for a path.
34  */
35 //--------------------------------------------------------------------------------------------------
36 #define SECSTOREADMIN_MAX_PATH_SIZE 511
37 
38 //--------------------------------------------------------------------------------------------------
39 /**
40  */
41 //--------------------------------------------------------------------------------------------------
42 #define SECSTOREADMIN_MAX_PATH_BYTES 512
43 
44 //--------------------------------------------------------------------------------------------------
45 /**
46  * Iterator to list entries in secure storage.
47  */
48 //--------------------------------------------------------------------------------------------------
49 typedef struct secStoreAdmin_Iter* secStoreAdmin_IterRef_t;
50 
51 
52 
53 //--------------------------------------------------------------------------------------------------
54 /**
55  * Get if this client bound locally.
56  */
57 //--------------------------------------------------------------------------------------------------
58 LE_SHARED bool ifgen_secStoreAdmin_HasLocalBinding
59 (
60  void
61 );
62 
63 
64 //--------------------------------------------------------------------------------------------------
65 /**
66  * Init data that is common across all threads
67  */
68 //--------------------------------------------------------------------------------------------------
69 LE_SHARED void ifgen_secStoreAdmin_InitCommonData
70 (
71  void
72 );
73 
74 
75 //--------------------------------------------------------------------------------------------------
76 /**
77  * Perform common initialization and open a session
78  */
79 //--------------------------------------------------------------------------------------------------
80 LE_SHARED le_result_t ifgen_secStoreAdmin_OpenSession
81 (
82  le_msg_SessionRef_t _ifgen_sessionRef,
83  bool isBlocking
84 );
85 
86 //--------------------------------------------------------------------------------------------------
87 /**
88  * Create an iterator for listing entries in secure storage under the specified path.
89  *
90  * @return
91  * An iterator reference if successful.
92  * NULL if the secure storage is currently unavailable.
93  */
94 //--------------------------------------------------------------------------------------------------
95 LE_SHARED secStoreAdmin_IterRef_t ifgen_secStoreAdmin_CreateIter
96 (
97  le_msg_SessionRef_t _ifgen_sessionRef,
98  const char* LE_NONNULL path
99  ///< [IN] Path to iterate over.
100 );
101 
102 //--------------------------------------------------------------------------------------------------
103 /**
104  * Deletes an iterator.
105  */
106 //--------------------------------------------------------------------------------------------------
107 LE_SHARED void ifgen_secStoreAdmin_DeleteIter
108 (
109  le_msg_SessionRef_t _ifgen_sessionRef,
111  ///< [IN] Iterator reference.
112 );
113 
114 //--------------------------------------------------------------------------------------------------
115 /**
116  * Go to the next entry in the iterator. This should be called at least once before accessing the
117  * entry. After the first time this function is called successfully on an iterator the first entry
118  * will be available.
119  *
120  * @return
121  * LE_OK if successful.
122  * LE_NOT_FOUND if there are no more entries available.
123  */
124 //--------------------------------------------------------------------------------------------------
125 LE_SHARED le_result_t ifgen_secStoreAdmin_Next
126 (
127  le_msg_SessionRef_t _ifgen_sessionRef,
129  ///< [IN] Iterator reference.
130 );
131 
132 //--------------------------------------------------------------------------------------------------
133 /**
134  * Get the current entry's name.
135  *
136  * @return
137  * LE_OK if successful.
138  * LE_OVERFLOW if the buffer is too small to hold the entry name.
139  * LE_UNAVAILABLE if the secure storage is currently unavailable.
140  */
141 //--------------------------------------------------------------------------------------------------
142 LE_SHARED le_result_t ifgen_secStoreAdmin_GetEntry
143 (
144  le_msg_SessionRef_t _ifgen_sessionRef,
145  secStoreAdmin_IterRef_t iterRef,
146  ///< [IN] Iterator reference.
147  char* name,
148  ///< [OUT] Buffer to store the entry name.
149  size_t nameSize,
150  ///< [IN]
151  bool* isDirPtr
152  ///< [OUT] True if the entry is a directory, false otherwise.
153 );
154 
155 //--------------------------------------------------------------------------------------------------
156 /**
157  * Writes a buffer of data into the specified path in secure storage. If the item already exists,
158  * it'll be overwritten with the new value. If the item doesn't already exist, it'll be created.
159  *
160  * @note
161  * The specified path must be an absolute path.
162  *
163  * @return
164  * LE_OK if successful.
165  * LE_NO_MEMORY if there isn't enough memory to store the item.
166  * LE_UNAVAILABLE if the secure storage is currently unavailable.
167  * LE_FAULT if there was some other error.
168  */
169 //--------------------------------------------------------------------------------------------------
170 LE_SHARED le_result_t ifgen_secStoreAdmin_Write
171 (
172  le_msg_SessionRef_t _ifgen_sessionRef,
173  const char* LE_NONNULL path,
174  ///< [IN] Path of the secure storage item.
175  const uint8_t* bufPtr,
176  ///< [IN] Buffer containing the data to store.
177  size_t bufSize
178  ///< [IN]
179 );
180 
181 //--------------------------------------------------------------------------------------------------
182 /**
183  * Reads an item from secure storage.
184  *
185  * @note
186  * The specified path must be an absolute path.
187  *
188  * @return
189  * LE_OK if successful.
190  * LE_OVERFLOW if the buffer is too small to hold the entire item. No data will be written to
191  * the buffer in this case.
192  * LE_NOT_FOUND if the item doesn't exist.
193  * LE_UNAVAILABLE if the secure storage is currently unavailable.
194  * LE_FAULT if there was some other error.
195  */
196 //--------------------------------------------------------------------------------------------------
197 LE_SHARED le_result_t ifgen_secStoreAdmin_Read
198 (
199  le_msg_SessionRef_t _ifgen_sessionRef,
200  const char* LE_NONNULL path,
201  ///< [IN] Path of the secure storage item.
202  uint8_t* bufPtr,
203  ///< [OUT] Buffer to store the data in.
204  size_t* bufSizePtr
205  ///< [INOUT]
206 );
207 
208 //--------------------------------------------------------------------------------------------------
209 /**
210  * Copy the meta file to the specified path.
211  *
212  * @return
213  * LE_OK if successful.
214  * LE_NOT_FOUND if the meta file does not exist.
215  * LE_UNAVAILABLE if the sfs is currently unavailable.
216  * LE_FAULT if there was some other error.
217  */
218 //--------------------------------------------------------------------------------------------------
219 LE_SHARED le_result_t ifgen_secStoreAdmin_CopyMetaTo
220 (
221  le_msg_SessionRef_t _ifgen_sessionRef,
222  const char* LE_NONNULL path
223  ///< [IN] Destination path of meta file copy.
224 );
225 
226 //--------------------------------------------------------------------------------------------------
227 /**
228  * Recursively deletes all items under the specified path and the specified path from secure
229  * storage.
230  *
231  * @note
232  * The specified path must be an absolute path.
233  *
234  * @return
235  * LE_OK if successful.
236  * LE_NOT_FOUND if the path doesn't exist.
237  * LE_UNAVAILABLE if the secure storage is currently unavailable.
238  * LE_FAULT if there was some other error.
239  */
240 //--------------------------------------------------------------------------------------------------
241 LE_SHARED le_result_t ifgen_secStoreAdmin_Delete
242 (
243  le_msg_SessionRef_t _ifgen_sessionRef,
244  const char* LE_NONNULL path
245  ///< [IN] Path of the secure storage item.
246 );
247 
248 //--------------------------------------------------------------------------------------------------
249 /**
250  * Gets the size, in bytes, of all items under the specified path.
251  *
252  * @note
253  * The specified path must be an absolute path.
254  *
255  * @return
256  * LE_OK if successful.
257  * LE_NOT_FOUND if the path doesn't exist.
258  * LE_UNAVAILABLE if the secure storage is currently unavailable.
259  * LE_FAULT if there was some other error.
260  */
261 //--------------------------------------------------------------------------------------------------
262 LE_SHARED le_result_t ifgen_secStoreAdmin_GetSize
263 (
264  le_msg_SessionRef_t _ifgen_sessionRef,
265  const char* LE_NONNULL path,
266  ///< [IN] Path of the secure storage item.
267  uint64_t* sizePtr
268  ///< [OUT] Size in bytes of all items in the path.
269 );
270 
271 //--------------------------------------------------------------------------------------------------
272 /**
273  * Gets the total space and the available free space in secure storage.
274  *
275  * @return
276  * LE_OK if successful.
277  * LE_UNAVAILABLE if the secure storage is currently unavailable.
278  * LE_FAULT if there was some other error.
279  */
280 //--------------------------------------------------------------------------------------------------
281 LE_SHARED le_result_t ifgen_secStoreAdmin_GetTotalSpace
282 (
283  le_msg_SessionRef_t _ifgen_sessionRef,
284  uint64_t* totalSizePtr,
285  ///< [OUT] Total size, in bytes, of secure storage.
286  uint64_t* freeSizePtr
287  ///< [OUT] Free space, in bytes, in secure storage.
288 );
289 /** @} **/
290 #endif // SECSTOREADMIN_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:287
le_result_t
Definition: le_basics.h:46
struct secStoreAdmin_Iter * secStoreAdmin_IterRef_t
Definition: secStoreAdmin_common.h:49
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860