Lines Matching refs:asoc

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