Lines Matching defs:socket

130  * also contains all socket related structures (except sock_fprog and tap_filter)
142 struct socket socket;
185 /* Since the socket were moved to tun_file, to preserve the behavior of persist
186 * device, socket filter, sndbuf and vnet header size were restore when the
731 tfile->socket.sk->sk_shutdown = RCV_SHUTDOWN;
732 tfile->socket.sk->sk_data_ready(tfile->socket.sk);
737 tfile->socket.sk->sk_shutdown = RCV_SHUTDOWN;
738 tfile->socket.sk->sk_data_ready(tfile->socket.sk);
773 err = security_tun_dev_attach(tfile->socket.sk, tun->security);
794 lock_sock(tfile->socket.sk);
795 err = sk_attach_filter(&tun->fprog, tfile->socket.sk);
796 release_sock(tfile->socket.sk);
809 tfile->socket.sk->sk_shutdown &= ~RCV_SHUTDOWN;
1108 if (tfile->socket.sk->sk_filter &&
1109 sk_filter(tfile->socket.sk, skb))
1138 tfile->socket.sk->sk_data_ready(tfile->socket.sk);
1287 tfile->socket.sk->sk_data_ready(tfile->socket.sk);
1429 struct sock *sk = tfile->socket.sk;
1447 sk = tfile->socket.sk;
1531 struct sock *sk = tfile->socket.sk;
1598 if (tfile->socket.sk->sk_sndbuf != INT_MAX)
1625 skb_set_owner_w(skb, tfile->socket.sk);
2209 add_wait_queue(&tfile->socket.wq.wait, &wait);
2220 if (tfile->socket.sk->sk_shutdown & RCV_SHUTDOWN) {
2229 remove_wait_queue(&tfile->socket.wq.wait, &wait);
2565 static int tun_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)
2568 struct tun_file *tfile = container_of(sock, struct tun_file, socket);
2612 static int tun_recvmsg(struct socket *sock, struct msghdr *m, size_t total_len,
2615 struct tun_file *tfile = container_of(sock, struct tun_file, socket);
2664 static int tun_peek_len(struct socket *sock)
2666 struct tun_file *tfile = container_of(sock, struct tun_file, socket);
2846 tun->sndbuf = tfile->socket.sk->sk_sndbuf;
2931 lock_sock(tfile->socket.sk);
2932 sk_detach_filter(tfile->socket.sk);
2933 release_sock(tfile->socket.sk);
2946 lock_sock(tfile->socket.sk);
2947 ret = sk_attach_filter(&tun->fprog, tfile->socket.sk);
2948 release_sock(tfile->socket.sk);
2966 tfile->socket.sk->sk_sndbuf = tun->sndbuf;
3155 if (!tfile->socket.sk->sk_filter)
3259 sndbuf = tfile->socket.sk->sk_sndbuf;
3463 init_waitqueue_head(&tfile->socket.wq.wait);
3465 tfile->socket.file = file;
3466 tfile->socket.ops = &tun_socket_ops;
3468 sock_init_data_uid(&tfile->socket, &tfile->sk, current_fsuid());
3683 tfile->socket.sk->sk_write_space(tfile->socket.sk);
3738 /* Get an underlying socket object from tun file. Returns error unless file is
3739 * attached to a device. The returned object works like a packet socket, it
3741 * holding a reference to the file for as long as the socket is in use. */
3742 struct socket *tun_get_socket(struct file *file)
3750 return &tfile->socket;