journald.h revision e156d769c3ee756cdb20f8522ace9ea459a82655
97a9a944b5887e91042b019776c41d5dd74557aferikabele/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele#ifndef foojournaldhfoo
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive#define foojournaldhfoo
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive/***
b686b6a420bde7f78c416b90be11db94cb789979nd This file is part of systemd.
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd Copyright 2011 Lennart Poettering
b686b6a420bde7f78c416b90be11db94cb789979nd
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen systemd is free software; you can redistribute it and/or modify it
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen under the terms of the GNU Lesser General Public License as published by
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen the Free Software Foundation; either version 2.1 of the License, or
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen (at your option) any later version.
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd systemd is distributed in the hope that it will be useful, but
b686b6a420bde7f78c416b90be11db94cb789979nd WITHOUT ANY WARRANTY; without even the implied warranty of
b686b6a420bde7f78c416b90be11db94cb789979nd MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3f08db06526d6901aa08c110b5bc7dde6bc39905nd Lesser General Public License for more details.
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd You should have received a copy of the GNU Lesser General Public License
b686b6a420bde7f78c416b90be11db94cb789979nd along with systemd; If not, see <http://www.gnu.org/licenses/>.
3f08db06526d6901aa08c110b5bc7dde6bc39905nd***/
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd#include <inttypes.h>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd#include <sys/types.h>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd#include <stdbool.h>
0066eddda7203f6345b56f77d146a759298dc635gryzor
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd#include "journal-file.h"
f3ec420152ca921e4c1ce77782f51b53f659018dnd#include "hashmap.h"
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung#include "util.h"
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd#include "audit.h"
b686b6a420bde7f78c416b90be11db94cb789979nd#include "journal-rate-limit.h"
b686b6a420bde7f78c416b90be11db94cb789979nd#include "list.h"
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979ndtypedef enum Storage {
b686b6a420bde7f78c416b90be11db94cb789979nd STORAGE_AUTO,
b686b6a420bde7f78c416b90be11db94cb789979nd STORAGE_VOLATILE,
b686b6a420bde7f78c416b90be11db94cb789979nd STORAGE_PERMANENT,
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen STORAGE_NONE,
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen _STORAGE_MAX,
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen _STORAGE_INVALID = -1
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf} Storage;
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowentypedef struct StdoutStream StdoutStream;
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979ndtypedef struct Server {
b686b6a420bde7f78c416b90be11db94cb789979nd int epoll_fd;
b686b6a420bde7f78c416b90be11db94cb789979nd int signal_fd;
117c1f888a14e73cdd821dc6c23eb0411144a41cnd int syslog_fd;
117c1f888a14e73cdd821dc6c23eb0411144a41cnd int native_fd;
b686b6a420bde7f78c416b90be11db94cb789979nd int stdout_fd;
b686b6a420bde7f78c416b90be11db94cb789979nd int proc_kmsg_fd;
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd JournalFile *runtime_journal;
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen JournalFile *system_journal;
b686b6a420bde7f78c416b90be11db94cb789979nd Hashmap *user_journals;
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd uint64_t seqnum;
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd char *buffer;
b686b6a420bde7f78c416b90be11db94cb789979nd size_t buffer_size;
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd JournalRateLimit *rate_limit;
b686b6a420bde7f78c416b90be11db94cb789979nd usec_t rate_limit_interval;
b686b6a420bde7f78c416b90be11db94cb789979nd unsigned rate_limit_burst;
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd JournalMetrics runtime_metrics;
b686b6a420bde7f78c416b90be11db94cb789979nd JournalMetrics system_metrics;
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen bool compress;
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf bool forward_to_kmsg;
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen bool forward_to_syslog;
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd bool forward_to_console;
e487d6c09669296f94a5190cc34586a98e624a00nd
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd bool import_proc_kmsg;
17ade6df5ec233536985eb1c130a906c725dd614humbedooh char proc_kmsg_buffer[LINE_MAX+1];
e487d6c09669296f94a5190cc34586a98e624a00nd size_t proc_kmsg_length;
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd uint64_t cached_available_space;
b686b6a420bde7f78c416b90be11db94cb789979nd usec_t cached_available_space_timestamp;
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd uint64_t var_available_timestamp;
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd gid_t file_gid;
b686b6a420bde7f78c416b90be11db94cb789979nd bool file_gid_valid;
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd LIST_HEAD(StdoutStream, stdout_streams);
b686b6a420bde7f78c416b90be11db94cb789979nd unsigned n_stdout_streams;
b686b6a420bde7f78c416b90be11db94cb789979nd
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf char *tty_path;
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd int max_level_store;
e487d6c09669296f94a5190cc34586a98e624a00nd int max_level_syslog;
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd int max_level_kmsg;
17ade6df5ec233536985eb1c130a906c725dd614humbedooh int max_level_console;
e487d6c09669296f94a5190cc34586a98e624a00nd
b686b6a420bde7f78c416b90be11db94cb789979nd Storage storage;
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener} Server;
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener/* gperf lookup function */
c6e6ef7c81b1ac917bb7a994557908225bac491ecovenerconst struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigned length);
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf
c6e6ef7c81b1ac917bb7a994557908225bac491ecovenerint config_parse_storage(const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener
c6e6ef7c81b1ac917bb7a994557908225bac491ecovenerconst char *storage_to_string(Storage s);
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsfStorage storage_from_string(const char *s);
c6e6ef7c81b1ac917bb7a994557908225bac491ecovener
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen#endif
fd09dcc9b954fde7abde7955af4ba9a094d34d50rbowen