11ae349f5Scvs2svn /*- 21ae349f5Scvs2svn * Copyright (c) 1997 Brian Somers <brian@Awfulhak.org> 31ae349f5Scvs2svn * All rights reserved. 41ae349f5Scvs2svn * 51ae349f5Scvs2svn * Redistribution and use in source and binary forms, with or without 61ae349f5Scvs2svn * modification, are permitted provided that the following conditions 71ae349f5Scvs2svn * are met: 81ae349f5Scvs2svn * 1. Redistributions of source code must retain the above copyright 91ae349f5Scvs2svn * notice, this list of conditions and the following disclaimer. 101ae349f5Scvs2svn * 2. Redistributions in binary form must reproduce the above copyright 111ae349f5Scvs2svn * notice, this list of conditions and the following disclaimer in the 121ae349f5Scvs2svn * documentation and/or other materials provided with the distribution. 131ae349f5Scvs2svn * 141ae349f5Scvs2svn * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 151ae349f5Scvs2svn * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 161ae349f5Scvs2svn * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 171ae349f5Scvs2svn * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 181ae349f5Scvs2svn * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 191ae349f5Scvs2svn * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 201ae349f5Scvs2svn * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 211ae349f5Scvs2svn * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 221ae349f5Scvs2svn * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 231ae349f5Scvs2svn * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 241ae349f5Scvs2svn * SUCH DAMAGE. 251ae349f5Scvs2svn * 262764b86aSBrian Somers * $Id: log.h,v 1.18.2.2 1998/04/03 19:25:41 brian Exp $ 271ae349f5Scvs2svn */ 281ae349f5Scvs2svn 291ae349f5Scvs2svn #define LogMIN (1) 301ae349f5Scvs2svn #define LogASYNC (1) /* syslog(LOG_INFO, ....) */ 311ae349f5Scvs2svn #define LogCARRIER (2) 321ae349f5Scvs2svn #define LogCCP (3) 331ae349f5Scvs2svn #define LogCHAT (4) 341ae349f5Scvs2svn #define LogCOMMAND (5) 351ae349f5Scvs2svn #define LogCONNECT (6) 361ae349f5Scvs2svn #define LogDEBUG (7) /* syslog(LOG_DEBUG, ....) */ 371ae349f5Scvs2svn #define LogHDLC (8) 381ae349f5Scvs2svn #define LogID0 (9) 391ae349f5Scvs2svn #define LogIPCP (10) 401ae349f5Scvs2svn #define LogLCP (11) 411ae349f5Scvs2svn #define LogLINK (12) 421ae349f5Scvs2svn #define LogLQM (13) 431ae349f5Scvs2svn #define LogPHASE (14) 441ae349f5Scvs2svn #define LogTCPIP (15) 451ae349f5Scvs2svn #define LogTUN (16) /* If set, tun%d is output with each message */ 461ae349f5Scvs2svn #define LogMAXCONF (16) 471ae349f5Scvs2svn #define LogWARN (17) /* Sent to VarTerm else syslog(LOG_WARNING, ) */ 481ae349f5Scvs2svn #define LogERROR (18) /* syslog(LOG_ERR, ....), + sent to VarTerm */ 491ae349f5Scvs2svn #define LogALERT (19) /* syslog(LOG_ALERT, ....) */ 501ae349f5Scvs2svn #define LogMAX (19) 511ae349f5Scvs2svn 5285b542cfSBrian Somers struct mbuf; 532764b86aSBrian Somers struct cmdargs; 542764b86aSBrian Somers struct prompt; 5585b542cfSBrian Somers 561ae349f5Scvs2svn /* The first int arg for all of the following is one of the above values */ 571ae349f5Scvs2svn extern const char *LogName(int); 581ae349f5Scvs2svn extern void LogKeep(int); 59b6217683SBrian Somers extern void LogKeepLocal(int, u_long *); 601ae349f5Scvs2svn extern void LogDiscard(int); 61b6217683SBrian Somers extern void LogDiscardLocal(int, u_long *); 621ae349f5Scvs2svn extern void LogDiscardAll(void); 63b6217683SBrian Somers extern void LogDiscardAllLocal(u_long *); 641ae349f5Scvs2svn #define LOG_KEPT_SYSLOG (1) /* Results of LogIsKept() */ 651ae349f5Scvs2svn #define LOG_KEPT_LOCAL (2) /* Results of LogIsKept() */ 661ae349f5Scvs2svn extern int LogIsKept(int); 67b6217683SBrian Somers extern int LogIsKeptLocal(int, u_long); 681ae349f5Scvs2svn extern void LogOpen(const char *); 691ae349f5Scvs2svn extern void LogSetTun(int); 701ae349f5Scvs2svn extern void LogClose(void); 711ae349f5Scvs2svn extern void LogPrintf(int, const char *,...); 721ae349f5Scvs2svn extern void LogDumpBp(int, const char *, const struct mbuf *); 731ae349f5Scvs2svn extern void LogDumpBuff(int, const char *, const u_char *, int); 74b6217683SBrian Somers extern void log_RegisterPrompt(struct prompt *); 75b6217683SBrian Somers extern void log_UnRegisterPrompt(struct prompt *); 76b6217683SBrian Somers extern int log_ShowLevel(struct cmdargs const *); 77b6217683SBrian Somers extern int log_SetLevel(struct cmdargs const *); 78b6217683SBrian Somers extern int log_ShowWho(struct cmdargs const *); 79