Lines Matching defs:sock
68 struct sockaddr_tipc sock;
97 struct sock sk;
132 static int tipc_sk_backlog_rcv(struct sock *sk, struct sk_buff *skb);
133 static void tipc_data_ready(struct sock *sk);
134 static void tipc_write_space(struct sock *sk);
135 static void tipc_sock_destruct(struct sock *sk);
136 static int tipc_release(struct socket *sock);
137 static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
148 static int __tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dsz);
149 static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dsz);
151 static int tipc_wait_for_connect(struct socket *sock, long *timeo_p);
199 static struct tipc_sock *tipc_sk(const struct sock *sk)
204 int tsk_set_importance(struct sock *sk, int imp)
246 struct sock *sk = &tsk->sk;
267 static void tsk_advance_rx_queue(struct sock *sk)
275 static void tipc_sk_respond(struct sock *sk, struct sk_buff *skb, int err)
295 static void tsk_rej_rx_queue(struct sock *sk, int error)
303 static bool tipc_sk_connected(const struct sock *sk)
313 static bool tipc_sk_type_connectionless(struct sock *sk)
325 struct sock *sk = &tsk->sk;
358 static int tipc_set_sk_state(struct sock *sk, int state)
390 static int tipc_sk_sock_err(struct socket *sock, long *timeout)
392 struct sock *sk = sock->sk;
394 int typ = sock->type;
415 struct sock *sk_; \
438 * @sock: pre-allocated socket structure
447 static int tipc_sk_create(struct net *net, struct socket *sock,
451 struct sock *sk;
459 switch (sock->type) {
488 sock->ops = ops;
489 sock_init_data(sock, sk);
521 if (sock->type == SOCK_DGRAM)
537 static void __tipc_shutdown(struct socket *sock, int error)
539 struct sock *sk = sock->sk;
547 tipc_wait_for_cond(sock, &timeout, (!tsk->cong_link_cnt &&
599 * @sock: socket to destroy
613 static int tipc_release(struct socket *sock)
615 struct sock *sk = sock->sk;
629 __tipc_shutdown(sock, TIPC_ERR_NO_PORT);
643 sock->sk = NULL;
650 * @sock: socket structure
663 static int tipc_bind(struct socket *sock, struct sockaddr *uaddr,
666 struct sock *sk = sock->sk;
713 * @sock: socket structure
723 static int tipc_getname(struct socket *sock, struct sockaddr *uaddr,
727 struct sock *sk = sock->sk;
753 * @sock: socket for which to calculate the poll bits
768 static __poll_t tipc_poll(struct file *file, struct socket *sock,
771 struct sock *sk = sock->sk;
775 sock_poll_wait(file, sock, wait);
811 * @sock: socket structure
820 static int tipc_sendmcast(struct socket *sock, struct tipc_name_seq *seq,
823 struct sock *sk = sock->sk;
837 rc = tipc_wait_for_cond(sock, &timeout, !tsk->cong_link_cnt);
927 * @sock: socket structure
935 static int tipc_send_group_unicast(struct socket *sock, struct msghdr *m,
938 struct sock *sk = sock->sk;
953 rc = tipc_wait_for_cond(sock, &timeout,
971 * @sock: socket structure
979 static int tipc_send_group_anycast(struct socket *sock, struct msghdr *m,
983 struct sock *sk = sock->sk;
1033 rc = tipc_wait_for_cond(sock, &timeout,
1056 * @sock: socket structure
1064 static int tipc_send_group_bcast(struct socket *sock, struct msghdr *m,
1068 struct sock *sk = sock->sk;
1081 rc = tipc_wait_for_cond(sock, &timeout,
1130 * @sock: socket structure
1138 static int tipc_send_group_mcast(struct socket *sock, struct msghdr *m,
1141 struct sock *sk = sock->sk;
1164 return tipc_send_group_unicast(sock, m, dlen, timeout);
1168 return tipc_send_group_bcast(sock, m, dlen, timeout);
1322 struct sock *sk = &tsk->sk;
1373 * @sock: socket structure
1384 static int tipc_sendmsg(struct socket *sock,
1387 struct sock *sk = sock->sk;
1391 ret = __tipc_sendmsg(sock, m, dsz);
1397 static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
1399 struct sock *sk = sock->sk;
1426 return tipc_send_group_bcast(sock, m, dlen, timeout);
1428 return tipc_send_group_anycast(sock, m, dlen, timeout);
1430 return tipc_send_group_unicast(sock, m, dlen, timeout);
1432 return tipc_send_group_mcast(sock, m, dlen, timeout);
1458 return tipc_sendmcast(sock, seq, m, dlen, timeout);
1474 rc = tipc_wait_for_cond(sock, &timeout,
1517 tipc_wait_for_connect(sock, &timeout);
1526 * @sock: socket structure
1535 static int tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dsz)
1537 struct sock *sk = sock->sk;
1541 ret = __tipc_sendstream(sock, m, dsz);
1547 static int __tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dlen)
1549 struct sock *sk = sock->sk;
1568 rc = __tipc_sendmsg(sock, m, dlen);
1577 rc = tipc_wait_for_cond(sock, &timeout,
1634 * @sock: socket structure
1642 static int tipc_send_packet(struct socket *sock, struct msghdr *m, size_t dsz)
1647 return tipc_sendstream(sock, m, dsz);
1655 struct sock *sk = &tsk->sk;
1696 srcaddr->sock.family = AF_TIPC;
1697 srcaddr->sock.addrtype = TIPC_ADDR_ID;
1698 srcaddr->sock.scope = 0;
1699 srcaddr->sock.addr.id.ref = msg_origport(hdr);
1700 srcaddr->sock.addr.id.node = msg_orignode(hdr);
1701 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;
1884 static int tipc_recvmsg(struct socket *sock, struct msghdr *m,
1887 struct sock *sk = sock->sk;
1911 rc = tipc_wait_for_rcvmsg(sock, &timeout);
2012 static int tipc_recvstream(struct socket *sock, struct msghdr *m,
2015 struct sock *sk = sock->sk;
2040 rc = tipc_wait_for_rcvmsg(sock, &timeout);
2111 static void tipc_write_space(struct sock *sk)
2127 static void tipc_data_ready(struct sock *sk)
2139 static void tipc_sock_destruct(struct sock *sk)
2144 static void tipc_sk_proto_rcv(struct sock *sk,
2193 struct sock *sk = &tsk->sk;
2304 static unsigned int rcvbuf_limit(struct sock *sk, struct sk_buff *skb)
2332 static void tipc_sk_filter_rcv(struct sock *sk, struct sk_buff *skb,
2397 static int tipc_sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
2423 static void tipc_sk_enqueue(struct sk_buff_head *inputq, struct sock *sk,
2482 struct sock *sk;
2522 static int tipc_wait_for_connect(struct socket *sock, long *timeo_p)
2525 struct sock *sk = sock->sk;
2559 * @sock: socket structure
2566 static int tipc_connect(struct socket *sock, struct sockaddr *dest,
2569 struct sock *sk = sock->sk;
2620 res = __tipc_sendmsg(sock, &m, 0);
2638 res = tipc_wait_for_connect(sock, &timeout);
2654 * @sock: socket structure
2659 static int tipc_listen(struct socket *sock, int len)
2661 struct sock *sk = sock->sk;
2671 static int tipc_wait_for_accept(struct socket *sock, long timeo)
2673 struct sock *sk = sock->sk;
2705 * @sock: listening socket
2711 static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
2714 struct sock *new_sk, *sk = sock->sk;
2729 res = tipc_wait_for_accept(sock, timeo);
2735 res = tipc_sk_create(sock_net(sock->sk), new_sock, 0, kern);
2738 security_sk_clone(sock->sk, new_sock->sk);
2782 * @sock: socket structure
2789 static int tipc_shutdown(struct socket *sock, int how)
2791 struct sock *sk = sock->sk;
2800 __tipc_shutdown(sock, TIPC_CONN_SHUTDOWN);
2818 static void tipc_sk_check_probing_state(struct sock *sk,
2844 static void tipc_sk_retry_connect(struct sock *sk, struct sk_buff_head *list)
2860 struct sock *sk = from_timer(sk, t, sk_timer);
2898 struct sock *sk = &tsk->sk;
3007 struct sock *sk = &tsk->sk;
3030 struct sock *sk = &tsk->sk;
3122 * @sock: socket structure
3133 static int tipc_setsockopt(struct socket *sock, int lvl, int opt,
3136 struct sock *sk = sock->sk;
3142 if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM))
3176 if (sock->type != SOCK_STREAM)
3216 * @sock: socket structure
3227 static int tipc_getsockopt(struct socket *sock, int lvl, int opt,
3230 struct sock *sk = sock->sk;
3237 if ((lvl == IPPROTO_TCP) && (sock->type == SOCK_STREAM))
3294 static int tipc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
3296 struct net *net = sock_net(sock->sk);
3501 struct sock *sk = &tsk->sk;
3624 u64 (*tipc_diag_gen_cookie)(struct sock *sk))
3626 struct sock *sk = &tsk->sk;
3787 struct nlattr *sock[TIPC_NLA_SOCK_MAX + 1];
3792 err = nla_parse_nested_deprecated(sock, TIPC_NLA_SOCK_MAX,
3798 if (!sock[TIPC_NLA_SOCK_REF])
3801 tsk_portid = nla_get_u32(sock[TIPC_NLA_SOCK_REF]);
3829 * (portid, sock type, name type, name lower, name upper)
3835 bool tipc_sk_filtering(struct sock *sk)
3885 u32 tipc_sock_get_portid(struct sock *sk)
3899 bool tipc_sk_overlimit1(struct sock *sk, struct sk_buff *skb)
3917 bool tipc_sk_overlimit2(struct sock *sk, struct sk_buff *skb)
3936 int tipc_sk_dump(struct sock *sk, u16 dqueues, char *buf)