/* transport_parameters.c generated by valac 0.56.19, the Vala compiler
 * generated from transport_parameters.vala, do not modify */

#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <glib-object.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_0_PROPERTY,
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_NS_URI_PROPERTY,
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_PWD_PROPERTY,
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_UFRAG_PROPERTY,
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_PWD_PROPERTY,
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_UFRAG_PROPERTY,
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_FULL_JID_PROPERTY,
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_PEER_FULL_JID_PROPERTY,
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_COMPONENTS_PROPERTY,
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_INCOMING_PROPERTY,
	XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
#define _xmpp_xep_jingle_ice_udp_candidate_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_jingle_ice_udp_candidate_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

struct _XmppXepJingleIceUdpIceUdpTransportParametersPrivate {
	gchar* _remote_pwd;
	gchar* _remote_ufrag;
	gchar* _local_pwd;
	gchar* _local_ufrag;
	XmppJid* _local_full_jid;
	XmppJid* _peer_full_jid;
	guint8 components_;
	gboolean _incoming;
	gboolean connection_created;
};

static gint XmppXepJingleIceUdpIceUdpTransportParameters_private_offset;
static gpointer xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_parent_class = NULL;
static XmppXepJingleTransportParametersIface * xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_xmpp_xep_jingle_transport_parameters_parent_iface = NULL;

static gboolean _xmpp_xep_jingle_ice_udp_candidate_equals_func_gee_equal_data_func (gconstpointer a,
                                                                             gconstpointer b,
                                                                             gpointer self);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_full_jid (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                              XmppJid* value);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_peer_full_jid (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                             XmppJid* value);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_incoming (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                        gboolean value);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_pwd (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                          const gchar* value);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_ufrag (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                            const gchar* value);
static guint8* xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_fingerprint_to_bytes (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                                   const gchar* fingerprint_,
                                                                                   gint* result_length1);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_ufrag (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                           const gchar* value);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_pwd (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                         const gchar* value);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_set_content (XmppXepJingleTransportParameters* base,
                                                                            XmppXepJingleContent* content);
static void _xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_unset_content_gweak_notify (gpointer self,
                                                                                       GObject* object);
static XmppStanzaNode* xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_to_transport_stanza_node (XmppXepJingleTransportParameters* base,
                                                                                                    const gchar* action_type);
static gchar* xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_format_fingerprint (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                                guint8* fingerprint,
                                                                                gint fingerprint_length1);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_handle_transport_accept (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                                        XmppStanzaNode* node,
                                                                                        GError** error);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_handle_transport_info (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                                      XmppStanzaNode* node,
                                                                                      GError** error);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_create_transport_connection (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                                            XmppXmppStream* stream,
                                                                                            XmppXepJingleContent* content);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_check_send_transport_info (XmppXepJingleIceUdpIceUdpTransportParameters* self);
static gboolean ___lambda25_ (XmppXepJingleIceUdpIceUdpTransportParameters* self);
static gboolean ____lambda25__gsource_func (gpointer self);
static void xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_finalize (GObject * obj);
static GType xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_type_once (void);
static void _vala_xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_property (GObject * object,
                                                                              guint property_id,
                                                                              GValue * value,
                                                                              GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_property (GObject * object,
                                                                              guint property_id,
                                                                              const GValue * value,
                                                                              GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_instance_private (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleIceUdpIceUdpTransportParameters_private_offset);
}

static gboolean
_xmpp_xep_jingle_ice_udp_candidate_equals_func_gee_equal_data_func (gconstpointer a,
                                                                    gconstpointer b,
                                                                    gpointer self)
{
	gboolean result;
	result = xmpp_xep_jingle_ice_udp_candidate_equals_func ((XmppXepJingleIceUdpCandidate*) a, (XmppXepJingleIceUdpCandidate*) b);
	return result;
}

XmppXepJingleIceUdpIceUdpTransportParameters*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_construct (GType object_type,
                                                                guint8 components,
                                                                XmppJid* local_full_jid,
                                                                XmppJid* peer_full_jid,
                                                                XmppStanzaNode* node)
{
	XmppXepJingleIceUdpIceUdpTransportParameters * self = NULL;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	self = (XmppXepJingleIceUdpIceUdpTransportParameters*) g_object_new (object_type, NULL);
	self->priv->components_ = components;
	xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_full_jid (self, local_full_jid);
	xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_peer_full_jid (self, peer_full_jid);
	if (node != NULL) {
		const gchar* _tmp0_;
		const gchar* _tmp1_;
		XmppStanzaNode* fingerprint_node = NULL;
		XmppStanzaNode* _tmp14_;
		XmppStanzaNode* _tmp15_;
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_incoming (self, TRUE);
		_tmp0_ = xmpp_stanza_node_get_attribute (node, "pwd", NULL);
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_pwd (self, _tmp0_);
		_tmp1_ = xmpp_stanza_node_get_attribute (node, "ufrag", NULL);
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_ufrag (self, _tmp1_);
		{
			GeeList* _candidateNode_list = NULL;
			GeeList* _tmp2_;
			gint _candidateNode_size = 0;
			GeeList* _tmp3_;
			gint _tmp4_;
			gint _tmp5_;
			gint _candidateNode_index = 0;
			_tmp2_ = xmpp_stanza_node_get_subnodes (node, "candidate", NULL, FALSE);
			_candidateNode_list = _tmp2_;
			_tmp3_ = _candidateNode_list;
			_tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_);
			_tmp5_ = _tmp4_;
			_candidateNode_size = _tmp5_;
			_candidateNode_index = -1;
			while (TRUE) {
				gint _tmp6_;
				gint _tmp7_;
				XmppStanzaNode* candidateNode = NULL;
				GeeList* _tmp8_;
				gpointer _tmp9_;
				XmppXepJingleIceUdpCandidate* _tmp10_ = NULL;
				XmppStanzaNode* _tmp11_;
				XmppXepJingleIceUdpCandidate* _tmp12_;
				GeeList* _tmp13_;
				_candidateNode_index = _candidateNode_index + 1;
				_tmp6_ = _candidateNode_index;
				_tmp7_ = _candidateNode_size;
				if (!(_tmp6_ < _tmp7_)) {
					break;
				}
				_tmp8_ = _candidateNode_list;
				_tmp9_ = gee_list_get (_tmp8_, _candidateNode_index);
				candidateNode = (XmppStanzaNode*) _tmp9_;
				_tmp11_ = candidateNode;
				_tmp12_ = xmpp_xep_jingle_ice_udp_candidate_parse (_tmp11_, &_inner_error0_);
				_tmp10_ = _tmp12_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_xmpp_stanza_entry_unref0 (candidateNode);
					_g_object_unref0 (_candidateNode_list);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
				_tmp13_ = self->remote_candidates;
				gee_collection_add ((GeeCollection*) _tmp13_, _tmp10_);
				_xmpp_xep_jingle_ice_udp_candidate_unref0 (_tmp10_);
				_xmpp_stanza_entry_unref0 (candidateNode);
			}
			_g_object_unref0 (_candidateNode_list);
		}
		_tmp14_ = xmpp_stanza_node_get_subnode (node, "fingerprint", XMPP_XEP_JINGLE_ICE_UDP_DTLS_NS_URI, FALSE);
		fingerprint_node = _tmp14_;
		_tmp15_ = fingerprint_node;
		if (_tmp15_ != NULL) {
			XmppStanzaNode* _tmp16_;
			const gchar* _tmp17_;
			gint _tmp18_ = 0;
			guint8* _tmp19_;
			XmppStanzaNode* _tmp20_;
			const gchar* _tmp21_;
			gchar* _tmp22_;
			XmppStanzaNode* _tmp23_;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			_tmp16_ = fingerprint_node;
			_tmp17_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp16_);
			_tmp19_ = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_fingerprint_to_bytes (self, _tmp17_, &_tmp18_);
			self->peer_fingerprint = (g_free (self->peer_fingerprint), NULL);
			self->peer_fingerprint = _tmp19_;
			self->peer_fingerprint_length1 = _tmp18_;
			_tmp20_ = fingerprint_node;
			_tmp21_ = xmpp_stanza_node_get_attribute (_tmp20_, "hash", NULL);
			_tmp22_ = g_strdup (_tmp21_);
			_g_free0 (self->peer_fp_algo);
			self->peer_fp_algo = _tmp22_;
			_tmp23_ = fingerprint_node;
			_tmp24_ = xmpp_stanza_node_get_attribute (_tmp23_, "setup", NULL);
			_tmp25_ = g_strdup (_tmp24_);
			_g_free0 (self->peer_setup);
			self->peer_setup = _tmp25_;
		}
		_xmpp_stanza_entry_unref0 (fingerprint_node);
	}
	return self;
}

