#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <pcap.h>
#include "protocol.h"

#define ACK_RAND 200
#define PACKETS 6
#define PORT_CLOSED 1

#define TH_XXX 0x40
#define TH_YYY 0x80

#define MIN_PKT 200

#define SRC 0
#define DST 1

typedef struct {
   u_long seq;
   u_long ack;
} hdrinfo;

extern struct in_addr local_ip; /* local ip address */
extern struct in_addr target_ip; /* target ip address */

extern u_short src_port; /* source port */
extern u_short dst_port; /* destination port */

extern int clicks;

extern int pcap_off; /* header offset for pcap_next captured packets */

extern pcap_t *pd_raw; /* packet capture descriptor */
extern int sd_raw; /* raw socket descriptor */
extern int sd_icmp; /* icmp socket descriptor */

extern u_long get_packet(struct ip *, char *, int, int);
extern void term_packet_devices(void);
extern void sendtcp(hdrinfo *, u_short);
extern void sendudp(int);
extern void init_packet_devices(int);

