Lines Matching defs:inp
236 sctp_notify_mbuf(struct sctp_inpcb *inp,
248 if ((inp == NULL) || (stcb == NULL) || (net == NULL) ||
284 sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, NULL);
337 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, NULL);
343 sctp_notify(struct sctp_inpcb *inp,
351 if ((inp == NULL) || (stcb == NULL) || (net == NULL) ||
400 sctp_free_assoc(inp, stcb);
405 if (inp->sctp_socket) {
406 inp->sctp_socket->so_error = errno;
407 sctp_sowwakeup(inp, inp->sctp_socket);
433 struct sctp_inpcb *inp;
456 &inp, &net, 1);
457 if (stcb != NULL && inp && (inp->sctp_socket != NULL)) {
465 sctp_notify(inp, cm, sh,
470 sctp_notify_mbuf(inp, stcb, net, ip, sh);
475 if (PRC_IS_REDIRECT(cmd) && inp) {
476 inpcb_rtchange((struct inpcb *)inp,
480 if ((stcb == NULL) && (inp != NULL)) {
482 SCTP_INP_WLOCK(inp);
483 SCTP_INP_DECR_REF(inp);
484 SCTP_INP_WUNLOCK(inp);
496 struct sctp_inpcb *inp;
498 inp = (struct sctp_inpcb *)so->so_pcb;
499 if (inp == 0)
502 sctp_inpcb_free(inp, 1);
509 struct sctp_inpcb *inp;
516 inp = (struct sctp_inpcb *)so->so_pcb;
517 if (inp != 0) {
528 inp = (struct sctp_inpcb *)so->so_pcb;
529 SCTP_INP_WLOCK(inp);
531 inp->sctp_flags &= ~SCTP_PCB_FLAGS_BOUND_V6; /* I'm not v6! */
533 ip_inp = &inp->ip_inp.inp;
536 inp->inp_vflag |= INP_IPV4;
537 inp->inp_ip_ttl = ip_defttl;
542 sctp_inpcb_free(inp, 1);
546 SCTP_INP_WUNLOCK(inp);
554 struct sctp_inpcb *inp;
565 inp = (struct sctp_inpcb *)so->so_pcb;
566 if (inp == 0)
577 struct sctp_inpcb *inp;
579 inp = (struct sctp_inpcb *)so->so_pcb;
580 if (inp == 0)
585 sctp_inpcb_free(inp, 1);
587 sctp_inpcb_free(inp, 0);
604 struct sctp_inpcb *inp;
606 inp = (struct sctp_inpcb *)so->so_pcb;
607 if (inp == 0) {
615 ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) ||
616 (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE))
644 if (inp->control) {
646 sctp_m_freem(inp->control);
647 inp->control = NULL;
649 inp->control = control;
652 if ((inp->pkt) && (inp->pkt->m_flags & M_PKTHDR)) {
661 inp->pkt->m_pkthdr.len += c_len;
664 if (inp->pkt) {
665 inp->pkt_last->m_next = m;
666 inp->pkt_last = m;
668 inp->pkt_last = inp->pkt = m;
679 ret = sctp_output(inp, inp->pkt, addr, inp->control, l, 0);
680 inp->pkt = NULL;
681 inp->control = NULL;
691 struct sctp_inpcb *inp;
694 inp = (struct sctp_inpcb *)so->so_pcb;
695 if (inp == NULL) {
699 SCTP_INP_RLOCK(inp);
700 if (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) {
701 if (LIST_EMPTY(&inp->sctp_asoc_list)) {
703 SCTP_INP_RUNLOCK(inp);
711 stcb = LIST_FIRST(&inp->sctp_asoc_list);
713 SCTP_INP_RUNLOCK(inp);
738 SCTP_INP_RUNLOCK(inp);
739 sctp_free_assoc(inp, stcb);
792 SCTP_INP_RUNLOCK(inp);
799 SCTP_INP_RUNLOCK(inp);
808 struct sctp_inpcb *inp;
810 inp = (struct sctp_inpcb *)so->so_pcb;
811 if (inp == 0) {
814 SCTP_INP_RLOCK(inp);
816 if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) {
820 SCTP_INP_RUNLOCK(inp);
833 stcb = LIST_FIRST(&inp->sctp_asoc_list);
888 SCTP_INP_RUNLOCK(inp);
908 sctp_fill_up_addresses(struct sctp_inpcb *inp,
933 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
939 (((struct in6pcb *)inp)->in6p_flags & IN6P_IPV6_V6ONLY)
941 (((struct in6pcb *)inp)->inp_flags & IN6P_IPV6_V6ONLY)
950 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
985 if (inp->sctp_flags & SCTP_PCB_FLAGS_NEEDS_MAPPED_V4) {
987 ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport;
992 ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport;
1016 ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport;
1036 if (inp->sctp_flags & SCTP_PCB_FLAGS_DO_ASCONF) {
1038 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
1047 ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport;
1064 ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport;
1074 LIST_FOREACH(laddr, &inp->sctp_addr_list,
1079 ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport;
1094 sctp_count_max_addresses(struct sctp_inpcb *inp)
1104 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
1114 if (inp->sctp_flags & SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)
1126 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
1128 if (inp->sctp_flags & SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)
1145 struct sctp_inpcb *inp;
1158 inp = (struct sctp_inpcb *)so->so_pcb;
1159 if (inp == 0)
1162 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
1163 (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) {
1167 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
1168 SCTP_INP_RLOCK(inp);
1169 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1170 SCTP_INP_RUNLOCK(inp);
1176 SCTP_ASOC_CREATE_LOCK(inp);
1177 if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) ||
1178 (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) {
1179 SCTP_ASOC_CREATE_UNLOCK(inp);
1195 SCTP_INP_WLOCK(inp);
1196 SCTP_INP_INCR_REF(inp);
1197 SCTP_INP_WUNLOCK(inp);
1207 SCTP_ASOC_CREATE_UNLOCK(inp);
1216 stcb = sctp_findassociation_ep_addr(&inp, sa, NULL, NULL, NULL);
1219 SCTP_ASOC_CREATE_UNLOCK(inp);
1230 SCTP_INP_WLOCK(inp);
1231 SCTP_INP_DECR_REF(inp);
1232 SCTP_INP_WUNLOCK(inp);
1234 if (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) &&
1236 SCTP_INP_WUNLOCK(inp);
1237 SCTP_ASOC_CREATE_UNLOCK(inp);
1240 if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
1243 inp6 = (struct in6pcb *)inp;
1249 SCTP_INP_WUNLOCK(inp);
1250 SCTP_ASOC_CREATE_UNLOCK(inp);
1255 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) ==
1258 SCTP_INP_WUNLOCK(inp);
1261 SCTP_ASOC_CREATE_UNLOCK(inp);
1265 SCTP_INP_WUNLOCK(inp);
1268 stcb = sctp_aloc_assoc(inp, sa, 1, &error, 0);
1271 SCTP_ASOC_CREATE_UNLOCK(inp);
1286 sctp_free_assoc(inp, stcb);
1287 SCTP_ASOC_CREATE_UNLOCK(inp);
1295 sctp_free_assoc(inp, stcb);
1296 SCTP_ASOC_CREATE_UNLOCK(inp);
1310 sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, stcb->asoc.primary_destination);
1313 sctp_send_initiate(inp, stcb);
1321 SCTP_ASOC_CREATE_UNLOCK(inp);
1329 struct sctp_inpcb *inp;
1334 inp = (struct sctp_inpcb *)so->so_pcb;
1335 if (inp == 0)
1357 SCTP_INP_RLOCK(inp);
1360 optval = inp->sctp_flags & SCTP_PCB_FLAGS_NO_FRAGMENT;
1363 optval = inp->sctp_flags & SCTP_PCB_FLAGS_NEEDS_MAPPED_V4;
1366 optval = inp->sctp_flags & SCTP_PCB_FLAGS_AUTO_ASCONF;
1369 optval = inp->sctp_flags & SCTP_PCB_FLAGS_NODELAY;
1372 if ((inp->sctp_flags & SCTP_PCB_FLAGS_AUTOCLOSE) ==
1374 optval = inp->sctp_ep.auto_close_time;
1389 SCTP_INP_RUNLOCK(inp);
1409 SCTP_INP_RLOCK(inp);
1410 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1415 SCTP_INP_RUNLOCK(inp);
1419 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1441 SCTP_INP_RUNLOCK(inp);
1452 stcb = sctp_findassociation_ep_asocid(inp, gnv->gn_assoc_id);
1480 *tm = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV]);
1491 stcb = sctp_findassociation_ep_asocid(inp, ss->ss_assoc_id);
1511 SCTP_INP_RLOCK(inp);
1512 *burst = inp->sctp_ep.max_burst;
1513 SCTP_INP_RUNLOCK(inp);
1535 if (((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
1536 (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) ||
1537 (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
1538 SCTP_INP_RLOCK(inp);
1539 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1542 SCTP_INP_RUNLOCK(inp);
1546 SCTP_INP_RUNLOCK(inp);
1550 stcb = sctp_findassociation_ep_asocid(inp, *assoc_id);
1560 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
1565 *segsize = inp->sctp_frag_point - ovh;
1629 SCTP_INP_RLOCK(inp);
1630 if (inp->sctp_flags & SCTP_PCB_FLAGS_RECVDATAIOEVNT)
1633 if (inp->sctp_flags & SCTP_PCB_FLAGS_RECVASSOCEVNT)
1636 if (inp->sctp_flags & SCTP_PCB_FLAGS_RECVPADDREVNT)
1639 if (inp->sctp_flags & SCTP_PCB_FLAGS_RECVSENDFAILEVNT)
1642 if (inp->sctp_flags & SCTP_PCB_FLAGS_RECVPEERERR)
1645 if (inp->sctp_flags & SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT)
1648 if (inp->sctp_flags & SCTP_PCB_FLAGS_PDAPIEVNT)
1651 if (inp->sctp_flags & SCTP_PCB_FLAGS_ADAPTIONEVNT)
1654 if (inp->sctp_flags & SCTP_PCB_FLAGS_STREAM_RESETEVNT)
1656 SCTP_INP_RUNLOCK(inp);
1672 SCTP_INP_RLOCK(inp);
1674 *ovp = inp->sctp_ep.adaption_layer_indicator;
1675 SCTP_INP_RUNLOCK(inp);
1688 SCTP_INP_RLOCK(inp);
1690 *ovp = inp->sctp_ep.initial_sequence_debug;
1691 SCTP_INP_RUNLOCK(inp);
1704 SCTP_INP_RLOCK(inp);
1706 *ovp = sctp_count_max_addresses(inp);
1707 SCTP_INP_RUNLOCK(inp);
1730 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
1731 SCTP_INP_RLOCK(inp);
1732 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1736 SCTP_INP_RUNLOCK(inp);
1740 stcb = sctp_findassociation_ep_asocid(inp, *assoc_id);
1787 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
1788 SCTP_INP_RLOCK(inp);
1789 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1793 SCTP_INP_RUNLOCK(inp);
1795 stcb = sctp_findassociation_ep_asocid(inp,
1871 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
1872 SCTP_INP_RLOCK(inp);
1873 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1877 SCTP_INP_RUNLOCK(inp);
1879 stcb = sctp_findassociation_ep_asocid(inp, saddr->sget_assoc_id);
1888 if ( (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) &&
1890 SCTP_INP_RLOCK(inp);
1891 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1895 SCTP_INP_RUNLOCK(inp);
1899 actual = sctp_fill_up_addresses(inp, stcb, limit, sas);
1933 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
1934 SCTP_INP_RLOCK(inp);
1935 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1940 SCTP_INP_RLOCK(inp);
1942 stcb = sctp_findassociation_ep_asocid(inp, paddrp->spp_assoc_id);
1958 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
1959 SCTP_INP_RLOCK(inp);
1960 stcb = LIST_FIRST(&inp->sctp_asoc_list);
1965 SCTP_INP_RUNLOCK(inp);
1967 SCTP_INP_WLOCK(inp);
1968 SCTP_INP_INCR_REF(inp);
1969 SCTP_INP_WUNLOCK(inp);
1970 stcb = sctp_findassociation_ep_addr(&inp,
1974 SCTP_INP_WLOCK(inp);
1975 SCTP_INP_DECR_REF(inp);
1976 SCTP_INP_WUNLOCK(inp);
2011 SCTP_INP_RLOCK(inp);
2017 paddrp->spp_pathmaxrxt = inp->sctp_ep.def_net_failure;
2018 paddrp->spp_hbinterval = inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT];
2020 SCTP_INP_RUNLOCK(inp);
2043 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2044 SCTP_INP_RLOCK(inp);
2045 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2051 SCTP_INP_RUNLOCK(inp);
2053 SCTP_INP_WLOCK(inp);
2054 SCTP_INP_INCR_REF(inp);
2055 SCTP_INP_WUNLOCK(inp);
2056 stcb = sctp_findassociation_ep_addr(&inp,
2060 SCTP_INP_WLOCK(inp);
2061 SCTP_INP_DECR_REF(inp);
2062 SCTP_INP_WUNLOCK(inp);
2115 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2116 SCTP_INP_RLOCK(inp);
2117 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2121 SCTP_INP_RUNLOCK(inp);
2123 stcb = sctp_findassociation_ep_asocid(inp, sstat->sstat_assoc_id);
2184 SCTP_INP_RLOCK(inp);
2185 srto->srto_initial = inp->sctp_ep.initial_rto;
2186 srto->srto_max = inp->sctp_ep.sctp_maxrto;
2187 srto->srto_min = inp->sctp_ep.sctp_minrto;
2188 SCTP_INP_RUNLOCK(inp);
2191 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2192 SCTP_INP_RLOCK(inp);
2193 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2197 SCTP_INP_RUNLOCK(inp);
2199 stcb = sctp_findassociation_ep_asocid(inp, srto->srto_assoc_id);
2227 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2228 SCTP_INP_RLOCK(inp);
2229 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2233 SCTP_INP_RUNLOCK(inp);
2236 stcb = sctp_findassociation_ep_asocid(inp,
2254 SCTP_INP_RLOCK(inp);
2255 sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times;
2258 sasoc->sasoc_local_rwnd = sbspace(&inp->sctp_socket->so_rcv);
2259 sasoc->sasoc_cookie_life = inp->sctp_ep.def_cookie_life;
2260 SCTP_INP_RUNLOCK(inp);
2274 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2275 SCTP_INP_RLOCK(inp);
2276 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2280 SCTP_INP_RUNLOCK(inp);
2282 stcb = sctp_findassociation_ep_asocid(inp, s_info->sinfo_assoc_id);
2307 SCTP_INP_RLOCK(inp);
2308 sinit->sinit_num_ostreams = inp->sctp_ep.pre_open_stream_count;
2309 sinit->sinit_max_instreams = inp->sctp_ep.max_open_streams_intome;
2310 sinit->sinit_max_attempts = inp->sctp_ep.max_init_times;
2311 sinit->sinit_max_init_timeo = inp->sctp_ep.initial_init_rto_max;
2312 SCTP_INP_RUNLOCK(inp);
2331 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2332 SCTP_INP_RLOCK(inp);
2333 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2337 SCTP_INP_RUNLOCK(inp);
2339 stcb = sctp_findassociation_ep_asocid(inp, ssp->ssp_assoc_id);
2344 SCTP_INP_WLOCK(inp);
2345 SCTP_INP_INCR_REF(inp);
2346 SCTP_INP_WUNLOCK(inp);
2347 stcb = sctp_findassociation_ep_addr(&inp,
2351 SCTP_INP_WLOCK(inp);
2352 SCTP_INP_DECR_REF(inp);
2353 SCTP_INP_WUNLOCK(inp);
2382 struct sctp_inpcb *inp;
2392 inp = (struct sctp_inpcb *)so->so_pcb;
2393 if (inp == 0)
2421 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
2437 inp->sctp_ep.auto_close_time = (*mopt * hz);
2440 SCTP_INP_WLOCK(inp);
2442 inp->sctp_flags |= set_opt;
2444 inp->sctp_flags &= ~set_opt;
2446 SCTP_INP_WUNLOCK(inp);
2477 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV] = MSEC_TO_TICKS(*tm);
2491 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2492 SCTP_INP_RLOCK(inp);
2493 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2497 SCTP_INP_RUNLOCK(inp);
2499 stcb = sctp_findassociation_ep_asocid(inp, strrst->strrst_assoc_id);
2558 sctp_chunk_output(inp, stcb, 12);
2577 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2578 SCTP_INP_RLOCK(inp);
2579 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2584 SCTP_INP_RUNLOCK(inp);
2586 SCTP_INP_WLOCK(inp);
2587 SCTP_INP_INCR_REF(inp);
2588 SCTP_INP_WUNLOCK(inp);
2589 stcb = sctp_findassociation_ep_addr(&inp, sa, &net, NULL, NULL);
2591 SCTP_INP_WLOCK(inp);
2592 SCTP_INP_DECR_REF(inp);
2593 SCTP_INP_WUNLOCK(inp);
2604 sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb, stcb->asoc.primary_destination);
2605 sctp_send_initiate(inp, stcb);
2616 SCTP_INP_WLOCK(inp);
2619 inp->sctp_ep.max_burst = *burst;
2621 SCTP_INP_WUNLOCK(inp);
2628 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
2638 SCTP_INP_WLOCK(inp);
2639 inp->sctp_frag_point = (*segsize+ovh);
2640 if (inp->sctp_frag_point < MHLEN) {
2641 inp->sctp_frag_point = MHLEN;
2643 SCTP_INP_WUNLOCK(inp);
2673 SCTP_INP_WLOCK(inp);
2676 inp->sctp_flags |= SCTP_PCB_FLAGS_RECVDATAIOEVNT;
2678 inp->sctp_flags &= ~SCTP_PCB_FLAGS_RECVDATAIOEVNT;
2682 inp->sctp_flags |= SCTP_PCB_FLAGS_RECVASSOCEVNT;
2684 inp->sctp_flags &= ~SCTP_PCB_FLAGS_RECVASSOCEVNT;
2688 inp->sctp_flags |= SCTP_PCB_FLAGS_RECVPADDREVNT;
2690 inp->sctp_flags &= ~SCTP_PCB_FLAGS_RECVPADDREVNT;
2694 inp->sctp_flags |= SCTP_PCB_FLAGS_RECVSENDFAILEVNT;
2696 inp->sctp_flags &= ~SCTP_PCB_FLAGS_RECVSENDFAILEVNT;
2700 inp->sctp_flags |= SCTP_PCB_FLAGS_RECVPEERERR;
2702 inp->sctp_flags &= ~SCTP_PCB_FLAGS_RECVPEERERR;
2706 inp->sctp_flags |= SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT;
2708 inp->sctp_flags &= ~SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT;
2712 inp->sctp_flags |= SCTP_PCB_FLAGS_PDAPIEVNT;
2714 inp->sctp_flags &= ~SCTP_PCB_FLAGS_PDAPIEVNT;
2718 inp->sctp_flags |= SCTP_PCB_FLAGS_ADAPTIONEVNT;
2720 inp->sctp_flags &= ~SCTP_PCB_FLAGS_ADAPTIONEVNT;
2724 inp->sctp_flags |= SCTP_PCB_FLAGS_STREAM_RESETEVNT;
2726 inp->sctp_flags &= ~SCTP_PCB_FLAGS_STREAM_RESETEVNT;
2728 SCTP_INP_WUNLOCK(inp);
2739 SCTP_INP_WLOCK(inp);
2741 inp->sctp_ep.adaption_layer_indicator = adap_bits->ssb_adaption_ind;
2742 SCTP_INP_WUNLOCK(inp);
2752 SCTP_INP_WLOCK(inp);
2754 inp->sctp_ep.initial_sequence_debug = *vvv;
2755 SCTP_INP_WUNLOCK(inp);
2768 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2769 SCTP_INP_RLOCK(inp);
2770 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2774 SCTP_INP_RUNLOCK(inp);
2776 stcb = sctp_findassociation_ep_asocid(inp, s_info->sinfo_assoc_id);
2808 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2809 SCTP_INP_RLOCK(inp);
2810 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2815 SCTP_INP_RUNLOCK(inp);
2817 stcb = sctp_findassociation_ep_asocid(inp, paddrp->spp_assoc_id);
2828 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2829 SCTP_INP_RLOCK(inp);
2830 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2836 SCTP_INP_RUNLOCK(inp);
2838 SCTP_INP_WLOCK(inp);
2839 SCTP_INP_INCR_REF(inp);
2840 SCTP_INP_WUNLOCK(inp);
2841 stcb = sctp_findassociation_ep_addr(&inp,
2845 SCTP_INP_WLOCK(inp);
2846 SCTP_INP_DECR_REF(inp);
2847 SCTP_INP_WUNLOCK(inp);
2875 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
2895 sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
2905 SCTP_INP_WLOCK(inp);
2907 inp->sctp_ep.def_net_failure = paddrp->spp_pathmaxrxt;
2909 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = paddrp->spp_hbinterval;
2910 SCTP_INP_WUNLOCK(inp);
2923 SCTP_INP_WLOCK(inp);
2926 inp->sctp_ep.initial_rto = srto->srto_initial;
2928 inp->sctp_ep.sctp_maxrto = srto->srto_max;
2930 inp->sctp_ep.sctp_minrto = srto->srto_min;
2931 SCTP_INP_WUNLOCK(inp);
2934 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2935 SCTP_INP_RLOCK(inp);
2936 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2940 SCTP_INP_RUNLOCK(inp);
2942 stcb = sctp_findassociation_ep_asocid(inp, srto->srto_assoc_id);
2967 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
2968 SCTP_INP_RLOCK(inp);
2969 stcb = LIST_FIRST(&inp->sctp_asoc_list);
2973 SCTP_INP_RUNLOCK(inp);
2975 stcb = sctp_findassociation_ep_asocid(inp,
2995 SCTP_INP_WLOCK(inp);
2997 inp->sctp_ep.max_send_times = sasoc->sasoc_asocmaxrxt;
3002 inp->sctp_ep.def_cookie_life = sasoc->sasoc_cookie_life;
3003 SCTP_INP_WUNLOCK(inp);
3016 SCTP_INP_WLOCK(inp);
3018 inp->sctp_ep.pre_open_stream_count = sinit->sinit_num_ostreams;
3021 inp->sctp_ep.max_open_streams_intome = sinit->sinit_max_instreams;
3024 inp->sctp_ep.max_init_times = sinit->sinit_max_attempts;
3028 inp->sctp_ep.initial_init_rto_max = sinit->sinit_max_init_timeo;
3029 SCTP_INP_WUNLOCK(inp);
3042 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
3043 SCTP_INP_RLOCK(inp);
3044 stcb = LIST_FIRST(&inp->sctp_asoc_list);
3051 SCTP_INP_RUNLOCK(inp);
3053 stcb = sctp_findassociation_ep_asocid(inp, spa->ssp_assoc_id);
3056 SCTP_INP_WLOCK(inp);
3057 SCTP_INP_INCR_REF(inp);
3058 SCTP_INP_WUNLOCK(inp);
3059 stcb = sctp_findassociation_ep_addr(&inp,
3063 SCTP_INP_WLOCK(inp);
3064 SCTP_INP_DECR_REF(inp);
3065 SCTP_INP_WUNLOCK(inp);
3105 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
3106 SCTP_INP_RLOCK(inp);
3107 stcb = LIST_FIRST(&inp->sctp_asoc_list);
3111 SCTP_INP_RUNLOCK(inp);
3113 stcb = sctp_findassociation_ep_asocid(inp, sspp->sspp_assoc_id);
3130 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
3148 if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) {
3159 ((struct sockaddr_in *)addr_touse)->sin_port = inp->sctp_lport;
3167 SCTP_INP_WLOCK(inp);
3168 SCTP_INP_DECR_REF(inp);
3169 SCTP_INP_WUNLOCK(inp);
3171 if (lep == inp) {
3176 error = sctp_addr_mgmt_ep_sa(inp, addr_touse,
3195 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
3219 sctp_addr_mgmt_ep_sa(inp, addr_touse,
3237 struct inpcb *inp;
3248 inp = sotoinpcb(so);
3255 inp = NULL;
3264 if (inp == NULL)
3266 if (inp == NULL && in6p == NULL)
3302 struct sctp_inpcb *inp;
3313 inp = (struct sctp_inpcb *)so->so_pcb;
3314 if (inp == 0) {
3318 SCTP_ASOC_CREATE_LOCK(inp);
3324 SCTP_INP_WLOCK(inp);
3330 if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) ||
3331 (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) {
3333 SCTP_INP_WUNLOCK(inp);
3334 SCTP_ASOC_CREATE_UNLOCK(inp);
3338 if (((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) &&
3340 SCTP_INP_WUNLOCK(inp);
3341 SCTP_ASOC_CREATE_UNLOCK(inp);
3350 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) ==
3353 SCTP_INP_WUNLOCK(inp);
3356 SCTP_ASOC_CREATE_UNLOCK(inp);
3359 SCTP_INP_WLOCK(inp);
3367 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
3368 (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) {
3370 SCTP_INP_WUNLOCK(inp);
3371 SCTP_ASOC_CREATE_UNLOCK(inp);
3374 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
3375 stcb = LIST_FIRST(&inp->sctp_asoc_list);
3379 SCTP_INP_WUNLOCK(inp);
3381 SCTP_INP_INCR_REF(inp);
3382 SCTP_INP_WUNLOCK(inp);
3383 stcb = sctp_findassociation_ep_addr(&inp, nam, NULL, NULL, NULL);
3385 SCTP_INP_WLOCK(inp);
3386 SCTP_INP_DECR_REF(inp);
3387 SCTP_INP_WUNLOCK(inp);
3392 SCTP_ASOC_CREATE_UNLOCK(inp);
3397 stcb = sctp_aloc_assoc(inp, nam, 1, &error, 0);
3409 sctp_send_initiate(inp, stcb);
3410 SCTP_ASOC_CREATE_UNLOCK(inp);
3431 struct sctp_inpcb *inp;
3434 inp = (struct sctp_inpcb *)so->so_pcb;
3437 printf("Read for so:%p inp:%p Flags:%x\n",
3438 so, inp, flags);
3441 if (inp == 0) {
3453 SCTP_INP_WLOCK(inp);
3454 if ((flags & MSG_EOR) && ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) == 0)
3455 && ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0)) {
3462 inp->sctp_vtag_first = sctp_get_first_vtag_from_sb(so);
3463 sq = TAILQ_FIRST(&inp->sctp_queue_list);
3470 stcb = LIST_FIRST(&inp->sctp_asoc_list);
3479 * we must release the inp write lock.
3482 if (((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) == 0)
3483 && ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0)) {
3484 stcb = sctp_remove_from_socket_q(inp);
3488 printf("remove from socket queue for inp:%p tcbret:%p\n",
3489 inp, stcb);
3494 if (inp->sctp_flags & SCTP_PCB_FLAGS_RECVDATAIOEVNT) {
3522 sctp_chunk_output(inp, stcb, 10);
3525 if ((( sq ) && (flags & MSG_EOR) && ((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) == 0))
3526 && ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0)) {
3527 stcb = sctp_remove_from_socket_q(inp);
3531 (TAILQ_EMPTY(&inp->sctp_queue_list) == 0)) {
3535 printf("Something off, inp:%p so->so_rcv->sb_mb is empty and sockq is not.. cleaning\n",
3536 inp);
3538 if (((inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) == 0)
3539 && ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0)) {
3541 done_yet = TAILQ_EMPTY(&inp->sctp_queue_list);
3544 (void)sctp_remove_from_socket_q(inp);
3545 done_yet = TAILQ_EMPTY(&inp->sctp_queue_list);
3556 SCTP_INP_WUNLOCK(inp);
3572 struct sctp_inpcb *inp;
3574 inp = (struct sctp_inpcb *)so->so_pcb;
3575 if (inp == 0) {
3579 SCTP_INP_RLOCK(inp);
3580 if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) &&
3581 (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED)) {
3583 SCTP_INP_RUNLOCK(inp);
3586 if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) {
3588 SCTP_INP_RUNLOCK(inp);
3594 SCTP_INP_RUNLOCK(inp);
3596 SCTP_INP_WLOCK(inp);
3597 if (inp->sctp_socket->so_qlimit) {
3598 if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) {
3605 inp->sctp_socket->so_options &= ~SO_ACCEPTCONN;
3607 inp->sctp_flags |= SCTP_PCB_FLAGS_ACCEPTING;
3609 if (inp->sctp_flags & SCTP_PCB_FLAGS_ACCEPTING) {
3614 inp->sctp_flags &= ~SCTP_PCB_FLAGS_ACCEPTING;
3616 inp->sctp_socket->so_options &= ~SO_ACCEPTCONN;
3618 SCTP_INP_WUNLOCK(inp);
3627 struct sctp_inpcb *inp;
3633 inp = (struct sctp_inpcb *)so->so_pcb;
3635 if (inp == 0) {
3638 SCTP_INP_RLOCK(inp);
3640 SCTP_INP_RUNLOCK(inp);
3643 stcb = LIST_FIRST(&inp->sctp_asoc_list);
3645 SCTP_INP_RUNLOCK(inp);
3649 SCTP_INP_RUNLOCK(inp);
3677 SCTP_INP_WLOCK(inp);
3678 if (inp->sctp_flags & SCTP_PCB_FLAGS_DONT_WAKE) {
3679 inp->sctp_flags &= ~SCTP_PCB_FLAGS_DONT_WAKE;
3680 if (inp->sctp_flags & SCTP_PCB_FLAGS_WAKEOUTPUT) {
3681 inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEOUTPUT;
3682 if (sowritable(inp->sctp_socket))
3683 sowwakeup(inp->sctp_socket);
3685 if (inp->sctp_flags & SCTP_PCB_FLAGS_WAKEINPUT) {
3686 inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEINPUT;
3687 if (soreadable(inp->sctp_socket))
3688 sorwakeup(inp->sctp_socket);
3692 SCTP_INP_WUNLOCK(inp);
3706 struct sctp_inpcb *inp;
3711 inp = (struct sctp_inpcb *)so->so_pcb;
3712 if (!inp) {
3715 SCTP_INP_RLOCK(inp);
3716 sin->sin_port = inp->sctp_lport;
3717 if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
3718 if (inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) {
3724 stcb = LIST_FIRST(&inp->sctp_asoc_list);
3743 sin->sin_addr = sctp_ipv4_source_address_selection(inp,
3756 LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
3766 SCTP_INP_RUNLOCK(inp);
3770 SCTP_INP_RUNLOCK(inp);
3780 struct sctp_inpcb *inp;
3785 inp = (struct sctp_inpcb *)so->so_pcb;
3786 if ((inp == NULL) ||
3787 ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0)) {
3797 inp = (struct sctp_inpcb *)so->so_pcb;
3798 if (!inp) {
3801 SCTP_INP_RLOCK(inp);
3802 stcb = LIST_FIRST(&inp->sctp_asoc_list);
3806 SCTP_INP_RUNLOCK(inp);