有些网络设备和网络子系统必须由独特的网络命名空间数据,为了提供这种支持,添加了结构pernet_operations,其包含回调函数init和exit,
用于执行设备初始化和清理工作。
linux-4.1.2\net
include/net/net_namespace.h
277 struct pernet_operations {
278 struct list_head list;
279 int (*init)(struct net *net);
280 void (*exit)(struct net *net);
281 void (*exit_batch)(struct list_head *net_exit_list);
282 int *id;
283 size_t size;
284 };
285
代码中 pernet_operations
pernet_operations 638 8021q/vlan.c static struct pernet_operations vlan_net_ops = {
pernet_operations 181 bridge/br.c static struct pernet_operations br_net_ops = {
pernet_operations 73 bridge/netfilter/ebtable_broute.c static struct pernet_operations broute_net_ops = {
pernet_operations 110 bridge/netfilter/ebtable_filter.c static struct pernet_operations frame_filter_net_ops = {
pernet_operations 110 bridge/netfilter/ebtable_nat.c static struct pernet_operations frame_nat_net_ops = {
pernet_operations 62 bridge/netfilter/nf_log_bridge.c static struct pernet_operations nf_log_bridge_net_ops = {
pernet_operations 150 bridge/netfilter/nf_tables_bridge.c static struct pernet_operations nf_tables_bridge_net_ops = {
pernet_operations 543 caif/caif_dev.c static struct pernet_operations caif_net_ops = {
pernet_operations 7338 core/dev.c static struct pernet_operations __net_initdata netdev_net_ops = {
pernet_operations 7438 core/dev.c static struct pernet_operations __net_initdata default_device_ops = {
pernet_operations 769 core/fib_rules.c static struct pernet_operations fib_rules_net_ops = {
pernet_operations 350 core/net-procfs.c static struct pernet_operations __net_initdata dev_proc_ops = {
pernet_operations 412 core/net-procfs.c static struct pernet_operations __net_initdata dev_mc_net_ops = {
pernet_operations 236 core/net_namespace.c const struct pernet_operations *ops, *saved_ops;
pernet_operations 347 core/net_namespace.c const struct pernet_operations *ops;
pernet_operations 484 core/net_namespace.c static struct pernet_operations __net_initdata net_ns_ops = {
pernet_operations 3819 core/pktgen.c static struct pernet_operations pg_net_ops = {
pernet_operations 3314 core/rtnetlink.c static struct pernet_operations rtnetlink_net_ops = {
pernet_operations 2674 core/sock.c static struct pernet_operations net_inuse_ops = {
pernet_operations 2967 core/sock.c static __net_initdata struct pernet_operations proto_net_ops = {
pernet_operations 230 core/sock_diag.c static struct pernet_operations diag_net_ops = {
pernet_operations 453 core/sysctl_net_core.c static __net_initdata struct pernet_operations sysctl_core_ops = {
pernet_operations 1040 dccp/ipv4.c static struct pernet_operations dccp_v4_ops = {
pernet_operations 1095 dccp/ipv6.c static struct pernet_operations dccp_v6_ops = {
pernet_operations 545 ieee802154/6lowpan/reassembly.c static struct pernet_operations lowpan_frags_ops = {
pernet_operations 3787 include/linux/netdevice.h extern struct pernet_operations __net_initdata loopback_net_ops;
pernet_operations 1585 ipv4/af_inet.c static __net_initdata struct pernet_operations ipv4_m