void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_init (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                           const gchar* ufrag,
                                                           const gchar* pwd)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (ufrag != NULL);
	g_return_if_fail (pwd != NULL);
	xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_ufrag (self, ufrag);
	xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_pwd (self, pwd);
	g_debug ("transport_parameters.vala:57: Initialized for %s", pwd);
}

static void
_xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_unset_content_gweak_notify (gpointer self,
                                                                                  GObject* object)
{
	xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_unset_content ((XmppXepJingleIceUdpIceUdpTransportParameters*) self);
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_set_content (XmppXepJingleTransportParameters* base,
                                                                       XmppXepJingleContent* content)
{
	XmppXepJingleIceUdpIceUdpTransportParameters * self;
	XmppXepJingleContent* _tmp0_;
	self = (XmppXepJingleIceUdpIceUdpTransportParameters*) base;
	g_return_if_fail (content != NULL);
	self->content = content;
	_tmp0_ = self->content;
	g_object_weak_ref ((GObject*) _tmp0_, _xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_unset_content_gweak_notify, self);
}

void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_unset_content (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	g_return_if_fail (self != NULL);
	self->content = NULL;
}

static XmppStanzaNode*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_to_transport_stanza_node (XmppXepJingleTransportParameters* base,
                                                                                    const gchar* action_type)
{
	XmppXepJingleIceUdpIceUdpTransportParameters * self;
	XmppStanzaNode* node = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	const gchar* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	const gchar* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppStanzaNode* _tmp9_;
	gboolean _tmp10_ = FALSE;
	guint8* _tmp11_;
	gint _tmp11__length1;
	XmppStanzaNode* result;
	self = (XmppXepJingleIceUdpIceUdpTransportParameters*) base;
	g_return_val_if_fail (action_type != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_new_build ("transport", XMPP_XEP_JINGLE_ICE_UDP_NS_URI, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_stanza_node_add_self_xmlns (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->_local_ufrag;
	_tmp5_ = xmpp_stanza_node_put_attribute (_tmp3_, "ufrag", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->_local_pwd;
	_tmp8_ = xmpp_stanza_node_put_attribute (_tmp6_, "pwd", _tmp7_, NULL);
	_tmp9_ = _tmp8_;
	_xmpp_stanza_entry_unref0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (_tmp3_);
	_xmpp_stanza_entry_unref0 (_tmp1_);
	node = _tmp9_;
	_tmp11_ = self->own_fingerprint;
	_tmp11__length1 = self->own_fingerprint_length1;
	if (_tmp11_ != NULL) {
		_tmp10_ = g_strcmp0 (action_type, "transport-info") != 0;
	} else {
		_tmp10_ = FALSE;
	}
	if (_tmp10_) {
		XmppStanzaNode* fingerprint_node = NULL;
		XmppStanzaNode* _tmp12_;
		XmppStanzaNode* _tmp13_;
		XmppStanzaNode* _tmp14_;
		XmppStanzaNode* _tmp15_;
		XmppStanzaNode* _tmp16_;
		XmppStanzaNode* _tmp17_;
		guint8* _tmp18_;
		gint _tmp18__length1;
		gchar* _tmp19_;
		gchar* _tmp20_;
		XmppStanzaNode* _tmp21_;
		XmppStanzaNode* _tmp22_;
		XmppStanzaNode* _tmp23_;
		XmppStanzaNode* _tmp24_;
		XmppStanzaNode* _tmp25_;
		const gchar* _tmp26_;
		XmppStanzaNode* _tmp27_;
		XmppStanzaNode* _tmp28_;
		XmppStanzaNode* _tmp29_;
		XmppStanzaNode* _tmp30_;
		XmppStanzaNode* _tmp31_;
		XmppStanzaNode* _tmp32_;
		_tmp12_ = xmpp_stanza_node_new_build ("fingerprint", XMPP_XEP_JINGLE_ICE_UDP_DTLS_NS_URI, NULL, NULL);
		_tmp13_ = _tmp12_;
		_tmp14_ = xmpp_stanza_node_add_self_xmlns (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = xmpp_stanza_node_put_attribute (_tmp15_, "hash", "sha-256", NULL);
		_tmp17_ = _tmp16_;
		_tmp18_ = self->own_fingerprint;
		_tmp18__length1 = self->own_fingerprint_length1;
		_tmp19_ = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_format_fingerprint (self, _tmp18_, (gint) _tmp18__length1);
		_tmp20_ = _tmp19_;
		_tmp21_ = xmpp_stanza_node_new_text (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = xmpp_stanza_node_put_node (_tmp17_, _tmp22_);
		_tmp24_ = _tmp23_;
		_xmpp_stanza_entry_unref0 (_tmp22_);
		_g_free0 (_tmp20_);
		_xmpp_stanza_entry_unref0 (_tmp17_);
		_xmpp_stanza_entry_unref0 (_tmp15_);
		_xmpp_stanza_entry_unref0 (_tmp13_);
		fingerprint_node = _tmp24_;
		_tmp25_ = fingerprint_node;
		_tmp26_ = self->own_setup;
		_tmp27_ = xmpp_stanza_node_put_attribute (_tmp25_, "setup", _tmp26_, NULL);
		_tmp28_ = _tmp27_;
		_xmpp_stanza_entry_unref0 (_tmp28_);
		_tmp29_ = node;
		_tmp30_ = fingerprint_node;
		_tmp31_ = xmpp_stanza_node_put_node (_tmp29_, _tmp30_);
		_tmp32_ = _tmp31_;
		_xmpp_stanza_entry_unref0 (_tmp32_);
		_xmpp_stanza_entry_unref0 (fingerprint_node);
	}
	if (g_strcmp0 (action_type, "transport-info") != 0) {
		GeeConcurrentList* _tmp47_;
		{
			GeeConcurrentList* _candidate_list = NULL;
			GeeConcurrentList* _tmp33_;
			gint _candidate_size = 0;
			GeeConcurrentList* _tmp34_;
			gint _tmp35_;
			gint _tmp36_;
			gint _candidate_index = 0;
			_tmp33_ = self->unsent_local_candidates;
			_candidate_list = _tmp33_;
			_tmp34_ = _candidate_list;
			_tmp35_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp34_);
			_tmp36_ = _tmp35_;
			_candidate_size = _tmp36_;
			_candidate_index = -1;
			while (TRUE) {
				gint _tmp37_;
				gint _tmp38_;
				XmppXepJingleIceUdpCandidate* candidate = NULL;
				GeeConcurrentList* _tmp39_;
				gpointer _tmp40_;
				XmppStanzaNode* _tmp41_;
				XmppXepJingleIceUdpCandidate* _tmp42_;
				XmppStanzaNode* _tmp43_;
				XmppStanzaNode* _tmp44_;
				XmppStanzaNode* _tmp45_;
				XmppStanzaNode* _tmp46_;
				_candidate_index = _candidate_index + 1;
				_tmp37_ = _candidate_index;
				_tmp38_ = _candidate_size;
				if (!(_tmp37_ < _tmp38_)) {
					break;
				}
				_tmp39_ = _candidate_list;
				_tmp40_ = gee_abstract_list_get ((GeeAbstractList*) _tmp39_, _candidate_index);
				candidate = (XmppXepJingleIceUdpCandidate*) _tmp40_;
				_tmp41_ = node;
				_tmp42_ = candidate;
				_tmp43_ = xmpp_xep_jingle_ice_udp_candidate_to_xml (_tmp42_);
				_tmp44_ = _tmp43_;
				_tmp45_ = xmpp_stanza_node_put_node (_tmp41_, _tmp44_);
				_tmp46_ = _tmp45_;
				_xmpp_stanza_entry_unref0 (_tmp46_);
				_xmpp_stanza_entry_unref0 (_tmp44_);
				_xmpp_xep_jingle_ice_udp_candidate_unref0 (candidate);
			}
		}
		_tmp47_ = self->unsent_local_candidates;
		gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp47_);
	} else {
		GeeConcurrentList* _tmp48_;
		gboolean _tmp49_;
		gboolean _tmp50_;
		_tmp48_ = self->unsent_local_candidates;
		_tmp49_ = gee_concurrent_list_get_is_empty (_tmp48_);
		_tmp50_ = _tmp49_;
		if (!_tmp50_) {
			XmppXepJingleIceUdpCandidate* candidate = NULL;
			GeeConcurrentList* _tmp51_;
			gpointer _tmp52_;
			XmppStanzaNode* _tmp53_;
			XmppXepJingleIceUdpCandidate* _tmp54_;
			XmppStanzaNode* _tmp55_;
			XmppStanzaNode* _tmp56_;
			XmppStanzaNode* _tmp57_;
			XmppStanzaNode* _tmp58_;
			GeeConcurrentList* _tmp59_;
			XmppXepJingleIceUdpCandidate* _tmp60_;
			_tmp51_ = self->unsent_local_candidates;
			_tmp52_ = gee_list_first ((GeeList*) _tmp51_);
			candidate = (XmppXepJingleIceUdpCandidate*) _tmp52_;
			_tmp53_ = node;
			_tmp54_ = candidate;
			_tmp55_ = xmpp_xep_jingle_ice_udp_candidate_to_xml (_tmp54_);
			_tmp56_ = _tmp55_;
			_tmp57_ = xmpp_stanza_node_put_node (_tmp53_, _tmp56_);
			_tmp58_ = _tmp57_;
			_xmpp_stanza_entry_unref0 (_tmp58_);
			_xmpp_stanza_entry_unref0 (_tmp56_);
			_tmp59_ = self->unsent_local_candidates;
			_tmp60_ = candidate;
			gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp59_, _tmp60_);
			_xmpp_xep_jingle_ice_udp_candidate_unref0 (candidate);
		}
	}
	result = node;
	return result;
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_handle_transport_accept (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                                   XmppStanzaNode* node,
                                                                                   GError** error)
{
	gchar* pwd = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* ufrag = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp6_;
	XmppStanzaNode* fingerprint_node = NULL;
	XmppStanzaNode* _tmp20_;
	XmppStanzaNode* _tmp21_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (node != NULL);
	_tmp0_ = xmpp_stanza_node_get_attribute (node, "pwd", NULL);
	_tmp1_ = g_strdup (_tmp0_);
	pwd = _tmp1_;
	_tmp2_ = xmpp_stanza_node_get_attribute (node, "ufrag", NULL);
	_tmp3_ = g_strdup (_tmp2_);
	ufrag = _tmp3_;
	_tmp4_ = pwd;
	if (_tmp4_ != NULL) {
		const gchar* _tmp5_;
		_tmp5_ = pwd;
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_pwd (self, _tmp5_);
	}
	_tmp6_ = ufrag;
	if (_tmp6_ != NULL) {
		const gchar* _tmp7_;
		_tmp7_ = ufrag;
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_ufrag (self, _tmp7_);
	}
	{
		GeeList* _candidateNode_list = NULL;
		GeeList* _tmp8_;
		gint _candidateNode_size = 0;
		GeeList* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		gint _candidateNode_index = 0;
		_tmp8_ = xmpp_stanza_node_get_subnodes (node, "candidate", NULL, FALSE);
		_candidateNode_list = _tmp8_;
		_tmp9_ = _candidateNode_list;
		_tmp10_ = gee_collection_get_size ((GeeCollection*) _tmp9_);
		_tmp11_ = _tmp10_;
		_candidateNode_size = _tmp11_;
		_candidateNode_index = -1;
		while (TRUE) {
			gint _tmp12_;
			gint _tmp13_;
			XmppStanzaNode* candidateNode = NULL;
			GeeList* _tmp14_;
			gpointer _tmp15_;
			XmppXepJingleIceUdpCandidate* _tmp16_ = NULL;
			XmppStanzaNode* _tmp17_;
			XmppXepJingleIceUdpCandidate* _tmp18_;
			GeeList* _tmp19_;
			_candidateNode_index = _candidateNode_index + 1;
			_tmp12_ = _candidateNode_index;
			_tmp13_ = _candidateNode_size;
			if (!(_tmp12_ < _tmp13_)) {
				break;
			}
			_tmp14_ = _candidateNode_list;
			_tmp15_ = gee_list_get (_tmp14_, _candidateNode_index);
			candidateNode = (XmppStanzaNode*) _tmp15_;
			_tmp17_ = candidateNode;
			_tmp18_ = xmpp_xep_jingle_ice_udp_candidate_parse (_tmp17_, &_inner_error0_);
			_tmp16_ = _tmp18_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
					g_propagate_error (error, _inner_error0_);
					_xmpp_stanza_entry_unref0 (candidateNode);
					_g_object_unref0 (_candidateNode_list);
					_g_free0 (ufrag);
					_g_free0 (pwd);
					return;
				} else {
					_xmpp_stanza_entry_unref0 (candidateNode);
					_g_object_unref0 (_candidateNode_list);
					_g_free0 (ufrag);
					_g_free0 (pwd);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
			}
			_tmp19_ = self->remote_candidates;
			gee_collection_add ((GeeCollection*) _tmp19_, _tmp16_);
			_xmpp_xep_jingle_ice_udp_candidate_unref0 (_tmp16_);
			_xmpp_stanza_entry_unref0 (candidateNode);
		}
		_g_object_unref0 (_candidateNode_list);
	}
	_tmp20_ = xmpp_stanza_node_get_subnode (node, "fingerprint", XMPP_XEP_JINGLE_ICE_UDP_DTLS_NS_URI, FALSE);
	fingerprint_node = _tmp20_;
	_tmp21_ = fingerprint_node;
	if (_tmp21_ != NULL) {
		XmppStanzaNode* _tmp22_;
		const gchar* _tmp23_;
		gint _tmp24_ = 0;
		guint8* _tmp25_;
		XmppStanzaNode* _tmp26_;
		const gchar* _tmp27_;
		gchar* _tmp28_;
		XmppStanzaNode* _tmp29_;
		const gchar* _tmp30_;
		gchar* _tmp31_;
		_tmp22_ = fingerprint_node;
		_tmp23_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp22_);
		_tmp25_ = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_fingerprint_to_bytes (self, _tmp23_, &_tmp24_);
		self->peer_fingerprint = (g_free (self->peer_fingerprint), NULL);
		self->peer_fingerprint = _tmp25_;
		self->peer_fingerprint_length1 = _tmp24_;
		_tmp26_ = fingerprint_node;
		_tmp27_ = xmpp_stanza_node_get_attribute (_tmp26_, "hash", NULL);
		_tmp28_ = g_strdup (_tmp27_);
		_g_free0 (self->peer_fp_algo);
		self->peer_fp_algo = _tmp28_;
		_tmp29_ = fingerprint_node;
		_tmp30_ = xmpp_stanza_node_get_attribute (_tmp29_, "setup", NULL);
		_tmp31_ = g_strdup (_tmp30_);
		_g_free0 (self->peer_setup);
		self->peer_setup = _tmp31_;
	}
	_xmpp_stanza_entry_unref0 (fingerprint_node);
	_g_free0 (ufrag);
	_g_free0 (pwd);
}

void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_handle_transport_accept (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                              XmppStanzaNode* node,
                                                                              GError** error)
{
	XmppXepJingleIceUdpIceUdpTransportParametersClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_GET_CLASS (self);
	if (_klass_->handle_transport_accept) {
		_klass_->handle_transport_accept (self, node, error);
	}
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_handle_transport_info (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                                 XmppStanzaNode* node,
                                                                                 GError** error)
{
	gchar* pwd = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* ufrag = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp6_;
	XmppStanzaNode* fingerprint_node = NULL;
	XmppStanzaNode* _tmp20_;
	XmppStanzaNode* _tmp21_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (node != NULL);
	_tmp0_ = xmpp_stanza_node_get_attribute (node, "pwd", NULL);
	_tmp1_ = g_strdup (_tmp0_);
	pwd = _tmp1_;
	_tmp2_ = xmpp_stanza_node_get_attribute (node, "ufrag", NULL);
	_tmp3_ = g_strdup (_tmp2_);
	ufrag = _tmp3_;
	_tmp4_ = pwd;
	if (_tmp4_ != NULL) {
		const gchar* _tmp5_;
		_tmp5_ = pwd;
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_pwd (self, _tmp5_);
	}
	_tmp6_ = ufrag;
	if (_tmp6_ != NULL) {
		const gchar* _tmp7_;
		_tmp7_ = ufrag;
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_ufrag (self, _tmp7_);
	}
	{
		GeeList* _candidateNode_list = NULL;
		GeeList* _tmp8_;
		gint _candidateNode_size = 0;
		GeeList* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		gint _candidateNode_index = 0;
		_tmp8_ = xmpp_stanza_node_get_subnodes (node, "candidate", NULL, FALSE);
		_candidateNode_list = _tmp8_;
		_tmp9_ = _candidateNode_list;
		_tmp10_ = gee_collection_get_size ((GeeCollection*) _tmp9_);
		_tmp11_ = _tmp10_;
		_candidateNode_size = _tmp11_;
		_candidateNode_index = -1;
		while (TRUE) {
			gint _tmp12_;
			gint _tmp13_;
			XmppStanzaNode* candidateNode = NULL;
			GeeList* _tmp14_;
			gpointer _tmp15_;
			XmppXepJingleIceUdpCandidate* _tmp16_ = NULL;
			XmppStanzaNode* _tmp17_;
			XmppXepJingleIceUdpCandidate* _tmp18_;
			GeeList* _tmp19_;
			_candidateNode_index = _candidateNode_index + 1;
			_tmp12_ = _candidateNode_index;
			_tmp13_ = _candidateNode_size;
			if (!(_tmp12_ < _tmp13_)) {
				break;
			}
			_tmp14_ = _candidateNode_list;
			_tmp15_ = gee_list_get (_tmp14_, _candidateNode_index);
			candidateNode = (XmppStanzaNode*) _tmp15_;
			_tmp17_ = candidateNode;
			_tmp18_ = xmpp_xep_jingle_ice_udp_candidate_parse (_tmp17_, &_inner_error0_);
			_tmp16_ = _tmp18_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
					g_propagate_error (error, _inner_error0_);
					_xmpp_stanza_entry_unref0 (candidateNode);
					_g_object_unref0 (_candidateNode_list);
					_g_free0 (ufrag);
					_g_free0 (pwd);
					return;
				} else {
					_xmpp_stanza_entry_unref0 (candidateNode);
					_g_object_unref0 (_candidateNode_list);
					_g_free0 (ufrag);
					_g_free0 (pwd);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
			}
			_tmp19_ = self->remote_candidates;
			gee_collection_add ((GeeCollection*) _tmp19_, _tmp16_);
			_xmpp_xep_jingle_ice_udp_candidate_unref0 (_tmp16_);
			_xmpp_stanza_entry_unref0 (candidateNode);
		}
		_g_object_unref0 (_candidateNode_list);
	}
	_tmp20_ = xmpp_stanza_node_get_subnode (node, "fingerprint", XMPP_XEP_JINGLE_ICE_UDP_DTLS_NS_URI, FALSE);
	fingerprint_node = _tmp20_;
	_tmp21_ = fingerprint_node;
	if (_tmp21_ != NULL) {
		XmppStanzaNode* _tmp22_;
		const gchar* _tmp23_;
		gint _tmp24_ = 0;
		guint8* _tmp25_;
		XmppStanzaNode* _tmp26_;
		const gchar* _tmp27_;
		gchar* _tmp28_;
		XmppStanzaNode* _tmp29_;
		const gchar* _tmp30_;
		gchar* _tmp31_;
		_tmp22_ = fingerprint_node;
		_tmp23_ = xmpp_stanza_entry_get_string_content ((XmppStanzaEntry*) _tmp22_);
		_tmp25_ = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_fingerprint_to_bytes (self, _tmp23_, &_tmp24_);
		self->peer_fingerprint = (g_free (self->peer_fingerprint), NULL);
		self->peer_fingerprint = _tmp25_;
		self->peer_fingerprint_length1 = _tmp24_;
		_tmp26_ = fingerprint_node;
		_tmp27_ = xmpp_stanza_node_get_attribute (_tmp26_, "hash", NULL);
		_tmp28_ = g_strdup (_tmp27_);
		_g_free0 (self->peer_fp_algo);
		self->peer_fp_algo = _tmp28_;
		_tmp29_ = fingerprint_node;
		_tmp30_ = xmpp_stanza_node_get_attribute (_tmp29_, "setup", NULL);
		_tmp31_ = g_strdup (_tmp30_);
		_g_free0 (self->peer_setup);
		self->peer_setup = _tmp31_;
	}
	_xmpp_stanza_entry_unref0 (fingerprint_node);
	_g_free0 (ufrag);
	_g_free0 (pwd);
}

void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_handle_transport_info (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                            XmppStanzaNode* node,
                                                                            GError** error)
{
	XmppXepJingleIceUdpIceUdpTransportParametersClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_GET_CLASS (self);
	if (_klass_->handle_transport_info) {
		_klass_->handle_transport_info (self, node, error);
	}
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_create_transport_connection (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                                       XmppXmppStream* stream,
                                                                                       XmppXepJingleContent* content)
{
	g_return_if_fail (stream != NULL);
	g_return_if_fail (content != NULL);
	self->priv->connection_created = TRUE;
	xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_check_send_transport_info (self);
}

void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_create_transport_connection (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                                  XmppXmppStream* stream,
                                                                                  XmppXepJingleContent* content)
{
	XmppXepJingleIceUdpIceUdpTransportParametersClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_GET_CLASS (self);
	if (_klass_->create_transport_connection) {
		_klass_->create_transport_connection (self, stream, content);
	}
}

static gboolean
___lambda25_ (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	gboolean result;
	xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_check_send_transport_info (self);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
____lambda25__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda25_ ((XmppXepJingleIceUdpIceUdpTransportParameters*) self);
	return result;
}

void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_add_local_candidate_threadsafe (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                                     XmppXepJingleIceUdpCandidate* candidate)
{
	GeeConcurrentList* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	GeeConcurrentList* _tmp4_;
	GeeConcurrentList* _tmp5_;
	gboolean _tmp6_ = FALSE;
	XmppXepJingleContent* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (candidate != NULL);
	_tmp0_ = self->local_candidates;
	if (gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp0_, candidate)) {
		return;
	}
	_tmp1_ = xmpp_xep_jingle_ice_udp_candidate_type_to_string (candidate->type_);
	_tmp2_ = _tmp1_;
	_tmp3_ = candidate->ip;
	g_debug ("transport_parameters.vala:140: New local candidate %u %s %s:%u", (guint) candidate->component, _tmp2_, _tmp3_, (guint) candidate->port);
	_g_free0 (_tmp2_);
	_tmp4_ = self->unsent_local_candidates;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, candidate);
	_tmp5_ = self->local_candidates;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, candidate);
	_tmp7_ = self->content;
	if (_tmp7_ != NULL) {
		gboolean _tmp8_ = FALSE;
		if (self->priv->connection_created) {
			_tmp8_ = TRUE;
		} else {
			gboolean _tmp9_;
			_tmp9_ = self->priv->_incoming;
			_tmp8_ = !_tmp9_;
		}
		_tmp6_ = _tmp8_;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda25__gsource_func, g_object_ref (self), g_object_unref);
	}
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_check_send_transport_info (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	gboolean _tmp0_ = FALSE;
	XmppXepJingleContent* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->content;
	if (_tmp1_ != NULL) {
		GeeConcurrentList* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->unsent_local_candidates;
		_tmp3_ = gee_concurrent_list_get_is_empty (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = !_tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		XmppXepJingleContent* _tmp5_;
		XmppStanzaNode* _tmp6_;
		XmppStanzaNode* _tmp7_;
		_tmp5_ = self->content;
		_tmp6_ = xmpp_xep_jingle_transport_parameters_to_transport_stanza_node ((XmppXepJingleTransportParameters*) self, "transport-info");
		_tmp7_ = _tmp6_;
		xmpp_xep_jingle_content_send_transport_info (_tmp5_, _tmp7_);
		_xmpp_stanza_entry_unref0 (_tmp7_);
	}
}

static gchar*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_format_fingerprint (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                         guint8* fingerprint,
                                                                         gint fingerprint_length1)
{
	GString* sb = NULL;
	GString* _tmp0_;
	GString* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_string_new ("");
	sb = _tmp0_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GString* _tmp3_;
				guint8 _tmp4_;
				gchar* _tmp5_;
				gchar* _tmp6_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				if (!(i < fingerprint_length1)) {
					break;
				}
				_tmp3_ = sb;
				_tmp4_ = fingerprint[i];
				_tmp5_ = g_strdup_printf ("%02X", (guint) _tmp4_);
				_tmp6_ = _tmp5_;
				g_string_append (_tmp3_, _tmp6_);
				_g_free0 (_tmp6_);
				if (i < (fingerprint_length1 - 1)) {
					GString* _tmp7_;
					_tmp7_ = sb;
					g_string_append (_tmp7_, ":");
				}
			}
		}
	}
	_tmp8_ = sb;
	_tmp9_ = _tmp8_->str;
	_tmp10_ = g_strdup (_tmp9_);
	result = _tmp10_;
	_g_string_free0 (sb);
	return result;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static gint
