Lines Matching refs:sock

102 static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr);
103 static void vsock_sk_destruct(struct sock *sk);
104 static int vsock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
169 struct sock *sk = sk_vsock(vsk); in vsock_auto_bind()
215 static struct sock *__vsock_find_bound_socket(struct sockaddr_vm *addr) in __vsock_find_bound_socket()
226 static struct sock *__vsock_find_connected_socket(struct sockaddr_vm *src, in __vsock_find_connected_socket()
286 struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr) in vsock_find_bound_socket()
288 struct sock *sk; in vsock_find_bound_socket()
301 struct sock *vsock_find_connected_socket(struct sockaddr_vm *src, in vsock_find_connected_socket()
304 struct sock *sk; in vsock_find_connected_socket()
339 void vsock_for_each_connected_socket(void (*fn)(struct sock *sk)) in vsock_for_each_connected_socket()
356 void vsock_add_pending(struct sock *listener, struct sock *pending) in vsock_add_pending()
370 void vsock_remove_pending(struct sock *listener, struct sock *pending) in vsock_remove_pending()
380 void vsock_enqueue_accept(struct sock *listener, struct sock *connected) in vsock_enqueue_accept()
394 static struct sock *vsock_dequeue_accept(struct sock *listener) in vsock_dequeue_accept()
416 static bool vsock_is_accept_queue_empty(struct sock *sk) in vsock_is_accept_queue_empty()
422 static bool vsock_is_pending(struct sock *sk) in vsock_is_pending()
428 static int vsock_send_shutdown(struct sock *sk, int mode) in vsock_send_shutdown()
435 struct sock *sk; in vsock_pending_work()
436 struct sock *listener; in vsock_pending_work()
541 static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr) in __vsock_bind()
579 struct sock *__vsock_create(struct net *net, in __vsock_create()
580 struct socket *sock, in __vsock_create() argument
581 struct sock *parent, in __vsock_create()
586 struct sock *sk; in __vsock_create()
594 sock_init_data(sock, sk); in __vsock_create()
600 if (!sock) in __vsock_create()
638 if (sock) in __vsock_create()
645 static void __vsock_release(struct sock *sk) in __vsock_release()
649 struct sock *pending; in __vsock_release()
681 static void vsock_sk_destruct(struct sock *sk) in vsock_sk_destruct()
696 static int vsock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) in vsock_queue_rcv_skb()
719 static int vsock_release(struct socket *sock) in vsock_release() argument
721 __vsock_release(sock->sk); in vsock_release()
722 sock->sk = NULL; in vsock_release()
723 sock->state = SS_FREE; in vsock_release()
729 vsock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) in vsock_bind() argument
732 struct sock *sk; in vsock_bind()
735 sk = sock->sk; in vsock_bind()
747 static int vsock_getname(struct socket *sock, in vsock_getname() argument
751 struct sock *sk; in vsock_getname()
755 sk = sock->sk; in vsock_getname()
762 if (sock->state != SS_CONNECTED) { in vsock_getname()
790 static int vsock_shutdown(struct socket *sock, int mode) in vsock_shutdown() argument
793 struct sock *sk; in vsock_shutdown()
812 sk = sock->sk; in vsock_shutdown()
813 if (sock->state == SS_UNCONNECTED) { in vsock_shutdown()
818 sock->state = SS_DISCONNECTING; in vsock_shutdown()
839 static unsigned int vsock_poll(struct file *file, struct socket *sock, in vsock_poll() argument
842 struct sock *sk; in vsock_poll()
846 sk = sock->sk; in vsock_poll()
870 if (sock->type == SOCK_DGRAM) { in vsock_poll()
883 } else if (sock->type == SOCK_STREAM) { in vsock_poll()
952 static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg, in vsock_dgram_sendmsg() argument
956 struct sock *sk; in vsock_dgram_sendmsg()
965 sk = sock->sk; in vsock_dgram_sendmsg()
992 } else if (sock->state == SS_CONNECTED) { in vsock_dgram_sendmsg()
1023 static int vsock_dgram_connect(struct socket *sock, in vsock_dgram_connect() argument
1027 struct sock *sk; in vsock_dgram_connect()
1031 sk = sock->sk; in vsock_dgram_connect()
1039 sock->state = SS_UNCONNECTED; in vsock_dgram_connect()
1058 sock->state = SS_CONNECTED; in vsock_dgram_connect()
1065 static int vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg, in vsock_dgram_recvmsg() argument
1068 return transport->dgram_dequeue(vsock_sk(sock->sk), msg, len, flags); in vsock_dgram_recvmsg()
1094 struct sock *sk; in vsock_connect_timeout()
1112 static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr, in vsock_stream_connect() argument
1116 struct sock *sk; in vsock_stream_connect()
1123 sk = sock->sk; in vsock_stream_connect()
1129 switch (sock->state) { in vsock_stream_connect()
1178 sock->state = SS_CONNECTING; in vsock_stream_connect()
1235 sock->state = SS_UNCONNECTED; in vsock_stream_connect()
1239 static int vsock_accept(struct socket *sock, struct socket *newsock, int flags) in vsock_accept() argument
1241 struct sock *listener; in vsock_accept()
1243 struct sock *connected; in vsock_accept()
1249 listener = sock->sk; in vsock_accept()
1253 if (sock->type != SOCK_STREAM) { in vsock_accept()
1322 static int vsock_listen(struct socket *sock, int backlog) in vsock_listen() argument
1325 struct sock *sk; in vsock_listen()
1328 sk = sock->sk; in vsock_listen()
1332 if (sock->type != SOCK_STREAM) { in vsock_listen()
1337 if (sock->state != SS_UNCONNECTED) { in vsock_listen()
1359 static int vsock_stream_setsockopt(struct socket *sock, in vsock_stream_setsockopt() argument
1366 struct sock *sk; in vsock_stream_setsockopt()
1386 sk = sock->sk; in vsock_stream_setsockopt()
1436 static int vsock_stream_getsockopt(struct socket *sock, in vsock_stream_getsockopt() argument
1443 struct sock *sk; in vsock_stream_getsockopt()
1466 sk = sock->sk; in vsock_stream_getsockopt()
1507 static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg, in vsock_stream_sendmsg() argument
1510 struct sock *sk; in vsock_stream_sendmsg()
1519 sk = sock->sk; in vsock_stream_sendmsg()
1646 vsock_stream_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, in vsock_stream_recvmsg() argument
1649 struct sock *sk; in vsock_stream_recvmsg()
1659 sk = sock->sk; in vsock_stream_recvmsg()
1828 static int vsock_create(struct net *net, struct socket *sock, in vsock_create() argument
1831 if (!sock) in vsock_create()
1837 switch (sock->type) { in vsock_create()
1839 sock->ops = &vsock_dgram_ops; in vsock_create()
1842 sock->ops = &vsock_stream_ops; in vsock_create()
1848 sock->state = SS_UNCONNECTED; in vsock_create()
1850 return __vsock_create(net, sock, NULL, GFP_KERNEL, 0, kern) ? 0 : -ENOMEM; in vsock_create()