printlog.c revision 256281
1226031Sstas/*	$FreeBSD: stable/10/contrib/ipfilter/lib/printlog.c 255332 2013-09-06 23:11:19Z cy $	*/
2226031Sstas
3226031Sstas/*
4226031Sstas * Copyright (C) 2012 by Darren Reed.
5226031Sstas *
6226031Sstas * See the IPFILTER.LICENCE file for details on licencing.
7226031Sstas *
8226031Sstas * $Id$
9226031Sstas */
10226031Sstas
11226031Sstas#include "ipf.h"
12226031Sstas
13226031Sstas#include <syslog.h>
14226031Sstas
15226031Sstas
16226031Sstasvoid
17226031Sstasprintlog(fp)
18226031Sstas	frentry_t *fp;
19226031Sstas{
20226031Sstas	char *s, *u;
21226031Sstas
22226031Sstas	PRINTF("log");
23226031Sstas	if (fp->fr_flags & FR_LOGBODY)
24226031Sstas		PRINTF(" body");
25226031Sstas	if (fp->fr_flags & FR_LOGFIRST)
26226031Sstas		PRINTF(" first");
27226031Sstas	if (fp->fr_flags & FR_LOGORBLOCK)
28226031Sstas		PRINTF(" or-block");
29226031Sstas	if (fp->fr_loglevel != 0xffff) {
30226031Sstas		PRINTF(" level ");
31226031Sstas		s = fac_toname(fp->fr_loglevel);
32226031Sstas		if (s == NULL || *s == '\0')
33226031Sstas			s = "!!!";
34226031Sstas		u = pri_toname(fp->fr_loglevel);
35226031Sstas		if (u == NULL || *u == '\0')
36226031Sstas			u = "!!!";
37226031Sstas		PRINTF("%s.%s", s, u);
38226031Sstas	}
39226031Sstas}
40226031Sstas