string_index_of_char (const gchar* self,
                      gunichar c,
                      gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = g_utf8_strchr (((gchar*) self) + start_index, (gssize) -1, c);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		_tmp2_ = _result_;
		result = (gint) (_tmp2_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}

static gchar
string_get (const gchar* self,
            glong index)
{
	gchar _tmp0_;
	gchar result;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = ((gchar*) self)[index];
	result = _tmp0_;
	return result;
}

static guint8*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_fingerprint_to_bytes (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                           const gchar* fingerprint_,
                                                                           gint* result_length1)
{
	gchar* fingerprint = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	guint8* bin = NULL;
	const gchar* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	guint8* _tmp8_;
	gint bin_length1;
	gint _bin_size_;
	static const char HEX[] = "0123456789ABCDEF";
	guint8* _tmp17_;
	gint _tmp17__length1;
	guint8* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (fingerprint_ == NULL) {
		guint8* _tmp0_;
		gint _tmp0__length1;
		_tmp0_ = NULL;
		_tmp0__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp0__length1;
		}
		result = _tmp0_;
		return result;
	}
	_tmp1_ = string_replace (fingerprint_, ":", "");
	_tmp2_ = _tmp1_;
	_tmp3_ = g_utf8_strup (_tmp2_, (gssize) -1);
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	fingerprint = _tmp4_;
	_tmp5_ = fingerprint;
	_tmp6_ = strlen (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_new0 (guint8, _tmp7_ / 2);
	bin = _tmp8_;
	bin_length1 = _tmp7_ / 2;
	_bin_size_ = bin_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp9_ = FALSE;
			_tmp9_ = TRUE;
			while (TRUE) {
				const gchar* _tmp11_;
				gint _tmp12_;
				gint _tmp13_;
				guint8* _tmp14_;
				gint _tmp14__length1;
				const gchar* _tmp15_;
				const gchar* _tmp16_;
				if (!_tmp9_) {
					gint _tmp10_;
					_tmp10_ = i;
					i = _tmp10_ + 1;
				}
				_tmp9_ = FALSE;
				_tmp11_ = fingerprint;
				_tmp12_ = strlen (_tmp11_);
				_tmp13_ = _tmp12_;
				if (!(i < (_tmp13_ / 2))) {
					break;
				}
				_tmp14_ = bin;
				_tmp14__length1 = bin_length1;
				_tmp15_ = fingerprint;
				_tmp16_ = fingerprint;
				_tmp14_[i] = ((guint8) (string_index_of_char (HEX, (gunichar) string_get (_tmp15_, (glong) (i * 2)), 0) << 4)) | string_index_of_char (HEX, (gunichar) string_get (_tmp16_, (glong) ((i * 2) + 1)), 0);
			}
		}
	}
	_tmp17_ = bin;
	_tmp17__length1 = bin_length1;
	if (result_length1) {
		*result_length1 = _tmp17__length1;
	}
	result = _tmp17_;
	_g_free0 (fingerprint);
	return result;
}

