Resolve conflicts (and believe me...you don't want to know).

This commit is contained in:
guido 2005-12-30 11:52:26 +00:00
parent 3cc29e6ebf
commit 7ee0924750
126 changed files with 427 additions and 255 deletions

View File

@ -193,6 +193,15 @@ freebsd5: include
else \
echo "#define INET6" > opt_inet6.h; \
fi
if [ "x$(IPFBPF)" = "x" ] ; then \
echo "#undef NBPF" > opt_bpf.h; \
echo "#undef NBPFILTER" > opt_bpf.h; \
echo "#undef DEV_BPF" > opt_bpf.h; \
else \
echo "#define NBPF" > opt_bpf.h; \
echo "#define NBPFILTER" > opt_bpf.h; \
echo "#define DEV_BPF" > opt_bpf.h; \
fi
if [ x$(ENABLE_PFIL) = x ] ; then \
echo "#undef PFIL_HOOKS" > opt_pfil.h; \
else \
@ -238,6 +247,11 @@ osf tru64: null include
(cd OSF/`OSF/cpurev`; make build TRU64=`uname -v` TOP=../.. "DEBUG=-g" $(MFLAGS) "MACHASSERT=$(MACHASSERT)" "OSREV=`../cpurev`"; cd ..)
(cd OSF/`OSF/cpurev`; make -f Makefile.ipsend build TRU64=`uname -v` TOP=../.. $(MFLAGS) "OSREV=`../cpurev`"; cd ..)
aix: null include
make setup "TARGOS=AIX" "CPUDIR=`AIX/cpurev`"
(cd AIX/`AIX/cpurev`; make build AIX=`uname -v` TOP=../.. "DEBUG=-g" $(MFLAGS) "OSREV=`../cpurev`" BITS=`../bootbits.sh`; cd ..)
# (cd AIX/`AIX/cpurev`; make -f Makefile.ipsend build AIX=`uname -v` TOP=../.. $(MFLAGS) "OSREV=`../cpurev`"; cd ..)
bsd: include
make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c" "MLR=mln_rule.o"; cd ..)
@ -278,6 +292,7 @@ clean: clean-include
(cd HPUX; $(MAKE) BITS=32 TOP=.. clean)
(cd Linux; $(MAKE) TOP=.. clean)
(cd OSF; $(MAKE) TOP=.. clean)
(cd AIX; $(MAKE) TOP=.. clean)
if [ "`uname -s`" = "IRIX" ]; then (cd IRIX; $(MAKE) clean); fi
[ -d test ] && (cd test; $(MAKE) clean)
(cd ipsend; $(MAKE) clean)
@ -296,6 +311,9 @@ clean-hpux: clean-include
clean-osf: clean-include
(cd OSF; make clean)
clean-aix: clean-include
(cd AIX; make clean)
clean-linux: clean-include
(cd Linux; make clean)
@ -348,6 +366,10 @@ install-sunos4: solaris
install-sunos5: solaris null
(cd SunOS5; $(MAKE) CPU=$(CPU) TOP=.. install)
install-aix:
(cd AIX/`AIX/cpurev`; make install "TOP=../.." $(MFLAGS); cd ..)
# (cd AIX/`AIX/cpurev`; make -f Makefile.ipsend INSTALL=$(INSTALL) install "TOP=../.." $(MFLAGS); cd ..)
install-hpux: hpux
(cd HPUX/`HPUX/cpurev`; $(MAKE) CPU=$(CPU) TOP=../.. "BITS=`getconf KERNEL_BITS`" install)
@ -356,7 +378,6 @@ install-irix: irix
install-osf install-tru64:
(cd OSF/`OSF/cpurev`; make install "TOP=../.." $(MFLAGS); cd ..)
(cd OSF/`OSF/cpurev`; make -f Makefile.ipsend INSTALL=$(INSTALL) install "TOP=../.." $(MFLAGS); cd ..)
do-cvs:
find . -type d -name CVS -print | xargs /bin/rm -rf
@ -379,3 +400,4 @@ mdb:
-DIPFILTER_SCAN -DIPFILTER_LKM -DSOLARIS2=10 -n ipf_mdb -k \
-I/home/dr146992/pfil -I/home/dr146992/ipf -f \
/usr/include/netinet/in_systm.h,/usr/include/sys/ethernet.h,/usr/include/netinet/in.h,/usr/include/netinet/ip.h,/usr/include/netinet/ip_var.h,/usr/include/netinet/tcp.h,/usr/include/netinet/tcpip.h,/usr/include/netinet/ip_icmp.h,/usr/include/netinet/udp.h,ip_compat.h,ip_fil.h,ip_nat.h,ip_state.h,ip_proxy.h,ip_scan.h

View File

@ -42,7 +42,7 @@
#if !(defined(lint) || defined(KERNEL) || defined(_KERNEL))
static const char rcsid[] =
"@(#) $Header: /devel/CVS/IP-Filter/bpf_filter.c,v 2.2 2003/08/19 16:49:58 darrenr Exp $ (LBL)";
"@(#) $Header: /devel/CVS/IP-Filter/bpf_filter.c,v 2.2.2.1 2005/06/18 02:41:30 darrenr Exp $ (LBL)";
#endif
#include <sys/param.h>

View File

@ -6,7 +6,7 @@
* See the IPFILTER.LICENCE file for details on licencing.
*
* @(#)ipf.h 1.12 6/5/96
* Id: ipf.h,v 2.71.2.6 2005/02/21 05:05:29 darrenr Exp
* $Id: ipf.h,v 2.71.2.7 2005/06/12 07:18:31 darrenr Exp $
*/
#ifndef __IPF_H__
@ -265,6 +265,7 @@ extern void printpacket6 __P((struct ip *));
extern struct ip_pool_s *printpool __P((struct ip_pool_s *, copyfunc_t,
char *, int));
extern struct ip_pool_node *printpoolnode __P((struct ip_pool_node *, int));
extern void printproto __P((struct protoent *, int, struct ipnat *));
extern void printportcmp __P((int, struct frpcmp *));
extern void optprint __P((u_short *, u_long, u_long));
#ifdef USE_INET6

View File

@ -6,7 +6,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: iplang_l.l,v 2.8 2003/07/28 01:15:31 darrenr Exp
* $Id: iplang_l.l,v 2.8 2003/07/28 01:15:31 darrenr Exp $
*/
#include <stdio.h>
#include <string.h>

View File

@ -1291,8 +1291,14 @@ void prep_packet()
if (ifp->if_fd == -1)
ifp->if_fd = initdevice(ifp->if_name, 5);
gwip = sending.snd_gw;
if (!gwip.s_addr)
if (!gwip.s_addr) {
if (aniphead == NULL) {
fprintf(stderr,
"no destination address defined for sending\n");
return;
}
gwip = aniphead->ah_ip->ip_dst;
}
(void) send_ip(ifp->if_fd, ifp->if_MTU, (ip_t *)ipbuffer, gwip, 2);
}

View File

@ -6,7 +6,7 @@
* See the IPFILTER.LICENCE file for details on licencing.
*
* @(#)ip_fil.h 1.35 6/5/96
* Id: ipmon.h,v 2.8 2003/07/25 22:16:20 darrenr Exp
* $Id: ipmon.h,v 2.8 2003/07/25 22:16:20 darrenr Exp $
*/

View File

@ -34,7 +34,7 @@
#ifndef lint
static const char sccsid[] = "@(#)ipsd.c 1.3 12/3/95 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: ipsd.c,v 2.2 2001/06/09 17:09:25 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipsd.c,v 2.2 2001/06/09 17:09:25 darrenr Exp $";
#endif
extern char *optarg;

View File

@ -35,7 +35,7 @@
#ifndef lint
static const char sccsid[] = "@(#)ipsdr.c 1.3 12/3/95 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: ipsdr.c,v 2.2 2001/06/09 17:09:25 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipsdr.c,v 2.2 2001/06/09 17:09:25 darrenr Exp $";
#endif
extern char *optarg;

View File

@ -7,11 +7,11 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)arp.c 1.4 1/11/96 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: arp.c,v 2.8 2003/12/01 02:01:15 darrenr Exp";
static const char rcsid[] = "@(#)$Id: arp.c,v 2.8.2.1 2005/06/12 07:18:38 darrenr Exp $";
#endif
#include <sys/types.h>
#include <sys/socket.h>
#if !defined(ultrix) && !defined(hpux) && !defined(__hpux) && !defined(__osf__)
#if !defined(ultrix) && !defined(hpux) && !defined(__hpux) && !defined(__osf__) && !defined(_AIX51)
#include <sys/sockio.h>
#endif
#include <sys/ioctl.h>

View File

@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "%W% %G% (C)1995";
static const char rcsid[] = "@(#)Id: ip.c,v 2.8.2.1 2004/10/19 12:31:48 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ip.c,v 2.8.2.1 2004/10/19 12:31:48 darrenr Exp $";
#endif
#include <sys/param.h>
#include <sys/types.h>

View File

@ -8,7 +8,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "%W% %G% (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: ipresend.c,v 2.4 2004/01/08 13:34:31 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipresend.c,v 2.4 2004/01/08 13:34:31 darrenr Exp $";
#endif
#include <sys/param.h>
#include <sys/types.h>

View File

@ -6,7 +6,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ipsend.c 1.5 12/10/95 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: ipsend.c,v 2.8.2.2 2004/11/13 16:50:10 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipsend.c,v 2.8.2.2 2004/11/13 16:50:10 darrenr Exp $";
#endif
#include <sys/param.h>
#include <sys/types.h>

View File

@ -8,7 +8,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ipsopt.c 1.2 1/11/96 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: ipsopt.c,v 2.4.4.1 2004/03/23 12:58:05 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipsopt.c,v 2.4.4.1 2004/03/23 12:58:05 darrenr Exp $";
#endif
#include <sys/param.h>
#include <sys/types.h>

View File

@ -8,7 +8,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "%W% %G% (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: iptest.c,v 2.6 2004/01/08 13:34:31 darrenr Exp";
static const char rcsid[] = "@(#)$Id: iptest.c,v 2.6 2004/01/08 13:34:31 darrenr Exp $";
#endif
#include <sys/param.h>
#include <sys/types.h>

View File

@ -8,7 +8,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "%W% %G% (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: iptests.c,v 2.8.2.3 2004/04/16 23:33:04 darrenr Exp";
static const char rcsid[] = "@(#)$Id: iptests.c,v 2.8.2.4 2005/06/12 07:18:39 darrenr Exp $";
#endif
#include <sys/param.h>
#include <sys/types.h>
@ -32,7 +32,7 @@ static const char rcsid[] = "@(#)Id: iptests.c,v 2.8.2.3 2004/04/16 23:33:04 dar
# include <sys/proc.h>
#endif
#if !defined(ultrix) && !defined(hpux) && !defined(linux) && \
!defined(__sgi) && !defined(__osf__)
!defined(__sgi) && !defined(__osf__) && !defined(_AIX51)
# include <kvm.h>
#endif
#ifndef ultrix

View File

@ -8,7 +8,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)larp.c 1.1 8/19/95 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: larp.c,v 2.4 2003/12/01 02:01:16 darrenr Exp";
static const char rcsid[] = "@(#)$Id: larp.c,v 2.4 2003/12/01 02:01:16 darrenr Exp $";
#endif
#include <sys/param.h>
#include <sys/types.h>

