2 * Copyright (C) 1993-2001 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * $Id: optprint.c,v 1.6 2002/07/13 15:59:49 darrenr Exp $
11 void optprint(sec
, optmsk
, optbits
)
13 u_long optmsk
, optbits
;
15 u_short secmsk
= sec
[0], secbits
= sec
[1];
16 struct ipopt_names
*io
, *so
;
20 for (io
= ionames
; io
->on_name
; io
++)
21 if ((io
->on_bit
& optmsk
) &&
22 ((io
->on_bit
& optmsk
) == (io
->on_bit
& optbits
))) {
23 if ((io
->on_value
!= IPOPT_SECURITY
) ||
24 (!secmsk
&& !secbits
)) {
25 printf("%s%s", s
, io
->on_name
);
26 if (io
->on_value
== IPOPT_SECURITY
)
33 if (secmsk
& secbits
) {
34 printf("%ssec-class", s
);
36 for (so
= secclass
; so
->on_name
; so
++)
37 if ((secmsk
& so
->on_bit
) &&
38 ((so
->on_bit
& secmsk
) == (so
->on_bit
& secbits
))) {
39 printf("%s%s", s
, so
->on_name
);
44 if ((optmsk
&& (optmsk
!= optbits
)) ||
45 (secmsk
&& (secmsk
!= secbits
))) {
48 if (optmsk
!= optbits
) {
49 for (io
= ionames
; io
->on_name
; io
++)
50 if ((io
->on_bit
& optmsk
) &&
51 ((io
->on_bit
& optmsk
) !=
52 (io
->on_bit
& optbits
))) {
53 if ((io
->on_value
!= IPOPT_SECURITY
) ||
54 (!secmsk
&& !secbits
)) {
55 printf("%s%s", s
, io
->on_name
);
65 if (secmsk
!= secbits
) {
66 printf("%ssec-class", s
);
68 for (so
= secclass
; so
->on_name
; so
++)
69 if ((so
->on_bit
& secmsk
) &&
70 ((so
->on_bit
& secmsk
) !=
71 (so
->on_bit
& secbits
))) {
72 printf("%s%s", s
, so
->on_name
);