Lines Matching full:asoc

27 	struct sctp_association *asoc;  in sctp_stream_shrink_out()  local
31 asoc = container_of(stream, struct sctp_association, stream); in sctp_stream_shrink_out()
32 outq = &asoc->outqueue; in sctp_stream_shrink_out()
47 if (asoc->peer.prsctp_capable && in sctp_stream_shrink_out()
49 asoc->sent_cnt_removable--; in sctp_stream_shrink_out()
229 static int sctp_send_reconf(struct sctp_association *asoc, in sctp_send_reconf() argument
234 retval = sctp_primitive_RECONF(asoc->base.net, asoc, chunk); in sctp_send_reconf()
244 struct sctp_association *asoc; in sctp_stream_outq_is_empty() local
247 asoc = container_of(stream, struct sctp_association, stream); in sctp_stream_outq_is_empty()
248 if (!asoc->outqueue.out_qlen) in sctp_stream_outq_is_empty()
265 int sctp_send_reset_streams(struct sctp_association *asoc, in sctp_send_reset_streams() argument
268 struct sctp_stream *stream = &asoc->stream; in sctp_send_reset_streams()
275 if (!asoc->peer.reconf_capable || in sctp_send_reset_streams()
276 !(asoc->strreset_enable & SCTP_ENABLE_RESET_STREAM_REQ)) { in sctp_send_reset_streams()
281 if (asoc->strreset_outstanding) { in sctp_send_reset_streams()
334 chunk = sctp_make_strreset_req(asoc, str_nums, nstr_list, out, in); in sctp_send_reset_streams()
353 asoc->strreset_chunk = chunk; in sctp_send_reset_streams()
354 sctp_chunk_hold(asoc->strreset_chunk); in sctp_send_reset_streams()
356 retval = sctp_send_reconf(asoc, chunk); in sctp_send_reset_streams()
358 sctp_chunk_put(asoc->strreset_chunk); in sctp_send_reset_streams()
359 asoc->strreset_chunk = NULL; in sctp_send_reset_streams()
374 asoc->strreset_outstanding = out + in; in sctp_send_reset_streams()
380 int sctp_send_reset_assoc(struct sctp_association *asoc) in sctp_send_reset_assoc() argument
382 struct sctp_stream *stream = &asoc->stream; in sctp_send_reset_assoc()
387 if (!asoc->peer.reconf_capable || in sctp_send_reset_assoc()
388 !(asoc->strreset_enable & SCTP_ENABLE_RESET_ASSOC_REQ)) in sctp_send_reset_assoc()
391 if (asoc->strreset_outstanding) in sctp_send_reset_assoc()
394 if (!sctp_outq_is_empty(&asoc->outqueue)) in sctp_send_reset_assoc()
397 chunk = sctp_make_strreset_tsnreq(asoc); in sctp_send_reset_assoc()
405 asoc->strreset_chunk = chunk; in sctp_send_reset_assoc()
406 sctp_chunk_hold(asoc->strreset_chunk); in sctp_send_reset_assoc()
408 retval = sctp_send_reconf(asoc, chunk); in sctp_send_reset_assoc()
410 sctp_chunk_put(asoc->strreset_chunk); in sctp_send_reset_assoc()
411 asoc->strreset_chunk = NULL; in sctp_send_reset_assoc()
419 asoc->strreset_outstanding = 1; in sctp_send_reset_assoc()
424 int sctp_send_add_streams(struct sctp_association *asoc, in sctp_send_add_streams() argument
427 struct sctp_stream *stream = &asoc->stream; in sctp_send_add_streams()
433 if (!asoc->peer.reconf_capable || in sctp_send_add_streams()
434 !(asoc->strreset_enable & SCTP_ENABLE_CHANGE_ASSOC_REQ)) { in sctp_send_add_streams()
439 if (asoc->strreset_outstanding) { in sctp_send_add_streams()
460 chunk = sctp_make_strreset_addstrm(asoc, out, in); in sctp_send_add_streams()
466 asoc->strreset_chunk = chunk; in sctp_send_add_streams()
467 sctp_chunk_hold(asoc->strreset_chunk); in sctp_send_add_streams()
469 retval = sctp_send_reconf(asoc, chunk); in sctp_send_add_streams()
471 sctp_chunk_put(asoc->strreset_chunk); in sctp_send_add_streams()
472 asoc->strreset_chunk = NULL; in sctp_send_add_streams()
476 asoc->strreset_outstanding = !!out + !!in; in sctp_send_add_streams()
483 struct sctp_association *asoc, __be32 resp_seq, in sctp_chunk_lookup_strreset_param() argument
486 struct sctp_chunk *chunk = asoc->strreset_chunk; in sctp_chunk_lookup_strreset_param()
509 static void sctp_update_strreset_result(struct sctp_association *asoc, in sctp_update_strreset_result() argument
512 asoc->strreset_result[1] = asoc->strreset_result[0]; in sctp_update_strreset_result()
513 asoc->strreset_result[0] = result; in sctp_update_strreset_result()
517 struct sctp_association *asoc, in sctp_process_strreset_outreq() argument
522 struct sctp_stream *stream = &asoc->stream; in sctp_process_strreset_outreq()
531 sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map)) { in sctp_process_strreset_outreq()
536 if (TSN_lt(asoc->strreset_inseq, request_seq) || in sctp_process_strreset_outreq()
537 TSN_lt(request_seq, asoc->strreset_inseq - 2)) { in sctp_process_strreset_outreq()
540 } else if (TSN_lt(request_seq, asoc->strreset_inseq)) { in sctp_process_strreset_outreq()
541 i = asoc->strreset_inseq - request_seq - 1; in sctp_process_strreset_outreq()
542 result = asoc->strreset_result[i]; in sctp_process_strreset_outreq()
545 asoc->strreset_inseq++; in sctp_process_strreset_outreq()
551 if (!(asoc->strreset_enable & SCTP_ENABLE_RESET_STREAM_REQ)) in sctp_process_strreset_outreq()
563 if (asoc->strreset_chunk) { in sctp_process_strreset_outreq()
565 asoc, outreq->response_seq, in sctp_process_strreset_outreq()
572 asoc->strreset_outstanding--; in sctp_process_strreset_outreq()
573 asoc->strreset_outseq++; in sctp_process_strreset_outreq()
575 if (!asoc->strreset_outstanding) { in sctp_process_strreset_outreq()
578 t = asoc->strreset_chunk->transport; in sctp_process_strreset_outreq()
582 sctp_chunk_put(asoc->strreset_chunk); in sctp_process_strreset_outreq()
583 asoc->strreset_chunk = NULL; in sctp_process_strreset_outreq()
596 *evp = sctp_ulpevent_make_stream_reset_event(asoc, in sctp_process_strreset_outreq()
600 sctp_update_strreset_result(asoc, result); in sctp_process_strreset_outreq()
602 return sctp_make_strreset_resp(asoc, result, request_seq); in sctp_process_strreset_outreq()
606 struct sctp_association *asoc, in sctp_process_strreset_inreq() argument
611 struct sctp_stream *stream = &asoc->stream; in sctp_process_strreset_inreq()
619 if (TSN_lt(asoc->strreset_inseq, request_seq) || in sctp_process_strreset_inreq()
620 TSN_lt(request_seq, asoc->strreset_inseq - 2)) { in sctp_process_strreset_inreq()
623 } else if (TSN_lt(request_seq, asoc->strreset_inseq)) { in sctp_process_strreset_inreq()
624 i = asoc->strreset_inseq - request_seq - 1; in sctp_process_strreset_inreq()
625 result = asoc->strreset_result[i]; in sctp_process_strreset_inreq()
630 asoc->strreset_inseq++; in sctp_process_strreset_inreq()
632 if (!(asoc->strreset_enable & SCTP_ENABLE_RESET_STREAM_REQ)) in sctp_process_strreset_inreq()
635 if (asoc->strreset_outstanding) { in sctp_process_strreset_inreq()
651 asoc->strreset_inseq--; in sctp_process_strreset_inreq()
655 chunk = sctp_make_strreset_req(asoc, nums, str_p, 1, 0); in sctp_process_strreset_inreq()
667 asoc->strreset_chunk = chunk; in sctp_process_strreset_inreq()
668 asoc->strreset_outstanding = 1; in sctp_process_strreset_inreq()
669 sctp_chunk_hold(asoc->strreset_chunk); in sctp_process_strreset_inreq()
674 sctp_update_strreset_result(asoc, result); in sctp_process_strreset_inreq()
677 chunk = sctp_make_strreset_resp(asoc, result, request_seq); in sctp_process_strreset_inreq()
683 struct sctp_association *asoc, in sctp_process_strreset_tsnreq() argument
689 struct sctp_stream *stream = &asoc->stream; in sctp_process_strreset_tsnreq()
695 if (TSN_lt(asoc->strreset_inseq, request_seq) || in sctp_process_strreset_tsnreq()
696 TSN_lt(request_seq, asoc->strreset_inseq - 2)) { in sctp_process_strreset_tsnreq()
699 } else if (TSN_lt(request_seq, asoc->strreset_inseq)) { in sctp_process_strreset_tsnreq()
700 i = asoc->strreset_inseq - request_seq - 1; in sctp_process_strreset_tsnreq()
701 result = asoc->strreset_result[i]; in sctp_process_strreset_tsnreq()
703 next_tsn = asoc->ctsn_ack_point + 1; in sctp_process_strreset_tsnreq()
705 sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1; in sctp_process_strreset_tsnreq()
710 if (!sctp_outq_is_empty(&asoc->outqueue)) { in sctp_process_strreset_tsnreq()
715 asoc->strreset_inseq++; in sctp_process_strreset_tsnreq()
717 if (!(asoc->strreset_enable & SCTP_ENABLE_RESET_ASSOC_REQ)) in sctp_process_strreset_tsnreq()
720 if (asoc->strreset_outstanding) { in sctp_process_strreset_tsnreq()
730 max_tsn_seen = sctp_tsnmap_get_max_tsn_seen(&asoc->peer.tsn_map); in sctp_process_strreset_tsnreq()
731 asoc->stream.si->report_ftsn(&asoc->ulpq, max_tsn_seen); in sctp_process_strreset_tsnreq()
738 init_tsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + (1 << 31); in sctp_process_strreset_tsnreq()
739 sctp_tsnmap_init(&asoc->peer.tsn_map, SCTP_TSN_MAP_INITIAL, in sctp_process_strreset_tsnreq()
746 sctp_outq_free(&asoc->outqueue); in sctp_process_strreset_tsnreq()
753 next_tsn = asoc->next_tsn; in sctp_process_strreset_tsnreq()
754 asoc->ctsn_ack_point = next_tsn - 1; in sctp_process_strreset_tsnreq()
755 asoc->adv_peer_ack_point = asoc->ctsn_ack_point; in sctp_process_strreset_tsnreq()
769 *evp = sctp_ulpevent_make_assoc_reset_event(asoc, 0, init_tsn, in sctp_process_strreset_tsnreq()
773 sctp_update_strreset_result(asoc, result); in sctp_process_strreset_tsnreq()
775 return sctp_make_strreset_tsnresp(asoc, result, request_seq, in sctp_process_strreset_tsnreq()
780 struct sctp_association *asoc, in sctp_process_strreset_addstrm_out() argument
785 struct sctp_stream *stream = &asoc->stream; in sctp_process_strreset_addstrm_out()
791 if (TSN_lt(asoc->strreset_inseq, request_seq) || in sctp_process_strreset_addstrm_out()
792 TSN_lt(request_seq, asoc->strreset_inseq - 2)) { in sctp_process_strreset_addstrm_out()
795 } else if (TSN_lt(request_seq, asoc->strreset_inseq)) { in sctp_process_strreset_addstrm_out()
796 i = asoc->strreset_inseq - request_seq - 1; in sctp_process_strreset_addstrm_out()
797 result = asoc->strreset_result[i]; in sctp_process_strreset_addstrm_out()
800 asoc->strreset_inseq++; in sctp_process_strreset_addstrm_out()
802 if (!(asoc->strreset_enable & SCTP_ENABLE_CHANGE_ASSOC_REQ)) in sctp_process_strreset_addstrm_out()
813 if (asoc->strreset_chunk) { in sctp_process_strreset_addstrm_out()
815 asoc, 0, SCTP_PARAM_RESET_ADD_IN_STREAMS)) { in sctp_process_strreset_addstrm_out()
821 asoc->strreset_outstanding--; in sctp_process_strreset_addstrm_out()
822 asoc->strreset_outseq++; in sctp_process_strreset_addstrm_out()
824 if (!asoc->strreset_outstanding) { in sctp_process_strreset_addstrm_out()
827 t = asoc->strreset_chunk->transport; in sctp_process_strreset_addstrm_out()
831 sctp_chunk_put(asoc->strreset_chunk); in sctp_process_strreset_addstrm_out()
832 asoc->strreset_chunk = NULL; in sctp_process_strreset_addstrm_out()
840 *evp = sctp_ulpevent_make_stream_change_event(asoc, in sctp_process_strreset_addstrm_out()
844 sctp_update_strreset_result(asoc, result); in sctp_process_strreset_addstrm_out()
846 return sctp_make_strreset_resp(asoc, result, request_seq); in sctp_process_strreset_addstrm_out()
850 struct sctp_association *asoc, in sctp_process_strreset_addstrm_in() argument
855 struct sctp_stream *stream = &asoc->stream; in sctp_process_strreset_addstrm_in()
863 if (TSN_lt(asoc->strreset_inseq, request_seq) || in sctp_process_strreset_addstrm_in()
864 TSN_lt(request_seq, asoc->strreset_inseq - 2)) { in sctp_process_strreset_addstrm_in()
867 } else if (TSN_lt(request_seq, asoc->strreset_inseq)) { in sctp_process_strreset_addstrm_in()
868 i = asoc->strreset_inseq - request_seq - 1; in sctp_process_strreset_addstrm_in()
869 result = asoc->strreset_result[i]; in sctp_process_strreset_addstrm_in()
874 asoc->strreset_inseq++; in sctp_process_strreset_addstrm_in()
876 if (!(asoc->strreset_enable & SCTP_ENABLE_CHANGE_ASSOC_REQ)) in sctp_process_strreset_addstrm_in()
879 if (asoc->strreset_outstanding) { in sctp_process_strreset_addstrm_in()
893 chunk = sctp_make_strreset_addstrm(asoc, out, 0); in sctp_process_strreset_addstrm_in()
897 asoc->strreset_chunk = chunk; in sctp_process_strreset_addstrm_in()
898 asoc->strreset_outstanding = 1; in sctp_process_strreset_addstrm_in()
899 sctp_chunk_hold(asoc->strreset_chunk); in sctp_process_strreset_addstrm_in()
906 sctp_update_strreset_result(asoc, result); in sctp_process_strreset_addstrm_in()
909 chunk = sctp_make_strreset_resp(asoc, result, request_seq); in sctp_process_strreset_addstrm_in()
915 struct sctp_association *asoc, in sctp_process_strreset_resp() argument
919 struct sctp_stream *stream = &asoc->stream; in sctp_process_strreset_resp()
926 req = sctp_chunk_lookup_strreset_param(asoc, resp->response_seq, 0); in sctp_process_strreset_resp()
972 *evp = sctp_ulpevent_make_stream_reset_event(asoc, flags, in sctp_process_strreset_resp()
989 *evp = sctp_ulpevent_make_stream_reset_event(asoc, flags, in sctp_process_strreset_resp()
1005 &asoc->peer.tsn_map); in sctp_process_strreset_resp()
1008 asoc->stream.si->report_ftsn(&asoc->ulpq, mtsn); in sctp_process_strreset_resp()
1010 sctp_tsnmap_init(&asoc->peer.tsn_map, in sctp_process_strreset_resp()
1018 list_splice_init(&asoc->outqueue.out_chunk_list, &temp); in sctp_process_strreset_resp()
1019 sctp_outq_free(&asoc->outqueue); in sctp_process_strreset_resp()
1020 list_splice_init(&temp, &asoc->outqueue.out_chunk_list); in sctp_process_strreset_resp()
1022 asoc->next_tsn = rtsn; in sctp_process_strreset_resp()
1023 asoc->ctsn_ack_point = asoc->next_tsn - 1; in sctp_process_strreset_resp()
1024 asoc->adv_peer_ack_point = asoc->ctsn_ack_point; in sctp_process_strreset_resp()
1037 *evp = sctp_ulpevent_make_assoc_reset_event(asoc, flags, in sctp_process_strreset_resp()
1055 *evp = sctp_ulpevent_make_stream_change_event(asoc, flags, in sctp_process_strreset_resp()
1069 *evp = sctp_ulpevent_make_stream_change_event(asoc, flags, in sctp_process_strreset_resp()
1073 asoc->strreset_outstanding--; in sctp_process_strreset_resp()
1074 asoc->strreset_outseq++; in sctp_process_strreset_resp()
1077 if (!asoc->strreset_outstanding) { in sctp_process_strreset_resp()
1078 t = asoc->strreset_chunk->transport; in sctp_process_strreset_resp()
1082 sctp_chunk_put(asoc->strreset_chunk); in sctp_process_strreset_resp()
1083 asoc->strreset_chunk = NULL; in sctp_process_strreset_resp()