freebsd-dev/sbin/ipf/libipf/icmptypename.c
Cy Schubert 2582ae5740 ipfilter: Adjust userland returns to conform to style(9)
Adjust ipfilter's userland return statements to conform to style(9).

MFC after:	1 month
2022-01-03 18:06:43 -08:00

29 lines
488 B
C

/*
* Copyright (C) 2012 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* $Id$
*/
#include "ipf.h"
char *
icmptypename(int family, int type)
{
icmptype_t *i;
if ((type < 0) || (type > 255))
return(NULL);
for (i = icmptypelist; i->it_name != NULL; i++) {
if ((family == AF_INET) && (i->it_v4 == type))
return(i->it_name);
#ifdef USE_INET6
if ((family == AF_INET6) && (i->it_v6 == type))
return(i->it_name);
#endif
}
return(NULL);
}