X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fsystemd.git;a=blobdiff_plain;f=src%2Fjournal%2Fjournal-def.h;h=1bd5de4c4308d8158c7c0087c258bef2a137c03d;hp=7e407a416cb1ca1674202c1162cddcc745d91d46;hb=349cc4a507c4d84fcadf61f42159ea6412717896;hpb=f274ece0f76b5709408821e317e87aef76123db6
diff --git a/src/journal/journal-def.h b/src/journal/journal-def.h
index 7e407a416cb..1bd5de4c430 100644
--- a/src/journal/journal-def.h
+++ b/src/journal/journal-def.h
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
#pragma once
/***
@@ -21,11 +19,10 @@
along with systemd; If not, see .
***/
-#include "sparse-endian.h"
-
-#include
+#include "sd-id128.h"
#include "macro.h"
+#include "sparse-endian.h"
/*
* If you change this file you probably should also change its documentation:
@@ -52,8 +49,8 @@ typedef struct HashItem HashItem;
typedef struct FSSHeader FSSHeader;
/* Object types */
-enum {
- OBJECT_UNUSED,
+typedef enum ObjectType {
+ OBJECT_UNUSED, /* also serves as "any type" or "additional context" */
OBJECT_DATA,
OBJECT_FIELD,
OBJECT_ENTRY,
@@ -62,13 +59,17 @@ enum {
OBJECT_ENTRY_ARRAY,
OBJECT_TAG,
_OBJECT_TYPE_MAX
-};
+} ObjectType;
/* Object flags */
enum {
- OBJECT_COMPRESSED = 1
+ OBJECT_COMPRESSED_XZ = 1 << 0,
+ OBJECT_COMPRESSED_LZ4 = 1 << 1,
+ _OBJECT_COMPRESSED_MAX
};
+#define OBJECT_COMPRESSION_MASK (OBJECT_COMPRESSED_XZ | OBJECT_COMPRESSED_LZ4)
+
struct ObjectHeader {
uint8_t type;
uint8_t flags;
@@ -155,13 +156,33 @@ enum {
/* Header flags */
enum {
- HEADER_INCOMPATIBLE_COMPRESSED = 1
+ HEADER_INCOMPATIBLE_COMPRESSED_XZ = 1 << 0,
+ HEADER_INCOMPATIBLE_COMPRESSED_LZ4 = 1 << 1,
};
+#define HEADER_INCOMPATIBLE_ANY (HEADER_INCOMPATIBLE_COMPRESSED_XZ|HEADER_INCOMPATIBLE_COMPRESSED_LZ4)
+
+#if HAVE_XZ && HAVE_LZ4
+# define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_ANY
+#elif HAVE_XZ
+# define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_COMPRESSED_XZ
+#elif HAVE_LZ4
+# define HEADER_INCOMPATIBLE_SUPPORTED HEADER_INCOMPATIBLE_COMPRESSED_LZ4
+#else
+# define HEADER_INCOMPATIBLE_SUPPORTED 0
+#endif
+
enum {
HEADER_COMPATIBLE_SEALED = 1
};
+#define HEADER_COMPATIBLE_ANY HEADER_COMPATIBLE_SEALED
+#if HAVE_GCRYPT
+# define HEADER_COMPATIBLE_SUPPORTED HEADER_COMPATIBLE_SEALED
+#else
+# define HEADER_COMPATIBLE_SUPPORTED 0
+#endif
+
#define HEADER_SIGNATURE ((char[]) { 'L', 'P', 'K', 'S', 'H', 'H', 'R', 'H' })
struct Header {
@@ -196,7 +217,7 @@ struct Header {
le64_t n_tags;
le64_t n_entry_arrays;
- /* Size: 224 */
+ /* Size: 240 */
} _packed_;
#define FSS_HEADER_SIGNATURE ((char[]) { 'K', 'S', 'H', 'H', 'R', 'H', 'L', 'P' })