Lines Matching refs:sctp
161 sctp_t *sctp; in cl_sctp_walk_list_stack() local
169 sctp = list_head(&sctps->sctps_g_list); in cl_sctp_walk_list_stack()
170 while (sctp != NULL) { in cl_sctp_walk_list_stack()
174 mutex_enter(&sctp->sctp_reflock); in cl_sctp_walk_list_stack()
175 if (sctp->sctp_condemned || sctp->sctp_state <= SCTPS_LISTEN) { in cl_sctp_walk_list_stack()
176 mutex_exit(&sctp->sctp_reflock); in cl_sctp_walk_list_stack()
177 sctp = list_next(&sctps->sctps_g_list, sctp); in cl_sctp_walk_list_stack()
180 sctp->sctp_refcnt++; in cl_sctp_walk_list_stack()
181 mutex_exit(&sctp->sctp_reflock); in cl_sctp_walk_list_stack()
185 RUN_SCTP(sctp); in cl_sctp_walk_list_stack()
186 ssize = sizeof (in6_addr_t) * sctp->sctp_nsaddrs; in cl_sctp_walk_list_stack()
187 fsize = sizeof (in6_addr_t) * sctp->sctp_nfaddrs; in cl_sctp_walk_list_stack()
192 WAKE_SCTP(sctp); in cl_sctp_walk_list_stack()
197 SCTP_REFRELE(sctp); in cl_sctp_walk_list_stack()
201 sctp_get_saddr_list(sctp, slist, ssize); in cl_sctp_walk_list_stack()
202 sctp_get_faddr_list(sctp, flist, fsize); in cl_sctp_walk_list_stack()
203 cl_sctpi.cl_sctpi_nladdr = sctp->sctp_nsaddrs; in cl_sctp_walk_list_stack()
204 cl_sctpi.cl_sctpi_nfaddr = sctp->sctp_nfaddrs; in cl_sctp_walk_list_stack()
205 cl_sctpi.cl_sctpi_family = sctp->sctp_connp->conn_family; in cl_sctp_walk_list_stack()
210 cl_sctpi.cl_sctpi_state = sctp->sctp_state; in cl_sctp_walk_list_stack()
211 cl_sctpi.cl_sctpi_lport = sctp->sctp_connp->conn_lport; in cl_sctp_walk_list_stack()
212 cl_sctpi.cl_sctpi_fport = sctp->sctp_connp->conn_fport; in cl_sctp_walk_list_stack()
213 cl_sctpi.cl_sctpi_handle = (cl_sctp_handle_t)sctp; in cl_sctp_walk_list_stack()
214 WAKE_SCTP(sctp); in cl_sctp_walk_list_stack()
220 SCTP_REFRELE(sctp); in cl_sctp_walk_list_stack()
224 sctp_prev = sctp; in cl_sctp_walk_list_stack()
226 sctp = list_next(&sctps->sctps_g_list, sctp); in cl_sctp_walk_list_stack()
239 sctp_t *sctp; in sctp_conn_match() local
247 for (sctp = tf->tf_sctp; sctp != NULL; sctp = in sctp_conn_match()
248 sctp->sctp_conn_hash_next) { in sctp_conn_match()
249 connp = sctp->sctp_connp; in sctp_conn_match()
260 for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { in sctp_conn_match()
265 if (sctp_saddr_lookup(sctp, laddr, 0) in sctp_conn_match()
267 SCTP_REFHOLD(sctp); in sctp_conn_match()
269 return (sctp); in sctp_conn_match()
279 return (sctp); in sctp_conn_match()
286 sctp_t *sctp; in listen_match() local
296 for (sctp = tf->tf_sctp; sctp; sctp = sctp->sctp_listen_hash_next) { in listen_match()
297 connp = sctp->sctp_connp; in listen_match()
308 if (sctp_saddr_lookup(sctp, laddr, 0) != NULL) { in listen_match()
309 SCTP_REFHOLD(sctp); in listen_match()
317 return (sctp); in listen_match()
325 sctp_t *sctp; in sctp_find_conn() local
327 sctp = sctp_conn_match(&src, 1, dst, ports, zoneid, iraflags, sctps); in sctp_find_conn()
328 if (sctp == NULL) { in sctp_find_conn()
330 sctp = listen_match(dst, ports, zoneid, iraflags, sctps); in sctp_find_conn()
331 if (sctp == NULL) in sctp_find_conn()
334 return (sctp->sctp_connp); in sctp_find_conn()
354 sctp_t *sctp; in sctp_lookup_by_faddrs() local
369 if ((sctp = sctp_conn_match(&srcp, 1, dstp, ports, zoneid, iraflags, in sctp_lookup_by_faddrs()
371 return (sctp); in sctp_lookup_by_faddrs()
463 sctp = sctp_conn_match(addrbuf, nfaddr, dstp, ports, in sctp_lookup_by_faddrs()
478 return (sctp); in sctp_lookup_by_faddrs()
490 sctp_t *sctp; in sctp_fanout() local
492 sctp = sctp_lookup_by_faddrs(mp, sctph, src, dst, ports, zoneid, in sctp_fanout()
494 if (sctp == NULL) { in sctp_fanout()
496 sctp = listen_match(dst, ports, zoneid, iraflags, sctps); in sctp_fanout()
497 if (sctp == NULL) in sctp_fanout()
507 sctp->sctp_connp)) { in sctp_fanout()
512 conn_t *, sctp->sctp_connp, mblk_t *, mp); in sctp_fanout()
513 SCTP_REFRELE(sctp); in sctp_fanout()
522 return (sctp->sctp_connp); in sctp_fanout()
533 sctp_t *sctp; in ip_fanout_sctp() local
572 sctp = CONN2SCTP(connp); in ip_fanout_sctp()
577 SCTP_REFRELE(sctp); in ip_fanout_sctp()
593 SCTP_REFRELE(sctp); in ip_fanout_sctp()
600 mutex_enter(&sctp->sctp_lock); in ip_fanout_sctp()
601 if (sctp->sctp_running) { in ip_fanout_sctp()
602 sctp_add_recvq(sctp, mp, B_FALSE, ira); in ip_fanout_sctp()
603 mutex_exit(&sctp->sctp_lock); in ip_fanout_sctp()
605 sctp->sctp_running = B_TRUE; in ip_fanout_sctp()
606 mutex_exit(&sctp->sctp_lock); in ip_fanout_sctp()
608 mutex_enter(&sctp->sctp_recvq_lock); in ip_fanout_sctp()
609 if (sctp->sctp_recvq != NULL) { in ip_fanout_sctp()
610 sctp_add_recvq(sctp, mp, B_TRUE, ira); in ip_fanout_sctp()
611 mutex_exit(&sctp->sctp_recvq_lock); in ip_fanout_sctp()
612 WAKE_SCTP(sctp); in ip_fanout_sctp()
614 mutex_exit(&sctp->sctp_recvq_lock); in ip_fanout_sctp()
616 sctp_icmp_error(sctp, mp); in ip_fanout_sctp()
618 sctp_input_data(sctp, mp, ira); in ip_fanout_sctp()
620 WAKE_SCTP(sctp); in ip_fanout_sctp()
623 SCTP_REFRELE(sctp); in ip_fanout_sctp()
629 sctp_conn_hash_remove(sctp_t *sctp) in sctp_conn_hash_remove() argument
631 sctp_tf_t *tf = sctp->sctp_conn_tfp; in sctp_conn_hash_remove()
641 (*cl_sctp_disconnect)(sctp->sctp_connp->conn_family, in sctp_conn_hash_remove()
642 (cl_sctp_handle_t)sctp); in sctp_conn_hash_remove()
647 if (tf->tf_sctp == sctp) { in sctp_conn_hash_remove()
648 tf->tf_sctp = sctp->sctp_conn_hash_next; in sctp_conn_hash_remove()
649 if (sctp->sctp_conn_hash_next) { in sctp_conn_hash_remove()
650 ASSERT(tf->tf_sctp->sctp_conn_hash_prev == sctp); in sctp_conn_hash_remove()
654 ASSERT(sctp->sctp_conn_hash_prev); in sctp_conn_hash_remove()
655 ASSERT(sctp->sctp_conn_hash_prev->sctp_conn_hash_next == sctp); in sctp_conn_hash_remove()
656 sctp->sctp_conn_hash_prev->sctp_conn_hash_next = in sctp_conn_hash_remove()
657 sctp->sctp_conn_hash_next; in sctp_conn_hash_remove()
659 if (sctp->sctp_conn_hash_next) { in sctp_conn_hash_remove()
660 ASSERT(sctp->sctp_conn_hash_next->sctp_conn_hash_prev in sctp_conn_hash_remove()
661 == sctp); in sctp_conn_hash_remove()
662 sctp->sctp_conn_hash_next->sctp_conn_hash_prev = in sctp_conn_hash_remove()
663 sctp->sctp_conn_hash_prev; in sctp_conn_hash_remove()
666 sctp->sctp_conn_hash_next = NULL; in sctp_conn_hash_remove()
667 sctp->sctp_conn_hash_prev = NULL; in sctp_conn_hash_remove()
668 sctp->sctp_conn_tfp = NULL; in sctp_conn_hash_remove()
673 sctp_conn_hash_insert(sctp_tf_t *tf, sctp_t *sctp, int caller_holds_lock) in sctp_conn_hash_insert() argument
675 if (sctp->sctp_conn_tfp) { in sctp_conn_hash_insert()
676 sctp_conn_hash_remove(sctp); in sctp_conn_hash_insert()
685 sctp->sctp_conn_hash_next = tf->tf_sctp; in sctp_conn_hash_insert()
687 tf->tf_sctp->sctp_conn_hash_prev = sctp; in sctp_conn_hash_insert()
689 sctp->sctp_conn_hash_prev = NULL; in sctp_conn_hash_insert()
690 tf->tf_sctp = sctp; in sctp_conn_hash_insert()
691 sctp->sctp_conn_tfp = tf; in sctp_conn_hash_insert()
698 sctp_listen_hash_remove(sctp_t *sctp) in sctp_listen_hash_remove() argument
700 sctp_tf_t *tf = sctp->sctp_listen_tfp; in sctp_listen_hash_remove()
701 conn_t *connp = sctp->sctp_connp; in sctp_listen_hash_remove()
714 ssize = sizeof (in6_addr_t) * sctp->sctp_nsaddrs; in sctp_listen_hash_remove()
716 sctp_get_saddr_list(sctp, slist, ssize); in sctp_listen_hash_remove()
718 sctp->sctp_nsaddrs, connp->conn_lport); in sctp_listen_hash_remove()
724 if (tf->tf_sctp == sctp) { in sctp_listen_hash_remove()
725 tf->tf_sctp = sctp->sctp_listen_hash_next; in sctp_listen_hash_remove()
726 if (sctp->sctp_listen_hash_next != NULL) { in sctp_listen_hash_remove()
727 ASSERT(tf->tf_sctp->sctp_listen_hash_prev == sctp); in sctp_listen_hash_remove()
731 ASSERT(sctp->sctp_listen_hash_prev); in sctp_listen_hash_remove()
732 ASSERT(sctp->sctp_listen_hash_prev->sctp_listen_hash_next == in sctp_listen_hash_remove()
733 sctp); in sctp_listen_hash_remove()
734 ASSERT(sctp->sctp_listen_hash_next == NULL || in sctp_listen_hash_remove()
735 sctp->sctp_listen_hash_next->sctp_listen_hash_prev == sctp); in sctp_listen_hash_remove()
737 sctp->sctp_listen_hash_prev->sctp_listen_hash_next = in sctp_listen_hash_remove()
738 sctp->sctp_listen_hash_next; in sctp_listen_hash_remove()
740 if (sctp->sctp_listen_hash_next != NULL) { in sctp_listen_hash_remove()
741 sctp_t *next = sctp->sctp_listen_hash_next; in sctp_listen_hash_remove()
743 ASSERT(next->sctp_listen_hash_prev == sctp); in sctp_listen_hash_remove()
745 sctp->sctp_listen_hash_prev; in sctp_listen_hash_remove()
748 sctp->sctp_listen_hash_next = NULL; in sctp_listen_hash_remove()
749 sctp->sctp_listen_hash_prev = NULL; in sctp_listen_hash_remove()
750 sctp->sctp_listen_tfp = NULL; in sctp_listen_hash_remove()
755 sctp_listen_hash_insert(sctp_tf_t *tf, sctp_t *sctp) in sctp_listen_hash_insert() argument
757 conn_t *connp = sctp->sctp_connp; in sctp_listen_hash_insert()
759 if (sctp->sctp_listen_tfp) { in sctp_listen_hash_insert()
760 sctp_listen_hash_remove(sctp); in sctp_listen_hash_insert()
764 sctp->sctp_listen_hash_next = tf->tf_sctp; in sctp_listen_hash_insert()
766 tf->tf_sctp->sctp_listen_hash_prev = sctp; in sctp_listen_hash_insert()
768 sctp->sctp_listen_hash_prev = NULL; in sctp_listen_hash_insert()
769 tf->tf_sctp = sctp; in sctp_listen_hash_insert()
770 sctp->sctp_listen_tfp = tf; in sctp_listen_hash_insert()
780 ssize = sizeof (in6_addr_t) * sctp->sctp_nsaddrs; in sctp_listen_hash_insert()
782 sctp_get_saddr_list(sctp, slist, ssize); in sctp_listen_hash_insert()
784 sctp->sctp_nsaddrs, connp->conn_lport); in sctp_listen_hash_insert()
795 sctp_bind_hash_insert(sctp_tf_t *tbf, sctp_t *sctp, int caller_holds_lock) in sctp_bind_hash_insert() argument
800 if (sctp->sctp_ptpbhn != NULL) { in sctp_bind_hash_insert()
802 sctp_bind_hash_remove(sctp); in sctp_bind_hash_insert()
812 sctpnext->sctp_ptpbhn = &sctp->sctp_bind_hash; in sctp_bind_hash_insert()
814 sctp->sctp_bind_hash = sctpnext; in sctp_bind_hash_insert()
815 sctp->sctp_ptpbhn = sctpp; in sctp_bind_hash_insert()
816 sctpp[0] = sctp; in sctp_bind_hash_insert()
818 sctp->sctp_bind_lockp = &tbf->tf_lock; in sctp_bind_hash_insert()
827 sctp_bind_hash_remove(sctp_t *sctp) in sctp_bind_hash_remove() argument
832 lockp = sctp->sctp_bind_lockp; in sctp_bind_hash_remove()
834 if (sctp->sctp_ptpbhn == NULL) in sctp_bind_hash_remove()
839 if (sctp->sctp_ptpbhn) { in sctp_bind_hash_remove()
840 sctpnext = sctp->sctp_bind_hash; in sctp_bind_hash_remove()
842 sctpnext->sctp_ptpbhn = sctp->sctp_ptpbhn; in sctp_bind_hash_remove()
843 sctp->sctp_bind_hash = NULL; in sctp_bind_hash_remove()
845 *sctp->sctp_ptpbhn = sctpnext; in sctp_bind_hash_remove()
846 sctp->sctp_ptpbhn = NULL; in sctp_bind_hash_remove()
849 sctp->sctp_bind_lockp = NULL; in sctp_bind_hash_remove()
867 sctp_t *sctp; in sctp_lookup() local
872 for (sctp = tf->tf_sctp; sctp != NULL; in sctp_lookup()
873 sctp = sctp->sctp_conn_hash_next) { in sctp_lookup()
874 if (*ports != sctp->sctp_connp->conn_ports || in sctp_lookup()
875 sctp->sctp_state < min_state) { in sctp_lookup()
880 for (fp = sctp->sctp_faddrs; fp != NULL; fp = fp->sf_next) { in sctp_lookup()
897 if (sctp_compare_saddrs(sctp1, sctp) <= SCTP_ADDR_OVERLAP) { in sctp_lookup()
905 if (sctp != NULL) { in sctp_lookup()
906 SCTP_REFHOLD(sctp); in sctp_lookup()
908 return (sctp); in sctp_lookup()