1*0a6a1f1dSLionel Sambuc /* $NetBSD: extern.h,v 1.4 2015/02/10 20:38:15 christos Exp $ */ 23e07920fSDavid van Moolenbroek 33e07920fSDavid van Moolenbroek /*- 43e07920fSDavid van Moolenbroek * Copyright (c) 2008 The NetBSD Foundation, Inc. 53e07920fSDavid van Moolenbroek * All rights reserved. 63e07920fSDavid van Moolenbroek * 73e07920fSDavid van Moolenbroek * This code is derived from software contributed to The NetBSD Foundation 83e07920fSDavid van Moolenbroek * by Martin Sch�tte. 93e07920fSDavid van Moolenbroek * 103e07920fSDavid van Moolenbroek * Redistribution and use in source and binary forms, with or without 113e07920fSDavid van Moolenbroek * modification, are permitted provided that the following conditions 123e07920fSDavid van Moolenbroek * are met: 133e07920fSDavid van Moolenbroek * 1. Redistributions of source code must retain the above copyright 143e07920fSDavid van Moolenbroek * notice, this list of conditions and the following disclaimer. 153e07920fSDavid van Moolenbroek * 2. Redistributions in binary form must reproduce the above copyright 163e07920fSDavid van Moolenbroek * notice, this list of conditions and the following disclaimer in the 173e07920fSDavid van Moolenbroek * documentation and/or other materials provided with the distribution. 183e07920fSDavid van Moolenbroek * 3. All advertising materials mentioning features or use of this software 193e07920fSDavid van Moolenbroek * must display the following acknowledgement: 203e07920fSDavid van Moolenbroek * This product includes software developed by the NetBSD 213e07920fSDavid van Moolenbroek * Foundation, Inc. and its contributors. 223e07920fSDavid van Moolenbroek * 4. Neither the name of The NetBSD Foundation nor the names of its 233e07920fSDavid van Moolenbroek * contributors may be used to endorse or promote products derived 243e07920fSDavid van Moolenbroek * from this software without specific prior written permission. 253e07920fSDavid van Moolenbroek * 263e07920fSDavid van Moolenbroek * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 273e07920fSDavid van Moolenbroek * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 283e07920fSDavid van Moolenbroek * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 293e07920fSDavid van Moolenbroek * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 303e07920fSDavid van Moolenbroek * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 313e07920fSDavid van Moolenbroek * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 323e07920fSDavid van Moolenbroek * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 333e07920fSDavid van Moolenbroek * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 343e07920fSDavid van Moolenbroek * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 353e07920fSDavid van Moolenbroek * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 363e07920fSDavid van Moolenbroek * POSSIBILITY OF SUCH DAMAGE. 373e07920fSDavid van Moolenbroek */ 383e07920fSDavid van Moolenbroek /* 393e07920fSDavid van Moolenbroek * extern.h 403e07920fSDavid van Moolenbroek * 413e07920fSDavid van Moolenbroek * declarations for variables and functions from syslogd.c 423e07920fSDavid van Moolenbroek * that are used in tls.c and sign.c 433e07920fSDavid van Moolenbroek */ 443e07920fSDavid van Moolenbroek #ifndef EXTERN_H_ 453e07920fSDavid van Moolenbroek #define EXTERN_H_ 463e07920fSDavid van Moolenbroek 473e07920fSDavid van Moolenbroek 483e07920fSDavid van Moolenbroek /* variables */ 493e07920fSDavid van Moolenbroek extern int Debug; 503e07920fSDavid van Moolenbroek extern struct tls_global_options_t tls_opt; 513e07920fSDavid van Moolenbroek extern struct TLS_Incoming TLS_Incoming_Head; 523e07920fSDavid van Moolenbroek extern struct sign_global_t GlobalSign; 533e07920fSDavid van Moolenbroek extern char *linebuf; 543e07920fSDavid van Moolenbroek extern size_t linebufsize; 553e07920fSDavid van Moolenbroek extern int RemoteAddDate; 563e07920fSDavid van Moolenbroek 573e07920fSDavid van Moolenbroek extern bool BSDOutputFormat; 583e07920fSDavid van Moolenbroek extern time_t now; 593e07920fSDavid van Moolenbroek extern char timestamp[]; 603e07920fSDavid van Moolenbroek extern char appname[]; 613e07920fSDavid van Moolenbroek extern char *LocalFQDN; 623e07920fSDavid van Moolenbroek extern char *include_pid; 633e07920fSDavid van Moolenbroek 643e07920fSDavid van Moolenbroek /* functions */ 653e07920fSDavid van Moolenbroek extern void logerror(const char *, ...) 663e07920fSDavid van Moolenbroek __attribute__((__format__(__printf__,1,2))); 673e07920fSDavid van Moolenbroek extern void loginfo(const char *, ...) 683e07920fSDavid van Moolenbroek __attribute__((__format__(__printf__,1,2))); 693e07920fSDavid van Moolenbroek extern void printline(const char *, char *, int); 703e07920fSDavid van Moolenbroek extern void die(int fd, short event, void *ev) 713e07920fSDavid van Moolenbroek __attribute__((__noreturn__)); 723e07920fSDavid van Moolenbroek extern struct event *allocev(void); 733e07920fSDavid van Moolenbroek extern void send_queue(int __unused, short __unused, void *); 743e07920fSDavid van Moolenbroek extern void schedule_event(struct event **, struct timeval *, 753e07920fSDavid van Moolenbroek void (*)(int, short, void *), void *); 76*0a6a1f1dSLionel Sambuc extern char *make_timestamp(time_t *, bool, size_t); 773e07920fSDavid van Moolenbroek #ifndef DISABLE_TLS 783e07920fSDavid van Moolenbroek extern struct filed *get_f_by_conninfo(struct tls_conn_settings *conn_info); 793e07920fSDavid van Moolenbroek #endif 803e07920fSDavid van Moolenbroek extern bool message_queue_remove(struct filed *, struct buf_queue *); 813e07920fSDavid van Moolenbroek extern void buf_msg_free(struct buf_msg *msg); 823e07920fSDavid van Moolenbroek extern void message_queue_freeall(struct filed *); 833e07920fSDavid van Moolenbroek extern bool copy_string(char **, const char *, const char *); 843e07920fSDavid van Moolenbroek extern bool copy_config_value_quoted(const char *, char **, const char **); 853e07920fSDavid van Moolenbroek extern size_t message_allqueues_purge(void); 863e07920fSDavid van Moolenbroek extern bool format_buffer(struct buf_msg*, char**, size_t*, size_t*, size_t*, 873e07920fSDavid van Moolenbroek size_t*); 883e07920fSDavid van Moolenbroek extern void fprintlog(struct filed *, struct buf_msg *, struct buf_queue *); 893e07920fSDavid van Moolenbroek extern struct buf_msg *buf_msg_new(const size_t); 903e07920fSDavid van Moolenbroek 913e07920fSDavid van Moolenbroek #endif /*EXTERN_H_*/ 92