Deleted Added
full compact
ipresend.c (24583) ipresend.c (31183)
1/*
1/*
2 * ipsend.c (C) 1995 Darren Reed
2 * ipresend.c (C) 1995-1997 Darren Reed
3 *
4 * This was written to test what size TCP fragments would get through
5 * various TCP/IP packet filters, as used in IP firewalls. In certain
6 * conditions, enough of the TCP header is missing for unpredictable
7 * results unless the filter is aware that this can happen.
8 *
3 *
4 * This was written to test what size TCP fragments would get through
5 * various TCP/IP packet filters, as used in IP firewalls. In certain
6 * conditions, enough of the TCP header is missing for unpredictable
7 * results unless the filter is aware that this can happen.
8 *
9 * The author provides this program as-is, with no gaurantee for its
10 * suitability for any specific purpose. The author takes no responsibility
11 * for the misuse/abuse of this program and provides it for the sole purpose
12 * of testing packet filter policies. This file maybe distributed freely
13 * providing it is not modified and that this notice remains in tact.
14 *
15 * This was written and tested (successfully) on SunOS 4.1.x.
9 * Redistribution and use in source and binary forms are permitted
10 * provided that this notice is preserved and due credit is given
11 * to the original author and the contributors.
16 */
12 */
17#if !defined(lint) && defined(LIBC_SCCS)
18static char sccsid[] = "%W% %G% (C)1995 Darren Reed";
13#if !defined(lint)
14static const char sccsid[] = "%W% %G% (C)1995 Darren Reed";
15static const char rcsid[] = "@(#)$Id: ipresend.c,v 2.0.2.9 1997/10/12 09:48:37 darrenr Exp $";
19#endif
20#include <stdio.h>
21#include <stdlib.h>
22#include <unistd.h>
23#include <netdb.h>
24#include <string.h>
25#include <sys/types.h>
26#include <sys/time.h>

--- 26 unchanged lines hidden (view full) ---

53char default_device[] = "le0";
54# else
55# ifdef ultrix
56char default_device[] = "ln0";
57# else
58# ifdef __bsdi__
59char default_device[] = "ef0";
60# else
16#endif
17#include <stdio.h>
18#include <stdlib.h>
19#include <unistd.h>
20#include <netdb.h>
21#include <string.h>
22#include <sys/types.h>
23#include <sys/time.h>

--- 26 unchanged lines hidden (view full) ---

50char default_device[] = "le0";
51# else
52# ifdef ultrix
53char default_device[] = "ln0";
54# else
55# ifdef __bsdi__
56char default_device[] = "ef0";
57# else
58# ifdef __sgi
59char default_device[] = "ec0";
60# else
61char default_device[] = "lan0";
61char default_device[] = "lan0";
62# endif
62# endif
63# endif
64# endif
65# endif
66#else
67char default_device[] = DEFAULT_DEVICE;
68#endif
69

--- 19 unchanged lines hidden (view full) ---

89
90int main(argc, argv)
91int argc;
92char **argv;
93{
94 struct in_addr gwip;
95 struct ipread *ipr = NULL;
96 char *name = argv[0], *gateway = NULL, *dev = NULL;
63# endif
64# endif
65# endif
66# endif
67#else
68char default_device[] = DEFAULT_DEVICE;
69#endif
70

--- 19 unchanged lines hidden (view full) ---

90
91int main(argc, argv)
92int argc;
93char **argv;
94{
95 struct in_addr gwip;
96 struct ipread *ipr = NULL;
97 char *name = argv[0], *gateway = NULL, *dev = NULL;
97 char c, *resend = NULL;
98 int mtu = 1500;
98 char *resend = NULL;
99 int mtu = 1500, c;
99
100
100 while ((c = getopt(argc, argv, "EHPSTXd:g:m:r:")) != -1)
101 while ((c = getopt(argc, argv, "EHPRSTXd:g:m:r:")) != -1)
101 switch (c)
102 {
103 case 'd' :
104 dev = optarg;
105 break;
106 case 'g' :
107 gateway = optarg;
108 break;
109 case 'm' :
110 mtu = atoi(optarg);
111 if (mtu < 28)
112 {
113 fprintf(stderr, "mtu must be > 28\n");
114 exit(1);
115 }
116 case 'r' :
117 resend = optarg;
118 break;
102 switch (c)
103 {
104 case 'd' :
105 dev = optarg;
106 break;
107 case 'g' :
108 gateway = optarg;
109 break;
110 case 'm' :
111 mtu = atoi(optarg);
112 if (mtu < 28)
113 {
114 fprintf(stderr, "mtu must be > 28\n");
115 exit(1);
116 }
117 case 'r' :
118 resend = optarg;
119 break;
120 case 'R' :
121 opts |= OPT_RAW;
122 break;
119#ifndef NO_IPF
120 case 'E' :
121 ipr = &etherf;
122 break;
123 case 'H' :
124 ipr = &iphex;
125 break;
126 case 'P' :

--- 36 unchanged lines hidden ---
123#ifndef NO_IPF
124 case 'E' :
125 ipr = &etherf;
126 break;
127 case 'H' :
128 ipr = &iphex;
129 break;
130 case 'P' :

--- 36 unchanged lines hidden ---