xref: /illumos-gate/usr/src/cmd/ipf/lib/printtunable.c (revision f3ac6781)
1ab25eeb5Syz /*
2ab25eeb5Syz  * Copyright (C) 1993-2005  by Darren Reed.
3ab25eeb5Syz  * See the IPFILTER.LICENCE file for details on licencing.
455fea89dSDan Cross  */
5ab25eeb5Syz 
6ab25eeb5Syz #include "ipf.h"
7ab25eeb5Syz 
printtunable(tup)8ab25eeb5Syz void printtunable(tup)
9ab25eeb5Syz ipftune_t *tup;
10ab25eeb5Syz {
11ab25eeb5Syz 	printf("%s\tmin %#lx\tmax %#lx\tcurrent ",
12ab25eeb5Syz 		tup->ipft_name, tup->ipft_min, tup->ipft_max);
13ab25eeb5Syz 	if (tup->ipft_sz == sizeof(u_long))
14ab25eeb5Syz 		printf("%lu\n", tup->ipft_vlong);
15ab25eeb5Syz 	else if (tup->ipft_sz == sizeof(u_int))
16ab25eeb5Syz 		printf("%u\n", tup->ipft_vint);
17ab25eeb5Syz 	else if (tup->ipft_sz == sizeof(u_short))
18ab25eeb5Syz 		printf("%hu\n", tup->ipft_vshort);
19ab25eeb5Syz 	else if (tup->ipft_sz == sizeof(u_char))
20ab25eeb5Syz 		printf("%u\n", (u_int)tup->ipft_vchar);
21ab25eeb5Syz 	else {
22ab25eeb5Syz 		printf("sz = %d\n", tup->ipft_sz);
23ab25eeb5Syz 	}
24ab25eeb5Syz }
25