Lines Matching defs:sock

110 #include <net/sock.h>
113 static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr);
114 static void vsock_sk_destruct(struct sock *sk);
115 static int vsock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
183 struct sock *sk = sk_vsock(vsk);
229 static struct sock *__vsock_find_bound_socket(struct sockaddr_vm *addr)
246 static struct sock *__vsock_find_connected_socket(struct sockaddr_vm *src,
298 struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr)
300 struct sock *sk;
313 struct sock *vsock_find_connected_socket(struct sockaddr_vm *src,
316 struct sock *sk;
337 void (*fn)(struct sock *sk))
358 void vsock_add_pending(struct sock *listener, struct sock *pending)
372 void vsock_remove_pending(struct sock *listener, struct sock *pending)
382 void vsock_enqueue_accept(struct sock *listener, struct sock *connected)
435 struct sock *sk = sk_vsock(vsk);
459 /* transport->release() must be called with sock lock acquired.
461 * where we have already held the sock lock.
502 static struct sock *vsock_dequeue_accept(struct sock *listener)
524 static bool vsock_is_accept_queue_empty(struct sock *sk)
530 static bool vsock_is_pending(struct sock *sk)
536 static int vsock_send_shutdown(struct sock *sk, int mode)
548 struct sock *sk;
549 struct sock *listener;
656 static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr)
694 static struct sock *__vsock_create(struct net *net,
695 struct socket *sock,
696 struct sock *parent,
701 struct sock *sk;
709 sock_init_data(sock, sk);
711 /* sk->sk_type is normally set in sock_init_data, but only if sock is
715 if (!sock)
759 static void __vsock_release(struct sock *sk, int level)
762 struct sock *pending;
796 static void vsock_sk_destruct(struct sock *sk)
811 static int vsock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
822 struct sock *vsock_create_connected(struct sock *parent)
841 static int vsock_release(struct socket *sock)
843 __vsock_release(sock->sk, 0);
844 sock->sk = NULL;
845 sock->state = SS_FREE;
851 vsock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
854 struct sock *sk;
857 sk = sock->sk;
869 static int vsock_getname(struct socket *sock,
873 struct sock *sk;
877 sk = sock->sk;
884 if (sock->state != SS_CONNECTED) {
912 static int vsock_shutdown(struct socket *sock, int mode)
915 struct sock *sk;
934 sk = sock->sk;
937 if (sock->state == SS_UNCONNECTED) {
942 sock->state = SS_DISCONNECTING;
963 static __poll_t vsock_poll(struct file *file, struct socket *sock,
966 struct sock *sk;
970 sk = sock->sk;
994 if (sock->type == SOCK_DGRAM) {
1007 } else if (sock->type == SOCK_STREAM) {
1080 static int vsock_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
1084 struct sock *sk;
1094 sk = sock->sk;
1123 } else if (sock->state == SS_CONNECTED) {
1154 static int vsock_dgram_connect(struct socket *sock,
1158 struct sock *sk;
1162 sk = sock->sk;
1170 sock->state = SS_UNCONNECTED;
1189 sock->state = SS_CONNECTED;
1196 static int vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
1199 struct vsock_sock *vsk = vsock_sk(sock->sk);
1235 struct sock *sk;
1255 static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr,
1259 struct sock *sk;
1267 sk = sock->sk;
1273 switch (sock->state) {
1281 /* This continues on so we can move sock into the SS_CONNECTED
1328 /* Mark sock as connecting and set the error code to in
1331 sock->state = SS_CONNECTING;
1371 sock->state = SS_UNCONNECTED;
1378 sock->state = SS_UNCONNECTED;
1389 sock->state = SS_UNCONNECTED;
1401 static int vsock_accept(struct socket *sock, struct socket *newsock, int flags,
1404 struct sock *listener;
1406 struct sock *connected;
1412 listener = sock->sk;
1416 if (sock->type != SOCK_STREAM) {
1483 static int vsock_listen(struct socket *sock, int backlog)
1486 struct sock *sk;
1489 sk = sock->sk;
1493 if (sock->type != SOCK_STREAM) {
1498 if (sock->state != SS_UNCONNECTED) {
1537 static int vsock_stream_setsockopt(struct socket *sock,
1544 struct sock *sk;
1565 sk = sock->sk;
1619 static int vsock_stream_getsockopt(struct socket *sock,
1626 struct sock *sk;
1649 sk = sock->sk;
1690 static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg,
1693 struct sock *sk;
1702 sk = sock->sk;
1832 vsock_stream_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
1835 struct sock *sk;
1846 sk = sock->sk;
2025 static int vsock_create(struct net *net, struct socket *sock,
2029 struct sock *sk;
2032 if (!sock)
2038 switch (sock->type) {
2040 sock->ops = &vsock_dgram_ops;
2043 sock->ops = &vsock_stream_ops;
2049 sock->state = SS_UNCONNECTED;
2051 sk = __vsock_create(net, sock, NULL, GFP_KERNEL, 0, kern);
2057 if (sock->type == SOCK_DGRAM) {