www.usr.com/support/gpl/USR9107_release.1.4.tar.gz
[bcm963xx.git] / kernel / linux / 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 #include <linux/netfilter_ipv4/lockhelp.h>
8
9 /* Protects ftp part of conntracks */
10 DECLARE_LOCK_EXTERN(ip_ftp_lock);
11
12 #define FTP_PORT        21
13
14 #endif /* __KERNEL__ */
15
16 enum ip_ct_ftp_type
17 {
18         /* PORT command from client */
19         IP_CT_FTP_PORT,
20         /* PASV response from server */
21         IP_CT_FTP_PASV,
22         /* EPRT command from client */
23         IP_CT_FTP_EPRT,
24         /* EPSV response from server */
25         IP_CT_FTP_EPSV,
26 };
27
28 /* This structure is per expected connection */
29 struct ip_ct_ftp_expect
30 {
31         /* We record seq number and length of ftp ip/port text here: all in
32          * host order. */
33
34         /* sequence number of IP address in packet is in ip_conntrack_expect */
35         u_int32_t len;                  /* length of IP address */
36         enum ip_ct_ftp_type ftptype;    /* PORT or PASV ? */
37         u_int16_t port;                 /* TCP port that was to be used */
38 };
39
40 /* This structure exists only once per master */
41 struct ip_ct_ftp_master {
42         /* Next valid seq position for cmd matching after newline */
43         u_int32_t seq_aft_nl[IP_CT_DIR_MAX];
44         /* 0 means seq_match_aft_nl not set */
45         int seq_aft_nl_set[IP_CT_DIR_MAX];
46 };
47
48 #endif /* _IP_CONNTRACK_FTP_H */