Lines Matching defs:stcb
197 struct sctp_tcb *stcb, int response_required)
229 sin->sin_port = stcb->rport;
248 sin6->sin6_port = stcb->rport;
279 if (sctp_add_remote_addr(stcb, sa, 0, 6) != 0) {
290 sctp_ulp_notify(SCTP_NOTIFY_ASCONF_ADD_IP, stcb, 0, sa);
302 struct sctp_tcb *stcb, int response_required)
333 sin->sin_port = stcb->rport;
345 sin6->sin6_port = stcb->rport;
364 sin->sin_port = stcb->rport;
383 sin6->sin6_port = stcb->rport;
430 result = sctp_del_remote_addr(stcb, sa);
448 sctp_ulp_notify(SCTP_NOTIFY_ASCONF_DELETE_IP, stcb, 0, sa);
459 struct sctp_tcb *stcb, int response_required)
537 if (sctp_set_primary_addr(stcb, sa, NULL) == 0) {
544 sctp_ulp_notify(SCTP_NOTIFY_ASCONF_SET_PRIMARY, stcb, 0, sa);
571 struct sctp_tcb *stcb, struct sctp_nets *net)
595 asoc = &stcb->asoc;
607 sctp_send_asconf_ack(stcb, 1);
725 m_result = sctp_process_asconf_add_ip(aph, stcb, error);
729 m_result = sctp_process_asconf_delete_ip(m, aph, stcb,
737 m_result = sctp_process_asconf_set_primary(aph, stcb,
802 sctp_send_asconf_ack(stcb, 0);
840 sctp_asconf_cleanup(struct sctp_tcb *stcb, struct sctp_nets *net)
848 stcb->asoc.peer_supports_asconf = 0;
849 stcb->asoc.peer_supports_asconf_setprim = 0;
853 sctp_timer_stop(SCTP_TIMER_TYPE_ASCONF, stcb->sctp_ep, stcb, net);
854 stcb->asoc.asconf_seq_out++;
856 sctp_toss_old_asconf(stcb);
866 sctp_asconf_addr_mgmt_ack(struct sctp_tcb *stcb, struct ifaddr *addr,
883 sctp_del_local_addr_assoc(stcb, addr);
898 sctp_asconf_queue_add(struct sctp_tcb *stcb, struct ifaddr *ifa, uint16_t type)
906 if (stcb->asoc.peer_supports_asconf == 0) {
916 for (aa=TAILQ_FIRST(&stcb->asoc.asconf_queue); aa!=NULL; aa=aa_next) {
939 TAILQ_REMOVE(&stcb->asoc.asconf_queue, aa, next);
941 sctp_asconf_addr_mgmt_ack(stcb, aa->ifa, type, 1);
1014 TAILQ_INSERT_HEAD(&stcb->asoc.asconf_queue, aa, next);
1022 TAILQ_INSERT_TAIL(&stcb->asoc.asconf_queue, aa, next);
1047 sctp_asconf_queue_add_sa(struct sctp_tcb *stcb, struct sockaddr *sa,
1053 if (stcb->asoc.peer_supports_asconf == 0) {
1063 for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL;
1087 TAILQ_REMOVE(&stcb->asoc.asconf_queue, aa, next);
1101 TAILQ_REMOVE(&stcb->asoc.asconf_queue, aa, next);
1103 sctp_asconf_addr_mgmt_ack(stcb, aa->ifa, type, 1);
1161 TAILQ_INSERT_HEAD(&stcb->asoc.asconf_queue, aa, next);
1169 TAILQ_INSERT_TAIL(&stcb->asoc.asconf_queue, aa, next);
1188 sctp_asconf_find_param(struct sctp_tcb *stcb, uint32_t correlation_id)
1192 TAILQ_FOREACH(aa, &stcb->asoc.asconf_queue, next) {
1208 sctp_asconf_process_error(struct sctp_tcb *stcb,
1253 stcb->asoc.peer_supports_asconf = 0;
1256 stcb->asoc.peer_supports_asconf_setprim = 0;
1270 sctp_asconf_process_param_ack(struct sctp_tcb *stcb,
1289 sctp_asconf_addr_mgmt_ack(stcb, aparam->ifa, param_type, flag);
1302 stcb->asoc.peer_supports_asconf_setprim = 0;
1310 TAILQ_REMOVE(&stcb->asoc.asconf_queue, aparam, next);
1318 sctp_asconf_ack_clear(struct sctp_tcb *stcb)
1321 stcb->asoc.peer_supports_asconf = 0;
1322 stcb->asoc.peer_supports_asconf_setprim = 0;
1328 struct sctp_asconf_ack_chunk *cp, struct sctp_tcb *stcb,
1353 asoc = &stcb->asoc;
1369 sctp_abort_an_association(stcb->sctp_ep, stcb,
1389 sctp_timer_stop(SCTP_TIMER_TYPE_ASCONF, stcb->sctp_ep, stcb, net);
1404 sctp_asconf_ack_clear(stcb);
1410 sctp_asconf_ack_clear(stcb);
1414 sctp_asconf_ack_clear(stcb);
1425 sctp_asconf_ack_clear(stcb);
1430 sctp_asconf_ack_clear(stcb);
1440 ap = sctp_asconf_find_param(stcb, id);
1446 sctp_asconf_process_param_ack(stcb, ap, 0);
1448 sctp_asconf_process_error(stcb, aph);
1452 ap = sctp_asconf_find_param(stcb, id);
1458 sctp_asconf_process_param_ack(stcb, ap, 1);
1484 for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL;
1494 sctp_asconf_process_param_ack(stcb, aa,
1497 sctp_asconf_process_param_ack(stcb, aa,
1513 sctp_toss_old_asconf(stcb);
1516 if (!TAILQ_EMPTY(&stcb->asoc.asconf_queue)) {
1518 sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, stcb->sctp_ep,
1519 stcb, net);
1560 sctp_is_scopeid_in_nets(struct sctp_tcb *stcb, struct sockaddr *sa)
1577 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
1597 sctp_addr_mgmt_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
1656 if (sctp_is_scopeid_in_nets(stcb, ifa->ifa_addr) == 0) {
1657 sctp_add_local_addr_assoc(stcb, ifa);
1691 if (stcb->asoc.local_scope == 0) {
1700 if (sctp_is_scopeid_in_nets(stcb, ifa->ifa_addr) == 0) {
1709 if (stcb->asoc.site_scope == 0 &&
1742 if (stcb->asoc.ipv4_local_scope == 0 &&
1764 if (stcb->asoc.peer_supports_asconf) {
1766 status = sctp_asconf_queue_add(stcb, ifa, type);
1775 SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) {
1777 stcb, stcb->asoc.primary_destination);
1785 sctp_add_local_addr_assoc(stcb, ifa);
1794 struct sctp_tcb *stcb;
1865 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
1866 SCTP_TCB_LOCK(stcb);
1867 sctp_addr_mgmt_assoc(inp, stcb, ifa, type);
1868 SCTP_TCB_UNLOCK(stcb);
1869 } /* for each stcb */
1880 struct sctp_tcb *stcb;
1895 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
1897 SCTP_TCB_LOCK(stcb);
1898 sctp_add_local_addr_assoc(stcb, ifa);
1899 SCTP_TCB_UNLOCK(stcb);
1905 } /* for each stcb */
1996 struct sctp_tcb *stcb;
2001 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
2005 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
2009 laddr = LIST_FIRST(&stcb->asoc.sctp_local_addr_list);
2018 } /* for each stcb */
2039 sctp_set_primary_ip_address_sa(struct sctp_tcb *stcb, struct sockaddr *sa)
2044 if (!sctp_asconf_queue_add_sa(stcb, sa, SCTP_SET_PRIM_ADDR)) {
2046 if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) {
2048 stcb->sctp_ep, stcb,
2049 stcb->asoc.primary_destination);
2054 stcb);
2062 stcb);
2088 struct sctp_tcb *stcb;
2091 LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
2093 if (!sctp_asconf_queue_add(stcb, ifa,
2096 if (SCTP_GET_STATE(&stcb->asoc) ==
2099 stcb->sctp_ep, stcb,
2100 stcb->asoc.primary_destination);
2104 printf("set_primary_ip_address: queued on stcb=%p, ",
2105 stcb);
2117 } /* for each stcb */
2122 sctp_find_valid_localaddr(struct sctp_tcb *stcb)
2130 if (stcb->asoc.loopback_scope == 0 && ifn->if_type == IFT_LOOP) {
2136 stcb->asoc.ipv4_addr_legal) {
2144 if (stcb->asoc.ipv4_local_scope == 0 &&
2148 if (sctp_is_addr_restricted(stcb,
2156 stcb->asoc.ipv6_addr_legal) {
2171 if (stcb->asoc.local_scope == 0 &&
2174 if (stcb->asoc.site_scope == 0 &&
2191 sctp_find_valid_localaddr_ep(struct sctp_tcb *stcb)
2195 LIST_FOREACH(laddr, &stcb->sctp_ep->sctp_addr_list, sctp_nxt_addr) {
2213 if (sctp_is_addr_restricted(stcb, laddr->ifa->ifa_addr))
2228 sctp_compose_asconf(struct sctp_tcb *stcb)
2241 if (TAILQ_EMPTY(&stcb->asoc.asconf_queue)) {
2294 acp->serial_number = htonl(stcb->asoc.asconf_seq_out);
2297 TAILQ_FOREACH(aa, &stcb->asoc.asconf_queue, next) {
2301 if (m_asconf->m_len + p_length > stcb->asoc.smallest_mtu) {
2368 if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL)
2369 found_addr = sctp_find_valid_localaddr(stcb);
2371 found_addr = sctp_find_valid_localaddr_ep(stcb);
2417 stcb->asoc.asconf_sent++;
2431 sctp_process_initack_addresses(struct sctp_tcb *stcb, struct mbuf *m,
2464 sin6.sin6_port = stcb->rport;
2469 sin.sin_port = stcb->rport;
2536 if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_DO_ASCONF) &&
2537 stcb->asoc.peer_supports_asconf) {
2539 status = sctp_asconf_queue_add_sa(stcb, sa,
2546 SCTP_GET_STATE(&stcb->asoc) ==
2549 stcb->sctp_ep, stcb,
2550 stcb->asoc.primary_destination);
2559 if ((stcb->sctp_ep->sctp_flags &
2561 (stcb->sctp_ep->sctp_flags &
2568 sctp_add_local_addr_assoc(stcb, ifa);
2588 sctp_addr_in_initack(struct sctp_tcb *stcb, struct mbuf *m, unsigned int offset,
2734 sctp_check_address_list_ep(struct sctp_tcb *stcb, struct mbuf *m, int offset,
2740 LIST_FOREACH(laddr, &stcb->sctp_ep->sctp_addr_list, sctp_nxt_addr) {
2769 if (!sctp_addr_in_initack(stcb, m, offset, length,
2772 sctp_addr_mgmt_assoc(stcb->sctp_ep, stcb, laddr->ifa,
2784 sctp_check_address_list_all(struct sctp_tcb *stcb, struct mbuf *m, int offset,
2813 if (!sctp_addr_in_initack(stcb, m, offset, length,
2816 sctp_addr_mgmt_assoc(stcb->sctp_ep, stcb,
2834 sctp_check_address_list(struct sctp_tcb *stcb, struct mbuf *m, int offset,
2840 sctp_process_initack_addresses(stcb, m, offset, length);
2842 if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) {
2844 sctp_check_address_list_all(stcb, m, offset, length, init_addr,
2848 if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_DO_ASCONF) {
2850 sctp_check_address_list_ep(stcb, m, offset, length,