ip_conntrack_tcp.h
上传用户:szlgq88
上传日期:2009-04-28
资源大小:48287k
文件大小:2k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. #ifndef _IP_CONNTRACK_TCP_H
  2. #define _IP_CONNTRACK_TCP_H
  3. /* TCP tracking. */
  4. enum tcp_conntrack {
  5. TCP_CONNTRACK_NONE,
  6. TCP_CONNTRACK_SYN_SENT,
  7. TCP_CONNTRACK_SYN_RECV,
  8. TCP_CONNTRACK_ESTABLISHED,
  9. TCP_CONNTRACK_FIN_WAIT,
  10. TCP_CONNTRACK_CLOSE_WAIT,
  11. TCP_CONNTRACK_LAST_ACK,
  12. TCP_CONNTRACK_TIME_WAIT,
  13. TCP_CONNTRACK_CLOSE,
  14. TCP_CONNTRACK_LISTEN,
  15. TCP_CONNTRACK_MAX,
  16. TCP_CONNTRACK_IGNORE
  17. };
  18. /* Window scaling is advertised by the sender */
  19. #define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
  20. /* SACK is permitted by the sender */
  21. #define IP_CT_TCP_FLAG_SACK_PERM 0x02
  22. /* This sender sent FIN first */
  23. #define IP_CT_TCP_FLAG_CLOSE_INIT 0x03
  24. struct ip_ct_tcp_state {
  25. u_int32_t td_end; /* max of seq + len */
  26. u_int32_t td_maxend; /* max of ack + max(win, 1) */
  27. u_int32_t td_maxwin; /* max(win) */
  28. u_int8_t td_scale; /* window scale factor */
  29. u_int8_t loose; /* used when connection picked up from the middle */
  30. u_int8_t flags; /* per direction options */
  31. };
  32. struct ip_ct_tcp
  33. {
  34. struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */
  35. u_int8_t state; /* state of the connection (enum tcp_conntrack) */
  36. /* For detecting stale connections */
  37. u_int8_t last_dir; /* Direction of the last packet (enum ip_conntrack_dir) */
  38. u_int8_t retrans; /* Number of retransmitted packets */
  39. u_int8_t last_index; /* Index of the last packet */
  40. u_int32_t last_seq; /* Last sequence number seen in dir */
  41. u_int32_t last_ack; /* Last sequence number seen in opposite dir */
  42. u_int32_t last_end; /* Last seq + len */
  43. };
  44. #endif /* _IP_CONNTRACK_TCP_H */