/
usr
/
src
/
kernels
/
4.18.0-553.121.1.el8_10.x86_64
/
include
/
net
/
/usr/src/kernels/4.18.0-553.121.1.el8_10.x86_64/include/net
mkdir
upload
Name
Size
Mode
Actions
9p/
-
0755
rm
bluetooth/
-
0755
rm
caif/
-
0755
rm
iucv/
-
0755
rm
mana/
-
0755
rm
netfilter/
-
0755
rm
netns/
-
0755
rm
nfc/
-
0755
rm
phonet/
-
0755
rm
sctp/
-
0755
rm
tc_act/
-
0755
rm
6lowpan.h
10271
0644
edit
dl
rm
act_api.h
9478
0644
edit
dl
rm
addrconf.h
13826
0644
edit
dl
rm
af_ieee802154.h
1591
0644
edit
dl
rm
af_rxrpc.h
2976
0644
edit
dl
rm
af_unix.h
2272
0644
edit
dl
rm
af_vsock.h
7295
0644
edit
dl
rm
ah.h
382
0644
edit
dl
rm
arp.h
2052
0644
edit
dl
rm
atmclip.h
1515
0644
edit
dl
rm
ax25.h
14999
0644
edit
dl
rm
ax88796.h
1488
0644
edit
dl
rm
bareudp.h
333
0644
edit
dl
rm
bonding.h
20225
0644
edit
dl
rm
bond_3ad.h
9629
0644
edit
dl
rm
bond_alb.h
6251
0644
edit
dl
rm
bond_options.h
3916
0644
edit
dl
rm
bpf_sk_storage.h
1802
0644
edit
dl
rm
busy_poll.h
4973
0644
edit
dl
rm
calipso.h
2199
0644
edit
dl
rm
cfg80211-wext.h
1900
0644
edit
dl
rm
cfg80211.h
325844
0644
edit
dl
rm
cfg802154.h
11175
0644
edit
dl
rm
checksum.h
4850
0644
edit
dl
rm
cipso_ipv4.h
8399
0644
edit
dl
rm
cls_cgroup.h
2301
0644
edit
dl
rm
codel.h
6000
0644
edit
dl
rm
codel_impl.h
8500
0644
edit
dl
rm
codel_qdisc.h
3001
0644
edit
dl
rm
compat.h
1711
0644
edit
dl
rm
datalink.h
619
0644
edit
dl
rm
dcbevent.h
1293
0644
edit
dl
rm
dcbnl.h
5267
0644
edit
dl
rm
devlink.h
64711
0644
edit
dl
rm
dn.h
7046
0644
edit
dl
rm
dn_dev.h
5488
0644
edit
dl
rm
dn_fib.h
4077
0644
edit
dl
rm
dn_neigh.h
968
0644
edit
dl
rm
dn_nsp.h
5966
0644
edit
dl
rm
dn_route.h
4500
0644
edit
dl
rm
dropreason-core.h
12063
0644
edit
dl
rm
drop_monitor.h
901
0644
edit
dl
rm
dsa.h
16605
0644
edit
dl
rm
dsfield.h
1139
0644
edit
dl
rm
dst.h
14870
0644
edit
dl
rm
dst_cache.h
2596
0644
edit
dl
rm
dst_metadata.h
5521
0644
edit
dl
rm
dst_ops.h
2564
0644
edit
dl
rm
erspan.h
8527
0644
edit
dl
rm
esp.h
1190
0644
edit
dl
rm
espintcp.h
966
0644
edit
dl
rm
ethoc.h
537
0644
edit
dl
rm
failover.h
1178
0644
edit
dl
rm
fib_notifier.h
1476
0644
edit
dl
rm
fib_rules.h
5728
0644
edit
dl
rm
firewire.h
636
0644
edit
dl
rm
flow.h
6353
0644
edit
dl
rm
flow_dissector.h
11284
0644
edit
dl
rm
flow_offload.h
17797
0644
edit
dl
rm
fou.h
549
0644
edit
dl
rm
fq.h
2497
0644
edit
dl
rm
fq_impl.h
8144
0644
edit
dl
rm
garp.h
2678
0644
edit
dl
rm
genetlink.h
14647
0644
edit
dl
rm
geneve.h
1898
0644
edit
dl
rm
gen_stats.h
3034
0644
edit
dl
rm
gre.h
3377
0644
edit
dl
rm
gro_cells.h
443
0644
edit
dl
rm
gtp.h
633
0644
edit
dl
rm
gue.h
3311
0644
edit
dl
rm
hwbm.h
937
0644
edit
dl
rm
icmp.h
1765
0644
edit
dl
rm
ieee80211_radiotap.h
23017
0644
edit
dl
rm
ieee802154_netdev.h
9358
0644
edit
dl
rm
ife.h
1057
0644
edit
dl
rm
if_inet6.h
6591
0644
edit
dl
rm
ila.h
498
0644
edit
dl
rm
inet6_connection_sock.h
976
0644
edit
dl
rm
inet6_hashtables.h
3746
0644
edit
dl
rm
inetpeer.h
3372
0644
edit
dl
rm
inet_common.h
2614
0644
edit
dl
rm
inet_connection_sock.h
11981
0644
edit
dl
rm
inet_ecn.h
8071
0644
edit
dl
rm
inet_frag.h
4816
0644
edit
dl
rm
inet_hashtables.h
13847
0644
edit
dl
rm
inet_sock.h
9828
0644
edit
dl
rm
inet_timewait_sock.h
3926
0644
edit
dl
rm
ip.h
21354
0644
edit
dl
rm
ip6_checksum.h
2981
0644
edit
dl
rm
ip6_fib.h
13766
0644
edit
dl
rm
ip6_route.h
9228
0644
edit
dl
rm
ip6_tunnel.h
5096
0644
edit
dl
rm
ipcomp.h
659
0644
edit
dl
rm
ipconfig.h
811
0644
edit
dl
rm
ipv6.h
32741
0644
edit
dl
rm
ipv6_frag.h
3321
0644
edit
dl
rm
ipv6_stubs.h
2671
0644
edit
dl
rm
ipx.h
4386
0644
edit
dl
rm
ip_fib.h
14290
0644
edit
dl
rm
ip_tunnels.h
14697
0644
edit
dl
rm
ip_vs.h
49407
0644
edit
dl
rm
iw_handler.h
21413
0644
edit
dl
rm
kcm.h
5083
0644
edit
dl
rm
l3mdev.h
6743
0644
edit
dl
rm
lag.h
409
0644
edit
dl
rm
lapb.h
4869
0644
edit
dl
rm
lib80211.h
4017
0644
edit
dl
rm
llc.h
4464
0644
edit
dl
rm
llc_conn.h
4155
0644
edit
dl
rm
llc_c_ac.h
9537
0644
edit
dl
rm
llc_c_ev.h
10940
0644
edit
dl
rm
llc_c_st.h
1762
0644
edit
dl
rm
llc_if.h
2210
0644
edit
dl
rm
llc_pdu.h
14783
0644
edit
dl
rm
llc_sap.h
1108
0644
edit
dl
rm
llc_s_ac.h
1591
0644
edit
dl
rm
llc_s_ev.h
2255
0644
edit
dl
rm
llc_s_st.h
947
0644
edit
dl
rm
lwtunnel.h
6563
0644
edit
dl
rm
mac80211.h
294437
0644
edit
dl
rm
mac802154.h
15633
0644
edit
dl
rm
mip6.h
1617
0644
edit
dl
rm
mld.h
2870
0644
edit
dl
rm
mpls.h
1340
0644
edit
dl
rm
mpls_iptunnel.h
827
0644
edit
dl
rm
mptcp.h
6242
0644
edit
dl
rm
mrp.h
3103
0644
edit
dl
rm
ncsi.h
1964
0644
edit
dl
rm
ndisc.h
15095
0644
edit
dl
rm
neighbour.h
16289
0644
edit
dl
rm
netdev_queues.h
5609
0644
edit
dl
rm
netevent.h
1044
0644
edit
dl
rm
netlabel.h
21236
0644
edit
dl
rm
netlink.h
63253
0644
edit
dl
rm
netprio_cgroup.h
1260
0644
edit
dl
rm
netrom.h
7896
0644
edit
dl
rm
net_failover.h
1023
0644
edit
dl
rm
net_namespace.h
14177
0644
edit
dl
rm
net_ratelimit.h
220
0644
edit
dl
rm
nexthop.h
865
0644
edit
dl
rm
nl802154.h
12385
0644
edit
dl
rm
nsh.h
12602
0644
edit
dl
rm
p8022.h
447
0644
edit
dl
rm
page_pool.h
6985
0644
edit
dl
rm
pie.h
3684
0644
edit
dl
rm
ping.h
3197
0644
edit
dl
rm
pkt_cls.h
26178
0644
edit
dl
rm
pkt_sched.h
6543
0644
edit
dl
rm
pptp.h
557
0644
edit
dl
rm
protocol.h
4320
0644
edit
dl
rm
psample.h
1083
0644
edit
dl
rm
psnap.h
351
0644
edit
dl
rm
raw.h
2161
0644
edit
dl
rm
rawv6.h
856
0644
edit
dl
rm
red.h
11600
0644
edit
dl
rm
regulatory.h
10961
0644
edit
dl
rm
request_sock.h
6871
0644
edit
dl
rm
rose.h
7802
0644
edit
dl
rm
route.h
11390
0644
edit
dl
rm
rsi_91x.h
1710
0644
edit
dl
rm
rtnetlink.h
7212
0644
edit
dl
rm
sch_generic.h
33841
0644
edit
dl
rm
scm.h
3671
0644
edit
dl
rm
secure_seq.h
855
0644
edit
dl
rm
seg6.h
1874
0644
edit
dl
rm
seg6_hmac.h
1699
0644
edit
dl
rm
seg6_local.h
870
0644
edit
dl
rm
slhc_vj.h
6831
0644
edit
dl
rm
smc.h
2155
0644
edit
dl
rm
snmp.h
5482
0644
edit
dl
rm
sock.h
79182
0644
edit
dl
rm
sock_reuseport.h
1565
0644
edit
dl
rm
Space.h
1094
0644
edit
dl
rm
stp.h
383
0644
edit
dl
rm
strparser.h
4340
0644
edit
dl
rm
switchdev.h
17812
0644
edit
dl
rm
tcp.h
73125
0644
edit
dl
rm
tcp_states.h
1540
0644
edit
dl
rm
tc_wrapper.h
7033
0644
edit
dl
rm
timewait_sock.h
1136
0644
edit
dl
rm
tipc.h
2405
0644
edit
dl
rm
tls.h
21363
0644
edit
dl
rm
tls_toe.h
3006
0644
edit
dl
rm
transp_v6.h
1996
0644
edit
dl
rm
tso.h
515
0644
edit
dl
rm
tun_proto.h
988
0644
edit
dl
rm
udp.h
16481
0644
edit
dl
rm
udplite.h
3762
0644
edit
dl
rm
udp_tunnel.h
13376
0644
edit
dl
rm
vsock_addr.h
662
0644
edit
dl
rm
vxlan.h
13541
0644
edit
dl
rm
wext.h
1510
0644
edit
dl
rm
wimax.h
20445
0644
edit
dl
rm
x25.h
9658
0644
edit
dl
rm
x25device.h
387
0644
edit
dl
rm
xdp.h
9436
0644
edit
dl
rm
xdp_priv.h
446
0644
edit
dl
rm
xdp_sock.h
2094
0644
edit
dl
rm
xdp_sock_drv.h
6423
0644
edit
dl
rm
xfrm.h
59628
0644
edit
dl
rm
xsk_buff_pool.h
6550
0644
edit
dl
rm
Edit:
/usr/src/kernels/4.18.0-553.121.1.el8_10.x86_64/include/net/net_namespace.h
(14177B)
/* SPDX-License-Identifier: GPL-2.0 */ /* * Operations on the network namespace */ #ifndef __NET_NET_NAMESPACE_H #define __NET_NET_NAMESPACE_H #include <linux/rh_kabi.h> #include <linux/atomic.h> #include <linux/refcount.h> #include <linux/workqueue.h> #include <linux/list.h> #include <linux/sysctl.h> #include <linux/uidgid.h> #include <net/flow.h> #include <net/netns/core.h> #include <net/netns/mib.h> #include <net/netns/unix.h> #include <net/netns/packet.h> #include <net/netns/ipv4.h> #include <net/netns/ipv6.h> #include <net/netns/ieee802154_6lowpan.h> #include <net/netns/sctp.h> #include <net/netns/dccp.h> #include <net/netns/netfilter.h> #include <net/netns/x_tables.h> #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) #include <net/netns/conntrack.h> #endif #include <net/netns/nftables.h> #include <net/netns/xfrm.h> #include <net/netns/mpls.h> #include <net/netns/can.h> #include RH_KABI_HIDE_INCLUDE(<net/netns/xdp.h>) #include <net/netns/smc.h> #include <net/netns/bpf.h> #include <linux/ns_common.h> #include <linux/idr.h> #include <linux/skbuff.h> #include <linux/notifier.h> #include <linux/siphash.h> struct user_namespace; struct proc_dir_entry; struct net_device; struct sock; struct ctl_table_header; struct net_generic; struct uevent_sock; struct netns_ipvs; struct bpf_prog; #define NETDEV_HASHBITS 8 #define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS) struct net { refcount_t passive; /* To decided when the network * namespace should be freed. */ refcount_t count; /* To decided when the network * namespace should be shut down. */ spinlock_t rules_mod_lock; RH_KABI_DEPRECATE(atomic64_t, cookie_gen) struct list_head list; /* list of network namespaces */ struct list_head exit_list; /* To linked to call pernet exit * methods on dead net ( * pernet_ops_rwsem read locked), * or to unregister pernet ops * (pernet_ops_rwsem write locked). */ struct llist_node cleanup_list; /* namespaces on death row */ struct user_namespace *user_ns; /* Owning user namespace */ struct ucounts *ucounts; spinlock_t nsid_lock; struct idr netns_ids; struct ns_common ns; struct proc_dir_entry *proc_net; struct proc_dir_entry *proc_net_stat; #ifdef CONFIG_SYSCTL struct ctl_table_set sysctls; #endif struct sock *rtnl; /* rtnetlink socket */ struct sock *genl_sock; struct uevent_sock *uevent_sock; /* uevent socket */ struct list_head dev_base_head; struct hlist_head *dev_name_head; struct hlist_head *dev_index_head; unsigned int dev_base_seq; /* protected by rtnl_mutex */ int ifindex; unsigned int dev_unreg_count; /* core fib_rules */ struct list_head rules_ops; RH_KABI_DEPRECATE(struct list_head, fib_notifier_ops) struct net_device *loopback_dev; /* The loopback */ struct netns_core core; struct netns_mib mib; struct netns_packet packet; struct netns_unix unx; struct netns_ipv4 ipv4; #if IS_ENABLED(CONFIG_IPV6) struct netns_ipv6 ipv6; #endif #if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN) struct netns_ieee802154_lowpan ieee802154_lowpan; #endif #if defined(CONFIG_IP_SCTP) || defined(CONFIG_IP_SCTP_MODULE) struct netns_sctp sctp; #endif #if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE) struct netns_dccp dccp; #endif #ifdef CONFIG_NETFILTER struct netns_nf nf; struct netns_xt xt; #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) struct netns_ct ct; #endif #if defined(CONFIG_NF_TABLES) || defined(CONFIG_NF_TABLES_MODULE) struct netns_nftables nft; #endif #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) struct netns_nf_frag nf_frag; struct ctl_table_header *nf_frag_frags_hdr; #endif struct sock *nfnl; struct sock *nfnl_stash; #if IS_ENABLED(CONFIG_NETFILTER_NETLINK_ACCT) struct list_head nfnl_acct_list; #endif #if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT) struct list_head nfct_timeout_list; #endif #endif #ifdef CONFIG_WEXT_CORE struct sk_buff_head wext_nlevents; #endif struct net_generic __rcu *gen; /* Note : following structs are cache line aligned */ #ifdef CONFIG_XFRM struct netns_xfrm xfrm; #endif #if IS_ENABLED(CONFIG_IP_VS) struct netns_ipvs *ipvs; #endif #if IS_ENABLED(CONFIG_MPLS) struct netns_mpls mpls; #endif #if IS_ENABLED(CONFIG_CAN) struct netns_can can; #endif struct sock *diag_nlsk; atomic_t fnhe_genid; RH_KABI_EXTEND(int ipv4_sysctl_ip_fwd_update_priority) RH_KABI_EXTEND(int ipv4_sysctl_tcp_min_snd_mss) RH_KABI_EXTEND(void *rh_unused) /* available for reuse */ RH_KABI_EXTEND(siphash_key_t ipv4_ip_id_key) RH_KABI_EXTEND(u32 hash_mix) RH_KABI_EXTEND_WITH_SIZE(struct netns_xdp xdp, 21) RH_KABI_EXTEND(int sctp_ecn_enable) RH_KABI_EXTEND(struct list_head xfrm_inexact_bins) RH_KABI_EXTEND(struct raw_notifier_head netdev_chain) RH_KABI_EXTEND(struct list_head nft_module_list) RH_KABI_EXTEND(struct list_head nft_notify_list) RH_KABI_EXTEND(struct mutex nft_commit_mutex) #ifdef CONFIG_NF_CT_PROTO_GRE RH_KABI_EXTEND(struct nf_gre_net nf_ct_gre) #endif RH_KABI_EXTEND(DEFINE_SNMP_STAT(struct linux_tls_mib, mib_tls_statistics)) #ifdef CONFIG_MPTCP RH_KABI_EXTEND(struct netns_mptcp_mib mptcp_mib) #endif RH_KABI_EXTEND(atomic64_t net_cookie) /* written once */ RH_KABI_EXTEND(int sctp_pf_expose) RH_KABI_EXTEND(int sctp_ps_retrans) RH_KABI_EXTEND_WITH_SIZE(struct netns_bpf bpf, 128) /* UDP tunneling listening sock. */ RH_KABI_EXTEND(struct sock *sctp_udp4_sock) RH_KABI_EXTEND(struct sock *sctp_udp6_sock) /* UDP tunneling listening port. */ RH_KABI_EXTEND(int sctp_udp_port) /* UDP tunneling remote encap port. */ RH_KABI_EXTEND(int sctp_encap_port) RH_KABI_EXTEND(seqcount_spinlock_t xfrm_state_hash_generation) RH_KABI_EXTEND(unsigned int nf_tcp_net_offload_timeout) RH_KABI_EXTEND(unsigned int nf_udp_net_offload_timeout) #if IS_ENABLED(CONFIG_SMC) RH_KABI_EXTEND(struct netns_smc smc) #endif RH_KABI_EXTEND(seqcount_spinlock_t xfrm_policy_hash_generation) /* The interval for PLPMTUD probe timer */ RH_KABI_EXTEND(unsigned int sctp_probe_interval) RH_KABI_EXTEND(struct hlist_head __rcu *xfrm_state_byseq) RH_KABI_EXTEND(u32 ipv4_sysctl_fib_multipath_hash_fields) RH_KABI_EXTEND(u32 ipv6_sysctl_multipath_hash_fields) #if IS_ENABLED(CONFIG_RPS) && IS_ENABLED(CONFIG_SYSCTL) RH_KABI_EXTEND(struct cpumask *core_rps_default_mask) #endif RH_KABI_EXTEND(u64 nft_table_handle) RH_KABI_EXTEND(int sysctl_txrehash) RH_KABI_EXTEND(u8 ipv4_sysctl_tcp_shrink_window) } __randomize_layout; #include <linux/seq_file_net.h> /* Init's network namespace */ extern struct net init_net; #ifdef CONFIG_NET_NS struct net *copy_net_ns(unsigned long flags, struct user_namespace *user_ns, struct net *old_net); void net_ns_get_ownership(const struct net *net, kuid_t *uid, kgid_t *gid); void net_ns_barrier(void); #else /* CONFIG_NET_NS */ #include <linux/sched.h> #include <linux/nsproxy.h> static inline struct net *copy_net_ns(unsigned long flags, struct user_namespace *user_ns, struct net *old_net) { if (flags & CLONE_NEWNET) return ERR_PTR(-EINVAL); return old_net; } static inline void net_ns_get_ownership(const struct net *net, kuid_t *uid, kgid_t *gid) { *uid = GLOBAL_ROOT_UID; *gid = GLOBAL_ROOT_GID; } static inline void net_ns_barrier(void) {} #endif /* CONFIG_NET_NS */ extern struct list_head net_namespace_list; struct net *get_net_ns_by_pid(pid_t pid); struct net *get_net_ns_by_fd(int fd); u64 __net_gen_cookie(struct net *net); #ifdef CONFIG_SYSCTL void ipx_register_sysctl(void); void ipx_unregister_sysctl(void); #else #define ipx_register_sysctl() #define ipx_unregister_sysctl() #endif #ifdef CONFIG_NET_NS void __put_net(struct net *net); static inline struct net *get_net(struct net *net) { refcount_inc(&net->count); return net; } static inline struct net *maybe_get_net(struct net *net) { /* Used when we know struct net exists but we * aren't guaranteed a previous reference count * exists. If the reference count is zero this * function fails and returns NULL. */ if (!refcount_inc_not_zero(&net->count)) net = NULL; return net; } static inline void put_net(struct net *net) { if (refcount_dec_and_test(&net->count)) __put_net(net); } static inline int net_eq(const struct net *net1, const struct net *net2) { return net1 == net2; } static inline int check_net(const struct net *net) { return refcount_read(&net->count) != 0; } void net_drop_ns(void *); #else static inline struct net *get_net(struct net *net) { return net; } static inline void put_net(struct net *net) { } static inline struct net *maybe_get_net(struct net *net) { return net; } static inline int net_eq(const struct net *net1, const struct net *net2) { return 1; } static inline int check_net(const struct net *net) { return 1; } #define net_drop_ns NULL #endif typedef struct { #ifdef CONFIG_NET_NS struct net __rcu *net; #endif } possible_net_t; static inline void write_pnet(possible_net_t *pnet, struct net *net) { #ifdef CONFIG_NET_NS rcu_assign_pointer(pnet->net, net); #endif } static inline struct net *read_pnet(const possible_net_t *pnet) { #ifdef CONFIG_NET_NS return rcu_dereference_protected(pnet->net, true); #else return &init_net; #endif } static inline struct net *read_pnet_rcu(const possible_net_t *pnet) { #ifdef CONFIG_NET_NS return rcu_dereference(pnet->net); #else return &init_net; #endif } /* Protected by net_rwsem */ #define for_each_net(VAR) \ list_for_each_entry(VAR, &net_namespace_list, list) #define for_each_net_continue_reverse(VAR) \ list_for_each_entry_continue_reverse(VAR, &net_namespace_list, list) #define for_each_net_rcu(VAR) \ list_for_each_entry_rcu(VAR, &net_namespace_list, list) #ifdef CONFIG_NET_NS #define __net_init #define __net_exit #define __net_initdata #define __net_initconst #else #define __net_init __init #define __net_exit __ref #define __net_initdata __initdata #define __net_initconst __initconst #endif int peernet2id_alloc(struct net *net, struct net *peer, gfp_t gfp); int peernet2id(const struct net *net, struct net *peer); bool peernet_has_id(const struct net *net, struct net *peer); struct net *get_net_ns_by_id(const struct net *net, int id); struct pernet_operations { struct list_head list; /* * Below methods are called without any exclusive locks. * More than one net may be constructed and destructed * in parallel on several cpus. Every pernet_operations * have to keep in mind all other pernet_operations and * to introduce a locking, if they share common resources. * * The only time they are called with exclusive lock is * from register_pernet_subsys(), unregister_pernet_subsys() * register_pernet_device() and unregister_pernet_device(). * * Exit methods using blocking RCU primitives, such as * synchronize_rcu(), should be implemented via exit_batch. * Then, destruction of a group of net requires single * synchronize_rcu() related to these pernet_operations, * instead of separate synchronize_rcu() for every net. * Please, avoid synchronize_rcu() at all, where it's possible. * * Note that a combination of pre_exit() and exit() can * be used, since a synchronize_rcu() is guaranteed between * the calls. */ int (*init)(struct net *net); void (*pre_exit)(struct net *net); void (*exit)(struct net *net); void (*exit_batch)(struct list_head *net_exit_list); unsigned int *id; size_t size; }; /* * Use these carefully. If you implement a network device and it * needs per network namespace operations use device pernet operations, * otherwise use pernet subsys operations. * * Network interfaces need to be removed from a dying netns _before_ * subsys notifiers can be called, as most of the network code cleanup * (which is done from subsys notifiers) runs with the assumption that * dev_remove_pack has been called so no new packets will arrive during * and after the cleanup functions have been called. dev_remove_pack * is not per namespace so instead the guarantee of no more packets * arriving in a network namespace is provided by ensuring that all * network devices and all sockets have left the network namespace * before the cleanup methods are called. * * For the longest time the ipv4 icmp code was registered as a pernet * device which caused kernel oops, and panics during network * namespace cleanup. So please don't get this wrong. */ int register_pernet_subsys(struct pernet_operations *); void unregister_pernet_subsys(struct pernet_operations *); int register_pernet_device(struct pernet_operations *); void unregister_pernet_device(struct pernet_operations *); struct ctl_table; struct ctl_table_header; #ifdef CONFIG_SYSCTL int net_sysctl_init(void); struct ctl_table_header *register_net_sysctl(struct net *net, const char *path, struct ctl_table *table); void unregister_net_sysctl_table(struct ctl_table_header *header); #else static inline int net_sysctl_init(void) { return 0; } static inline struct ctl_table_header *register_net_sysctl(struct net *net, const char *path, struct ctl_table *table) { return NULL; } static inline void unregister_net_sysctl_table(struct ctl_table_header *header) { } #endif static inline int rt_genid_ipv4(const struct net *net) { return atomic_read(&net->ipv4.rt_genid); } static inline void rt_genid_bump_ipv4(struct net *net) { atomic_inc(&net->ipv4.rt_genid); } extern void (*__fib6_flush_trees)(struct net *net); static inline void rt_genid_bump_ipv6(struct net *net) { if (__fib6_flush_trees) __fib6_flush_trees(net); } #if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN) static inline struct netns_ieee802154_lowpan * net_ieee802154_lowpan(struct net *net) { return &net->ieee802154_lowpan; } #endif /* For callers who don't really care about whether it's IPv4 or IPv6 */ static inline void rt_genid_bump_all(struct net *net) { rt_genid_bump_ipv4(net); rt_genid_bump_ipv6(net); } static inline int fnhe_genid(const struct net *net) { return atomic_read(&net->fnhe_genid); } static inline void fnhe_genid_bump(struct net *net) { atomic_inc(&net->fnhe_genid); } #endif /* __NET_NET_NAMESPACE_H */
Save
cmd:
run