]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - include/linux/netfilter_ipv4/ip_conntrack_ftp.h
Linux-2.6.12-rc2
[mirror_ubuntu-zesty-kernel.git] / include / linux / netfilter_ipv4 / ip_conntrack_ftp.h
1 #ifndef _IP_CONNTRACK_FTP_H
2 #define _IP_CONNTRACK_FTP_H
3 /* FTP tracking. */
4
5 #ifdef __KERNEL__
6
7 #define FTP_PORT 21
8
9 #endif /* __KERNEL__ */
10
11 enum ip_ct_ftp_type
12 {
13 /* PORT command from client */
14 IP_CT_FTP_PORT,
15 /* PASV response from server */
16 IP_CT_FTP_PASV,
17 /* EPRT command from client */
18 IP_CT_FTP_EPRT,
19 /* EPSV response from server */
20 IP_CT_FTP_EPSV,
21 };
22
23 #define NUM_SEQ_TO_REMEMBER 2
24 /* This structure exists only once per master */
25 struct ip_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 int seq_aft_nl_num[IP_CT_DIR_MAX];
30 };
31
32 struct ip_conntrack_expect;
33
34 /* For NAT to hook in when we find a packet which describes what other
35 * connection we should expect. */
36 extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb,
37 enum ip_conntrack_info ctinfo,
38 enum ip_ct_ftp_type type,
39 unsigned int matchoff,
40 unsigned int matchlen,
41 struct ip_conntrack_expect *exp,
42 u32 *seq);
43 #endif /* _IP_CONNTRACK_FTP_H */