1/* $FreeBSD: head/contrib/ipfilter/lib/printlog.c 145519 2005-04-25 18:20:15Z darrenr $ */
|
1/* $FreeBSD: head/contrib/ipfilter/lib/printlog.c 153881 2005-12-30 11:52:26Z guido $ */ |
2 3/* 4 * Copyright (C) 1993-2001 by Darren Reed. 5 * 6 * See the IPFILTER.LICENCE file for details on licencing. 7 *
|
8 * Id: printlog.c,v 1.6 2002/01/28 06:50:47 darrenr Exp
|
8 * $Id: printlog.c,v 1.6.4.1 2005/11/14 17:45:06 darrenr Exp $ |
9 */ 10 11#include "ipf.h" 12 13#include <syslog.h> 14 15 16void printlog(fp) 17frentry_t *fp; 18{ 19 char *s, *u; 20 21 printf("log"); 22 if (fp->fr_flags & FR_LOGBODY) 23 printf(" body"); 24 if (fp->fr_flags & FR_LOGFIRST) 25 printf(" first"); 26 if (fp->fr_flags & FR_LOGORBLOCK) 27 printf(" or-block"); 28 if (fp->fr_loglevel != 0xffff) { 29 printf(" level ");
|
30 if (fp->fr_loglevel & LOG_FACMASK) {
31 s = fac_toname(fp->fr_loglevel);
32 if (s == NULL)
33 s = "!!!";
34 } else
35 s = "";
|
30 s = fac_toname(fp->fr_loglevel); 31 if (s == NULL) 32 s = "!!!"; |
33 u = pri_toname(fp->fr_loglevel); 34 if (u == NULL) 35 u = "!!!"; 36 if (*s) 37 printf("%s.%s", s, u); 38 else 39 printf("%s", u); 40 } 41}
|