Module Name:    src
Committed By:   christos
Date:           Sat Mar 24 02:08:34 UTC 2012

Modified Files:
        src/external/bsd/ipf/bin/ipresend: Makefile
        src/external/bsd/ipf/bin/ipsend: Makefile
        src/external/bsd/ipf/bin/iptest: Makefile
        src/external/bsd/ipf/dist/ipsend: iptests.c sbpf.c sock.c
Added Files:
        src/external/bsd/ipf/bin/ipsend: tcpip.h

Log Message:
Make this build from our own tree.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ipf/bin/ipresend/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ipf/bin/ipsend/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/ipf/bin/ipsend/tcpip.h
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ipf/bin/iptest/Makefile
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ipf/dist/ipsend/iptests.c \
    src/external/bsd/ipf/dist/ipsend/sbpf.c \
    src/external/bsd/ipf/dist/ipsend/sock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ipf/bin/ipresend/Makefile
diff -u src/external/bsd/ipf/bin/ipresend/Makefile:1.1 src/external/bsd/ipf/bin/ipresend/Makefile:1.2
--- src/external/bsd/ipf/bin/ipresend/Makefile:1.1	Fri Mar 23 17:29:45 2012
+++ src/external/bsd/ipf/bin/ipresend/Makefile	Fri Mar 23 22:08:34 2012
@@ -1,11 +1,18 @@
-#	$NetBSD: Makefile,v 1.1 2012/03/23 21:29:45 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2012/03/24 02:08:34 christos Exp $
 
 .include <bsd.own.mk>
+.include "../Makefile.inc"
 
 PROG=		ipresend
 SRCS=		ipresend.c ip.c resend.c sbpf.c sock.c 44arp.c
 MAN=		ipresend.1
 
-.PATH:		${NETBSDSRCDIR}/dist/ipf/ipsend
+CPPFLAGS+=	-I. -I${.CURDIR}/../ipsend -I${NETBSDSRCDIR}/sys 
+.PATH:		${UDIST}/ipsend
+
+#.BEGIN:
+#	rm -f machine x86
+#	ln -s ${NETBSDSRCDIR}/sys/arch/${MACHINE}/include machine
+#	ln -s ${NETBSDSRCDIR}/sys/arch/x86/include x86
 
 .include <bsd.prog.mk>

Index: src/external/bsd/ipf/bin/ipsend/Makefile
diff -u src/external/bsd/ipf/bin/ipsend/Makefile:1.1 src/external/bsd/ipf/bin/ipsend/Makefile:1.2
--- src/external/bsd/ipf/bin/ipsend/Makefile:1.1	Fri Mar 23 17:29:45 2012
+++ src/external/bsd/ipf/bin/ipsend/Makefile	Fri Mar 23 22:08:34 2012
@@ -1,6 +1,7 @@
-#	$NetBSD: Makefile,v 1.1 2012/03/23 21:29:45 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2012/03/24 02:08:34 christos Exp $
 
 .include <bsd.own.mk>
+.include "../Makefile.inc"
 
 PROG=		ipsend
 SRCS=		ipsend.c ip.c ipsopt.c iplang_y.c iplang_l.l sbpf.c \
@@ -9,16 +10,16 @@ MAN=		ipsend.1 ipsend.5
 DPADD+=		${LIBL}
 LDADD+=		-ll
 
-CPPFLAGS+=	-I${NETBSDSRCDIR}/dist/ipf/ipsend
-CPPFLAGS+=	-I${NETBSDSRCDIR}/dist/ipf/iplang
-CPPFLAGS+=	-I.
+CPPFLAGS+=	-I${UDIST}/ipsend
+CPPFLAGS+=	-I${UDIST}/iplang
+CPPFLAGS+=	-I${.CURDIR} -I.
 
 CLEANFILES+=	iplang_y.c iplang_y.h
 
 DPSRCS+=	iplang_y.h
 
-.PATH:		${NETBSDSRCDIR}/dist/ipf/ipsend \
-		${NETBSDSRCDIR}/dist/ipf/iplang
+.PATH:		${UDIST}/ipsend \
+		${UDIST}/iplang
 
 iplang_y.c: iplang_y.y
 	${_MKTARGET_CREATE}

Index: src/external/bsd/ipf/bin/iptest/Makefile
diff -u src/external/bsd/ipf/bin/iptest/Makefile:1.1 src/external/bsd/ipf/bin/iptest/Makefile:1.2
--- src/external/bsd/ipf/bin/iptest/Makefile:1.1	Fri Mar 23 17:29:45 2012
+++ src/external/bsd/ipf/bin/iptest/Makefile	Fri Mar 23 22:08:34 2012
@@ -1,11 +1,13 @@
-#	$NetBSD: Makefile,v 1.1 2012/03/23 21:29:45 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2012/03/24 02:08:34 christos Exp $
 
 .include <bsd.own.mk>
