Lines Matching defs:sock
48 #include <net/sock.h>
101 struct socket *sock; /* NULL if not connected */
287 static void lowcomms_data_ready(struct sock *sk, int count_unused)
294 static void lowcomms_write_space(struct sock *sk)
310 static void lowcomms_state_change(struct sock *sk)
335 static int add_sock(struct socket *sock, struct connection *con)
337 con->sock = sock;
340 con->sock->sk->sk_data_ready = lowcomms_data_ready;
341 con->sock->sk->sk_write_space = lowcomms_write_space;
342 con->sock->sk->sk_state_change = lowcomms_state_change;
343 con->sock->sk->sk_user_data = con;
344 con->sock->sk->sk_allocation = GFP_NOFS;
372 if (con->sock) {
373 sock_release(con->sock);
374 con->sock = NULL;
419 ret = kernel_sendmsg(con->sock, &outmessage, NULL, 0, 0);
482 ret = kernel_getsockopt(con->sock,
515 /* Peel off a new sock */
517 ret = kernel_getsockopt(con->sock, IPPROTO_SCTP,
526 new_con->sock = sockfd_lookup(parg.sd, &err);
527 if (!new_con->sock) {
531 add_sock(new_con->sock, new_con);
532 sockfd_put(new_con->sock);
591 if (con->sock == NULL) {
633 r = ret = kernel_recvmsg(con->sock, &msg, iov, nvec, len,
716 if (con->sock == NULL)
719 newsock->type = con->sock->type;
720 newsock->ops = con->sock->ops;
722 result = con->sock->ops->accept(con->sock, newsock, O_NONBLOCK);
756 if (newcon->sock) {
774 if (!othercon->sock) {
776 othercon->sock = newsock;
889 ret = kernel_sendmsg(base_con->sock, &outmessage, iov, 1, len);
917 struct socket *sock = NULL;
920 log_print("attempt to connect sock 0 foiled");
929 if (con->sock) {
936 IPPROTO_TCP, &sock);
944 sock->sk->sk_user_data = con;
947 add_sock(sock, con);
953 result = sock->ops->bind(sock, (struct sockaddr *) &src_addr,
964 sock->ops->connect(sock, (struct sockaddr *)&saddr, addr_len,
972 if (con->sock) {
973 sock_release(con->sock);
974 con->sock = NULL;
975 } else if (sock) {
976 sock_release(sock);
996 struct socket *sock = NULL;
1008 IPPROTO_TCP, &sock);
1014 result = kernel_setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
1020 sock->sk->sk_user_data = con;
1023 con->sock = sock;
1027 result = sock->ops->bind(sock, (struct sockaddr *) saddr, addr_len);
1030 sock_release(sock);
1031 sock = NULL;
1032 con->sock = NULL;
1035 result = kernel_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE,
1041 result = sock->ops->listen(sock, 5);
1044 sock_release(sock);
1045 sock = NULL;
1050 return sock;
1081 result = kernel_bind(sctp_con->sock,
1085 result = kernel_setsockopt(sctp_con->sock, SOL_SCTP,
1099 struct socket *sock = NULL;
1112 IPPROTO_SCTP, &sock);
1126 result = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVBUFFORCE,
1131 result = kernel_setsockopt(sock, SOL_SCTP, SCTP_EVENTS,
1140 sock->sk->sk_user_data = con;
1141 con->sock = sock;
1142 con->sock->sk->sk_data_ready = lowcomms_data_ready;
1157 result = sock->ops->listen(sock, 5);
1166 sock_release(sock);
1167 con->sock = NULL;
1174 struct socket *sock = NULL;
1190 sock = tcp_create_listen_sock(con, dlm_local_addr[0]);
1191 if (sock) {
1192 add_sock(sock, con);
1302 if (con->sock == NULL)
1319 ret = kernel_sendpage(con->sock, e->page, offset, len,
1455 if (con->sock && con->sock->sk)
1456 con->sock->sk->sk_user_data = NULL;