ip_conntrack_helper.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* IP connection tracking helpers. */
  2. #ifndef _IP_CONNTRACK_HELPER_H
  3. #define _IP_CONNTRACK_HELPER_H
  4. #include <linux/netfilter_ipv4/ip_conntrack.h>
  5. struct module;
  6. /* Reuse expectation when max_expected reached */
  7. #define IP_CT_HELPER_F_REUSE_EXPECT 0x01
  8. struct ip_conntrack_helper
  9. {
  10. struct list_head list;  /* Internal use. */
  11. const char *name; /* name of the module */
  12. unsigned char flags; /* Flags (see above) */
  13. struct module *me; /* pointer to self */
  14. unsigned int max_expected; /* Maximum number of concurrent 
  15.  * expected connections */
  16. unsigned int timeout; /* timeout for expecteds */
  17. /* Mask of things we will help (compared against server response) */
  18. struct ip_conntrack_tuple tuple;
  19. struct ip_conntrack_tuple mask;
  20. /* Function to call when data passes; return verdict, or -1 to
  21.            invalidate. */
  22. int (*help)(const struct iphdr *, size_t len,
  23.     struct ip_conntrack *ct,
  24.     enum ip_conntrack_info conntrackinfo);
  25. };
  26. extern int ip_conntrack_helper_register(struct ip_conntrack_helper *);
  27. extern void ip_conntrack_helper_unregister(struct ip_conntrack_helper *);
  28. extern struct ip_conntrack_helper *ip_ct_find_helper(const struct ip_conntrack_tuple *tuple);
  29. /* Add an expected connection: can have more than one per connection */
  30. extern int ip_conntrack_expect_related(struct ip_conntrack *related_to,
  31.        struct ip_conntrack_expect *exp);
  32. extern int ip_conntrack_change_expect(struct ip_conntrack_expect *expect,
  33.       struct ip_conntrack_tuple *newtuple);
  34. extern void ip_conntrack_unexpect_related(struct ip_conntrack_expect *exp);
  35. #endif /*_IP_CONNTRACK_HELPER_H*/