+.include "../Makefile.inc"
 
 PROG=		iptest
 SRCS=		iptest.c iptests.c ip.c sbpf.c sock.c 44arp.c
 MAN=		iptest.1
 
-.PATH:		${NETBSDSRCDIR}/dist/ipf/ipsend
+CPPFLAGS+=	-I${.CURDIR}/../ipsend -I${NETBSDSRCDIR}/sys
+.PATH:		${UDIST}/ipsend
 
 .include <bsd.prog.mk>

Index: src/external/bsd/ipf/dist/ipsend/iptests.c
diff -u src/external/bsd/ipf/dist/ipsend/iptests.c:1.1.1.1 src/external/bsd/ipf/dist/ipsend/iptests.c:1.2
--- src/external/bsd/ipf/dist/ipsend/iptests.c:1.1.1.1	Fri Mar 23 17:20:07 2012
+++ src/external/bsd/ipf/dist/ipsend/iptests.c	Fri Mar 23 22:08:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: iptests.c,v 1.1.1.1 2012/03/23 21:20:07 christos Exp $	*/
+/*	$NetBSD: iptests.c,v 1.2 2012/03/24 02:08:34 christos Exp $	*/
 
 /*
  * Copyright (C) 2009 by Darren Reed.
@@ -8,10 +8,11 @@
  */
 #if !defined(lint)
 static const char sccsid[] = "%W% %G% (C)1995 Darren Reed";
-static const char rcsid[] = "@(#)Id";
+static const char rcsid[] = "@(#)Id: iptests.c,v 2.21.2.1 2012/01/26 05:29:15 darrenr Exp";
 #endif
 #include <sys/param.h>
 #include <sys/types.h>
+#include <stdbool.h>
 #if defined(__NetBSD__) && defined(__vax__)
 /*
  * XXX need to declare boolean_t for _KERNEL <sys/files.h>
@@ -24,6 +25,7 @@ typedef	int	boolean_t;
 #if !defined(__osf__)
 # ifdef __NetBSD__
 #  include <machine/lock.h>
+#  include <sys/mutex.h>
 # endif
 # define _KERNEL
 # define KERNEL
Index: src/external/bsd/ipf/dist/ipsend/sbpf.c
diff -u src/external/bsd/ipf/dist/ipsend/sbpf.c:1.1.1.1 src/external/bsd/ipf/dist/ipsend/sbpf.c:1.2
--- src/external/bsd/ipf/dist/ipsend/sbpf.c:1.1.1.1	Fri Mar 23 17:20:07 2012
+++ src/external/bsd/ipf/dist/ipsend/sbpf.c	Fri Mar 23 22:08:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbpf.c,v 1.1.1.1 2012/03/23 21:20:07 christos Exp $	*/
+/*	$NetBSD: sbpf.c,v 1.2 2012/03/24 02:08:34 christos Exp $	*/
 
 /*
  * (C)opyright 1995-1998 Darren Reed. (from tcplog)
@@ -28,6 +28,8 @@
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/ip_var.h>
 #include <netinet/udp.h>
 #include <netinet/tcp.h>
 
@@ -43,6 +45,7 @@
 #include <signal.h>
 #include <errno.h>
 
+#include "ip_compat.h"
 #include "ipsend.h"
 
 #if !defined(lint)
Index: src/external/bsd/ipf/dist/ipsend/sock.c
diff -u src/external/bsd/ipf/dist/ipsend/sock.c:1.1.1.1 src/external/bsd/ipf/dist/ipsend/sock.c:1.2
--- src/external/bsd/ipf/dist/ipsend/sock.c:1.1.1.1	Fri Mar 23 17:20:07 2012
+++ src/external/bsd/ipf/dist/ipsend/sock.c	Fri Mar 23 22:08:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sock.c,v 1.1.1.1 2012/03/23 21:20:07 christos Exp $	*/
+/*	$NetBSD: sock.c,v 1.2 2012/03/24 02:08:34 christos Exp $	*/
 
 /*
  * sock.c (C) 1995-1998 Darren Reed
@@ -8,12 +8,13 @@
  */
 #if !defined(lint)
 static const char sccsid[] = "@(#)sock.c	1.2 1/11/96 (C)1995 Darren Reed";
