chiark / gitweb /
bus-proxyd: explicitly address messages to unique and well-known name
[elogind.git] / src / journal-remote / journal-remote.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 /***
4   This file is part of systemd.
5
6   Copyright 2014 Zbigniew JÄ™drzejewski-Szmek
7
8   systemd is free software; you can redistribute it and/or modify it
9   under the terms of the GNU Lesser General Public License as published by
10   the Free Software Foundation; either version 2.1 of the License, or
11   (at your option) any later version.
12
13   systemd is distributed in the hope that it will be useful, but
14   WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   Lesser General Public License for more details.
17
18   You should have received a copy of the GNU Lesser General Public License
19   along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #pragma once
23
24 #include <inttypes.h>
25
26 #include "sd-event.h"
27 #include "hashmap.h"
28 #include "microhttpd-util.h"
29
30 #include "journal-remote-parse.h"
31 #include "journal-remote-write.h"
32
33 typedef struct MHDDaemonWrapper MHDDaemonWrapper;
34
35 struct MHDDaemonWrapper {
36         uint64_t fd;
37         struct MHD_Daemon *daemon;
38
39         sd_event_source *event;
40 };
41
42 struct RemoteServer {
43         RemoteSource **sources;
44         size_t sources_size;
45         size_t active;
46
47         sd_event *events;
48         sd_event_source *sigterm_event, *sigint_event, *listen_event;
49
50         Hashmap *writers;
51         Writer *_single_writer;
52         uint64_t event_count;
53
54         bool check_trust;
55         Hashmap *daemons;
56 };