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

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

Version: ~ [ linux-5.6 ] ~ [ linux-5.5.13 ] ~ [ linux-5.4.28 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.113 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.174 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.217 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.217 ] ~ [ 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.82 ] ~ [ 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 expectations.
  3  */
  4 
  5 #ifndef _NF_CONNTRACK_EXPECT_H
  6 #define _NF_CONNTRACK_EXPECT_H
  7 #include <net/netfilter/nf_conntrack.h>
  8 
  9 extern unsigned int nf_ct_expect_hsize;
 10 extern unsigned int nf_ct_expect_max;
 11 
 12 struct nf_conntrack_expect {
 13         /* Conntrack expectation list member */
 14         struct hlist_node lnode;
 15 
 16         /* Hash member */
 17         struct hlist_node hnode;
 18 
 19         /* We expect this tuple, with the following mask */
 20         struct nf_conntrack_tuple tuple;
 21         struct nf_conntrack_tuple_mask mask;
 22 
 23         /* Function to call after setup and insertion */
 24         void (*expectfn)(struct nf_conn *new,
 25                          struct nf_conntrack_expect *this);
 26 
 27         /* Helper to assign to new connection */
 28         struct nf_conntrack_helper *helper;
 29 
 30         /* The conntrack of the master connection */
 31         struct nf_conn *master;
 32 
 33         /* Timer function; deletes the expectation. */
 34         struct timer_list timeout;
 35 
 36         /* Usage count. */
 37         atomic_t use;
 38 
 39         /* Flags */
 40         unsigned int flags;
 41 
 42         /* Expectation class */
 43         unsigned int class;
 44 
 45 #ifdef CONFIG_NF_NAT_NEEDED
 46         union nf_inet_addr saved_addr;
 47         /* This is the original per-proto part, used to map the
 48          * expected connection the way the recipient expects. */
 49         union nf_conntrack_man_proto saved_proto;
 50         /* Direction relative to the master connection. */
 51         enum ip_conntrack_dir dir;
 52 #endif
 53 
 54         struct rcu_head rcu;
 55 };
 56 
 57 static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp)
 58 {
 59         return nf_ct_net(exp->master);
 60 }
 61 
 62 #define NF_CT_EXP_POLICY_NAME_LEN       16
 63 
 64 struct nf_conntrack_expect_policy {
 65         unsigned int    max_expected;
 66         unsigned int    timeout;
 67         char            name[NF_CT_EXP_POLICY_NAME_LEN];
 68 };
 69 
 70 #define NF_CT_EXPECT_CLASS_DEFAULT      0
 71 
 72 int nf_conntrack_expect_pernet_init(struct net *net);
 73 void nf_conntrack_expect_pernet_fini(struct net *net);
 74 
 75 int nf_conntrack_expect_init(void);
 76 void nf_conntrack_expect_fini(void);
 77 
 78 struct nf_conntrack_expect *
 79 __nf_ct_expect_find(struct net *net, u16 zone,
 80                     const struct nf_conntrack_tuple *tuple);
 81 
 82 struct nf_conntrack_expect *
 83 nf_ct_expect_find_get(struct net *net, u16 zone,
 84                       const struct nf_conntrack_tuple *tuple);
 85 
 86 struct nf_conntrack_expect *
 87 nf_ct_find_expectation(struct net *net, u16 zone,
 88                        const struct nf_conntrack_tuple *tuple);
 89 
 90 void nf_ct_unlink_expect_report(struct nf_conntrack_expect *exp,
 91                                 u32 portid, int report);
 92 static inline void nf_ct_unlink_expect(struct nf_conntrack_expect *exp)
 93 {
 94         nf_ct_unlink_expect_report(exp, 0, 0);
 95 }
 96 
 97 void nf_ct_remove_expectations(struct nf_conn *ct);
 98 void nf_ct_unexpect_related(struct nf_conntrack_expect *exp);
 99 
100 /* Allocate space for an expectation: this is mandatory before calling
101    nf_ct_expect_related.  You will have to call put afterwards. */
102 struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me);
103 void nf_ct_expect_init(struct nf_conntrack_expect *, unsigned int, u_int8_t,
104                        const union nf_inet_addr *,
105                        const union nf_inet_addr *,
106                        u_int8_t, const __be16 *, const __be16 *);
107 void nf_ct_expect_put(struct nf_conntrack_expect *exp);
108 int nf_ct_expect_related_report(struct nf_conntrack_expect *expect, 
109                                 u32 portid, int report);
110 static inline int nf_ct_expect_related(struct nf_conntrack_expect *expect)
111 {
112         return nf_ct_expect_related_report(expect, 0, 0);
113 }
114 
115 #endif /*_NF_CONNTRACK_EXPECT_H*/
116 
117 

~ [ 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