diff options
author | Darren Reed <darrenr@FreeBSD.org> | 1997-04-03 10:22:02 +0000 |
---|---|---|
committer | Darren Reed <darrenr@FreeBSD.org> | 1997-04-03 10:22:02 +0000 |
commit | 5a1a935563263ad6eabdbbfadd6aca9b6585c704 (patch) | |
tree | f687cfed6c59d74a7c81b967eb3caf8a9c5f184e /contrib/ipfilter/ipft_hx.c | |
parent | b182e52bf6b074c57140cca8cf3a1c812cb195b1 (diff) | |
download | src-5a1a935563263ad6eabdbbfadd6aca9b6585c704.tar.gz src-5a1a935563263ad6eabdbbfadd6aca9b6585c704.zip |
Import IP Filter version 3.2alpha4 to bring in working LKM for 2.2vendor/ipfilter/3.2a4
Notes
Notes:
svn path=/vendor/ipfilter/dist/; revision=24583
svn path=/vendor/ipfilter/3.2a4/; revision=24585; tag=vendor/ipfilter/3.2a4
Diffstat (limited to 'contrib/ipfilter/ipft_hx.c')
-rw-r--r-- | contrib/ipfilter/ipft_hx.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/contrib/ipfilter/ipft_hx.c b/contrib/ipfilter/ipft_hx.c index 26dbc83d15a4..e57eedae7d5c 100644 --- a/contrib/ipfilter/ipft_hx.c +++ b/contrib/ipfilter/ipft_hx.c @@ -38,15 +38,15 @@ #if !defined(lint) && defined(LIBC_SCCS) static char sccsid[] = "@(#)ipft_hx.c 1.1 3/9/96 (C) 1996 Darren Reed"; -static char rcsid[] = "$Id: ipft_hx.c,v 2.0.1.2 1997/02/04 13:57:56 darrenr Exp $"; +static char rcsid[] = "$Id: ipft_hx.c,v 2.0.2.3 1997/03/10 08:10:25 darrenr Exp $"; #endif extern int opts; -extern u_short portnum(); -extern u_long buildopts(); -static int hex_open(), hex_close(), hex_readip(); -static char *readhex(); +static int hex_open __P((char *)); +static int hex_close __P((void)); +static int hex_readip __P((char *, int, char **, int *)); +static char *readhex __P((char *, char *)); struct ipread iphex = { hex_open, hex_close, hex_readip }; static FILE *tfp = NULL; @@ -85,7 +85,7 @@ static int hex_readip(buf, cnt, ifn, dir) char *buf, **ifn; int cnt, *dir; { - register char *s; + register char *s, *t, *u; struct ip *ip; char line[513]; @@ -104,7 +104,30 @@ int cnt, *dir; printf("input: %s\n", line); fflush(stdout); } - ip = (struct ip *)readhex(line, (char *)ip); + + /* + * interpret start of line as possibly "[ifname]" or + * "[in/out,ifname]". + */ + *ifn = NULL; + *dir = 0; + if ((*buf == '[') && (s = index(line, ']'))) { + t = buf + 1; + if (t - s > 0) { + if ((u = index(t, ',')) && (u < s)) { + u++; + *ifn = u; + if (*t == 'i') + *dir = 0; + else if (*t == 'o') + *dir = 1; + } else + *ifn = t; + *s++ = '\0'; + } + } else + s = line; + ip = (struct ip *)readhex(s, (char *)ip); } return -1; } |