Lines Matching refs:sock
169 static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
217 static void packet_flush_mclist(struct sock *sk);
246 static void __fanout_unlink(struct sock *sk, struct packet_sock *po);
247 static void __fanout_link(struct sock *sk, struct packet_sock *po);
340 static void register_prot_hook(struct sock *sk) in register_prot_hook()
362 static void __unregister_prot_hook(struct sock *sk, bool sync) in __unregister_prot_hook()
382 static void unregister_prot_hook(struct sock *sk, bool sync) in unregister_prot_hook()
795 struct sock *sk = &po->sk; in prb_close_block()
1267 struct sock *sk = &po->sk; in __packet_rcv_has_room()
1311 static void packet_sock_destruct(struct sock *sk) in packet_sock_destruct()
1388 i = j = min_t(int, po->rollover->sock, num - 1); in fanout_demux_rollover()
1394 po->rollover->sock = i; in fanout_demux_rollover()
1493 static void __fanout_link(struct sock *sk, struct packet_sock *po) in __fanout_link()
1504 static void __fanout_unlink(struct sock *sk, struct packet_sock *po) in __fanout_unlink()
1520 static bool match_fanout_group(struct packet_type *ptype, struct sock *sk) in match_fanout_group()
1625 static int fanout_add(struct sock *sk, u16 id, u16 type_flags) in fanout_add()
1720 static void fanout_release(struct sock *sk) in fanout_release()
1765 struct sock *sk; in packet_rcv_spkt()
1834 static int packet_sendmsg_spkt(struct socket *sock, struct msghdr *msg, in packet_sendmsg_spkt() argument
1837 struct sock *sk = sock->sk; in packet_sendmsg_spkt()
1953 const struct sock *sk, in run_filter()
1982 struct sock *sk; in packet_rcv()
2094 struct sock *sk; in tpacket_rcv()
2348 struct socket *sock = po->sk.sk_socket; in tpacket_fill_skb() local
2382 if (sock->type == SOCK_DGRAM) { in tpacket_fill_skb()
2409 if (sock->type == SOCK_DGRAM) { in tpacket_fill_skb()
2602 static struct sk_buff *packet_alloc_skb(struct sock *sk, size_t prepad, in packet_alloc_skb()
2626 static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) in packet_snd() argument
2628 struct sock *sk = sock->sk; in packet_snd()
2678 if (sock->type == SOCK_RAW) in packet_snd()
2754 if (sock->type == SOCK_DGRAM) { in packet_snd()
2765 if (sock->type == SOCK_RAW && in packet_snd()
2829 static int packet_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) in packet_sendmsg() argument
2831 struct sock *sk = sock->sk; in packet_sendmsg()
2837 return packet_snd(sock, msg, len); in packet_sendmsg()
2845 static int packet_release(struct socket *sock) in packet_release() argument
2847 struct sock *sk = sock->sk; in packet_release()
2895 sock->sk = NULL; in packet_release()
2911 static int packet_do_bind(struct sock *sk, const char *name, int ifindex, in packet_do_bind()
3001 static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, in packet_bind_spkt() argument
3004 struct sock *sk = sock->sk; in packet_bind_spkt()
3018 static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) in packet_bind() argument
3021 struct sock *sk = sock->sk; in packet_bind()
3046 static int packet_create(struct net *net, struct socket *sock, int protocol, in packet_create() argument
3049 struct sock *sk; in packet_create()
3056 if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW && in packet_create()
3057 sock->type != SOCK_PACKET) in packet_create()
3060 sock->state = SS_UNCONNECTED; in packet_create()
3067 sock->ops = &packet_ops; in packet_create()
3068 if (sock->type == SOCK_PACKET) in packet_create()
3069 sock->ops = &packet_ops_spkt; in packet_create()
3071 sock_init_data(sock, sk); in packet_create()
3096 if (sock->type == SOCK_PACKET) in packet_create()
3126 static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, in packet_recvmsg() argument
3129 struct sock *sk = sock->sk; in packet_recvmsg()
3236 if (sock->type != SOCK_PACKET) { in packet_recvmsg()
3251 if (sock->type == SOCK_PACKET) { in packet_recvmsg()
3302 static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr, in packet_getname_spkt() argument
3306 struct sock *sk = sock->sk; in packet_getname_spkt()
3323 static int packet_getname(struct socket *sock, struct sockaddr *uaddr, in packet_getname() argument
3327 struct sock *sk = sock->sk; in packet_getname()
3399 static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq) in packet_mc_add()
3454 static int packet_mc_drop(struct sock *sk, struct packet_mreq_max *mreq) in packet_mc_drop()
3480 static void packet_flush_mclist(struct sock *sk) in packet_flush_mclist()
3502 packet_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int op… in packet_setsockopt() argument
3504 struct sock *sk = sock->sk; in packet_setsockopt()
3644 if (sock->type != SOCK_RAW) in packet_setsockopt()
3716 static int packet_getsockopt(struct socket *sock, int level, int optname, in packet_getsockopt() argument
3721 struct sock *sk = sock->sk; in packet_getsockopt()
3833 struct sock *sk; in packet_notifier()
3881 static int packet_ioctl(struct socket *sock, unsigned int cmd, in packet_ioctl() argument
3884 struct sock *sk = sock->sk; in packet_ioctl()
3925 return inet_dgram_ops.ioctl(sock, cmd, arg); in packet_ioctl()
3934 static unsigned int packet_poll(struct file *file, struct socket *sock, in packet_poll() argument
3937 struct sock *sk = sock->sk; in packet_poll()
3939 unsigned int mask = datagram_poll(file, sock, wait); in packet_poll()
3967 struct socket *sock = file->private_data; in packet_mm_open() local
3968 struct sock *sk = sock->sk; in packet_mm_open()
3977 struct socket *sock = file->private_data; in packet_mm_close() local
3978 struct sock *sk = sock->sk; in packet_mm_close()
4057 static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, in packet_set_ring()
4208 static int packet_mmap(struct file *file, struct socket *sock, in packet_mmap() argument
4211 struct sock *sk = sock->sk; in packet_mmap()
4350 struct sock *s = sk_entry(v); in packet_seq_show()