Mistake on this page? Email us
pal_sst.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // Copyright 2016-2019 ARM Ltd.
3 //
4 // SPDX-License-Identifier: Apache-2.0
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 //
10 // http://www.apache.org/licenses/LICENSE-2.0
11 //
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 // See the License for the specific language governing permissions and
16 // limitations under the License.
17 // ----------------------------------------------------------------------------
18 
19 #ifdef MBED_CONF_MBED_CLOUD_CLIENT_EXTERNAL_SST_SUPPORT
20 
21 #ifndef _PAL_SST_H
22 #define _PAL_SST_H
23 
24 #ifndef _PAL_H
25  #error "Do not include this file directly. Use pal.h instead."
26 #endif
27 
28 #include <stdint.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
40 /*
41 * Pal SST item iterator
42 */
43 typedef uintptr_t palSSTIterator_t;
44 
45 /*
46 * Pal SST flags
47 */
48 
49 /*
50 * Write once flag.
51 * When the flag is used, the item can only be written once and cannot be removed.
52 */
53 #define PAL_SST_WRITE_ONCE_FLAG (1 << 0)
54 
55 /*
56 * Confidentiality (encryption) flag.
57 */
58 #define PAL_SST_CONFIDENTIALITY_FLAG (1 << 1)
59 
60 /*
61 * Replay protection flag.
62 * When this flag is used, the item cannot be physically removed (outside pal_SST APIs).
63 */
64 #define PAL_SST_REPLAY_PROTECTION_FLAG (1 << 3)
65 
66 /*
67 * PAL SST item info structure
68 */
69 typedef struct palSSTItemInfo {
70  size_t itemSize;
71  uint32_t SSTFlagsBitmap;
72 } palSSTItemInfo_t;
73 
92 palStatus_t pal_SSTSet(const char *itemName, const void *itemBuffer, size_t itemBufferSize, uint32_t SSTFlagsBitmap);
93 
111 palStatus_t pal_SSTGet(const char *itemName, void *itemBuffer, size_t itemBufferSize, size_t *actualItemSize);
112 
125 palStatus_t pal_SSTGetInfo(const char *itemName, palSSTItemInfo_t *palItemInfo);
126 
138 palStatus_t pal_SSTRemove(const char *itemName);
139 
147 palStatus_t pal_SSTIteratorOpen(palSSTIterator_t *palSSTIterator, const char *itemPrefix);
148 
160 palStatus_t pal_SSTIteratorNext(palSSTIterator_t palSSTIterator, char *itemNameBuffer, size_t itemNameBufferSize);
161 
169 palStatus_t pal_SSTIteratorClose(palSSTIterator_t palSSTIterator);
170 
175 palStatus_t pal_SSTReset(void);
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 // endif
182 
183 
184 #endif //_PAL_SST_H
185 
186 #endif //MBED_CONF_MBED_CLOUD_CLIENT_EXTERNAL_SST_SUPPORT
int32_t palStatus_t
Definition: pal_types.h:49