Go to the documentation of this file.
4 #ifndef __NET_NET_NAMESPACE_H
5 #define __NET_NET_NAMESPACE_H
9 #include <linux/list.h>
10 #include <linux/sysctl.h>
21 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
35 #define NETDEV_HASHBITS 8
36 #define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS)
45 #ifdef NETNS_REFCNT_DEBUG
82 #if IS_ENABLED(CONFIG_IPV6)
85 #if defined(CONFIG_IP_SCTP) || defined(CONFIG_IP_SCTP_MODULE)
88 #if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE)
91 #ifdef CONFIG_NETFILTER
93 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
96 #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
97 struct netns_nf_frag nf_frag;
100 struct sock *nfnl_stash;
102 #ifdef CONFIG_WEXT_CORE
122 #define LOOPBACK_IFINDEX 1
147 extern void __put_net(
struct net *
net);
149 static inline struct net *get_net(
struct net *
net)
155 static inline struct net *maybe_get_net(
struct net *
net)
167 static inline void put_net(
struct net *net)
174 int net_eq(
const struct net *net1,
const struct net *net2)
183 static inline struct net *get_net(
struct net *net)
188 static inline void put_net(
struct net *net)
192 static inline struct net *maybe_get_net(
struct net *net)
198 int net_eq(
const struct net *net1,
const struct net *net2)
203 #define net_drop_ns NULL
207 #ifdef NETNS_REFCNT_DEBUG
208 static inline struct net *hold_net(
struct net *net)
215 static inline void release_net(
struct net *net)
221 static inline struct net *hold_net(
struct net *net)
226 static inline void release_net(
struct net *net)
233 static inline void write_pnet(
struct net **pnet,
struct net *net)
238 static inline struct net *
read_pnet(
struct net *
const *pnet)
245 #define write_pnet(pnet, net) do { (void)(net);} while (0)
246 #define read_pnet(pnet) (&init_net)
250 #define for_each_net(VAR) \
251 list_for_each_entry(VAR, &net_namespace_list, list)
253 #define for_each_net_rcu(VAR) \
254 list_for_each_entry_rcu(VAR, &net_namespace_list, list)
259 #define __net_initdata
260 #define __net_initconst
262 #define __net_init __init
263 #define __net_exit __exit_refok
264 #define __net_initdata __initdata
265 #define __net_initconst __initconst
321 static inline int rt_genid(
struct net *net)
326 static inline void rt_genid_bump(
struct net *net)