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

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

Version: ~ [ linux-5.12 ] ~ [ linux-5.11.16 ] ~ [ linux-5.10.32 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.114 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.188 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.231 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.267 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.267 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ 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 {
 14         /* Conntrack expectation list member */
 15         struct hlist_node lnode;
 16 
 17         /* Hash member */
 18         struct hlist_node hnode;
 19 
 20         /* We expect this tuple, with the following mask */
 21         struct nf_conntrack_tuple tuple;
 22         struct nf_conntrack_tuple_mask mask;
 23 
 24         /* Function to call after setup and insertion */
 25         void (*expectfn)(struct nf_conn *new,
 26                          struct nf_conntrack_expect *this);
 27 
 28         /* Helper to assign to new connection */
 29         struct nf_conntrack_helper *helper;
 30 
 31         /* The conntrack of the master connection */
 32         struct nf_conn *master;
 33 
 34         /* Timer function; deletes the expectation. */
 35         struct timer_list timeout;
 36 
 37         /* Usage count. */
 38         atomic_t use;
 39 
 40         /* Flags */
 41         unsigned int flags;
 42 
 43         /* Expectation class */
 44         unsigned int class;
 45 
 46 #ifdef CONFIG_NF_NAT_NEEDED
 47         __be32 saved_ip;
 48         /* This is the original per-proto part, used to map the
 49          * expected connection the way the recipient expects. */
 50         union nf_conntrack_man_proto saved_proto;
 51         /* Direction relative to the master connection. */
 52         enum ip_conntrack_dir dir;
 53 #endif
 54 
 55         struct rcu_head rcu;
 56 };
 57 
 58 static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp)
 59 {
 60 #ifdef CONFIG_NET_NS
 61         return exp->master->ct_net;     /* by definition */
 62 #else
 63         return &init_net;
 64 #endif
 65 }
 66 
 67 struct nf_conntrack_expect_policy
 68 {
 69         unsigned int    max_expected;
 70         unsigned int    timeout;
 71 };
 72 
 73 #define NF_CT_EXPECT_CLASS_DEFAULT      0
 74 
 75 #define NF_CT_EXPECT_PERMANENT  0x1
 76 #define NF_CT_EXPECT_INACTIVE   0x2
 77 
 78 int nf_conntrack_expect_init(struct net *net);
 79 void nf_conntrack_expect_fini(struct net *net);
 80 
 81 struct nf_conntrack_expect *
 82 __nf_ct_expect_find(struct net *net, const struct nf_conntrack_tuple *tuple);
 83 
 84 struct nf_conntrack_expect *
 85 nf_ct_expect_find_get(struct net *net, const struct nf_conntrack_tuple *tuple);
 86 
 87 struct nf_conntrack_expect *
 88 nf_ct_find_expectation(struct net *net, const struct nf_conntrack_tuple *tuple);
 89 
 90 void nf_ct_unlink_expect(struct nf_conntrack_expect *exp);
 91 void nf_ct_remove_expectations(struct nf_conn *ct);
 92 void nf_ct_unexpect_related(struct nf_conntrack_expect *exp);
 93 
 94 /* Allocate space for an expectation: this is mandatory before calling
 95    nf_ct_expect_related.  You will have to call put afterwards. */
 96 struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me);
 97 void nf_ct_expect_init(struct nf_conntrack_expect *, unsigned int, u_int8_t,
 98                        const union nf_inet_addr *,
 99                        const union nf_inet_addr *,
100                        u_int8_t, const __be16 *, const __be16 *);
101 void nf_ct_expect_put(struct nf_conntrack_expect *exp);
102 int nf_ct_expect_related_report(struct nf_conntrack_expect *expect, 
103                                 u32 pid, int report);
104 static inline int nf_ct_expect_related(struct nf_conntrack_expect *expect)
105 {
106         return nf_ct_expect_related_report(expect, 0, 0);
107 }
108 
109 #endif /*_NF_CONNTRACK_EXPECT_H*/
110 
111 

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