blob: 304b902a00e5d9be53957183cf311f01efdf858f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
/*
* 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;
}
|