Squashed 'third_party/rawrtc/rawrtc/' content from commit aa3ae4b24
Change-Id: I38a655a4259b62f591334e90a1315bd4e7e4d8ec
git-subtree-dir: third_party/rawrtc/rawrtc
git-subtree-split: aa3ae4b247275cc6e69c30613b3a4ba7fdc82d1b
diff --git a/include/rawrtc/ice_gather_options.h b/include/rawrtc/ice_gather_options.h
new file mode 100644
index 0000000..d850eb5
--- /dev/null
+++ b/include/rawrtc/ice_gather_options.h
@@ -0,0 +1,57 @@
+#pragma once
+#include <rawrtcc/code.h>
+#include <re.h>
+
+/*
+ * ICE gather policy.
+ */
+enum rawrtc_ice_gather_policy {
+ RAWRTC_ICE_GATHER_POLICY_ALL,
+ RAWRTC_ICE_GATHER_POLICY_NOHOST,
+ RAWRTC_ICE_GATHER_POLICY_RELAY,
+};
+
+/*
+ * ICE credential type
+ */
+enum rawrtc_ice_credential_type {
+ RAWRTC_ICE_CREDENTIAL_TYPE_NONE,
+ RAWRTC_ICE_CREDENTIAL_TYPE_PASSWORD,
+ RAWRTC_ICE_CREDENTIAL_TYPE_TOKEN,
+};
+
+/*
+ * ICE gather options.
+ */
+struct rawrtc_ice_gather_options;
+
+/*
+ * Create a new ICE gather options instance.
+ * `*optionsp` must be unreferenced.
+ */
+enum rawrtc_code rawrtc_ice_gather_options_create(
+ struct rawrtc_ice_gather_options** const optionsp, // de-referenced
+ enum rawrtc_ice_gather_policy const gather_policy);
+
+/*
+ * Add an ICE server to the gather options.
+ */
+enum rawrtc_code rawrtc_ice_gather_options_add_server(
+ struct rawrtc_ice_gather_options* const options,
+ char* const* const urls, // copied
+ size_t const n_urls,
+ char* const username, // nullable, copied
+ char* const credential, // nullable, copied
+ enum rawrtc_ice_credential_type const credential_type);
+
+/*
+ * Translate an ICE gather policy to str.
+ */
+char const* rawrtc_ice_gather_policy_to_str(enum rawrtc_ice_gather_policy const policy);
+
+/*
+ * Translate a str to an ICE gather policy (case-insensitive).
+ */
+enum rawrtc_code rawrtc_str_to_ice_gather_policy(
+ enum rawrtc_ice_gather_policy* const policyp, // de-referenced
+ char const* const str);