]>
git.proxmox.com Git - mirror_frr.git/blob - lib/zlog_live.h
2 * Copyright (c) 2019-22 David Lamparter, for NetDEF, Inc.
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef _FRR_ZLOG_LIVE_H
18 #define _FRR_ZLOG_LIVE_H
22 struct zlog_live_hdr
{
23 /* timestamp (CLOCK_REALTIME) */
27 /* length of zlog_live_hdr, including variable length bits and
28 * possible future extensions - aka start of text
32 /* process & thread ID, meaning depends on OS */
36 /* number of lost messages due to best-effort non-blocking mode */
38 /* syslog priority value */
40 /* flags: currently unused */
42 /* length of message text - extra data (e.g. future key/value metadata)
46 /* length of "[XXXXX-XXXXX][EC 0] " header; consumer may want to skip
47 * over it if using the raw values below. Note that this text may be
48 * absent depending on "log error-category" and "log unique-id"
53 /* xref unique identifier, "XXXXX-XXXXX\0" = 12 bytes */
58 /* recorded printf formatting argument positions (variable length) */
60 struct fmt_outpos argpos
[0];
65 struct zlog_live_cfg
{
66 struct zlt_live
*target
;
68 /* nothing else here */
71 extern void zlog_live_open(struct zlog_live_cfg
*cfg
, int prio_min
,
73 extern void zlog_live_open_fd(struct zlog_live_cfg
*cfg
, int prio_min
, int fd
);
75 static inline bool zlog_live_is_null(struct zlog_live_cfg
*cfg
)
77 return cfg
->target
== NULL
;
80 extern void zlog_live_close(struct zlog_live_cfg
*cfg
);
81 extern void zlog_live_disown(struct zlog_live_cfg
*cfg
);
83 #endif /* _FRR_ZLOG_5424_H */