]>
git.proxmox.com Git - mirror_frr.git/blob - lib/zlog_targets.h
2 * Copyright (c) 2015-19 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_TARGETS_H
18 #define _FRR_ZLOG_TARGETS_H
28 /* multiple file log targets can be active */
32 struct zlog_cfg_file
{
33 struct zlt_fd
*active
;
35 pthread_mutex_t cfg_mtx
;
37 /* call zlog_file_set_other() to apply these */
42 /* call zlog_file_set_filename/fd() to change this */
46 void (*zlog_wrap
)(struct zlog_target
*zt
, struct zlog_msg
*msgs
[],
50 extern void zlog_file_init(struct zlog_cfg_file
*zcf
);
51 extern void zlog_file_fini(struct zlog_cfg_file
*zcf
);
53 extern void zlog_file_set_other(struct zlog_cfg_file
*zcf
);
54 extern bool zlog_file_set_filename(struct zlog_cfg_file
*zcf
, const char *name
);
55 extern bool zlog_file_set_fd(struct zlog_cfg_file
*zcf
, int fd
);
56 extern bool zlog_file_rotate(struct zlog_cfg_file
*zcf
);
58 extern void zlog_fd(struct zlog_target
*zt
, struct zlog_msg
*msgs
[],
61 /* syslog is always limited to one target */
63 extern void zlog_syslog_set_facility(int facility
);
64 extern int zlog_syslog_get_facility(void);
66 /* use ZLOG_DISABLED to disable */
67 extern void zlog_syslog_set_prio_min(int prio_min
);
68 extern int zlog_syslog_get_prio_min(void);
74 #endif /* _FRR_ZLOG_TARGETS_H */