]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/journal/journald.h
use #pragma once instead of foo*foo #define guards
[thirdparty/systemd.git] / src / journal / journald.h
CommitLineData
e6960940
LP
1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
c2f1db8f 3#pragma once
e6960940
LP
4
5/***
6 This file is part of systemd.
7
8 Copyright 2011 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
e6960940
LP
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 18 Lesser General Public License for more details.
e6960940 19
5430f7f2 20 You should have received a copy of the GNU Lesser General Public License
e6960940
LP
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22***/
23
24#include <inttypes.h>
25#include <sys/types.h>
26#include <stdbool.h>
27
28#include "journal-file.h"
29#include "hashmap.h"
30#include "util.h"
d7832d2c 31#include "audit.h"
e6960940
LP
32#include "journal-rate-limit.h"
33#include "list.h"
34
e156d769
LP
35typedef enum Storage {
36 STORAGE_AUTO,
37 STORAGE_VOLATILE,
205c4d1d 38 STORAGE_PERSISTENT,
e156d769
LP
39 STORAGE_NONE,
40 _STORAGE_MAX,
41 _STORAGE_INVALID = -1
42} Storage;
43
e6960940
LP
44typedef struct StdoutStream StdoutStream;
45
46typedef struct Server {
47 int epoll_fd;
48 int signal_fd;
49 int syslog_fd;
50 int native_fd;
51 int stdout_fd;
6c1e6b98 52 int proc_kmsg_fd;
e6960940
LP
53
54 JournalFile *runtime_journal;
55 JournalFile *system_journal;
56 Hashmap *user_journals;
57
58 uint64_t seqnum;
59
60 char *buffer;
61 size_t buffer_size;
62
63 JournalRateLimit *rate_limit;
64 usec_t rate_limit_interval;
65 unsigned rate_limit_burst;
66
67 JournalMetrics runtime_metrics;
68 JournalMetrics system_metrics;
69
70 bool compress;
71
224f2ee2
LP
72 bool forward_to_kmsg;
73 bool forward_to_syslog;
74 bool forward_to_console;
75
6c1e6b98
LP
76 bool import_proc_kmsg;
77 char proc_kmsg_buffer[LINE_MAX+1];
78 size_t proc_kmsg_length;
79
e6960940
LP
80 uint64_t cached_available_space;
81 usec_t cached_available_space_timestamp;
82
83 uint64_t var_available_timestamp;
84
5e41cfec
LP
85 gid_t file_gid;
86 bool file_gid_valid;
87
e6960940
LP
88 LIST_HEAD(StdoutStream, stdout_streams);
89 unsigned n_stdout_streams;
0d9243f0
LP
90
91 char *tty_path;
213ba152
LP
92
93 int max_level_store;
94 int max_level_syslog;
95 int max_level_kmsg;
96 int max_level_console;
e156d769
LP
97
98 Storage storage;
e6960940
LP
99} Server;
100
101/* gperf lookup function */
102const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigned length);
103
e156d769
LP
104int config_parse_storage(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
105
106const char *storage_to_string(Storage s);
107Storage storage_from_string(const char *s);