1/*	$FreeBSD$	*/
2
3/*
4 * ipsend.h (C) 1997-1998 Darren Reed
5 *
6 * This was written to test what size TCP fragments would get through
7 * various TCP/IP packet filters, as used in IP firewalls.  In certain
8 * conditions, enough of the TCP header is missing for unpredictable
9 * results unless the filter is aware that this can happen.
10 *
11 * The author provides this program as-is, with no gaurantee for its
12 * suitability for any specific purpose.  The author takes no responsibility
13 * for the misuse/abuse of this program and provides it for the sole purpose
14 * of testing packet filter policies.  This file maybe distributed freely
15 * providing it is not modified and that this notice remains in tact.
16 *
17 */
18#ifndef	__P
19#  define	__P(x)	x
20#endif
21
22#include <net/if.h>
23
24#include "ipf.h"
25/* XXX:	The following is needed by tcpip.h */
26#include <netinet/ip_var.h>
27#include "netinet/tcpip.h"
28#include "ipt.h"
29
30extern	int	resolve(char *, char *);
31extern	int	arp(char *, char *);
32extern	u_short	chksum(u_short *, int);
33extern	int	send_ether(int, char *, int, struct in_addr);
34extern	int	send_ip(int, int, ip_t *, struct in_addr, int);
35extern	int	send_tcp(int, int, ip_t *, struct in_addr);
36extern	int	send_udp(int, int, ip_t *, struct in_addr);
37extern	int	send_icmp(int, int, ip_t *, struct in_addr);
38extern	int	send_packet(int, int, ip_t *, struct in_addr);
39extern	int	send_packets(char *, int, ip_t *, struct in_addr);
40extern	u_short	ipseclevel(char *);
41extern	u_32_t	buildopts(char *, char *, int);
42extern	int	addipopt(char *, struct ipopt_names *, int, char *);
43extern	int	initdevice(char *, int);
44extern	int	sendip(int, char *, int);
45extern	struct	tcpcb	*find_tcp(int, struct tcpiphdr *);
46extern	int	ip_resend(char *, int, struct ipread *, struct in_addr, char *);
47
48extern	void	ip_test1(char *, int, ip_t *, struct in_addr, int);
49extern	void	ip_test2(char *, int, ip_t *, struct in_addr, int);
50extern	void	ip_test3(char *, int, ip_t *, struct in_addr, int);
51extern	void	ip_test4(char *, int, ip_t *, struct in_addr, int);
52extern	void	ip_test5(char *, int, ip_t *, struct in_addr, int);
53extern	void	ip_test6(char *, int, ip_t *, struct in_addr, int);
54extern	void	ip_test7(char *, int, ip_t *, struct in_addr, int);
55extern	int	do_socket(char *, int, struct tcpiphdr *, struct in_addr);
56extern	int	kmemcpy(char *, void *, int);
57
58#define	KMCPY(a,b,c)	kmemcpy((char *)(a), (void *)(b), (int)(c))
59
60#ifndef	OPT_RAW
61#define	OPT_RAW	0x80000
62#endif
63