freebsd-src/sbin/ipf/libipf/printtunable.c
Cy Schubert 9ff592d868 ipflter: ANSIfy userland function declarations
Convert ipfilter userland function declarations from K&R to ANSI. This
syncs our function declarations with NetBSD hg commit 75edcd7552a0
(apply our changes). Though not copied from NetBSD, this change was
partially inspired by NetBSD's work and inspired by style(9).

Reviewed by:		glebius (for #network)
Differential Revision:	https://reviews.freebsd.org/D33595

(cherry picked from commit efeb8bffe3)
2022-02-07 05:51:15 -08:00

30 lines
643 B
C

/* $FreeBSD$ */
/*
* Copyright (C) 2012 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* $Id$
*/
#include "ipf.h"
void
printtunable(ipftune_t *tup)
{
PRINTF("%s\tmin %lu\tmax %lu\tcurrent ",
tup->ipft_name, tup->ipft_min, tup->ipft_max);
if (tup->ipft_sz == sizeof(u_long))
PRINTF("%lu\n", tup->ipft_vlong);
else if (tup->ipft_sz == sizeof(u_int))
PRINTF("%u\n", tup->ipft_vint);
else if (tup->ipft_sz == sizeof(u_short))
PRINTF("%hu\n", tup->ipft_vshort);
else if (tup->ipft_sz == sizeof(u_char))
PRINTF("%u\n", (u_int)tup->ipft_vchar);
else {
PRINTF("sz = %d\n", tup->ipft_sz);
}
}