aboutsummaryrefslogtreecommitdiff
path: root/plugins/ice/src/util.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2021-03-21 12:41:27 +0100
committerMarvin W <git@larma.de>2021-03-21 12:41:27 +0100
commitd703b7c09d5eea81ec383fd09c9d320199e6d577 (patch)
tree23a89c8324d145c750b5be354188352fb693bc4b /plugins/ice/src/util.vala
parentf328bf93fbdd8e99a2fa27757a07223473fff4a5 (diff)
downloaddino-d703b7c09d5eea81ec383fd09c9d320199e6d577.tar.gz
dino-d703b7c09d5eea81ec383fd09c9d320199e6d577.zip
Add libnice-based ICE-UDP implementation as plugin
Diffstat (limited to 'plugins/ice/src/util.vala')
-rw-r--r--plugins/ice/src/util.vala18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/ice/src/util.vala b/plugins/ice/src/util.vala
new file mode 100644
index 00000000..dd89d2f4
--- /dev/null
+++ b/plugins/ice/src/util.vala
@@ -0,0 +1,18 @@
+using Gee;
+
+namespace Dino.Plugins.Ice {
+
+internal static bool is_component_ready(Nice.Agent agent, uint stream_id, uint component_id) {
+ var state = agent.get_component_state(stream_id, component_id);
+ return state == Nice.ComponentState.CONNECTED || state == Nice.ComponentState.READY;
+}
+
+internal Gee.List<string> get_local_ip_addresses() {
+ Gee.List<string> result = new ArrayList<string>();
+ foreach (string ip_address in Nice.interfaces_get_local_ips(false)) {
+ result.add(ip_address);
+ }
+ return result;
+}
+
+} \ No newline at end of file