le_secStore_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 le_secStore_common.h
12  *
13  * Type definitions for le_secStore.
14  *
15  */
16 #ifndef LE_SECSTORE_COMMON_H_INCLUDE_GUARD
17 #define LE_SECSTORE_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 #define IFGEN_LE_SECSTORE_PROTOCOL_ID "98c2a4dd482018a94c642390891be24f"
23 #define IFGEN_LE_SECSTORE_MSG_SIZE 8463
24 /** @addtogroup le_secStore
25  * @{ **/
26 
27 
28 //--------------------------------------------------------------------------------------------------
29 /**
30  * Maximum number of characters and byte storage size permitted for a secure storage item name.
31  */
32 //--------------------------------------------------------------------------------------------------
33 #define LE_SECSTORE_MAX_NAME_SIZE 255
34 
35 //--------------------------------------------------------------------------------------------------
36 /**
37  */
38 //--------------------------------------------------------------------------------------------------
39 #define LE_SECSTORE_MAX_NAME_BYTES 256
40 
41 //--------------------------------------------------------------------------------------------------
42 /**
43  * Maximum number of bytes for each item in secure storage.
44  */
45 //--------------------------------------------------------------------------------------------------
46 #define LE_SECSTORE_MAX_ITEM_SIZE 8192
47 
48 
49 //--------------------------------------------------------------------------------------------------
50 /**
51  * Get if this client bound locally.
52  */
53 //--------------------------------------------------------------------------------------------------
54 LE_SHARED bool ifgen_le_secStore_HasLocalBinding
55 (
56  void
57 );
58 
59 
60 //--------------------------------------------------------------------------------------------------
61 /**
62  * Init data that is common across all threads
63  */
64 //--------------------------------------------------------------------------------------------------
65 LE_SHARED void ifgen_le_secStore_InitCommonData
66 (
67  void
68 );
69 
70 
71 //--------------------------------------------------------------------------------------------------
72 /**
73  * Perform common initialization and open a session
74  */
75 //--------------------------------------------------------------------------------------------------
76 LE_SHARED le_result_t ifgen_le_secStore_OpenSession
77 (
78  le_msg_SessionRef_t _ifgen_sessionRef,
79  bool isBlocking
80 );
81 
82 //--------------------------------------------------------------------------------------------------
83 /**
84  * Writes an item to secure storage. If the item already exists, it'll be overwritten with
85  * the new value. If the item doesn't already exist, it'll be created.
86  * If the item name is not valid or the buffer is NULL, this function will kill the calling client.
87  *
88  * @return
89  * LE_OK if successful.
90  * LE_NO_MEMORY if there isn't enough memory to store the item.
91  * LE_UNAVAILABLE if the secure storage is currently unavailable.
92  * LE_FAULT if there was some other error.
93  */
94 //--------------------------------------------------------------------------------------------------
95 LE_SHARED le_result_t ifgen_le_secStore_Write
96 (
97  le_msg_SessionRef_t _ifgen_sessionRef,
98  const char* LE_NONNULL name,
99  ///< [IN] Name of the secure storage item.
100  const uint8_t* bufPtr,
101  ///< [IN] Buffer containing the data to store.
102  size_t bufSize
103  ///< [IN]
104 );
105 
106 //--------------------------------------------------------------------------------------------------
107 /**
108  * Reads an item from secure storage.
109  * If the item name is not valid or the buffer is NULL, this function will kill the calling client.
110  *
111  * @return
112  * LE_OK if successful.
113  * LE_OVERFLOW if the buffer is too small to hold the entire item. No data will be written to
114  * the buffer in this case.
115  * LE_NOT_FOUND if the item doesn't exist.
116  * LE_UNAVAILABLE if the secure storage is currently unavailable.
117  * LE_FAULT if there was some other error.
118  */
119 //--------------------------------------------------------------------------------------------------
120 LE_SHARED le_result_t ifgen_le_secStore_Read
121 (
122  le_msg_SessionRef_t _ifgen_sessionRef,
123  const char* LE_NONNULL name,
124  ///< [IN] Name of the secure storage item.
125  uint8_t* bufPtr,
126  ///< [OUT] Buffer to store the data in.
127  size_t* bufSizePtr
128  ///< [INOUT]
129 );
130 
131 //--------------------------------------------------------------------------------------------------
132 /**
133  * Deletes an item from secure storage.
134  * If the item name is not valid, this function will kill the calling client.
135  *
136  * @return
137  * LE_OK if successful.
138  * LE_NOT_FOUND if the item doesn't exist.
139  * LE_UNAVAILABLE if the secure storage is currently unavailable.
140  * LE_FAULT if there was some other error.
141  */
142 //--------------------------------------------------------------------------------------------------
143 LE_SHARED le_result_t ifgen_le_secStore_Delete
144 (
145  le_msg_SessionRef_t _ifgen_sessionRef,
146  const char* LE_NONNULL name
147  ///< [IN] Name of the secure storage item.
148 );
149 /** @} **/
150 #endif // LE_SECSTORE_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:300
le_result_t
Definition: le_basics.h:46
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860