55 jingle_socks5_cmp, |
55 jingle_socks5_cmp, |
56 jingle_socks5_new, |
56 jingle_socks5_new, |
57 jingle_socks5_send |
57 jingle_socks5_send |
58 }; |
58 }; |
59 |
59 |
60 module_info_t info_jingle_inbandbytestream = { |
60 module_info_t info_jingle_socks5bytestream = { |
61 .branch = MCABBER_BRANCH, |
61 .branch = MCABBER_BRANCH, |
62 .api = MCABBER_API_VERSION, |
62 .api = MCABBER_API_VERSION, |
63 .version = PROJECT_VERSION, |
63 .version = PROJECT_VERSION, |
64 .description = "Jingle In Band Bytestream (XEP-0261)\n", |
64 .description = "Jingle Socks5 Bytestream (XEP-0260)\n", |
65 .requires = deps, |
65 .requires = deps, |
66 .init = jingle_socks5_init, |
66 .init = jingle_socks5_init, |
67 .uninit = jingle_socks5_uninit, |
67 .uninit = jingle_socks5_uninit, |
68 .next = NULL, |
68 .next = NULL, |
69 }; |
69 }; |
71 |
71 |
72 const gchar* jingle_socks5_xmlns(void) |
72 const gchar* jingle_socks5_xmlns(void) |
73 { |
73 { |
74 return NS_JINGLE_TRANSPORT_SOCKS5; |
74 return NS_JINGLE_TRANSPORT_SOCKS5; |
75 } |
75 } |
|
76 |
|
77 gconstpointer jingle_socks5_check(JingleContent *cn, GError **err) |
|
78 { |
|
79 JingleSocks5 *js5b = NULL; |
|
80 JingleCandidate *jc; |
|
81 |
|
82 LmMessageNode *node = cn->transport, *node2; |
|
83 |
|
84 js5b = g_new0(JingleSocks5, 1); |
|
85 |
|
86 js5b->mode = lm_message_node_get_attribute(node, "mode"); |
|
87 js5b->sid = lm_message_node_get_attribute(node, "sid"); |
|
88 |
|
89 if (!js5b->sid) { |
|
90 g_set_error(err, JINGLE_CHECK_ERROR, JINGLE_CHECK_ERROR_MISSING, |
|
91 "an attribute of the transport element is missing"); |
|
92 g_free(js5b); |
|
93 return NULL; |
|
94 } |
|
95 |
|
96 for (node2 = node->children; node2; node2 = node2->next) { |
|
97 if (!g_strcmp0(node->name, "candidate")) { |
|
98 jc = g_new0(JingleCandidate, 1); |
|
99 jc->cid = lm_message_node_get_attribute(node2, "cid"); |
|
100 jc->host = lm_message_node_get_attribute(node2, "host"); |
|
101 jc->jid = lm_message_node_get_attribute(node2, "jid"); |
|
102 jc->port = g_ascii_strtoull(lm_message_node_get_attribute(node2, "port"), NULL, 10); |
|
103 jc->priority = g_ascii_strtoull(lm_message_node_get_attribute(node2, "priority"), NULL, 10); |
|
104 //jc->type = |
|
105 |
|
106 js5b->candidates = g_slist_append(js5b->candidates, jc); |
|
107 } |
|
108 } |
|
109 |
|
110 return (gconstpointer) js5b; |
|
111 |
|
112 } |
|
113 |
76 |
114 |
77 static void jingle_socks5_init(void) |
115 static void jingle_socks5_init(void) |
78 { |
116 { |
79 jingle_register_transport(NS_JINGLE_TRANSPORT_SOCKS5, &funcs, |
117 jingle_register_transport(NS_JINGLE_TRANSPORT_SOCKS5, &funcs, |
80 JINGLE_TRANSPORT_STREAMING, |
118 JINGLE_TRANSPORT_STREAMING, |