]> git.karo-electronics.de Git - karo-tx-linux.git/blob - include/linux/netfilter/nf_conntrack_ftp.h
Merge remote-tracking branch 'wireless/master' into mac80211
[karo-tx-linux.git] / include / linux / netfilter / nf_conntrack_ftp.h
1 #ifndef _NF_CONNTRACK_FTP_H
2 #define _NF_CONNTRACK_FTP_H
3 /* FTP tracking. */
4
5 /* This enum is exposed to userspace */
6 enum nf_ct_ftp_type {
7         /* PORT command from client */
8         NF_CT_FTP_PORT,
9         /* PASV response from server */
10         NF_CT_FTP_PASV,
11         /* EPRT command from client */
12         NF_CT_FTP_EPRT,
13         /* EPSV response from server */
14         NF_CT_FTP_EPSV,
15 };
16
17 #ifdef __KERNEL__
18
19 #define FTP_PORT        21
20
21 #define NF_CT_FTP_SEQ_PICKUP    (1 << 0)
22
23 #define NUM_SEQ_TO_REMEMBER 2
24 /* This structure exists only once per master */
25 struct nf_ct_ftp_master {
26         /* Valid seq positions for cmd matching after newline */
27         u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER];
28         /* 0 means seq_match_aft_nl not set */
29         u_int16_t seq_aft_nl_num[IP_CT_DIR_MAX];
30         /* pickup sequence tracking, useful for conntrackd */
31         u_int16_t flags[IP_CT_DIR_MAX];
32 };
33
34 struct nf_conntrack_expect;
35
36 /* For NAT to hook in when we find a packet which describes what other
37  * connection we should expect. */
38 extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb,
39                                        enum ip_conntrack_info ctinfo,
40                                        enum nf_ct_ftp_type type,
41                                        unsigned int protoff,
42                                        unsigned int matchoff,
43                                        unsigned int matchlen,
44                                        struct nf_conntrack_expect *exp);
45 #endif /* __KERNEL__ */
46
47 #endif /* _NF_CONNTRACK_FTP_H */