File: pqueue.h

package info (click to toggle)
pptpd 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,184 kB
  • sloc: ansic: 4,958; sh: 913; makefile: 101; perl: 87
file content (31 lines) | stat: -rw-r--r-- 806 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef PQUEUE_H
#define PQUEUE_H

#include <time.h>
#include <sys/time.h>
#include <sys/types.h>

/* wait this many seconds for missing packets before forgetting about them */
#define DEFAULT_PACKET_TIMEOUT 0.3
extern int packet_timeout_usecs;

/* assume packet is bad/spoofed if it's more than this many seqs ahead */
#define MISSING_WINDOW 300

/* Packet queue structure: linked list of packets received out-of-order */
typedef struct pqueue {
  struct pqueue *next;
  struct pqueue *prev;
  int seq;
  struct timeval expires;
  unsigned char *packet;
  int packlen;
  int capacity;
} pqueue_t;

int       pqueue_add  (int seq, unsigned char *packet, int packlen);
int       pqueue_del  (pqueue_t *point);
pqueue_t *pqueue_head ();
int       pqueue_expiry_time (pqueue_t *entry);

#endif /* PQUEUE_H */