]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ipfilter/lib/printportcmp.c
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / ipfilter / lib / printportcmp.c
1 /*      $FreeBSD$       */
2
3 /*
4  * Copyright (C) 2012 by Darren Reed.
5  *
6  * See the IPFILTER.LICENCE file for details on licencing.
7  *
8  * $Id$
9  */
10
11 #include "ipf.h"
12
13
14 void
15 printportcmp(pr, frp)
16         int     pr;
17         frpcmp_t        *frp;
18 {
19         static char *pcmp1[] = { "*", "=", "!=", "<", ">", "<=", ">=",
20                                  "<>", "><", ":" };
21
22         if (frp->frp_cmp == FR_INRANGE || frp->frp_cmp == FR_OUTRANGE)
23                 PRINTF(" port %d %s %d", frp->frp_port,
24                              pcmp1[frp->frp_cmp], frp->frp_top);
25         else if (frp->frp_cmp == FR_INCRANGE)
26                 PRINTF(" port %d:%d", frp->frp_port, frp->frp_top);
27         else
28                 PRINTF(" port %s %s", pcmp1[frp->frp_cmp],
29                              portname(pr, frp->frp_port));
30 }