]>
git.proxmox.com Git - mirror_frr.git/blob - lib/zlog_targets.h
1 // SPDX-License-Identifier: ISC
3 * Copyright (c) 2015-19 David Lamparter, for NetDEF, Inc.
6 #ifndef _FRR_ZLOG_TARGETS_H
7 #define _FRR_ZLOG_TARGETS_H
17 /* multiple file log targets can be active */
21 struct zlog_cfg_file
{
22 struct zlt_fd
*active
;
24 pthread_mutex_t cfg_mtx
;
26 /* call zlog_file_set_other() to apply these */
31 /* call zlog_file_set_filename/fd() to change this */
35 void (*zlog_wrap
)(struct zlog_target
*zt
, struct zlog_msg
*msgs
[],
39 extern void zlog_file_init(struct zlog_cfg_file
*zcf
);
40 extern void zlog_file_fini(struct zlog_cfg_file
*zcf
);
42 extern void zlog_file_set_other(struct zlog_cfg_file
*zcf
);
43 extern bool zlog_file_set_filename(struct zlog_cfg_file
*zcf
, const char *name
);
44 extern bool zlog_file_set_fd(struct zlog_cfg_file
*zcf
, int fd
);
45 extern bool zlog_file_rotate(struct zlog_cfg_file
*zcf
);
47 extern void zlog_fd(struct zlog_target
*zt
, struct zlog_msg
*msgs
[],
50 /* syslog is always limited to one target */
52 extern void zlog_syslog_set_facility(int facility
);
53 extern int zlog_syslog_get_facility(void);
55 /* use ZLOG_DISABLED to disable */
56 extern void zlog_syslog_set_prio_min(int prio_min
);
57 extern int zlog_syslog_get_prio_min(void);
63 #endif /* _FRR_ZLOG_TARGETS_H */