~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/net/netfilter/nf_conntrack_helper.h

Version: ~ [ linux-5.3-rc5 ] ~ [ linux-5.2.9 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.67 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.139 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.189 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.189 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.72 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 
 10 #ifndef _NF_CONNTRACK_HELPER_H
 11 #define _NF_CONNTRACK_HELPER_H
 12 #include <net/netfilter/nf_conntrack.h>
 13 #include <net/netfilter/nf_conntrack_extend.h>
 14 #include <net/netfilter/nf_conntrack_expect.h>
 15 
 16 struct module;
 17 
 18 enum nf_ct_helper_flags {
 19         NF_CT_HELPER_F_USERSPACE        = (1 << 0),
 20         NF_CT_HELPER_F_CONFIGURED       = (1 << 1),
 21 };
 22 
 23 #define NF_CT_HELPER_NAME_LEN   16
 24 
 25 struct nf_conntrack_helper {
 26         struct hlist_node hnode;        /* Internal use. */
 27 
 28         char name[NF_CT_HELPER_NAME_LEN]; /* name of the module */
 29         struct module *me;              /* pointer to self */
 30         const struct nf_conntrack_expect_policy *expect_policy;
 31 
 32         /* length of internal data, ie. sizeof(struct nf_ct_*_master) */
 33         size_t data_len;
 34 
 35         /* Tuple of things we will help (compared against server response) */
 36         struct nf_conntrack_tuple tuple;
 37 
 38         /* Function to call when data passes; return verdict, or -1 to
 39            invalidate. */
 40         int (*help)(struct sk_buff *skb,
 41                     unsigned int protoff,
 42                     struct nf_conn *ct,
 43                     enum ip_conntrack_info conntrackinfo);
 44 
 45         void (*destroy)(struct nf_conn *ct);
 46 
 47         int (*from_nlattr)(struct nlattr *attr, struct nf_conn *ct);
 48         int (*to_nlattr)(struct sk_buff *skb, const struct nf_conn *ct);
 49         unsigned int expect_class_max;
 50 
 51         unsigned int flags;
 52         unsigned int queue_num;         /* For user-space helpers. */
 53 };
 54 
 55 extern struct nf_conntrack_helper *
 56 __nf_conntrack_helper_find(const char *name, u16 l3num, u8 protonum);
 57 
 58 extern struct nf_conntrack_helper *
 59 nf_conntrack_helper_try_module_get(const char *name, u16 l3num, u8 protonum);
 60 
 61 extern int nf_conntrack_helper_register(struct nf_conntrack_helper *);
 62 extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *);
 63 
 64 extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, struct nf_conntrack_helper *helper, gfp_t gfp);
 65 
 66 extern int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl,
 67                                      gfp_t flags);
 68 
 69 extern void nf_ct_helper_destroy(struct nf_conn *ct);
 70 
 71 static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct)
 72 {
 73         return nf_ct_ext_find(ct, NF_CT_EXT_HELPER);
 74 }
 75 
 76 static inline void *nfct_help_data(const struct nf_conn *ct)
 77 {
 78         struct nf_conn_help *help;
 79 
 80         help = nf_ct_ext_find(ct, NF_CT_EXT_HELPER);
 81 
 82         return (void *)help->data;
 83 }
 84 
 85 extern int nf_conntrack_helper_pernet_init(struct net *net);
 86 extern void nf_conntrack_helper_pernet_fini(struct net *net);
 87 
 88 extern int nf_conntrack_helper_init(void);
 89 extern void nf_conntrack_helper_fini(void);
 90 
 91 extern int nf_conntrack_broadcast_help(struct sk_buff *skb,
 92                                        unsigned int protoff,
 93                                        struct nf_conn *ct,
 94                                        enum ip_conntrack_info ctinfo,
 95                                        unsigned int timeout);
 96 
 97 struct nf_ct_helper_expectfn {
 98         struct list_head head;
 99         const char *name;
100         void (*expectfn)(struct nf_conn *ct, struct nf_conntrack_expect *exp);
101 };
102 
103 __printf(3,4)
104 void nf_ct_helper_log(struct sk_buff *skb, const struct nf_conn *ct,
105                       const char *fmt, ...);
106 
107 void nf_ct_helper_expectfn_register(struct nf_ct_helper_expectfn *n);
108 void nf_ct_helper_expectfn_unregister(struct nf_ct_helper_expectfn *n);
109 struct nf_ct_helper_expectfn *
110 nf_ct_helper_expectfn_find_by_name(const char *name);
111 struct nf_ct_helper_expectfn *
112 nf_ct_helper_expectfn_find_by_symbol(const void *symbol);
113 
114 extern struct hlist_head *nf_ct_helper_hash;
115 extern unsigned int nf_ct_helper_hsize;
116 
117 #endif /*_NF_CONNTRACK_HELPER_H*/
118 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp