Squashed 'third_party/rawrtc/rawrtc-data-channel/' content from commit 7b1b8d57c
Change-Id: I84850720e2b51961981d55f67238f4d282314fff
git-subtree-dir: third_party/rawrtc/rawrtc-data-channel
git-subtree-split: 7b1b8d57c6d07da18cc0de8bbca8cc5e8bd06eae
diff --git a/src/sctp_capabilities/attributes.c b/src/sctp_capabilities/attributes.c
new file mode 100644
index 0000000..f84ff70
--- /dev/null
+++ b/src/sctp_capabilities/attributes.c
@@ -0,0 +1,23 @@
+#include "capabilities.h"
+#include <rawrtcdc/sctp_capabilities.h>
+#include <rawrtcc/code.h>
+#include <re.h>
+
+/*
+ * Get the SCTP parameter's maximum message size value.
+ *
+ * Note: A value of `0` indicates that the implementation supports
+ * receiving messages of arbitrary size.
+ */
+enum rawrtc_code rawrtc_sctp_capabilities_get_max_message_size(
+ uint64_t* const max_message_sizep, // de-referenced
+ struct rawrtc_sctp_capabilities* const capabilities) {
+ // Check arguments
+ if (!capabilities) {
+ return RAWRTC_CODE_INVALID_ARGUMENT;
+ }
+
+ // Set value
+ *max_message_sizep = capabilities->max_message_size;
+ return RAWRTC_CODE_SUCCESS;
+}