|
|
@@ -3733,3 +3733,77 @@ struct sctp_chunk *sctp_make_strreset_addstrm(
|
|
|
|
|
|
return retval;
|
|
|
}
|
|
|
+
|
|
|
+/* RE-CONFIG 4.4 (RESP)
|
|
|
+ * 0 1 2 3
|
|
|
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
+ * | Parameter Type = 16 | Parameter Length |
|
|
|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
+ * | Re-configuration Response Sequence Number |
|
|
|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
+ * | Result |
|
|
|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
+ */
|
|
|
+struct sctp_chunk *sctp_make_strreset_resp(
|
|
|
+ const struct sctp_association *asoc,
|
|
|
+ __u32 result, __u32 sn)
|
|
|
+{
|
|
|
+ struct sctp_strreset_resp resp;
|
|
|
+ __u16 length = sizeof(resp);
|
|
|
+ struct sctp_chunk *retval;
|
|
|
+
|
|
|
+ retval = sctp_make_reconf(asoc, length);
|
|
|
+ if (!retval)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ resp.param_hdr.type = SCTP_PARAM_RESET_RESPONSE;
|
|
|
+ resp.param_hdr.length = htons(length);
|
|
|
+ resp.response_seq = htonl(sn);
|
|
|
+ resp.result = htonl(result);
|
|
|
+
|
|
|
+ sctp_addto_chunk(retval, sizeof(resp), &resp);
|
|
|
+
|
|
|
+ return retval;
|
|
|
+}
|
|
|
+
|
|
|
+/* RE-CONFIG 4.4 OPTIONAL (TSNRESP)
|
|
|
+ * 0 1 2 3
|
|
|
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
+ * | Parameter Type = 16 | Parameter Length |
|
|
|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
+ * | Re-configuration Response Sequence Number |
|
|
|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
+ * | Result |
|
|
|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
+ * | Sender's Next TSN (optional) |
|
|
|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
+ * | Receiver's Next TSN (optional) |
|
|
|
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
+ */
|
|
|
+struct sctp_chunk *sctp_make_strreset_tsnresp(
|
|
|
+ struct sctp_association *asoc,
|
|
|
+ __u32 result, __u32 sn,
|
|
|
+ __u32 sender_tsn, __u32 receiver_tsn)
|
|
|
+{
|
|
|
+ struct sctp_strreset_resptsn tsnresp;
|
|
|
+ __u16 length = sizeof(tsnresp);
|
|
|
+ struct sctp_chunk *retval;
|
|
|
+
|
|
|
+ retval = sctp_make_reconf(asoc, length);
|
|
|
+ if (!retval)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ tsnresp.param_hdr.type = SCTP_PARAM_RESET_RESPONSE;
|
|
|
+ tsnresp.param_hdr.length = htons(length);
|
|
|
+
|
|
|
+ tsnresp.response_seq = htonl(sn);
|
|
|
+ tsnresp.result = htonl(result);
|
|
|
+ tsnresp.senders_next_tsn = htonl(sender_tsn);
|
|
|
+ tsnresp.receivers_next_tsn = htonl(receiver_tsn);
|
|
|
+
|
|
|
+ sctp_addto_chunk(retval, sizeof(tsnresp), &tsnresp);
|
|
|
+
|
|
|
+ return retval;
|
|
|
+}
|