summaryrefslogtreecommitdiff
path: root/usr.sbin/ipsend
diff options
context:
space:
mode:
authordm <dm@cvs.openbsd.org>1996-07-18 05:01:10 +0000
committerdm <dm@cvs.openbsd.org>1996-07-18 05:01:10 +0000
commit746e8c40786f598f5da99fed9714ae7961393281 (patch)
tree7fa485ff1f4c0076948de7742853326232fa0cc1 /usr.sbin/ipsend
parent6764f712dd3ffd42fd940f9e87d2a9109743c72d (diff)
ipfilter 3.1.0
Diffstat (limited to 'usr.sbin/ipsend')
-rw-r--r--usr.sbin/ipsend/ipresend/Makefile8
-rw-r--r--usr.sbin/ipsend/ipresend/ipresend.c47
2 files changed, 37 insertions, 18 deletions
diff --git a/usr.sbin/ipsend/ipresend/Makefile b/usr.sbin/ipsend/ipresend/Makefile
index da0f8a37855..99d65114bcb 100644
--- a/usr.sbin/ipsend/ipresend/Makefile
+++ b/usr.sbin/ipsend/ipresend/Makefile
@@ -1,12 +1,14 @@
-# $Id: Makefile,v 1.1 1996/05/10 21:40:57 dm Exp $
+# $Id: Makefile,v 1.2 1996/07/18 05:00:22 dm Exp $
PROG= ipresend
BINDIR= /usr/sbin
NOMAN=
-SRCS= ipresend.c resend.c ip.c sbpf.c sock.c 44arp.c ipft_sn.c ipft_pc.c
+SRCS= ipresend.c resend.c ip.c sbpf.c sock.c 44arp.c opt.c \
+ ipft_ef.c ipft_hx.c ipft_pc.c ipft_sn.c ipft_tx.c ipft_td.c
CFLAGS+= -DDOSOCKET -I${.CURDIR}/../common -I${.CURDIR}/../../ipftest \
-I${.CURDIR}/../../../sbin/ipf \
-I${.CURDIR}/../../../sys/netinet
-.PATH: ${.CURDIR}/../common ${.CURDIR}/../../ipftest
+.PATH: ${.CURDIR}/../common ${.CURDIR}/../../ipftest \
+ ${.CURDIR}/../../../sbin/ipf
.include <bsd.prog.mk>
diff --git a/usr.sbin/ipsend/ipresend/ipresend.c b/usr.sbin/ipsend/ipresend/ipresend.c
index 482811a4b53..863c8b754da 100644
--- a/usr.sbin/ipsend/ipresend/ipresend.c
+++ b/usr.sbin/ipsend/ipresend/ipresend.c
@@ -15,7 +15,7 @@
* This was written and tested (successfully) on SunOS 4.1.x.
*/
#ifndef lint
-static char sccsid[] = "@(#)ipresend.c 1.1 1/11/96 (C)1995 Darren Reed";
+static char sccsid[] = "%W% %G% (C)1995 Darren Reed";
#endif
#include <stdio.h>
#include <netdb.h>
@@ -43,24 +43,29 @@ static char sccsid[] = "@(#)ipresend.c 1.1 1/11/96 (C)1995 Darren Reed";
extern char *optarg;
extern int optind;
-extern struct ipread snoop, pcap;
+extern struct ipread snoop, pcap, etherf, iphex, tcpd, iptext;
-#ifdef linux
+int opts = 0;
+#ifndef DEFAULT_DEVICE
+# ifdef linux
char default_device[] = "eth0";
-#else
-# ifdef sun
-char default_device[] = "le0";
# else
-# ifdef ultrix
-char default_device[] = "ln0";
+# ifdef sun
+char default_device[] = "le0";
# else
-# ifdef __bsdi__
-char default_device[] = "ef0";
+# ifdef ultrix
+char default_device[] = "ln0";
# else
+# ifdef __bsdi__
+char default_device[] = "ef0";
+# else
char default_device[] = "lan0";
+# endif
# endif
# endif
# endif
+#else
+char default_device[] = DEFAULT_DEVICE;
#endif
@@ -89,13 +94,9 @@ char **argv;
char c, *s, *resend = NULL;
int mtu = 1500;
- while ((c = getopt(argc, argv, "R:d:g:m:r:")) != -1)
+ while ((c = getopt(argc, argv, "EHPSTXd:g:m:r:")) != -1)
switch (c)
{
- case 'R' :
- resend = optarg;
- ipr = &pcap;
- break;
case 'd' :
dev = optarg;
break;
@@ -111,8 +112,24 @@ char **argv;
}
case 'r' :
resend = optarg;
+ break;
+ case 'E' :
+ ipr = &etherf;
+ break;
+ case 'H' :
+ ipr = &iphex;
+ break;
+ case 'P' :
+ ipr = &pcap;
+ break;
+ case 'S' :
ipr = &snoop;
break;
+ case 'T' :
+ ipr = &tcpd;
+ break;
+ case 'X' :
+ ipr = &iptext;
break;
default :
fprintf(stderr, "Unknown option \"%c\"\n", c);