Lines Matching defs:net

104 #include <linux/net.h>
125 #include <net/protocol.h>
127 #include <net/net_namespace.h>
128 #include <net/request_sock.h>
129 #include <net/sock.h>
131 #include <net/xfrm.h>
133 #include <net/cls_cgroup.h>
134 #include <net/netprio_cgroup.h>
138 #include <net/sock_reuseport.h>
139 #include <net/bpf_sk_storage.h>
143 #include <net/tcp.h>
144 #include <net/busy_poll.h>
145 #include <net/phonet/phonet.h>
634 struct net *net = sock_net(sk);
638 if (sk->sk_bound_dev_if && !ns_capable(net->user_ns, CAP_NET_RAW))
678 struct net *net = sock_net(sk);
704 dev = dev_get_by_name_rcu(net, devname);
728 struct net *net = sock_net(sk);
740 ret = netdev_get_name(net, devname, bound_dev_if);
868 struct net *net = sock_net(sk);
875 dev = dev_get_by_index(net, sk->sk_bound_dev_if);
2140 * @net: the applicable net namespace
2146 struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
2163 get_net_track(net, &sk->ns_tracker, priority);
2164 sock_inuse_add(net, 1);
2166 __netns_tracker_alloc(net, &sk->ns_tracker,
2170 sock_net_set(sk, net);
2315 /* Kernel sockets are not elevating the struct net refcount.
3622 * we just set one of the two flags which require net
3719 * no access to socket. But net still has.
3765 int sock_prot_inuse_get(struct net *net, struct proto *prot)
3771 res += per_cpu_ptr(net->core.prot_inuse, cpu)->val[idx];
3777 int sock_inuse_get(struct net *net)
3782 res += per_cpu_ptr(net->core.prot_inuse, cpu)->all;
3789 static int __net_init sock_inuse_init_net(struct net *net)
3791 net->core.prot_inuse = alloc_percpu(struct prot_inuse);
3792 if (net->core.prot_inuse == NULL)
3797 static void __net_exit sock_inuse_exit_net(struct net *net)
3799 free_percpu(net->core.prot_inuse);
3810 panic("Cannot initialize net inuse counters");
3997 return request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
4009 return request_module("net-pf-%d-proto-%d-type-%d-%d", PF_NETLINK,
4106 static __net_init int proto_init_net(struct net *net)
4108 if (!proc_create_net("protocols", 0444, net->proc_net, &proto_seq_ops,
4115 static __net_exit void proto_exit_net(struct net *net)
4117 remove_proc_entry("protocols", net->proc_net);