Lines Matching refs:sctp

159 	sctp_t		*sctp;  in cl_sctp_walk_list_stack()  local
167 sctp = list_head(&sctps->sctps_g_list); in cl_sctp_walk_list_stack()
168 while (sctp != NULL) { in cl_sctp_walk_list_stack()
172 mutex_enter(&sctp->sctp_reflock); in cl_sctp_walk_list_stack()
173 if (sctp->sctp_condemned || sctp->sctp_state <= SCTPS_LISTEN) { in cl_sctp_walk_list_stack()
174 mutex_exit(&sctp->sctp_reflock); in cl_sctp_walk_list_stack()
175 sctp = list_next(&sctps->sctps_g_list, sctp); in cl_sctp_walk_list_stack()
178 sctp->sctp_refcnt++; in cl_sctp_walk_list_stack()
179 mutex_exit(&sctp->sctp_reflock); in cl_sctp_walk_list_stack()
183 RUN_SCTP(sctp); in cl_sctp_walk_list_stack()
184 ssize = sizeof (in6_addr_t) * sctp->sctp_nsaddrs; in cl_sctp_walk_list_stack()
185 fsize = sizeof (in6_addr_t) * sctp->sctp_nfaddrs; in cl_sctp_walk_list_stack()
190 WAKE_SCTP(sctp); in cl_sctp_walk_list_stack()
195 SCTP_REFRELE(sctp); in cl_sctp_walk_list_stack()
199 sctp_get_saddr_list(sctp, slist, ssize); in cl_sctp_walk_list_stack()
200 sctp_get_faddr_list(sctp, flist, fsize); in cl_sctp_walk_list_stack()
201 cl_sctpi.cl_sctpi_nladdr = sctp->sctp_nsaddrs; in cl_sctp_walk_list_stack()
202 cl_sctpi.cl_sctpi_nfaddr = sctp->sctp_nfaddrs; in cl_sctp_walk_list_stack()
203 cl_sctpi.cl_sctpi_family = sctp->sctp_connp->conn_family; in cl_sctp_walk_list_stack()
208 cl_sctpi.cl_sctpi_state = sctp->sctp_state; in cl_sctp_walk_list_stack()
209 cl_sctpi.cl_sctpi_lport = sctp->sctp_connp->conn_lport; in cl_sctp_walk_list_stack()
210 cl_sctpi.cl_sctpi_fport = sctp->sctp_connp->conn_fport; in cl_sctp_walk_list_stack()
211 cl_sctpi.cl_sctpi_handle = (cl_sctp_handle_t)sctp; in cl_sctp_walk_list_stack()
212 WAKE_SCTP(sctp); in cl_sctp_walk_list_stack()
218 SCTP_REFRELE(sctp); in cl_sctp_walk_list_stack()
222 sctp_prev = sctp; in cl_sctp_walk_list_stack()
224 sctp = list_next(&sctps->sctps_g_list, sctp); in cl_sctp_walk_list_stack()
237 sctp_t *sctp; in sctp_conn_match() local
245 for (sctp = tf->tf_sctp; sctp != NULL; sctp = in sctp_conn_match()
246 sctp->sctp_conn_hash_next) { in sctp_conn_match()
247 connp = sctp->sctp_connp; in sctp_conn_match()
258 for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { in sctp_conn_match()
263 if (sctp_saddr_lookup(sctp, laddr, 0) in sctp_conn_match()
265 SCTP_REFHOLD(sctp); in sctp_conn_match()
267 return (sctp); in sctp_conn_match()
277 return (sctp); in sctp_conn_match()
284 sctp_t *sctp; in listen_match() local
294 for (sctp = tf->tf_sctp; sctp; sctp = sctp->sctp_listen_hash_next) { in listen_match()
295 connp = sctp->sctp_connp; in listen_match()
306 if (sctp_saddr_lookup(sctp, laddr, 0) != NULL) { in listen_match()
307 SCTP_REFHOLD(sctp); in listen_match()
315 return (sctp); in listen_match()
323 sctp_t *sctp; in sctp_find_conn() local
325 sctp = sctp_conn_match(&src, 1, dst, ports, zoneid, iraflags, sctps); in sctp_find_conn()
326 if (sctp == NULL) { in sctp_find_conn()
328 sctp = listen_match(dst, ports, zoneid, iraflags, sctps); in sctp_find_conn()
329 if (sctp == NULL) in sctp_find_conn()
332 return (sctp->sctp_connp); in sctp_find_conn()
352 sctp_t *sctp; in sctp_lookup_by_faddrs() local
367 if ((sctp = sctp_conn_match(&srcp, 1, dstp, ports, zoneid, iraflags, in sctp_lookup_by_faddrs()
369 return (sctp); in sctp_lookup_by_faddrs()
461 sctp = sctp_conn_match(addrbuf, nfaddr, dstp, ports, in sctp_lookup_by_faddrs()
476 return (sctp); in sctp_lookup_by_faddrs()
488 sctp_t *sctp; in sctp_fanout() local
490 sctp = sctp_lookup_by_faddrs(mp, sctph, src, dst, ports, zoneid, in sctp_fanout()
492 if (sctp == NULL) { in sctp_fanout()
494 sctp = listen_match(dst, ports, zoneid, iraflags, sctps); in sctp_fanout()
495 if (sctp == NULL) in sctp_fanout()
505 sctp->sctp_connp)) { in sctp_fanout()
510 conn_t *, sctp->sctp_connp, mblk_t *, mp); in sctp_fanout()
511 SCTP_REFRELE(sctp); in sctp_fanout()
520 return (sctp->sctp_connp); in sctp_fanout()
531 sctp_t *sctp; in ip_fanout_sctp() local
570 sctp = CONN2SCTP(connp); in ip_fanout_sctp()
583 SCTP_REFRELE(sctp); in ip_fanout_sctp()
590 mutex_enter(&sctp->sctp_lock); in ip_fanout_sctp()
591 if (sctp->sctp_running) { in ip_fanout_sctp()
592 sctp_add_recvq(sctp, mp, B_FALSE, ira); in ip_fanout_sctp()
593 mutex_exit(&sctp->sctp_lock); in ip_fanout_sctp()
595 sctp->sctp_running = B_TRUE; in ip_fanout_sctp()
596 mutex_exit(&sctp->sctp_lock); in ip_fanout_sctp()
598 mutex_enter(&sctp->sctp_recvq_lock); in ip_fanout_sctp()
599 if (sctp->sctp_recvq != NULL) { in ip_fanout_sctp()
600 sctp_add_recvq(sctp, mp, B_TRUE, ira); in ip_fanout_sctp()
601 mutex_exit(&sctp->sctp_recvq_lock); in ip_fanout_sctp()
602 WAKE_SCTP(sctp); in ip_fanout_sctp()
604 mutex_exit(&sctp->sctp_recvq_lock); in ip_fanout_sctp()
606 sctp_icmp_error(sctp, mp); in ip_fanout_sctp()
608 sctp_input_data(sctp, mp, ira); in ip_fanout_sctp()
610 WAKE_SCTP(sctp); in ip_fanout_sctp()
613 SCTP_REFRELE(sctp); in ip_fanout_sctp()
619 sctp_conn_hash_remove(sctp_t *sctp) in sctp_conn_hash_remove() argument
621 sctp_tf_t *tf = sctp->sctp_conn_tfp; in sctp_conn_hash_remove()
631 (*cl_sctp_disconnect)(sctp->sctp_connp->conn_family, in sctp_conn_hash_remove()
632 (cl_sctp_handle_t)sctp); in sctp_conn_hash_remove()
637 if (tf->tf_sctp == sctp) { in sctp_conn_hash_remove()
638 tf->tf_sctp = sctp->sctp_conn_hash_next; in sctp_conn_hash_remove()
639 if (sctp->sctp_conn_hash_next) { in sctp_conn_hash_remove()
640 ASSERT(tf->tf_sctp->sctp_conn_hash_prev == sctp); in sctp_conn_hash_remove()
644 ASSERT(sctp->sctp_conn_hash_prev); in sctp_conn_hash_remove()
645 ASSERT(sctp->sctp_conn_hash_prev->sctp_conn_hash_next == sctp); in sctp_conn_hash_remove()
646 sctp->sctp_conn_hash_prev->sctp_conn_hash_next = in sctp_conn_hash_remove()
647 sctp->sctp_conn_hash_next; in sctp_conn_hash_remove()
649 if (sctp->sctp_conn_hash_next) { in sctp_conn_hash_remove()
650 ASSERT(sctp->sctp_conn_hash_next->sctp_conn_hash_prev in sctp_conn_hash_remove()
651 == sctp); in sctp_conn_hash_remove()
652 sctp->sctp_conn_hash_next->sctp_conn_hash_prev = in sctp_conn_hash_remove()
653 sctp->sctp_conn_hash_prev; in sctp_conn_hash_remove()
656 sctp->sctp_conn_hash_next = NULL; in sctp_conn_hash_remove()
657 sctp->sctp_conn_hash_prev = NULL; in sctp_conn_hash_remove()
658 sctp->sctp_conn_tfp = NULL; in sctp_conn_hash_remove()
663 sctp_conn_hash_insert(sctp_tf_t *tf, sctp_t *sctp, int caller_holds_lock) in sctp_conn_hash_insert() argument
665 if (sctp->sctp_conn_tfp) { in sctp_conn_hash_insert()
666 sctp_conn_hash_remove(sctp); in sctp_conn_hash_insert()
675 sctp->sctp_conn_hash_next = tf->tf_sctp; in sctp_conn_hash_insert()
677 tf->tf_sctp->sctp_conn_hash_prev = sctp; in sctp_conn_hash_insert()
679 sctp->sctp_conn_hash_prev = NULL; in sctp_conn_hash_insert()
680 tf->tf_sctp = sctp; in sctp_conn_hash_insert()
681 sctp->sctp_conn_tfp = tf; in sctp_conn_hash_insert()
688 sctp_listen_hash_remove(sctp_t *sctp) in sctp_listen_hash_remove() argument
690 sctp_tf_t *tf = sctp->sctp_listen_tfp; in sctp_listen_hash_remove()
691 conn_t *connp = sctp->sctp_connp; in sctp_listen_hash_remove()
704 ssize = sizeof (in6_addr_t) * sctp->sctp_nsaddrs; in sctp_listen_hash_remove()
706 sctp_get_saddr_list(sctp, slist, ssize); in sctp_listen_hash_remove()
708 sctp->sctp_nsaddrs, connp->conn_lport); in sctp_listen_hash_remove()
714 if (tf->tf_sctp == sctp) { in sctp_listen_hash_remove()
715 tf->tf_sctp = sctp->sctp_listen_hash_next; in sctp_listen_hash_remove()
716 if (sctp->sctp_listen_hash_next != NULL) { in sctp_listen_hash_remove()
717 ASSERT(tf->tf_sctp->sctp_listen_hash_prev == sctp); in sctp_listen_hash_remove()
721 ASSERT(sctp->sctp_listen_hash_prev); in sctp_listen_hash_remove()
722 ASSERT(sctp->sctp_listen_hash_prev->sctp_listen_hash_next == in sctp_listen_hash_remove()
723 sctp); in sctp_listen_hash_remove()
724 ASSERT(sctp->sctp_listen_hash_next == NULL || in sctp_listen_hash_remove()
725 sctp->sctp_listen_hash_next->sctp_listen_hash_prev == sctp); in sctp_listen_hash_remove()
727 sctp->sctp_listen_hash_prev->sctp_listen_hash_next = in sctp_listen_hash_remove()
728 sctp->sctp_listen_hash_next; in sctp_listen_hash_remove()
730 if (sctp->sctp_listen_hash_next != NULL) { in sctp_listen_hash_remove()
731 sctp_t *next = sctp->sctp_listen_hash_next; in sctp_listen_hash_remove()
733 ASSERT(next->sctp_listen_hash_prev == sctp); in sctp_listen_hash_remove()
735 sctp->sctp_listen_hash_prev; in sctp_listen_hash_remove()
738 sctp->sctp_listen_hash_next = NULL; in sctp_listen_hash_remove()
739 sctp->sctp_listen_hash_prev = NULL; in sctp_listen_hash_remove()
740 sctp->sctp_listen_tfp = NULL; in sctp_listen_hash_remove()
745 sctp_listen_hash_insert(sctp_tf_t *tf, sctp_t *sctp) in sctp_listen_hash_insert() argument
747 conn_t *connp = sctp->sctp_connp; in sctp_listen_hash_insert()
749 if (sctp->sctp_listen_tfp) { in sctp_listen_hash_insert()
750 sctp_listen_hash_remove(sctp); in sctp_listen_hash_insert()
754 sctp->sctp_listen_hash_next = tf->tf_sctp; in sctp_listen_hash_insert()
756 tf->tf_sctp->sctp_listen_hash_prev = sctp; in sctp_listen_hash_insert()
758 sctp->sctp_listen_hash_prev = NULL; in sctp_listen_hash_insert()
759 tf->tf_sctp = sctp; in sctp_listen_hash_insert()
760 sctp->sctp_listen_tfp = tf; in sctp_listen_hash_insert()
770 ssize = sizeof (in6_addr_t) * sctp->sctp_nsaddrs; in sctp_listen_hash_insert()
772 sctp_get_saddr_list(sctp, slist, ssize); in sctp_listen_hash_insert()
774 sctp->sctp_nsaddrs, connp->conn_lport); in sctp_listen_hash_insert()
785 sctp_bind_hash_insert(sctp_tf_t *tbf, sctp_t *sctp, int caller_holds_lock) in sctp_bind_hash_insert() argument
790 if (sctp->sctp_ptpbhn != NULL) { in sctp_bind_hash_insert()
792 sctp_bind_hash_remove(sctp); in sctp_bind_hash_insert()
802 sctpnext->sctp_ptpbhn = &sctp->sctp_bind_hash; in sctp_bind_hash_insert()
804 sctp->sctp_bind_hash = sctpnext; in sctp_bind_hash_insert()
805 sctp->sctp_ptpbhn = sctpp; in sctp_bind_hash_insert()
806 sctpp[0] = sctp; in sctp_bind_hash_insert()
808 sctp->sctp_bind_lockp = &tbf->tf_lock; in sctp_bind_hash_insert()
817 sctp_bind_hash_remove(sctp_t *sctp) in sctp_bind_hash_remove() argument
822 lockp = sctp->sctp_bind_lockp; in sctp_bind_hash_remove()
824 if (sctp->sctp_ptpbhn == NULL) in sctp_bind_hash_remove()
829 if (sctp->sctp_ptpbhn) { in sctp_bind_hash_remove()
830 sctpnext = sctp->sctp_bind_hash; in sctp_bind_hash_remove()
832 sctpnext->sctp_ptpbhn = sctp->sctp_ptpbhn; in sctp_bind_hash_remove()
833 sctp->sctp_bind_hash = NULL; in sctp_bind_hash_remove()
835 *sctp->sctp_ptpbhn = sctpnext; in sctp_bind_hash_remove()
836 sctp->sctp_ptpbhn = NULL; in sctp_bind_hash_remove()
839 sctp->sctp_bind_lockp = NULL; in sctp_bind_hash_remove()
857 sctp_t *sctp; in sctp_lookup() local
862 for (sctp = tf->tf_sctp; sctp != NULL; in sctp_lookup()
863 sctp = sctp->sctp_conn_hash_next) { in sctp_lookup()
864 if (*ports != sctp->sctp_connp->conn_ports || in sctp_lookup()
865 sctp->sctp_state < min_state) { in sctp_lookup()
870 for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { in sctp_lookup()
887 if (sctp_compare_saddrs(sctp1, sctp) <= SCTP_ADDR_OVERLAP) { in sctp_lookup()
895 if (sctp != NULL) { in sctp_lookup()
896 SCTP_REFHOLD(sctp); in sctp_lookup()
898 return (sctp); in sctp_lookup()