ip_conntrack_ftp.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:1k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. #ifndef _IP_CONNTRACK_FTP_H
  2. #define _IP_CONNTRACK_FTP_H
  3. /* FTP tracking. */
  4. #ifndef __KERNEL__
  5. #error Only in kernel.
  6. #endif
  7. #include <linux/netfilter_ipv4/lockhelp.h>
  8. #define IP_CONNTR_FTP 21
  9. /* Protects ftp part of conntracks */
  10. DECLARE_LOCK_EXTERN(ip_ftp_lock);
  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. /* We record seq number and length of ftp ip/port text here: all in
  23.    host order. */
  24. struct ip_ct_ftp
  25. {
  26. /* This tells NAT that this is an ftp connection */
  27. int is_ftp;
  28. u_int32_t seq;
  29. /* 0 means not found yet */
  30. u_int32_t len;
  31. enum ip_ct_ftp_type ftptype;
  32. /* Port that was to be used */
  33. u_int16_t port;
  34. /* Next valid seq position for cmd matching after newline */
  35. u_int32_t seq_aft_nl[IP_CT_DIR_MAX];
  36. /* 0 means seq_match_aft_nl not set */
  37. int seq_aft_nl_set[IP_CT_DIR_MAX];
  38. };
  39. #endif /* _IP_CONNTRACK_FTP_H */