xref: /titanic_50/usr/src/cmd/ipf/lib/common/optprintv6.c (revision 9acbbeaf2a1ffe5c14b244867d427714fab43c5c)
1 /*
2  * Copyright (C) 1993-2001 by Darren Reed.
3  *
4  * See the IPFILTER.LICENCE file for details on licencing.
5  *
6  * $Id: optprintv6.c,v 1.2 2003/04/30 00:39:39 darrenr Exp $
7  */
8 
9 
10 #include "ipf.h"
11 
12 
13 #ifdef	USE_INET6
14 
15 void optprintv6(sec, optmsk, optbits)
16 u_short *sec;
17 u_long optmsk, optbits;
18 {
19 	u_short secmsk = sec[0], secbits = sec[1];
20 	struct ipopt_names *io;
21 	char *s;
22 
23 	s = " v6hdrs ";
24 	for (io = v6ionames; io->on_name; io++)
25 		if ((io->on_bit & optmsk) &&
26 		    ((io->on_bit & optmsk) == (io->on_bit & optbits))) {
27 			printf("%s%s", s, io->on_name);
28 			s = ",";
29 		}
30 
31 	if ((optmsk && (optmsk != optbits)) ||
32 	    (secmsk && (secmsk != secbits))) {
33 		s = " ";
34 		printf(" not v6hdrs");
35 		if (optmsk != optbits) {
36 			for (io = v6ionames; io->on_name; io++)
37 				if ((io->on_bit & optmsk) &&
38 				    ((io->on_bit & optmsk) !=
39 				     (io->on_bit & optbits))) {
40 					printf("%s%s", s, io->on_name);
41 					s = ",";
42 				}
43 		}
44 
45 	}
46 }
47 #endif
48