View File

@ -8,7 +8,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)lsock.c 1.2 1/11/96 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: lsock.c,v 2.3 2001/06/09 17:09:26 darrenr Exp";
static const char rcsid[] = "@(#)$Id: lsock.c,v 2.3 2001/06/09 17:09:26 darrenr Exp $";
#endif
#include <stdio.h>
#include <unistd.h>

View File

@ -8,7 +8,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)resend.c 1.3 1/11/96 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: resend.c,v 2.8 2004/01/08 13:34:31 darrenr Exp";
static const char rcsid[] = "@(#)$Id: resend.c,v 2.8 2004/01/08 13:34:31 darrenr Exp $";
#endif
#include <sys/param.h>
#include <sys/types.h>

View File

@ -45,7 +45,7 @@
#if !defined(lint)
static const char sccsid[] = "@(#)sbpf.c 1.3 8/25/95 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: sbpf.c,v 2.5 2002/02/24 07:30:03 darrenr Exp";
static const char rcsid[] = "@(#)$Id: sbpf.c,v 2.5 2002/02/24 07:30:03 darrenr Exp $";
#endif
/*

View File

@ -48,7 +48,7 @@
#if !defined(lint)
static const char sccsid[] = "@(#)sdlpi.c 1.3 10/30/95 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: sdlpi.c,v 2.8.2.1 2004/12/09 19:41:13 darrenr Exp";
static const char rcsid[] = "@(#)$Id: sdlpi.c,v 2.8.2.1 2004/12/09 19:41:13 darrenr Exp $";
#endif
#define CHUNKSIZE 8192

View File

@ -30,7 +30,7 @@
#if !defined(lint)
static const char sccsid[] = "@(#)slinux.c 1.2 8/25/95";
static const char rcsid[] = "@(#)Id: slinux.c,v 2.3 2001/06/09 17:09:26 darrenr Exp";
static const char rcsid[] = "@(#)$Id: slinux.c,v 2.3 2001/06/09 17:09:26 darrenr Exp $";
#endif
#define CHUNKSIZE 8192

View File

@ -41,7 +41,7 @@
#if !defined(lint)
static const char sccsid[] = "@(#)snit.c 1.5 1/11/96 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: snit.c,v 2.3 2001/06/09 17:09:26 darrenr Exp";
static const char rcsid[] = "@(#)$Id: snit.c,v 2.3 2001/06/09 17:09:26 darrenr Exp $";
#endif
#define CHUNKSIZE 8192

View File

@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)sock.c 1.2 1/11/96 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: sock.c,v 2.8.4.1 2004/03/23 12:58:06 darrenr Exp";
static const char rcsid[] = "@(#)$Id: sock.c,v 2.8.4.1 2004/03/23 12:58:06 darrenr Exp $";
#endif
#include <sys/param.h>
#include <sys/types.h>

View File

@ -29,7 +29,7 @@
* SUCH DAMAGE.
*
* @(#)tcpip.h 8.1 (Berkeley) 6/10/93
* Id: tcpip.h,v 2.2.2.3 2004/05/26 15:45:48 darrenr Exp
* $Id: tcpip.h,v 2.2.2.3 2004/05/26 15:45:48 darrenr Exp $
*/
#ifndef _NETINET_TCPIP_H_

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ipt.h,v 2.6 2003/02/16 02:33:09 darrenr Exp
* $Id: ipt.h,v 2.6 2003/02/16 02:33:09 darrenr Exp $
*/
#ifndef __IPT_H__

