wickr-crypto-c

packet_meta.h
1 /*
2 * Copyright © 2012-2020 Wickr Inc. All rights reserved.
3 *
4 * This code is being released for EDUCATIONAL, ACADEMIC, AND CODE REVIEW PURPOSES
5 * ONLY. COMMERCIAL USE OF THE CODE IS EXPRESSLY PROHIBITED. For additional details,
6 * please see LICENSE
7 *
8 * THE CODE IS MADE AVAILABLE "AS-IS" AND WITHOUT ANY EXPRESS OR
9 * IMPLIED GUARANTEES AS TO FITNESS, MERCHANTABILITY, NON-
10 * INFRINGEMENT OR OTHERWISE. IT IS NOT BEING PROVIDED IN TRADE BUT ON
11 * A VOLUNTARY BASIS ON BEHALF OF THE AUTHOR’S PART FOR THE BENEFIT
12 * OF THE LICENSEE AND IS NOT MADE AVAILABLE FOR CONSUMER USE OR ANY
13 * OTHER USE OUTSIDE THE TERMS OF THIS LICENSE. ANYONE ACCESSING THE
14 * CODE SHOULD HAVE THE REQUISITE EXPERTISE TO SECURE THEIR SYSTEM
15 * AND DEVICES AND TO ACCESS AND USE THE CODE FOR REVIEW PURPOSES
16 * ONLY. LICENSEE BEARS THE RISK OF ACCESSING AND USING THE CODE. IN
17 * PARTICULAR, AUTHOR BEARS NO LIABILITY FOR ANY INTERFERENCE WITH OR
18 * ADVERSE EFFECT THAT MAY OCCUR AS A RESULT OF THE LICENSEE
19 * ACCESSING AND/OR USING THE CODE ON LICENSEE’S SYSTEM.
20 */
21
22 #ifndef packet_meta_h
23 #define packet_meta_h
24
25 #include "buffer.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
44 struct wickr_ephemeral_info {
45 uint64_t ttl;
46 uint64_t bor;
47 };
48
49 typedef struct wickr_ephemeral_info wickr_ephemeral_info_t;
50
62 struct wickr_packet_meta {
63 wickr_ephemeral_info_t ephemerality_settings;
64 wickr_buffer_t *channel_tag;
65 uint16_t content_type;
66 };
67
68 typedef struct wickr_packet_meta wickr_packet_meta_t;
69
81 wickr_packet_meta_t *wickr_packet_meta_create(wickr_ephemeral_info_t ephemerality_settings,
82 wickr_buffer_t *channel_tag,
83 uint16_t content_type);
84
94 wickr_packet_meta_t *wickr_packet_meta_copy(const wickr_packet_meta_t *source);
95
104 void wickr_packet_meta_destroy(wickr_packet_meta_t **meta);
105
106 #ifdef __cplusplus
107 }
108 #endif
109
110 #endif /* packet_meta_h */
wickr_packet_meta_create
wickr_packet_meta_t * wickr_packet_meta_create(wickr_ephemeral_info_t ephemerality_settings, wickr_buffer_t *channel_tag, uint16_t content_type)
wickr_packet_meta_copy
wickr_packet_meta_t * wickr_packet_meta_copy(const wickr_packet_meta_t *source)
wickr_packet_meta_destroy
void wickr_packet_meta_destroy(wickr_packet_meta_t **meta)
wickr_buffer
Represents an array of bytes and the length of the allocation associated with those bytes.
Definition: buffer.h:51
wickr_ephemeral_info
Message destruction control metadata.
Definition: packet_meta.h:44
wickr_ephemeral_info::bor
uint64_t bor
Definition: packet_meta.h:46
wickr_ephemeral_info::ttl
uint64_t ttl
Definition: packet_meta.h:45
wickr_packet_meta
control metadata found in the encrypted payload of a packet
Definition: packet_meta.h:62
wickr_packet_meta::ephemerality_settings
wickr_ephemeral_info_t ephemerality_settings
Definition: packet_meta.h:63
wickr_packet_meta::channel_tag
wickr_buffer_t * channel_tag
Definition: packet_meta.h:64
wickr_packet_meta::content_type
uint16_t content_type
Definition: packet_meta.h:65