Lines Matching refs:sock
40 #include <trace/events/sock.h>
70 struct sockaddr_tipc sock;
111 struct sock sk;
145 static int tipc_sk_backlog_rcv(struct sock *sk, struct sk_buff *skb);
146 static void tipc_data_ready(struct sock *sk);
147 static void tipc_write_space(struct sock *sk);
148 static void tipc_sock_destruct(struct sock *sk);
149 static int tipc_release(struct socket *sock);
150 static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
159 static int __tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dsz);
160 static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dsz);
162 static int tipc_wait_for_connect(struct socket *sock, long *timeo_p);
210 static struct tipc_sock *tipc_sk(const struct sock *sk)
215 int tsk_set_importance(struct sock *sk, int imp)
257 struct sock *sk = &tsk->sk;
279 static void tsk_advance_rx_queue(struct sock *sk)
287 static void tipc_sk_respond(struct sock *sk, struct sk_buff *skb, int err)
309 static void tsk_rej_rx_queue(struct sock *sk, int error)
317 static bool tipc_sk_connected(const struct sock *sk)
327 static bool tipc_sk_type_connectionless(struct sock *sk)
339 struct sock *sk = &tsk->sk;
372 static int tipc_set_sk_state(struct sock *sk, int state)
404 static int tipc_sk_sock_err(struct socket *sock, long *timeout)
406 struct sock *sk = sock->sk;
408 int typ = sock->type;
429 struct sock *sk_; \
452 * @sock: pre-allocated socket structure
461 static int tipc_sk_create(struct net *net, struct socket *sock,
465 struct sock *sk;
473 switch (sock->type) {
502 sock->ops = ops;
503 sock_init_data(sock, sk);
535 if (sock->type == SOCK_DGRAM)
551 static void __tipc_shutdown(struct socket *sock, int error)
553 struct sock *sk = sock->sk;
561 tipc_wait_for_cond(sock, &timeout, (!tsk->cong_link_cnt &&
613 * @sock: socket to destroy
627 static int tipc_release(struct socket *sock)
629 struct sock *sk = sock->sk;
643 __tipc_shutdown(sock, TIPC_ERR_NO_PORT);
657 sock->sk = NULL;
664 * @sock: socket structure
677 static int __tipc_bind(struct socket *sock, struct sockaddr *skaddr, int alen)
680 struct tipc_sock *tsk = tipc_sk(sock->sk);
706 int tipc_sk_bind(struct socket *sock, struct sockaddr *skaddr, int alen)
710 lock_sock(sock->sk);
711 res = __tipc_bind(sock, skaddr, alen);
712 release_sock(sock->sk);
716 static int tipc_bind(struct socket *sock, struct sockaddr *skaddr, int alen)
732 return tipc_sk_bind(sock, skaddr, alen);
737 * @sock: socket structure
747 static int tipc_getname(struct socket *sock, struct sockaddr *uaddr,
751 struct sock *sk = sock->sk;
777 * @sock: socket for which to calculate the poll bits
792 static __poll_t tipc_poll(struct file *file, struct socket *sock,
795 struct sock *sk = sock->sk;
799 sock_poll_wait(file, sock, wait);
835 * @sock: socket structure
844 static int tipc_sendmcast(struct socket *sock, struct tipc_uaddr *ua,
847 struct sock *sk = sock->sk;
860 rc = tipc_wait_for_cond(sock, &timeout, !tsk->cong_link_cnt);
950 * @sock: socket structure
958 static int tipc_send_group_unicast(struct socket *sock, struct msghdr *m,
961 struct sock *sk = sock->sk;
976 rc = tipc_wait_for_cond(sock, &timeout,
994 * @sock: socket structure
1002 static int tipc_send_group_anycast(struct socket *sock, struct msghdr *m,
1006 struct sock *sk = sock->sk;
1053 rc = tipc_wait_for_cond(sock, &timeout,
1076 * @sock: socket structure
1084 static int tipc_send_group_bcast(struct socket *sock, struct msghdr *m,
1088 struct sock *sk = sock->sk;
1101 rc = tipc_wait_for_cond(sock, &timeout,
1150 * @sock: socket structure
1158 static int tipc_send_group_mcast(struct socket *sock, struct msghdr *m,
1162 struct sock *sk = sock->sk;
1180 return tipc_send_group_unicast(sock, m, dlen, timeout);
1184 return tipc_send_group_bcast(sock, m, dlen, timeout);
1335 struct sock *sk = &tsk->sk;
1386 * @sock: socket structure
1397 static int tipc_sendmsg(struct socket *sock,
1400 struct sock *sk = sock->sk;
1404 ret = __tipc_sendmsg(sock, m, dsz);
1410 static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
1412 struct sock *sk = sock->sk;
1437 return tipc_send_group_bcast(sock, m, dlen, timeout);
1439 return tipc_send_group_anycast(sock, m, dlen, timeout);
1441 return tipc_send_group_unicast(sock, m, dlen, timeout);
1443 return tipc_send_group_mcast(sock, m, dlen, timeout);
1470 return tipc_sendmcast(sock, ua, m, dlen, timeout);
1483 rc = tipc_wait_for_cond(sock, &timeout,
1527 tipc_wait_for_connect(sock, &timeout);
1536 * @sock: socket structure
1545 static int tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dsz)
1547 struct sock *sk = sock->sk;
1551 ret = __tipc_sendstream(sock, m, dsz);
1557 static int __tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dlen)
1559 struct sock *sk = sock->sk;
1578 rc = __tipc_sendmsg(sock, m, dlen);
1587 rc = tipc_wait_for_cond(sock, &timeout,
1644 * @sock: socket structure
1652 static int tipc_send_packet(struct socket *sock, struct msghdr *m, size_t dsz)
1657 return tipc_sendstream(sock, m, dsz);
1665 struct sock *sk = &tsk->sk;
1706 srcaddr->sock.family = AF_TIPC;
1707 srcaddr->sock.addrtype = TIPC_SOCKET_ADDR;
1708 srcaddr->sock.scope = 0;
1709 srcaddr->sock.addr.id.ref = msg_origport(hdr);
1710 srcaddr->sock.addr.id.node = msg_orignode(hdr);
1711 srcaddr->sock.addr.name.domain = 0;
1796 struct sock *sk = &tsk->sk;
1833 static int tipc_wait_for_rcvmsg(struct socket *sock, long *timeop)
1835 struct sock *sk = sock->sk;
1876 * @sock: network socket
1886 static int tipc_recvmsg(struct socket *sock, struct msghdr *m,
1889 struct sock *sk = sock->sk;
1913 rc = tipc_wait_for_rcvmsg(sock, &timeout);
2005 * @sock: network socket
2015 static int tipc_recvstream(struct socket *sock, struct msghdr *m,
2018 struct sock *sk = sock->sk;
2043 rc = tipc_wait_for_rcvmsg(sock, &timeout);
2114 static void tipc_write_space(struct sock *sk)
2130 static void tipc_data_ready(struct sock *sk)
2144 static void tipc_sock_destruct(struct sock *sk)
2149 static void tipc_sk_proto_rcv(struct sock *sk,
2198 struct sock *sk = &tsk->sk;
2309 static unsigned int rcvbuf_limit(struct sock *sk, struct sk_buff *skb)
2337 static void tipc_sk_filter_rcv(struct sock *sk, struct sk_buff *skb,
2402 static int tipc_sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
2429 static void tipc_sk_enqueue(struct sk_buff_head *inputq, struct sock *sk,
2489 struct sock *sk;
2529 static int tipc_wait_for_connect(struct socket *sock, long *timeo_p)
2532 struct sock *sk = sock->sk;
2566 * @sock: socket structure
2573 static int tipc_connect(struct socket *sock, struct sockaddr *dest,
2576 struct sock *sk = sock->sk;
2628 res = __tipc_sendmsg(sock, &m, 0);
2646 res = tipc_wait_for_connect(sock, &timeout);
2662 * @sock: socket structure
2667 static int tipc_listen(struct socket *sock, int len)
2669 struct sock *sk = sock->sk;
2679 static int tipc_wait_for_accept(struct socket *sock, long timeo)
2681 struct sock *sk = sock->sk;
2713 * @sock: listening socket
2720 static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
2723 struct sock *new_sk, *sk = sock->sk;
2738 res = tipc_wait_for_accept(sock, timeo);
2744 res = tipc_sk_create(sock_net(sock->sk), new_sock, 0, kern);
2747 security_sk_clone(sock->sk, new_sock->sk);
2793 * @sock: socket structure
2800 static int tipc_shutdown(struct socket *sock, int how)
2802 struct sock *sk = sock->sk;
2811 __tipc_shutdown(sock, TIPC_CONN_SHUTDOWN);
2829 static void tipc_sk_check_probing_state(struct sock *sk,
2855 static void tipc_sk_retry_connect(struct sock *sk, struct sk_buff_head *list)
2871 struct sock *sk = from_timer(sk, t, sk_timer);
2908 struct sock *sk = &tsk->sk;
3014 struct sock *sk = &tsk->sk;
3037 struct sock *sk = &tsk->sk;
3132 * @sock: socket structure
3143 static int tipc_setsockopt(struct socket *sock, int lvl, int opt,
3146 struct sock *sk = sock->sk;
3152 if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM))
3186 if (sock->type != SOCK_STREAM)
3226 * @sock: socket structure
3237 static int tipc_getsockopt(struct socket *sock, int lvl, int opt,
3240 struct sock *sk = sock->sk;
3247 if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM))
3304 static int tipc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
3306 struct net *net = sock_net(sock->sk);
3509 struct sock *sk = &tsk->sk;
3632 u64 (*tipc_diag_gen_cookie)(struct sock *sk))
3634 struct sock *sk = &tsk->sk;
3795 struct nlattr *sock[TIPC_NLA_SOCK_MAX + 1];
3800 err = nla_parse_nested_deprecated(sock, TIPC_NLA_SOCK_MAX,
3806 if (!sock[TIPC_NLA_SOCK_REF])
3809 tsk_portid = nla_get_u32(sock[TIPC_NLA_SOCK_REF]);
3838 * (portid, sock type, name type, name lower, name upper)
3844 bool tipc_sk_filtering(struct sock *sk)
3894 u32 tipc_sock_get_portid(struct sock *sk)
3908 bool tipc_sk_overlimit1(struct sock *sk, struct sk_buff *skb)
3926 bool tipc_sk_overlimit2(struct sock *sk, struct sk_buff *skb)
3945 int tipc_sk_dump(struct sock *sk, u16 dqueues, char *buf)