xref: /freebsd/sbin/ipf/ipsend/ipsend.h (revision b17b639832e707aab0e9514cf94727498e2d67bd)
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 guarantee 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 
30 extern	int	resolve(char *, char *);
31 extern	int	arp(char *, char *);
32 extern	u_short	chksum(u_short *, int);
33 extern	int	send_ether(int, char *, int, struct in_addr);
34 extern	int	send_ip(int, int, ip_t *, struct in_addr, int);
35 extern	int	send_tcp(int, int, ip_t *, struct in_addr);
36 extern	int	send_udp(int, int, ip_t *, struct in_addr);
37 extern	int	send_icmp(int, int, ip_t *, struct in_addr);
38 extern	int	send_packet(int, int, ip_t *, struct in_addr);
39 extern	int	send_packets(char *, int, ip_t *, struct in_addr);
40 extern	u_short	ipseclevel(char *);
41 extern	u_32_t	buildopts(char *, char *, int);
42 extern	int	addipopt(char *, struct ipopt_names *, int, char *);
43 extern	int	initdevice(char *, int);
44 extern	int	sendip(int, char *, int);
45 extern	struct	tcpcb	*find_tcp(int, struct tcpiphdr *);
46 extern	int	ip_resend(char *, int, struct ipread *, struct in_addr, char *);
47 
48 extern	void	ip_test1(char *, int, ip_t *, struct in_addr, int);
49 extern	void	ip_test2(char *, int, ip_t *, struct in_addr, int);
50 extern	void	ip_test3(char *, int, ip_t *, struct in_addr, int);
51 extern	void	ip_test4(char *, int, ip_t *, struct in_addr, int);
52 extern	void	ip_test5(char *, int, ip_t *, struct in_addr, int);
53 extern	void	ip_test6(char *, int, ip_t *, struct in_addr, int);
54 extern	void	ip_test7(char *, int, ip_t *, struct in_addr, int);
55 extern	int	do_socket(char *, int, struct tcpiphdr *, struct in_addr);
56 extern	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