diff options
author | Peter Wemm <peter@FreeBSD.org> | 1997-11-16 04:52:19 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1997-11-16 04:52:19 +0000 |
commit | af5dd3181a44c8c60d82fe2f4f8ff9ff81d98e26 (patch) | |
tree | 1abde20e1d717a2bf3509de2189cbe7fa3c9f91e /contrib/ipfilter/ipft_hx.c | |
parent | acdb2ce24a62f8b955af761b992ae020cc2303ef (diff) | |
download | src-af5dd3181a44c8c60d82fe2f4f8ff9ff81d98e26.tar.gz src-af5dd3181a44c8c60d82fe2f4f8ff9ff81d98e26.zip |
Import ipfilter 3.2.1 (update from 3.1.8)
Notes
Notes:
svn path=/vendor/ipfilter/dist/; revision=31183
Diffstat (limited to 'contrib/ipfilter/ipft_hx.c')
-rw-r--r-- | contrib/ipfilter/ipft_hx.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/contrib/ipfilter/ipft_hx.c b/contrib/ipfilter/ipft_hx.c index 30b3d6d93959..c7fcd92f872b 100644 --- a/contrib/ipfilter/ipft_hx.c +++ b/contrib/ipfilter/ipft_hx.c @@ -1,5 +1,5 @@ /* - * (C)opyright 1995 by Darren Reed. + * Copyright (C) 1995-1997 by Darren Reed. * * Redistribution and use in source and binary forms are permitted * provided that this notice is preserved and due credit is given @@ -9,12 +9,12 @@ #include <ctype.h> #include <assert.h> #include <string.h> +#include <sys/types.h> #if !defined(__SVR4) && !defined(__svr4__) #include <strings.h> #else #include <sys/byteorder.h> #endif -#include <sys/types.h> #include <sys/param.h> #include <sys/time.h> #include <stdlib.h> @@ -24,23 +24,25 @@ #include <sys/ioctl.h> #include <netinet/in.h> #include <netinet/in_systm.h> +#ifndef linux #include <netinet/ip_var.h> +#endif #include <netinet/ip.h> #include <netinet/udp.h> #include <netinet/tcp.h> #include <netinet/ip_icmp.h> -#include <netinet/tcpip.h> #include <net/if.h> #include <netdb.h> #include <arpa/nameser.h> #include <resolv.h> #include "ip_compat.h" +#include <netinet/tcpip.h> #include "ipf.h" #include "ipt.h" -#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.2.4 1997/04/30 13:55:07 darrenr Exp $"; +#if !defined(lint) +static const char sccsid[] = "@(#)ipft_hx.c 1.1 3/9/96 (C) 1996 Darren Reed"; +static const char rcsid[] = "@(#)$Id: ipft_hx.c,v 2.0.2.8.2.1 1997/11/12 10:56:07 darrenr Exp $"; #endif extern int opts; @@ -88,10 +90,10 @@ char *buf, **ifn; int cnt, *dir; { register char *s, *t, *u; - struct ip *ip; char line[513]; + ip_t *ip; - ip = (struct ip *)buf; + ip = (ip_t *)buf; while (fgets(line, sizeof(line)-1, tfp)) { if ((s = index(line, '\n'))) { if (s == line) @@ -111,25 +113,30 @@ int cnt, *dir; * interpret start of line as possibly "[ifname]" or * "[in/out,ifname]". */ - *ifn = NULL; - *dir = 0; + if (ifn) + *ifn = NULL; + if (dir) + *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 + if (ifn) + *ifn = u; + if (dir) { + if (*t == 'i') + *dir = 0; + else if (*t == 'o') + *dir = 1; + } + } else if (ifn) *ifn = t; *s++ = '\0'; } } else s = line; - ip = (struct ip *)readhex(s, (char *)ip); + ip = (ip_t *)readhex(s, (char *)ip); } return -1; } |