net_namespace.h (7057bb975dab827997e0ca9dd92cafef0856b0cc) | net_namespace.h (19efbd93e6fb05eab81856b4fc8d64211dd37088) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Operations on the network namespace 4 */ 5#ifndef __NET_NET_NAMESPACE_H 6#define __NET_NET_NAMESPACE_H 7 8#include <linux/atomic.h> --- 46 unchanged lines hidden (view full) --- 55 * namespace should be shut down. 56 */ 57 spinlock_t rules_mod_lock; 58 59 atomic64_t cookie_gen; 60 61 struct list_head list; /* list of network namespaces */ 62 struct list_head cleanup_list; /* namespaces on death row */ | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Operations on the network namespace 4 */ 5#ifndef __NET_NET_NAMESPACE_H 6#define __NET_NET_NAMESPACE_H 7 8#include <linux/atomic.h> --- 46 unchanged lines hidden (view full) --- 55 * namespace should be shut down. 56 */ 57 spinlock_t rules_mod_lock; 58 59 atomic64_t cookie_gen; 60 61 struct list_head list; /* list of network namespaces */ 62 struct list_head cleanup_list; /* namespaces on death row */ |
63 struct list_head exit_list; /* Use only net_mutex */ 64 | 63 struct list_head exit_list; /* To linked to call pernet exit 64 * methods on dead net (net_sem 65 * read locked), or to unregister 66 * pernet ops (net_sem wr locked). 67 */ |
65 struct user_namespace *user_ns; /* Owning user namespace */ 66 struct ucounts *ucounts; 67 spinlock_t nsid_lock; 68 struct idr netns_ids; 69 70 struct ns_common ns; 71 72 struct proc_dir_entry *proc_net; --- 11 unchanged lines hidden (view full) --- 84 struct hlist_head *dev_index_head; 85 unsigned int dev_base_seq; /* protected by rtnl_mutex */ 86 int ifindex; 87 unsigned int dev_unreg_count; 88 89 /* core fib_rules */ 90 struct list_head rules_ops; 91 | 68 struct user_namespace *user_ns; /* Owning user namespace */ 69 struct ucounts *ucounts; 70 spinlock_t nsid_lock; 71 struct idr netns_ids; 72 73 struct ns_common ns; 74 75 struct proc_dir_entry *proc_net; --- 11 unchanged lines hidden (view full) --- 87 struct hlist_head *dev_index_head; 88 unsigned int dev_base_seq; /* protected by rtnl_mutex */ 89 int ifindex; 90 unsigned int dev_unreg_count; 91 92 /* core fib_rules */ 93 struct list_head rules_ops; 94 |
92 struct list_head fib_notifier_ops; /* protected by net_mutex */ | 95 struct list_head fib_notifier_ops; /* protected by net_sem */ |
93 94 struct net_device *loopback_dev; /* The loopback */ 95 struct netns_core core; 96 struct netns_mib mib; 97 struct netns_packet packet; 98 struct netns_unix unx; 99 struct netns_ipv4 ipv4; 100#if IS_ENABLED(CONFIG_IPV6) --- 207 unchanged lines hidden (view full) --- 308 309struct pernet_operations { 310 struct list_head list; 311 int (*init)(struct net *net); 312 void (*exit)(struct net *net); 313 void (*exit_batch)(struct list_head *net_exit_list); 314 unsigned int *id; 315 size_t size; | 96 97 struct net_device *loopback_dev; /* The loopback */ 98 struct netns_core core; 99 struct netns_mib mib; 100 struct netns_packet packet; 101 struct netns_unix unx; 102 struct netns_ipv4 ipv4; 103#if IS_ENABLED(CONFIG_IPV6) --- 207 unchanged lines hidden (view full) --- 311 312struct pernet_operations { 313 struct list_head list; 314 int (*init)(struct net *net); 315 void (*exit)(struct net *net); 316 void (*exit_batch)(struct list_head *net_exit_list); 317 unsigned int *id; 318 size_t size; |
319 /* 320 * Indicates above methods are allowed to be executed in parallel 321 * with methods of any other pernet_operations, i.e. they are not 322 * need write locked net_sem. 323 */ 324 bool async; |
|
316}; 317 318/* 319 * Use these carefully. If you implement a network device and it 320 * needs per network namespace operations use device pernet operations, 321 * otherwise use pernet subsys operations. 322 * 323 * Network interfaces need to be removed from a dying netns _before_ --- 81 unchanged lines hidden --- | 325}; 326 327/* 328 * Use these carefully. If you implement a network device and it 329 * needs per network namespace operations use device pernet operations, 330 * otherwise use pernet subsys operations. 331 * 332 * Network interfaces need to be removed from a dying netns _before_ --- 81 unchanged lines hidden --- |