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