Home | History | Annotate | Download | only in netinet

Lines Matching defs:asoc

286 sctp_log_block(uint8_t from, struct socket *so, struct sctp_association *asoc)
292 sctp_clog[sctp_cwnd_log_at].x.blk.onmb = asoc->total_output_mbuf_queue_size;
294 sctp_clog[sctp_cwnd_log_at].x.blk.onsb = asoc->total_output_queue_size;
295 sctp_clog[sctp_cwnd_log_at].x.blk.send_sent_qcnt = (u_int16_t)(asoc->send_queue_cnt + asoc->sent_queue_cnt);
296 sctp_clog[sctp_cwnd_log_at].x.blk.stream_qcnt = (u_int16_t)asoc->stream_queue_cnt;
464 (0x000000ff & stcb->asoc.sent_queue_retran_cnt);
472 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
480 if (resend_cnt != stcb->asoc.sent_queue_retran_cnt) {
487 printf("resend_cnt:%d asoc-tot:%d\n",
488 resend_cnt, stcb->asoc.sent_queue_retran_cnt);
490 stcb->asoc.sent_queue_retran_cnt = resend_cnt;
493 (0x000000ff & stcb->asoc.sent_queue_retran_cnt);
499 if (tot_out != stcb->asoc.total_flight) {
508 (int)stcb->asoc.total_flight);
509 stcb->asoc.total_flight = tot_out;
511 if (tot_book_cnt != stcb->asoc.total_flight_count) {
521 stcb->asoc.total_flight_count = tot_book_cnt;
524 TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) {
527 if (tot_out != stcb->asoc.total_flight) {
536 stcb->asoc.total_flight, tot_out);
538 TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) {
540 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
646 sctp_init_asoc(struct sctp_inpcb *m, struct sctp_association *asoc,
662 asoc->state = SCTP_STATE_INUSE;
663 asoc->max_burst = m->sctp_ep.max_burst;
664 asoc->heart_beat_delay = m->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT];
665 asoc->cookie_life = m->sctp_ep.def_cookie_life;
668 asoc->my_vtag = override_tag;
670 asoc->my_vtag = sctp_select_a_tag(m);
672 asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number = asoc->sending_seq =
674 asoc->t3timeout_highest_marked = asoc->asconf_seq_out;
676 asoc->peer_supports_asconf = 1;
677 asoc->peer_supports_asconf_setprim = 1;
678 asoc->peer_supports_pktdrop = 1;
680 asoc->sent_queue_retran_cnt = 0;
682 asoc->last_cwr_tsn = asoc->init_seq_number - 1;
683 asoc->last_acked_seq = asoc->init_seq_number - 1;
684 asoc->advanced_peer_ack_point = asoc->last_acked_seq;
685 asoc->asconf_seq_in = asoc->last_acked_seq;
688 asoc->str_reset_seq_in = asoc->last_acked_seq + 1;
690 asoc->initial_init_rto_max = m->sctp_ep.initial_init_rto_max;
691 asoc->initial_rto = m->sctp_ep.initial_rto;
693 asoc->max_init_times = m->sctp_ep.max_init_times;
694 asoc->max_send_times = m->sctp_ep.max_send_times;
695 asoc->def_net_failure = m->sctp_ep.def_net_failure;
698 asoc->ecn_nonce_allowed = 0;
699 asoc->receiver_nonce_sum = 1;
700 asoc->nonce_sum_expect_base = 1;
701 asoc->nonce_sum_check = 1;
702 asoc->nonce_resync_tsn = 0;
703 asoc->nonce_wait_for_ecne = 0;
704 asoc->nonce_wait_tsn = 0;
712 asoc->ipv6_addr_legal = 1;
723 asoc->ipv4_addr_legal = 1;
726 asoc->ipv4_addr_legal = 0;
730 asoc->ipv4_addr_legal = 1;
731 asoc->ipv6_addr_legal = 0;
735 asoc->my_rwnd = uimax(m->sctp_socket->so_rcv.sb_hiwat, SCTP_MINIMAL_RWND);
736 asoc->peers_rwnd = m->sctp_socket->so_rcv.sb_hiwat;
738 asoc->smallest_mtu = m->sctp_frag_point;
739 asoc->minrto = m->sctp_ep.sctp_minrto;
740 asoc->maxrto = m->sctp_ep.sctp_maxrto;
742 LIST_INIT(&asoc->sctp_local_addr_list);
743 TAILQ_INIT(&asoc->nets);
744 TAILQ_INIT(&asoc->pending_reply_queue);
745 asoc->last_asconf_ack_sent = NULL;
747 asoc->hb_random_idx = 4;
749 asoc->sctp_autoclose_ticks = m->sctp_ep.auto_close_time;
755 asoc->streamoutcnt = asoc->pre_open_streams =
757 asoc->strmout = malloc(asoc->streamoutcnt *
759 if (asoc->strmout == NULL) {
763 for (i = 0; i < asoc->streamoutcnt; i++) {
772 asoc->strmout[i].next_sequence_sent = 0x0;
773 TAILQ_INIT(&asoc->strmout[i].outqueue);
774 asoc->strmout[i].stream_no = i;
775 asoc->strmout[i].next_spoke.tqe_next = 0;
776 asoc->strmout[i].next_spoke.tqe_prev = 0;
779 asoc->mapping_array_size = SCTP_INITIAL_MAPPING_ARRAY;
780 asoc->mapping_array = malloc(asoc->mapping_array_size,
782 if (asoc->mapping_array == NULL) {
783 free(asoc->strmout, M_PCB);
786 memset(asoc->mapping_array, 0, asoc->mapping_array_size);
788 TAILQ_INIT(&asoc->out_wheel);
789 TAILQ_INIT(&asoc->control_send_queue);
790 TAILQ_INIT(&asoc->send_queue);
791 TAILQ_INIT(&asoc->sent_queue);
792 TAILQ_INIT(&asoc->reasmqueue);
793 TAILQ_INIT(&asoc->delivery_queue);
794 asoc->max_inbound_streams = m->sctp_ep.max_open_streams_intome;
796 TAILQ_INIT(&asoc->asconf_queue);
801 sctp_expand_mapping_array(struct sctp_association *asoc)
807 old_size = asoc->mapping_array_size;
816 memcpy(new_array, asoc->mapping_array, old_size);
818 free(asoc->mapping_array, M_PCB);
819 asoc->mapping_array = new_array;
820 asoc->mapping_array_size = new_size;
857 if (stcb->asoc.state == 0) {
891 stcb->asoc.num_send_timers_up--;
892 if (stcb->asoc.num_send_timers_up < 0) {
893 stcb->asoc.num_send_timers_up = 0;
904 if ((stcb->asoc.num_send_timers_up == 0) &&
905 (stcb->asoc.sent_queue_cnt > 0)
915 chk = TAILQ_FIRST(&stcb->asoc.sent_queue);
1067 sctp_fix_ecn_echo(&stcb->asoc);
1113 rto_val = stcb->asoc.initial_rto;
1130 to_ticks = MSEC_TO_TICKS(stcb->asoc.initial_rto);
1143 tmr = &stcb->asoc.dack_timer;
1153 to_ticks = MSEC_TO_TICKS(stcb->asoc.initial_rto);
1174 TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) {
1182 cnt_of_unconf, stcb->asoc.heart_beat_delay);
1185 if (stcb->asoc.hb_random_idx > 3) {
1187 memcpy(stcb->asoc.hb_random_values, &rndval,
1188 sizeof(stcb->asoc.hb_random_values));
1189 this_random = stcb->asoc.hb_random_values[0];
1190 stcb->asoc.hb_random_idx = 0;
1191 stcb->asoc.hb_ect_randombit = 0;
1193 this_random = stcb->asoc.hb_random_values[stcb->asoc.hb_random_idx];
1194 stcb->asoc.hb_random_idx++;
1195 stcb->asoc.hb_ect_randombit = 0;
1201 if ((stcb->asoc.heart_beat_delay == 0) &&
1208 delay = stcb->asoc.heart_beat_delay;
1209 TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) {
1218 to_ticks = this_random + stcb->asoc.initial_rto + delay;
1225 to_ticks = this_random + stcb->asoc.initial_rto;
1227 to_ticks = stcb->asoc.heart_beat_delay + this_random + stcb->asoc.initial_rto;
1241 tmr = &stcb->asoc.hb_timer;
1254 to_ticks = MSEC_TO_TICKS(stcb->asoc.initial_rto);
1297 to_ticks = MSEC_TO_TICKS(stcb->asoc.initial_rto);
1312 tmr = &stcb->asoc.shut_guard_timer;
1323 to_ticks = MSEC_TO_TICKS(stcb->asoc.initial_rto);
1327 tmr = &stcb->asoc.strreset_timer;
1339 to_ticks = MSEC_TO_TICKS(stcb->asoc.initial_rto);
1343 tmr = &stcb->asoc.asconf_timer;
1349 if (stcb->asoc.sctp_autoclose_ticks == 0) {
1353 to_ticks = stcb->asoc.sctp_autoclose_ticks;
1354 tmr = &stcb->asoc.autoclose_timer;
1384 stcb->asoc.num_send_timers_up++;
1428 tmr = &stcb->asoc.dack_timer;
1440 tmr = &stcb->asoc.hb_timer;
1483 tmr = &stcb->asoc.shut_guard_timer;
1489 tmr = &stcb->asoc.strreset_timer;
1495 tmr = &stcb->asoc.asconf_timer;
1501 tmr = &stcb->asoc.autoclose_timer;
1525 stcb->asoc.num_send_timers_up--;
1526 if (stcb->asoc.num_send_timers_up < 0) {
1527 stcb->asoc.num_send_timers_up = 0;
1590 struct sctp_association *asoc, u_long mtu)
1594 * the asoc MTU, going through ANY chunk+overhead larger than mtu
1600 asoc->smallest_mtu = mtu;
1608 TAILQ_FOREACH(strm, &asoc->out_wheel, next_spoke) {
1616 TAILQ_FOREACH(chk, &asoc->send_queue, sctp_next) {
1622 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) {
1638 struct sctp_association *asoc,
1729 (stcb->asoc.sat_network_lockout == 0)) {
1730 stcb->asoc.sat_network = 1;
1731 } else if ((!first_measure) && stcb->asoc.sat_network) {
1732 stcb->asoc.sat_network = 0;
1733 stcb->asoc.sat_network_lockout = 1;
1736 if (new_rto < stcb->asoc.minrto) {
1737 new_rto = stcb->asoc.minrto;
1739 if (new_rto > stcb->asoc.maxrto) {
1740 new_rto = stcb->asoc.maxrto;
1879 sctp_deliver_data(stcb, &stcb->asoc, NULL, 0);
1918 sac->sac_outbound_streams = stcb->asoc.streamoutcnt;
1919 sac->sac_inbound_streams = stcb->asoc.streamincnt;
1929 to = rtcache_getdst(&stcb->asoc.primary_destination->ro);
1952 to, m_notify, NULL, stcb->asoc.my_vtag, stcb->sctp_ep)) {
1961 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
1964 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2015 to = rtcache_getdst(&stcb->asoc.primary_destination->ro);
2037 m_notify, NULL, stcb->asoc.my_vtag, stcb->sctp_ep)) {
2046 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2049 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2109 to = rtcache_getdst(&stcb->asoc.primary_destination->ro);
2132 m_notify, NULL, stcb->asoc.my_vtag, stcb->sctp_ep)) {
2141 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2144 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2181 to = rtcache_getdst(&stcb->asoc.primary_destination->ro);
2202 m_notify, NULL, stcb->asoc.my_vtag, stcb->sctp_ep)) {
2211 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2214 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2251 to = rtcache_getdst(&stcb->asoc.primary_destination->ro);
2272 m_notify, NULL, stcb->asoc.my_vtag, stcb->sctp_ep)) {
2281 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2284 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2330 to = rtcache_getdst(&stcb->asoc.primary_destination->ro);
2351 m_notify, NULL, stcb->asoc.my_vtag, stcb->sctp_ep)) {
2360 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2363 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2426 to = rtcache_getdst(&stcb->asoc.primary_destination->ro);
2443 m_notify, NULL, stcb->asoc.my_vtag, stcb->sctp_ep)) {
2452 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2455 stcb->asoc.my_rwnd_control_len += sizeof(struct mbuf);
2470 if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) {
2569 struct sctp_association *asoc;
2573 asoc = &stcb->asoc;
2579 TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) {
2583 stcb->asoc.stream_queue_cnt--;
2592 chk->asoc = NULL;
2604 if (!TAILQ_EMPTY(&asoc->send_queue)) {
2605 chk = TAILQ_FIRST(&asoc->send_queue);
2607 TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next);
2620 chk = TAILQ_FIRST(&asoc->send_queue);
2624 if (!TAILQ_EMPTY(&asoc->sent_queue)) {
2625 chk = TAILQ_FIRST(&asoc->sent_queue);
2627 TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next);
2641 chk = TAILQ_FIRST(&asoc->sent_queue);
2653 /* Tell them we lost the asoc */
2667 vtag = stcb->asoc.peer_vtag;
2702 /* now free the asoc */
3181 sctp_should_be_moved(struct mbuf *this, struct sctp_association *asoc)
3188 * a kludge where we stuff the my_vtag of the asoc
3196 if ((u_int32_t)m->m_pkthdr.csum == asoc->my_vtag)
3198 if ((u_int32_t)m->m_pkthdr.csum_data == asoc->my_vtag)
3262 struct sctp_association *asoc;
3265 asoc = &stcb->asoc;
3273 if (inp->sctp_vtag_first == asoc->my_vtag) {
3301 if (sctp_should_be_moved(this, asoc)) {
3334 sctp_free_bufspace(struct sctp_tcb *stcb, struct sctp_association *asoc,
3342 asoc->total_output_queue_size,
3344 asoc->total_output_mbuf_queue_size,
3347 if (asoc->total_output_queue_size >= tp1->book_size) {
3348 asoc->total_output_queue_size -= tp1->book_size;
3350 asoc->total_output_queue_size = 0;
3354 if (asoc->total_output_mbuf_queue_size >= tp1->mbcnt) {
3355 asoc->total_output_mbuf_queue_size -= tp1->mbcnt;
3357 asoc->total_output_mbuf_queue_size = 0;
3387 sctp_free_bufspace(stcb, &stcb->asoc, tp1);
3394 stcb->asoc.sent_queue_cnt_removeable--;
3396 if (queue == &stcb->asoc.send_queue) {
3397 TAILQ_REMOVE(&stcb->asoc.send_queue, tp1, sctp_next);
3399 TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, tp1,
3401 stcb->asoc.sent_queue_cnt++;
3418 if ((foundeom == 0) && (queue == &stcb->asoc.sent_queue)) {
3423 tp1 = TAILQ_FIRST(&stcb->asoc.send_queue);
3430 &stcb->asoc.send_queue);