Lines Matching defs:sock

41 #include <trace/events/sock.h>
71 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);
157 static int __tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dsz);
158 static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dsz);
160 static int tipc_wait_for_connect(struct socket *sock, long *timeo_p);
208 static struct tipc_sock *tipc_sk(const struct sock *sk)
213 int tsk_set_importance(struct sock *sk, int imp)
255 struct sock *sk = &tsk->sk;
277 static void tsk_advance_rx_queue(struct sock *sk)
285 static void tipc_sk_respond(struct sock *sk, struct sk_buff *skb, int err)
307 static void tsk_rej_rx_queue(struct sock *sk, int error)
315 static bool tipc_sk_connected(const struct sock *sk)
325 static bool tipc_sk_type_connectionless(struct sock *sk)
337 struct sock *sk = &tsk->sk;
370 static int tipc_set_sk_state(struct sock *sk, int state)
402 static int tipc_sk_sock_err(struct socket *sock, long *timeout)
404 struct sock *sk = sock->sk;
406 int typ = sock->type;
427 struct sock *sk_; \
450 * @sock: pre-allocated socket structure
459 static int tipc_sk_create(struct net *net, struct socket *sock,
463 struct sock *sk;
471 switch (sock->type) {
500 sock->ops = ops;
501 sock_init_data(sock, sk);
533 if (sock->type == SOCK_DGRAM)
549 static void __tipc_shutdown(struct socket *sock, int error)
551 struct sock *sk = sock->sk;
559 tipc_wait_for_cond(sock, &timeout, (!tsk->cong_link_cnt &&
611 * @sock: socket to destroy
625 static int tipc_release(struct socket *sock)
627 struct sock *sk = sock->sk;
641 __tipc_shutdown(sock, TIPC_ERR_NO_PORT);
655 sock->sk = NULL;
662 * @sock: socket structure
675 static int __tipc_bind(struct socket *sock, struct sockaddr *skaddr, int alen)
678 struct tipc_sock *tsk = tipc_sk(sock->sk);
704 int tipc_sk_bind(struct socket *sock, struct sockaddr *skaddr, int alen)
708 lock_sock(sock->sk);
709 res = __tipc_bind(sock, skaddr, alen);
710 release_sock(sock->sk);
714 static int tipc_bind(struct socket *sock, struct sockaddr_unsized *skaddr, int alen)
730 return tipc_sk_bind(sock, (struct sockaddr *)skaddr, alen);
735 * @sock: socket structure
745 static int tipc_getname(struct socket *sock, struct sockaddr *uaddr,
749 struct sock *sk = sock->sk;
775 * @sock: socket for which to calculate the poll bits
790 static __poll_t tipc_poll(struct file *file, struct socket *sock,
793 struct sock *sk = sock->sk;
797 sock_poll_wait(file, sock, wait);
833 * @sock: socket structure
842 static int tipc_sendmcast(struct socket *sock, struct tipc_uaddr *ua,
845 struct sock *sk = sock->sk;
858 rc = tipc_wait_for_cond(sock, &timeout, !tsk->cong_link_cnt);
948 * @sock: socket structure
956 static int tipc_send_group_unicast(struct socket *sock, struct msghdr *m,
959 struct sock *sk = sock->sk;
974 rc = tipc_wait_for_cond(sock, &timeout,
992 * @sock: socket structure
1000 static int tipc_send_group_anycast(struct socket *sock, struct msghdr *m,
1004 struct sock *sk = sock->sk;
1050 rc = tipc_wait_for_cond(sock, &timeout,
1073 * @sock: socket structure
1081 static int tipc_send_group_bcast(struct socket *sock, struct msghdr *m,
1085 struct sock *sk = sock->sk;
1098 rc = tipc_wait_for_cond(sock, &timeout,
1147 * @sock: socket structure
1155 static int tipc_send_group_mcast(struct socket *sock, struct msghdr *m,
1159 struct sock *sk = sock->sk;
1176 return tipc_send_group_unicast(sock, m, dlen, timeout);
1180 return tipc_send_group_bcast(sock, m, dlen, timeout);
1331 struct sock *sk = &tsk->sk;
1385 * @sock: socket structure
1396 static int tipc_sendmsg(struct socket *sock,
1399 struct sock *sk = sock->sk;
1403 ret = __tipc_sendmsg(sock, m, dsz);
1409 static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
1411 struct sock *sk = sock->sk;
1436 return tipc_send_group_bcast(sock, m, dlen, timeout);
1438 return tipc_send_group_anycast(sock, m, dlen, timeout);
1440 return tipc_send_group_unicast(sock, m, dlen, timeout);
1442 return tipc_send_group_mcast(sock, m, dlen, timeout);
1469 return tipc_sendmcast(sock, ua, m, dlen, timeout);
1482 rc = tipc_wait_for_cond(sock, &timeout,
1526 tipc_wait_for_connect(sock, &timeout);
1535 * @sock: socket structure
1544 static int tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dsz)
1546 struct sock *sk = sock->sk;
1550 ret = __tipc_sendstream(sock, m, dsz);
1556 static int __tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dlen)
1558 struct sock *sk = sock->sk;
1577 rc = __tipc_sendmsg(sock, m, dlen);
1586 rc = tipc_wait_for_cond(sock, &timeout,
1643 * @sock: socket structure
1651 static int tipc_send_packet(struct socket *sock, struct msghdr *m, size_t dsz)
1656 return tipc_sendstream(sock, m, dsz);
1664 struct sock *sk = &tsk->sk;
1705 srcaddr->sock.family = AF_TIPC;
1706 srcaddr->sock.addrtype = TIPC_SOCKET_ADDR;
1707 srcaddr->sock.scope = 0;
1708 srcaddr->sock.addr.id.ref = msg_origport(hdr);
1709 srcaddr->sock.addr.id.node = msg_orignode(hdr);
1710 srcaddr->sock.addr.name.domain = 0;
1795 struct sock *sk = &tsk->sk;
1832 static int tipc_wait_for_rcvmsg(struct socket *sock, long *timeop)
1834 struct sock *sk = sock->sk;
1875 * @sock: network socket
1885 static int tipc_recvmsg(struct socket *sock, struct msghdr *m,
1888 struct sock *sk = sock->sk;
1912 rc = tipc_wait_for_rcvmsg(sock, &timeout);
2004 * @sock: network socket
2014 static int tipc_recvstream(struct socket *sock, struct msghdr *m,
2017 struct sock *sk = sock->sk;
2042 rc = tipc_wait_for_rcvmsg(sock, &timeout);
2113 static void tipc_write_space(struct sock *sk)
2129 static void tipc_data_ready(struct sock *sk)
2143 static void tipc_sock_destruct(struct sock *sk)
2148 static void tipc_sk_proto_rcv(struct sock *sk,
2197 struct sock *sk = &tsk->sk;
2310 static unsigned int rcvbuf_limit(struct sock *sk, struct sk_buff *skb)
2338 static void tipc_sk_filter_rcv(struct sock *sk, struct sk_buff *skb,
2403 static int tipc_sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
2430 static void tipc_sk_enqueue(struct sk_buff_head *inputq, struct sock *sk,
2490 struct sock *sk;
2530 static int tipc_wait_for_connect(struct socket *sock, long *timeo_p)
2533 struct sock *sk = sock->sk;
2567 * @sock: socket structure
2574 static int tipc_connect(struct socket *sock, struct sockaddr_unsized *dest,
2577 struct sock *sk = sock->sk;
2629 res = __tipc_sendmsg(sock, &m, 0);
2647 res = tipc_wait_for_connect(sock, &timeout);
2663 * @sock: socket structure
2668 static int tipc_listen(struct socket *sock, int len)
2670 struct sock *sk = sock->sk;
2680 static int tipc_wait_for_accept(struct socket *sock, long timeo)
2682 struct sock *sk = sock->sk;
2714 * @sock: listening socket
2720 static int tipc_accept(struct socket *sock, struct socket *new_sock,
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, arg->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 = timer_container_of(sk, t, sk_timer);
2908 struct sock *sk = &tsk->sk;
3014 struct sock *sk = &tsk->sk;
3037 struct sock *sk = &tsk->sk;
3130 * @sock: socket structure
3141 static int tipc_setsockopt(struct socket *sock, int lvl, int opt,
3144 struct sock *sk = sock->sk;
3150 if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM))
3184 if (sock->type != SOCK_STREAM)
3224 * @sock: socket structure
3234 static int tipc_getsockopt(struct socket *sock, int lvl, int opt,
3237 struct sock *sk = sock->sk;
3244 if (lvl == IPPROTO_TCP && sock->type == SOCK_STREAM) {
3302 static int tipc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
3304 struct net *net = sock_net(sock->sk);
3507 struct sock *sk = &tsk->sk;
3627 u64 (*tipc_diag_gen_cookie)(struct sock *sk))
3629 struct sock *sk = &tsk->sk;
3790 struct nlattr *sock[TIPC_NLA_SOCK_MAX + 1];
3795 err = nla_parse_nested_deprecated(sock, TIPC_NLA_SOCK_MAX,
3801 if (!sock[TIPC_NLA_SOCK_REF])
3804 tsk_portid = nla_get_u32(sock[TIPC_NLA_SOCK_REF]);
3833 * (portid, sock type, name type, name lower, name upper)
3839 bool tipc_sk_filtering(struct sock *sk)
3889 u32 tipc_sock_get_portid(struct sock *sk)
3903 bool tipc_sk_overlimit1(struct sock *sk, struct sk_buff *skb)
3921 bool tipc_sk_overlimit2(struct sock *sk, struct sk_buff *skb)
3940 int tipc_sk_dump(struct sock *sk, u16 dqueues, char *buf)