chiark / gitweb /
journald: add kmsg source
[elogind.git] / src / journal / journald.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #ifndef foojournaldhfoo
4 #define foojournaldhfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2011 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2 of the License, or
14   (at your option) any later version.
15
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   General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include <inttypes.h>
26 #include <sys/types.h>
27 #include <stdbool.h>
28
29 #include "journal-file.h"
30 #include "hashmap.h"
31 #include "util.h"
32 #include "journal-rate-limit.h"
33 #include "list.h"
34
35 typedef struct StdoutStream StdoutStream;
36
37 typedef struct Server {
38         int epoll_fd;
39         int signal_fd;
40         int syslog_fd;
41         int native_fd;
42         int stdout_fd;
43         int proc_kmsg_fd;
44
45         JournalFile *runtime_journal;
46         JournalFile *system_journal;
47         Hashmap *user_journals;
48
49         uint64_t seqnum;
50
51         char *buffer;
52         size_t buffer_size;
53
54         JournalRateLimit *rate_limit;
55         usec_t rate_limit_interval;
56         unsigned rate_limit_burst;
57
58         JournalMetrics runtime_metrics;
59         JournalMetrics system_metrics;
60
61         bool compress;
62
63         bool forward_to_kmsg;
64         bool forward_to_syslog;
65         bool forward_to_console;
66
67         bool import_proc_kmsg;
68         char proc_kmsg_buffer[LINE_MAX+1];
69         size_t proc_kmsg_length;
70
71         uint64_t cached_available_space;
72         usec_t cached_available_space_timestamp;
73
74         uint64_t var_available_timestamp;
75
76         LIST_HEAD(StdoutStream, stdout_streams);
77         unsigned n_stdout_streams;
78 } Server;
79
80 /* gperf lookup function */
81 const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigned length);
82
83 #endif