nf_conntrack_helper.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * connection tracking helpers.
  3. *
  4. * 16 Dec 2003: Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp>
  5. * - generalize L3 protocol dependent part.
  6. *
  7. * Derived from include/linux/netfiter_ipv4/ip_conntrack_helper.h
  8. */
  9. #ifndef _NF_CONNTRACK_HELPER_H
  10. #define _NF_CONNTRACK_HELPER_H
  11. #include <net/netfilter/nf_conntrack.h>
  12. struct module;
  13. struct nf_conntrack_helper
  14. {
  15. struct list_head list; /* Internal use. */
  16. const char *name; /* name of the module */
  17. struct module *me; /* pointer to self */
  18. unsigned int max_expected; /* Maximum number of concurrent
  19. * expected connections */
  20. unsigned int timeout; /* timeout for expecteds */
  21. /* Mask of things we will help (compared against server response) */
  22. struct nf_conntrack_tuple tuple;
  23. struct nf_conntrack_tuple mask;
  24. /* Function to call when data passes; return verdict, or -1 to
  25. invalidate. */
  26. int (*help)(struct sk_buff **pskb,
  27. unsigned int protoff,
  28. struct nf_conn *ct,
  29. enum ip_conntrack_info conntrackinfo);
  30. void (*destroy)(struct nf_conn *ct);
  31. int (*to_nfattr)(struct sk_buff *skb, const struct nf_conn *ct);
  32. };
  33. extern struct nf_conntrack_helper *
  34. __nf_ct_helper_find(const struct nf_conntrack_tuple *tuple);
  35. extern struct nf_conntrack_helper *
  36. nf_ct_helper_find_get( const struct nf_conntrack_tuple *tuple);
  37. extern struct nf_conntrack_helper *
  38. __nf_conntrack_helper_find_byname(const char *name);
  39. extern void nf_ct_helper_put(struct nf_conntrack_helper *helper);
  40. extern int nf_conntrack_helper_register(struct nf_conntrack_helper *);
  41. extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *);
  42. #endif /*_NF_CONNTRACK_HELPER_H*/