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