1/*	$NetBSD: extern.h,v 1.2 2008/11/07 07:36:38 minskim Exp $	*/
2
3/*-
4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Martin Sch�tte.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 *    must display the following acknowledgement:
20 *        This product includes software developed by the NetBSD
21 *        Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 *    contributors may be used to endorse or promote products derived
24 *    from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38/*
39 * extern.h
40 *
41 * declarations for variables and functions from syslogd.c
42 * that are used in tls.c and sign.c
43 */
44#ifndef EXTERN_H_
45#define EXTERN_H_
46
47
48/* variables */
49extern int Debug;
50extern struct tls_global_options_t tls_opt;
51extern struct TLS_Incoming TLS_Incoming_Head;
52extern struct sign_global_t GlobalSign;
53extern char  *linebuf;
54extern size_t linebufsize;
55extern int    RemoteAddDate;
56
57extern bool	BSDOutputFormat;
58extern time_t	now;
59extern char	timestamp[];
60extern char	appname[];
61extern char    *LocalFQDN;
62extern char    *include_pid;
63
64/* functions */
65extern void	logerror(const char *, ...)
66    __attribute__((__format__(__printf__,1,2)));
67extern void	loginfo(const char *, ...)
68    __attribute__((__format__(__printf__,1,2)));
69extern void	printline(const char *, char *, int);
70extern void	die(int fd, short event, void *ev)
71    __attribute__((__noreturn__));
72extern struct event *allocev(void);
73extern void	send_queue(int __unused, short __unused, void *);
74extern void	schedule_event(struct event **, struct timeval *,
75    void (*)(int, short, void *), void *);
76extern char    *make_timestamp(time_t *, bool);
77#ifndef DISABLE_TLS
78extern struct filed *get_f_by_conninfo(struct tls_conn_settings *conn_info);
79#endif
80extern bool	message_queue_remove(struct filed *, struct buf_queue *);
81extern void	buf_msg_free(struct buf_msg *msg);
82extern void	message_queue_freeall(struct filed *);
83extern bool	copy_string(char **, const char *, const char *);
84extern bool	copy_config_value_quoted(const char *, char **, const char **);
85extern size_t message_allqueues_purge(void);
86extern bool  format_buffer(struct buf_msg*, char**, size_t*, size_t*, size_t*,
87    size_t*);
88extern void  fprintlog(struct filed *, struct buf_msg *, struct buf_queue *);
89extern struct buf_msg *buf_msg_new(const size_t);
90
91#endif /*EXTERN_H_*/
92