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