summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/lib/extras.c
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2013-07-19 05:41:57 +0000
committercy <cy@FreeBSD.org>2013-07-19 05:41:57 +0000
commit672af8808c0e7c15f330b401482f9271c2eb3fa6 (patch)
tree225b5acf68c01bc6a260b386c2b2dbf4fa2839e3 /contrib/ipfilter/lib/extras.c
parent71e82d94e82560b20789833f60056506de34de8b (diff)
downloadFreeBSD-src-672af8808c0e7c15f330b401482f9271c2eb3fa6.zip
FreeBSD-src-672af8808c0e7c15f330b401482f9271c2eb3fa6.tar.gz
As per the developers handbook (5.3.1 step 1), prepare the vendor trees for
import of new ipfilter vendor sources by flattening them. To keep the tags consistent with dist, the tags are also flattened. Approved by: glebius (Mentor)
Diffstat (limited to 'contrib/ipfilter/lib/extras.c')
-rw-r--r--contrib/ipfilter/lib/extras.c112
1 files changed, 0 insertions, 112 deletions
diff --git a/contrib/ipfilter/lib/extras.c b/contrib/ipfilter/lib/extras.c
deleted file mode 100644
index 9087ca6..0000000
--- a/contrib/ipfilter/lib/extras.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 1993-2001 by Darren Reed.
- *
- * See the IPFILTER.LICENCE file for details on licencing.
- *
- * $Id: extras.c,v 1.12 2002/07/13 12:06:49 darrenr Exp $
- */
-
-#include "ipf.h"
-
-
-/*
- * deal with extra bits on end of the line
- */
-int extras(cp, fr, linenum)
-char ***cp;
-struct frentry *fr;
-int linenum;
-{
- u_short secmsk;
- u_long opts;
- int notopt;
-
- opts = 0;
- secmsk = 0;
- notopt = 0;
- (*cp)++;
- if (!**cp)
- return -1;
-
- while (**cp) {
- if (!strcasecmp(**cp, "not") || !strcasecmp(**cp, "no")) {
- notopt = 1;
- (*cp)++;
- continue;
- } else if (!strncasecmp(**cp, "ipopt", 5)) {
- if (!notopt)
- fr->fr_flx |= FI_OPTIONS;
- fr->fr_mflx |= FI_OPTIONS;
- goto nextopt;
- } else if (!strcasecmp(**cp, "lowttl")) {
- if (!notopt)
- fr->fr_flx |= FI_LOWTTL;
- fr->fr_mflx |= FI_LOWTTL;
- goto nextopt;
- } else if (!strcasecmp(**cp, "bad-src")) {
- if (!notopt)
- fr->fr_flx |= FI_BADSRC;
- fr->fr_mflx |= FI_BADSRC;
- goto nextopt;
- } else if (!strncasecmp(**cp, "mbcast", 6)) {
- if (!notopt)
- fr->fr_flx |= FI_MBCAST;
- fr->fr_mflx |= FI_MBCAST;
- goto nextopt;
- } else if (!strncasecmp(**cp, "nat", 3)) {
- if (!notopt)
- fr->fr_flx |= FI_NATED;
- fr->fr_mflx |= FI_NATED;
- goto nextopt;
- } else if (!strncasecmp(**cp, "frag", 4)) {
- if (!notopt)
- fr->fr_flx |= FI_FRAG;
- fr->fr_mflx |= FI_FRAG;
- goto nextopt;
- } else if (!strncasecmp(**cp, "opt", 3)) {
- if (!*(*cp + 1)) {
- fprintf(stderr, "%d: opt missing arguements\n",
- linenum);
- return -1;
- }
- (*cp)++;
- if (!(opts = optname(cp, &secmsk, linenum)))
- return -1;
-
- if (notopt) {
- if (!secmsk) {
- fr->fr_optmask |= opts;
- } else {
- fr->fr_optmask |= (opts & ~0x0100);
- fr->fr_secmask |= secmsk;
- }
- fr->fr_secbits &= ~secmsk;
- fr->fr_optbits &= ~opts;
- } else {
- fr->fr_optmask |= opts;
- fr->fr_secmask |= secmsk;
- fr->fr_optbits |= opts;
- fr->fr_secbits |= secmsk;
- }
- } else if (!strncasecmp(**cp, "short", 5)) {
- if (fr->fr_tcpf) {
- fprintf(stderr,
- "%d: short cannot be used with TCP flags\n",
- linenum);
- return -1;
- }
-
- if (!notopt)
- fr->fr_flx |= FI_SHORT;
- fr->fr_mflx |= FI_SHORT;
- goto nextopt;
- } else
- return -1;
-nextopt:
- notopt = 0;
- opts = 0;
- secmsk = 0;
- (*cp)++;
- }
- return 0;
-}
OpenPOWER on IntegriCloud