1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate * Copyright (C) 1993-2001 by Darren Reed.
3*7c478bd9Sstevel@tonic-gate *
4*7c478bd9Sstevel@tonic-gate * See the IPFILTER.LICENCE file for details on licencing.
5*7c478bd9Sstevel@tonic-gate *
6*7c478bd9Sstevel@tonic-gate * $Id: printportcmp.c,v 1.7 2003/02/16 02:31:05 darrenr Exp $
7*7c478bd9Sstevel@tonic-gate */
8*7c478bd9Sstevel@tonic-gate
9*7c478bd9Sstevel@tonic-gate #include "ipf.h"
10*7c478bd9Sstevel@tonic-gate
11*7c478bd9Sstevel@tonic-gate
printportcmp(pr,frp)12*7c478bd9Sstevel@tonic-gate void printportcmp(pr, frp)
13*7c478bd9Sstevel@tonic-gate int pr;
14*7c478bd9Sstevel@tonic-gate frpcmp_t *frp;
15*7c478bd9Sstevel@tonic-gate {
16*7c478bd9Sstevel@tonic-gate static char *pcmp1[] = { "*", "=", "!=", "<", ">", "<=", ">=",
17*7c478bd9Sstevel@tonic-gate "<>", "><", ":" };
18*7c478bd9Sstevel@tonic-gate
19*7c478bd9Sstevel@tonic-gate if (frp->frp_cmp == FR_INRANGE || frp->frp_cmp == FR_OUTRANGE)
20*7c478bd9Sstevel@tonic-gate printf(" port %d %s %d", frp->frp_port,
21*7c478bd9Sstevel@tonic-gate pcmp1[frp->frp_cmp], frp->frp_top);
22*7c478bd9Sstevel@tonic-gate else if (frp->frp_cmp == FR_INCRANGE)
23*7c478bd9Sstevel@tonic-gate printf(" port %d:%d", frp->frp_port, frp->frp_top);
24*7c478bd9Sstevel@tonic-gate else
25*7c478bd9Sstevel@tonic-gate printf(" port %s %s", pcmp1[frp->frp_cmp],
26*7c478bd9Sstevel@tonic-gate portname(pr, frp->frp_port));
27*7c478bd9Sstevel@tonic-gate }
28