1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
6 This file is part of systemd.
8 Copyright 2011 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
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
13 (at your option) any later version.
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
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 #include <sys/types.h>
28 #include "journal-file.h"
32 #include "journald-rate-limit.h"
35 typedef enum Storage {
44 typedef enum SplitMode {
52 typedef struct StdoutStream StdoutStream;
54 typedef struct Server {
62 JournalFile *runtime_journal;
63 JournalFile *system_journal;
64 Hashmap *user_journals;
71 JournalRateLimit *rate_limit;
72 usec_t rate_limit_interval;
73 unsigned rate_limit_burst;
75 JournalMetrics runtime_metrics;
76 JournalMetrics system_metrics;
82 bool forward_to_syslog;
83 bool forward_to_console;
85 unsigned n_forward_syslog_missed;
86 usec_t last_warn_forward_syslog_missed;
88 uint64_t cached_available_space;
89 usec_t cached_available_space_timestamp;
91 uint64_t var_available_timestamp;
96 LIST_HEAD(StdoutStream, stdout_streams);
97 unsigned n_stdout_streams;
102 int max_level_syslog;
104 int max_level_console;
107 SplitMode split_mode;
111 bool dev_kmsg_readable;
113 uint64_t *kernel_seqnum;
118 #define N_IOVEC_META_FIELDS 17
119 #define N_IOVEC_KERNEL_FIELDS 64
120 #define N_IOVEC_UDEV_FIELDS 32
122 void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, unsigned m, struct ucred *ucred, struct timeval *tv, const char *label, size_t label_len, const char *unit_id, int priority);
123 void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...);
125 /* gperf lookup function */
126 const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigned length);
128 int config_parse_storage(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
130 const char *storage_to_string(Storage s);
131 Storage storage_from_string(const char *s);
133 int config_parse_split_mode(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
135 const char *split_mode_to_string(SplitMode s);
136 SplitMode split_mode_from_string(const char *s);