View File

@ -4,7 +4,7 @@
* Copyright (C) 1993-2001 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
* Id: kmem.h,v 2.5 2002/08/21 22:57:36 darrenr Exp
* $Id: kmem.h,v 2.5 2002/08/21 22:57:36 darrenr Exp $
*/
#ifndef __KMEM_H__

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: addicmp.c,v 1.10.2.1 2004/12/09 19:41:16 darrenr Exp
* $Id: addicmp.c,v 1.10.2.1 2004/12/09 19:41:16 darrenr Exp $
*/
#include <ctype.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: addipopt.c,v 1.7 2002/01/28 06:50:45 darrenr Exp
* $Id: addipopt.c,v 1.7 2002/01/28 06:50:45 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: addkeep.c,v 1.12 2003/12/01 01:59:42 darrenr Exp
* $Id: addkeep.c,v 1.12 2003/12/01 01:59:42 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: binprint.c,v 1.8 2002/05/14 15:18:56 darrenr Exp
* $Id: binprint.c,v 1.8 2002/05/14 15:18:56 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: buildopts.c,v 1.6 2002/01/28 06:50:45 darrenr Exp
* $Id: buildopts.c,v 1.6 2002/01/28 06:50:45 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: checkrev.c,v 1.12.2.1 2004/03/09 14:44:39 darrenr Exp
* $Id: checkrev.c,v 1.12.2.1 2004/03/09 14:44:39 darrenr Exp $
*/
#include <sys/ioctl.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: count4bits.c,v 1.1 2002/06/15 04:46:39 darrenr Exp
* $Id: count4bits.c,v 1.1 2002/06/15 04:46:39 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: count6bits.c,v 1.4 2001/06/09 17:09:23 darrenr Exp
* $Id: count6bits.c,v 1.4 2001/06/09 17:09:23 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: debug.c,v 1.6 2001/06/09 17:09:24 darrenr Exp
* $Id: debug.c,v 1.6 2001/06/09 17:09:24 darrenr Exp $
*/
#if defined(__STDC__)

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: extras.c,v 1.12 2002/07/13 12:06:49 darrenr Exp
* $Id: extras.c,v 1.12 2002/07/13 12:06:49 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: facpri.c,v 1.6 2003/12/01 01:59:43 darrenr Exp
* $Id: facpri.c,v 1.6.2.1 2005/11/14 17:45:06 darrenr Exp $
*/
#include <stdio.h>
@ -22,7 +22,7 @@
#include "facpri.h"
#if !defined(lint)
static const char rcsid[] = "@(#)Id: facpri.c,v 1.6 2003/12/01 01:59:43 darrenr Exp";
static const char rcsid[] = "@(#)$Id: facpri.c,v 1.6.2.1 2005/11/14 17:45:06 darrenr Exp $";
#endif
@ -42,10 +42,10 @@ table_t facs[] = {
#else
{ "cron", LOG_CRON1 },
#endif
#ifdef LOG_FTP
#ifdef LOG_FTP
{ "ftp", LOG_FTP },
#endif
#ifdef LOG_AUTHPRIV
#ifdef LOG_AUTHPRIV
{ "authpriv", LOG_AUTHPRIV },
#endif
#ifdef LOG_AUDIT

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: facpri.h,v 1.3 2001/06/09 17:19:50 darrenr Exp
* $Id: facpri.h,v 1.3 2001/06/09 17:19:50 darrenr Exp $
*/
#ifndef __FACPRI_H__

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: fill6bits.c,v 1.5 2002/03/27 15:09:57 darrenr Exp
* $Id: fill6bits.c,v 1.5 2002/03/27 15:09:57 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: flags.c,v 1.4 2002/11/02 07:16:36 darrenr Exp
* $Id: flags.c,v 1.4 2002/11/02 07:16:36 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: genmask.c,v 1.7 2003/11/11 13:40:15 darrenr Exp
* $Id: genmask.c,v 1.7 2003/11/11 13:40:15 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: getline.c,v 1.3 2001/06/09 17:09:24 darrenr Exp
* $Id: getline.c,v 1.3 2001/06/09 17:09:24 darrenr Exp $
*/
#include <stdio.h>

View File

@ -11,7 +11,7 @@
#include "kmem.h"
#if !defined(lint)
static const char rcsid[] = "@(#)Id: getnattype.c,v 1.3 2004/01/17 17:26:07 darrenr Exp";
static const char rcsid[] = "@(#)$Id: getnattype.c,v 1.3 2004/01/17 17:26:07 darrenr Exp $";
#endif

View File

@ -14,6 +14,14 @@ char *name;
if (*s == '\0')
return atoi(name);
#ifdef _AIX51
/*
* For some bogus reason, "ip" is 252 in /etc/protocols on AIX 5
*/
if (!strcasecmp(name, "ip"))
return 0;
#endif
p = getprotobyname(name);
if (p != NULL)
return p->p_proto;

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: hostmask.c,v 1.10 2002/01/28 06:50:46 darrenr Exp
* $Id: hostmask.c,v 1.10 2002/01/28 06:50:46 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: hostnum.c,v 1.10.2.1 2004/12/09 19:41:20 darrenr Exp
* $Id: hostnum.c,v 1.10.2.1 2004/12/09 19:41:20 darrenr Exp $
*/
#include <ctype.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: icmpcode.c,v 1.7.2.1 2004/12/09 19:41:20 darrenr Exp
* $Id: icmpcode.c,v 1.7.2.1 2004/12/09 19:41:20 darrenr Exp $
*/
#include <ctype.h>

View File

@ -57,7 +57,7 @@
#if !defined(lint)
static const char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
static const char rcsid[] = "@(#)Id: inet_addr.c,v 1.8.2.3 2004/12/09 19:41:20 darrenr Exp";
static const char rcsid[] = "@(#)$Id: inet_addr.c,v 1.8.2.3 2004/12/09 19:41:20 darrenr Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: initparse.c,v 1.6 2002/01/28 06:50:46 darrenr Exp
* $Id: initparse.c,v 1.6 2002/01/28 06:50:46 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ionames.c,v 1.7 2002/01/28 06:50:46 darrenr Exp
* $Id: ionames.c,v 1.7 2002/01/28 06:50:46 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ipft_ef.c,v 1.14 2004/01/08 13:34:31 darrenr Exp
* $Id: ipft_ef.c,v 1.14 2004/01/08 13:34:31 darrenr Exp $
*/
/*
@ -33,7 +33,7 @@ etherfind -n -t
#if !defined(lint)
static const char sccsid[] = "@(#)ipft_ef.c 1.6 2/4/96 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: ipft_ef.c,v 1.14 2004/01/08 13:34:31 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipft_ef.c,v 1.14 2004/01/08 13:34:31 darrenr Exp $";
#endif
static int etherf_open __P((char *));

View File

@ -7,7 +7,7 @@
*/
#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 1.11.4.1 2004/12/09 19:41:20 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipft_hx.c,v 1.11.4.3 2005/12/04 10:07:21 darrenr Exp $";
#endif
#include <ctype.h>
@ -83,7 +83,7 @@ int cnt, *dir;
*s = '\0';
if (!*line)
continue;
if (!(opts & OPT_BRIEF)) {
if ((opts & OPT_DEBUG) != 0) {
printf("input: %s", line);
}
@ -108,7 +108,7 @@ int cnt, *dir;
s = line;
t = (char *)ip;
ip = (ip_t *)readhex(s, (char *)ip);
if (!(opts & OPT_BRIEF)) {
if ((opts & OPT_DEBUG) != 0) {
if (opts & OPT_ASCII) {
if (t < (char *)ip)
putchar('\t');
@ -124,6 +124,8 @@ int cnt, *dir;
fflush(stdout);
}
}
if (feof(tfp))
return 0;
return -1;
}

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ipft_pc.c,v 1.10 2004/02/07 18:17:40 darrenr Exp
* $Id: ipft_pc.c,v 1.10.2.1 2005/12/04 09:55:10 darrenr Exp $
*/
#include "ipf.h"
#include "pcap-ipf.h"
@ -13,7 +13,7 @@
#include "ipt.h"
#if !defined(lint)
static const char rcsid[] = "@(#)Id: ipft_pc.c,v 1.10 2004/02/07 18:17:40 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipft_pc.c,v 1.10.2.1 2005/12/04 09:55:10 darrenr Exp $";
#endif
struct llc {
@ -162,10 +162,19 @@ static int pcap_close()
static int pcap_read_rec(rec)
struct pcap_pkthdr *rec;
{
int n, p;
int n, p, i;
char *s;
if (read(pfd, (char *)rec, sizeof(*rec)) != sizeof(*rec))
return -2;
s = (char *)rec;
n = sizeof(*rec);
while (n > 0) {
i = read(pfd, (char *)rec, sizeof(*rec));
if (i <= 0)
return -2;
s += i;
n -= i;
}
if (swapped) {
rec->ph_clen = SWAPLONG(rec->ph_clen);
@ -178,6 +187,8 @@ struct pcap_pkthdr *rec;
if (!n || n < 0)
return -3;
if (p < 0 || p > 65536)
return -4;
return p;
}
@ -224,7 +235,7 @@ int cnt, *dir;
struct pcap_pkthdr rec;
struct llc *l;
char *s, ty[4];
int i, n;
int i, j, n;
l = llcp;
@ -238,8 +249,14 @@ int cnt, *dir;
bufp = realloc(bufp, i);
s = bufp;
if (read(pfd, s, i) != i)
return -2;
for (j = i, n = 0; j > 0; ) {
n = read(pfd, s, j);
if (n <= 0)
return -2;
j -= n;
s += n;
}
s = bufp;
i -= l->lc_sz;
s += l->lc_to;

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ipft_sn.c,v 1.7 2003/02/16 02:32:36 darrenr Exp
* $Id: ipft_sn.c,v 1.7 2003/02/16 02:32:36 darrenr Exp $
*/
/*
@ -16,7 +16,7 @@
#include "ipt.h"
#if !defined(lint)
static const char rcsid[] = "@(#)Id: ipft_sn.c,v 1.7 2003/02/16 02:32:36 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipft_sn.c,v 1.7 2003/02/16 02:32:36 darrenr Exp $";
#endif
struct llc {

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ipft_td.c,v 1.15 2004/01/08 13:34:31 darrenr Exp
* $Id: ipft_td.c,v 1.15 2004/01/08 13:34:31 darrenr Exp $
*/
/*
@ -42,7 +42,7 @@ tcpdump -nqte
#if !defined(lint)
static const char sccsid[] = "@(#)ipft_td.c 1.8 2/4/96 (C)1995 Darren Reed";
static const char rcsid[] = "@(#)Id: ipft_td.c,v 1.15 2004/01/08 13:34:31 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipft_td.c,v 1.15 2004/01/08 13:34:31 darrenr Exp $";
#endif
static int tcpd_open __P((char *));

View File

@ -5,11 +5,11 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ipft_tx.c,v 1.15.2.2 2004/12/09 19:41:21 darrenr Exp
* $Id: ipft_tx.c,v 1.15.2.6 2005/12/04 10:07:22 darrenr Exp $
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ipft_tx.c 1.7 6/5/96 (C) 1993 Darren Reed";
static const char rcsid[] = "@(#)Id: ipft_tx.c,v 1.15.2.2 2004/12/09 19:41:21 darrenr Exp";
static const char rcsid[] = "@(#)$Id: ipft_tx.c,v 1.15.2.6 2005/12/04 10:07:22 darrenr Exp $";
#endif
#include <ctype.h>
@ -161,7 +161,7 @@ int cnt, *dir;
*s = '\0';
if (!*line)
continue;
if (!(opts & OPT_BRIEF))
if ((opts & OPT_DEBUG) != 0)
printf("input: %s\n", line);
*ifn = NULL;
*dir = 0;
@ -172,6 +172,8 @@ int cnt, *dir;
return sizeof(ip_t);
#endif
}
if (feof(tfp))
return 0;
return -1;
}
@ -297,15 +299,22 @@ int *out;
char **s, *t;
int i;
t = strchr(*cpp, ',');
if (t != NULL)
*t = '\0';
for (s = tx_icmptypes, i = 0; !*s || strcmp(*s, "END");
s++, i++)
if (*s && !strncasecmp(*cpp, *s, strlen(*s))) {
s++, i++) {
if (*s && !strcasecmp(*cpp, *s)) {
ic->icmp_type = i;
if ((t = strchr(*cpp, ',')))
ic->icmp_code = atoi(t+1);
if (t != NULL)
ic->icmp_code = atoi(t + 1);
cpp++;
break;
}
}
if (t != NULL)
*t = ',';
}
if (*cpp && !strcasecmp(*cpp, "opt")) {

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ipoptsec.c,v 1.2 2002/01/28 06:50:46 darrenr Exp
* $Id: ipoptsec.c,v 1.2 2002/01/28 06:50:46 darrenr Exp $
*/
#include "ipf.h"

View File

@ -18,7 +18,7 @@
#include <string.h>
#include <fcntl.h>
#include <sys/file.h>
#if !defined(__sgi) && !defined(__hpux) && !defined(__osf__) && !defined(linux)
#if !defined(__sgi) && !defined(__hpux) && !defined(__osf__) && !defined(linux) && !defined(_AIX51)
#include <kvm.h>
#endif
#include <fcntl.h>
@ -44,12 +44,13 @@
#if !defined(lint)
static const char sccsid[] = "@(#)kmem.c 1.4 1/12/96 (C) 1992 Darren Reed";
static const char rcsid[] = "@(#)Id: kmem.c,v 1.16.2.1 2004/06/20 10:25:58 darrenr Exp";
static const char rcsid[] = "@(#)$Id: kmem.c,v 1.16.2.2 2005/06/12 07:18:41 darrenr Exp $";
#endif
#if !defined(__sgi) && !defined(__hpux) && !defined(__osf__) && !defined(linux)
#if !defined(__sgi) && !defined(__hpux) && !defined(__osf__) && \
!defined(linux) && !defined(_AIX51)
/*
* For all platforms where there is a libkvm and a kvm_t, we use that...
*/

View File

@ -4,7 +4,7 @@
* Copyright (C) 1993-2001 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
* Id: kmem.h,v 1.2 2002/08/21 22:57:36 darrenr Exp
* $Id: kmem.h,v 1.2 2002/08/21 22:57:36 darrenr Exp $
*/
#ifndef __KMEM_H__

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: load_hash.c,v 1.11.2.2 2005/02/01 02:44:05 darrenr Exp
* $Id: load_hash.c,v 1.11.2.3 2005/11/13 15:41:12 darrenr Exp $
*/
#include <fcntl.h>
@ -72,8 +72,8 @@ ioctlfunc_t iocfunc;
}
}
strncpy(op.iplo_name, iph.iph_name, sizeof(op.iplo_name));
strncpy(iphp->iph_name, iph.iph_name, sizeof(op.iplo_name));
strncpy(iph.iph_name, op.iplo_name, sizeof(op.iplo_name));
strncpy(iphp->iph_name, op.iplo_name, sizeof(op.iplo_name));
if (opts & OPT_VERBOSE) {
for (a = list; a != NULL; a = a->ipe_next) {

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: load_hashnode.c,v 1.2.4.1 2004/03/06 14:33:28 darrenr Exp
* $Id: load_hashnode.c,v 1.2.4.1 2004/03/06 14:33:28 darrenr Exp $
*/
#include <fcntl.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: load_pool.c,v 1.14.2.2 2005/02/01 02:44:06 darrenr Exp
* $Id: load_pool.c,v 1.14.2.3 2005/11/13 15:41:13 darrenr Exp $
*/
#include <fcntl.h>
@ -38,7 +38,7 @@ ioctlfunc_t iocfunc;
op.iplo_struct = &pool;
bzero((char *)&pool, sizeof(pool));
strncpy(pool.ipo_name, plp->ipo_name, sizeof(pool.ipo_name));
if (*plp->ipo_name == '\0')
if (plp->ipo_name[0] == '\0')
op.iplo_arg |= IPOOL_ANON;
if ((opts & OPT_REMOVE) == 0) {
@ -49,6 +49,9 @@ ioctlfunc_t iocfunc;
}
}
if (op.iplo_arg & IPOOL_ANON)
strncpy(pool.ipo_name, op.iplo_name, sizeof(pool.ipo_name));
if ((opts & OPT_VERBOSE) != 0) {
pool.ipo_list = plp->ipo_list;
printpool(&pool, bcopywrap, pool.ipo_name, opts);
@ -56,7 +59,7 @@ ioctlfunc_t iocfunc;
}
for (a = plp->ipo_list; a != NULL; a = a->ipn_next)
load_poolnode(plp->ipo_unit, plp->ipo_name, a, iocfunc);
load_poolnode(plp->ipo_unit, pool.ipo_name, a, iocfunc);
if ((opts & OPT_REMOVE) != 0) {
if ((*iocfunc)(poolfd, SIOCLOOKUPDELTABLE, &op))

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: load_poolnode.c,v 1.3.2.1 2004/03/06 14:33:29 darrenr Exp
* $Id: load_poolnode.c,v 1.3.2.1 2004/03/06 14:33:29 darrenr Exp $
*/
#include <fcntl.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: loglevel.c,v 1.5 2001/06/09 17:09:24 darrenr Exp
* $Id: loglevel.c,v 1.5 2001/06/09 17:09:24 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: make_range.c,v 1.2 2002/05/18 07:27:52 darrenr Exp
* $Id: make_range.c,v 1.2 2002/05/18 07:27:52 darrenr Exp $
*/
#include "ipf.h"

View File

@ -6,7 +6,7 @@
* See the IPFILTER.LICENCE file for details on licencing.
*/
#if !defined(lint)
static const char rcsid[] = "@(#)Id: nat_setgroupmap.c,v 1.1 2003/04/13 06:40:14 darrenr Exp";
static const char rcsid[] = "@(#)$Id: nat_setgroupmap.c,v 1.1 2003/04/13 06:40:14 darrenr Exp $";
#endif
#include "ipf.h"

View File

@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] ="@(#)ipnat.c 1.9 6/5/96 (C) 1993 Darren Reed";
static const char rcsid[] = "@(#)Id: natparse.c,v 1.8.2.1 2004/12/09 19:41:21 darrenr Exp";
static const char rcsid[] = "@(#)$Id: natparse.c,v 1.8.2.1 2004/12/09 19:41:21 darrenr Exp $";
#endif
#include <sys/ioctl.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: optname.c,v 1.3 2001/06/09 17:09:24 darrenr Exp
* $Id: optname.c,v 1.3 2001/06/09 17:09:24 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: optprint.c,v 1.6 2002/07/13 15:59:49 darrenr Exp
* $Id: optprint.c,v 1.6 2002/07/13 15:59:49 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: optprintv6.c,v 1.2 2003/04/30 00:39:39 darrenr Exp
* $Id: optprintv6.c,v 1.2 2003/04/30 00:39:39 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: optvalue.c,v 1.2 2002/01/28 06:50:47 darrenr Exp
* $Id: optvalue.c,v 1.2 2002/01/28 06:50:47 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: parse.c,v 1.34.2.1 2004/12/09 19:41:21 darrenr Exp
* $Id: parse.c,v 1.34.2.1 2004/12/09 19:41:21 darrenr Exp $
*/
#include <ctype.h>
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: portname.c,v 1.7 2003/08/14 14:27:43 darrenr Exp
* $Id: portname.c,v 1.7 2003/08/14 14:27:43 darrenr Exp $
*/
#include "ipf.h"

View File

@ -6,7 +6,7 @@
* See the IPFILTER.LICENCE file for details on licencing.
*
*
* Id: portnum.c,v 1.6.4.1 2004/12/09 19:41:22 darrenr Exp
* $Id: portnum.c,v 1.6.4.1 2004/12/09 19:41:22 darrenr Exp $
*/
#include <ctype.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ports.c,v 1.9.4.1 2004/12/09 19:41:22 darrenr Exp
* $Id: ports.c,v 1.9.4.1 2004/12/09 19:41:22 darrenr Exp $
*/
#include <ctype.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: print_toif.c,v 1.8 2002/01/28 06:50:47 darrenr Exp
* $Id: print_toif.c,v 1.8 2002/01/28 06:50:47 darrenr Exp $
*/
#include "ipf.h"

View File

@ -12,7 +12,7 @@
#if !defined(lint)
static const char rcsid[] = "@(#)Id: printactivenat.c,v 1.3.2.4 2004/05/11 16:07:32 darrenr Exp";
static const char rcsid[] = "@(#)$Id: printactivenat.c,v 1.3.2.4 2004/05/11 16:07:32 darrenr Exp $";
#endif

View File

@ -13,7 +13,7 @@
#if !defined(lint)
static const char rcsid[] = "@(#)Id: printaps.c,v 1.4 2004/01/08 13:34:32 darrenr Exp";
static const char rcsid[] = "@(#)$Id: printaps.c,v 1.4 2004/01/08 13:34:32 darrenr Exp $";
#endif

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printbuf.c,v 1.5.4.1 2004/12/09 19:41:22 darrenr Exp
* $Id: printbuf.c,v 1.5.4.1 2004/12/09 19:41:22 darrenr Exp $
*/
#include <ctype.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printfr.c,v 1.43.2.10 2005/03/16 15:38:13 darrenr Exp
* $Id: printfr.c,v 1.43.2.15 2005/11/14 17:45:06 darrenr Exp $
*/
#include "ipf.h"
@ -22,7 +22,7 @@ u_32_t *addr, *mask;
switch (type)
{
case FRI_BROADCAST :
suffix = "/bcast";
suffix = "bcast";
break;
case FRI_DYNAMIC :
@ -32,15 +32,15 @@ u_32_t *addr, *mask;
break;
case FRI_NETWORK :
suffix = "/net";
suffix = "net";
break;
case FRI_NETMASKED :
suffix = "/netmasked";
suffix = "netmasked";
break;
case FRI_PEERADDR :
suffix = "/peer";
suffix = "peer";
break;
case FRI_LOOKUP :
@ -107,6 +107,9 @@ ioctlfunc_t iocfunc;
if ((fp->fr_type & FR_T_BUILTIN) != 0)
printf("# Builtin: ");
if (fp->fr_collect != 0)
printf("%u ", fp->fr_collect);
if (fp->fr_type == FR_T_CALLFUNC) {
;
} else if (fp->fr_func != NULL) {
@ -189,12 +192,11 @@ ioctlfunc_t iocfunc;
if (*fp->fr_ifnames[2]) {
printifname("", fp->fr_ifnames[2],
fp->fr_ifas[2]);
putchar(' ');
if (*fp->fr_ifnames[3]) {
printifname(",", fp->fr_ifnames[3],
fp->fr_ifas[3]);
}
putchar(' ');
}
}
@ -208,10 +210,10 @@ ioctlfunc_t iocfunc;
pr = -1;
} else if (fp->fr_mip.fi_p) {
pr = fp->fr_ip.fi_p;
if ((p = getprotobynumber(fp->fr_proto)))
printf("proto %s ", p->p_name);
else
printf("proto %d ", fp->fr_proto);
p = getprotobynumber(pr);
printf("proto ");
printproto(p, pr, NULL);
putchar(' ');
}
}
@ -370,6 +372,35 @@ ioctlfunc_t iocfunc;
if (!(fp->fr_flx & FI_OOW))
printf("not ");
printf("oow");
comma = ",";
}
if (fp->fr_mflx & FI_MBCAST) {
fputs(comma, stdout);
if (!(fp->fr_flx & FI_MBCAST))
printf("not ");
printf("mbcast");
comma = ",";
}
if (fp->fr_mflx & FI_BROADCAST) {
fputs(comma, stdout);
if (!(fp->fr_flx & FI_BROADCAST))
printf("not ");
printf("bcast");
comma = ",";
}
if (fp->fr_mflx & FI_MULTICAST) {
fputs(comma, stdout);
if (!(fp->fr_flx & FI_MULTICAST))
printf("not ");
printf("mcast");
comma = ",";
}
if (fp->fr_mflx & FI_STATE) {
fputs(comma, stdout);
if (!(fp->fr_flx & FI_STATE))
printf("not ");
printf("state");
comma = ",";
}
}
@ -410,8 +441,8 @@ ioctlfunc_t iocfunc;
if (fp->fr_flags & (FR_FRSTRICT)) {
printf(" (");
if (fp->fr_flags & FR_FRSTRICT)
printf(" strict");
printf(" )");
printf("strict");
printf(")");
}
}

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printfraginfo.c,v 1.1.2.2 2004/03/23 15:15:45 darrenr Exp
* $Id: printfraginfo.c,v 1.1.2.2 2004/03/23 15:15:45 darrenr Exp $
*/
#include "ipf.h"
#include "kmem.h"

