1 /* SPDX-License-Identifier: LGPL-2.1+ */
7 #include "sparse-endian.h"
10 * If you change this file you probably should also change its documentation:
12 * http://www.freedesktop.org/wiki/Software/systemd/journal-files
15 typedef struct Header Header
;
17 typedef struct ObjectHeader ObjectHeader
;
18 typedef union Object Object
;
20 typedef struct DataObject DataObject
;
21 typedef struct FieldObject FieldObject
;
22 typedef struct EntryObject EntryObject
;
23 typedef struct HashTableObject HashTableObject
;
24 typedef struct EntryArrayObject EntryArrayObject
;
25 typedef struct TagObject TagObject
;
27 typedef struct EntryItem EntryItem
;
28 typedef struct HashItem HashItem
;
30 typedef struct FSSHeader FSSHeader
;
33 typedef enum ObjectType
{
34 OBJECT_UNUSED
, /* also serves as "any type" or "additional context" */
38 OBJECT_DATA_HASH_TABLE
,
39 OBJECT_FIELD_HASH_TABLE
,
47 OBJECT_COMPRESSED_XZ
= 1 << 0,
48 OBJECT_COMPRESSED_LZ4
= 1 << 1,
49 _OBJECT_COMPRESSED_MAX
52 #define OBJECT_COMPRESSION_MASK (OBJECT_COMPRESSED_XZ | OBJECT_COMPRESSED_LZ4)
65 le64_t next_hash_offset
;
66 le64_t next_field_offset
;
67 le64_t entry_offset
; /* the first array entry we store inline */
68 le64_t entry_array_offset
;
76 le64_t next_hash_offset
;
77 le64_t head_data_offset
;
97 le64_t head_hash_offset
;
98 le64_t tail_hash_offset
;
101 struct HashTableObject
{
106 struct EntryArrayObject
{
108 le64_t next_entry_array_offset
;
112 #define TAG_LENGTH (256/8)
118 uint8_t tag
[TAG_LENGTH
]; /* SHA-256 HMAC */
126 HashTableObject hash_table
;
127 EntryArrayObject entry_array
;
140 HEADER_INCOMPATIBLE_COMPRESSED_XZ
= 1 << 0,
141 HEADER_INCOMPATIBLE_COMPRESSED_LZ4
= 1 << 1,
144 #define HEADER_INCOMPATIBLE_ANY (HEADER_INCOMPATIBLE_COMPRESSED_XZ|HEADER_INCOMPATIBLE_COMPRESSED_LZ4)
146 #if HAVE_XZ && HAVE_LZ4
147 # define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_ANY
149 # define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_COMPRESSED_XZ
151 # define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_COMPRESSED_LZ4
153 # define HEADER_INCOMPATIBLE_SUPPORTED 0
157 HEADER_COMPATIBLE_SEALED
= 1
160 #define HEADER_COMPATIBLE_ANY HEADER_COMPATIBLE_SEALED
162 # define HEADER_COMPATIBLE_SUPPORTED HEADER_COMPATIBLE_SEALED
164 # define HEADER_COMPATIBLE_SUPPORTED 0
167 #define HEADER_SIGNATURE ((char[]) { 'L', 'P', 'K', 'S', 'H', 'H', 'R', 'H' })
170 uint8_t signature
[8]; /* "LPKSHHRH" */
171 le32_t compatible_flags
;
172 le32_t incompatible_flags
;
176 sd_id128_t machine_id
;
177 sd_id128_t boot_id
; /* last writer */
178 sd_id128_t seqnum_id
;
181 le64_t data_hash_table_offset
;
182 le64_t data_hash_table_size
;
183 le64_t field_hash_table_offset
;
184 le64_t field_hash_table_size
;
185 le64_t tail_object_offset
;
188 le64_t tail_entry_seqnum
;
189 le64_t head_entry_seqnum
;
190 le64_t entry_array_offset
;
191 le64_t head_entry_realtime
;
192 le64_t tail_entry_realtime
;
193 le64_t tail_entry_monotonic
;
199 le64_t n_entry_arrays
;
204 #define FSS_HEADER_SIGNATURE ((char[]) { 'K', 'S', 'H', 'H', 'R', 'H', 'L', 'P' })
207 uint8_t signature
[8]; /* "KSHHRHLP" */
208 le32_t compatible_flags
;
209 le32_t incompatible_flags
;
210 sd_id128_t machine_id
;
211 sd_id128_t boot_id
; /* last writer */
214 le64_t interval_usec
;
217 le64_t fsprg_state_size
;