Virgil IoT KIT
prvs-structs.h
Go to the documentation of this file.
1 // Copyright (C) 2015-2020 Virgil Security, Inc.
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // (1) Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // (2) Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in
14 // the documentation and/or other materials provided with the
15 // distribution.
16 //
17 // (3) Neither the name of the copyright holder nor the names of its
18 // contributors may be used to endorse or promote products derived from
19 // this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR
22 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30 // IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 // POSSIBILITY OF SUCH DAMAGE.
32 //
33 // Lead Maintainer: Virgil Security Inc. <support@virgilsecurity.com>
34 
41 #ifndef VS_SECURITY_SDK_SNAP_SERVICES_PRVS_STRUCTS_H
42 #define VS_SECURITY_SDK_SNAP_SERVICES_PRVS_STRUCTS_H
43 
46 
47 #ifdef __cplusplus
48 namespace VirgilIoTKit {
49 extern "C" {
50 #endif
51 
52 #define DNID_LIST_SZ_MAX (50)
53 #define PUBKEY_MAX_SZ (100)
54 
61 typedef struct {
63  uint32_t device_roles;
65 
72 typedef struct {
74  uint16_t count;
76 
83 typedef struct __attribute__((__packed__)) {
84  uint8_t manufacturer[VS_DEVICE_MANUFACTURE_ID_SIZE];
85  uint8_t device_type[VS_DEVICE_TYPE_SIZE];
86  uint8_t serial[VS_DEVICE_SERIAL_SIZE];
88  uint16_t data_sz;
89  uint8_t data[];
91 
96 typedef struct __attribute__((__packed__)) {
97  uint8_t hash_type;
98  uint8_t data[];
100 
101 #ifdef __cplusplus
102 } // extern "C"
103 } // namespace VirgilIoTKit
104 #endif
105 
106 #endif // VS_SECURITY_SDK_SNAP_SERVICES_PRVS_STRUCTS_H
vs_mac_addr_t
MAC address.
Definition: snap-structs.h:252
provision-structs.h
Provision interface structures.
vs_snap_prvs_devi_t
Device information.
Definition: prvs-structs.h:83
VS_DEVICE_MANUFACTURE_ID_SIZE
#define VS_DEVICE_MANUFACTURE_ID_SIZE
Manufacture ID size.
Definition: provision-structs.h:111
VS_DEVICE_TYPE_SIZE
#define VS_DEVICE_TYPE_SIZE
Device type size.
Definition: provision-structs.h:114
vs_snap_prvs_dnid_list_t
Devices enumeration.
Definition: prvs-structs.h:72
vs_snap_prvs_sgnp_req_t::hash_type
uint8_t hash_type
vs_secmodule_hash_type_e
Definition: prvs-structs.h:97
vs_snap_prvs_dnid_element_t::device_roles
uint32_t device_roles
Mask based on vs_snap_device_role_e.
Definition: prvs-structs.h:63
snap-structs.h
SNAP structures.
vs_snap_prvs_dnid_element_t::mac_addr
vs_mac_addr_t mac_addr
Device MAC address.
Definition: prvs-structs.h:62
vs_snap_prvs_devi_t::data_sz
uint16_t data_sz
data size
Definition: prvs-structs.h:88
vs_snap_prvs_devi_t::mac
vs_mac_addr_t mac
device MAC address
Definition: prvs-structs.h:87
VS_DEVICE_SERIAL_SIZE
#define VS_DEVICE_SERIAL_SIZE
Device serial ID size.
Definition: provision-structs.h:108
vs_snap_prvs_sgnp_req_t
Signed data.
Definition: prvs-structs.h:96
vs_snap_prvs_dnid_list_t::count
uint16_t count
elements amount
Definition: prvs-structs.h:74
vs_snap_prvs_dnid_element_t
Device description.
Definition: prvs-structs.h:61
DNID_LIST_SZ_MAX
#define DNID_LIST_SZ_MAX
Definition: prvs-structs.h:52