log.h revision 36285
1/*- 2 * Copyright (c) 1997 Brian Somers <brian@Awfulhak.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * $Id: log.h,v 1.18.2.8 1998/05/01 22:39:37 brian Exp $ 27 */ 28 29#define LogMIN (1) 30#define LogASYNC (1) /* syslog(LOG_INFO, ....) */ 31#define LogCCP (2) 32#define LogCHAT (3) 33#define LogCOMMAND (4) 34#define LogCONNECT (5) 35#define LogDEBUG (6) /* syslog(LOG_DEBUG, ....) */ 36#define LogHDLC (7) 37#define LogID0 (8) 38#define LogIPCP (9) 39#define LogLCP (10) 40#define LogLQM (11) 41#define LogPHASE (12) 42#define LogTCPIP (13) 43#define LogTIMER (14) /* syslog(LOG_DEBUG, ....) */ 44#define LogTUN (15) /* If set, tun%d is output with each message */ 45#define LogMAXCONF (15) 46#define LogWARN (16) /* Sent to VarTerm else syslog(LOG_WARNING, ) */ 47#define LogERROR (17) /* syslog(LOG_ERR, ....), + sent to VarTerm */ 48#define LogALERT (18) /* syslog(LOG_ALERT, ....) */ 49#define LogMAX (18) 50 51struct mbuf; 52struct cmdargs; 53struct prompt; 54 55/* The first int arg for all of the following is one of the above values */ 56extern const char *log_Name(int); 57extern void log_Keep(int); 58extern void log_KeepLocal(int, u_long *); 59extern void log_Discard(int); 60extern void log_DiscardLocal(int, u_long *); 61extern void log_DiscardAll(void); 62extern void log_DiscardAllLocal(u_long *); 63#define LOG_KEPT_SYSLOG (1) /* Results of log_IsKept() */ 64#define LOG_KEPT_LOCAL (2) /* Results of log_IsKept() */ 65extern int log_IsKept(int); 66extern int log_IsKeptLocal(int, u_long); 67extern void log_Open(const char *); 68extern void log_SetTun(int); 69extern void log_Close(void); 70#ifdef __GNUC__ 71extern void log_Printf(int, const char *,...) 72 __attribute__ ((format (printf, 2, 3))); 73#else 74extern void log_Printf(int, const char *,...); 75#endif 76extern void log_DumpBp(int, const char *, const struct mbuf *); 77extern void log_DumpBuff(int, const char *, const u_char *, int); 78extern void log_RegisterPrompt(struct prompt *); 79extern void log_UnRegisterPrompt(struct prompt *); 80extern int log_ShowLevel(struct cmdargs const *); 81extern int log_SetLevel(struct cmdargs const *); 82extern int log_ShowWho(struct cmdargs const *); 83