-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpf_nattrack.h
38 lines (31 loc) · 1.03 KB
/
pf_nattrack.h
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
32
33
34
35
36
37
38
#ifndef _PF_NATTRACK_H_
#define _PF_NATTRACK_H_
#include <stdlib.h>
#include <net/if.h>
#include <net/pfvar.h>
struct conn {
struct pf_addr osrc,odst,tsrc,tdst; // original/translated source/dest.
u_int16_t osport,tsport,odport,tdport; // original/translated ports
};
struct pf_nattrack {
struct conn c;
sa_family_t af;
u_int8_t proto;
u_int32_t duration;
};
struct pf_nattrack_list {
struct pf_nattrack_list *prev, *next;
struct pf_nattrack_list *ref; // a reverse reference to other
// lists (used to free list)
struct pf_nattrack *nt;
};
struct pf_nattrack_hash {
struct pf_nattrack_list *list;
};
void ladd(struct pf_nattrack_list **head, struct pf_nattrack_list *no);
void laddref(struct pf_nattrack_list **head, struct pf_nattrack_list *no,
struct pf_nattrack_list *ref);
void ldel(struct pf_nattrack_list **head, struct pf_nattrack_list *no);
struct pf_nattrack_list *lfind(struct pf_nattrack_list *head,
struct pf_nattrack *nt);
#endif