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