Loading...
Searching...
No Matches
handlers.h
1/*
2 * Copyright (C) 2019 Koen Zandberg
3 * 2019 Kaspar Schleiser <kaspar@schleiser.de>
4 * 2019 Inria
5 * 2019 Freie Universität Berlin
6 *
7 * This file is subject to the terms and conditions of the GNU Lesser
8 * General Public License v2.1. See the file LICENSE in the top level
9 * directory for more details.
10 */
24#ifndef SUIT_HANDLERS_H
25#define SUIT_HANDLERS_H
26
27#include <stddef.h>
28#include <stdint.h>
29
30#include "suit.h"
31#include "uuid.h"
32#include "nanocbor/nanocbor.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
42#define SUIT_WRAPPER_AUTHENTICATION (2)
43#define SUIT_WRAPPER_MANIFEST (3)
50#define SUIT_CONTAINER_VERSION (1)
51#define SUIT_CONTAINER_SEQ_NO (2)
52#define SUIT_CONTAINER_COMMON (3)
53#define SUIT_CONTAINER_DEPS_RESOLUTION (7)
54#define SUIT_CONTAINER_PAYLOAD_FETCH (8)
55#define SUIT_CONTAINER_INSTALL (9)
56#define SUIT_CONTAINER_VALIDATE (10)
57#define SUIT_CONTAINER_LOAD (11)
58#define SUIT_CONTAINER_RUN (12)
59#define SUIT_CONTAINER_TEXT (13)
66#define SUIT_COMMON_DEPENDENCIES (1)
67#define SUIT_COMMON_COMPONENTS (2)
68#define SUIT_COMMON_DEP_COMPONENTS (3)
69#define SUIT_COMMON_COMMAND_SEQUENCE (4)
76#define SUIT_COND_VENDOR_ID (1)
77#define SUIT_COND_CLASS_ID (2)
78#define SUIT_COND_IMAGE_MATCH (3)
79#define SUIT_COND_USE_BEFORE (4)
80#define SUIT_COND_COMPONENT_OFFSET (5)
81#define SUIT_COND_DEVICE_ID (24)
82#define SUIT_COND_IMAGE_NOT_MATCH (25)
83#define SUIT_COND_MIN_BATTERY (26)
84#define SUIT_COND_UPDATE_AUTHZ (27)
85#define SUIT_COND_VERSION (28)
92#define SUIT_DIR_SET_COMPONENT_IDX (12)
93#define SUIT_DIR_SET_DEPENDENCY_IDX (13)
94#define SUIT_DIR_ABORT (14)
95#define SUIT_DIR_TRY_EACH (15)
96#define SUIT_DIR_PROCESS_DEPS (18)
97#define SUIT_DIR_SET_PARAM (19)
98#define SUIT_DIR_OVERRIDE_PARAM (20)
99#define SUIT_DIR_FETCH (21)
100#define SUIT_DIR_COPY (22)
101#define SUIT_DIR_RUN (23)
102#define SUIT_DIR_WAIT (29)
103#define SUIT_DIR_RUN_SEQUENCE (30)
104#define SUIT_DIR_RUN_WITH_ARGS (31)
105#define SUIT_DIR_SWAP (32)
118typedef int (*suit_manifest_handler_t)(suit_manifest_t *manifest, int key,
119 nanocbor_value_t *it);
120
124extern const suit_manifest_handler_t suit_global_handlers[];
125extern const size_t suit_global_handlers_len;
126
130extern const suit_manifest_handler_t suit_command_sequence_handlers[];
131
135extern const size_t suit_command_sequence_handlers_len;
136
140extern const suit_manifest_handler_t suit_envelope_handlers[];
141
145extern const size_t suit_envelope_handlers_len;
146
150extern const suit_manifest_handler_t suit_common_handlers[];
151
155extern const size_t suit_common_handlers_len;
156
171int suit_handle_manifest_structure(suit_manifest_t *manifest,
172 nanocbor_value_t *it,
173 const suit_manifest_handler_t *handlers,
174 size_t handlers_len);
175
191int suit_handle_manifest_structure_bstr(suit_manifest_t *manifest,
192 nanocbor_value_t *bseq,
193 const suit_manifest_handler_t *handlers,
194 size_t handlers_len);
195
210uint16_t suit_param_ref_to_cbor(const suit_manifest_t *manifest,
211 const suit_param_ref_t *ref,
212 nanocbor_value_t *val);
213
222void suit_param_cbor_to_ref(const suit_manifest_t *manifest,
223 suit_param_ref_t *ref,
224 const nanocbor_value_t *val);
225
226#ifdef __cplusplus
227}
228#endif
229
230#endif /* SUIT_HANDLERS_H */
SUIT manifest struct.
Definition suit.h:234
SUIT parameter reference.
Definition suit.h:186
RFC 4122 UUID functions