Lines Matching defs:socket

119  * also contains all socket related structures (except sock_fprog and tap_filter)
131 struct socket socket;
174 /* Since the socket were moved to tun_file, to preserve the behavior of persist
175 * device, socket filter, sndbuf and vnet header size were restore when the
720 tfile->socket.sk->sk_shutdown = RCV_SHUTDOWN;
721 tfile->socket.sk->sk_data_ready(tfile->socket.sk);
726 tfile->socket.sk->sk_shutdown = RCV_SHUTDOWN;
727 tfile->socket.sk->sk_data_ready(tfile->socket.sk);
762 err = security_tun_dev_attach(tfile->socket.sk, tun->security);
783 lock_sock(tfile->socket.sk);
784 err = sk_attach_filter(&tun->fprog, tfile->socket.sk);
785 release_sock(tfile->socket.sk);
798 tfile->socket.sk->sk_shutdown &= ~RCV_SHUTDOWN;
1102 if (tfile->socket.sk->sk_filter &&
1103 sk_filter(tfile->socket.sk, skb)) {
1145 tfile->socket.sk->sk_data_ready(tfile->socket.sk);
1269 tfile->socket.sk->sk_data_ready(tfile->socket.sk);
1419 struct sock *sk = tfile->socket.sk;
1437 sk = tfile->socket.sk;
1522 struct sock *sk = tfile->socket.sk;
1591 if (tfile->socket.sk->sk_sndbuf != INT_MAX)
1618 skb_set_owner_w(skb, tfile->socket.sk);
2196 add_wait_queue(&tfile->socket.wq.wait, &wait);
2207 if (tfile->socket.sk->sk_shutdown & RCV_SHUTDOWN) {
2216 remove_wait_queue(&tfile->socket.wq.wait, &wait);
2562 static int tun_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)
2565 struct tun_file *tfile = container_of(sock, struct tun_file, socket);
2614 static int tun_recvmsg(struct socket *sock, struct msghdr *m, size_t total_len,
2617 struct tun_file *tfile = container_of(sock, struct tun_file, socket);
2666 static int tun_peek_len(struct socket *sock)
2668 struct tun_file *tfile = container_of(sock, struct tun_file, socket);
2848 tun->sndbuf = tfile->socket.sk->sk_sndbuf;
2942 lock_sock(tfile->socket.sk);
2943 sk_detach_filter(tfile->socket.sk);
2944 release_sock(tfile->socket.sk);
2957 lock_sock(tfile->socket.sk);
2958 ret = sk_attach_filter(&tun->fprog, tfile->socket.sk);
2959 release_sock(tfile->socket.sk);
2977 tfile->socket.sk->sk_sndbuf = tun->sndbuf;
3165 if (!tfile->socket.sk->sk_filter)
3278 sndbuf = tfile->socket.sk->sk_sndbuf;
3482 init_waitqueue_head(&tfile->socket.wq.wait);
3484 tfile->socket.file = file;
3485 tfile->socket.ops = &tun_socket_ops;
3487 sock_init_data_uid(&tfile->socket, &tfile->sk, current_fsuid());
3708 tfile->socket.sk->sk_write_space(tfile->socket.sk);
3763 /* Get an underlying socket object from tun file. Returns error unless file is
3764 * attached to a device. The returned object works like a packet socket, it
3766 * holding a reference to the file for as long as the socket is in use. */
3767 struct socket *tun_get_socket(struct file *file)
3775 return &tfile->socket;