View File

@ -6,8 +6,11 @@ void printhostmap(hmp, hv)
hostmap_t *hmp;
u_int hv;
{
struct in_addr in;
printf("%s,", inet_ntoa(hmp->hm_srcip));
printf("%s -> ", inet_ntoa(hmp->hm_dstip));
printf("%s ", inet_ntoa(hmp->hm_mapip));
in.s_addr = htonl(hmp->hm_mapip.s_addr);
printf("%s ", inet_ntoa(in));
printf("(use = %d hv = %u)\n", hmp->hm_ref, hv);
}

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printhostmask.c,v 1.8 2002/04/11 15:01:19 darrenr Exp
* $Id: printhostmask.c,v 1.8 2002/04/11 15:01:19 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printifname.c,v 1.2 2002/01/28 06:50:47 darrenr Exp
* $Id: printifname.c,v 1.2 2002/01/28 06:50:47 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printip.c,v 1.3 2002/07/13 12:10:27 darrenr Exp
* $Id: printip.c,v 1.3 2002/07/13 12:10:27 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printlog.c,v 1.6 2002/01/28 06:50:47 darrenr Exp
* $Id: printlog.c,v 1.6.4.1 2005/11/14 17:45:06 darrenr Exp $
*/
#include "ipf.h"
@ -27,12 +27,9 @@ frentry_t *fp;
printf(" or-block");
if (fp->fr_loglevel != 0xffff) {
printf(" level ");
if (fp->fr_loglevel & LOG_FACMASK) {
s = fac_toname(fp->fr_loglevel);
if (s == NULL)
s = "!!!";
} else
s = "";
s = fac_toname(fp->fr_loglevel);
if (s == NULL)
s = "!!!";
u = pri_toname(fp->fr_loglevel);
if (u == NULL)
u = "!!!";

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printmask.c,v 1.5 2002/06/15 04:48:33 darrenr Exp
* $Id: printmask.c,v 1.5 2002/06/15 04:48:33 darrenr Exp $
*/
#include "ipf.h"

View File

@ -13,11 +13,9 @@
#if !defined(lint)
static const char rcsid[] = "@(#)Id: printnat.c,v 1.22.2.8 2005/01/12 03:39:04 darrenr Exp";
static const char rcsid[] = "@(#)$Id: printnat.c,v 1.22.2.11 2005/11/14 17:45:06 darrenr Exp $";
#endif
static void printproto __P((ipnat_t *, struct protoent *));
/*
* Print out a NAT rule
*/
@ -53,7 +51,7 @@ int opts;
printf(" %s", np->in_ifnames[0]);
if ((np->in_ifnames[1][0] != '\0') &&
(strncmp(np->in_ifnames[0], np->in_ifnames[1], LIFNAMSIZ) != 0)) {
printf(",%s ", np->in_ifnames[1]);
printf(",%s", np->in_ifnames[1]);
}
putchar(' ');
@ -102,13 +100,16 @@ int opts;
printf(" -> %s", inet_ntoa(np->in_in[0].in4));
if (np->in_flags & IPN_SPLIT)
printf(",%s", inet_ntoa(np->in_in[1].in4));
else if (np->in_inmsk == 0 && np->in_inip == 0)
printf("/0");
if (np->in_flags & IPN_TCPUDP) {
if ((np->in_flags & IPN_FIXEDDPORT) != 0)
printf(" port = %d", ntohs(np->in_pnext));
else
printf(" port %d", ntohs(np->in_pnext));
}
printproto(np, pr);
putchar(' ');
printproto(pr, np->in_p, np);
if (np->in_flags & IPN_ROUNDR)
printf(" round-robin");
if (np->in_flags & IPN_FRAG)
@ -164,10 +165,7 @@ int opts;
}
printf(" %.*s/", (int)sizeof(np->in_plabel),
np->in_plabel);
if (pr != NULL)
fputs(pr->p_name, stdout);
else
printf("%d", np->in_p);
printproto(pr, np->in_p, NULL);
} else if (np->in_redir == NAT_MAPBLK) {
if ((np->in_pmin == 0) &&
(np->in_flags & IPN_AUTOPORTMAP))
@ -178,11 +176,11 @@ int opts;
printf("\n\tip modulous %d", np->in_pmax);
} else if (np->in_pmin || np->in_pmax) {
if (np->in_flags & IPN_ICMPQUERY) {
printf(" icmpidmap");
printf(" icmpidmap ");
} else {
printf(" portmap");
printf(" portmap ");
}
printproto(np, pr);
printproto(pr, np->in_p, np);
if (np->in_flags & IPN_AUTOPORTMAP) {
printf(" auto");
if (opts & OPT_DEBUG)
@ -194,8 +192,10 @@ int opts;
printf(" %d:%d", ntohs(np->in_pmin),
ntohs(np->in_pmax));
}
} else if (np->in_flags & IPN_TCPUDP || np->in_p)
printproto(np, pr);
} else if (np->in_flags & IPN_TCPUDP || np->in_p) {
putchar(' ');
printproto(pr, np->in_p, np);
}
if (np->in_flags & IPN_FRAG)
printf(" frag");
@ -227,21 +227,3 @@ int opts;
np->in_tqehead[0], np->in_tqehead[1], np->in_comment);
}
}
static void printproto(np, pr)
ipnat_t *np;
struct protoent *pr;
{
if ((np->in_flags & IPN_TCPUDP) == IPN_TCPUDP)
printf(" tcp/udp");
else if (np->in_flags & IPN_TCP)
printf(" tcp");
else if (np->in_flags & IPN_UDP)
printf(" udp");
else if (np->in_flags & IPN_ICMPQUERY)
printf(" icmp");
else if (pr != NULL)
printf(" %s", pr->p_name);
else
printf(" %d", np->in_p);
}

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printpacket.c,v 1.12.4.1 2005/02/21 05:09:24 darrenr Exp
* $Id: printpacket.c,v 1.12.4.2 2005/12/04 09:33:06 darrenr Exp $
*/
#include "ipf.h"
@ -52,7 +52,8 @@ struct ip *ip;
}
tcp = (struct tcphdr *)((char *)ip + (IP_HL(ip) << 2));
printf("ip %d(%d) %d", ntohs(ip->ip_len), IP_HL(ip) << 2, ip->ip_p);
printf("ip #%d %d(%d) %d", ntohs(ip->ip_id), ntohs(ip->ip_len),
IP_HL(ip) << 2, ip->ip_p);
if (off & IP_OFFMASK)
printf(" @%d", off << 3);
printf(" %s", inet_ntoa(ip->ip_src));

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printportcmp.c,v 1.7 2003/02/16 02:31:05 darrenr Exp
* $Id: printportcmp.c,v 1.7 2003/02/16 02:31:05 darrenr Exp $
*/
#include "ipf.h"

