annotate libpurple/protocols/jabber/jingle/iceudp.c @ 26119:36c7efb85220

Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Tue, 24 Feb 2009 23:36:51 +0000
parents 84ea07648377
children dfb6fbd89ac2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
1 /**
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
2 * @file iceudp.c
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
3 *
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
4 * purple
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
5 *
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
9 * (at your option) any later version.
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
10 *
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
14 * GNU General Public License for more details.
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
15 *
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
19 */
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
20
26010
db517c55c508 Make it compile in Windows with the equivalent of --disable-vv.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 24966
diff changeset
21 #include "internal.h"
db517c55c508 Make it compile in Windows with the equivalent of --disable-vv.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 24966
diff changeset
22
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
23 #include "iceudp.h"
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
24 #include "jingle.h"
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
25 #include "debug.h"
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
26
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
27 #include <string.h>
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
28
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
29 struct _JingleIceUdpPrivate
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
30 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
31 GList *local_candidates;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
32 GList *remote_candidates;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
33 };
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
34
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
35 #define JINGLE_ICEUDP_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), JINGLE_TYPE_ICEUDP, JingleIceUdpPrivate))
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
36
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
37 static void jingle_iceudp_class_init (JingleIceUdpClass *klass);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
38 static void jingle_iceudp_init (JingleIceUdp *iceudp);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
39 static void jingle_iceudp_finalize (GObject *object);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
40 static void jingle_iceudp_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
41 static void jingle_iceudp_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
42 static JingleTransport *jingle_iceudp_parse_internal(xmlnode *iceudp);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
43 static xmlnode *jingle_iceudp_to_xml_internal(JingleTransport *transport, xmlnode *content, JingleActionType action);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
44
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
45 static JingleTransportClass *parent_class = NULL;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
46
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
47 enum {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
48 PROP_0,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
49 PROP_LOCAL_CANDIDATES,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
50 PROP_REMOTE_CANDIDATES,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
51 };
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
52
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
53 static JingleIceUdpCandidate *
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
54 jingle_iceudp_candidate_copy(JingleIceUdpCandidate *candidate)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
55 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
56 JingleIceUdpCandidate *new_candidate = g_new0(JingleIceUdpCandidate, 1);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
57 new_candidate->component = candidate->component;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
58 new_candidate->foundation = g_strdup(candidate->foundation);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
59 new_candidate->generation = candidate->generation;
26097
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
60 new_candidate->id = g_strdup(candidate->id);
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
61 new_candidate->ip = g_strdup(candidate->ip);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
62 new_candidate->network = candidate->network;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
63 new_candidate->port = candidate->port;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
64 new_candidate->priority = candidate->priority;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
65 new_candidate->protocol = g_strdup(candidate->protocol);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
66 new_candidate->type = g_strdup(candidate->type);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
67
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
68 new_candidate->username = g_strdup(candidate->username);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
69 new_candidate->password = g_strdup(candidate->password);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
70
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
71 return new_candidate;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
72 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
73
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
74 static void
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
75 jingle_iceudp_candidate_free(JingleIceUdpCandidate *candidate)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
76 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
77 g_free(candidate->foundation);
26097
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
78 g_free(candidate->id);
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
79 g_free(candidate->ip);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
80 g_free(candidate->protocol);
26119
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
81 g_free(candidate->reladdr);
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
82 g_free(candidate->type);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
83
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
84 g_free(candidate->username);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
85 g_free(candidate->password);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
86 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
87
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
88 GType
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
89 jingle_iceudp_candidate_get_type()
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
90 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
91 static GType type = 0;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
92
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
93 if (type == 0) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
94 type = g_boxed_type_register_static("JingleIceUdpCandidate",
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
95 (GBoxedCopyFunc)jingle_iceudp_candidate_copy,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
96 (GBoxedFreeFunc)jingle_iceudp_candidate_free);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
97 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
98 return type;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
99 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
100
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
101 JingleIceUdpCandidate *
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
102 jingle_iceudp_candidate_new(guint component, const gchar *foundation,
26097
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
103 guint generation, const gchar *id, const gchar *ip,
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
104 guint network, guint port, guint priority,
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
105 const gchar *protocol, const gchar *type,
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
106 const gchar *username, const gchar *password)
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
107 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
108 JingleIceUdpCandidate *candidate = g_new0(JingleIceUdpCandidate, 1);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
109 candidate->component = component;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
110 candidate->foundation = g_strdup(foundation);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
111 candidate->generation = generation;
26097
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
112 candidate->id = g_strdup(id);
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
113 candidate->ip = g_strdup(ip);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
114 candidate->network = network;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
115 candidate->port = port;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
116 candidate->priority = priority;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
117 candidate->protocol = g_strdup(protocol);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
118 candidate->type = g_strdup(type);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
119
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
120 candidate->username = g_strdup(username);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
121 candidate->password = g_strdup(password);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
122 return candidate;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
123 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
124
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
125 GType
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
126 jingle_iceudp_get_type()
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
127 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
128 static GType type = 0;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
129
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
130 if (type == 0) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
131 static const GTypeInfo info = {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
132 sizeof(JingleIceUdpClass),
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
133 NULL,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
134 NULL,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
135 (GClassInitFunc) jingle_iceudp_class_init,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
136 NULL,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
137 NULL,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
138 sizeof(JingleIceUdp),
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
139 0,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
140 (GInstanceInitFunc) jingle_iceudp_init,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
141 NULL
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
142 };
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
143 type = g_type_register_static(JINGLE_TYPE_TRANSPORT, "JingleIceUdp", &info, 0);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
144 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
145 return type;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
146 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
147
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
148 static void
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
149 jingle_iceudp_class_init (JingleIceUdpClass *klass)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
150 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
151 GObjectClass *gobject_class = (GObjectClass*)klass;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
152 parent_class = g_type_class_peek_parent(klass);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
153
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
154 gobject_class->finalize = jingle_iceudp_finalize;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
155 gobject_class->set_property = jingle_iceudp_set_property;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
156 gobject_class->get_property = jingle_iceudp_get_property;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
157 klass->parent_class.to_xml = jingle_iceudp_to_xml_internal;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
158 klass->parent_class.parse = jingle_iceudp_parse_internal;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
159 klass->parent_class.transport_type = JINGLE_TRANSPORT_ICEUDP;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
160
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
161 g_object_class_install_property(gobject_class, PROP_LOCAL_CANDIDATES,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
162 g_param_spec_pointer("local-candidates",
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
163 "Local candidates",
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
164 "The local candidates for this transport.",
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
165 G_PARAM_READABLE));
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
166
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
167 g_object_class_install_property(gobject_class, PROP_REMOTE_CANDIDATES,
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
168 g_param_spec_pointer("remote-candidates",
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
169 "Remote candidates",
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
170 "The remote candidates for this transport.",
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
171 G_PARAM_READABLE));
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
172
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
173 g_type_class_add_private(klass, sizeof(JingleIceUdpPrivate));
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
174 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
175
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
176 static void
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
177 jingle_iceudp_init (JingleIceUdp *iceudp)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
178 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
179 iceudp->priv = JINGLE_ICEUDP_GET_PRIVATE(iceudp);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
180 memset(iceudp->priv, 0, sizeof(iceudp->priv));
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
181 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
182
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
183 static void
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
184 jingle_iceudp_finalize (GObject *iceudp)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
185 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
186 /* JingleIceUdpPrivate *priv = JINGLE_ICEUDP_GET_PRIVATE(iceudp); */
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
187 purple_debug_info("jingle","jingle_iceudp_finalize\n");
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
188 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
189
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
190 static void
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
191 jingle_iceudp_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
192 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
193 JingleIceUdp *iceudp;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
194 g_return_if_fail(JINGLE_IS_ICEUDP(object));
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
195
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
196 iceudp = JINGLE_ICEUDP(object);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
197
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
198 switch (prop_id) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
199 case PROP_LOCAL_CANDIDATES:
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
200 iceudp->priv->local_candidates =
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
201 g_value_get_pointer(value);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
202 break;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
203 case PROP_REMOTE_CANDIDATES:
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
204 iceudp->priv->remote_candidates =
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
205 g_value_get_pointer(value);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
206 break;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
207 default:
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
208 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
209 break;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
210 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
211 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
212
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
213 static void
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
214 jingle_iceudp_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
215 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
216 JingleIceUdp *iceudp;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
217 g_return_if_fail(JINGLE_IS_ICEUDP(object));
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
218
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
219 iceudp = JINGLE_ICEUDP(object);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
220
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
221 switch (prop_id) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
222 case PROP_LOCAL_CANDIDATES:
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
223 g_value_set_pointer(value, iceudp->priv->local_candidates);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
224 break;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
225 case PROP_REMOTE_CANDIDATES:
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
226 g_value_set_pointer(value, iceudp->priv->remote_candidates);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
227 break;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
228 default:
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
229 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
230 break;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
231 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
232 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
233
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
234 void
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
235 jingle_iceudp_add_local_candidate(JingleIceUdp *iceudp, JingleIceUdpCandidate *candidate)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
236 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
237 GList *iter = iceudp->priv->local_candidates;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
238
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
239 for (; iter; iter = g_list_next(iter)) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
240 JingleIceUdpCandidate *c = iter->data;
26097
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
241 if (!strcmp(c->id, candidate->id)) {
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
242 guint generation = c->generation + 1;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
243
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
244 g_boxed_free(JINGLE_TYPE_ICEUDP_CANDIDATE, c);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
245 iceudp->priv->local_candidates = g_list_delete_link(
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
246 iceudp->priv->local_candidates, iter);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
247
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
248 candidate->generation = generation;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
249
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
250 iceudp->priv->local_candidates = g_list_append(
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
251 iceudp->priv->local_candidates, candidate);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
252 return;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
253 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
254 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
255
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
256 iceudp->priv->local_candidates = g_list_append(
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
257 iceudp->priv->local_candidates, candidate);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
258 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
259
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
260 GList *
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
261 jingle_iceudp_get_remote_candidates(JingleIceUdp *iceudp)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
262 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
263 return g_list_copy(iceudp->priv->remote_candidates);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
264 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
265
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
266 static JingleIceUdpCandidate *
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
267 jingle_iceudp_get_remote_candidate_by_id(JingleIceUdp *iceudp,
26097
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
268 const gchar *id)
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
269 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
270 GList *iter = iceudp->priv->remote_candidates;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
271 for (; iter; iter = g_list_next(iter)) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
272 JingleIceUdpCandidate *candidate = iter->data;
26097
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
273 if (!strcmp(candidate->id, id)) {
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
274 return candidate;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
275 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
276 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
277 return NULL;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
278 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
279
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
280 static void
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
281 jingle_iceudp_add_remote_candidate(JingleIceUdp *iceudp, JingleIceUdpCandidate *candidate)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
282 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
283 JingleIceUdpPrivate *priv = JINGLE_ICEUDP_GET_PRIVATE(iceudp);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
284 JingleIceUdpCandidate *iceudp_candidate =
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
285 jingle_iceudp_get_remote_candidate_by_id(iceudp,
26097
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
286 candidate->id);
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
287 if (iceudp_candidate != NULL) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
288 priv->remote_candidates = g_list_remove(
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
289 priv->remote_candidates, iceudp_candidate);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
290 g_boxed_free(JINGLE_TYPE_ICEUDP_CANDIDATE, iceudp_candidate);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
291 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
292 priv->remote_candidates = g_list_append(priv->remote_candidates, candidate);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
293 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
294
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
295 static JingleTransport *
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
296 jingle_iceudp_parse_internal(xmlnode *iceudp)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
297 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
298 JingleTransport *transport = parent_class->parse(iceudp);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
299 xmlnode *candidate = xmlnode_get_child(iceudp, "candidate");
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
300 JingleIceUdpCandidate *iceudp_candidate = NULL;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
301
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
302 const gchar *username = xmlnode_get_attrib(iceudp, "ufrag");
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
303 const gchar *password = xmlnode_get_attrib(iceudp, "pwd");
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
304
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
305 for (; candidate; candidate = xmlnode_get_next_twin(candidate)) {
26119
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
306 const gchar *relport =
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
307 xmlnode_get_attrib(candidate, "rel-port");
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
308 iceudp_candidate = jingle_iceudp_candidate_new(
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
309 atoi(xmlnode_get_attrib(candidate, "component")),
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
310 xmlnode_get_attrib(candidate, "foundation"),
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
311 atoi(xmlnode_get_attrib(candidate, "generation")),
26097
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
312 xmlnode_get_attrib(candidate, "id"),
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
313 xmlnode_get_attrib(candidate, "ip"),
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
314 atoi(xmlnode_get_attrib(candidate, "network")),
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
315 atoi(xmlnode_get_attrib(candidate, "port")),
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
316 atoi(xmlnode_get_attrib(candidate, "priority")),
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
317 xmlnode_get_attrib(candidate, "protocol"),
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
318 xmlnode_get_attrib(candidate, "type"),
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
319 username, password);
26119
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
320 iceudp_candidate->reladdr = g_strdup(
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
321 xmlnode_get_attrib(candidate, "rel-addr"));
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
322 iceudp_candidate->relport =
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
323 relport != NULL ? atoi(relport) : 0;
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
324 jingle_iceudp_add_remote_candidate(JINGLE_ICEUDP(transport), iceudp_candidate);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
325 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
326
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
327 return transport;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
328 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
329
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
330 static xmlnode *
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
331 jingle_iceudp_to_xml_internal(JingleTransport *transport, xmlnode *content, JingleActionType action)
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
332 {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
333 xmlnode *node = parent_class->to_xml(transport, content, action);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
334
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
335 if (action == JINGLE_SESSION_INITIATE || action == JINGLE_TRANSPORT_INFO ||
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
336 action == JINGLE_CONTENT_ADD || action == JINGLE_TRANSPORT_REPLACE) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
337 JingleIceUdpCandidate *candidate = JINGLE_ICEUDP_GET_PRIVATE(
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
338 transport)->local_candidates->data;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
339 xmlnode_set_attrib(node, "pwd", candidate->password);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
340 xmlnode_set_attrib(node, "ufrag", candidate->username);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
341 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
342
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
343 if (action == JINGLE_TRANSPORT_INFO || action == JINGLE_SESSION_ACCEPT) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
344 JingleIceUdpPrivate *priv = JINGLE_ICEUDP_GET_PRIVATE(transport);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
345 GList *iter = priv->local_candidates;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
346
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
347 for (; iter; iter = g_list_next(iter)) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
348 JingleIceUdpCandidate *candidate = iter->data;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
349
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
350 xmlnode *xmltransport = xmlnode_new_child(node, "candidate");
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
351 gchar *component = g_strdup_printf("%d", candidate->component);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
352 gchar *generation = g_strdup_printf("%d", candidate->generation);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
353 gchar *network = g_strdup_printf("%d", candidate->network);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
354 gchar *port = g_strdup_printf("%d", candidate->port);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
355 gchar *priority = g_strdup_printf("%d", candidate->priority);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
356
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
357 xmlnode_set_attrib(xmltransport, "component", component);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
358 xmlnode_set_attrib(xmltransport, "foundation", candidate->foundation);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
359 xmlnode_set_attrib(xmltransport, "generation", generation);
26097
84ea07648377 Add the id attribute to ice-udp according to the XEP.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26010
diff changeset
360 xmlnode_set_attrib(xmltransport, "id", candidate->id);
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
361 xmlnode_set_attrib(xmltransport, "ip", candidate->ip);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
362 xmlnode_set_attrib(xmltransport, "network", network);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
363 xmlnode_set_attrib(xmltransport, "port", port);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
364 xmlnode_set_attrib(xmltransport, "priority", priority);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
365 xmlnode_set_attrib(xmltransport, "protocol", candidate->protocol);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
366
26119
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
367 if (candidate->reladdr != NULL &&
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
368 (strcmp(candidate->ip, candidate->reladdr) ||
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
369 (candidate->port != candidate->relport))) {
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
370 gchar *relport = g_strdup_printf("%d",
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
371 candidate->relport);
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
372 xmlnode_set_attrib(xmltransport, "rel-addr",
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
373 candidate->reladdr);
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
374 xmlnode_set_attrib(xmltransport, "rel-port",
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
375 relport);
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
376 g_free(relport);
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
377 }
36c7efb85220 Use the correct values for Jingle Ice-Udp's rel-addr and rel-port.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26097
diff changeset
378
24966
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
379 if (action == JINGLE_SESSION_ACCEPT) {
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
380 /* XXX: fix this, it's dummy data */
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
381 xmlnode_set_attrib(xmltransport, "rem-addr", "192.0.2.1");
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
382 xmlnode_set_attrib(xmltransport, "rem-port", "3478");
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
383 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
384
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
385 xmlnode_set_attrib(xmltransport, "type", candidate->type);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
386
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
387 g_free(component);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
388 g_free(generation);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
389 g_free(network);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
390 g_free(port);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
391 g_free(priority);
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
392 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
393 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
394
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
395 return node;
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
396 }
bee5ab815291 Added a Jingle ice-udp transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
397