Sync usage with man page.
[netbsd-mini2440.git] / dist / ipf / lib / printportcmp.c
blob7d77ff811cf44d64faf3a26bb5b1c325774cf225
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2000-2003 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
8 * Id: printportcmp.c,v 1.7.4.1 2006/06/16 17:21:14 darrenr Exp
9 */
11 #include "ipf.h"
14 void printportcmp(pr, frp)
15 int pr;
16 frpcmp_t *frp;
18 static char *pcmp1[] = { "*", "=", "!=", "<", ">", "<=", ">=",
19 "<>", "><", ":" };
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));