4 * Copyright (C) 2005 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
13 static const char rcsid
[] = "@(#)Id: printproto.c,v 1.1.2.3 2007/10/27 16:03:39 darrenr Exp";
17 void printproto(pr
, p
, np
)
23 if ((np
->in_flags
& IPN_TCPUDP
) == IPN_TCPUDP
)
25 else if (np
->in_flags
& IPN_TCP
)
27 else if (np
->in_flags
& IPN_UDP
)
29 else if (np
->in_flags
& IPN_ICMPQUERY
)
33 * To make up for "ip = 252" and "hopopt = 0" in /etc/protocols
34 * The IANA has doubled up on the definition of 0 - it is now
35 * also used for IPv6 hop-opts, so we can no longer rely on
36 * /etc/protocols providing the correct name->number mapping
39 else if (np
->in_p
== 0)
42 printf("%s", pr
->p_name
);
44 printf("%d", np
->in_p
);
52 printf("%s", pr
->p_name
);