2 * Routines to report various classes of problems. Each report is decorated
3 * with the current context (file name and line number), if available.
5 * tcpd_warn() reports a problem and proceeds.
7 * tcpd_jump() reports a problem and jumps.
9 * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
11 * @(#) diag.c 1.1 94/12/28 17:42:20
12 * $DragonFly: src/contrib/tcp_wrappers/diag.c,v 1.2 2005/09/15 04:33:04 sephe Exp $
15 /* System libraries */
25 struct tcpd_context tcpd_context
;
28 /* tcpd_diag - centralize error reporter */
31 tcpd_diag(int severity
, const char *tag
, const char *format
, va_list ap
)
35 if (tcpd_context
.file
)
36 sprintf(fmt
, "%s: %s, line %d: %s",
37 tag
, tcpd_context
.file
, tcpd_context
.line
, format
);
39 sprintf(fmt
, "%s: %s", tag
, format
);
40 vsyslog(severity
, fmt
, ap
);
43 /* tcpd_warn - report problem of some sort and proceed */
46 tcpd_warn(const char *format
, ...)
51 tcpd_diag(LOG_ERR
, "warning", format
, ap
);
55 /* tcpd_jump - report serious problem and jump */
58 tcpd_jump(const char *format
, ...)
63 tcpd_diag(LOG_ERR
, "error", format
, ap
);
65 longjmp(tcpd_buf
, AC_ERROR
);