2 * Copyright (C) 1993-2001 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * $Id: extras.c,v 1.12 2002/07/13 12:06:49 darrenr Exp $
13 * deal with extra bits on end of the line
15 int extras(cp
, fr
, linenum
)
32 if (!strcasecmp(**cp
, "not") || !strcasecmp(**cp
, "no")) {
36 } else if (!strncasecmp(**cp
, "ipopt", 5)) {
38 fr
->fr_flx
|= FI_OPTIONS
;
39 fr
->fr_mflx
|= FI_OPTIONS
;
41 } else if (!strcasecmp(**cp
, "lowttl")) {
43 fr
->fr_flx
|= FI_LOWTTL
;
44 fr
->fr_mflx
|= FI_LOWTTL
;
46 } else if (!strcasecmp(**cp
, "bad-src")) {
48 fr
->fr_flx
|= FI_BADSRC
;
49 fr
->fr_mflx
|= FI_BADSRC
;
51 } else if (!strncasecmp(**cp
, "mbcast", 6)) {
53 fr
->fr_flx
|= FI_MBCAST
;
54 fr
->fr_mflx
|= FI_MBCAST
;
56 } else if (!strncasecmp(**cp
, "nat", 3)) {
58 fr
->fr_flx
|= FI_NATED
;
59 fr
->fr_mflx
|= FI_NATED
;
61 } else if (!strncasecmp(**cp
, "frag", 4)) {
63 fr
->fr_flx
|= FI_FRAG
;
64 fr
->fr_mflx
|= FI_FRAG
;
66 } else if (!strncasecmp(**cp
, "opt", 3)) {
68 fprintf(stderr
, "%d: opt missing arguements\n",
73 if (!(opts
= optname(cp
, &secmsk
, linenum
)))
78 fr
->fr_optmask
|= opts
;
80 fr
->fr_optmask
|= (opts
& ~0x0100);
81 fr
->fr_secmask
|= secmsk
;
83 fr
->fr_secbits
&= ~secmsk
;
84 fr
->fr_optbits
&= ~opts
;
86 fr
->fr_optmask
|= opts
;
87 fr
->fr_secmask
|= secmsk
;
88 fr
->fr_optbits
|= opts
;
89 fr
->fr_secbits
|= secmsk
;
91 } else if (!strncasecmp(**cp
, "short", 5)) {
94 "%d: short cannot be used with TCP flags\n",
100 fr
->fr_flx
|= FI_SHORT
;
101 fr
->fr_mflx
|= FI_SHORT
;