#include <asm/types.h>
#include <curses.h>
#include <panel.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <sys/time.h>
#include <net/if_arp.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#include <linux/if_fddi.h>

 
#define SNAPSHOT_LEN 96
#define MAX_PACKET_SIZE 17664
#define ALIGNED_BUF_LEN 120

#define min(a, b) ((a > b) ? b : a)

#define INVALID_PACKET 0
#define OK_PACKET 1
#define PACKET_OK 1
#define CHECKSUM_ERROR 2

#ifndef ARPHRD_IEEE802_TR
#define ARPHRD_IEEE802_TR 800
#endif

extern int isdnfd;

int open_socket(int *fd);
unsigned short getlinktype(unsigned short family, char *ifname);
void adjustpacket(char *tpacket, unsigned short family,
                  char **packet, char *aligned_buf, unsigned int *readlen);
void getpacket(int fd, char *buf, struct sockaddr_ll *fromaddr,int *ch, int *br, char *ifname);
int processpacket(char *tpacket, char **packet, unsigned int *br,
                   unsigned int *total_br, unsigned int *sport,
                   unsigned int *dport, struct sockaddr_ll *fromaddr,
                   unsigned short *linktype,char *ifname, char *ifptr);
void pkt_cleanup(void);
char *c2b(char c);
char *prn32bit(char *c);
char *prnaddr(char *c);
char *pr_iph(struct ip *ip,char *packet);
