2005-04-25 17:31:50 +00:00
|
|
|
|
1997-04-03 10:22:02 +00:00
|
|
|
/*
|
1999-11-08 20:51:23 +00:00
|
|
|
* ipsend.h (C) 1997-1998 Darren Reed
|
1997-04-03 10:22:02 +00:00
|
|
|
*
|
|
|
|
* This was written to test what size TCP fragments would get through
|
|
|
|
* various TCP/IP packet filters, as used in IP firewalls. In certain
|
|
|
|
* conditions, enough of the TCP header is missing for unpredictable
|
|
|
|
* results unless the filter is aware that this can happen.
|
|
|
|
*
|
2023-06-01 23:41:33 +00:00
|
|
|
* The author provides this program as-is, with no guarantee for its
|
2005-04-25 17:31:50 +00:00
|
|
|
* suitability for any specific purpose. The author takes no responsibility
|
|
|
|
* for the misuse/abuse of this program and provides it for the sole purpose
|
|
|
|
* of testing packet filter policies. This file maybe distributed freely
|
|
|
|
* providing it is not modified and that this notice remains in tact.
|
1997-04-03 10:22:02 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
#ifndef __P
|
|
|
|
# define __P(x) x
|
|
|
|
#endif
|
|
|
|
|
2005-04-25 17:31:50 +00:00
|
|
|
#include <net/if.h>
|
|
|
|
|
|
|
|
#include "ipf.h"
|
2013-09-06 23:11:19 +00:00
|
|
|
/* XXX: The following is needed by tcpip.h */
|
|
|
|
#include <netinet/ip_var.h>
|
2013-08-11 14:28:45 +00:00
|
|
|
#include "netinet/tcpip.h"
|
1997-04-03 10:22:02 +00:00
|
|
|
#include "ipt.h"
|
|
|
|
|
2021-01-26 06:24:28 +00:00
|
|
|
extern int resolve(char *, char *);
|
|
|
|
extern int arp(char *, char *);
|
|
|
|
extern u_short chksum(u_short *, int);
|
|
|
|
extern int send_ether(int, char *, int, struct in_addr);
|
|
|
|
extern int send_ip(int, int, ip_t *, struct in_addr, int);
|
|
|
|
extern int send_tcp(int, int, ip_t *, struct in_addr);
|
|
|
|
extern int send_udp(int, int, ip_t *, struct in_addr);
|
|
|
|
extern int send_icmp(int, int, ip_t *, struct in_addr);
|
|
|
|
extern int send_packet(int, int, ip_t *, struct in_addr);
|
|
|
|
extern int send_packets(char *, int, ip_t *, struct in_addr);
|
|
|
|
extern u_short ipseclevel(char *);
|
|
|
|
extern u_32_t buildopts(char *, char *, int);
|
|
|
|
extern int addipopt(char *, struct ipopt_names *, int, char *);
|
|
|
|
extern int initdevice(char *, int);
|
|
|
|
extern int sendip(int, char *, int);
|
|
|
|
extern struct tcpcb *find_tcp(int, struct tcpiphdr *);
|
|
|
|
extern int ip_resend(char *, int, struct ipread *, struct in_addr, char *);
|
1997-04-03 10:22:02 +00:00
|
|
|
|
2021-01-26 06:24:28 +00:00
|
|
|
extern void ip_test1(char *, int, ip_t *, struct in_addr, int);
|
|
|
|
extern void ip_test2(char *, int, ip_t *, struct in_addr, int);
|
|
|
|
extern void ip_test3(char *, int, ip_t *, struct in_addr, int);
|
|
|
|
extern void ip_test4(char *, int, ip_t *, struct in_addr, int);
|
|
|
|
extern void ip_test5(char *, int, ip_t *, struct in_addr, int);
|
|
|
|
extern void ip_test6(char *, int, ip_t *, struct in_addr, int);
|
|
|
|
extern void ip_test7(char *, int, ip_t *, struct in_addr, int);
|
|
|
|
extern int do_socket(char *, int, struct tcpiphdr *, struct in_addr);
|
|
|
|
extern int kmemcpy(char *, void *, int);
|
1997-04-03 10:22:02 +00:00
|
|
|
|
|
|
|
#define KMCPY(a,b,c) kmemcpy((char *)(a), (void *)(b), (int)(c))
|
1997-11-16 04:52:19 +00:00
|
|
|
|
1999-11-08 20:51:23 +00:00
|
|
|
#ifndef OPT_RAW
|
1997-11-16 04:52:19 +00:00
|
|
|
#define OPT_RAW 0x80000
|
1999-11-08 20:51:23 +00:00
|
|
|
#endif
|