Lines Matching refs:tcp
70 tcp_bind_hash_insert(tf_t *tbf, tcp_t *tcp, int caller_holds_lock) in tcp_bind_hash_insert() argument
75 conn_t *connp = tcp->tcp_connp; in tcp_bind_hash_insert()
78 if (tcp->tcp_ptpbhn != NULL) { in tcp_bind_hash_insert()
80 tcp_bind_hash_remove(tcp); in tcp_bind_hash_insert()
126 tcpnext->tcp_ptpbhn = &tcp->tcp_bind_hash_port; in tcp_bind_hash_insert()
130 &(tcp->tcp_bind_hash); in tcp_bind_hash_insert()
135 tcpnext->tcp_ptpbhn = &tcp->tcp_bind_hash_port; in tcp_bind_hash_insert()
139 &(tcp->tcp_bind_hash); in tcp_bind_hash_insert()
145 tcp->tcp_bind_hash_port = tcpnext; in tcp_bind_hash_insert()
146 tcp->tcp_bind_hash = tcphash; in tcp_bind_hash_insert()
147 tcp->tcp_ptpbhn = tcpp; in tcp_bind_hash_insert()
148 tcpp[0] = tcp; in tcp_bind_hash_insert()
157 tcp_bind_hash_remove(tcp_t *tcp) in tcp_bind_hash_remove() argument
161 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_bind_hash_remove()
162 conn_t *connp = tcp->tcp_connp; in tcp_bind_hash_remove()
164 if (tcp->tcp_ptpbhn == NULL) in tcp_bind_hash_remove()
177 if (tcp->tcp_ptpbhn) { in tcp_bind_hash_remove()
178 tcpnext = tcp->tcp_bind_hash_port; in tcp_bind_hash_remove()
180 tcp->tcp_bind_hash_port = NULL; in tcp_bind_hash_remove()
181 tcpnext->tcp_ptpbhn = tcp->tcp_ptpbhn; in tcp_bind_hash_remove()
182 tcpnext->tcp_bind_hash = tcp->tcp_bind_hash; in tcp_bind_hash_remove()
186 tcp->tcp_bind_hash = NULL; in tcp_bind_hash_remove()
188 } else if ((tcpnext = tcp->tcp_bind_hash) != NULL) { in tcp_bind_hash_remove()
189 tcpnext->tcp_ptpbhn = tcp->tcp_ptpbhn; in tcp_bind_hash_remove()
190 tcp->tcp_bind_hash = NULL; in tcp_bind_hash_remove()
192 *tcp->tcp_ptpbhn = tcpnext; in tcp_bind_hash_remove()
193 tcp->tcp_ptpbhn = NULL; in tcp_bind_hash_remove()
215 tcp_update_next_port(in_port_t port, const tcp_t *tcp, boolean_t random) in tcp_update_next_port() argument
219 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_update_next_port()
271 (i = tsol_next_port(crgetzone(tcp->tcp_connp->conn_cred), port, in tcp_update_next_port()
288 tcp_get_next_priv_port(const tcp_t *tcp) in tcp_get_next_priv_port() argument
293 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_get_next_priv_port()
303 (nextport = tsol_next_port(crgetzone(tcp->tcp_connp->conn_cred), in tcp_get_next_priv_port()
312 tcp_bind_select_lport(tcp_t *tcp, in_port_t *requested_port_ptr, in tcp_bind_select_lport() argument
320 conn_t *connp = tcp->tcp_connp; in tcp_bind_select_lport()
322 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_bind_select_lport()
347 tcp_get_next_priv_port(tcp) : in tcp_bind_select_lport()
349 tcp, B_TRUE); in tcp_bind_select_lport()
411 connp = tcp->tcp_connp; in tcp_bind_select_lport()
484 allocated_port = tcp_bindi(tcp, requested_port, &v6addr, in tcp_bind_select_lport()
525 tcp_t *tcp = connp->conn_tcp; in tcp_bind_check() local
540 if (tcp->tcp_state == TCPS_BOUND) { in tcp_bind_check()
542 } else if (tcp->tcp_state > TCPS_BOUND) { in tcp_bind_check()
545 "tcp_bind: bad state, %d", tcp->tcp_state); in tcp_bind_check()
631 error = tcp_bind_select_lport(tcp, &requested_port, in tcp_bind_check()
658 tcp_bindi(tcp_t *tcp, in_port_t port, const in6_addr_t *laddr, in tcp_bindi() argument
666 conn_t *connp = tcp->tcp_connp; in tcp_bindi()
667 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_bindi()
718 tcp_bind_hash_remove(tcp); in tcp_bindi()
800 TCP_IS_SOCKET(tcp)); in tcp_bindi()
901 tcp->tcp_state = TCPS_BOUND; in tcp_bindi()
904 void, NULL, tcp_t *, tcp, void, NULL, in tcp_bindi()
911 tcp_bind_hash_insert(tbf, tcp, 1); in tcp_bindi()
933 port = tcp_get_next_priv_port(tcp); in tcp_bindi()
943 tcp, B_TRUE); in tcp_bindi()
946 port = tcp_update_next_port(port + 1, tcp, in tcp_bindi()