View File

@ -144,8 +144,8 @@ u_long now;
PRINTF("\tpkt_flags & %x(%x) = %x,\t",
ips.is_flags & 0xf, ips.is_flags,
ips.is_flags >> 4);
PRINTF("\tpkt_options & %x = %x\n", ips.is_optmsk,
ips.is_opt);
PRINTF("\tpkt_options & %x = %x, %x = %x \n", ips.is_optmsk[0],
ips.is_opt[0], ips.is_optmsk[1], ips.is_opt[1]);
PRINTF("\tpkt_security & %x = %x, pkt_auth & %x = %x\n",
ips.is_secmsk, ips.is_sec, ips.is_authmsk,
ips.is_auth);

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ratoi.c,v 1.4 2001/06/09 17:09:25 darrenr Exp
* $Id: ratoi.c,v 1.4 2001/06/09 17:09:25 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: ratoui.c,v 1.4 2001/06/09 17:09:25 darrenr Exp
* $Id: ratoui.c,v 1.4 2001/06/09 17:09:25 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: remove_hash.c,v 1.1 2003/04/13 06:40:14 darrenr Exp
* $Id: remove_hash.c,v 1.1 2003/04/13 06:40:14 darrenr Exp $
*/
#include <fcntl.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: remove_hashnode.c,v 1.1 2003/04/13 06:40:14 darrenr Exp
* $Id: remove_hashnode.c,v 1.1 2003/04/13 06:40:14 darrenr Exp $
*/
#include <fcntl.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: remove_pool.c,v 1.1 2003/04/13 06:40:14 darrenr Exp
* $Id: remove_pool.c,v 1.1 2003/04/13 06:40:14 darrenr Exp $
*/
#include <fcntl.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: remove_poolnode.c,v 1.3 2003/11/22 10:14:36 darrenr Exp
* $Id: remove_poolnode.c,v 1.3 2003/11/22 10:14:36 darrenr Exp $
*/
#include <fcntl.h>

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: tcp_flags.c,v 1.8 2004/02/07 18:15:54 darrenr Exp
* $Id: tcp_flags.c,v 1.8 2004/02/07 18:15:54 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: tcpflags.c,v 1.3 2002/11/02 07:18:01 darrenr Exp
* $Id: tcpflags.c,v 1.3 2002/11/02 07:18:01 darrenr Exp $
*/
#include "ipf.h"

View File

@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: tcpoptnames.c,v 1.5 2002/01/28 06:50:48 darrenr Exp
* $Id: tcpoptnames.c,v 1.5 2002/01/28 06:50:48 darrenr Exp $
*/
#include "ipf.h"

Some files were not shown because too many files have changed in this diff Show More