-static const char rcsid[] = "@(#)Id";
+static const char rcsid[] = "@(#)Id: sock.c,v 2.18 2008/08/10 05:51:14 darrenr Exp";
 #endif
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/stat.h>
+#include <stdbool.h>
 #if defined(__NetBSD__) && defined(__vax__)
 /*
  * XXX need to declare boolean_t for _KERNEL <sys/files.h>
@@ -33,6 +34,7 @@ typedef int     boolean_t;
 #if !defined(__osf__)
 # ifdef __NetBSD__
 #  include <machine/lock.h>
+#  include <sys/mutex.h>
 # endif
 # define _KERNEL
 # define	KERNEL
@@ -324,12 +326,21 @@ struct	tcpcb	*find_tcp(tfd, ti)
 	t = NULL;
 
 	o = (struct file **)calloc(1, sizeof(*o) * (fd->fd_lastfile + 1));
+#if defined(__NetBSD_Version__)  && __NetBSD_Version__ < 599001200
 	if (KMCPY(o, fd->fd_ofiles, (fd->fd_lastfile + 1) * sizeof(*o)) == -1)
 	    {
 		fprintf(stderr, "read(%#lx,%#lx,%lu) - u_ofile - failed\n",
 			(u_long)fd->fd_ofiles, (u_long)o, (u_long)sizeof(*o));
 		goto finderror;
 	    }
+#else
+	if (KMCPY(o, &fd->fd_dt->dt_ff, (fd->fd_lastfile + 1) * sizeof(*o)) == -1)
+	    {
+		fprintf(stderr, "read(%#lx,%#lx,%lu) - u_ofile - failed\n",
+			(u_long)fd->fd_dt->dt_ff, (u_long)o, (u_long)sizeof(*o));
+		goto finderror;
+	    }
+#endif
 	f = (struct file *)calloc(1, sizeof(*f));
 	if (KMCPY(f, o[tfd], sizeof(*f)) == -1)
 	    {

Added files:

Index: src/external/bsd/ipf/bin/ipsend/tcpip.h
diff -u /dev/null src/external/bsd/ipf/bin/ipsend/tcpip.h:1.1
--- /dev/null	Fri Mar 23 22:08:34 2012
+++ src/external/bsd/ipf/bin/ipsend/tcpip.h	Fri Mar 23 22:08:34 2012
@@ -0,0 +1,86 @@
+/*	$NetBSD: tcpip.h,v 1.1 2012/03/24 02:08:34 christos Exp $	*/
+
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * 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
+ */
+
+#ifndef _NETINET_TCPIP_H_
+#define _NETINET_TCPIP_H_
+
+# if defined(linux) && !defined(LINUX_IPOVLY)
+#  define LINUX_IPOVLY
+struct ipovly {
+	caddr_t	ih_next, ih_prev;	/* for protocol sequence q's */
+	u_char	ih_x1;			/* (unused) */
+	u_char	ih_pr;			/* protocol */
+	short	ih_len;			/* protocol length */
+	struct	in_addr ih_src;		/* source internet address */
+	struct	in_addr ih_dst;		/* destination internet address */
+};
+# endif
+
+/*
+ * Tcp+ip header, after ip options removed.
+ */
+struct tcpiphdr {
+	struct 	ipovly ti_i;		/* overlaid ip structure */
+	struct	tcphdr ti_t;		/* tcp header */
+};
+
+#ifdef notyet
+/*
+ * Tcp+ip header, after ip options removed but including TCP options.
+ */
+struct full_tcpiphdr {
+	struct 	ipovly ti_i;		/* overlaid ip structure */
+	struct	tcphdr ti_t;		/* tcp header */
+	char	ti_o[TCP_MAXOLEN];	/* space for tcp options */
+};
+#endif /* notyet */
+#define	ti_next		ti_i.ih_next
+#define	ti_prev		ti_i.ih_prev
+#define	ti_x1		ti_i.ih_x1
+#define	ti_pr		ti_i.ih_pr
+#define	ti_len		ti_i.ih_len
+#define	ti_src		ti_i.ih_src
+#define	ti_dst		ti_i.ih_dst
+#define	ti_sport	ti_t.th_sport
+#define	ti_dport	ti_t.th_dport
+#define	ti_seq		ti_t.th_seq
+#define	ti_ack		ti_t.th_ack
+#define	ti_x2		ti_t.th_x2
+#define	ti_off		ti_t.th_off
+#define	ti_flags	ti_t.th_flags
+#define	ti_win		ti_t.th_win
+#define	ti_sum		ti_t.th_sum
+#define	ti_urp		ti_t.th_urp
+
+#endif

Reply via email to