dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / ipf / lib / common / printproto.c
blobe969ad02b135fdfd8963f81b19cfaa77fc145887
1 /*
2 * Copyright (C) 1993-2005 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
5 */
7 #include "ipf.h"
10 static const char rcsid[] = "@(#)$Id: printproto.c,v 1.1.2.1 2005/06/12 07:21:53 darrenr Exp $";
13 void printproto(pr, p, np)
14 struct protoent *pr;
15 int p;
16 ipnat_t *np;
18 if (np != NULL) {
19 if ((np->in_flags & IPN_TCPUDP) == IPN_TCPUDP)
20 printf("tcp/udp");
21 else if (np->in_flags & IPN_TCP)
22 printf("tcp");
23 else if (np->in_flags & IPN_UDP)
24 printf("udp");
25 else if (np->in_flags & IPN_ICMPQUERY)
26 printf("icmp");
27 #ifdef _AIX51
29 * To make up for "ip = 252" and "hopopt = 0" in /etc/protocols
31 else if (np->in_p == 0)
32 printf("ip");
33 #endif
34 else if (pr != NULL)
35 printf("%s", pr->p_name);
36 else
37 printf("%d", np->in_p);
38 } else {
39 #ifdef _AIX51
40 if (p == 0)
41 printf("ip");
42 else
43 #endif
44 if (pr != NULL)
45 printf("%s", pr->p_name);
46 else
47 printf("%d", p);