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