static const gchar*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_get_ns_uri (XmppXepJingleTransportParameters* base)
{
	const gchar* result;
	XmppXepJingleIceUdpIceUdpTransportParameters* self;
	self = (XmppXepJingleIceUdpIceUdpTransportParameters*) base;
	result = XMPP_XEP_JINGLE_ICE_UDP_NS_URI;
	return result;
}

const gchar*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_remote_pwd (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_remote_pwd;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_pwd (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_remote_pwd (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_remote_pwd);
		self->priv->_remote_pwd = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_PWD_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_remote_ufrag (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_remote_ufrag;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_ufrag (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_remote_ufrag (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_remote_ufrag);
		self->priv->_remote_ufrag = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_UFRAG_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_local_pwd (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_local_pwd;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_pwd (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_local_pwd (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_local_pwd);
		self->priv->_local_pwd = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_PWD_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_local_ufrag (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_local_ufrag;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_ufrag (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_local_ufrag (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_local_ufrag);
		self->priv->_local_ufrag = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_UFRAG_PROPERTY]);
	}
}

XmppJid*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_local_full_jid (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_local_full_jid;
	result = _tmp0_;
	return result;
}

static gpointer
_xmpp_jid_ref0 (gpointer self)
{
	return self ? xmpp_jid_ref (self) : NULL;
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_full_jid (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                         XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_local_full_jid (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_local_full_jid);
		self->priv->_local_full_jid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_FULL_JID_PROPERTY]);
	}
}

XmppJid*
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_peer_full_jid (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	XmppJid* result;
	XmppJid* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_peer_full_jid;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_peer_full_jid (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                        XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_peer_full_jid (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_peer_full_jid);
		self->priv->_peer_full_jid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_PEER_FULL_JID_PROPERTY]);
	}
}

