printtunable.c revision 170268
1/* $FreeBSD: head/contrib/ipfilter/lib/printtunable.c 170268 2007-06-04 02:54:36Z darrenr $ */ 2 3/* 4 * Copyright (C) 2003 by Darren Reed. 5 * 6 * See the IPFILTER.LICENCE file for details on licencing. 7 * 8 * $Id: printtunable.c,v 1.1.4.1 2006/06/16 17:21:15 darrenr Exp $ 9 */ 10 11#include "ipf.h" 12 13void printtunable(tup) 14ipftune_t *tup; 15{ 16 printf("%s\tmin %#lx\tmax %#lx\tcurrent ", 17 tup->ipft_name, tup->ipft_min, tup->ipft_max); 18 if (tup->ipft_sz == sizeof(u_long)) 19 printf("%lu\n", tup->ipft_vlong); 20 else if (tup->ipft_sz == sizeof(u_int)) 21 printf("%u\n", tup->ipft_vint); 22 else if (tup->ipft_sz == sizeof(u_short)) 23 printf("%hu\n", tup->ipft_vshort); 24 else if (tup->ipft_sz == sizeof(u_char)) 25 printf("%u\n", (u_int)tup->ipft_vchar); 26 else { 27 printf("sz = %d\n", tup->ipft_sz); 28 } 29} 30