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