static guint8
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_get_components (XmppXepJingleTransportParameters* base)
{
	guint8 result;
	XmppXepJingleIceUdpIceUdpTransportParameters* self;
	self = (XmppXepJingleIceUdpIceUdpTransportParameters*) base;
	result = self->priv->components_;
	return result;
}

gboolean
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_incoming (XmppXepJingleIceUdpIceUdpTransportParameters* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_incoming;
	return result;
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_incoming (XmppXepJingleIceUdpIceUdpTransportParameters* self,
                                                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_incoming (self);
	if (old_value != value) {
		self->priv->_incoming = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_INCOMING_PROPERTY]);
	}
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_class_init (XmppXepJingleIceUdpIceUdpTransportParametersClass * klass,
                                                                 gpointer klass_data)
{
	xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleIceUdpIceUdpTransportParameters_private_offset);
	((XmppXepJingleIceUdpIceUdpTransportParametersClass *) klass)->handle_transport_accept = (void (*) (XmppXepJingleIceUdpIceUdpTransportParameters*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_handle_transport_accept;
	((XmppXepJingleIceUdpIceUdpTransportParametersClass *) klass)->handle_transport_info = (void (*) (XmppXepJingleIceUdpIceUdpTransportParameters*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_handle_transport_info;
	((XmppXepJingleIceUdpIceUdpTransportParametersClass *) klass)->create_transport_connection = (void (*) (XmppXepJingleIceUdpIceUdpTransportParameters*, XmppXmppStream*, XmppXepJingleContent*)) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_create_transport_connection;
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_NS_URI_PROPERTY, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_NS_URI_PROPERTY] = g_param_spec_string ("ns-uri", "ns-uri", "ns-uri", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_PWD_PROPERTY, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_PWD_PROPERTY] = g_param_spec_string ("remote-pwd", "remote-pwd", "remote-pwd", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_UFRAG_PROPERTY, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_UFRAG_PROPERTY] = g_param_spec_string ("remote-ufrag", "remote-ufrag", "remote-ufrag", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_PWD_PROPERTY, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_PWD_PROPERTY] = g_param_spec_string ("local-pwd", "local-pwd", "local-pwd", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_UFRAG_PROPERTY, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_UFRAG_PROPERTY] = g_param_spec_string ("local-ufrag", "local-ufrag", "local-ufrag", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_FULL_JID_PROPERTY, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_FULL_JID_PROPERTY] = xmpp_param_spec_jid ("local-full-jid", "local-full-jid", "local-full-jid", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_PEER_FULL_JID_PROPERTY, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_PEER_FULL_JID_PROPERTY] = xmpp_param_spec_jid ("peer-full-jid", "peer-full-jid", "peer-full-jid", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_COMPONENTS_PROPERTY, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_COMPONENTS_PROPERTY] = g_param_spec_uchar ("components", "components", "components", 0, G_MAXUINT8, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_INCOMING_PROPERTY, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_properties[XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_INCOMING_PROPERTY] = g_param_spec_boolean ("incoming", "incoming", "incoming", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_xmpp_xep_jingle_transport_parameters_interface_init (XmppXepJingleTransportParametersIface * iface,
                                                                                                          gpointer iface_data)
{
	xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_xmpp_xep_jingle_transport_parameters_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_content = (void (*) (XmppXepJingleTransportParameters*, XmppXepJingleContent*)) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_set_content;
	iface->to_transport_stanza_node = (XmppStanzaNode* (*) (XmppXepJingleTransportParameters*, const gchar*)) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_to_transport_stanza_node;
	iface->handle_transport_accept = (void (*) (XmppXepJingleTransportParameters*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_handle_transport_accept;
	iface->handle_transport_info = (void (*) (XmppXepJingleTransportParameters*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_handle_transport_info;
	iface->create_transport_connection = (void (*) (XmppXepJingleTransportParameters*, XmppXmppStream*, XmppXepJingleContent*)) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_create_transport_connection;
	iface->get_ns_uri = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_get_ns_uri;
	iface->get_components = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_real_get_components;
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_instance_init (XmppXepJingleIceUdpIceUdpTransportParameters * self,
                                                                    gpointer klass)
{
	GeeConcurrentList* _tmp0_;
	GeeConcurrentList* _tmp1_;
	GeeArrayList* _tmp2_;
	self->priv = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_instance_private (self);
	_tmp0_ = gee_concurrent_list_new (XMPP_XEP_JINGLE_ICE_UDP_TYPE_CANDIDATE, (GBoxedCopyFunc) xmpp_xep_jingle_ice_udp_candidate_ref, (GDestroyNotify) xmpp_xep_jingle_ice_udp_candidate_unref, _xmpp_xep_jingle_ice_udp_candidate_equals_func_gee_equal_data_func, NULL, NULL);
	self->local_candidates = _tmp0_;
	_tmp1_ = gee_concurrent_list_new (XMPP_XEP_JINGLE_ICE_UDP_TYPE_CANDIDATE, (GBoxedCopyFunc) xmpp_xep_jingle_ice_udp_candidate_ref, (GDestroyNotify) xmpp_xep_jingle_ice_udp_candidate_unref, _xmpp_xep_jingle_ice_udp_candidate_equals_func_gee_equal_data_func, NULL, NULL);
	self->unsent_local_candidates = _tmp1_;
	_tmp2_ = gee_array_list_new (XMPP_XEP_JINGLE_ICE_UDP_TYPE_CANDIDATE, (GBoxedCopyFunc) xmpp_xep_jingle_ice_udp_candidate_ref, (GDestroyNotify) xmpp_xep_jingle_ice_udp_candidate_unref, _xmpp_xep_jingle_ice_udp_candidate_equals_func_gee_equal_data_func, NULL, NULL);
	self->remote_candidates = (GeeList*) _tmp2_;
	self->own_fingerprint = NULL;
	self->own_fingerprint_length1 = 0;
	self->own_setup = NULL;
	self->peer_fingerprint = NULL;
	self->peer_fingerprint_length1 = 0;
	self->peer_fp_algo = NULL;
	self->peer_setup = NULL;
	self->priv->_incoming = FALSE;
	self->priv->connection_created = FALSE;
	self->content = NULL;
	self->use_raw = FALSE;
}

static void
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_finalize (GObject * obj)
{
	XmppXepJingleIceUdpIceUdpTransportParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_ICE_UDP_TYPE_ICE_UDP_TRANSPORT_PARAMETERS, XmppXepJingleIceUdpIceUdpTransportParameters);
	_g_free0 (self->priv->_remote_pwd);
	_g_free0 (self->priv->_remote_ufrag);
	_g_free0 (self->priv->_local_pwd);
	_g_free0 (self->priv->_local_ufrag);
	_g_object_unref0 (self->local_candidates);
	_g_object_unref0 (self->unsent_local_candidates);
	_g_object_unref0 (self->remote_candidates);
	self->own_fingerprint = (g_free (self->own_fingerprint), NULL);
	_g_free0 (self->own_setup);
	self->peer_fingerprint = (g_free (self->peer_fingerprint), NULL);
	_g_free0 (self->peer_fp_algo);
	_g_free0 (self->peer_setup);
	_xmpp_jid_unref0 (self->priv->_local_full_jid);
	_xmpp_jid_unref0 (self->priv->_peer_full_jid);
	G_OBJECT_CLASS (xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleIceUdpIceUdpTransportParametersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleIceUdpIceUdpTransportParameters), 0, (GInstanceInitFunc) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_instance_init, NULL };
	static const GInterfaceInfo xmpp_xep_jingle_transport_parameters_info = { (GInterfaceInitFunc) xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_xmpp_xep_jingle_transport_parameters_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id;
	xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleIceUdpIceUdpTransportParameters", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	g_type_add_interface_static (xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id, XMPP_XEP_JINGLE_TYPE_TRANSPORT_PARAMETERS, &xmpp_xep_jingle_transport_parameters_info);
	XmppXepJingleIceUdpIceUdpTransportParameters_private_offset = g_type_add_instance_private (xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id, sizeof (XmppXepJingleIceUdpIceUdpTransportParametersPrivate));
	return xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id;
}

GType
xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id__once)) {
		GType xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id;
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id = xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id__once, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id);
	}
	return xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_type_id__once;
}

static void
_vala_xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_property (GObject * object,
                                                                         guint property_id,
                                                                         GValue * value,
                                                                         GParamSpec * pspec)
{
	XmppXepJingleIceUdpIceUdpTransportParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_ICE_UDP_TYPE_ICE_UDP_TRANSPORT_PARAMETERS, XmppXepJingleIceUdpIceUdpTransportParameters);
	switch (property_id) {
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_NS_URI_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_transport_parameters_get_ns_uri ((XmppXepJingleTransportParameters*) self));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_PWD_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_remote_pwd (self));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_UFRAG_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_remote_ufrag (self));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_PWD_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_local_pwd (self));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_UFRAG_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_local_ufrag (self));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_FULL_JID_PROPERTY:
		xmpp_value_set_jid (value, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_local_full_jid (self));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_PEER_FULL_JID_PROPERTY:
		xmpp_value_set_jid (value, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_peer_full_jid (self));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_COMPONENTS_PROPERTY:
		g_value_set_uchar (value, xmpp_xep_jingle_transport_parameters_get_components ((XmppXepJingleTransportParameters*) self));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_INCOMING_PROPERTY:
		g_value_set_boolean (value, xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_get_incoming (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_property (GObject * object,
                                                                         guint property_id,
                                                                         const GValue * value,
                                                                         GParamSpec * pspec)
{
	XmppXepJingleIceUdpIceUdpTransportParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_ICE_UDP_TYPE_ICE_UDP_TRANSPORT_PARAMETERS, XmppXepJingleIceUdpIceUdpTransportParameters);
	switch (property_id) {
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_PWD_PROPERTY:
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_pwd (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_REMOTE_UFRAG_PROPERTY:
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_remote_ufrag (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_PWD_PROPERTY:
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_pwd (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_UFRAG_PROPERTY:
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_ufrag (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_LOCAL_FULL_JID_PROPERTY:
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_local_full_jid (self, xmpp_value_get_jid (value));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_PEER_FULL_JID_PROPERTY:
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_peer_full_jid (self, xmpp_value_get_jid (value));
		break;
		case XMPP_XEP_JINGLE_ICE_UDP_ICE_UDP_TRANSPORT_PARAMETERS_INCOMING_PROPERTY:
		xmpp_xep_jingle_ice_udp_ice_udp_transport_parameters_set_incoming (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

