Lines Matching refs:tcp

69 tcp_bind_hash_insert(tf_t *tbf, tcp_t *tcp, int caller_holds_lock)  in tcp_bind_hash_insert()  argument
74 conn_t *connp = tcp->tcp_connp; in tcp_bind_hash_insert()
77 if (tcp->tcp_ptpbhn != NULL) { in tcp_bind_hash_insert()
79 tcp_bind_hash_remove(tcp); in tcp_bind_hash_insert()
125 tcpnext->tcp_ptpbhn = &tcp->tcp_bind_hash_port; in tcp_bind_hash_insert()
129 &(tcp->tcp_bind_hash); in tcp_bind_hash_insert()
134 tcpnext->tcp_ptpbhn = &tcp->tcp_bind_hash_port; in tcp_bind_hash_insert()
138 &(tcp->tcp_bind_hash); in tcp_bind_hash_insert()
144 tcp->tcp_bind_hash_port = tcpnext; in tcp_bind_hash_insert()
145 tcp->tcp_bind_hash = tcphash; in tcp_bind_hash_insert()
146 tcp->tcp_ptpbhn = tcpp; in tcp_bind_hash_insert()
147 tcpp[0] = tcp; in tcp_bind_hash_insert()
156 tcp_bind_hash_remove(tcp_t *tcp) in tcp_bind_hash_remove() argument
160 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_bind_hash_remove()
161 conn_t *connp = tcp->tcp_connp; in tcp_bind_hash_remove()
163 if (tcp->tcp_ptpbhn == NULL) in tcp_bind_hash_remove()
176 if (tcp->tcp_ptpbhn) { in tcp_bind_hash_remove()
177 tcpnext = tcp->tcp_bind_hash_port; in tcp_bind_hash_remove()
179 tcp->tcp_bind_hash_port = NULL; in tcp_bind_hash_remove()
180 tcpnext->tcp_ptpbhn = tcp->tcp_ptpbhn; in tcp_bind_hash_remove()
181 tcpnext->tcp_bind_hash = tcp->tcp_bind_hash; in tcp_bind_hash_remove()
185 tcp->tcp_bind_hash = NULL; in tcp_bind_hash_remove()
187 } else if ((tcpnext = tcp->tcp_bind_hash) != NULL) { in tcp_bind_hash_remove()
188 tcpnext->tcp_ptpbhn = tcp->tcp_ptpbhn; in tcp_bind_hash_remove()
189 tcp->tcp_bind_hash = NULL; in tcp_bind_hash_remove()
191 *tcp->tcp_ptpbhn = tcpnext; in tcp_bind_hash_remove()
192 tcp->tcp_ptpbhn = NULL; in tcp_bind_hash_remove()
214 tcp_update_next_port(in_port_t port, const tcp_t *tcp, boolean_t random) in tcp_update_next_port() argument
218 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_update_next_port()
270 (i = tsol_next_port(crgetzone(tcp->tcp_connp->conn_cred), port, in tcp_update_next_port()
287 tcp_get_next_priv_port(const tcp_t *tcp) in tcp_get_next_priv_port() argument
292 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_get_next_priv_port()
302 (nextport = tsol_next_port(crgetzone(tcp->tcp_connp->conn_cred), in tcp_get_next_priv_port()
311 tcp_bind_select_lport(tcp_t *tcp, in_port_t *requested_port_ptr, in tcp_bind_select_lport() argument
319 conn_t *connp = tcp->tcp_connp; in tcp_bind_select_lport()
321 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_bind_select_lport()
346 tcp_get_next_priv_port(tcp) : in tcp_bind_select_lport()
348 tcp, B_TRUE); in tcp_bind_select_lport()
410 connp = tcp->tcp_connp; in tcp_bind_select_lport()
483 allocated_port = tcp_bindi(tcp, requested_port, &v6addr, in tcp_bind_select_lport()
524 tcp_t *tcp = connp->conn_tcp; in tcp_bind_check() local
539 if (tcp->tcp_state == TCPS_BOUND) { in tcp_bind_check()
541 } else if (tcp->tcp_state > TCPS_BOUND) { in tcp_bind_check()
544 "tcp_bind: bad state, %d", tcp->tcp_state); in tcp_bind_check()
630 error = tcp_bind_select_lport(tcp, &requested_port, in tcp_bind_check()
657 tcp_bindi(tcp_t *tcp, in_port_t port, const in6_addr_t *laddr, in tcp_bindi() argument
665 conn_t *connp = tcp->tcp_connp; in tcp_bindi()
666 tcp_stack_t *tcps = tcp->tcp_tcps; in tcp_bindi()
717 tcp_bind_hash_remove(tcp); in tcp_bindi()
789 TCP_IS_SOCKET(tcp)); in tcp_bindi()
890 tcp->tcp_state = TCPS_BOUND; in tcp_bindi()
893 void, NULL, tcp_t *, tcp, void, NULL, in tcp_bindi()
900 tcp_bind_hash_insert(tbf, tcp, 1); in tcp_bindi()
922 port = tcp_get_next_priv_port(tcp); in tcp_bindi()
932 tcp, B_TRUE); in tcp_bindi()
935 port = tcp_update_next_port(port + 1, tcp, in tcp_bindi()