Lines Matching refs:chk

269 		struct sctp_tmit_chunk *chk, *nchk;  in sctp_process_init()  local
273 TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { in sctp_process_init()
274 if (chk->rec.data.sid >= newcnt) { in sctp_process_init()
275 TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); in sctp_process_init()
277 if (asoc->strmout[chk->rec.data.sid].chunks_on_queues > 0) { in sctp_process_init()
278 asoc->strmout[chk->rec.data.sid].chunks_on_queues--; in sctp_process_init()
281 panic("No chunks on the queues for sid %u.", chk->rec.data.sid); in sctp_process_init()
284 if (chk->data != NULL) { in sctp_process_init()
285 sctp_free_bufspace(stcb, asoc, chk, 1); in sctp_process_init()
287 0, chk, SCTP_SO_NOT_LOCKED); in sctp_process_init()
288 if (chk->data) { in sctp_process_init()
289 sctp_m_freem(chk->data); in sctp_process_init()
290 chk->data = NULL; in sctp_process_init()
293 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_process_init()
1361 struct sctp_tmit_chunk *chk, *nchk; in sctp_process_cookie_existing() local
1647 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { in sctp_process_cookie_existing()
1648 if (chk->sent < SCTP_DATAGRAM_RESEND) { in sctp_process_cookie_existing()
1649 chk->sent = SCTP_DATAGRAM_RESEND; in sctp_process_cookie_existing()
1650 sctp_flight_size_decrease(chk); in sctp_process_cookie_existing()
1651 sctp_total_flight_decrease(stcb, chk); in sctp_process_cookie_existing()
1837 TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) { in sctp_process_cookie_existing()
1838 TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); in sctp_process_cookie_existing()
1839 if (chk->data) { in sctp_process_cookie_existing()
1840 sctp_m_freem(chk->data); in sctp_process_cookie_existing()
1841 chk->data = NULL; in sctp_process_cookie_existing()
1843 if (chk->holds_key_ref) in sctp_process_cookie_existing()
1844 sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); in sctp_process_cookie_existing()
1845 sctp_free_remote_addr(chk->whoTo); in sctp_process_cookie_existing()
1846 SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); in sctp_process_cookie_existing()
1852 TAILQ_FOREACH_SAFE(chk, &asoc->asconf_send_queue, sctp_next, nchk) { in sctp_process_cookie_existing()
1853 TAILQ_REMOVE(&asoc->asconf_send_queue, chk, sctp_next); in sctp_process_cookie_existing()
1854 if (chk->data) { in sctp_process_cookie_existing()
1855 sctp_m_freem(chk->data); in sctp_process_cookie_existing()
1856 chk->data = NULL; in sctp_process_cookie_existing()
1858 if (chk->holds_key_ref) in sctp_process_cookie_existing()
1859 sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); in sctp_process_cookie_existing()
1860 sctp_free_remote_addr(chk->whoTo); in sctp_process_cookie_existing()
1861 SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); in sctp_process_cookie_existing()
2743 struct sctp_tmit_chunk *chk; in sctp_handle_cookie_ack() local
2841 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_handle_cookie_ack()
2842 if (chk->whoTo != NULL) { in sctp_handle_cookie_ack()
2846 if (chk != NULL) { in sctp_handle_cookie_ack()
2847 sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, chk->whoTo); in sctp_handle_cookie_ack()
2978 struct sctp_tmit_chunk *chk, *nchk; in sctp_handle_ecn_cwr() local
2985 TAILQ_FOREACH_SAFE(chk, &stcb->asoc.control_send_queue, sctp_next, nchk) { in sctp_handle_ecn_cwr()
2986 if (chk->rec.chunk_id.id != SCTP_ECN_ECHO) { in sctp_handle_ecn_cwr()
2989 if ((override == 0) && (chk->whoTo != net)) { in sctp_handle_ecn_cwr()
2993 ecne = mtod(chk->data, struct sctp_ecne_chunk *); in sctp_handle_ecn_cwr()
2997 TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, in sctp_handle_ecn_cwr()
3000 sctp_m_freem(chk->data); in sctp_handle_ecn_cwr()
3001 chk->data = NULL; in sctp_handle_ecn_cwr()
3002 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_handle_ecn_cwr()
3370 struct sctp_tmit_chunk *chk; in sctp_find_stream_reset() local
3374 chk = asoc->str_reset; in sctp_find_stream_reset()
3376 (chk == NULL)) { in sctp_find_stream_reset()
3380 if (chk->data == NULL) { in sctp_find_stream_reset()
3385 *bchk = chk; in sctp_find_stream_reset()
3387 clen = chk->send_size; in sctp_find_stream_reset()
3388 ch = mtod(chk->data, struct sctp_chunkhdr *); in sctp_find_stream_reset()
3410 struct sctp_tmit_chunk *chk; in sctp_clean_up_stream_reset() local
3413 chk = asoc->str_reset; in sctp_clean_up_stream_reset()
3414 if (chk == NULL) { in sctp_clean_up_stream_reset()
3420 TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); in sctp_clean_up_stream_reset()
3422 if (chk->data) { in sctp_clean_up_stream_reset()
3423 sctp_m_freem(chk->data); in sctp_clean_up_stream_reset()
3424 chk->data = NULL; in sctp_clean_up_stream_reset()
3426 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_clean_up_stream_reset()
3437 struct sctp_tmit_chunk *chk; in sctp_handle_stream_reset_response() local
3448 req_param = sctp_find_stream_reset(stcb, seq, &chk); in sctp_handle_stream_reset_response()
3592 struct sctp_tmit_chunk *chk, in sctp_handle_str_reset_request_in() argument
3644 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_request_in()
3647 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_request_in()
3649 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]); in sctp_handle_str_reset_request_in()
3651 sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_RESULT_ERR_BAD_SEQNO); in sctp_handle_str_reset_request_in()
3658 struct sctp_tmit_chunk *chk, in sctp_handle_str_reset_request_tsn() argument
3706 sctp_add_stream_reset_result_tsn(chk, seq, asoc->last_reset_action[0], in sctp_handle_str_reset_request_tsn()
3710 sctp_add_stream_reset_result_tsn(chk, seq, asoc->last_reset_action[0], in sctp_handle_str_reset_request_tsn()
3713 sctp_add_stream_reset_result_tsn(chk, seq, asoc->last_reset_action[1], in sctp_handle_str_reset_request_tsn()
3716 sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_RESULT_ERR_BAD_SEQNO); in sctp_handle_str_reset_request_tsn()
3723 struct sctp_tmit_chunk *chk, in sctp_handle_str_reset_request_out() argument
3769 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_request_out()
3779 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_request_out()
3786 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_request_out()
3792 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]); in sctp_handle_str_reset_request_out()
3794 sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_RESULT_ERR_BAD_SEQNO); in sctp_handle_str_reset_request_out()
3799 sctp_handle_str_reset_add_strm(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk, in sctp_handle_str_reset_add_strm() argument
3871 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_add_strm()
3878 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_add_strm()
3884 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]); in sctp_handle_str_reset_add_strm()
3886 sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_RESULT_ERR_BAD_SEQNO); in sctp_handle_str_reset_add_strm()
3891 sctp_handle_str_reset_add_out_strm(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk, in sctp_handle_str_reset_add_out_strm() argument
3928 sctp_add_stream_reset_result(chk, seq, stcb->asoc.last_reset_action[0]); in sctp_handle_str_reset_add_out_strm()
3935 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_add_out_strm()
3941 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]); in sctp_handle_str_reset_add_out_strm()
3943 sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_RESULT_ERR_BAD_SEQNO); in sctp_handle_str_reset_add_out_strm()
3960 struct sctp_tmit_chunk *chk; in sctp_handle_stream_reset() local
3970 sctp_alloc_a_chunk(stcb, chk); in sctp_handle_stream_reset()
3971 if (chk == NULL) { in sctp_handle_stream_reset()
3974 chk->copy_by_ref = 0; in sctp_handle_stream_reset()
3975 chk->rec.chunk_id.id = SCTP_STREAM_RESET; in sctp_handle_stream_reset()
3976 chk->rec.chunk_id.can_take_data = 0; in sctp_handle_stream_reset()
3977 chk->flags = 0; in sctp_handle_stream_reset()
3978 chk->asoc = &stcb->asoc; in sctp_handle_stream_reset()
3979 chk->no_fr_allowed = 0; in sctp_handle_stream_reset()
3980 chk->book_size = chk->send_size = sizeof(struct sctp_chunkhdr); in sctp_handle_stream_reset()
3981 chk->book_size_scale = 0; in sctp_handle_stream_reset()
3982 chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); in sctp_handle_stream_reset()
3983 if (chk->data == NULL) { in sctp_handle_stream_reset()
3985 if (chk->data) { in sctp_handle_stream_reset()
3986 sctp_m_freem(chk->data); in sctp_handle_stream_reset()
3987 chk->data = NULL; in sctp_handle_stream_reset()
3989 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_handle_stream_reset()
3992 SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); in sctp_handle_stream_reset()
3995 chk->sent = SCTP_DATAGRAM_UNSENT; in sctp_handle_stream_reset()
3996 chk->snd_count = 0; in sctp_handle_stream_reset()
3997 chk->whoTo = NULL; in sctp_handle_stream_reset()
3999 ch = mtod(chk->data, struct sctp_chunkhdr *); in sctp_handle_stream_reset()
4002 ch->chunk_length = htons(chk->send_size); in sctp_handle_stream_reset()
4003 SCTP_BUF_LEN(chk->data) = SCTP_SIZE32(chk->send_size); in sctp_handle_stream_reset()
4049 sctp_handle_str_reset_request_out(stcb, chk, req_out, trunc); in sctp_handle_stream_reset()
4058 sctp_handle_str_reset_add_strm(stcb, chk, str_add); in sctp_handle_stream_reset()
4067 sctp_handle_str_reset_add_out_strm(stcb, chk, str_add); in sctp_handle_stream_reset()
4073 sctp_handle_str_reset_request_in(stcb, chk, req_in, trunc); in sctp_handle_stream_reset()
4079 if (sctp_handle_str_reset_request_tsn(stcb, chk, req_tsn)) { in sctp_handle_stream_reset()
4115 chk, in sctp_handle_stream_reset()
4892 struct sctp_tmit_chunk *chk; in sctp_process_control() local
4955 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { in sctp_process_control()
4956 if (chk->whoTo != NULL) { in sctp_process_control()
4960 if (chk != NULL) { in sctp_process_control()
4961 sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, chk->whoTo); in sctp_process_control()