1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright 2017 Lennart Poettering
11 #include <sys/types.h>
15 typedef struct ClientContext ClientContext
;
17 #include "journald-server.h"
19 struct ClientContext
{
47 sd_id128_t invocation_id
;
54 struct iovec
*extra_fields_iovec
;
55 size_t extra_fields_n_iovec
;
56 void *extra_fields_data
;
57 nsec_t extra_fields_mtime
;
60 int client_context_get(
63 const struct ucred
*ucred
,
64 const char *label
, size_t label_len
,
68 int client_context_acquire(
71 const struct ucred
*ucred
,
72 const char *label
, size_t label_len
,
76 ClientContext
* client_context_release(Server
*s
, ClientContext
*c
);
78 void client_context_maybe_refresh(
81 const struct ucred
*ucred
,
82 const char *label
, size_t label_size
,
86 void client_context_acquire_default(Server
*s
);
87 void client_context_flush_all(Server
*s
);
89 static inline size_t client_context_extra_fields_n_iovec(const ClientContext
*c
) {
90 return c
? c
->extra_fields_n_iovec
: 0;
93 static inline bool client_context_test_priority(const ClientContext
*c
, int priority
) {
97 if (c
->log_level_max
< 0)
100 return LOG_PRI(priority
) <= c
->log_level_max
;