Home | History | Annotate | Line # | Download | only in tcpdchk
      1  1.7     sevan /*	$NetBSD: fakelog.c,v 1.7 2018/01/23 21:06:26 sevan Exp $	*/
      2  1.2  christos 
      3  1.1       cjs  /*
      4  1.1       cjs   * This module intercepts syslog() library calls and redirects their output
      5  1.1       cjs   * to the standard output stream. For interactive testing.
      6  1.1       cjs   *
      7  1.1       cjs   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
      8  1.1       cjs   */
      9  1.1       cjs 
     10  1.2  christos #include <sys/cdefs.h>
     11  1.1       cjs #ifndef lint
     12  1.2  christos #if 0
     13  1.1       cjs static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17:42:21";
     14  1.2  christos #else
     15  1.7     sevan __RCSID("$NetBSD: fakelog.c,v 1.7 2018/01/23 21:06:26 sevan Exp $");
     16  1.2  christos #endif
     17  1.1       cjs #endif
     18  1.1       cjs 
     19  1.1       cjs #include <stdio.h>
     20  1.2  christos #include <syslog.h>
     21  1.1       cjs 
     22  1.1       cjs #include "mystdarg.h"
     23  1.2  christos #include "percent_m.h"
     24  1.1       cjs 
     25  1.1       cjs /* openlog - dummy */
     26  1.1       cjs 
     27  1.1       cjs /* ARGSUSED */
     28  1.1       cjs 
     29  1.2  christos void
     30  1.7     sevan openlog(const char *name, int logopt, int facility)
     31  1.1       cjs {
     32  1.1       cjs     /* void */
     33  1.1       cjs }
     34  1.1       cjs 
     35  1.1       cjs /* vsyslog - format one record */
     36  1.1       cjs 
     37  1.2  christos void
     38  1.6     joerg vsyslog(int severity, const char *fmt, va_list ap)
     39  1.1       cjs {
     40  1.1       cjs     char    buf[BUFSIZ];
     41  1.1       cjs 
     42  1.1       cjs     vprintf(percent_m(buf, fmt), ap);
     43  1.1       cjs     printf("\n");
     44  1.1       cjs     fflush(stdout);
     45  1.1       cjs }
     46  1.1       cjs 
     47  1.1       cjs /* syslog - format one record */
     48  1.1       cjs 
     49  1.1       cjs /* VARARGS */
     50  1.1       cjs 
     51  1.2  christos void
     52  1.2  christos syslog(int severity, const char *fmt, ...)
     53  1.1       cjs {
     54  1.1       cjs     va_list ap;
     55  1.5       wiz 
     56  1.2  christos     va_start(ap, fmt);
     57  1.1       cjs     vsyslog(severity, fmt, ap);
     58  1.2  christos     va_end(ap);
     59  1.1       cjs }
     60  1.1       cjs 
     61  1.1       cjs /* closelog - dummy */
     62  1.1       cjs 
     63  1.2  christos void
     64  1.1       cjs closelog()
     65  1.1       cjs {
     66  1.1       cjs     /* void */
     67  1.1       cjs }
     68