1 /* $NetBSD: printtunable.c,v 1.2 2012/07/22 14:27:37 darrenr Exp $ */
2
3 /*
4 * Copyright (C) 2012 by Darren Reed.
5 *
6 * See the IPFILTER.LICENCE file for details on licencing.
7 *
8 * Id: printtunable.c,v 1.1.1.2 2012/07/22 13:44:42 darrenr Exp $
9 */
10
11 #include "ipf.h"
12
13 void
printtunable(tup)14 printtunable(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