diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-16 10:21:58 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-31 13:04:18 +0200 |
commit | c064d8db402de0c0d609aabcfc722750856a1f01 (patch) | |
tree | 8b0b9345e8e706702e8c354d5f828e011eb2b85a /src/journal-remote/journal-remote.h | |
parent | 5d889c1365de385e6adbdea96a57f9df00c23013 (diff) | |
download | systemd-c064d8db402de0c0d609aabcfc722750856a1f01.tar.gz |
journal-remote: split out µhttpd support and main() into a separate file
This is in preparation to reusing the RemoteServer in other concepts.
I tried to keep changes to minimum:
- arg_* global variables are now passed as state in RemoteServer
- exported functions get the "journal_remote_" prefix
- some variables are renamed
In particular, there is an ugly global RemoveServer* variable. It was originally
added because µhttpd did not allow state to be passed to the callbacks. I'm not
sure if this has been remediated in µhttpd, but either way, this is not changed
here, the global variable is only renamed for clarity.
Diffstat (limited to 'src/journal-remote/journal-remote.h')
-rw-r--r-- | src/journal-remote/journal-remote.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/journal-remote/journal-remote.h b/src/journal-remote/journal-remote.h index f8df72ec55..72741c7fba 100644 --- a/src/journal-remote/journal-remote.h +++ b/src/journal-remote/journal-remote.h @@ -36,6 +36,27 @@ struct RemoteServer { Writer *_single_writer; uint64_t event_count; - bool check_trust; Hashmap *daemons; + + const char *output; /* either the output file or directory */ + + JournalWriteSplitMode split_mode; + bool compress; + bool seal; + bool check_trust; }; +extern RemoteServer *journal_remote_server_global; + +int journal_remote_server_init( + RemoteServer *s, + const char *output, + JournalWriteSplitMode split_mode, + bool compress, + bool seal); + +int journal_remote_get_writer(RemoteServer *s, const char *host, Writer **writer); + +int journal_remote_add_source(RemoteServer *s, int fd, char* name, bool own_name); +int journal_remote_add_raw_socket(RemoteServer *s, int fd); + +RemoteServer* journal_remote_server_destroy(RemoteServer *s); |