31#ifndef PROTOCORE_EDGE_MESH_H
32#define PROTOCORE_EDGE_MESH_H
36#if PROTOCORE_ENABLE_EDGE_MESH
44#define PROTOCORE_EDGE_MESH_MAGIC0 ('E')
46#define PROTOCORE_EDGE_MESH_MAGIC1 ('M')
48#define PROTOCORE_EDGE_MESH_VERSION 1
50#define PROTOCORE_EDGE_MESH_OP_GET 1
52#define PROTOCORE_EDGE_MESH_REQ_MAX (2 + 1 + 1 + 32 + 2 + PROTOCORE_EDGE_KEY_MAX + 2 + PROTOCORE_MESH_HDRS_MAX)
57 EDGE_MESH_PARSE_MALFORMED = -1,
58 EDGE_MESH_PARSE_INCOMPLETE = 0,
59 EDGE_MESH_PARSE_MISS = 1,
60 EDGE_MESH_PARSE_HIT = 2,
66 EDGE_MESH_STATUS_PENDING,
68 EDGE_MESH_STATUS_MISS,
69 EDGE_MESH_STATUS_FAILED,
98 const uint8_t *digest;
104} EdgeMeshBuildRequestArgs;
116} EdgeMeshParseRequestArgs;
121 const struct EdgeEntry *e;
125} EdgeMeshSerializeEntryArgs;
135} EdgeMeshDeserializeEntryArgs;
141 const uint8_t *entry;
145} EdgeMeshBuildResponseArgs;
154} EdgeMeshParseResponseArgs;
163 const uint8_t *request;
168} EdgeMeshFetchBeginArgs;
176} EdgeMeshFetchPumpArgs;
183} EdgeMeshFetchEndArgs;
229 EdgeMeshBuildRequestArgs build_request_args;
230 EdgeMeshParseRequestArgs parse_request_args;
231 EdgeMeshSerializeEntryArgs serialize_entry_args;
232 EdgeMeshDeserializeEntryArgs deserialize_entry_args;
233 EdgeMeshBuildResponseArgs build_response_args;
234 EdgeMeshParseResponseArgs parse_response_args;
235 EdgeMeshFetchBeginArgs fetch_begin_args;
236 EdgeMeshFetchPumpArgs fetch_pump_args;
237 EdgeMeshFetchEndArgs fetch_end_args;
241 EdgeMeshStatus status;
245extern EdgeMeshVars EdgeMeshV;
250 void (*
const build_request)(uint8_t *work);
251 void (*
const parse_request)(uint8_t *work);
252 void (*
const serialize_entry)(uint8_t *work);
253 void (*
const deserialize_entry)(uint8_t *work);
254 void (*
const build_response)(uint8_t *work);
255 void (*
const parse_response)(uint8_t *work);
256 void (*
const fetch_begin)(uint8_t *work);
257 void (*
const fetch_pump)(uint8_t *work);
258 void (*
const fetch_end)(uint8_t *work);
263void protocore_edge_mesh_build_request(uint8_t *work);
264void protocore_edge_mesh_parse_request(uint8_t *work);
265void protocore_edge_mesh_serialize_entry(uint8_t *work);
266void protocore_edge_mesh_deserialize_entry(uint8_t *work);
267void protocore_edge_mesh_build_response(uint8_t *work);
268void protocore_edge_mesh_parse_response(uint8_t *work);
269void protocore_edge_mesh_fetch_begin(uint8_t *work);
270void protocore_edge_mesh_fetch_pump(uint8_t *work);
271void protocore_edge_mesh_fetch_end(uint8_t *work);
277static const EdgeMeshNs EdgeMesh __attribute__((unused)) = {
278 .build_request = protocore_edge_mesh_build_request,
279 .parse_request = protocore_edge_mesh_parse_request,
280 .serialize_entry = protocore_edge_mesh_serialize_entry,
281 .deserialize_entry = protocore_edge_mesh_deserialize_entry,
282 .build_response = protocore_edge_mesh_build_response,
283 .parse_response = protocore_edge_mesh_parse_response,
284 .fetch_begin = protocore_edge_mesh_fetch_begin,
285 .fetch_pump = protocore_edge_mesh_fetch_pump,
286 .fetch_end = protocore_edge_mesh_fetch_end,
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
The origin transport, bound to protocore_client on the device and a mock in host tests.
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS