printlog.c revision 170268
150477Speter/*	$FreeBSD: head/contrib/ipfilter/lib/printlog.c 170268 2007-06-04 02:54:36Z darrenr $	*/
238465Smsmith
3200872Sjhb/*
440149Srnordier * Copyright (C) 2000-2005 by Darren Reed.
5200872Sjhb *
6200872Sjhb * See the IPFILTER.LICENCE file for details on licencing.
7200872Sjhb *
858713Sjhb * $Id: printlog.c,v 1.6.4.3 2006/06/16 17:21:12 darrenr Exp $
958713Sjhb */
1058713Sjhb
11200872Sjhb#include "ipf.h"
12200872Sjhb
13200872Sjhb#include <syslog.h>
14200872Sjhb
1538465Smsmith
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		s = fac_toname(fp->fr_loglevel);
31		if (s == NULL || *s == '\0')
32			s = "!!!";
33		u = pri_toname(fp->fr_loglevel);
34		if (u == NULL || *u == '\0')
35			u = "!!!";
36		printf("%s.%s", s, u);
37	}
38}
39