1#ifndef PQUEUE_H 2#define PQUEUE_H 3 4#include <time.h> 5#include <sys/time.h> 6 7/* wait this many seconds for missing packets before forgetting about them */ 8#define DEFAULT_PACKET_TIMEOUT 0.3 9extern int packet_timeout_usecs; 10 11/* assume packet is bad/spoofed if it's more than this many seqs ahead */ 12#define MISSING_WINDOW 300 13 14/* Packet queue structure: linked list of packets received out-of-order */ 15typedef struct pqueue { 16 struct pqueue *next; 17 struct pqueue *prev; 18 int seq; 19 struct timeval expires; 20 unsigned char *packet; 21 int packlen; 22 int capacity; 23} pqueue_t; 24 25int pqueue_add (int seq, unsigned char *packet, int packlen); 26int pqueue_del (pqueue_t *point); 27pqueue_t *pqueue_head (); 28int pqueue_expiry_time (pqueue_t *entry); 29 30#endif /* PQUEUE_H */ 31