xref: /freebsd/sbin/ipf/libipf/printtunable.c (revision 4d846d26)
1 /*	$FreeBSD$	*/
2 
3 /*
4  * Copyright (C) 2012 by Darren Reed.
5  *
6  * See the IPFILTER.LICENCE file for details on licencing.
7  *
8  * $Id$
9  */
10 
11 #include "ipf.h"
12 
13 void
14 printtunable(ipftune_t *tup)
15 {
16 	PRINTF("%s\tmin %lu\tmax %lu\tcurrent ",
17 		tup->ipft_name, tup->ipft_min, tup->ipft_max);
18 	if (tup->ipft_sz == sizeof(u_long))
19 		PRINTF("%lu\n", tup->ipft_vlong);
20 	else if (tup->ipft_sz == sizeof(u_int))
21 		PRINTF("%u\n", tup->ipft_vint);
22 	else if (tup->ipft_sz == sizeof(u_short))
23 		PRINTF("%hu\n", tup->ipft_vshort);
24 	else if (tup->ipft_sz == sizeof(u_char))
25 		PRINTF("%u\n", (u_int)tup->ipft_vchar);
26 	else {
27 		PRINTF("sz = %d\n", tup->ipft_sz);
28 	}
29 }
30