xref: /onnv-gate/usr/src/cmd/ipf/lib/common/printlookup.c (revision 7176:101cc5da1498)
1*7176Syx160601 /*
2*7176Syx160601  * Copyright (C) 2005 by Darren Reed.
3*7176Syx160601  *
4*7176Syx160601  * See the IPFILTER.LICENCE file for details on licencing.
5*7176Syx160601  *
6*7176Syx160601  */
7*7176Syx160601 
8*7176Syx160601 #pragma ident	"%Z%%M%	%I%	%E% SMI"
9*7176Syx160601 
10*7176Syx160601 #include "ipf.h"
11*7176Syx160601 
12*7176Syx160601 
printlookup(addr,mask)13*7176Syx160601 void printlookup(addr, mask)
14*7176Syx160601 	i6addr_t *addr, *mask;
15*7176Syx160601 {
16*7176Syx160601 	switch (addr->iplookuptype)
17*7176Syx160601 	{
18*7176Syx160601 	case IPLT_POOL :
19*7176Syx160601 		printf("pool/");
20*7176Syx160601 		break;
21*7176Syx160601 	case IPLT_HASH :
22*7176Syx160601 		printf("hash/");
23*7176Syx160601 		break;
24*7176Syx160601 	default :
25*7176Syx160601 		printf("lookup(%x)=", addr->iplookuptype);
26*7176Syx160601 		break;
27*7176Syx160601 	}
28*7176Syx160601 
29*7176Syx160601 	printf("%u", addr->iplookupnum);
30*7176Syx160601 	if (opts & OPT_UNDEF) {
31*7176Syx160601 		if (mask->iplookupptr == NULL)
32*7176Syx160601 			printf("(!)");
33*7176Syx160601 	}
34*7176Syx160601 }
35