]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ipfilter/lib/printtunable.c
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ipfilter / lib / printtunable.c
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(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 }