1*7779d774Schristos /* $NetBSD: extern.h,v 1.4 2015/02/10 20:38:15 christos Exp $ */ 21c6aec20Schristos 31c6aec20Schristos /*- 41c6aec20Schristos * Copyright (c) 2008 The NetBSD Foundation, Inc. 51c6aec20Schristos * All rights reserved. 61c6aec20Schristos * 71c6aec20Schristos * This code is derived from software contributed to The NetBSD Foundation 81c6aec20Schristos * by Martin Sch�tte. 91c6aec20Schristos * 101c6aec20Schristos * Redistribution and use in source and binary forms, with or without 111c6aec20Schristos * modification, are permitted provided that the following conditions 121c6aec20Schristos * are met: 131c6aec20Schristos * 1. Redistributions of source code must retain the above copyright 141c6aec20Schristos * notice, this list of conditions and the following disclaimer. 151c6aec20Schristos * 2. Redistributions in binary form must reproduce the above copyright 161c6aec20Schristos * notice, this list of conditions and the following disclaimer in the 171c6aec20Schristos * documentation and/or other materials provided with the distribution. 181c6aec20Schristos * 3. All advertising materials mentioning features or use of this software 191c6aec20Schristos * must display the following acknowledgement: 201c6aec20Schristos * This product includes software developed by the NetBSD 211c6aec20Schristos * Foundation, Inc. and its contributors. 221c6aec20Schristos * 4. Neither the name of The NetBSD Foundation nor the names of its 231c6aec20Schristos * contributors may be used to endorse or promote products derived 241c6aec20Schristos * from this software without specific prior written permission. 251c6aec20Schristos * 261c6aec20Schristos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 271c6aec20Schristos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 281c6aec20Schristos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 291c6aec20Schristos * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 301c6aec20Schristos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 311c6aec20Schristos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 321c6aec20Schristos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 331c6aec20Schristos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 341c6aec20Schristos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 351c6aec20Schristos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 361c6aec20Schristos * POSSIBILITY OF SUCH DAMAGE. 371c6aec20Schristos */ 381c6aec20Schristos /* 391c6aec20Schristos * extern.h 401c6aec20Schristos * 411c6aec20Schristos * declarations for variables and functions from syslogd.c 421c6aec20Schristos * that are used in tls.c and sign.c 431c6aec20Schristos */ 441c6aec20Schristos #ifndef EXTERN_H_ 451c6aec20Schristos #define EXTERN_H_ 461c6aec20Schristos 471c6aec20Schristos 481c6aec20Schristos /* variables */ 491c6aec20Schristos extern int Debug; 501c6aec20Schristos extern struct tls_global_options_t tls_opt; 511c6aec20Schristos extern struct TLS_Incoming TLS_Incoming_Head; 521c6aec20Schristos extern struct sign_global_t GlobalSign; 531c6aec20Schristos extern char *linebuf; 541c6aec20Schristos extern size_t linebufsize; 551c6aec20Schristos extern int RemoteAddDate; 561c6aec20Schristos 571c6aec20Schristos extern bool BSDOutputFormat; 581c6aec20Schristos extern time_t now; 591c6aec20Schristos extern char timestamp[]; 601c6aec20Schristos extern char appname[]; 611c6aec20Schristos extern char *LocalFQDN; 621c6aec20Schristos extern char *include_pid; 631c6aec20Schristos 641c6aec20Schristos /* functions */ 651c6aec20Schristos extern void logerror(const char *, ...) 661c6aec20Schristos __attribute__((__format__(__printf__,1,2))); 671c6aec20Schristos extern void loginfo(const char *, ...) 681c6aec20Schristos __attribute__((__format__(__printf__,1,2))); 691c6aec20Schristos extern void printline(const char *, char *, int); 701c6aec20Schristos extern void die(int fd, short event, void *ev) 711c6aec20Schristos __attribute__((__noreturn__)); 721c6aec20Schristos extern struct event *allocev(void); 731c6aec20Schristos extern void send_queue(int __unused, short __unused, void *); 741c6aec20Schristos extern void schedule_event(struct event **, struct timeval *, 751c6aec20Schristos void (*)(int, short, void *), void *); 76*7779d774Schristos extern char *make_timestamp(time_t *, bool, size_t); 77634f514eSriz #ifndef DISABLE_TLS 781c6aec20Schristos extern struct filed *get_f_by_conninfo(struct tls_conn_settings *conn_info); 79634f514eSriz #endif 801c6aec20Schristos extern bool message_queue_remove(struct filed *, struct buf_queue *); 811c6aec20Schristos extern void buf_msg_free(struct buf_msg *msg); 821c6aec20Schristos extern void message_queue_freeall(struct filed *); 831c6aec20Schristos extern bool copy_string(char **, const char *, const char *); 841c6aec20Schristos extern bool copy_config_value_quoted(const char *, char **, const char **); 851c6aec20Schristos extern size_t message_allqueues_purge(void); 861c6aec20Schristos extern bool format_buffer(struct buf_msg*, char**, size_t*, size_t*, size_t*, 871c6aec20Schristos size_t*); 881c6aec20Schristos extern void fprintlog(struct filed *, struct buf_msg *, struct buf_queue *); 891c6aec20Schristos extern struct buf_msg *buf_msg_new(const size_t); 901c6aec20Schristos 911c6aec20Schristos #endif /*EXTERN_H_*/ 92