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

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

Version: ~ [ linux-5.4-rc7 ] ~ [ linux-5.3.11 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.84 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.154 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.201 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.201 ] ~ [ 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.77 ] ~ [ 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 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * This header is used to share core functionality between the
  4  * standalone connection tracking module, and the compatibility layer's use
  5  * of connection tracking.
  6  *
  7  * 16 Dec 2003: Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp>
  8  *      - generalize L3 protocol dependent part.
  9  *
 10  * Derived from include/linux/netfiter_ipv4/ip_conntrack_core.h
 11  */
 12 
 13 #ifndef _NF_CONNTRACK_CORE_H
 14 #define _NF_CONNTRACK_CORE_H
 15 
 16 #include <linux/netfilter.h>
 17 #include <net/netfilter/nf_conntrack_l3proto.h>
 18 #include <net/netfilter/nf_conntrack_l4proto.h>
 19 #include <net/netfilter/nf_conntrack_ecache.h>
 20 
 21 /* This header is used to share core functionality between the
 22    standalone connection tracking module, and the compatibility layer's use
 23    of connection tracking. */
 24 unsigned int nf_conntrack_in(struct net *net, u_int8_t pf, unsigned int hooknum,
 25                              struct sk_buff *skb);
 26 
 27 int nf_conntrack_init_net(struct net *net);
 28 void nf_conntrack_cleanup_net(struct net *net);
 29 void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list);
 30 
 31 int nf_conntrack_proto_pernet_init(struct net *net);
 32 void nf_conntrack_proto_pernet_fini(struct net *net);
 33 
 34 int nf_conntrack_proto_init(void);
 35 void nf_conntrack_proto_fini(void);
 36 
 37 int nf_conntrack_init_start(void);
 38 void nf_conntrack_cleanup_start(void);
 39 
 40 void nf_conntrack_init_end(void);
 41 void nf_conntrack_cleanup_end(void);
 42 
 43 bool nf_ct_get_tuple(const struct sk_buff *skb, unsigned int nhoff,
 44                      unsigned int dataoff, u_int16_t l3num, u_int8_t protonum,
 45                      struct net *net,
 46                      struct nf_conntrack_tuple *tuple,
 47                      const struct nf_conntrack_l3proto *l3proto,
 48                      const struct nf_conntrack_l4proto *l4proto);
 49 
 50 bool nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
 51                         const struct nf_conntrack_tuple *orig,
 52                         const struct nf_conntrack_l3proto *l3proto,
 53                         const struct nf_conntrack_l4proto *l4proto);
 54 
 55 /* Find a connection corresponding to a tuple. */
 56 struct nf_conntrack_tuple_hash *
 57 nf_conntrack_find_get(struct net *net,
 58                       const struct nf_conntrack_zone *zone,
 59                       const struct nf_conntrack_tuple *tuple);
 60 
 61 int __nf_conntrack_confirm(struct sk_buff *skb);
 62 
 63 /* Confirm a connection: returns NF_DROP if packet must be dropped. */
 64 static inline int nf_conntrack_confirm(struct sk_buff *skb)
 65 {
 66         struct nf_conn *ct = (struct nf_conn *)skb_nfct(skb);
 67         int ret = NF_ACCEPT;
 68 
 69         if (ct) {
 70                 if (!nf_ct_is_confirmed(ct))
 71                         ret = __nf_conntrack_confirm(skb);
 72                 if (likely(ret == NF_ACCEPT))
 73                         nf_ct_deliver_cached_events(ct);
 74         }
 75         return ret;
 76 }
 77 
 78 void
 79 print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple,
 80             const struct nf_conntrack_l3proto *l3proto,
 81             const struct nf_conntrack_l4proto *proto);
 82 
 83 #define CONNTRACK_LOCKS 1024
 84 
 85 extern spinlock_t nf_conntrack_locks[CONNTRACK_LOCKS];
 86 void nf_conntrack_lock(spinlock_t *lock);
 87 
 88 extern spinlock_t nf_conntrack_expect_lock;
 89 
 90 #endif /* _NF_CONNTRACK_CORE_H */
 91 

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