1/*	$FreeBSD: releng/10.2/contrib/ipfilter/lib/printtunable.c 255332 2013-09-06 23:11:19Z cy $	*/
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
13void
14printtunable(tup)
15	ipftune_t *tup;
16{
17	PRINTF("%s\tmin %lu\tmax %lu\tcurrent ",
18		tup->ipft_name, tup->ipft_min, tup->ipft_max);
19	if (tup->ipft_sz == sizeof(u_long))
20		PRINTF("%lu\n", tup->ipft_vlong);
21	else if (tup->ipft_sz == sizeof(u_int))
22		PRINTF("%u\n", tup->ipft_vint);
23	else if (tup->ipft_sz == sizeof(u_short))
24		PRINTF("%hu\n", tup->ipft_vshort);
25	else if (tup->ipft_sz == sizeof(u_char))
26		PRINTF("%u\n", (u_int)tup->ipft_vchar);
27	else {
28		PRINTF("sz = %d\n", tup->ipft_sz);
29	}
30}
31