11692SN/A/*- 22224Sctornqvi * Copyright (c) 1997 Brian Somers <brian@Awfulhak.org> 31692SN/A * All rights reserved. 41692SN/A * 51692SN/A * Redistribution and use in source and binary forms, with or without 61692SN/A * modification, are permitted provided that the following conditions 71692SN/A * are met: 81692SN/A * 1. Redistributions of source code must retain the above copyright 91692SN/A * notice, this list of conditions and the following disclaimer. 101692SN/A * 2. Redistributions in binary form must reproduce the above copyright 111692SN/A * notice, this list of conditions and the following disclaimer in the 121692SN/A * documentation and/or other materials provided with the distribution. 131692SN/A * 141692SN/A * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 151692SN/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 161692SN/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 171692SN/A * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 181692SN/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 191692SN/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 201692SN/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 211692SN/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 221692SN/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 231692SN/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 241692SN/A * SUCH DAMAGE. 251692SN/A * 261692SN/A * $FreeBSD: releng/10.2/usr.sbin/ppp/log.h 218397 2011-02-07 11:18:18Z brian $ 271692SN/A */ 281692SN/A 291692SN/A#define LogLOG (0) 301692SN/A#define LogMIN (1) 311692SN/A#define LogASYNC (1) /* syslog(LOG_INFO, ....) */ 321692SN/A#define LogCBCP (2) 331692SN/A#define LogCCP (3) 341692SN/A#define LogCHAT (4) 351692SN/A#define LogCOMMAND (5) 361692SN/A#define LogCONNECT (6) 371692SN/A#define LogDEBUG (7) /* syslog(LOG_DEBUG, ....) */ 381692SN/A#define LogDNS (8) 391692SN/A#define LogFILTER (9) 401692SN/A#define LogHDLC (10) 411692SN/A#define LogID0 (11) 421692SN/A#define LogIPCP (12) 431692SN/A#define LogIPV6CP (13) 441692SN/A#define LogLCP (14) 451692SN/A#define LogLQM (15) 461692SN/A#define LogPHASE (16) 471692SN/A#define LogPHYSICAL (17) /* syslog(LOG_INFO, ....) */ 481692SN/A#define LogRADIUS (18) /* syslog(LOG_INFO, ....) */ 491692SN/A#define LogSYNC (19) /* syslog(LOG_INFO, ....) */ 501692SN/A#define LogTCPIP (20) 511692SN/A#define LogTIMER (21) /* syslog(LOG_DEBUG, ....) */ 521692SN/A#define LogTUN (22) /* If set, tun%d is output with each message */ 531692SN/A#define LogWARN (23) /* Sent to VarTerm else syslog(LOG_WARNING, ) */ 541692SN/A#define LogERROR (24) /* syslog(LOG_ERR, ....), + sent to VarTerm */ 551692SN/A#define LogALERT (25) /* syslog(LOG_ALERT, ....) */ 561692SN/A 571692SN/A#define LogMAXCONF (22) 581692SN/A#define LogMAX (25) 591692SN/A 601692SN/Astruct mbuf; 611692SN/Astruct cmdargs; 621692SN/Astruct prompt; 631692SN/Astruct server; 641692SN/Astruct datalink; 651692SN/A 661692SN/A/* The first int arg for all of the following is one of the above values */ 671692SN/Aextern const char *log_Name(int); 681692SN/Aextern void log_Keep(int); 691692SN/Aextern void log_KeepLocal(int, u_long *); 701692SN/Aextern void log_Discard(int); 711692SN/Aextern void log_DiscardLocal(int, u_long *); 721692SN/Aextern void log_DiscardAll(void); 731692SN/Aextern void log_DiscardAllLocal(u_long *); 741692SN/A#define LOG_KEPT_SYSLOG (1) /* Results of log_IsKept() */ 751692SN/A#define LOG_KEPT_LOCAL (2) /* Results of log_IsKept() */ 761692SN/Aextern int log_IsKept(int); 771692SN/Aextern int log_IsKeptLocal(int, u_long); 781692SN/Aextern void log_Open(const char *); 791692SN/Aextern void log_SetTun(int, const char *); 801692SN/Aextern void log_Close(void); 811692SN/A#ifdef __GNUC__ 82extern void log_Printf(int, const char *,...) 83 __attribute__ ((format (printf, 2, 3))); 84extern void log_WritePrompts(struct datalink *, const char *, ...) 85 __attribute__ ((format (printf, 2, 3))); 86#else 87extern void log_Printf(int, const char *,...); 88extern void log_WritePrompts(struct datalink *, const char *, ...); 89#endif 90extern void log_DumpBp(int, const char *, const struct mbuf *); 91extern void log_DumpBuff(int, const char *, const u_char *, int); 92extern int log_ShowLevel(struct cmdargs const *); 93extern int log_SetLevel(struct cmdargs const *); 94extern int log_ShowWho(struct cmdargs const *); 95 96extern struct prompt *log_PromptContext; 97extern int log_PromptListChanged; 98extern void log_RegisterPrompt(struct prompt *); 99extern void log_UnRegisterPrompt(struct prompt *); 100extern void log_DestroyPrompts(struct server *); 101extern void log_DisplayPrompts(void); 102extern void log_ActivatePrompt(struct prompt *); 103extern void log_DeactivatePrompt(struct prompt *); 104extern void log_SetTtyCommandMode(struct datalink *); 105extern struct prompt *log_PromptList(void); 106