diff options
author | brian <brian@FreeBSD.org> | 1997-06-09 03:27:43 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-06-09 03:27:43 +0000 |
commit | 94d661ac8cb907e0a869759f76cd7134c9105e6c (patch) | |
tree | 5fa88c28cbdec0d4a0d3d118b33c1042dc49c526 /usr.sbin/ppp/log.h | |
parent | 328d28c6502cfec45b8ead98e18b2d8638499efb (diff) | |
download | FreeBSD-src-94d661ac8cb907e0a869759f76cd7134c9105e6c.zip FreeBSD-src-94d661ac8cb907e0a869759f76cd7134c9105e6c.tar.gz |
Overhaul ppp:
o Use syslog
o Remove references to stdout/stderr (incl perror())
o Introduce VarTerm - the interactive terminal or zero
o Allow "set timeout" to affect current session
o Change "set debug" to "set log"
o Allow "set log [+|-]flag"
o Make MSEXT and PASSWDAUTH stuff the default
o Move all #ifdef DEBUG stuff into the code - this
shouldn't be too much overhead. It's now controlled
with "set log +debug"
o Add "set log command, debug, tun, warn, error, alert"
o Remove cdefs.h, and assume an ansi compiler.
o Improve all diagnostic output
o Don't trap SIGSEGV
o SIGHUP now terminates again (log files are controlled
by syslog)
o Call CloseModem() when changing devices
o Fix parsing of third arg of "delete"
I think this fixes the "magic is same" problems that some
people have been experiencing.
The man page is being rewritten. It'll follow soon.
Diffstat (limited to 'usr.sbin/ppp/log.h')
-rw-r--r-- | usr.sbin/ppp/log.h | 103 |
1 files changed, 31 insertions, 72 deletions
diff --git a/usr.sbin/ppp/log.h b/usr.sbin/ppp/log.h index 31ae57d..3a68cbf 100644 --- a/usr.sbin/ppp/log.h +++ b/usr.sbin/ppp/log.h @@ -1,73 +1,32 @@ -/* - * Written by Toshiharu OHNO (tony-o@iij.ad.jp) - * - * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the Internet Initiative Japan. The name of the - * IIJ may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id: log.h,v 1.9 1997/03/13 14:53:54 brian Exp $ - * - * TODO: - */ +#define LogMIN (1) +#define LogASYNC (1) /* syslog(LOG_INFO, ....) */ +#define LogCARRIER (2) +#define LogCHAT (3) +#define LogCOMMAND (4) +#define LogCONNECT (5) +#define LogDEBUG (6) /* syslog(LOG_DEBUG, ....) */ +#define LogHDLC (7) +#define LogLCP (8) +#define LogLINK (9) +#define LogLQM (10) +#define LogPHASE (11) +#define LogTCPIP (12) +#define LogTUN (13) /* If set, tun%d is output with each message */ +#define LogMAXCONF (13) +#define LogWARN (14) /* Sent to VarTerm else syslog(LOG_WARNING, ) */ +#define LogERROR (15) /* syslog(LOG_ERR, ....), + sent to VarTerm */ +#define LogALERT (16) /* syslog(LOG_ALERT, ....) */ +#define LogMAX (16) -#ifndef _LOG_H_ -#define _LOG_H_ -#include "cdefs.h" -/* - * Definition of log level - */ -#define LOG_PHASE 0 -#define LOG_PHASE_BIT (1 << LOG_PHASE) -# define LM_PHASE "Phase" -#define LOG_CHAT 1 -#define LOG_CHAT_BIT (1 << LOG_CHAT) -# define LM_CHAT "Chat" -#define LOG_LQM 2 -#define LOG_LQM_BIT (1 << LOG_LQM) -# define LM_LQM "LQM" -#define LOG_LCP 3 -#define LOG_LCP_BIT (1 << LOG_LCP) -# define LM_LCP "LCP" -#define LOG_TCPIP 4 -#define LOG_TCPIP_BIT (1 << LOG_TCPIP) -# define LM_TCPIP "TCP/IP" -#define LOG_HDLC 5 -#define LOG_HDLC_BIT (1 << LOG_HDLC) -# define LM_HDLC "HDLC" -#define LOG_ASYNC 6 -#define LOG_ASYNC_BIT (1 << LOG_ASYNC) -# define LM_ASYNC "Async" -#define LOG_LINK 7 -#define LOG_LINK_BIT (1 << LOG_LINK) -# define LM_LINK "Link" -#define LOG_CONNECT 8 -#define LOG_CONNECT_BIT (1 << LOG_CONNECT) -# define LM_CONNECT "Connect" -#define LOG_CARRIER 9 -#define LOG_CARRIER_BIT (1 << LOG_CARRIER) -# define LM_CARRIER "Carrier" -#define MAXLOGLEVEL 10 - -extern int loglevel, tunno; -extern char *logptr; - -extern void LogTimeStamp __P((void)); -extern int LogOpen __P((int)); -extern void LogReOpen __P((int)); -extern void DupLog __P((void)); -extern void LogClose __P((void)); -extern void logprintf __P((char *, ...)), LogPrintf __P((int, char *, ...)); -extern void LogDumpBp __P((int level, char *header, struct mbuf *bp)); -extern void LogDumpBuff __P((int level, char *header, u_char *ptr, int cnt)); -extern void ListLog __P((void)); -#endif +/* The first int arg for all of the following is one of the above values */ +extern const char *LogName(int); +extern void LogKeep(int); +extern void LogDiscard(int); +extern void LogDiscardAll(); +extern int LogIsKept(int); +extern void LogOpen(const char *); +extern void LogSetTun(int); +extern void LogClose(); +extern void LogPrintf(int, char *, ...); +extern void LogDumpBp(int, char *hdr, struct mbuf *bp); +extern void LogDumpBuff(int, char *hdr, u_char *ptr, int n); |