Lines Matching refs:sockets
483 old_timeout = sockets[sock_id].in_timeout; in tcp_drain_input()
484 sockets[sock_id].in_timeout = timeout; in tcp_drain_input()
490 old_in_gram = sockets[sock_id].inq; in tcp_drain_input()
491 sockets[sock_id].inq = NULL; in tcp_drain_input()
495 if (sockets[sock_id].input[i] != NULL) { in tcp_drain_input()
496 if (sockets[sock_id].input[i](sock_id) < 0) { in tcp_drain_input()
497 sockets[sock_id].in_timeout = old_timeout; in tcp_drain_input()
498 if (sockets[sock_id].inq != NULL) in tcp_drain_input()
499 nuke_grams(&sockets[sock_id].inq); in tcp_drain_input()
500 sockets[sock_id].inq = old_in_gram; in tcp_drain_input()
508 while ((in_gram = sockets[sock_id].inq) != NULL) { in tcp_drain_input()
515 del_gram(&sockets[sock_id].inq, in_gram, B_TRUE); in tcp_drain_input()
519 del_gram(&sockets[sock_id].inq, in_gram, B_FALSE); in tcp_drain_input()
522 sockets[sock_id].in_timeout = old_timeout; in tcp_drain_input()
530 if (sockets[sock_id].pcb == NULL) in tcp_drain_input()
534 if (tcp == NULL || sockets[sock_id].pcb == NULL) { in tcp_drain_input()
535 if (sockets[sock_id].so_error != 0) in tcp_drain_input()
543 sockets[sock_id].in_timeout = old_timeout; in tcp_drain_input()
544 sockets[sock_id].inq = old_in_gram; in tcp_drain_input()
568 if ((tcp = sockets[sock_id].pcb) == NULL) in tcp_input()
571 while ((in_gram = sockets[sock_id].inq) != NULL) { in tcp_input()
578 del_gram(&sockets[sock_id].inq, in_gram, B_TRUE); in tcp_input()
582 del_gram(&sockets[sock_id].inq, in_gram, B_FALSE); in tcp_input()
586 if (sockets[sock_id].pcb == NULL) in tcp_input()
596 sockets[sock_id].so_state |= SS_CANTRCVMORE; in tcp_input()
828 if ((tcp = sockets[sock_id].pcb) == NULL) { in tcp_shutdown()
842 if (sockets[sock_id].pcb != NULL) in tcp_shutdown()
864 if (sockets[sock_id].pcb == NULL) in tcp_shutdown()
885 if ((tcp = sockets[sock_id].pcb) == NULL) { in tcp_close()
901 if (sockets[sock_id].pcb != NULL) in tcp_close()
958 if (sockets[sock_id].pcb == NULL) in tcp_close()
978 if (sockets[sock_id].pcb != NULL) { in tcp_close()
989 if (sockets[sock_id].pcb == NULL) in tcp_close()
1012 sockets[sock_id].pcb = NULL; in tcp_close()
1022 if ((tcp = (tcp_t *)(sockets[sock_id].pcb)) == NULL) { in tcp_listen()
1058 if ((listener = (tcp_t *)(sockets[sock_id].pcb)) == NULL || in tcp_accept()
1066 if (sockets[sock_id].in_timeout > tcp_accept_timeout) in tcp_accept()
1067 timeout = prom_gettime() + sockets[sock_id].in_timeout; in tcp_accept()
1099 bkmem_free((caddr_t)(sockets[new_sock_id].pcb), sizeof (tcp_t)); in tcp_accept()
1106 sockets[new_sock_id].pcb = eager; in tcp_accept()
1145 if (sockets[i].type != INETBOOT_STREAM || in tcp_bindi()
1146 ((tcp = (tcp_t *)sockets[i].pcb) == NULL) || in tcp_bindi()
1185 if ((tcp = (tcp_t *)sockets[sock_id].pcb) == NULL) { in tcp_bind()
1196 requested_port = ntohs(sockets[sock_id].bind.sin_port); in tcp_bind()
1199 tcp->tcp_bound_source = sockets[sock_id].bind.sin_addr.s_addr; in tcp_bind()
1212 reuseaddr = sockets[sock_id].so_opt & SO_REUSEADDR; in tcp_bind()
1222 sockets[sock_id].bind.sin_port = tcp->tcp_lport; in tcp_bind()
1237 if (sockets[i].type != INETBOOT_STREAM) in tcp_conn_check()
1240 if ((tmp_tcp = (tcp_t *)sockets[i].pcb) == NULL) in tcp_conn_check()
1268 if ((tcp = (tcp_t *)(sockets[sock_id].pcb)) == NULL) { in tcp_connect()
1275 dstaddr = sockets[sock_id].remote.sin_addr.s_addr; in tcp_connect()
1276 dstport = sockets[sock_id].remote.sin_port; in tcp_connect()
1307 ipv4_getipaddr(&(sockets[sock_id].bind.sin_addr)); in tcp_connect()
1309 if (ntohl(sockets[sock_id].bind.sin_addr.s_addr) == in tcp_connect()
1314 tcp->tcp_bound_source = sockets[sock_id].bind.sin_addr.s_addr; in tcp_connect()
1713 timeout = sockets[sock_id].in_timeout; in tcp_state_wait()
1715 sockets[sock_id].in_timeout = tcp->tcp_rto; in tcp_state_wait()
1719 if (sockets[sock_id].inq == NULL) { in tcp_state_wait()
1722 if (sockets[sock_id].input[i] != NULL) { in tcp_state_wait()
1723 if (sockets[sock_id].input[i](sock_id) < 0) { in tcp_state_wait()
1725 sockets[sock_id].in_timeout = in tcp_state_wait()
1734 while ((in_gram = sockets[sock_id].inq) != NULL) { in tcp_state_wait()
1745 del_gram(&sockets[sock_id].inq, in_gram, B_TRUE); in tcp_state_wait()
1749 del_gram(&sockets[sock_id].inq, in_gram, B_FALSE); in tcp_state_wait()
1759 if (sockets[sock_id].pcb == NULL) { in tcp_state_wait()
1765 if (tcp == NULL || sockets[sock_id].pcb == NULL) { in tcp_state_wait()
1768 "error %d\n", state, sockets[sock_id].so_error); in tcp_state_wait()
1770 if (sockets[sock_id].so_error != 0) in tcp_state_wait()
1790 sockets[sock_id].in_timeout = timeout; in tcp_state_wait()
1834 if (sockets[i].type == INETBOOT_STREAM && in tcp_lookup_ipv4()
1835 (tcp = (tcp_t *)sockets[i].pcb) != NULL) { in tcp_lookup_ipv4()
1869 if (sockets[i].type == INETBOOT_STREAM && in tcp_lookup_listener_ipv4()
1870 (tcp = (tcp_t *)sockets[i].pcb) != NULL) { in tcp_lookup_listener_ipv4()
1926 sockets[sock_id].pcb = NULL; in tcp_clean_death()
1928 sockets[sock_id].so_error = err; in tcp_clean_death()
4090 if (++tcp->tcp_rack_cnt == 2 || sockets[sock_id].inq == NULL) { in tcp_rput_data()
4173 if (sockets[sock_id].pcb == NULL) in tcp_rput_data()
5216 if ((sockets[sock_id].pcb == NULL) || (sockets[sock_id].pcb != tcp)) in tcp_time_wait_processing()
6746 if (sockets[sock_id].so_rcvbuf <= 0) in tcp_rcv_drain()
6775 add_grams(&sockets[sock_id].inq, in_gram); in tcp_rcv_drain()
6778 sockets[sock_id].so_rcvbuf -= in_mp->b_wptr - in_mp->b_rptr; in tcp_rcv_drain()
6785 if (sockets[sock_id].so_rcvbuf > 0 && in tcp_rcv_drain()
6800 if ((tcp = sockets[sock_id].pcb) == NULL) in tcp_rcv_drain_sock()
6816 sockets[sock_id].inq, tcp->tcp_rcv_list); in tcp_drain_needed()
6818 if ((sockets[sock_id].inq != NULL) || in tcp_drain_needed()
6830 add_grams(&sockets[sock_id].inq, in_gram); in tcp_drain_needed()