Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/ipf Make this build from our own tree.
details: https://anonhg.NetBSD.org/src/rev/e45c4a107a47
branches: trunk
changeset: 778389:e45c4a107a47
user: christos <christos%NetBSD.org@localhost>
date: Sat Mar 24 02:08:34 2012 +0000
description:
Make this build from our own tree.
diffstat:
external/bsd/ipf/bin/ipresend/Makefile | 11 +++-
external/bsd/ipf/bin/ipsend/Makefile | 13 ++--
external/bsd/ipf/bin/ipsend/tcpip.h | 86 ++++++++++++++++++++++++++++++++++
external/bsd/ipf/bin/iptest/Makefile | 6 +-
external/bsd/ipf/dist/ipsend/iptests.c | 6 +-
external/bsd/ipf/dist/ipsend/sbpf.c | 5 +-
external/bsd/ipf/dist/ipsend/sock.c | 15 +++++-
7 files changed, 127 insertions(+), 15 deletions(-)
diffs (277 lines):
diff -r 2b411b8b6535 -r e45c4a107a47 external/bsd/ipf/bin/ipresend/Makefile
--- a/external/bsd/ipf/bin/ipresend/Makefile Sat Mar 24 01:36:50 2012 +0000
+++ b/external/bsd/ipf/bin/ipresend/Makefile Sat Mar 24 02:08:34 2012 +0000
@@ -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>
diff -r 2b411b8b6535 -r e45c4a107a47 external/bsd/ipf/bin/ipsend/Makefile
--- a/external/bsd/ipf/bin/ipsend/Makefile Sat Mar 24 01:36:50 2012 +0000
+++ b/external/bsd/ipf/bin/ipsend/Makefile Sat Mar 24 02:08:34 2012 +0000
@@ -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 @@
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}
diff -r 2b411b8b6535 -r e45c4a107a47 external/bsd/ipf/bin/ipsend/tcpip.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/ipf/bin/ipsend/tcpip.h Sat Mar 24 02:08:34 2012 +0000
@@ -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
diff -r 2b411b8b6535 -r e45c4a107a47 external/bsd/ipf/bin/iptest/Makefile
--- a/external/bsd/ipf/bin/iptest/Makefile Sat Mar 24 01:36:50 2012 +0000
+++ b/external/bsd/ipf/bin/iptest/Makefile Sat Mar 24 02:08:34 2012 +0000
@@ -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>
diff -r 2b411b8b6535 -r e45c4a107a47 external/bsd/ipf/dist/ipsend/iptests.c
--- a/external/bsd/ipf/dist/ipsend/iptests.c Sat Mar 24 01:36:50 2012 +0000
+++ b/external/bsd/ipf/dist/ipsend/iptests.c Sat Mar 24 02:08:34 2012 +0000
@@ -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 @@
#if !defined(__osf__)
# ifdef __NetBSD__
# include <machine/lock.h>
+# include <sys/mutex.h>
# endif
# define _KERNEL
# define KERNEL
diff -r 2b411b8b6535 -r e45c4a107a47 external/bsd/ipf/dist/ipsend/sbpf.c
--- a/external/bsd/ipf/dist/ipsend/sbpf.c Sat Mar 24 01:36:50 2012 +0000
+++ b/external/bsd/ipf/dist/ipsend/sbpf.c Sat Mar 24 02:08:34 2012 +0000
@@ -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)
diff -r 2b411b8b6535 -r e45c4a107a47 external/bsd/ipf/dist/ipsend/sock.c
--- a/external/bsd/ipf/dist/ipsend/sock.c Sat Mar 24 01:36:50 2012 +0000
+++ b/external/bsd/ipf/dist/ipsend/sock.c Sat Mar 24 02:08:34 2012 +0000
@@ -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 @@
#if !defined(__osf__)
# ifdef __NetBSD__
# include <machine/lock.h>
+# include <sys/mutex.h>
# endif
# define _KERNEL
# define KERNEL
@@ -324,12 +326,21 @@
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)
{
Home |
Main Index |
Thread Index |
Old Index