1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
3 #ifndef foojournaldefhfoo
4 #define foojournaldefhfoo
7 This file is part of systemd.
9 Copyright 2011 Lennart Poettering
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
14 (at your option) any later version.
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 #include "sparse-endian.h"
27 #include <systemd/sd-id128.h>
31 typedef struct Header Header;
32 typedef struct ObjectHeader ObjectHeader;
33 typedef union Object Object;
34 typedef struct DataObject DataObject;
35 typedef struct FieldObject FieldObject;
36 typedef struct EntryObject EntryObject;
37 typedef struct HashTableObject HashTableObject;
38 typedef struct EntryArrayObject EntryArrayObject;
39 typedef struct EntryItem EntryItem;
40 typedef struct HashItem HashItem;
48 OBJECT_DATA_HASH_TABLE,
49 OBJECT_FIELD_HASH_TABLE,
59 _packed_ struct ObjectHeader {
67 _packed_ struct DataObject {
70 le64_t next_hash_offset;
71 le64_t next_field_offset;
72 le64_t entry_offset; /* the first array entry we store inline */
73 le64_t entry_array_offset;
78 _packed_ struct FieldObject {
81 le64_t next_hash_offset;
82 le64_t head_data_offset;
83 le64_t tail_data_offset;
87 _packed_ struct EntryItem {
92 _packed_ struct EntryObject {
102 _packed_ struct HashItem {
103 le64_t head_hash_offset;
104 le64_t tail_hash_offset;
107 _packed_ struct HashTableObject {
112 _packed_ struct EntryArrayObject {
114 le64_t next_entry_array_offset;
123 HashTableObject hash_table;
124 EntryArrayObject entry_array;
135 HEADER_INCOMPATIBLE_COMPRESSED = 1
138 _packed_ struct Header {
139 uint8_t signature[8]; /* "LPKSHHRH" */
140 uint32_t compatible_flags;
141 uint32_t incompatible_flags;
145 sd_id128_t machine_id;
147 sd_id128_t seqnum_id;
150 le64_t data_hash_table_offset; /* for looking up data objects */
151 le64_t data_hash_table_size;
152 le64_t field_hash_table_offset; /* for looking up field objects */
153 le64_t field_hash_table_size;
154 le64_t tail_object_offset;
159 le64_t entry_array_offset;
160 le64_t head_entry_realtime;
161 le64_t tail_entry_realtime;
162 le64_t tail_entry_monotonic;