(fp->fr_ifa || (int)fp->fr_ifa == -1) ? "" : "(!)");
(fp->fr_ifa || (long)fp->fr_ifa == -1) ? "" : "(!)");
void	printfr(fp)struct	frentry	*fp;{	static	char	*pcmp1[] = { "*", "=", "!=", "<", ">", "<=", ">=",				    "<>", "><"};	struct	protoent	*p;	int	ones = 0, pr;	char	*s;	u_char	*t;	if (fp->fr_flags & FR_PASS) {		(void)printf("pass");	} else if (fp->fr_flags & FR_BLOCK) {		(void)printf("block");		if (fp->fr_flags & FR_RETICMP) {			(void)printf(" return-icmp");			if (fp->fr_icode)				if (fp->fr_icode <= MAX_ICMPCODE)					printf("(%s)",						icmpcodes[(int)fp->fr_icode]);				else					printf("(%d)", fp->fr_icode);		}		if (fp->fr_flags & FR_RETRST)			(void)printf(" return-rst");	} else if ((fp->fr_flags & FR_LOGMASK) == FR_LOG) {		(void)printf("log");		if (fp->fr_flags & FR_LOGBODY)			(void)printf(" body");		if (fp->fr_flags & FR_LOGFIRST)			(void)printf(" first");	} else if (fp->fr_flags & FR_ACCOUNT)		(void)printf("count");	if (fp->fr_flags & FR_OUTQUE)		(void)printf(" out ");	else		(void)printf(" in ");	if (((fp->fr_flags & FR_LOGB) == FR_LOGB) ||	    ((fp->fr_flags & FR_LOGP) == FR_LOGP)) {		(void)printf("log ");		if (fp->fr_flags & FR_LOGBODY)			(void)printf("body ");		if (fp->fr_flags & FR_LOGFIRST)			(void)printf("first ");		if (fp->fr_flags & FR_LOGORBLOCK)			(void)printf("or-block ");	}	if (fp->fr_flags & FR_QUICK)		(void)printf("quick ");	if (*fp->fr_ifname) {		(void)printf("on %s%s ", fp->fr_ifname,			(fp->fr_ifa || (int)fp->fr_ifa == -1) ? "" : "(!)");		if (*fp->fr_dif.fd_ifname)			print_toif("dup-to", &fp->fr_dif);		if (*fp->fr_tif.fd_ifname)			print_toif("to", &fp->fr_tif);		if (fp->fr_flags & FR_FASTROUTE)			(void)printf("fastroute ");	}	if (fp->fr_mip.fi_tos)		(void)printf("tos %#x ", fp->fr_tos);	if (fp->fr_mip.fi_ttl)		(void)printf("ttl %d ", fp->fr_ttl);	if (fp->fr_ip.fi_fl & FI_TCPUDP) {			(void)printf("proto tcp/udp ");			pr = -1;	} else if ((pr = fp->fr_mip.fi_p)) {		if ((p = getprotobynumber(fp->fr_proto)))			(void)printf("proto %s ", p->p_name);		else			(void)printf("proto %d ", fp->fr_proto);	}	if (!fp->fr_src.s_addr & !fp->fr_smsk.s_addr)		(void)printf("from any ");	else {		(void)printf("from %s", inet_ntoa(fp->fr_src));		if ((ones = countbits(fp->fr_smsk.s_addr)) == -1)			(void)printf("/%s ", inet_ntoa(fp->fr_smsk));		else			(void)printf("/%d ", ones);	}	if (fp->fr_scmp)		if (fp->fr_scmp == FR_INRANGE || fp->fr_scmp == FR_OUTRANGE)			(void)printf("port %d %s %d ", fp->fr_sport,				     pcmp1[fp->fr_scmp], fp->fr_stop);		else			(void)printf("port %s %s ", pcmp1[fp->fr_scmp],				     portname(pr, fp->fr_sport));	if (!fp->fr_dst.s_addr & !fp->fr_dmsk.s_addr)		(void)printf("to any");	else {		(void)printf("to %s", inet_ntoa(fp->fr_dst));		if ((ones = countbits(fp->fr_dmsk.s_addr)) == -1)			(void)printf("/%s", inet_ntoa(fp->fr_dmsk));		else			(void)printf("/%d", ones);	}	if (fp->fr_dcmp) {		if (fp->fr_dcmp == FR_INRANGE || fp->fr_dcmp == FR_OUTRANGE)			(void)printf(" port %d %s %d", fp->fr_dport,				     pcmp1[fp->fr_dcmp], fp->fr_dtop);		else			(void)printf(" port %s %s", pcmp1[fp->fr_dcmp],				     portname(pr, fp->fr_dport));	}	if ((fp->fr_ip.fi_fl & ~FI_TCPUDP) ||	    (fp->fr_mip.fi_fl & ~FI_TCPUDP) ||	    fp->fr_ip.fi_optmsk || fp->fr_mip.fi_optmsk ||	    fp->fr_ip.fi_secmsk || fp->fr_mip.fi_secmsk) {		(void)printf(" with");		if (fp->fr_ip.fi_optmsk || fp->fr_mip.fi_optmsk ||		    fp->fr_ip.fi_secmsk || fp->fr_mip.fi_secmsk)			optprint(fp->fr_mip.fi_secmsk,				 fp->fr_ip.fi_secmsk,				 fp->fr_mip.fi_optmsk,				 fp->fr_ip.fi_optmsk);		else if (fp->fr_mip.fi_fl & FI_OPTIONS) {			if (!(fp->fr_ip.fi_fl & FI_OPTIONS))				(void)printf(" not");			(void)printf(" ipopt");		}		if (fp->fr_mip.fi_fl & FI_SHORT) {			if (!(fp->fr_ip.fi_fl & FI_SHORT))				(void)printf(" not");			(void)printf(" short");		}		if (fp->fr_mip.fi_fl & FI_FRAG) {			if (!(fp->fr_ip.fi_fl & FI_FRAG))				(void)printf(" not");			(void)printf(" frag");		}	}	if (fp->fr_proto == IPPROTO_ICMP && fp->fr_icmpm) {		int	type = fp->fr_icmp, code;		type = ntohs(fp->fr_icmp);		code = type & 0xff;		type /= 256;		if (type < (sizeof(icmptypes) / sizeof(char *)) &&		    icmptypes[type])			(void)printf(" icmp-type %s", icmptypes[type]);		else			(void)printf(" icmp-type %d", type);		if (code)			(void)printf(" code %d", code);	}	if (fp->fr_proto == IPPROTO_TCP && (fp->fr_tcpf || fp->fr_tcpfm)) {		(void)printf(" flags ");		for (s = flagset, t = flags; *s; s++, t++)			if (fp->fr_tcpf & *t)				(void)putchar(*s);		if (fp->fr_tcpfm) {			(void)putchar('/');			for (s = flagset, t = flags; *s; s++, t++)				if (fp->fr_tcpfm & *t)					(void)putchar(*s);		}	}	if (fp->fr_flags & FR_KEEPSTATE)		printf(" keep state");	if (fp->fr_flags & FR_KEEPFRAG)		printf(" keep frags");	(void)putchar('\n');}