]> git.karo-electronics.de Git - karo-tx-linux.git/blob - include/net/netfilter/nf_conntrack_seqadj.h
rt2x00: rt2800pci: use module_pci_driver macro
[karo-tx-linux.git] / include / net / netfilter / nf_conntrack_seqadj.h
1 #ifndef _NF_CONNTRACK_SEQADJ_H
2 #define _NF_CONNTRACK_SEQADJ_H
3
4 #include <net/netfilter/nf_conntrack_extend.h>
5
6 /**
7  * struct nf_ct_seqadj - sequence number adjustment information
8  *
9  * @correction_pos: position of the last TCP sequence number modification
10  * @offset_before: sequence number offset before last modification
11  * @offset_after: sequence number offset after last modification
12  */
13 struct nf_ct_seqadj {
14         u32             correction_pos;
15         s32             offset_before;
16         s32             offset_after;
17 };
18
19 struct nf_conn_seqadj {
20         struct nf_ct_seqadj     seq[IP_CT_DIR_MAX];
21 };
22
23 static inline struct nf_conn_seqadj *nfct_seqadj(const struct nf_conn *ct)
24 {
25         return nf_ct_ext_find(ct, NF_CT_EXT_SEQADJ);
26 }
27
28 static inline struct nf_conn_seqadj *nfct_seqadj_ext_add(struct nf_conn *ct)
29 {
30         return nf_ct_ext_add(ct, NF_CT_EXT_SEQADJ, GFP_ATOMIC);
31 }
32
33 extern int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
34                              s32 off);
35 extern int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
36                             __be32 seq, s32 off);
37 extern void nf_ct_tcp_seqadj_set(struct sk_buff *skb,
38                                  struct nf_conn *ct,
39                                  enum ip_conntrack_info ctinfo,
40                                  s32 off);
41
42 extern int nf_ct_seq_adjust(struct sk_buff *skb,
43                             struct nf_conn *ct, enum ip_conntrack_info ctinfo,
44                             unsigned int protoff);
45 extern s32 nf_ct_seq_offset(const struct nf_conn *ct, enum ip_conntrack_dir,
46                             u32 seq);
47
48 extern int nf_conntrack_seqadj_init(void);
49 extern void nf_conntrack_seqadj_fini(void);
50
51 #endif /* _NF_CONNTRACK_SEQADJ_H */