Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 1 | #ifndef _NF_CONNTRACK_FTP_H |
| 2 | #define _NF_CONNTRACK_FTP_H |
| 3 | /* FTP tracking. */ |
| 4 | |
| 5 | /* This enum is exposed to userspace */ |
Eric Dumazet | d94d9fe | 2009-11-04 09:50:58 -0800 | [diff] [blame] | 6 | enum nf_ct_ftp_type { |
Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 7 | /* PORT command from client */ |
Jozsef Kadlecsik | 55a7332 | 2006-12-02 22:07:44 -0800 | [diff] [blame] | 8 | NF_CT_FTP_PORT, |
Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 9 | /* PASV response from server */ |
Jozsef Kadlecsik | 55a7332 | 2006-12-02 22:07:44 -0800 | [diff] [blame] | 10 | NF_CT_FTP_PASV, |
Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 11 | /* EPRT command from client */ |
Jozsef Kadlecsik | 55a7332 | 2006-12-02 22:07:44 -0800 | [diff] [blame] | 12 | NF_CT_FTP_EPRT, |
Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 13 | /* EPSV response from server */ |
Jozsef Kadlecsik | 55a7332 | 2006-12-02 22:07:44 -0800 | [diff] [blame] | 14 | NF_CT_FTP_EPSV, |
Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 15 | }; |
| 16 | |
| 17 | #ifdef __KERNEL__ |
| 18 | |
| 19 | #define FTP_PORT 21 |
| 20 | |
| 21 | #define NUM_SEQ_TO_REMEMBER 2 |
| 22 | /* This structure exists only once per master */ |
Jozsef Kadlecsik | 55a7332 | 2006-12-02 22:07:44 -0800 | [diff] [blame] | 23 | struct nf_ct_ftp_master { |
Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 24 | /* Valid seq positions for cmd matching after newline */ |
| 25 | u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; |
| 26 | /* 0 means seq_match_aft_nl not set */ |
| 27 | int seq_aft_nl_num[IP_CT_DIR_MAX]; |
| 28 | }; |
| 29 | |
Jozsef Kadlecsik | 55a7332 | 2006-12-02 22:07:44 -0800 | [diff] [blame] | 30 | struct nf_conntrack_expect; |
Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 31 | |
| 32 | /* For NAT to hook in when we find a packet which describes what other |
| 33 | * connection we should expect. */ |
Herbert Xu | 3db05fe | 2007-10-15 00:53:15 -0700 | [diff] [blame] | 34 | extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb, |
Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 35 | enum ip_conntrack_info ctinfo, |
Jozsef Kadlecsik | 55a7332 | 2006-12-02 22:07:44 -0800 | [diff] [blame] | 36 | enum nf_ct_ftp_type type, |
Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 37 | unsigned int matchoff, |
| 38 | unsigned int matchlen, |
Patrick McHardy | 25b86e0 | 2007-05-24 16:41:50 -0700 | [diff] [blame] | 39 | struct nf_conntrack_expect *exp); |
Yasuyuki Kozakai | 9fb9cbb | 2005-11-09 16:38:16 -0800 | [diff] [blame] | 40 | #endif /* __KERNEL__ */ |
| 41 | |
| 42 | #endif /* _NF_CONNTRACK_FTP_H */ |