X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fjournal-def.h;h=ac89e61d932053edf6a98635037f69d04a90b38d;hb=a8bb2e6503fa2a4ed608aa958480d27a696f5146;hp=9cb80510822a2a89771de9fdc6ddf40406461536;hpb=4fd052aede13eb3041277c54ac2f5dee6e6c29cf;p=elogind.git diff --git a/src/journal/journal-def.h b/src/journal/journal-def.h index 9cb805108..ac89e61d9 100644 --- a/src/journal/journal-def.h +++ b/src/journal/journal-def.h @@ -9,16 +9,16 @@ Copyright 2011 Lennart Poettering systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. systemd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . ***/ @@ -29,13 +29,17 @@ #include "macro.h" typedef struct Header Header; + typedef struct ObjectHeader ObjectHeader; typedef union Object Object; + typedef struct DataObject DataObject; typedef struct FieldObject FieldObject; typedef struct EntryObject EntryObject; typedef struct HashTableObject HashTableObject; typedef struct EntryArrayObject EntryArrayObject; +typedef struct SignatureObject SignatureObject; + typedef struct EntryItem EntryItem; typedef struct HashItem HashItem; @@ -48,6 +52,7 @@ enum { OBJECT_DATA_HASH_TABLE, OBJECT_FIELD_HASH_TABLE, OBJECT_ENTRY_ARRAY, + OBJECT_SIGNATURE, _OBJECT_TYPE_MAX }; @@ -115,6 +120,14 @@ _packed_ struct EntryArrayObject { le64_t items[]; }; +#define SIGNATURE_LENGTH 160 + +_packed_ struct SignatureObject { + ObjectHeader object; + le64_t from; + uint8_t signature[SIGNATURE_LENGTH]; +}; + union Object { ObjectHeader object; DataObject data; @@ -122,6 +135,7 @@ union Object { EntryObject entry; HashTableObject hash_table; EntryArrayObject entry_array; + SignatureObject signature; }; enum { @@ -135,6 +149,10 @@ enum { HEADER_INCOMPATIBLE_COMPRESSED = 1 }; +enum { + HEADER_COMPATIBLE_SIGNED = 1 +}; + _packed_ struct Header { uint8_t signature[8]; /* "LPKSHHRH" */ uint32_t compatible_flags; @@ -142,10 +160,10 @@ _packed_ struct Header { uint8_t state; uint8_t reserved[7]; sd_id128_t file_id; - sd_id128_t machine_id; - sd_id128_t boot_id; + sd_id128_t machine_id; /* last writer */ + sd_id128_t boot_id; /* last writer */ sd_id128_t seqnum_id; - le64_t arena_offset; + le64_t header_size; le64_t arena_size; le64_t data_hash_table_offset; /* for looking up data objects */ le64_t data_hash_table_size; @@ -154,12 +172,15 @@ _packed_ struct Header { le64_t tail_object_offset; le64_t n_objects; le64_t n_entries; - le64_t seqnum; - le64_t first_seqnum; + le64_t tail_seqnum; + le64_t head_seqnum; le64_t entry_array_offset; le64_t head_entry_realtime; le64_t tail_entry_realtime; le64_t tail_entry_monotonic; + /* Added in 187 */ + le64_t n_data; + le64_t n_fields; }; #endif