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

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "xmpp-vala.h"
#include <glib-object.h>
#include <gio/gio.h>
#include <gee.h>
#include <gobject/gvaluecollector.h>

#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI "urn:xmpp:jingle:transports:s5b:1"
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NEGOTIATION_TIMEOUT 3
#define XMPP_XEP_SOCKS5_BYTESTREAMS_NS_URI "http://jabber.org/protocol/bytestreams"
#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_SOCKS5_BYTESTREAMS_MODULE_0_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_NS_URI_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_TYPE__PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_PRIORITY_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_socks5_bytestreams_module_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_NUM_PROPERTIES];
#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)))
typedef struct _XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData;
#define _g_free0(var) (var = (g_free (var), NULL))

#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER (xmpp_xep_jingle_socks5_bytestreams_local_listener_get_type ())
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_LOCAL_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER, XmppXepJingleSocks5BytestreamsLocalListener))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_LOCAL_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER, XmppXepJingleSocks5BytestreamsLocalListenerClass))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_IS_LOCAL_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_IS_LOCAL_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_LOCAL_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER, XmppXepJingleSocks5BytestreamsLocalListenerClass))

typedef struct _XmppXepJingleSocks5BytestreamsLocalListener XmppXepJingleSocks5BytestreamsLocalListener;
typedef struct _XmppXepJingleSocks5BytestreamsLocalListenerClass XmppXepJingleSocks5BytestreamsLocalListenerClass;

#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER (xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_type ())
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER, XmppXepJingleSocks5BytestreamsStringWrapper))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER, XmppXepJingleSocks5BytestreamsStringWrapperClass))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_IS_STRING_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_IS_STRING_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER, XmppXepJingleSocks5BytestreamsStringWrapperClass))

typedef struct _XmppXepJingleSocks5BytestreamsStringWrapper XmppXepJingleSocks5BytestreamsStringWrapper;
typedef struct _XmppXepJingleSocks5BytestreamsStringWrapperClass XmppXepJingleSocks5BytestreamsStringWrapperClass;
#define _xmpp_xep_jingle_socks5_bytestreams_local_listener_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_jingle_socks5_bytestreams_local_listener_unref (var), NULL)))

#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS (xmpp_xep_jingle_socks5_bytestreams_parameters_get_type ())
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleSocks5BytestreamsParameters))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleSocks5BytestreamsParametersClass))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_IS_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_IS_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS))
#define XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleSocks5BytestreamsParametersClass))

typedef struct _XmppXepJingleSocks5BytestreamsParameters XmppXepJingleSocks5BytestreamsParameters;
typedef struct _XmppXepJingleSocks5BytestreamsParametersClass XmppXepJingleSocks5BytestreamsParametersClass;
typedef struct _XmppXepJingleSocks5BytestreamsParametersPrivate XmppXepJingleSocks5BytestreamsParametersPrivate;
enum  {
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_0_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_CID_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_PRIORITY_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE__PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_socks5_bytestreams_candidate_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_NUM_PROPERTIES];
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
typedef struct _XmppXepJingleSocks5BytestreamsStringWrapperPrivate XmppXepJingleSocks5BytestreamsStringWrapperPrivate;
enum  {
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_0_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_STR_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_socks5_bytestreams_string_wrapper_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_NUM_PROPERTIES];
typedef struct _XmppXepJingleSocks5BytestreamsLocalListenerPrivate XmppXepJingleSocks5BytestreamsLocalListenerPrivate;
typedef struct _XmppXepJingleSocks5BytestreamsLocalListenerRunData XmppXepJingleSocks5BytestreamsLocalListenerRunData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_byte_array_unref0(var) ((var == NULL) ? NULL : (var = (g_byte_array_unref (var), NULL)))
typedef struct _XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData;
typedef struct _XmppXepJingleSocks5BytestreamsParamSpecLocalListener XmppXepJingleSocks5BytestreamsParamSpecLocalListener;
enum  {
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_0_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_NS_URI_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_COMPONENTS_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_SID_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_REMOTE_DSTADDR_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_LOCAL_DSTADDR_PROPERTY,
	XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_NUM_PROPERTIES];
typedef struct _XmppXepJingleSocks5BytestreamsParametersWaitForRemoteActivationData XmppXepJingleSocks5BytestreamsParametersWaitForRemoteActivationData;
typedef struct _Block14Data Block14Data;
typedef struct _XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData;
typedef struct _XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data;
typedef struct _XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleSocks5BytestreamsModule* self;
	XmppXmppStream* stream;
	guint8 components;
	XmppJid* full_jid;
	gboolean result;
	gboolean _tmp0_;
	XmppModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	XmppXepServiceDiscoveryModule* _tmp3_;
};

struct _XmppXepJingleSocks5BytestreamsParameters {
	GObject parent_instance;
	XmppXepJingleSocks5BytestreamsParametersPrivate * priv;
	GeeList* local_candidates;
	GeeList* remote_candidates;
	XmppXepJingleSocks5BytestreamsLocalListener* listener;
};

struct _XmppXepJingleSocks5BytestreamsParametersClass {
	GObjectClass parent_class;
};

struct _XmppXepJingleSocks5BytestreamsCandidatePrivate {
	gchar* _cid;
	gint _priority;
	XmppXepJingleSocks5BytestreamsCandidateType _type_;
};

struct _XmppXepJingleSocks5BytestreamsStringWrapper {
	GObject parent_instance;
	XmppXepJingleSocks5BytestreamsStringWrapperPrivate * priv;
};

struct _XmppXepJingleSocks5BytestreamsStringWrapperClass {
	GObjectClass parent_class;
};

struct _XmppXepJingleSocks5BytestreamsStringWrapperPrivate {
	gchar* _str;
};

struct _XmppXepJingleSocks5BytestreamsLocalListener {
	GTypeInstance parent_instance;
	volatile int ref_count;
	XmppXepJingleSocks5BytestreamsLocalListenerPrivate * priv;
};

struct _XmppXepJingleSocks5BytestreamsLocalListenerClass {
	GTypeClass parent_class;
	void (*finalize) (XmppXepJingleSocks5BytestreamsLocalListener *self);
};

struct _XmppXepJingleSocks5BytestreamsLocalListenerPrivate {
	GSocketListener* inner;
	gchar* dstaddr;
	GeeHashMap* connections;
};

struct _XmppXepJingleSocks5BytestreamsLocalListenerRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleSocks5BytestreamsLocalListener* self;
	GObject* cid;
	GSocketConnection* conn;
	GSocketConnection* _tmp0_;
	GSocketListener* _tmp1_;
	GObject* _tmp2_;
	GSocketConnection* _tmp3_;
	GObject* _tmp4_;
	GSocketConnection* _tmp5_;
	GObject* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	GSocketConnection* _tmp9_;
	GError* _inner_error0_;
};

struct _XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleSocks5BytestreamsLocalListener* self;
	gchar* cid;
	GSocketConnection* conn;
	GSocket* _tmp0_;
	GSocket* _tmp1_;
	gsize read;
	gsize written;
	guint8* read_buffer;
	guint8* _tmp2_;
	gint read_buffer_length1;
	gint _read_buffer_size_;
	GByteArray* write_buffer;
	GByteArray* _tmp3_;
	GInputStream* _tmp4_;
	GInputStream* _tmp5_;
	guint8* _tmp6_;
	gint _tmp6__length1;
	gsize _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GError* _tmp10_;
	GError* _tmp11_;
	gboolean _tmp12_;
	guint8* _tmp13_;
	gint _tmp13__length1;
	guint8 _tmp14_;
	guint8* _tmp15_;
	gint _tmp15__length1;
	guint8 _tmp16_;
	guint8* _tmp17_;
	gint _tmp17__length1;
	guint8 _tmp18_;
	guint8* _tmp19_;
	gint _tmp19__length1;
	guint8 _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	GError* _tmp23_;
	GError* _tmp24_;
	gint num_auth_methods;
	guint8* _tmp25_;
	gint _tmp25__length1;
	guint8 _tmp26_;
	GInputStream* _tmp27_;
	GInputStream* _tmp28_;
	guint8* _tmp29_;
	gint _tmp29__length1;
	gsize _tmp30_;
	gboolean found_null_auth;
	gint i;
	gboolean _tmp31_;
	gint _tmp32_;
	guint8* _tmp33_;
	gint _tmp33__length1;
	guint8 _tmp34_;
	gboolean _tmp35_;
	GError* _tmp36_;
	GOutputStream* _tmp37_;
	GOutputStream* _tmp38_;
	guint8* _tmp39_;
	guint8* _tmp40_;
	gint _tmp40__length1;
	gsize _tmp41_;
	GInputStream* _tmp42_;
	GInputStream* _tmp43_;
	guint8* _tmp44_;
	gint _tmp44__length1;
	gsize _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_;
	GError* _tmp48_;
	GError* _tmp49_;
	gboolean _tmp50_;
	gboolean _tmp51_;
	guint8* _tmp52_;
	gint _tmp52__length1;
	guint8 _tmp53_;
	guint8* _tmp54_;
	gint _tmp54__length1;
	guint8 _tmp55_;
	guint8* _tmp56_;
	gint _tmp56__length1;
	guint8 _tmp57_;
	guint8* _tmp58_;
	gint _tmp58__length1;
	guint8 _tmp59_;
	guint8* _tmp60_;
	gint _tmp60__length1;
	guint8 _tmp61_;
	guint8* _tmp62_;
	gint _tmp62__length1;
	guint8 _tmp63_;
	guint8* _tmp64_;
	gint _tmp64__length1;
	guint8 _tmp65_;
	gchar* _tmp66_;
	gchar* _tmp67_;
	GError* _tmp68_;
	GError* _tmp69_;
	GInputStream* _tmp70_;
	GInputStream* _tmp71_;
	guint8* _tmp72_;
	gint _tmp72__length1;
	gsize _tmp73_;
	gchar* _tmp74_;
	gchar* _tmp75_;
	GError* _tmp76_;
	GError* _tmp77_;
	gint dstaddr_len;
	guint8* _tmp78_;
	gint _tmp78__length1;
	guint8 _tmp79_;
	GInputStream* _tmp80_;
	GInputStream* _tmp81_;
	guint8* _tmp82_;
	gint _tmp82__length1;
	gsize _tmp83_;
	gchar* _tmp84_;
	gchar* _tmp85_;
	GError* _tmp86_;
	GError* _tmp87_;
	guint8* _tmp88_;
	gint _tmp88__length1;
	const gchar* _tmp89_;
	guint8* _tmp90_;
	gint _tmp90__length1;
	gint _tmp91_;
	guint8* _tmp92_;
	gint _tmp92__length1;
	gchar* repr;
	guint8* _tmp93_;
	gint _tmp93__length1;
	const gchar* _tmp94_;
	gint _tmp95_;
	gint _tmp96_;
	gchar* _tmp97_;
	gchar* _tmp98_;
	gchar* _tmp99_;
	gchar* _tmp100_;
	const gchar* _tmp101_;
	const gchar* _tmp102_;
	const gchar* _tmp103_;
	const gchar* _tmp104_;
	gchar* _tmp105_;
	gchar* _tmp106_;
	GError* _tmp107_;
	GError* _tmp108_;
	gboolean _tmp109_;
	guint8* _tmp110_;
	gint _tmp110__length1;
	guint8 _tmp111_;
	guint8* _tmp112_;
	gint _tmp112__length1;
	guint8 _tmp113_;
	guint8* _tmp114_;
	gint _tmp114__length1;
	guint8 _tmp115_;
	guint8* _tmp116_;
	gint _tmp116__length1;
	guint8 _tmp117_;
	gchar* _tmp118_;
	gchar* _tmp119_;
	GError* _tmp120_;
	GError* _tmp121_;
	GByteArray* _tmp122_;
	guint8* _tmp123_;
	guint8* _tmp124_;
	gint _tmp124__length1;
	GByteArray* _tmp125_;
	const gchar* _tmp126_;
	gint _tmp127_;
	gint _tmp128_;
	guint8* _tmp129_;
	guint8* _tmp130_;
	gint _tmp130__length1;
	GByteArray* _tmp131_;
	const gchar* _tmp132_;
	guint8* _tmp133_;
	gint _tmp133__length1;
	gint _tmp134_;
	guint8* _tmp135_;
	gint _tmp135__length1;
	GByteArray* _tmp136_;
	guint8* _tmp137_;
	guint8* _tmp138_;
	gint _tmp138__length1;
	GOutputStream* _tmp139_;
	GOutputStream* _tmp140_;
	GByteArray* _tmp141_;
	guint8* _tmp142_;
	gint _tmp142__length1;
	gsize _tmp143_;
	GSocket* _tmp144_;
	GSocket* _tmp145_;
	GeeHashMap* _tmp146_;
	GeeHashMap* _tmp147_;
	GError* e;
	GError* _tmp148_;
	const gchar* _tmp149_;
	GOutputStream* _tmp150_;
	GOutputStream* _tmp151_;
	guint8* _tmp152_;
	guint8* _tmp153_;
	gint _tmp153__length1;
	gsize _tmp154_;
	GOutputStream* _tmp155_;
	GOutputStream* _tmp156_;
	GError* _inner_error0_;
};

struct _XmppXepJingleSocks5BytestreamsParamSpecLocalListener {
	GParamSpec parent_instance;
};

struct _XmppXepJingleSocks5BytestreamsParametersPrivate {
	XmppXepJingleRole _role;
	gchar* _sid;
	gchar* _remote_dstaddr;
	gchar* _local_dstaddr;
	XmppJid* local_full_jid;
	XmppJid* peer_full_jid;
	gboolean remote_sent_selected_candidate;
	XmppXepJingleSocks5BytestreamsCandidate* remote_selected_candidate;
	gboolean local_determined_selected_candidate;
	XmppXepJingleSocks5BytestreamsCandidate* local_selected_candidate;
	GSocketConnection* local_selected_candidate_conn;
	XmppXepJingleSession* session;
	XmppXepJingleContent* content;
	XmppXmppStream* hack;
	gchar* waiting_for_activation_cid;
	GSourceFunc waiting_for_activation_callback;
	gpointer waiting_for_activation_callback_target;
	GDestroyNotify waiting_for_activation_callback_target_destroy_notify;
	gboolean waiting_for_activation_error;
	XmppXepJingleStreamingConnection* connection;
};

struct _XmppXepJingleSocks5BytestreamsParametersWaitForRemoteActivationData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleSocks5BytestreamsParameters* self;
	XmppXepJingleSocks5BytestreamsCandidate* candidate;
	GSocketConnection* conn;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	XmppXepJingleSession* strong;
	XmppXepJingleSession* _tmp5_;
	XmppXepJingleSession* _tmp6_;
	XmppXepJingleSession* _tmp7_;
	GError* _tmp8_;
	GError* _tmp9_;
};

struct _Block14Data {
	int _ref_count_;
	XmppXepJingleSocks5BytestreamsParameters* self;
	gboolean activation_error;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
};

struct _XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleSocks5BytestreamsParameters* self;
	XmppXepJingleSocks5BytestreamsCandidate* candidate;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	Block14Data* _data14_;
	GSocketConnection* conn;
	const gchar* _tmp2_;
	GSocketConnection* _tmp3_;
	XmppStanzaNode* query;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppStanzaNode* _tmp7_;
	const gchar* _tmp8_;
	XmppStanzaNode* _tmp9_;
	XmppStanzaNode* _tmp10_;
	XmppStanzaNode* _tmp11_;
	XmppStanzaNode* _tmp12_;
	XmppJid* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	XmppStanzaNode* _tmp16_;
	XmppStanzaNode* _tmp17_;
	XmppStanzaNode* _tmp18_;
	XmppStanzaNode* _tmp19_;
	XmppStanzaNode* _tmp20_;
	XmppStanzaNode* _tmp21_;
	XmppIqStanza* iq;
	XmppStanzaNode* _tmp22_;
	XmppJid* _tmp23_;
	XmppJid* _tmp24_;
	XmppJid* _tmp25_;
	XmppIqStanza* _tmp26_;
	XmppXmppStream* _tmp27_;
	XmppModuleIdentity* _tmp28_;
	gpointer _tmp29_;
	XmppIqModule* _tmp30_;
	XmppXmppStream* _tmp31_;
	XmppIqStanza* _tmp32_;
	GError* _tmp33_;
	XmppXepJingleContent* strong_content;
	XmppXepJingleContent* _tmp34_;
	XmppXepJingleContent* _tmp35_;
	XmppXepJingleContent* _tmp36_;
	XmppXepJingleContent* _tmp37_;
	XmppStanzaNode* _tmp38_;
	XmppStanzaNode* _tmp39_;
	XmppStanzaNode* _tmp40_;
	XmppStanzaNode* _tmp41_;
	const gchar* _tmp42_;
	XmppStanzaNode* _tmp43_;
	XmppStanzaNode* _tmp44_;
	XmppStanzaNode* _tmp45_;
	XmppStanzaNode* _tmp46_;
	const gchar* _tmp47_;
	const gchar* _tmp48_;
	XmppStanzaNode* _tmp49_;
	XmppStanzaNode* _tmp50_;
	XmppStanzaNode* _tmp51_;
	XmppStanzaNode* _tmp52_;
	GSocketConnection* _tmp53_;
	GError* e;
	XmppXepJingleContent* _vala1_strong_content;
	XmppXepJingleContent* _tmp54_;
	XmppXepJingleContent* _tmp55_;
	XmppXepJingleContent* _tmp56_;
	XmppXepJingleContent* _tmp57_;
	XmppStanzaNode* _tmp58_;
	XmppStanzaNode* _tmp59_;
	XmppStanzaNode* _tmp60_;
	XmppStanzaNode* _tmp61_;
	const gchar* _tmp62_;
	XmppStanzaNode* _tmp63_;
	XmppStanzaNode* _tmp64_;
	XmppStanzaNode* _tmp65_;
	XmppStanzaNode* _tmp66_;
	XmppStanzaNode* _tmp67_;
	XmppStanzaNode* _tmp68_;
	GError* _tmp69_;
	const gchar* _tmp70_;
	GError* _tmp71_;
	GError* _tmp72_;
	GError* _inner_error0_;
};

struct _XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleSocks5BytestreamsParameters* self;
	XmppXepJingleSocks5BytestreamsCandidate* candidate;
	gchar* dstaddr;
	GSocketConnection* result;
	GSocketClient* socket_client;
	GSocketClient* _tmp0_;
	gchar* address;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	gsize written;
	gsize read;
	guint8* read_buffer;
	guint8* _tmp11_;
	gint read_buffer_length1;
	gint _read_buffer_size_;
	GByteArray* write_buffer;
	GByteArray* _tmp12_;
	GSocketConnection* conn;
	GSocketClient* _tmp13_;
	const gchar* _tmp14_;
	GSocketConnection* _tmp15_;
	GSocketConnection* _tmp16_;
	GOutputStream* _tmp17_;
	GOutputStream* _tmp18_;
	guint8* _tmp19_;
	guint8* _tmp20_;
	gint _tmp20__length1;
	gsize _tmp21_;
	GSocketConnection* _tmp22_;
	GInputStream* _tmp23_;
	GInputStream* _tmp24_;
	guint8* _tmp25_;
	gint _tmp25__length1;
	gsize _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	GError* _tmp29_;
	GError* _tmp30_;
	gboolean _tmp31_;
	guint8* _tmp32_;
	gint _tmp32__length1;
	guint8 _tmp33_;
	guint8* _tmp34_;
	gint _tmp34__length1;
	guint8 _tmp35_;
	guint8* _tmp36_;
	gint _tmp36__length1;
	guint8 _tmp37_;
	guint8* _tmp38_;
	gint _tmp38__length1;
	guint8 _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	GError* _tmp42_;
	GError* _tmp43_;
	GByteArray* _tmp44_;
	guint8* _tmp45_;
	guint8* _tmp46_;
	gint _tmp46__length1;
	GByteArray* _tmp47_;
	gint _tmp48_;
	gint _tmp49_;
	guint8* _tmp50_;
	guint8* _tmp51_;
	gint _tmp51__length1;
	GByteArray* _tmp52_;
	guint8* _tmp53_;
	gint _tmp53__length1;
	gint _tmp54_;
	guint8* _tmp55_;
	gint _tmp55__length1;
	GByteArray* _tmp56_;
	guint8* _tmp57_;
	guint8* _tmp58_;
	gint _tmp58__length1;
	GSocketConnection* _tmp59_;
	GOutputStream* _tmp60_;
	GOutputStream* _tmp61_;
	GByteArray* _tmp62_;
	guint8* _tmp63_;
	gint _tmp63__length1;
	gsize _tmp64_;
	GSocketConnection* _tmp65_;
	GInputStream* _tmp66_;
	GInputStream* _tmp67_;
	guint8* _tmp68_;
	gint _tmp68__length1;
	GByteArray* _tmp69_;
	gsize _tmp70_;
	GByteArray* _tmp71_;
	GByteArray* _tmp72_;
	gchar* _tmp73_;
	gchar* _tmp74_;
	GError* _tmp75_;
	GError* _tmp76_;
	gboolean _tmp77_;
	gboolean _tmp78_;
	guint8* _tmp79_;
	gint _tmp79__length1;
	guint8 _tmp80_;
	guint8* _tmp81_;
	gint _tmp81__length1;
	guint8 _tmp82_;
	guint8* _tmp83_;
	gint _tmp83__length1;
	guint8 _tmp84_;
	guint8* _tmp85_;
	gint _tmp85__length1;
	guint8 _tmp86_;
	guint8* _tmp87_;
	gint _tmp87__length1;
	guint8 _tmp88_;
	guint8* _tmp89_;
	gint _tmp89__length1;
	guint8 _tmp90_;
	guint8* _tmp91_;
	gint _tmp91__length1;
	guint8 _tmp92_;
	gchar* _tmp93_;
	gchar* _tmp94_;
	GError* _tmp95_;
	GError* _tmp96_;
	guint8* _tmp97_;
	gint _tmp97__length1;
	guint8 _tmp98_;
	gint _tmp99_;
	gint _tmp100_;
	gint _tmp101_;
	gint _tmp102_;
	guint8* _tmp103_;
	gint _tmp103__length1;
	guint8 _tmp104_;
	gchar* _tmp105_;
	gchar* _tmp106_;
	GError* _tmp107_;
	GError* _tmp108_;
	guint8* _tmp109_;
	gint _tmp109__length1;
	gint _tmp110_;
	gint _tmp111_;
	guint8* _tmp112_;
	gint _tmp112__length1;
	gint _tmp113_;
	guint8* _tmp114_;
	gint _tmp114__length1;
	gchar* repr;
	guint8* _tmp115_;
	gint _tmp115__length1;
	gint _tmp116_;
	gint _tmp117_;
	gchar* _tmp118_;
	const gchar* _tmp119_;
	const gchar* _tmp120_;
	const gchar* _tmp121_;
	gchar* _tmp122_;
	gchar* _tmp123_;
	GError* _tmp124_;
	GError* _tmp125_;
	gboolean _tmp126_;
	guint8* _tmp127_;
	gint _tmp127__length1;
	gint _tmp128_;
	gint _tmp129_;
	guint8 _tmp130_;
	guint8* _tmp131_;
	gint _tmp131__length1;
	gint _tmp132_;
	gint _tmp133_;
	guint8 _tmp134_;
	guint8* _tmp135_;
	gint _tmp135__length1;
	gint _tmp136_;
	gint _tmp137_;
	guint8 _tmp138_;
	guint8* _tmp139_;
	gint _tmp139__length1;
	gint _tmp140_;
	gint _tmp141_;
	guint8 _tmp142_;
	gchar* _tmp143_;
	gchar* _tmp144_;
	GError* _tmp145_;
	GError* _tmp146_;
	GSocketConnection* _tmp147_;
	GSocket* _tmp148_;
	GSocket* _tmp149_;
	GError* _inner_error0_;
};

struct _XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleSocks5BytestreamsParameters* self;
	XmppXmppStream* stream;
	XmppXepJingleSession* session;
	GeeList* _tmp0_;
	GeeList* _candidate_list;
	GeeList* _tmp1_;
	gint _candidate_size;
	GeeList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _candidate_index;
	gint _tmp5_;
	gint _tmp6_;
	XmppXepJingleSocks5BytestreamsCandidate* candidate;
	GeeList* _tmp7_;
	gpointer _tmp8_;
	gboolean _tmp9_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp10_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	GSocketConnection* conn;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp17_;
	const gchar* _tmp18_;
	GSocketConnection* _tmp19_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp20_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp21_;
	GSocketConnection* _tmp22_;
	GSocketConnection* _tmp23_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	XmppXepJingleContent* _tmp27_;
	XmppStanzaNode* _tmp28_;
	XmppStanzaNode* _tmp29_;
	XmppStanzaNode* _tmp30_;
	XmppStanzaNode* _tmp31_;
	const gchar* _tmp32_;
	XmppStanzaNode* _tmp33_;
	XmppStanzaNode* _tmp34_;
	XmppStanzaNode* _tmp35_;
	XmppStanzaNode* _tmp36_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	XmppStanzaNode* _tmp40_;
	XmppStanzaNode* _tmp41_;
	XmppStanzaNode* _tmp42_;
	XmppStanzaNode* _tmp43_;
	XmppXepJingleContent* _tmp44_;
	XmppStanzaNode* _tmp45_;
	XmppStanzaNode* _tmp46_;
	XmppStanzaNode* _tmp47_;
	XmppStanzaNode* _tmp48_;
	const gchar* _tmp49_;
	XmppStanzaNode* _tmp50_;
	XmppStanzaNode* _tmp51_;
	XmppStanzaNode* _tmp52_;
	XmppStanzaNode* _tmp53_;
	XmppStanzaNode* _tmp54_;
	XmppStanzaNode* _tmp55_;
	GError* _inner_error0_;
};

static gpointer xmpp_xep_jingle_socks5_bytestreams_module_parent_class = NULL;
XmppModuleIdentity* xmpp_xep_jingle_socks5_bytestreams_module_IDENTITY = NULL;
static XmppXepJingleTransportIface * xmpp_xep_jingle_socks5_bytestreams_module_xmpp_xep_jingle_transport_parent_iface = NULL;
static gint XmppXepJingleSocks5BytestreamsCandidate_private_offset;
static gpointer xmpp_xep_jingle_socks5_bytestreams_candidate_parent_class = NULL;
static gint XmppXepJingleSocks5BytestreamsStringWrapper_private_offset;
static gpointer xmpp_xep_jingle_socks5_bytestreams_string_wrapper_parent_class = NULL;
static gint XmppXepJingleSocks5BytestreamsLocalListener_private_offset;
static gpointer xmpp_xep_jingle_socks5_bytestreams_local_listener_parent_class = NULL;
static gint XmppXepJingleSocks5BytestreamsParameters_private_offset;
static gpointer xmpp_xep_jingle_socks5_bytestreams_parameters_parent_class = NULL;
static XmppXepJingleTransportParametersIface * xmpp_xep_jingle_socks5_bytestreams_parameters_xmpp_xep_jingle_transport_parameters_parent_iface = NULL;

static void xmpp_xep_jingle_socks5_bytestreams_module_real_attach (XmppXmppStreamModule* base,
                                                            XmppXmppStream* stream);
static void xmpp_xep_jingle_socks5_bytestreams_module_real_detach (XmppXmppStreamModule* base,
                                                            XmppXmppStream* stream);
static gchar* xmpp_xep_jingle_socks5_bytestreams_module_real_get_ns (XmppXmppStreamModule* base);
static gchar* xmpp_xep_jingle_socks5_bytestreams_module_real_get_id (XmppXmppStreamModule* base);
static void xmpp_xep_jingle_socks5_bytestreams_module_real_is_transport_available_data_free (gpointer _data);
static void xmpp_xep_jingle_socks5_bytestreams_module_real_is_transport_available (XmppXepJingleTransport* base,
                                                                            XmppXmppStream* stream,
                                                                            guint8 components,
                                                                            XmppJid* full_jid,
                                                                            GAsyncReadyCallback _callback_,
                                                                            gpointer _user_data_);
static gboolean xmpp_xep_jingle_socks5_bytestreams_module_real_is_transport_available_co (XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData* _data_);
static void xmpp_xep_jingle_socks5_bytestreams_module_is_transport_available_ready (GObject* source_object,
                                                                             GAsyncResult* _res_,
                                                                             gpointer _user_data_);
static GeeList* xmpp_xep_jingle_socks5_bytestreams_module_get_proxies (XmppXepJingleSocks5BytestreamsModule* self,
                                                                XmppXmppStream* stream);
VALA_EXTERN gpointer xmpp_xep_jingle_socks5_bytestreams_local_listener_ref (gpointer instance);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_local_listener_unref (gpointer instance);
VALA_EXTERN GParamSpec* xmpp_xep_jingle_socks5_bytestreams_param_spec_local_listener (const gchar* name,
                                                                          const gchar* nick,
                                                                          const gchar* blurb,
                                                                          GType object_type,
                                                                          GParamFlags flags);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_value_set_local_listener (GValue* value,
                                                                  gpointer v_object);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_value_take_local_listener (GValue* value,
                                                                   gpointer v_object);
VALA_EXTERN gpointer xmpp_xep_jingle_socks5_bytestreams_value_get_local_listener (const GValue* value);
VALA_EXTERN GType xmpp_xep_jingle_socks5_bytestreams_local_listener_get_type (void) G_GNUC_CONST ;
static GeeList* xmpp_xep_jingle_socks5_bytestreams_module_start_local_listeners (XmppXepJingleSocks5BytestreamsModule* self,
                                                                          XmppXmppStream* stream,
                                                                          XmppJid* local_full_jid,
                                                                          const gchar* dstaddr,
                                                                          XmppXepJingleSocks5BytestreamsLocalListener** local_listener);
VALA_EXTERN XmppXepJingleSocks5BytestreamsStringWrapper* xmpp_xep_jingle_socks5_bytestreams_string_wrapper_new (const gchar* str);
VALA_EXTERN XmppXepJingleSocks5BytestreamsStringWrapper* xmpp_xep_jingle_socks5_bytestreams_string_wrapper_construct (GType object_type,
                                                                                                          const gchar* str);
VALA_EXTERN GType xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_type (void) G_GNUC_CONST ;
VALA_EXTERN XmppXepJingleSocks5BytestreamsLocalListener* xmpp_xep_jingle_socks5_bytestreams_local_listener_new (GSocketListener* inner,
                                                                                                    const gchar* dstaddr);
VALA_EXTERN XmppXepJingleSocks5BytestreamsLocalListener* xmpp_xep_jingle_socks5_bytestreams_local_listener_construct (GType object_type,
                                                                                                          GSocketListener* inner,
                                                                                                          const gchar* dstaddr);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_local_listener_start (XmppXepJingleSocks5BytestreamsLocalListener* self);
VALA_EXTERN XmppXepJingleSocks5BytestreamsLocalListener* xmpp_xep_jingle_socks5_bytestreams_local_listener_new_empty (void);
VALA_EXTERN XmppXepJingleSocks5BytestreamsLocalListener* xmpp_xep_jingle_socks5_bytestreams_local_listener_construct_empty (GType object_type);
VALA_EXTERN GType xmpp_xep_jingle_socks5_bytestreams_parameters_get_type (void) G_GNUC_CONST ;
static void xmpp_xep_jingle_socks5_bytestreams_module_select_candidates (XmppXepJingleSocks5BytestreamsModule* self,
                                                                  XmppXmppStream* stream,
                                                                  XmppJid* local_full_jid,
                                                                  const gchar* dstaddr,
                                                                  XmppXepJingleSocks5BytestreamsParameters* _result_);
static gint __lambda31_ (XmppXepJingleSocks5BytestreamsModule* self,
                  XmppXepJingleSocks5BytestreamsCandidate* c1,
                  XmppXepJingleSocks5BytestreamsCandidate* c2);
static gint ___lambda31__gcompare_data_func (gconstpointer a,
                                      gconstpointer b,
                                      gpointer self);
static XmppXepJingleTransportParameters* xmpp_xep_jingle_socks5_bytestreams_module_real_create_transport_parameters (XmppXepJingleTransport* base,
                                                                                                              XmppXmppStream* stream,
                                                                                                              guint8 components,
                                                                                                              XmppJid* local_full_jid,
                                                                                                              XmppJid* peer_full_jid,
                                                                                                              GError** error);
VALA_EXTERN XmppXepJingleSocks5BytestreamsParameters* xmpp_xep_jingle_socks5_bytestreams_parameters_new_create (XmppJid* local_full_jid,
                                                                                                    XmppJid* peer_full_jid,
                                                                                                    const gchar* sid);
VALA_EXTERN XmppXepJingleSocks5BytestreamsParameters* xmpp_xep_jingle_socks5_bytestreams_parameters_construct_create (GType object_type,
                                                                                                          XmppJid* local_full_jid,
                                                                                                          XmppJid* peer_full_jid,
                                                                                                          const gchar* sid);
VALA_EXTERN gchar* xmpp_xep_jingle_socks5_bytestreams_calculate_dstaddr (const gchar* sid,
                                                             XmppJid* first_jid,
                                                             XmppJid* second_jid);
VALA_EXTERN const gchar* xmpp_xep_jingle_socks5_bytestreams_parameters_get_sid (XmppXepJingleSocks5BytestreamsParameters* self);
static XmppXepJingleTransportParameters* xmpp_xep_jingle_socks5_bytestreams_module_real_parse_transport_parameters (XmppXepJingleTransport* base,
                                                                                                             XmppXmppStream* stream,
                                                                                                             guint8 components,
                                                                                                             XmppJid* local_full_jid,
                                                                                                             XmppJid* peer_full_jid,
                                                                                                             XmppStanzaNode* transport,
                                                                                                             GError** error);
VALA_EXTERN XmppXepJingleSocks5BytestreamsParameters* xmpp_xep_jingle_socks5_bytestreams_parameters_parse (XmppJid* local_full_jid,
                                                                                               XmppJid* peer_full_jid,
                                                                                               XmppStanzaNode* transport,
                                                                                               GError** error);
static void xmpp_xep_jingle_socks5_bytestreams_module_finalize (GObject * obj);
static GType xmpp_xep_jingle_socks5_bytestreams_module_get_type_once (void);
static void _vala_xmpp_xep_jingle_socks5_bytestreams_module_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec);
static gint xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_preference_impl (XmppXepJingleSocks5BytestreamsCandidateType self);
static XmppXepJingleSocks5BytestreamsCandidate* xmpp_xep_jingle_socks5_bytestreams_candidate_new (const gchar* cid,
                                                                                           const gchar* host,
                                                                                           XmppJid* jid,
                                                                                           gint port,
                                                                                           gint priority,
                                                                                           XmppXepJingleSocks5BytestreamsCandidateType type);
static XmppXepJingleSocks5BytestreamsCandidate* xmpp_xep_jingle_socks5_bytestreams_candidate_construct (GType object_type,
                                                                                                 const gchar* cid,
                                                                                                 const gchar* host,
                                                                                                 XmppJid* jid,
                                                                                                 gint port,
                                                                                                 gint priority,
                                                                                                 XmppXepJingleSocks5BytestreamsCandidateType type);
static void xmpp_xep_jingle_socks5_bytestreams_candidate_set_cid (XmppXepJingleSocks5BytestreamsCandidate* self,
                                                           const gchar* value);
static void xmpp_xep_jingle_socks5_bytestreams_candidate_set_priority (XmppXepJingleSocks5BytestreamsCandidate* self,
                                                                gint value);
static void xmpp_xep_jingle_socks5_bytestreams_candidate_set_type_ (XmppXepJingleSocks5BytestreamsCandidate* self,
                                                             XmppXepJingleSocks5BytestreamsCandidateType value);
static void xmpp_xep_jingle_socks5_bytestreams_candidate_finalize (GObject * obj);
static GType xmpp_xep_jingle_socks5_bytestreams_candidate_get_type_once (void);
static void _vala_xmpp_xep_jingle_socks5_bytestreams_candidate_get_property (GObject * object,
                                                                      guint property_id,
                                                                      GValue * value,
                                                                      GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_socks5_bytestreams_candidate_set_property (GObject * object,
                                                                      guint property_id,
                                                                      const GValue * value,
                                                                      GParamSpec * pspec);
VALA_EXTERN gboolean xmpp_xep_jingle_socks5_bytestreams_bytes_equal (guint8* a,
                                                         gint a_length1,
                                                         guint8* b,
                                                         gint b_length1);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_string_wrapper_set_str (XmppXepJingleSocks5BytestreamsStringWrapper* self,
                                                                const gchar* value);
VALA_EXTERN const gchar* xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_str (XmppXepJingleSocks5BytestreamsStringWrapper* self);
static void xmpp_xep_jingle_socks5_bytestreams_string_wrapper_finalize (GObject * obj);
static GType xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_type_once (void);
static void _vala_xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_property (GObject * object,
                                                                           guint property_id,
                                                                           GValue * value,
                                                                           GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_socks5_bytestreams_string_wrapper_set_property (GObject * object,
                                                                           guint property_id,
                                                                           const GValue * value,
                                                                           GParamSpec * pspec);
static void xmpp_xep_jingle_socks5_bytestreams_local_listener_run (XmppXepJingleSocks5BytestreamsLocalListener* self,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static void xmpp_xep_jingle_socks5_bytestreams_local_listener_run_finish (XmppXepJingleSocks5BytestreamsLocalListener* self,
                                                                   GAsyncResult* _res_);
static void xmpp_xep_jingle_socks5_bytestreams_local_listener_run_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_socks5_bytestreams_local_listener_run_co (XmppXepJingleSocks5BytestreamsLocalListenerRunData* _data_);
static void xmpp_xep_jingle_socks5_bytestreams_local_listener_run_ready (GObject* source_object,
                                                                  GAsyncResult* _res_,
                                                                  gpointer _user_data_);
static void xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn (XmppXepJingleSocks5BytestreamsLocalListener* self,
                                                                    const gchar* cid,
                                                                    GSocketConnection* conn,
                                                                    GAsyncReadyCallback _callback_,
                                                                    gpointer _user_data_);
static void xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_finish (XmppXepJingleSocks5BytestreamsLocalListener* self,
                                                                           GAsyncResult* _res_);
static void xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_co (XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData* _data_);
static void xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready (GObject* source_object,
                                                                          GAsyncResult* _res_,
                                                                          gpointer _user_data_);
VALA_EXTERN GSocketConnection* xmpp_xep_jingle_socks5_bytestreams_local_listener_get_connection (XmppXepJingleSocks5BytestreamsLocalListener* self,
                                                                                     const gchar* cid);
static void xmpp_xep_jingle_socks5_bytestreams_local_listener_finalize (XmppXepJingleSocks5BytestreamsLocalListener * obj);
static GType xmpp_xep_jingle_socks5_bytestreams_local_listener_get_type_once (void);
static XmppXepJingleSocks5BytestreamsParameters* xmpp_xep_jingle_socks5_bytestreams_parameters_new (XmppXepJingleRole role,
                                                                                             const gchar* sid,
                                                                                             XmppJid* local_full_jid,
                                                                                             XmppJid* peer_full_jid,
                                                                                             const gchar* remote_dstaddr);
static XmppXepJingleSocks5BytestreamsParameters* xmpp_xep_jingle_socks5_bytestreams_parameters_construct (GType object_type,
                                                                                                   XmppXepJingleRole role,
                                                                                                   const gchar* sid,
                                                                                                   XmppJid* local_full_jid,
                                                                                                   XmppJid* peer_full_jid,
                                                                                                   const gchar* remote_dstaddr);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_set_role (XmppXepJingleSocks5BytestreamsParameters* self,
                                                             XmppXepJingleRole value);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_set_sid (XmppXepJingleSocks5BytestreamsParameters* self,
                                                            const gchar* value);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_set_local_dstaddr (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                      const gchar* value);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_set_remote_dstaddr (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                       const gchar* value);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_real_set_content (XmppXepJingleTransportParameters* base,
                                                                     XmppXepJingleContent* content);
static XmppStanzaNode* xmpp_xep_jingle_socks5_bytestreams_parameters_real_to_transport_stanza_node (XmppXepJingleTransportParameters* base,
                                                                                             const gchar* action_type);
VALA_EXTERN const gchar* xmpp_xep_jingle_socks5_bytestreams_parameters_get_local_dstaddr (XmppXepJingleSocks5BytestreamsParameters* self);
VALA_EXTERN XmppXepJingleRole xmpp_xep_jingle_socks5_bytestreams_parameters_get_role (XmppXepJingleSocks5BytestreamsParameters* self);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_real_handle_transport_accept (XmppXepJingleTransportParameters* base,
                                                                                 XmppStanzaNode* transport,
                                                                                 GError** error);
VALA_EXTERN const gchar* xmpp_xep_jingle_socks5_bytestreams_parameters_get_remote_dstaddr (XmppXepJingleSocks5BytestreamsParameters* self);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_real_handle_transport_info (XmppXepJingleTransportParameters* base,
                                                                               XmppStanzaNode* transport,
                                                                               GError** error);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_handle_activated (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                     const gchar* cid,
                                                                     GError** error);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_handle_remote_candidate (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                            const gchar* cid,
                                                                            GError** error);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_handle_proxy_error (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                       GError** error);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_try_completing_negotiation (XmppXepJingleSocks5BytestreamsParameters* self);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection_error (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                           GError* e);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                     GIOStream* ios);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                               XmppXepJingleSocks5BytestreamsCandidate* candidate,
                                                                               GSocketConnection* conn,
                                                                               GAsyncReadyCallback _callback_,
                                                                               gpointer _user_data_);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_finish (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                      GAsyncResult* _res_);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                               XmppXepJingleSocks5BytestreamsCandidate* candidate,
                                                                               GAsyncReadyCallback _callback_,
                                                                               gpointer _user_data_);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_finish (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                      GAsyncResult* _res_);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_co (XmppXepJingleSocks5BytestreamsParametersWaitForRemoteActivationData* _data_);
static gboolean _xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_co_gsource_func (gpointer self);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_co (XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData* _data_);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5 (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                      XmppXepJingleSocks5BytestreamsCandidate* candidate,
                                                                      const gchar* dstaddr,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_);
VALA_EXTERN GSocketConnection* xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_finish (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                           GAsyncResult* _res_,
                                                                                           GError** error);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_ready (GObject* source_object,
                                                                                     GAsyncResult* _res_,
                                                                                     gpointer _user_data_);
static gboolean _xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_co_gsource_func (gpointer self);
static void ___lambda29_ (Block14Data* _data14_,
                   XmppXmppStream* stream,
                   XmppIqStanza* iq);
static void ____lambda29__xmpp_iq_module_on_result (XmppXmppStream* stream,
                                             XmppIqStanza* iq,
                                             gpointer self);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_data_free (gpointer _data);
static gboolean xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_co (XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data* _data_);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_ready (GObject* source_object,
                                                                            GAsyncResult* _res_,
                                                                            gpointer _user_data_);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_data_free (gpointer _data);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                 XmppXmppStream* stream,
                                                                                 XmppXepJingleSession* session,
                                                                                 GAsyncReadyCallback _callback_,
                                                                                 gpointer _user_data_);
VALA_EXTERN void xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_finish (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                        GAsyncResult* _res_,
                                                                                        GError** error);
static gboolean xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_co (XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData* _data_);
static gint __lambda30_ (XmppXepJingleSocks5BytestreamsParameters* self,
                  XmppXepJingleSocks5BytestreamsCandidate* c1,
                  XmppXepJingleSocks5BytestreamsCandidate* c2);
static gint ___lambda30__gcompare_data_func (gconstpointer a,
                                      gconstpointer b,
                                      gpointer self);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_ready (GObject* source_object,
                                                                                       GAsyncResult* _res_,
                                                                                       gpointer _user_data_);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_real_create_transport_connection (XmppXepJingleTransportParameters* base,
                                                                                     XmppXmppStream* stream,
                                                                                     XmppXepJingleContent* content);
static void xmpp_xep_jingle_socks5_bytestreams_parameters_finalize (GObject * obj);
static GType xmpp_xep_jingle_socks5_bytestreams_parameters_get_type_once (void);
static void _vala_xmpp_xep_jingle_socks5_bytestreams_parameters_get_property (GObject * object,
                                                                       guint property_id,
                                                                       GValue * value,
                                                                       GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_socks5_bytestreams_parameters_set_property (GObject * object,
                                                                       guint property_id,
                                                                       const GValue * value,
                                                                       GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static void
xmpp_xep_jingle_socks5_bytestreams_module_real_attach (XmppXmppStreamModule* base,
                                                       XmppXmppStream* stream)
{
	XmppXepJingleSocks5BytestreamsModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepJingleModule* _tmp2_;
	XmppModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	XmppXepServiceDiscoveryModule* _tmp5_;
	self = (XmppXepJingleSocks5BytestreamsModule*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_xep_jingle_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_JINGLE_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepJingleModule*) _tmp1_;
	xmpp_xep_jingle_module_register_transport (_tmp2_, (XmppXepJingleTransport*) self);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = xmpp_xep_service_discovery_module_IDENTITY;
	_tmp4_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_SERVICE_DISCOVERY_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
	_tmp5_ = (XmppXepServiceDiscoveryModule*) _tmp4_;
	xmpp_xep_service_discovery_module_add_feature (_tmp5_, stream, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI);
	_g_object_unref0 (_tmp5_);
}

static void
xmpp_xep_jingle_socks5_bytestreams_module_real_detach (XmppXmppStreamModule* base,
                                                       XmppXmppStream* stream)
{
	XmppXepJingleSocks5BytestreamsModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepServiceDiscoveryModule* _tmp2_;
	self = (XmppXepJingleSocks5BytestreamsModule*) base;
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_xep_service_discovery_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_SERVICE_DISCOVERY_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepServiceDiscoveryModule*) _tmp1_;
	xmpp_xep_service_discovery_module_remove_feature (_tmp2_, stream, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI);
	_g_object_unref0 (_tmp2_);
}

static gchar*
xmpp_xep_jingle_socks5_bytestreams_module_real_get_ns (XmppXmppStreamModule* base)
{
	XmppXepJingleSocks5BytestreamsModule * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppXepJingleSocks5BytestreamsModule*) base;
	_tmp0_ = g_strdup (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_xep_jingle_socks5_bytestreams_module_real_get_id (XmppXmppStreamModule* base)
{
	XmppXepJingleSocks5BytestreamsModule * self;
	XmppModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppXepJingleSocks5BytestreamsModule*) base;
	_tmp0_ = xmpp_xep_jingle_socks5_bytestreams_module_IDENTITY;
	_tmp1_ = xmpp_module_identity_get_id (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_module_real_is_transport_available_data_free (gpointer _data)
{
	XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_xmpp_jid_unref0 (_data_->full_jid);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData, _data_);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

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

static void
xmpp_xep_jingle_socks5_bytestreams_module_real_is_transport_available (XmppXepJingleTransport* base,
                                                                       XmppXmppStream* stream,
                                                                       guint8 components,
                                                                       XmppJid* full_jid,
                                                                       GAsyncReadyCallback _callback_,
                                                                       gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsModule * self;
	XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData* _data_;
	XmppXepJingleSocks5BytestreamsModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppJid* _tmp2_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (full_jid != NULL);
	self = (XmppXepJingleSocks5BytestreamsModule*) base;
	_data_ = g_slice_new0 (XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_socks5_bytestreams_module_real_is_transport_available_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_data_->components = components;
	_tmp2_ = _xmpp_jid_ref0 (full_jid);
	_xmpp_jid_unref0 (_data_->full_jid);
	_data_->full_jid = _tmp2_;
	xmpp_xep_jingle_socks5_bytestreams_module_real_is_transport_available_co (_data_);
}

static gboolean
xmpp_xep_jingle_socks5_bytestreams_module_is_transport_available_finish (XmppXepJingleTransport* base,
                                                                         GAsyncResult* _res_)
{
	gboolean result;
	XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_module_is_transport_available_ready (GObject* source_object,
                                                                        GAsyncResult* _res_,
                                                                        gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_socks5_bytestreams_module_real_is_transport_available_co (_data_);
}

static gboolean
xmpp_xep_jingle_socks5_bytestreams_module_real_is_transport_available_co (XmppXepJingleSocks5BytestreamsModuleIsTransportAvailableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (((gint) _data_->components) == 1) {
		_data_->_tmp1_ = xmpp_xep_service_discovery_module_IDENTITY;
		_data_->_tmp2_ = xmpp_xmpp_stream_get_module (_data_->stream, XMPP_XEP_SERVICE_DISCOVERY_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp1_);
		_data_->_tmp3_ = (XmppXepServiceDiscoveryModule*) _data_->_tmp2_;
		_data_->_state_ = 1;
		xmpp_xep_service_discovery_module_has_entity_feature (_data_->_tmp3_, _data_->stream, _data_->full_jid, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, xmpp_xep_jingle_socks5_bytestreams_module_is_transport_available_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = xmpp_xep_service_discovery_module_has_entity_feature_finish (_data_->_tmp3_, _data_->_res_);
		_g_object_unref0 (_data_->_tmp3_);
	} else {
		_data_->_tmp0_ = FALSE;
	}
	_data_->result = _data_->_tmp0_;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static GeeList*
xmpp_xep_jingle_socks5_bytestreams_module_get_proxies (XmppXepJingleSocks5BytestreamsModule* self,
                                                       XmppXmppStream* stream)
{
	GeeList* _result_ = NULL;
	GeeArrayList* _tmp0_;
	gint i = 0;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (stream != NULL, NULL);
	_tmp0_ = gee_array_list_new (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_result_ = (GeeList*) _tmp0_;
	i = 1 << 15;
	{
		GeeList* _proxy_list = NULL;
		XmppModuleIdentity* _tmp1_;
		gpointer _tmp2_;
		XmppXepSocks5BytestreamsModule* _tmp3_;
		GeeList* _tmp4_;
		GeeList* _tmp5_;
		gint _proxy_size = 0;
		GeeList* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		gint _proxy_index = 0;
		_tmp1_ = xmpp_xep_socks5_bytestreams_module_IDENTITY;
		_tmp2_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_SOCKS5_BYTESTREAMS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
		_tmp3_ = (XmppXepSocks5BytestreamsModule*) _tmp2_;
		_tmp4_ = xmpp_xep_socks5_bytestreams_module_get_proxies (_tmp3_, stream);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_proxy_list = _tmp5_;
		_tmp6_ = _proxy_list;
		_tmp7_ = gee_collection_get_size ((GeeCollection*) _tmp6_);
		_tmp8_ = _tmp7_;
		_proxy_size = _tmp8_;
		_proxy_index = -1;
		while (TRUE) {
			gint _tmp9_;
			gint _tmp10_;
			XmppXepSocks5BytestreamsProxy* proxy = NULL;
			GeeList* _tmp11_;
			gpointer _tmp12_;
			GeeList* _tmp13_;
			gchar* _tmp14_;
			gchar* _tmp15_;
			XmppXepSocks5BytestreamsProxy* _tmp16_;
			XmppXepJingleSocks5BytestreamsCandidate* _tmp17_;
			XmppXepJingleSocks5BytestreamsCandidate* _tmp18_;
			_proxy_index = _proxy_index + 1;
			_tmp9_ = _proxy_index;
			_tmp10_ = _proxy_size;
			if (!(_tmp9_ < _tmp10_)) {
				break;
			}
			_tmp11_ = _proxy_list;
			_tmp12_ = gee_list_get (_tmp11_, _proxy_index);
			proxy = (XmppXepSocks5BytestreamsProxy*) _tmp12_;
			_tmp13_ = _result_;
			_tmp14_ = xmpp_random_uuid ();
			_tmp15_ = _tmp14_;
			_tmp16_ = proxy;
			_tmp17_ = xmpp_xep_jingle_socks5_bytestreams_candidate_new_proxy (_tmp15_, _tmp16_, i);
			_tmp18_ = _tmp17_;
			gee_collection_add ((GeeCollection*) _tmp13_, _tmp18_);
			_g_object_unref0 (_tmp18_);
			_g_free0 (_tmp15_);
			i -= 1;
			_g_object_unref0 (proxy);
		}
		_g_object_unref0 (_proxy_list);
	}
	result = _result_;
	return result;
}

static GeeList*
xmpp_xep_jingle_socks5_bytestreams_module_start_local_listeners (XmppXepJingleSocks5BytestreamsModule* self,
                                                                 XmppXmppStream* stream,
                                                                 XmppJid* local_full_jid,
                                                                 const gchar* dstaddr,
                                                                 XmppXepJingleSocks5BytestreamsLocalListener** local_listener)
{
	XmppXepJingleSocks5BytestreamsLocalListener* _vala_local_listener = NULL;
	GeeList* _result_ = NULL;
	GeeArrayList* _tmp0_;
	GSocketListener* listener = NULL;
	GSocketListener* _tmp1_;
	gint i = 0;
	GeeList* _tmp33_;
	gboolean _tmp34_;
	gboolean _tmp35_;
	GError* _inner_error0_ = NULL;
	GeeList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (stream != NULL, NULL);
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (dstaddr != NULL, NULL);
	_tmp0_ = gee_array_list_new (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_result_ = (GeeList*) _tmp0_;
	_tmp1_ = g_socket_listener_new ();
	listener = _tmp1_;
	i = 1 << 15;
	{
		GeeList* _ip_address_list = NULL;
		XmppModuleIdentity* _tmp2_;
		gpointer _tmp3_;
		XmppXepSocks5BytestreamsModule* _tmp4_;
		GeeList* _tmp5_;
		GeeList* _tmp6_;
		gint _ip_address_size = 0;
		GeeList* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		gint _ip_address_index = 0;
		_tmp2_ = xmpp_xep_socks5_bytestreams_module_IDENTITY;
		_tmp3_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_SOCKS5_BYTESTREAMS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_);
		_tmp4_ = (XmppXepSocks5BytestreamsModule*) _tmp3_;
		_tmp5_ = xmpp_xep_socks5_bytestreams_module_get_local_ip_addresses (_tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_ip_address_list = _tmp6_;
		_tmp7_ = _ip_address_list;
		_tmp8_ = gee_collection_get_size ((GeeCollection*) _tmp7_);
		_tmp9_ = _tmp8_;
		_ip_address_size = _tmp9_;
		_ip_address_index = -1;
		while (TRUE) {
			gint _tmp10_;
			gint _tmp11_;
			gchar* ip_address = NULL;
			GeeList* _tmp12_;
			gpointer _tmp13_;
			GInetSocketAddress* addr = NULL;
			const gchar* _tmp14_;
			GInetSocketAddress* _tmp15_;
			GSocketAddress* effective_any = NULL;
			gchar* cid = NULL;
			gchar* _tmp16_;
			GInetSocketAddress* effective = NULL;
			GSocketAddress* _tmp23_;
			GInetSocketAddress* _tmp24_;
			GeeList* _tmp25_;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			GInetSocketAddress* _tmp28_;
			guint _tmp29_;
			guint _tmp30_;
			XmppXepJingleSocks5BytestreamsCandidate* _tmp31_;
			XmppXepJingleSocks5BytestreamsCandidate* _tmp32_;
			_ip_address_index = _ip_address_index + 1;
			_tmp10_ = _ip_address_index;
			_tmp11_ = _ip_address_size;
			if (!(_tmp10_ < _tmp11_)) {
				break;
			}
			_tmp12_ = _ip_address_list;
			_tmp13_ = gee_list_get (_tmp12_, _ip_address_index);
			ip_address = (gchar*) _tmp13_;
			_tmp14_ = ip_address;
			_tmp15_ = (GInetSocketAddress*) g_inet_socket_address_new_from_string (_tmp14_, (guint) 0);
			addr = _tmp15_;
			_tmp16_ = xmpp_random_uuid ();
			cid = _tmp16_;
			{
				GSocketListener* _tmp17_;
				GInetSocketAddress* _tmp18_;
				const gchar* _tmp19_;
				XmppXepJingleSocks5BytestreamsStringWrapper* _tmp20_;
				XmppXepJingleSocks5BytestreamsStringWrapper* _tmp21_;
				GSocketAddress* _tmp22_ = NULL;
				_tmp17_ = listener;
				_tmp18_ = addr;
				_tmp19_ = cid;
				_tmp20_ = xmpp_xep_jingle_socks5_bytestreams_string_wrapper_new (_tmp19_);
				_tmp21_ = _tmp20_;
				g_socket_listener_add_address (_tmp17_, (GSocketAddress*) _tmp18_, G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_DEFAULT, (GObject*) _tmp21_, &_tmp22_, &_inner_error0_);
				_g_object_unref0 (effective_any);
				effective_any = _tmp22_;
				_g_object_unref0 (_tmp21_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
			}
			goto __finally0;
			__catch0_g_error:
			{
				g_clear_error (&_inner_error0_);
				_g_free0 (cid);
				_g_object_unref0 (effective_any);
				_g_object_unref0 (addr);
				_g_free0 (ip_address);
				continue;
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (cid);
				_g_object_unref0 (effective_any);
				_g_object_unref0 (addr);
				_g_free0 (ip_address);
				_g_object_unref0 (_ip_address_list);
				_g_object_unref0 (listener);
				_g_object_unref0 (_result_);
				_xmpp_xep_jingle_socks5_bytestreams_local_listener_unref0 (_vala_local_listener);
				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;
			}
			_tmp23_ = effective_any;
			_tmp24_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, g_inet_socket_address_get_type (), GInetSocketAddress));
			effective = _tmp24_;
			_tmp25_ = _result_;
			_tmp26_ = cid;
			_tmp27_ = ip_address;
			_tmp28_ = effective;
			_tmp29_ = g_inet_socket_address_get_port (_tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = xmpp_xep_jingle_socks5_bytestreams_candidate_new_build (_tmp26_, _tmp27_, local_full_jid, (gint) _tmp30_, i, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_DIRECT);
			_tmp32_ = _tmp31_;
			gee_collection_add ((GeeCollection*) _tmp25_, _tmp32_);
			_g_object_unref0 (_tmp32_);
			i -= 1;
			_g_object_unref0 (effective);
			_g_free0 (cid);
			_g_object_unref0 (effective_any);
			_g_object_unref0 (addr);
			_g_free0 (ip_address);
		}
		_g_object_unref0 (_ip_address_list);
	}
	_tmp33_ = _result_;
	_tmp34_ = gee_collection_get_is_empty ((GeeCollection*) _tmp33_);
	_tmp35_ = _tmp34_;
	if (!_tmp35_) {
		GSocketListener* _tmp36_;
		XmppXepJingleSocks5BytestreamsLocalListener* _tmp37_;
		XmppXepJingleSocks5BytestreamsLocalListener* _tmp38_;
		_tmp36_ = listener;
		_tmp37_ = xmpp_xep_jingle_socks5_bytestreams_local_listener_new (_tmp36_, dstaddr);
		_xmpp_xep_jingle_socks5_bytestreams_local_listener_unref0 (_vala_local_listener);
		_vala_local_listener = _tmp37_;
		_tmp38_ = _vala_local_listener;
		xmpp_xep_jingle_socks5_bytestreams_local_listener_start (_tmp38_);
	} else {
		XmppXepJingleSocks5BytestreamsLocalListener* _tmp39_;
		_tmp39_ = xmpp_xep_jingle_socks5_bytestreams_local_listener_new_empty ();
		_xmpp_xep_jingle_socks5_bytestreams_local_listener_unref0 (_vala_local_listener);
		_vala_local_listener = _tmp39_;
	}
	result = _result_;
	_g_object_unref0 (listener);
	if (local_listener) {
		*local_listener = _vala_local_listener;
	} else {
		_xmpp_xep_jingle_socks5_bytestreams_local_listener_unref0 (_vala_local_listener);
	}
	return result;
}

static gint
__lambda31_ (XmppXepJingleSocks5BytestreamsModule* self,
             XmppXepJingleSocks5BytestreamsCandidate* c1,
             XmppXepJingleSocks5BytestreamsCandidate* c2)
{
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gint result;
	g_return_val_if_fail (c1 != NULL, -1);
	g_return_val_if_fail (c2 != NULL, -1);
	_tmp0_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (c1);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (c2);
	_tmp3_ = _tmp2_;
	if (_tmp1_ < _tmp3_) {
		result = 1;
		return result;
	}
	_tmp4_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (c1);
	_tmp5_ = _tmp4_;
	_tmp6_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (c2);
	_tmp7_ = _tmp6_;
	if (_tmp5_ > _tmp7_) {
		result = -1;
		return result;
	}
	result = 0;
	return result;
}

static gint
___lambda31__gcompare_data_func (gconstpointer a,
                                 gconstpointer b,
                                 gpointer self)
{
	gint result;
	result = __lambda31_ ((XmppXepJingleSocks5BytestreamsModule*) self, (XmppXepJingleSocks5BytestreamsCandidate*) a, (XmppXepJingleSocks5BytestreamsCandidate*) b);
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_module_select_candidates (XmppXepJingleSocks5BytestreamsModule* self,
                                                             XmppXmppStream* stream,
                                                             XmppJid* local_full_jid,
                                                             const gchar* dstaddr,
                                                             XmppXepJingleSocks5BytestreamsParameters* _result_)
{
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	GeeList* _tmp2_;
	GeeList* _tmp3_;
	XmppXepJingleSocks5BytestreamsLocalListener* _tmp4_ = NULL;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	GeeList* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (local_full_jid != NULL);
	g_return_if_fail (dstaddr != NULL);
	g_return_if_fail (_result_ != NULL);
	_tmp0_ = _result_->local_candidates;
	_tmp1_ = xmpp_xep_jingle_socks5_bytestreams_module_get_proxies (self, stream);
	_tmp2_ = _tmp1_;
	gee_collection_add_all ((GeeCollection*) _tmp0_, (GeeCollection*) _tmp2_);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = _result_->local_candidates;
	_tmp5_ = xmpp_xep_jingle_socks5_bytestreams_module_start_local_listeners (self, stream, local_full_jid, dstaddr, &_tmp4_);
	_xmpp_xep_jingle_socks5_bytestreams_local_listener_unref0 (_result_->listener);
	_result_->listener = _tmp4_;
	_tmp6_ = _tmp5_;
	gee_collection_add_all ((GeeCollection*) _tmp3_, (GeeCollection*) _tmp6_);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = _result_->local_candidates;
	gee_list_sort (_tmp7_, ___lambda31__gcompare_data_func, g_object_ref (self), g_object_unref);
}

static XmppXepJingleTransportParameters*
xmpp_xep_jingle_socks5_bytestreams_module_real_create_transport_parameters (XmppXepJingleTransport* base,
                                                                            XmppXmppStream* stream,
                                                                            guint8 components,
                                                                            XmppJid* local_full_jid,
                                                                            XmppJid* peer_full_jid,
                                                                            GError** error)
{
	XmppXepJingleSocks5BytestreamsModule * self;
	XmppXepJingleSocks5BytestreamsParameters* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp2_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp3_;
	gchar* dstaddr = NULL;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	XmppXepJingleTransportParameters* result;
	self = (XmppXepJingleSocks5BytestreamsModule*) base;
	g_return_val_if_fail (stream != NULL, NULL);
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	_vala_assert (((gint) components) == 1, "components == 1");
	_tmp0_ = xmpp_random_uuid ();
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_xep_jingle_socks5_bytestreams_parameters_new_create (local_full_jid, peer_full_jid, _tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	_result_ = _tmp3_;
	_tmp4_ = xmpp_xep_jingle_socks5_bytestreams_parameters_get_sid (_result_);
	_tmp5_ = _tmp4_;
	_tmp6_ = xmpp_xep_jingle_socks5_bytestreams_calculate_dstaddr (_tmp5_, local_full_jid, peer_full_jid);
	dstaddr = _tmp6_;
	xmpp_xep_jingle_socks5_bytestreams_module_select_candidates (self, stream, local_full_jid, dstaddr, _result_);
	result = (XmppXepJingleTransportParameters*) _result_;
	_g_free0 (dstaddr);
	return result;
}

static XmppXepJingleTransportParameters*
xmpp_xep_jingle_socks5_bytestreams_module_real_parse_transport_parameters (XmppXepJingleTransport* base,
                                                                           XmppXmppStream* stream,
                                                                           guint8 components,
                                                                           XmppJid* local_full_jid,
                                                                           XmppJid* peer_full_jid,
                                                                           XmppStanzaNode* transport,
                                                                           GError** error)
{
	XmppXepJingleSocks5BytestreamsModule * self;
	XmppXepJingleSocks5BytestreamsParameters* _result_ = NULL;
	XmppXepJingleSocks5BytestreamsParameters* _tmp0_;
	gchar* dstaddr = NULL;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	GError* _inner_error0_ = NULL;
	XmppXepJingleTransportParameters* result;
	self = (XmppXepJingleSocks5BytestreamsModule*) base;
	g_return_val_if_fail (stream != NULL, NULL);
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	g_return_val_if_fail (transport != NULL, NULL);
	_tmp0_ = xmpp_xep_jingle_socks5_bytestreams_parameters_parse (local_full_jid, peer_full_jid, transport, &_inner_error0_);
	_result_ = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return NULL;
		} else {
			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;
		}
	}
	_tmp1_ = xmpp_xep_jingle_socks5_bytestreams_parameters_get_sid (_result_);
	_tmp2_ = _tmp1_;
	_tmp3_ = xmpp_xep_jingle_socks5_bytestreams_calculate_dstaddr (_tmp2_, local_full_jid, peer_full_jid);
	dstaddr = _tmp3_;
	_tmp4_ = dstaddr;
	xmpp_xep_jingle_socks5_bytestreams_module_select_candidates (self, stream, local_full_jid, _tmp4_, _result_);
	result = (XmppXepJingleTransportParameters*) _result_;
	_g_free0 (dstaddr);
	return result;
}

XmppXepJingleSocks5BytestreamsModule*
xmpp_xep_jingle_socks5_bytestreams_module_construct (GType object_type)
{
	XmppXepJingleSocks5BytestreamsModule * self = NULL;
	self = (XmppXepJingleSocks5BytestreamsModule*) xmpp_xmpp_stream_module_construct (object_type);
	return self;
}

XmppXepJingleSocks5BytestreamsModule*
xmpp_xep_jingle_socks5_bytestreams_module_new (void)
{
	return xmpp_xep_jingle_socks5_bytestreams_module_construct (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_MODULE);
}

static const gchar*
xmpp_xep_jingle_socks5_bytestreams_module_real_get_ns_uri (XmppXepJingleTransport* base)
{
	const gchar* result;
	XmppXepJingleSocks5BytestreamsModule* self;
	self = (XmppXepJingleSocks5BytestreamsModule*) base;
	result = XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI;
	return result;
}

static XmppXepJingleTransportType
xmpp_xep_jingle_socks5_bytestreams_module_real_get_type_ (XmppXepJingleTransport* base)
{
	XmppXepJingleTransportType result;
	XmppXepJingleSocks5BytestreamsModule* self;
	self = (XmppXepJingleSocks5BytestreamsModule*) base;
	result = XMPP_XEP_JINGLE_TRANSPORT_TYPE_STREAMING;
	return result;
}

static gint
xmpp_xep_jingle_socks5_bytestreams_module_real_get_priority (XmppXepJingleTransport* base)
{
	gint result;
	XmppXepJingleSocks5BytestreamsModule* self;
	self = (XmppXepJingleSocks5BytestreamsModule*) base;
	result = 1;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_module_class_init (XmppXepJingleSocks5BytestreamsModuleClass * klass,
                                                      gpointer klass_data)
{
	XmppModuleIdentity* _tmp0_;
	xmpp_xep_jingle_socks5_bytestreams_module_parent_class = g_type_class_peek_parent (klass);
	((XmppXmppStreamModuleClass *) klass)->attach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_jingle_socks5_bytestreams_module_real_attach;
	((XmppXmppStreamModuleClass *) klass)->detach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_jingle_socks5_bytestreams_module_real_detach;
	((XmppXmppStreamModuleClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_jingle_socks5_bytestreams_module_real_get_ns;
	((XmppXmppStreamModuleClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_jingle_socks5_bytestreams_module_real_get_id;
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_socks5_bytestreams_module_get_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_socks5_bytestreams_module_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_NS_URI_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_module_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_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_SOCKS5_BYTESTREAMS_MODULE_TYPE__PROPERTY, xmpp_xep_jingle_socks5_bytestreams_module_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_TYPE__PROPERTY] = g_param_spec_enum ("type-", "type-", "type-", XMPP_XEP_JINGLE_TYPE_TRANSPORT_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_PRIORITY_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_module_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_PRIORITY_PROPERTY] = g_param_spec_int ("priority", "priority", "priority", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	_tmp0_ = xmpp_module_identity_new (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, "0260_jingle_socks5_bytestreams");
	xmpp_xep_jingle_socks5_bytestreams_module_IDENTITY = _tmp0_;
}

static void
xmpp_xep_jingle_socks5_bytestreams_module_xmpp_xep_jingle_transport_interface_init (XmppXepJingleTransportIface * iface,
                                                                                    gpointer iface_data)
{
	xmpp_xep_jingle_socks5_bytestreams_module_xmpp_xep_jingle_transport_parent_iface = g_type_interface_peek_parent (iface);
	iface->is_transport_available = (void (*) (XmppXepJingleTransport*, XmppXmppStream*, guint8, XmppJid*, GAsyncReadyCallback, gpointer)) xmpp_xep_jingle_socks5_bytestreams_module_real_is_transport_available;
	iface->is_transport_available_finish = (gboolean (*) (XmppXepJingleTransport*, GAsyncResult*)) xmpp_xep_jingle_socks5_bytestreams_module_is_transport_available_finish;
	iface->create_transport_parameters = (XmppXepJingleTransportParameters* (*) (XmppXepJingleTransport*, XmppXmppStream*, guint8, XmppJid*, XmppJid*, GError**)) xmpp_xep_jingle_socks5_bytestreams_module_real_create_transport_parameters;
	iface->parse_transport_parameters = (XmppXepJingleTransportParameters* (*) (XmppXepJingleTransport*, XmppXmppStream*, guint8, XmppJid*, XmppJid*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_socks5_bytestreams_module_real_parse_transport_parameters;
	iface->get_ns_uri = xmpp_xep_jingle_socks5_bytestreams_module_real_get_ns_uri;
	iface->get_type_ = xmpp_xep_jingle_socks5_bytestreams_module_real_get_type_;
	iface->get_priority = xmpp_xep_jingle_socks5_bytestreams_module_real_get_priority;
}

static void
xmpp_xep_jingle_socks5_bytestreams_module_instance_init (XmppXepJingleSocks5BytestreamsModule * self,
                                                         gpointer klass)
{
}

static void
xmpp_xep_jingle_socks5_bytestreams_module_finalize (GObject * obj)
{
	XmppXepJingleSocks5BytestreamsModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_MODULE, XmppXepJingleSocks5BytestreamsModule);
	G_OBJECT_CLASS (xmpp_xep_jingle_socks5_bytestreams_module_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_socks5_bytestreams_module_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleSocks5BytestreamsModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_socks5_bytestreams_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleSocks5BytestreamsModule), 0, (GInstanceInitFunc) xmpp_xep_jingle_socks5_bytestreams_module_instance_init, NULL };
	static const GInterfaceInfo xmpp_xep_jingle_transport_info = { (GInterfaceInitFunc) xmpp_xep_jingle_socks5_bytestreams_module_xmpp_xep_jingle_transport_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_jingle_socks5_bytestreams_module_type_id;
	xmpp_xep_jingle_socks5_bytestreams_module_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_MODULE, "XmppXepJingleSocks5BytestreamsModule", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_jingle_socks5_bytestreams_module_type_id, XMPP_XEP_JINGLE_TYPE_TRANSPORT, &xmpp_xep_jingle_transport_info);
	return xmpp_xep_jingle_socks5_bytestreams_module_type_id;
}

GType
xmpp_xep_jingle_socks5_bytestreams_module_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_socks5_bytestreams_module_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_socks5_bytestreams_module_type_id__once)) {
		GType xmpp_xep_jingle_socks5_bytestreams_module_type_id;
		xmpp_xep_jingle_socks5_bytestreams_module_type_id = xmpp_xep_jingle_socks5_bytestreams_module_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_socks5_bytestreams_module_type_id__once, xmpp_xep_jingle_socks5_bytestreams_module_type_id);
	}
	return xmpp_xep_jingle_socks5_bytestreams_module_type_id__once;
}

static void
_vala_xmpp_xep_jingle_socks5_bytestreams_module_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec)
{
	XmppXepJingleSocks5BytestreamsModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_MODULE, XmppXepJingleSocks5BytestreamsModule);
	switch (property_id) {
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_NS_URI_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_transport_get_ns_uri ((XmppXepJingleTransport*) self));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_TYPE__PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_transport_get_type_ ((XmppXepJingleTransport*) self));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_MODULE_PRIORITY_PROPERTY:
		g_value_set_int (value, xmpp_xep_jingle_transport_get_priority ((XmppXepJingleTransport*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

gchar*
xmpp_xep_jingle_socks5_bytestreams_calculate_dstaddr (const gchar* sid,
                                                      XmppJid* first_jid,
                                                      XmppJid* second_jid)
{
	gchar* hashed = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* result;
	g_return_val_if_fail (sid != NULL, NULL);
	g_return_val_if_fail (first_jid != NULL, NULL);
	g_return_val_if_fail (second_jid != NULL, NULL);
	_tmp0_ = xmpp_jid_to_string (first_jid);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strconcat (sid, _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = xmpp_jid_to_string (second_jid);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strconcat (_tmp3_, _tmp5_, NULL);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	hashed = _tmp7_;
	_tmp8_ = g_compute_checksum_for_string (G_CHECKSUM_SHA1, hashed, (gsize) -1);
	result = _tmp8_;
	_g_free0 (hashed);
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

XmppXepJingleSocks5BytestreamsCandidateType
xmpp_xep_jingle_socks5_bytestreams_candidate_type_parse (const gchar* type,
                                                         GError** error)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	static GQuark _tmp1_label3 = 0;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GError* _tmp6_;
	GError* _tmp7_;
	GError* _inner_error0_ = NULL;
	XmppXepJingleSocks5BytestreamsCandidateType result;
	g_return_val_if_fail (type != NULL, 0);
	_tmp0_ = type;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("assisted")))) {
		switch (0) {
			default:
			{
				result = XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_ASSISTED;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("direct")))) {
		switch (0) {
			default:
			{
				result = XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_DIRECT;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("proxy")))) {
		switch (0) {
			default:
			{
				result = XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_PROXY;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("tunnel")))) {
		switch (0) {
			default:
			{
				result = XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_TUNNEL;
				return result;
			}
		}
	}
	_tmp3_ = string_to_string (type);
	_tmp4_ = g_strconcat ("unknown candidate type ", _tmp3_, NULL);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, _tmp5_);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	_inner_error0_ = _tmp7_;
	if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
		g_propagate_error (error, _inner_error0_);
		return 0;
	} else {
		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 0;
	}
}

gchar*
xmpp_xep_jingle_socks5_bytestreams_candidate_type_to_string (XmppXepJingleSocks5BytestreamsCandidateType self)
{
	gchar* result;
	switch (self) {
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_ASSISTED:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("assisted");
			result = _tmp0_;
			return result;
		}
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_DIRECT:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("direct");
			result = _tmp1_;
			return result;
		}
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_PROXY:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("proxy");
			result = _tmp2_;
			return result;
		}
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_TUNNEL:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("tunnel");
			result = _tmp3_;
			return result;
		}
		default:
		break;
	}
	g_assert_not_reached ();
}

static gint
xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_preference_impl (XmppXepJingleSocks5BytestreamsCandidateType self)
{
	gint result;
	switch (self) {
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_ASSISTED:
		{
			result = 120;
			return result;
		}
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_DIRECT:
		{
			result = 126;
			return result;
		}
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_PROXY:
		{
			result = 10;
			return result;
		}
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_TUNNEL:
		{
			result = 110;
			return result;
		}
		default:
		break;
	}
	g_assert_not_reached ();
}

gint
xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_preference (XmppXepJingleSocks5BytestreamsCandidateType self)
{
	gint result;
	result = xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_preference_impl (self) << 16;
	return result;
}

static GType
xmpp_xep_jingle_socks5_bytestreams_candidate_type_get_type_once (void)
{
	static const GEnumValue values[] = {{XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_ASSISTED, "XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_ASSISTED", "assisted"}, {XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_DIRECT, "XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_DIRECT", "direct"}, {XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_PROXY, "XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_PROXY", "proxy"}, {XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_TUNNEL, "XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_TUNNEL", "tunnel"}, {0, NULL, NULL}};
	GType xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_id;
	xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_id = g_enum_register_static ("XmppXepJingleSocks5BytestreamsCandidateType", values);
	return xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_id;
}

GType
xmpp_xep_jingle_socks5_bytestreams_candidate_type_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_id__once)) {
		GType xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_id;
		xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_id = xmpp_xep_jingle_socks5_bytestreams_candidate_type_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_id__once, xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_id);
	}
	return xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_id__once;
}

static inline gpointer
xmpp_xep_jingle_socks5_bytestreams_candidate_get_instance_private (XmppXepJingleSocks5BytestreamsCandidate* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleSocks5BytestreamsCandidate_private_offset);
}

static XmppXepJingleSocks5BytestreamsCandidate*
xmpp_xep_jingle_socks5_bytestreams_candidate_construct (GType object_type,
                                                        const gchar* cid,
                                                        const gchar* host,
                                                        XmppJid* jid,
                                                        gint port,
                                                        gint priority,
                                                        XmppXepJingleSocks5BytestreamsCandidateType type)
{
	XmppXepJingleSocks5BytestreamsCandidate * self = NULL;
	g_return_val_if_fail (cid != NULL, NULL);
	g_return_val_if_fail (host != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	self = (XmppXepJingleSocks5BytestreamsCandidate*) xmpp_xep_socks5_bytestreams_proxy_construct (object_type, host, jid, port);
	xmpp_xep_jingle_socks5_bytestreams_candidate_set_cid (self, cid);
	xmpp_xep_jingle_socks5_bytestreams_candidate_set_priority (self, priority);
	xmpp_xep_jingle_socks5_bytestreams_candidate_set_type_ (self, type);
	return self;
}

static XmppXepJingleSocks5BytestreamsCandidate*
xmpp_xep_jingle_socks5_bytestreams_candidate_new (const gchar* cid,
                                                  const gchar* host,
                                                  XmppJid* jid,
                                                  gint port,
                                                  gint priority,
                                                  XmppXepJingleSocks5BytestreamsCandidateType type)
{
	return xmpp_xep_jingle_socks5_bytestreams_candidate_construct (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE, cid, host, jid, port, priority, type);
}

XmppXepJingleSocks5BytestreamsCandidate*
xmpp_xep_jingle_socks5_bytestreams_candidate_construct_build (GType object_type,
                                                              const gchar* cid,
                                                              const gchar* host,
                                                              XmppJid* jid,
                                                              gint port,
                                                              gint local_priority,
                                                              XmppXepJingleSocks5BytestreamsCandidateType type)
{
	XmppXepJingleSocks5BytestreamsCandidate * self = NULL;
	g_return_val_if_fail (cid != NULL, NULL);
	g_return_val_if_fail (host != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	self = (XmppXepJingleSocks5BytestreamsCandidate*) xmpp_xep_jingle_socks5_bytestreams_candidate_construct (object_type, cid, host, jid, port, xmpp_xep_jingle_socks5_bytestreams_candidate_type_type_preference (type) + local_priority, type);
	return self;
}

XmppXepJingleSocks5BytestreamsCandidate*
xmpp_xep_jingle_socks5_bytestreams_candidate_new_build (const gchar* cid,
                                                        const gchar* host,
                                                        XmppJid* jid,
                                                        gint port,
                                                        gint local_priority,
                                                        XmppXepJingleSocks5BytestreamsCandidateType type)
{
	return xmpp_xep_jingle_socks5_bytestreams_candidate_construct_build (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE, cid, host, jid, port, local_priority, type);
}

XmppXepJingleSocks5BytestreamsCandidate*
xmpp_xep_jingle_socks5_bytestreams_candidate_construct_proxy (GType object_type,
                                                              const gchar* cid,
                                                              XmppXepSocks5BytestreamsProxy* proxy,
                                                              gint local_priority)
{
	XmppXepJingleSocks5BytestreamsCandidate * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	g_return_val_if_fail (cid != NULL, NULL);
	g_return_val_if_fail (proxy != NULL, NULL);
	_tmp0_ = xmpp_xep_socks5_bytestreams_proxy_get_host (proxy);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_xep_socks5_bytestreams_proxy_get_jid (proxy);
	_tmp3_ = _tmp2_;
	_tmp4_ = xmpp_xep_socks5_bytestreams_proxy_get_port (proxy);
	_tmp5_ = _tmp4_;
	self = (XmppXepJingleSocks5BytestreamsCandidate*) xmpp_xep_jingle_socks5_bytestreams_candidate_construct_build (object_type, cid, _tmp1_, _tmp3_, _tmp5_, local_priority, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_PROXY);
	return self;
}

XmppXepJingleSocks5BytestreamsCandidate*
xmpp_xep_jingle_socks5_bytestreams_candidate_new_proxy (const gchar* cid,
                                                        XmppXepSocks5BytestreamsProxy* proxy,
                                                        gint local_priority)
{
	return xmpp_xep_jingle_socks5_bytestreams_candidate_construct_proxy (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE, cid, proxy, local_priority);
}

XmppXepJingleSocks5BytestreamsCandidate*
xmpp_xep_jingle_socks5_bytestreams_candidate_parse (XmppStanzaNode* candidate,
                                                    GError** error)
{
	gchar* cid = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* host = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* jid_str = NULL;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	XmppJid* jid = NULL;
	gint _tmp10_ = 0;
	const gchar* _tmp11_;
	gint port = 0;
	gint priority = 0;
	gchar* type_str = NULL;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	XmppXepJingleSocks5BytestreamsCandidateType _tmp14_ = 0;
	const gchar* _tmp15_;
	XmppXepJingleSocks5BytestreamsCandidateType type = 0;
	gboolean _tmp17_ = FALSE;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_ = FALSE;
	gboolean _tmp20_ = FALSE;
	const gchar* _tmp21_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	XmppJid* _tmp27_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp28_;
	GError* _inner_error0_ = NULL;
	XmppXepJingleSocks5BytestreamsCandidate* result;
	g_return_val_if_fail (candidate != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_get_attribute (candidate, "cid", NULL);
	_tmp1_ = g_strdup (_tmp0_);
	cid = _tmp1_;
	_tmp2_ = xmpp_stanza_node_get_attribute (candidate, "host", NULL);
	_tmp3_ = g_strdup (_tmp2_);
	host = _tmp3_;
	_tmp4_ = xmpp_stanza_node_get_attribute (candidate, "jid", NULL);
	_tmp5_ = g_strdup (_tmp4_);
	jid_str = _tmp5_;
	jid = NULL;
	{
		XmppJid* _tmp6_ = NULL;
		const gchar* _tmp7_;
		XmppJid* _tmp8_;
		XmppJid* _tmp9_;
		_tmp7_ = jid_str;
		_tmp8_ = xmpp_jid_new (_tmp7_, &_inner_error0_);
		_tmp6_ = _tmp8_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
				goto __catch0_xmpp_invalid_jid_error;
			}
			_xmpp_jid_unref0 (jid);
			_g_free0 (jid_str);
			_g_free0 (host);
			_g_free0 (cid);
			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;
		}
		_tmp9_ = _tmp6_;
		_tmp6_ = NULL;
		_xmpp_jid_unref0 (jid);
		jid = _tmp9_;
		_xmpp_jid_unref0 (_tmp6_);
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_xmpp_jid_unref0 (jid);
			_g_free0 (jid_str);
			_g_free0 (host);
			_g_free0 (cid);
			return NULL;
		} else {
			_xmpp_jid_unref0 (jid);
			_g_free0 (jid_str);
			_g_free0 (host);
			_g_free0 (cid);
			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;
		}
	}
	_tmp11_ = xmpp_stanza_node_get_attribute (candidate, "port", NULL);
	if (_tmp11_ != NULL) {
		_tmp10_ = xmpp_stanza_node_get_attribute_int (candidate, "port", -1, NULL);
	} else {
		_tmp10_ = 1080;
	}
	port = _tmp10_;
	priority = xmpp_stanza_node_get_attribute_int (candidate, "priority", -1, NULL);
	_tmp12_ = xmpp_stanza_node_get_attribute (candidate, "type", NULL);
	_tmp13_ = g_strdup (_tmp12_);
	type_str = _tmp13_;
	_tmp15_ = type_str;
	if (_tmp15_ != NULL) {
		const gchar* _tmp16_;
		_tmp16_ = type_str;
		_tmp14_ = xmpp_xep_jingle_socks5_bytestreams_candidate_type_parse (_tmp16_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_g_free0 (type_str);
				_xmpp_jid_unref0 (jid);
				_g_free0 (jid_str);
				_g_free0 (host);
				_g_free0 (cid);
				return NULL;
			} else {
				_g_free0 (type_str);
				_xmpp_jid_unref0 (jid);
				_g_free0 (jid_str);
				_g_free0 (host);
				_g_free0 (cid);
				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;
			}
		}
	} else {
		_tmp14_ = XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_DIRECT;
	}
	type = _tmp14_;
	_tmp21_ = cid;
	if (_tmp21_ == NULL) {
		_tmp20_ = TRUE;
	} else {
		const gchar* _tmp22_;
		_tmp22_ = host;
		_tmp20_ = _tmp22_ == NULL;
	}
	if (_tmp20_) {
		_tmp19_ = TRUE;
	} else {
		XmppJid* _tmp23_;
		_tmp23_ = jid;
		_tmp19_ = _tmp23_ == NULL;
	}
	if (_tmp19_) {
		_tmp18_ = TRUE;
	} else {
		_tmp18_ = port <= 0;
	}
	if (_tmp18_) {
		_tmp17_ = TRUE;
	} else {
		_tmp17_ = priority <= 0;
	}
	if (_tmp17_) {
		GError* _tmp24_;
		_tmp24_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "missing or invalid cid, host, jid or port");
		_inner_error0_ = _tmp24_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_free0 (type_str);
			_xmpp_jid_unref0 (jid);
			_g_free0 (jid_str);
			_g_free0 (host);
			_g_free0 (cid);
			return NULL;
		} else {
			_g_free0 (type_str);
			_xmpp_jid_unref0 (jid);
			_g_free0 (jid_str);
			_g_free0 (host);
			_g_free0 (cid);
			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;
		}
	}
	_tmp25_ = cid;
	_tmp26_ = host;
	_tmp27_ = jid;
	_tmp28_ = xmpp_xep_jingle_socks5_bytestreams_candidate_new (_tmp25_, _tmp26_, _tmp27_, port, priority, type);
	result = _tmp28_;
	_g_free0 (type_str);
	_xmpp_jid_unref0 (jid);
	_g_free0 (jid_str);
	_g_free0 (host);
	_g_free0 (cid);
	return result;
}

XmppStanzaNode*
xmpp_xep_jingle_socks5_bytestreams_candidate_to_xml (XmppXepJingleSocks5BytestreamsCandidate* self)
{
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	const gchar* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppJid* _tmp9_;
	XmppJid* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	XmppStanzaNode* _tmp13_;
	XmppStanzaNode* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	XmppStanzaNode* _tmp19_;
	XmppStanzaNode* _tmp20_;
	gint _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	XmppStanzaNode* _tmp24_;
	XmppStanzaNode* _tmp25_;
	XmppXepJingleSocks5BytestreamsCandidateType _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	XmppStanzaNode* _tmp29_;
	XmppStanzaNode* _tmp30_;
	XmppStanzaNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_new_build ("candidate", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_cid;
	_tmp3_ = xmpp_stanza_node_put_attribute (_tmp1_, "cid", _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = xmpp_xep_socks5_bytestreams_proxy_get_host ((XmppXepSocks5BytestreamsProxy*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = xmpp_stanza_node_put_attribute (_tmp4_, "host", _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = xmpp_xep_socks5_bytestreams_proxy_get_jid ((XmppXepSocks5BytestreamsProxy*) self);
	_tmp10_ = _tmp9_;
	_tmp11_ = xmpp_jid_to_string (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = xmpp_stanza_node_put_attribute (_tmp8_, "jid", _tmp12_, NULL);
	_tmp14_ = _tmp13_;
	_tmp15_ = xmpp_xep_socks5_bytestreams_proxy_get_port ((XmppXepSocks5BytestreamsProxy*) self);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_strdup_printf ("%i", _tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = xmpp_stanza_node_put_attribute (_tmp14_, "port", _tmp18_, NULL);
	_tmp20_ = _tmp19_;
	_tmp21_ = self->priv->_priority;
	_tmp22_ = g_strdup_printf ("%i", _tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = xmpp_stanza_node_put_attribute (_tmp20_, "priority", _tmp23_, NULL);
	_tmp25_ = _tmp24_;
	_tmp26_ = self->priv->_type_;
	_tmp27_ = xmpp_xep_jingle_socks5_bytestreams_candidate_type_to_string (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = xmpp_stanza_node_put_attribute (_tmp25_, "type", _tmp28_, NULL);
	_tmp30_ = _tmp29_;
	_g_free0 (_tmp28_);
	_xmpp_stanza_entry_unref0 (_tmp25_);
	_g_free0 (_tmp23_);
	_xmpp_stanza_entry_unref0 (_tmp20_);
	_g_free0 (_tmp18_);
	_xmpp_stanza_entry_unref0 (_tmp14_);
	_g_free0 (_tmp12_);
	_xmpp_stanza_entry_unref0 (_tmp8_);
	_xmpp_stanza_entry_unref0 (_tmp4_);
	_xmpp_stanza_entry_unref0 (_tmp1_);
	result = _tmp30_;
	return result;
}

const gchar*
xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (XmppXepJingleSocks5BytestreamsCandidate* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_cid;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_candidate_set_cid (XmppXepJingleSocks5BytestreamsCandidate* self,
                                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_cid);
		self->priv->_cid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_socks5_bytestreams_candidate_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_CID_PROPERTY]);
	}
}

gint
xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (XmppXepJingleSocks5BytestreamsCandidate* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_priority;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_candidate_set_priority (XmppXepJingleSocks5BytestreamsCandidate* self,
                                                           gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (self);
	if (old_value != value) {
		self->priv->_priority = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_socks5_bytestreams_candidate_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_PRIORITY_PROPERTY]);
	}
}

XmppXepJingleSocks5BytestreamsCandidateType
xmpp_xep_jingle_socks5_bytestreams_candidate_get_type_ (XmppXepJingleSocks5BytestreamsCandidate* self)
{
	XmppXepJingleSocks5BytestreamsCandidateType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_type_;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_candidate_set_type_ (XmppXepJingleSocks5BytestreamsCandidate* self,
                                                        XmppXepJingleSocks5BytestreamsCandidateType value)
{
	XmppXepJingleSocks5BytestreamsCandidateType old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_socks5_bytestreams_candidate_get_type_ (self);
	if (old_value != value) {
		self->priv->_type_ = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_socks5_bytestreams_candidate_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE__PROPERTY]);
	}
}

static void
xmpp_xep_jingle_socks5_bytestreams_candidate_class_init (XmppXepJingleSocks5BytestreamsCandidateClass * klass,
                                                         gpointer klass_data)
{
	xmpp_xep_jingle_socks5_bytestreams_candidate_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleSocks5BytestreamsCandidate_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_socks5_bytestreams_candidate_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_socks5_bytestreams_candidate_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_socks5_bytestreams_candidate_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_CID_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_candidate_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_CID_PROPERTY] = g_param_spec_string ("cid", "cid", "cid", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_PRIORITY_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_candidate_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_PRIORITY_PROPERTY] = g_param_spec_int ("priority", "priority", "priority", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE__PROPERTY, xmpp_xep_jingle_socks5_bytestreams_candidate_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE__PROPERTY] = g_param_spec_enum ("type-", "type-", "type-", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
xmpp_xep_jingle_socks5_bytestreams_candidate_instance_init (XmppXepJingleSocks5BytestreamsCandidate * self,
                                                            gpointer klass)
{
	self->priv = xmpp_xep_jingle_socks5_bytestreams_candidate_get_instance_private (self);
}

static void
xmpp_xep_jingle_socks5_bytestreams_candidate_finalize (GObject * obj)
{
	XmppXepJingleSocks5BytestreamsCandidate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE, XmppXepJingleSocks5BytestreamsCandidate);
	_g_free0 (self->priv->_cid);
	G_OBJECT_CLASS (xmpp_xep_jingle_socks5_bytestreams_candidate_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_socks5_bytestreams_candidate_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleSocks5BytestreamsCandidateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_socks5_bytestreams_candidate_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleSocks5BytestreamsCandidate), 0, (GInstanceInitFunc) xmpp_xep_jingle_socks5_bytestreams_candidate_instance_init, NULL };
	GType xmpp_xep_jingle_socks5_bytestreams_candidate_type_id;
	xmpp_xep_jingle_socks5_bytestreams_candidate_type_id = g_type_register_static (XMPP_XEP_SOCKS5_BYTESTREAMS_TYPE_PROXY, "XmppXepJingleSocks5BytestreamsCandidate", &g_define_type_info, 0);
	XmppXepJingleSocks5BytestreamsCandidate_private_offset = g_type_add_instance_private (xmpp_xep_jingle_socks5_bytestreams_candidate_type_id, sizeof (XmppXepJingleSocks5BytestreamsCandidatePrivate));
	return xmpp_xep_jingle_socks5_bytestreams_candidate_type_id;
}

GType
xmpp_xep_jingle_socks5_bytestreams_candidate_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_socks5_bytestreams_candidate_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_socks5_bytestreams_candidate_type_id__once)) {
		GType xmpp_xep_jingle_socks5_bytestreams_candidate_type_id;
		xmpp_xep_jingle_socks5_bytestreams_candidate_type_id = xmpp_xep_jingle_socks5_bytestreams_candidate_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_socks5_bytestreams_candidate_type_id__once, xmpp_xep_jingle_socks5_bytestreams_candidate_type_id);
	}
	return xmpp_xep_jingle_socks5_bytestreams_candidate_type_id__once;
}

static void
_vala_xmpp_xep_jingle_socks5_bytestreams_candidate_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec)
{
	XmppXepJingleSocks5BytestreamsCandidate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE, XmppXepJingleSocks5BytestreamsCandidate);
	switch (property_id) {
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_CID_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (self));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_PRIORITY_PROPERTY:
		g_value_set_int (value, xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (self));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE__PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_socks5_bytestreams_candidate_get_type_ (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_socks5_bytestreams_candidate_set_property (GObject * object,
                                                                 guint property_id,
                                                                 const GValue * value,
                                                                 GParamSpec * pspec)
{
	XmppXepJingleSocks5BytestreamsCandidate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE, XmppXepJingleSocks5BytestreamsCandidate);
	switch (property_id) {
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_CID_PROPERTY:
		xmpp_xep_jingle_socks5_bytestreams_candidate_set_cid (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_PRIORITY_PROPERTY:
		xmpp_xep_jingle_socks5_bytestreams_candidate_set_priority (self, g_value_get_int (value));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE__PROPERTY:
		xmpp_xep_jingle_socks5_bytestreams_candidate_set_type_ (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

gboolean
xmpp_xep_jingle_socks5_bytestreams_bytes_equal (guint8* a,
                                                gint a_length1,
                                                guint8* b,
                                                gint b_length1)
{
	gboolean result;
	if (a_length1 != b_length1) {
		result = FALSE;
		return result;
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				guint8 _tmp2_;
				guint8 _tmp3_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < a_length1)) {
					break;
				}
				_tmp2_ = a[i];
				_tmp3_ = b[i];
				if (_tmp2_ != _tmp3_) {
					result = FALSE;
					return result;
				}
			}
		}
	}
	result = TRUE;
	return result;
}

static inline gpointer
xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_instance_private (XmppXepJingleSocks5BytestreamsStringWrapper* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleSocks5BytestreamsStringWrapper_private_offset);
}

XmppXepJingleSocks5BytestreamsStringWrapper*
xmpp_xep_jingle_socks5_bytestreams_string_wrapper_construct (GType object_type,
                                                             const gchar* str)
{
	XmppXepJingleSocks5BytestreamsStringWrapper * self = NULL;
	g_return_val_if_fail (str != NULL, NULL);
	self = (XmppXepJingleSocks5BytestreamsStringWrapper*) g_object_new (object_type, NULL);
	xmpp_xep_jingle_socks5_bytestreams_string_wrapper_set_str (self, str);
	return self;
}

XmppXepJingleSocks5BytestreamsStringWrapper*
xmpp_xep_jingle_socks5_bytestreams_string_wrapper_new (const gchar* str)
{
	return xmpp_xep_jingle_socks5_bytestreams_string_wrapper_construct (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER, str);
}

const gchar*
xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_str (XmppXepJingleSocks5BytestreamsStringWrapper* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_str;
	result = _tmp0_;
	return result;
}

void
xmpp_xep_jingle_socks5_bytestreams_string_wrapper_set_str (XmppXepJingleSocks5BytestreamsStringWrapper* self,
                                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_str (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_str);
		self->priv->_str = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_socks5_bytestreams_string_wrapper_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_STR_PROPERTY]);
	}
}

static void
xmpp_xep_jingle_socks5_bytestreams_string_wrapper_class_init (XmppXepJingleSocks5BytestreamsStringWrapperClass * klass,
                                                              gpointer klass_data)
{
	xmpp_xep_jingle_socks5_bytestreams_string_wrapper_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleSocks5BytestreamsStringWrapper_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_socks5_bytestreams_string_wrapper_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_socks5_bytestreams_string_wrapper_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_STR_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_string_wrapper_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_STR_PROPERTY] = g_param_spec_string ("str", "str", "str", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
xmpp_xep_jingle_socks5_bytestreams_string_wrapper_instance_init (XmppXepJingleSocks5BytestreamsStringWrapper * self,
                                                                 gpointer klass)
{
	self->priv = xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_instance_private (self);
}

static void
xmpp_xep_jingle_socks5_bytestreams_string_wrapper_finalize (GObject * obj)
{
	XmppXepJingleSocks5BytestreamsStringWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER, XmppXepJingleSocks5BytestreamsStringWrapper);
	_g_free0 (self->priv->_str);
	G_OBJECT_CLASS (xmpp_xep_jingle_socks5_bytestreams_string_wrapper_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleSocks5BytestreamsStringWrapperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_socks5_bytestreams_string_wrapper_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleSocks5BytestreamsStringWrapper), 0, (GInstanceInitFunc) xmpp_xep_jingle_socks5_bytestreams_string_wrapper_instance_init, NULL };
	GType xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id;
	xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleSocks5BytestreamsStringWrapper", &g_define_type_info, 0);
	XmppXepJingleSocks5BytestreamsStringWrapper_private_offset = g_type_add_instance_private (xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id, sizeof (XmppXepJingleSocks5BytestreamsStringWrapperPrivate));
	return xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id;
}

GType
xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id__once)) {
		GType xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id;
		xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id = xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id__once, xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id);
	}
	return xmpp_xep_jingle_socks5_bytestreams_string_wrapper_type_id__once;
}

static void
_vala_xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_property (GObject * object,
                                                                      guint property_id,
                                                                      GValue * value,
                                                                      GParamSpec * pspec)
{
	XmppXepJingleSocks5BytestreamsStringWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER, XmppXepJingleSocks5BytestreamsStringWrapper);
	switch (property_id) {
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_STR_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_str (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_socks5_bytestreams_string_wrapper_set_property (GObject * object,
                                                                      guint property_id,
                                                                      const GValue * value,
                                                                      GParamSpec * pspec)
{
	XmppXepJingleSocks5BytestreamsStringWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER, XmppXepJingleSocks5BytestreamsStringWrapper);
	switch (property_id) {
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_STRING_WRAPPER_STR_PROPERTY:
		xmpp_xep_jingle_socks5_bytestreams_string_wrapper_set_str (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
xmpp_xep_jingle_socks5_bytestreams_local_listener_get_instance_private (XmppXepJingleSocks5BytestreamsLocalListener* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleSocks5BytestreamsLocalListener_private_offset);
}

XmppXepJingleSocks5BytestreamsLocalListener*
xmpp_xep_jingle_socks5_bytestreams_local_listener_construct (GType object_type,
                                                             GSocketListener* inner,
                                                             const gchar* dstaddr)
{
	XmppXepJingleSocks5BytestreamsLocalListener* self = NULL;
	GSocketListener* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (inner != NULL, NULL);
	g_return_val_if_fail (dstaddr != NULL, NULL);
	self = (XmppXepJingleSocks5BytestreamsLocalListener*) g_type_create_instance (object_type);
	_tmp0_ = _g_object_ref0 (inner);
	_g_object_unref0 (self->priv->inner);
	self->priv->inner = _tmp0_;
	_tmp1_ = g_strdup (dstaddr);
	_g_free0 (self->priv->dstaddr);
	self->priv->dstaddr = _tmp1_;
	return self;
}

XmppXepJingleSocks5BytestreamsLocalListener*
xmpp_xep_jingle_socks5_bytestreams_local_listener_new (GSocketListener* inner,
                                                       const gchar* dstaddr)
{
	return xmpp_xep_jingle_socks5_bytestreams_local_listener_construct (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER, inner, dstaddr);
}

XmppXepJingleSocks5BytestreamsLocalListener*
xmpp_xep_jingle_socks5_bytestreams_local_listener_construct_empty (GType object_type)
{
	XmppXepJingleSocks5BytestreamsLocalListener* self = NULL;
	gchar* _tmp0_;
	self = (XmppXepJingleSocks5BytestreamsLocalListener*) g_type_create_instance (object_type);
	_g_object_unref0 (self->priv->inner);
	self->priv->inner = NULL;
	_tmp0_ = g_strdup ("");
	_g_free0 (self->priv->dstaddr);
	self->priv->dstaddr = _tmp0_;
	return self;
}

XmppXepJingleSocks5BytestreamsLocalListener*
xmpp_xep_jingle_socks5_bytestreams_local_listener_new_empty (void)
{
	return xmpp_xep_jingle_socks5_bytestreams_local_listener_construct_empty (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER);
}

void
xmpp_xep_jingle_socks5_bytestreams_local_listener_start (XmppXepJingleSocks5BytestreamsLocalListener* self)
{
	GSocketListener* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->inner;
	if (_tmp0_ == NULL) {
		return;
	}
	xmpp_xep_jingle_socks5_bytestreams_local_listener_run (self, NULL, NULL);
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_run_data_free (gpointer _data)
{
	XmppXepJingleSocks5BytestreamsLocalListenerRunData* _data_;
	_data_ = _data;
	_xmpp_xep_jingle_socks5_bytestreams_local_listener_unref0 (_data_->self);
	g_slice_free (XmppXepJingleSocks5BytestreamsLocalListenerRunData, _data_);
}

static gpointer
_xmpp_xep_jingle_socks5_bytestreams_local_listener_ref0 (gpointer self)
{
	return self ? xmpp_xep_jingle_socks5_bytestreams_local_listener_ref (self) : NULL;
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_run (XmppXepJingleSocks5BytestreamsLocalListener* self,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsLocalListenerRunData* _data_;
	XmppXepJingleSocks5BytestreamsLocalListener* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (XmppXepJingleSocks5BytestreamsLocalListenerRunData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_socks5_bytestreams_local_listener_run_data_free);
	_tmp0_ = _xmpp_xep_jingle_socks5_bytestreams_local_listener_ref0 (self);
	_data_->self = _tmp0_;
	xmpp_xep_jingle_socks5_bytestreams_local_listener_run_co (_data_);
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_run_finish (XmppXepJingleSocks5BytestreamsLocalListener* self,
                                                              GAsyncResult* _res_)
{
	XmppXepJingleSocks5BytestreamsLocalListenerRunData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_run_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsLocalListenerRunData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_socks5_bytestreams_local_listener_run_co (_data_);
}

static gboolean
xmpp_xep_jingle_socks5_bytestreams_local_listener_run_co (XmppXepJingleSocks5BytestreamsLocalListenerRunData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	while (TRUE) {
		{
			_data_->_tmp1_ = _data_->self->priv->inner;
			_data_->_tmp2_ = NULL;
			_data_->_state_ = 1;
			g_socket_listener_accept_async (_data_->_tmp1_, NULL, xmpp_xep_jingle_socks5_bytestreams_local_listener_run_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp3_ = g_socket_listener_accept_finish (_data_->_tmp1_, _data_->_res_, &_data_->_tmp2_, &_data_->_inner_error0_);
			_g_object_unref0 (_data_->cid);
			_data_->_tmp4_ = _g_object_ref0 (_data_->_tmp2_);
			_data_->cid = _data_->_tmp4_;
			_data_->_tmp0_ = _data_->_tmp3_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_tmp5_ = _data_->_tmp0_;
			_data_->_tmp0_ = NULL;
			_g_object_unref0 (_data_->conn);
			_data_->conn = _data_->_tmp5_;
			_g_object_unref0 (_data_->_tmp0_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			g_clear_error (&_data_->_inner_error0_);
			_g_object_unref0 (_data_->conn);
			_g_object_unref0 (_data_->cid);
			break;
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->conn);
			_g_object_unref0 (_data_->cid);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp6_ = _data_->cid;
		_data_->_tmp7_ = xmpp_xep_jingle_socks5_bytestreams_string_wrapper_get_str (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp6_, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_STRING_WRAPPER, XmppXepJingleSocks5BytestreamsStringWrapper));
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_tmp9_ = _data_->conn;
		xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn (_data_->self, _data_->_tmp8_, _data_->_tmp9_, NULL, NULL);
		_g_object_unref0 (_data_->conn);
		_g_object_unref0 (_data_->cid);
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_data_free (gpointer _data)
{
	XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData* _data_;
	_data_ = _data;
	_g_free0 (_data_->cid);
	_g_object_unref0 (_data_->conn);
	_xmpp_xep_jingle_socks5_bytestreams_local_listener_unref0 (_data_->self);
	g_slice_free (XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData, _data_);
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn (XmppXepJingleSocks5BytestreamsLocalListener* self,
                                                               const gchar* cid,
                                                               GSocketConnection* conn,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData* _data_;
	XmppXepJingleSocks5BytestreamsLocalListener* _tmp0_;
	gchar* _tmp1_;
	GSocketConnection* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cid != NULL);
	g_return_if_fail (conn != NULL);
	_data_ = g_slice_new0 (XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_data_free);
	_tmp0_ = _xmpp_xep_jingle_socks5_bytestreams_local_listener_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (cid);
	_g_free0 (_data_->cid);
	_data_->cid = _tmp1_;
	_tmp2_ = _g_object_ref0 (conn);
	_g_object_unref0 (_data_->conn);
	_data_->conn = _tmp2_;
	xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_co (_data_);
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_finish (XmppXepJingleSocks5BytestreamsLocalListener* self,
                                                                      GAsyncResult* _res_)
{
	XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready (GObject* source_object,
                                                                     GAsyncResult* _res_,
                                                                     gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_co (_data_);
}

static guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res;
	_tmp2__length1 = res_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static gboolean
xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_co (XmppXepJingleSocks5BytestreamsLocalListenerHandleConnData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		case 8:
		goto _state_8;
		case 9:
		goto _state_9;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_socket_connection_get_socket (_data_->conn);
	_data_->_tmp1_ = _data_->_tmp0_;
	g_socket_set_timeout (_data_->_tmp1_, (guint) XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NEGOTIATION_TIMEOUT);
	_data_->_tmp2_ = g_new0 (guint8, 1024);
	_data_->read_buffer = _data_->_tmp2_;
	_data_->read_buffer_length1 = 1024;
	_data_->_read_buffer_size_ = _data_->read_buffer_length1;
	_data_->_tmp3_ = g_byte_array_new ();
	_data_->write_buffer = _data_->_tmp3_;
	{
		_data_->_tmp4_ = g_io_stream_get_input_stream ((GIOStream*) _data_->conn);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = _data_->read_buffer;
		_data_->_tmp6__length1 = _data_->read_buffer_length1;
		_data_->_tmp7_ = 0UL;
		_data_->_state_ = 1;
		g_input_stream_read_all_async (_data_->_tmp5_, _data_->_tmp6_ + 0, (gsize) (2 - 0), G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready, _data_);
		return FALSE;
		_state_1:
		g_input_stream_read_all_finish (_data_->_tmp5_, _data_->_res_, &_data_->_tmp7_, &_data_->_inner_error0_);
		_data_->read = _data_->_tmp7_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->read != ((gsize) 2)) {
			_data_->_tmp8_ = g_strdup_printf ("wanted client hello message consisting of 2 bytes, only got %d bytes", (gint) _data_->read);
			_data_->_tmp9_ = _data_->_tmp8_;
			_data_->_tmp10_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp9_);
			_data_->_tmp11_ = _data_->_tmp10_;
			_g_free0 (_data_->_tmp9_);
			_data_->_inner_error0_ = _data_->_tmp11_;
			goto __catch0_g_error;
		}
		_data_->_tmp13_ = _data_->read_buffer;
		_data_->_tmp13__length1 = _data_->read_buffer_length1;
		_data_->_tmp14_ = _data_->_tmp13_[0];
		if (((gint) _data_->_tmp14_) != 0x05) {
			_data_->_tmp12_ = TRUE;
		} else {
			_data_->_tmp15_ = _data_->read_buffer;
			_data_->_tmp15__length1 = _data_->read_buffer_length1;
			_data_->_tmp16_ = _data_->_tmp15_[1];
			_data_->_tmp12_ = ((gint) _data_->_tmp16_) == 0;
		}
		if (_data_->_tmp12_) {
			_data_->_tmp17_ = _data_->read_buffer;
			_data_->_tmp17__length1 = _data_->read_buffer_length1;
			_data_->_tmp18_ = _data_->_tmp17_[0];
			_data_->_tmp19_ = _data_->read_buffer;
			_data_->_tmp19__length1 = _data_->read_buffer_length1;
			_data_->_tmp20_ = _data_->_tmp19_[1];
			_data_->_tmp21_ = g_strdup_printf ("wanted 05 xx, got %02x %02x", (guint) _data_->_tmp18_, (guint) _data_->_tmp20_);
			_data_->_tmp22_ = _data_->_tmp21_;
			_data_->_tmp23_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp22_);
			_data_->_tmp24_ = _data_->_tmp23_;
			_g_free0 (_data_->_tmp22_);
			_data_->_inner_error0_ = _data_->_tmp24_;
			goto __catch0_g_error;
		}
		_data_->_tmp25_ = _data_->read_buffer;
		_data_->_tmp25__length1 = _data_->read_buffer_length1;
		_data_->_tmp26_ = _data_->_tmp25_[1];
		_data_->num_auth_methods = (gint) _data_->_tmp26_;
		_data_->_tmp27_ = g_io_stream_get_input_stream ((GIOStream*) _data_->conn);
		_data_->_tmp28_ = _data_->_tmp27_;
		_data_->_tmp29_ = _data_->read_buffer;
		_data_->_tmp29__length1 = _data_->read_buffer_length1;
		_data_->_tmp30_ = 0UL;
		_data_->_state_ = 2;
		g_input_stream_read_all_async (_data_->_tmp28_, _data_->_tmp29_ + 0, (gsize) (_data_->num_auth_methods - 0), G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready, _data_);
		return FALSE;
		_state_2:
		g_input_stream_read_all_finish (_data_->_tmp28_, _data_->_res_, &_data_->_tmp30_, &_data_->_inner_error0_);
		_data_->read = _data_->_tmp30_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->found_null_auth = FALSE;
		{
			_data_->i = 0;
			{
				_data_->_tmp31_ = TRUE;
				while (TRUE) {
					if (!_data_->_tmp31_) {
						_data_->_tmp32_ = _data_->i;
						_data_->i = _data_->_tmp32_ + 1;
					}
					_data_->_tmp31_ = FALSE;
					if (!(((gsize) _data_->i) < _data_->read)) {
						break;
					}
					_data_->_tmp33_ = _data_->read_buffer;
					_data_->_tmp33__length1 = _data_->read_buffer_length1;
					_data_->_tmp34_ = _data_->_tmp33_[_data_->i];
					if (((gint) _data_->_tmp34_) == 0x00) {
						_data_->found_null_auth = TRUE;
						break;
					}
				}
			}
		}
		if (_data_->read != ((gsize) _data_->num_auth_methods)) {
			_data_->_tmp35_ = TRUE;
		} else {
			_data_->_tmp35_ = !_data_->found_null_auth;
		}
		if (_data_->_tmp35_) {
			_data_->_tmp36_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, "peer didn't offer null auth");
			_data_->_inner_error0_ = _data_->_tmp36_;
			goto __catch0_g_error;
		}
		_data_->_tmp37_ = g_io_stream_get_output_stream ((GIOStream*) _data_->conn);
		_data_->_tmp38_ = _data_->_tmp37_;
		_data_->_tmp39_ = g_new0 (guint8, 2);
		_data_->_tmp39_[0] = (guint8) 0x05;
		_data_->_tmp39_[1] = (guint8) 0x00;
		_data_->_tmp40_ = _data_->_tmp39_;
		_data_->_tmp40__length1 = 2;
		_data_->_tmp41_ = 0UL;
		_data_->_state_ = 3;
		g_output_stream_write_all_async (_data_->_tmp38_, _data_->_tmp40_, (gsize) 2, G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready, _data_);
		return FALSE;
		_state_3:
		g_output_stream_write_all_finish (_data_->_tmp38_, _data_->_res_, &_data_->_tmp41_, &_data_->_inner_error0_);
		_data_->written = _data_->_tmp41_;
		_data_->_tmp40_ = (g_free (_data_->_tmp40_), NULL);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp42_ = g_io_stream_get_input_stream ((GIOStream*) _data_->conn);
		_data_->_tmp43_ = _data_->_tmp42_;
		_data_->_tmp44_ = _data_->read_buffer;
		_data_->_tmp44__length1 = _data_->read_buffer_length1;
		_data_->_tmp45_ = 0UL;
		_data_->_state_ = 4;
		g_input_stream_read_all_async (_data_->_tmp43_, _data_->_tmp44_ + 0, (gsize) (4 - 0), G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready, _data_);
		return FALSE;
		_state_4:
		g_input_stream_read_all_finish (_data_->_tmp43_, _data_->_res_, &_data_->_tmp45_, &_data_->_inner_error0_);
		_data_->read = _data_->_tmp45_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->read != ((gsize) 4)) {
			_data_->_tmp46_ = g_strdup_printf ("wanted connect message consisting of 4 bytes, only got %d bytes", (gint) _data_->read);
			_data_->_tmp47_ = _data_->_tmp46_;
			_data_->_tmp48_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp47_);
			_data_->_tmp49_ = _data_->_tmp48_;
			_g_free0 (_data_->_tmp47_);
			_data_->_inner_error0_ = _data_->_tmp49_;
			goto __catch0_g_error;
		}
		_data_->_tmp52_ = _data_->read_buffer;
		_data_->_tmp52__length1 = _data_->read_buffer_length1;
		_data_->_tmp53_ = _data_->_tmp52_[0];
		if (((gint) _data_->_tmp53_) != 0x05) {
			_data_->_tmp51_ = TRUE;
		} else {
			_data_->_tmp54_ = _data_->read_buffer;
			_data_->_tmp54__length1 = _data_->read_buffer_length1;
			_data_->_tmp55_ = _data_->_tmp54_[1];
			_data_->_tmp51_ = ((gint) _data_->_tmp55_) != 0x01;
		}
		if (_data_->_tmp51_) {
			_data_->_tmp50_ = TRUE;
		} else {
			_data_->_tmp56_ = _data_->read_buffer;
			_data_->_tmp56__length1 = _data_->read_buffer_length1;
			_data_->_tmp57_ = _data_->_tmp56_[3];
			_data_->_tmp50_ = ((gint) _data_->_tmp57_) != 0x03;
		}
		if (_data_->_tmp50_) {
			_data_->_tmp58_ = _data_->read_buffer;
			_data_->_tmp58__length1 = _data_->read_buffer_length1;
			_data_->_tmp59_ = _data_->_tmp58_[0];
			_data_->_tmp60_ = _data_->read_buffer;
			_data_->_tmp60__length1 = _data_->read_buffer_length1;
			_data_->_tmp61_ = _data_->_tmp60_[1];
			_data_->_tmp62_ = _data_->read_buffer;
			_data_->_tmp62__length1 = _data_->read_buffer_length1;
			_data_->_tmp63_ = _data_->_tmp62_[2];
			_data_->_tmp64_ = _data_->read_buffer;
			_data_->_tmp64__length1 = _data_->read_buffer_length1;
			_data_->_tmp65_ = _data_->_tmp64_[3];
			_data_->_tmp66_ = g_strdup_printf ("wanted 05 00 ?? 03, got %02x %02x %02x %02x", (guint) _data_->_tmp59_, (guint) _data_->_tmp61_, (guint) _data_->_tmp63_, (guint) _data_->_tmp65_);
			_data_->_tmp67_ = _data_->_tmp66_;
			_data_->_tmp68_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp67_);
			_data_->_tmp69_ = _data_->_tmp68_;
			_g_free0 (_data_->_tmp67_);
			_data_->_inner_error0_ = _data_->_tmp69_;
			goto __catch0_g_error;
		}
		_data_->_tmp70_ = g_io_stream_get_input_stream ((GIOStream*) _data_->conn);
		_data_->_tmp71_ = _data_->_tmp70_;
		_data_->_tmp72_ = _data_->read_buffer;
		_data_->_tmp72__length1 = _data_->read_buffer_length1;
		_data_->_tmp73_ = 0UL;
		_data_->_state_ = 5;
		g_input_stream_read_all_async (_data_->_tmp71_, _data_->_tmp72_ + 0, (gsize) (1 - 0), G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready, _data_);
		return FALSE;
		_state_5:
		g_input_stream_read_all_finish (_data_->_tmp71_, _data_->_res_, &_data_->_tmp73_, &_data_->_inner_error0_);
		_data_->read = _data_->_tmp73_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->read != ((gsize) 1)) {
			_data_->_tmp74_ = g_strdup_printf ("wanted length of dstaddr consisting of 1 byte, only got %d bytes", (gint) _data_->read);
			_data_->_tmp75_ = _data_->_tmp74_;
			_data_->_tmp76_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp75_);
			_data_->_tmp77_ = _data_->_tmp76_;
			_g_free0 (_data_->_tmp75_);
			_data_->_inner_error0_ = _data_->_tmp77_;
			goto __catch0_g_error;
		}
		_data_->_tmp78_ = _data_->read_buffer;
		_data_->_tmp78__length1 = _data_->read_buffer_length1;
		_data_->_tmp79_ = _data_->_tmp78_[0];
		_data_->dstaddr_len = (gint) _data_->_tmp79_;
		_data_->_tmp80_ = g_io_stream_get_input_stream ((GIOStream*) _data_->conn);
		_data_->_tmp81_ = _data_->_tmp80_;
		_data_->_tmp82_ = _data_->read_buffer;
		_data_->_tmp82__length1 = _data_->read_buffer_length1;
		_data_->_tmp83_ = 0UL;
		_data_->_state_ = 6;
		g_input_stream_read_all_async (_data_->_tmp81_, _data_->_tmp82_ + 0, (gsize) ((_data_->dstaddr_len + 2) - 0), G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready, _data_);
		return FALSE;
		_state_6:
		g_input_stream_read_all_finish (_data_->_tmp81_, _data_->_res_, &_data_->_tmp83_, &_data_->_inner_error0_);
		_data_->read = _data_->_tmp83_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (_data_->read != ((gsize) (_data_->dstaddr_len + 2))) {
			_data_->_tmp84_ = g_strdup_printf ("wanted dstaddr and port consisting of %d bytes, got %d bytes", _data_->dstaddr_len + 2, (gint) _data_->read);
			_data_->_tmp85_ = _data_->_tmp84_;
			_data_->_tmp86_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp85_);
			_data_->_tmp87_ = _data_->_tmp86_;
			_g_free0 (_data_->_tmp85_);
			_data_->_inner_error0_ = _data_->_tmp87_;
			goto __catch0_g_error;
		}
		_data_->_tmp88_ = _data_->read_buffer;
		_data_->_tmp88__length1 = _data_->read_buffer_length1;
		_data_->_tmp89_ = _data_->self->priv->dstaddr;
		_data_->_tmp91_ = 0;
		_data_->_tmp90_ = string_get_data (_data_->_tmp89_, &_data_->_tmp91_);
		_data_->_tmp90__length1 = _data_->_tmp91_;
		_data_->_tmp92_ = _data_->_tmp90_;
		_data_->_tmp92__length1 = _data_->_tmp90__length1;
		if (!xmpp_xep_jingle_socks5_bytestreams_bytes_equal (_data_->_tmp88_ + 0, (gint) (_data_->dstaddr_len - 0), _data_->_tmp92_, (gint) _data_->_tmp92__length1)) {
			_data_->_tmp93_ = _data_->read_buffer;
			_data_->_tmp93__length1 = _data_->read_buffer_length1;
			_data_->_tmp94_ = _data_->self->priv->dstaddr;
			_data_->_tmp95_ = strlen (_data_->_tmp94_);
			_data_->_tmp96_ = _data_->_tmp95_;
			_data_->_tmp97_ = g_utf8_make_valid ((const gchar*) (_data_->_tmp93_ + 0), (gssize) -1);
			_data_->_tmp98_ = _data_->_tmp97_;
			_data_->_tmp99_ = g_strescape (_data_->_tmp98_, NULL);
			_data_->_tmp100_ = _data_->_tmp99_;
			_g_free0 (_data_->_tmp98_);
			_data_->repr = _data_->_tmp100_;
			_data_->_tmp101_ = _data_->self->priv->dstaddr;
			_data_->_tmp102_ = string_to_string (_data_->_tmp101_);
			_data_->_tmp103_ = _data_->repr;
			_data_->_tmp104_ = string_to_string (_data_->_tmp103_);
			_data_->_tmp105_ = g_strconcat ("wanted dstaddr ", _data_->_tmp102_, ", got ", _data_->_tmp104_, NULL);
			_data_->_tmp106_ = _data_->_tmp105_;
			_data_->_tmp107_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp106_);
			_data_->_tmp108_ = _data_->_tmp107_;
			_g_free0 (_data_->_tmp106_);
			_data_->_inner_error0_ = _data_->_tmp108_;
			_g_free0 (_data_->repr);
			goto __catch0_g_error;
		}
		_data_->_tmp110_ = _data_->read_buffer;
		_data_->_tmp110__length1 = _data_->read_buffer_length1;
		_data_->_tmp111_ = _data_->_tmp110_[_data_->dstaddr_len];
		if (((gint) _data_->_tmp111_) != 0x00) {
			_data_->_tmp109_ = TRUE;
		} else {
			_data_->_tmp112_ = _data_->read_buffer;
			_data_->_tmp112__length1 = _data_->read_buffer_length1;
			_data_->_tmp113_ = _data_->_tmp112_[_data_->dstaddr_len + 1];
			_data_->_tmp109_ = ((gint) _data_->_tmp113_) != 0x00;
		}
		if (_data_->_tmp109_) {
			_data_->_tmp114_ = _data_->read_buffer;
			_data_->_tmp114__length1 = _data_->read_buffer_length1;
			_data_->_tmp115_ = _data_->_tmp114_[_data_->dstaddr_len];
			_data_->_tmp116_ = _data_->read_buffer;
			_data_->_tmp116__length1 = _data_->read_buffer_length1;
			_data_->_tmp117_ = _data_->_tmp116_[_data_->dstaddr_len + 1];
			_data_->_tmp118_ = g_strdup_printf ("wanted 00 00, got %02x %02x", (guint) _data_->_tmp115_, (guint) _data_->_tmp117_);
			_data_->_tmp119_ = _data_->_tmp118_;
			_data_->_tmp120_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp119_);
			_data_->_tmp121_ = _data_->_tmp120_;
			_g_free0 (_data_->_tmp119_);
			_data_->_inner_error0_ = _data_->_tmp121_;
			goto __catch0_g_error;
		}
		_data_->_tmp122_ = _data_->write_buffer;
		_data_->_tmp123_ = g_new0 (guint8, 4);
		_data_->_tmp123_[0] = (guint8) 0x05;
		_data_->_tmp123_[1] = (guint8) 0x00;
		_data_->_tmp123_[2] = (guint8) 0x00;
		_data_->_tmp123_[3] = (guint8) 0x03;
		_data_->_tmp124_ = _data_->_tmp123_;
		_data_->_tmp124__length1 = 4;
		g_byte_array_append (_data_->_tmp122_, _data_->_tmp124_, (gint) 4);
		_data_->_tmp124_ = (g_free (_data_->_tmp124_), NULL);
		_data_->_tmp125_ = _data_->write_buffer;
		_data_->_tmp126_ = _data_->self->priv->dstaddr;
		_data_->_tmp127_ = strlen (_data_->_tmp126_);
		_data_->_tmp128_ = _data_->_tmp127_;
		_data_->_tmp129_ = g_new0 (guint8, 1);
		_data_->_tmp129_[0] = (guint8) _data_->_tmp128_;
		_data_->_tmp130_ = _data_->_tmp129_;
		_data_->_tmp130__length1 = 1;
		g_byte_array_append (_data_->_tmp125_, _data_->_tmp130_, (gint) 1);
		_data_->_tmp130_ = (g_free (_data_->_tmp130_), NULL);
		_data_->_tmp131_ = _data_->write_buffer;
		_data_->_tmp132_ = _data_->self->priv->dstaddr;
		_data_->_tmp134_ = 0;
		_data_->_tmp133_ = string_get_data (_data_->_tmp132_, &_data_->_tmp134_);
		_data_->_tmp133__length1 = _data_->_tmp134_;
		_data_->_tmp135_ = _data_->_tmp133_;
		_data_->_tmp135__length1 = _data_->_tmp133__length1;
		g_byte_array_append (_data_->_tmp131_, _data_->_tmp135_, (gint) _data_->_tmp135__length1);
		_data_->_tmp136_ = _data_->write_buffer;
		_data_->_tmp137_ = g_new0 (guint8, 2);
		_data_->_tmp137_[0] = (guint8) 0x00;
		_data_->_tmp137_[1] = (guint8) 0x00;
		_data_->_tmp138_ = _data_->_tmp137_;
		_data_->_tmp138__length1 = 2;
		g_byte_array_append (_data_->_tmp136_, _data_->_tmp138_, (gint) 2);
		_data_->_tmp138_ = (g_free (_data_->_tmp138_), NULL);
		_data_->_tmp139_ = g_io_stream_get_output_stream ((GIOStream*) _data_->conn);
		_data_->_tmp140_ = _data_->_tmp139_;
		_data_->_tmp141_ = _data_->write_buffer;
		_data_->_tmp142_ = _data_->_tmp141_->data;
		_data_->_tmp142__length1 = _data_->_tmp141_->len;
		_data_->_tmp143_ = 0UL;
		_data_->_state_ = 7;
		g_output_stream_write_all_async (_data_->_tmp140_, _data_->_tmp142_, (gsize) _data_->_tmp142__length1, G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready, _data_);
		return FALSE;
		_state_7:
		g_output_stream_write_all_finish (_data_->_tmp140_, _data_->_res_, &_data_->_tmp143_, &_data_->_inner_error0_);
		_data_->written = _data_->_tmp143_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp144_ = g_socket_connection_get_socket (_data_->conn);
		_data_->_tmp145_ = _data_->_tmp144_;
		g_socket_set_timeout (_data_->_tmp145_, (guint) 0);
		_data_->_tmp146_ = _data_->self->priv->connections;
		if (!gee_abstract_map_has_key ((GeeAbstractMap*) _data_->_tmp146_, _data_->cid)) {
			_data_->_tmp147_ = _data_->self->priv->connections;
			gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp147_, _data_->cid, _data_->conn);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp148_ = _data_->e;
		_data_->_tmp149_ = _data_->_tmp148_->message;
		g_warning ("0260_jingle_socks5_bytestreams.vala:330: Jingle SOCKS5 bytestream esta" \
"blish error cid %s: %s", _data_->cid, _data_->_tmp149_);
		_data_->_tmp150_ = g_io_stream_get_output_stream ((GIOStream*) _data_->conn);
		_data_->_tmp151_ = _data_->_tmp150_;
		_data_->_tmp152_ = g_new0 (guint8, 2);
		_data_->_tmp152_[0] = (guint8) 0x05;
		_data_->_tmp152_[1] = (guint8) 0x01;
		_data_->_tmp153_ = _data_->_tmp152_;
		_data_->_tmp153__length1 = 2;
		_data_->_tmp154_ = 0UL;
		_data_->_state_ = 8;
		g_output_stream_write_all_async (_data_->_tmp151_, _data_->_tmp153_, (gsize) 2, G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready, _data_);
		return FALSE;
		_state_8:
		g_output_stream_write_all_finish (_data_->_tmp151_, _data_->_res_, &_data_->_tmp154_, &_data_->_inner_error0_);
		_data_->written = _data_->_tmp154_;
		_data_->_tmp153_ = (g_free (_data_->_tmp153_), NULL);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_error_free0 (_data_->e);
			goto __finally0;
		}
		_data_->_tmp155_ = g_io_stream_get_output_stream ((GIOStream*) _data_->conn);
		_data_->_tmp156_ = _data_->_tmp155_;
		_data_->_state_ = 9;
		g_output_stream_close_async (_data_->_tmp156_, G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_local_listener_handle_conn_ready, _data_);
		return FALSE;
		_state_9:
		g_output_stream_close_finish (_data_->_tmp156_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_error_free0 (_data_->e);
			goto __finally0;
		}
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_byte_array_unref0 (_data_->write_buffer);
	_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

GSocketConnection*
xmpp_xep_jingle_socks5_bytestreams_local_listener_get_connection (XmppXepJingleSocks5BytestreamsLocalListener* self,
                                                                  const gchar* cid)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	GSocketConnection* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (cid != NULL, NULL);
	_tmp0_ = self->priv->connections;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, cid)) {
		result = NULL;
		return result;
	}
	_tmp1_ = self->priv->connections;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, cid);
	result = (GSocketConnection*) _tmp2_;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_value_local_listener_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
xmpp_xep_jingle_socks5_bytestreams_value_local_listener_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		xmpp_xep_jingle_socks5_bytestreams_local_listener_unref (value->data[0].v_pointer);
	}
}

static void
xmpp_xep_jingle_socks5_bytestreams_value_local_listener_copy_value (const GValue* src_value,
                                                                    GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = xmpp_xep_jingle_socks5_bytestreams_local_listener_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
xmpp_xep_jingle_socks5_bytestreams_value_local_listener_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
xmpp_xep_jingle_socks5_bytestreams_value_local_listener_collect_value (GValue* value,
                                                                       guint n_collect_values,
                                                                       GTypeCValue* collect_values,
                                                                       guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		XmppXepJingleSocks5BytestreamsLocalListener * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = xmpp_xep_jingle_socks5_bytestreams_local_listener_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
xmpp_xep_jingle_socks5_bytestreams_value_local_listener_lcopy_value (const GValue* value,
                                                                     guint n_collect_values,
                                                                     GTypeCValue* collect_values,
                                                                     guint collect_flags)
{
	XmppXepJingleSocks5BytestreamsLocalListener ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = xmpp_xep_jingle_socks5_bytestreams_local_listener_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
xmpp_xep_jingle_socks5_bytestreams_param_spec_local_listener (const gchar* name,
                                                              const gchar* nick,
                                                              const gchar* blurb,
                                                              GType object_type,
                                                              GParamFlags flags)
{
	XmppXepJingleSocks5BytestreamsParamSpecLocalListener* spec;
	g_return_val_if_fail (g_type_is_a (object_type, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
xmpp_xep_jingle_socks5_bytestreams_value_get_local_listener (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER), NULL);
	return value->data[0].v_pointer;
}

void
xmpp_xep_jingle_socks5_bytestreams_value_set_local_listener (GValue* value,
                                                             gpointer v_object)
{
	XmppXepJingleSocks5BytestreamsLocalListener * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		xmpp_xep_jingle_socks5_bytestreams_local_listener_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_xep_jingle_socks5_bytestreams_local_listener_unref (old);
	}
}

void
xmpp_xep_jingle_socks5_bytestreams_value_take_local_listener (GValue* value,
                                                              gpointer v_object)
{
	XmppXepJingleSocks5BytestreamsLocalListener * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_xep_jingle_socks5_bytestreams_local_listener_unref (old);
	}
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_class_init (XmppXepJingleSocks5BytestreamsLocalListenerClass * klass,
                                                              gpointer klass_data)
{
	xmpp_xep_jingle_socks5_bytestreams_local_listener_parent_class = g_type_class_peek_parent (klass);
	((XmppXepJingleSocks5BytestreamsLocalListenerClass *) klass)->finalize = xmpp_xep_jingle_socks5_bytestreams_local_listener_finalize;
	g_type_class_adjust_private_offset (klass, &XmppXepJingleSocks5BytestreamsLocalListener_private_offset);
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_instance_init (XmppXepJingleSocks5BytestreamsLocalListener * self,
                                                                 gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = xmpp_xep_jingle_socks5_bytestreams_local_listener_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, g_socket_connection_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->connections = _tmp0_;
	self->ref_count = 1;
}

static void
xmpp_xep_jingle_socks5_bytestreams_local_listener_finalize (XmppXepJingleSocks5BytestreamsLocalListener * obj)
{
	XmppXepJingleSocks5BytestreamsLocalListener * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_LOCAL_LISTENER, XmppXepJingleSocks5BytestreamsLocalListener);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->inner);
	_g_free0 (self->priv->dstaddr);
	_g_object_unref0 (self->priv->connections);
}

static GType
xmpp_xep_jingle_socks5_bytestreams_local_listener_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { xmpp_xep_jingle_socks5_bytestreams_value_local_listener_init, xmpp_xep_jingle_socks5_bytestreams_value_local_listener_free_value, xmpp_xep_jingle_socks5_bytestreams_value_local_listener_copy_value, xmpp_xep_jingle_socks5_bytestreams_value_local_listener_peek_pointer, "p", xmpp_xep_jingle_socks5_bytestreams_value_local_listener_collect_value, "p", xmpp_xep_jingle_socks5_bytestreams_value_local_listener_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleSocks5BytestreamsLocalListenerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_socks5_bytestreams_local_listener_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleSocks5BytestreamsLocalListener), 0, (GInstanceInitFunc) xmpp_xep_jingle_socks5_bytestreams_local_listener_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id;
	xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id = g_type_register_fundamental (g_type_fundamental_next (), "XmppXepJingleSocks5BytestreamsLocalListener", &g_define_type_info, &g_define_type_fundamental_info, 0);
	XmppXepJingleSocks5BytestreamsLocalListener_private_offset = g_type_add_instance_private (xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id, sizeof (XmppXepJingleSocks5BytestreamsLocalListenerPrivate));
	return xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id;
}

GType
xmpp_xep_jingle_socks5_bytestreams_local_listener_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id__once)) {
		GType xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id;
		xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id = xmpp_xep_jingle_socks5_bytestreams_local_listener_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id__once, xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id);
	}
	return xmpp_xep_jingle_socks5_bytestreams_local_listener_type_id__once;
}

gpointer
xmpp_xep_jingle_socks5_bytestreams_local_listener_ref (gpointer instance)
{
	XmppXepJingleSocks5BytestreamsLocalListener * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
xmpp_xep_jingle_socks5_bytestreams_local_listener_unref (gpointer instance)
{
	XmppXepJingleSocks5BytestreamsLocalListener * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_LOCAL_LISTENER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
xmpp_xep_jingle_socks5_bytestreams_parameters_get_instance_private (XmppXepJingleSocks5BytestreamsParameters* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleSocks5BytestreamsParameters_private_offset);
}

static XmppXepJingleSocks5BytestreamsParameters*
xmpp_xep_jingle_socks5_bytestreams_parameters_construct (GType object_type,
                                                         XmppXepJingleRole role,
                                                         const gchar* sid,
                                                         XmppJid* local_full_jid,
                                                         XmppJid* peer_full_jid,
                                                         const gchar* remote_dstaddr)
{
	XmppXepJingleSocks5BytestreamsParameters * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_;
	XmppJid* _tmp5_;
	XmppJid* _tmp6_;
	g_return_val_if_fail (sid != NULL, NULL);
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	self = (XmppXepJingleSocks5BytestreamsParameters*) g_object_new (object_type, NULL);
	xmpp_xep_jingle_socks5_bytestreams_parameters_set_role (self, role);
	xmpp_xep_jingle_socks5_bytestreams_parameters_set_sid (self, sid);
	_tmp0_ = xmpp_xep_jingle_socks5_bytestreams_calculate_dstaddr (sid, local_full_jid, peer_full_jid);
	_tmp1_ = _tmp0_;
	xmpp_xep_jingle_socks5_bytestreams_parameters_set_local_dstaddr (self, _tmp1_);
	_g_free0 (_tmp1_);
	_tmp3_ = g_strdup (remote_dstaddr);
	_tmp2_ = _tmp3_;
	if (_tmp2_ == NULL) {
		gchar* _tmp4_;
		_tmp4_ = xmpp_xep_jingle_socks5_bytestreams_calculate_dstaddr (sid, peer_full_jid, local_full_jid);
		_g_free0 (_tmp2_);
		_tmp2_ = _tmp4_;
	}
	xmpp_xep_jingle_socks5_bytestreams_parameters_set_remote_dstaddr (self, _tmp2_);
	_tmp5_ = _xmpp_jid_ref0 (local_full_jid);
	_xmpp_jid_unref0 (self->priv->local_full_jid);
	self->priv->local_full_jid = _tmp5_;
	_tmp6_ = _xmpp_jid_ref0 (peer_full_jid);
	_xmpp_jid_unref0 (self->priv->peer_full_jid);
	self->priv->peer_full_jid = _tmp6_;
	_g_free0 (_tmp2_);
	return self;
}

static XmppXepJingleSocks5BytestreamsParameters*
xmpp_xep_jingle_socks5_bytestreams_parameters_new (XmppXepJingleRole role,
                                                   const gchar* sid,
                                                   XmppJid* local_full_jid,
                                                   XmppJid* peer_full_jid,
                                                   const gchar* remote_dstaddr)
{
	return xmpp_xep_jingle_socks5_bytestreams_parameters_construct (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS, role, sid, local_full_jid, peer_full_jid, remote_dstaddr);
}

XmppXepJingleSocks5BytestreamsParameters*
xmpp_xep_jingle_socks5_bytestreams_parameters_construct_create (GType object_type,
                                                                XmppJid* local_full_jid,
                                                                XmppJid* peer_full_jid,
                                                                const gchar* sid)
{
	XmppXepJingleSocks5BytestreamsParameters * self = NULL;
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	g_return_val_if_fail (sid != NULL, NULL);
	self = (XmppXepJingleSocks5BytestreamsParameters*) xmpp_xep_jingle_socks5_bytestreams_parameters_construct (object_type, XMPP_XEP_JINGLE_ROLE_INITIATOR, sid, local_full_jid, peer_full_jid, NULL);
	return self;
}

XmppXepJingleSocks5BytestreamsParameters*
xmpp_xep_jingle_socks5_bytestreams_parameters_new_create (XmppJid* local_full_jid,
                                                          XmppJid* peer_full_jid,
                                                          const gchar* sid)
{
	return xmpp_xep_jingle_socks5_bytestreams_parameters_construct_create (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS, local_full_jid, peer_full_jid, sid);
}

XmppXepJingleSocks5BytestreamsParameters*
xmpp_xep_jingle_socks5_bytestreams_parameters_parse (XmppJid* local_full_jid,
                                                     XmppJid* peer_full_jid,
                                                     XmppStanzaNode* transport,
                                                     GError** error)
{
	gchar* dstaddr = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* mode = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* sid = NULL;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_ = FALSE;
	const gchar* _tmp7_;
	gboolean _tmp15_ = FALSE;
	const gchar* _tmp16_;
	XmppXepJingleSocks5BytestreamsParameters* _result_ = NULL;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp23_;
	GError* _inner_error0_ = NULL;
	XmppXepJingleSocks5BytestreamsParameters* result;
	g_return_val_if_fail (local_full_jid != NULL, NULL);
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	g_return_val_if_fail (transport != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_get_attribute (transport, "dstaddr", NULL);
	_tmp1_ = g_strdup (_tmp0_);
	dstaddr = _tmp1_;
	_tmp2_ = xmpp_stanza_node_get_attribute (transport, "mode", NULL);
	_tmp3_ = g_strdup (_tmp2_);
	mode = _tmp3_;
	_tmp4_ = xmpp_stanza_node_get_attribute (transport, "sid", NULL);
	_tmp5_ = g_strdup (_tmp4_);
	sid = _tmp5_;
	_tmp7_ = mode;
	if (_tmp7_ != NULL) {
		const gchar* _tmp8_;
		_tmp8_ = mode;
		_tmp6_ = g_strcmp0 (_tmp8_, "tcp") != 0;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		GError* _tmp13_;
		GError* _tmp14_;
		_tmp9_ = mode;
		_tmp10_ = string_to_string (_tmp9_);
		_tmp11_ = g_strconcat ("unknown transport method ", _tmp10_, NULL);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, _tmp12_);
		_tmp14_ = _tmp13_;
		_g_free0 (_tmp12_);
		_inner_error0_ = _tmp14_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_free0 (sid);
			_g_free0 (mode);
			_g_free0 (dstaddr);
			return NULL;
		} else {
			_g_free0 (sid);
			_g_free0 (mode);
			_g_free0 (dstaddr);
			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;
		}
	}
	_tmp16_ = dstaddr;
	if (_tmp16_ != NULL) {
		const gchar* _tmp17_;
		gint _tmp18_;
		gint _tmp19_;
		_tmp17_ = dstaddr;
		_tmp18_ = strlen (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp15_ = _tmp19_ > 255;
	} else {
		_tmp15_ = FALSE;
	}
	if (_tmp15_) {
		GError* _tmp20_;
		_tmp20_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "too long dstaddr");
		_inner_error0_ = _tmp20_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_free0 (sid);
			_g_free0 (mode);
			_g_free0 (dstaddr);
			return NULL;
		} else {
			_g_free0 (sid);
			_g_free0 (mode);
			_g_free0 (dstaddr);
			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;
		}
	}
	_tmp21_ = sid;
	_tmp22_ = dstaddr;
	_tmp23_ = xmpp_xep_jingle_socks5_bytestreams_parameters_new (XMPP_XEP_JINGLE_ROLE_RESPONDER, _tmp21_, local_full_jid, peer_full_jid, _tmp22_);
	_result_ = _tmp23_;
	{
		GeeList* _candidate_list = NULL;
		GeeList* _tmp24_;
		gint _candidate_size = 0;
		GeeList* _tmp25_;
		gint _tmp26_;
		gint _tmp27_;
		gint _candidate_index = 0;
		_tmp24_ = xmpp_stanza_node_get_subnodes (transport, "candidate", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, FALSE);
		_candidate_list = _tmp24_;
		_tmp25_ = _candidate_list;
		_tmp26_ = gee_collection_get_size ((GeeCollection*) _tmp25_);
		_tmp27_ = _tmp26_;
		_candidate_size = _tmp27_;
		_candidate_index = -1;
		while (TRUE) {
			gint _tmp28_;
			gint _tmp29_;
			XmppStanzaNode* candidate = NULL;
			GeeList* _tmp30_;
			gpointer _tmp31_;
			XmppXepJingleSocks5BytestreamsCandidate* _tmp32_ = NULL;
			XmppStanzaNode* _tmp33_;
			XmppXepJingleSocks5BytestreamsCandidate* _tmp34_;
			XmppXepJingleSocks5BytestreamsParameters* _tmp35_;
			GeeList* _tmp36_;
			_candidate_index = _candidate_index + 1;
			_tmp28_ = _candidate_index;
			_tmp29_ = _candidate_size;
			if (!(_tmp28_ < _tmp29_)) {
				break;
			}
			_tmp30_ = _candidate_list;
			_tmp31_ = gee_list_get (_tmp30_, _candidate_index);
			candidate = (XmppStanzaNode*) _tmp31_;
			_tmp33_ = candidate;
			_tmp34_ = xmpp_xep_jingle_socks5_bytestreams_candidate_parse (_tmp33_, &_inner_error0_);
			_tmp32_ = _tmp34_;
			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 (candidate);
					_g_object_unref0 (_candidate_list);
					_g_object_unref0 (_result_);
					_g_free0 (sid);
					_g_free0 (mode);
					_g_free0 (dstaddr);
					return NULL;
				} else {
					_xmpp_stanza_entry_unref0 (candidate);
					_g_object_unref0 (_candidate_list);
					_g_object_unref0 (_result_);
					_g_free0 (sid);
					_g_free0 (mode);
					_g_free0 (dstaddr);
					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;
				}
			}
			_tmp35_ = _result_;
			_tmp36_ = _tmp35_->remote_candidates;
			gee_collection_add ((GeeCollection*) _tmp36_, _tmp32_);
			_g_object_unref0 (_tmp32_);
			_xmpp_stanza_entry_unref0 (candidate);
		}
		_g_object_unref0 (_candidate_list);
	}
	result = _result_;
	_g_free0 (sid);
	_g_free0 (mode);
	_g_free0 (dstaddr);
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_real_set_content (XmppXepJingleTransportParameters* base,
                                                                XmppXepJingleContent* content)
{
	XmppXepJingleSocks5BytestreamsParameters * self;
	self = (XmppXepJingleSocks5BytestreamsParameters*) base;
	g_return_if_fail (content != NULL);
}

static XmppStanzaNode*
xmpp_xep_jingle_socks5_bytestreams_parameters_real_to_transport_stanza_node (XmppXepJingleTransportParameters* base,
                                                                             const gchar* action_type)
{
	XmppXepJingleSocks5BytestreamsParameters * self;
	XmppStanzaNode* transport = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	const gchar* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppXepJingleRole _tmp7_;
	XmppStanzaNode* _tmp11_;
	const gchar* _tmp12_;
	XmppStanzaNode* _tmp13_;
	XmppStanzaNode* _tmp14_;
	XmppStanzaNode* result;
	self = (XmppXepJingleSocks5BytestreamsParameters*) base;
	g_return_val_if_fail (action_type != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_new_build ("transport", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_stanza_node_add_self_xmlns (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->_local_dstaddr;
	_tmp5_ = xmpp_stanza_node_put_attribute (_tmp3_, "dstaddr", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	_xmpp_stanza_entry_unref0 (_tmp3_);
	_xmpp_stanza_entry_unref0 (_tmp1_);
	transport = _tmp6_;
	_tmp7_ = self->priv->_role;
	if (_tmp7_ == XMPP_XEP_JINGLE_ROLE_INITIATOR) {
		XmppStanzaNode* _tmp8_;
		XmppStanzaNode* _tmp9_;
		XmppStanzaNode* _tmp10_;
		_tmp8_ = transport;
		_tmp9_ = xmpp_stanza_node_put_attribute (_tmp8_, "mode", "tcp", NULL);
		_tmp10_ = _tmp9_;
		_xmpp_stanza_entry_unref0 (_tmp10_);
	}
	_tmp11_ = transport;
	_tmp12_ = self->priv->_sid;
	_tmp13_ = xmpp_stanza_node_put_attribute (_tmp11_, "sid", _tmp12_, NULL);
	_tmp14_ = _tmp13_;
	_xmpp_stanza_entry_unref0 (_tmp14_);
	{
		GeeList* _candidate_list = NULL;
		GeeList* _tmp15_;
		gint _candidate_size = 0;
		GeeList* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		gint _candidate_index = 0;
		_tmp15_ = self->local_candidates;
		_candidate_list = _tmp15_;
		_tmp16_ = _candidate_list;
		_tmp17_ = gee_collection_get_size ((GeeCollection*) _tmp16_);
		_tmp18_ = _tmp17_;
		_candidate_size = _tmp18_;
		_candidate_index = -1;
		while (TRUE) {
			gint _tmp19_;
			gint _tmp20_;
			XmppXepJingleSocks5BytestreamsCandidate* candidate = NULL;
			GeeList* _tmp21_;
			gpointer _tmp22_;
			XmppStanzaNode* _tmp23_;
			XmppXepJingleSocks5BytestreamsCandidate* _tmp24_;
			XmppStanzaNode* _tmp25_;
			XmppStanzaNode* _tmp26_;
			XmppStanzaNode* _tmp27_;
			XmppStanzaNode* _tmp28_;
			_candidate_index = _candidate_index + 1;
			_tmp19_ = _candidate_index;
			_tmp20_ = _candidate_size;
			if (!(_tmp19_ < _tmp20_)) {
				break;
			}
			_tmp21_ = _candidate_list;
			_tmp22_ = gee_list_get (_tmp21_, _candidate_index);
			candidate = (XmppXepJingleSocks5BytestreamsCandidate*) _tmp22_;
			_tmp23_ = transport;
			_tmp24_ = candidate;
			_tmp25_ = xmpp_xep_jingle_socks5_bytestreams_candidate_to_xml (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = xmpp_stanza_node_put_node (_tmp23_, _tmp26_);
			_tmp28_ = _tmp27_;
			_xmpp_stanza_entry_unref0 (_tmp28_);
			_xmpp_stanza_entry_unref0 (_tmp26_);
			_g_object_unref0 (candidate);
		}
	}
	result = transport;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_real_handle_transport_accept (XmppXepJingleTransportParameters* base,
                                                                            XmppStanzaNode* transport,
                                                                            GError** error)
{
	XmppXepJingleSocks5BytestreamsParameters * self;
	XmppXepJingleSocks5BytestreamsParameters* other = NULL;
	XmppJid* _tmp0_;
	XmppJid* _tmp1_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp2_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp7_;
	GeeList* _tmp8_;
	GeeList* _tmp9_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp10_;
	const gchar* _tmp11_;
	GError* _inner_error0_ = NULL;
	self = (XmppXepJingleSocks5BytestreamsParameters*) base;
	g_return_if_fail (transport != NULL);
	_tmp0_ = self->priv->local_full_jid;
	_tmp1_ = self->priv->peer_full_jid;
	_tmp2_ = xmpp_xep_jingle_socks5_bytestreams_parameters_parse (_tmp0_, _tmp1_, transport, &_inner_error0_);
	other = _tmp2_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			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;
		}
	}
	_tmp3_ = other;
	_tmp4_ = _tmp3_->priv->_sid;
	_tmp5_ = self->priv->_sid;
	if (g_strcmp0 (_tmp4_, _tmp5_) != 0) {
		GError* _tmp6_;
		_tmp6_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "invalid sid");
		_inner_error0_ = _tmp6_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (other);
			return;
		} else {
			_g_object_unref0 (other);
			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;
		}
	}
	_tmp7_ = other;
	_tmp8_ = _tmp7_->remote_candidates;
	_tmp9_ = _g_object_ref0 (_tmp8_);
	_g_object_unref0 (self->remote_candidates);
	self->remote_candidates = _tmp9_;
	_tmp10_ = other;
	_tmp11_ = _tmp10_->priv->_remote_dstaddr;
	xmpp_xep_jingle_socks5_bytestreams_parameters_set_remote_dstaddr (self, _tmp11_);
	_g_object_unref0 (other);
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_real_handle_transport_info (XmppXepJingleTransportParameters* base,
                                                                          XmppStanzaNode* transport,
                                                                          GError** error)
{
	XmppXepJingleSocks5BytestreamsParameters * self;
	GeeArrayList* socks5_nodes = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	GeeArrayList* _tmp16_;
	gint _tmp17_;
	gint _tmp18_;
	XmppStanzaNode* node = NULL;
	GeeArrayList* _tmp19_;
	gpointer _tmp20_;
	XmppStanzaNode* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	GQuark _tmp25_ = 0U;
	static GQuark _tmp24_label0 = 0;
	static GQuark _tmp24_label1 = 0;
	static GQuark _tmp24_label2 = 0;
	static GQuark _tmp24_label3 = 0;
	GError* _inner_error0_ = NULL;
	self = (XmppXepJingleSocks5BytestreamsParameters*) base;
	g_return_if_fail (transport != NULL);
	_tmp0_ = gee_array_list_new (XMPP_TYPE_STANZA_NODE, (GBoxedCopyFunc) xmpp_stanza_entry_ref, (GDestroyNotify) xmpp_stanza_entry_unref, NULL, NULL, NULL);
	socks5_nodes = _tmp0_;
	{
		GeeList* _node_list = NULL;
		GeeList* _tmp1_;
		gint _node_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _node_index = 0;
		_tmp1_ = transport->sub_nodes;
		_node_list = _tmp1_;
		_tmp2_ = _node_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_node_size = _tmp4_;
		_node_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			XmppStanzaNode* node = NULL;
			GeeList* _tmp7_;
			gpointer _tmp8_;
			XmppStanzaNode* _tmp9_;
			const gchar* _tmp10_;
			_node_index = _node_index + 1;
			_tmp5_ = _node_index;
			_tmp6_ = _node_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _node_list;
			_tmp8_ = gee_list_get (_tmp7_, _node_index);
			node = (XmppStanzaNode*) _tmp8_;
			_tmp9_ = node;
			_tmp10_ = ((XmppStanzaEntry*) _tmp9_)->ns_uri;
			if (g_strcmp0 (_tmp10_, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI) == 0) {
				GeeArrayList* _tmp11_;
				XmppStanzaNode* _tmp12_;
				_tmp11_ = socks5_nodes;
				_tmp12_ = node;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp12_);
			}
			_xmpp_stanza_entry_unref0 (node);
		}
	}
	_tmp13_ = socks5_nodes;
	_tmp14_ = gee_collection_get_is_empty ((GeeCollection*) _tmp13_);
	_tmp15_ = _tmp14_;
	if (_tmp15_) {
		g_warning ("0260_jingle_socks5_bytestreams.vala:438: No socks5 subnodes in transpo" \
"rt node");
		_g_object_unref0 (socks5_nodes);
		return;
	}
	_tmp16_ = socks5_nodes;
	_tmp17_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp16_);
	_tmp18_ = _tmp17_;
	if (_tmp18_ > 1) {
		g_warning ("0260_jingle_socks5_bytestreams.vala:439: Too many socks5 subnodes in t" \
"ransport node");
		_g_object_unref0 (socks5_nodes);
		return;
	}
	_tmp19_ = socks5_nodes;
	_tmp20_ = gee_abstract_list_get ((GeeAbstractList*) _tmp19_, 0);
	node = (XmppStanzaNode*) _tmp20_;
	_tmp21_ = node;
	_tmp22_ = ((XmppStanzaEntry*) _tmp21_)->name;
	_tmp23_ = _tmp22_;
	_tmp25_ = (NULL == _tmp23_) ? 0 : g_quark_from_string (_tmp23_);
	if (_tmp25_ == ((0 != _tmp24_label0) ? _tmp24_label0 : (_tmp24_label0 = g_quark_from_static_string ("activated")))) {
		switch (0) {
			default:
			{
				gchar* cid = NULL;
				XmppStanzaNode* _tmp26_;
				const gchar* _tmp27_;
				gchar* _tmp28_;
				const gchar* _tmp29_;
				const gchar* _tmp31_;
				_tmp26_ = node;
				_tmp27_ = xmpp_stanza_node_get_attribute (_tmp26_, "cid", NULL);
				_tmp28_ = g_strdup (_tmp27_);
				cid = _tmp28_;
				_tmp29_ = cid;
				if (_tmp29_ == NULL) {
					GError* _tmp30_;
					_tmp30_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "missing cid");
					_inner_error0_ = _tmp30_;
					if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
						g_propagate_error (error, _inner_error0_);
						_g_free0 (cid);
						_xmpp_stanza_entry_unref0 (node);
						_g_object_unref0 (socks5_nodes);
						return;
					} else {
						_g_free0 (cid);
						_xmpp_stanza_entry_unref0 (node);
						_g_object_unref0 (socks5_nodes);
						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;
					}
				}
				_tmp31_ = cid;
				xmpp_xep_jingle_socks5_bytestreams_parameters_handle_activated (self, _tmp31_, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
						g_propagate_error (error, _inner_error0_);
						_g_free0 (cid);
						_xmpp_stanza_entry_unref0 (node);
						_g_object_unref0 (socks5_nodes);
						return;
					} else {
						_g_free0 (cid);
						_xmpp_stanza_entry_unref0 (node);
						_g_object_unref0 (socks5_nodes);
						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;
					}
				}
				_g_free0 (cid);
				break;
			}
		}
	} else if (_tmp25_ == ((0 != _tmp24_label1) ? _tmp24_label1 : (_tmp24_label1 = g_quark_from_static_string ("candidate-used")))) {
		switch (0) {
			default:
			{
				gchar* cid = NULL;
				XmppStanzaNode* _tmp32_;
				const gchar* _tmp33_;
				gchar* _tmp34_;
				const gchar* _tmp35_;
				const gchar* _tmp37_;
				_tmp32_ = node;
				_tmp33_ = xmpp_stanza_node_get_attribute (_tmp32_, "cid", NULL);
				_tmp34_ = g_strdup (_tmp33_);
				cid = _tmp34_;
				_tmp35_ = cid;
				if (_tmp35_ == NULL) {
					GError* _tmp36_;
					_tmp36_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "missing cid");
					_inner_error0_ = _tmp36_;
					if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
						g_propagate_error (error, _inner_error0_);
						_g_free0 (cid);
						_xmpp_stanza_entry_unref0 (node);
						_g_object_unref0 (socks5_nodes);
						return;
					} else {
						_g_free0 (cid);
						_xmpp_stanza_entry_unref0 (node);
						_g_object_unref0 (socks5_nodes);
						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;
					}
				}
				_tmp37_ = cid;
				xmpp_xep_jingle_socks5_bytestreams_parameters_handle_remote_candidate (self, _tmp37_, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
						g_propagate_error (error, _inner_error0_);
						_g_free0 (cid);
						_xmpp_stanza_entry_unref0 (node);
						_g_object_unref0 (socks5_nodes);
						return;
					} else {
						_g_free0 (cid);
						_xmpp_stanza_entry_unref0 (node);
						_g_object_unref0 (socks5_nodes);
						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;
					}
				}
				_g_free0 (cid);
				break;
			}
		}
	} else if (_tmp25_ == ((0 != _tmp24_label2) ? _tmp24_label2 : (_tmp24_label2 = g_quark_from_static_string ("candidate-error")))) {
		switch (0) {
			default:
			{
				xmpp_xep_jingle_socks5_bytestreams_parameters_handle_remote_candidate (self, NULL, &_inner_error0_);
				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 (node);
						_g_object_unref0 (socks5_nodes);
						return;
					} else {
						_xmpp_stanza_entry_unref0 (node);
						_g_object_unref0 (socks5_nodes);
						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;
					}
				}
				break;
			}
		}
	} else if (_tmp25_ == ((0 != _tmp24_label3) ? _tmp24_label3 : (_tmp24_label3 = g_quark_from_static_string ("proxy-error")))) {
		switch (0) {
			default:
			{
				xmpp_xep_jingle_socks5_bytestreams_parameters_handle_proxy_error (self, &_inner_error0_);
				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 (node);
						_g_object_unref0 (socks5_nodes);
						return;
					} else {
						_xmpp_stanza_entry_unref0 (node);
						_g_object_unref0 (socks5_nodes);
						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;
					}
				}
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				gchar* _tmp38_;
				gchar* _tmp39_;
				_tmp38_ = xmpp_stanza_entry_to_string ((XmppStanzaEntry*) transport, 0);
				_tmp39_ = _tmp38_;
				g_warning ("0260_jingle_socks5_bytestreams.vala:465: Unknown transport-info: %s", _tmp39_);
				_g_free0 (_tmp39_);
				break;
			}
		}
	}
	_xmpp_stanza_entry_unref0 (node);
	_g_object_unref0 (socks5_nodes);
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_handle_remote_candidate (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                       const gchar* cid,
                                                                       GError** error)
{
	XmppXepJingleSocks5BytestreamsCandidate* candidate = NULL;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp16_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp17_;
	const gchar* _tmp18_ = NULL;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp19_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	if (self->priv->remote_sent_selected_candidate) {
		GError* _tmp0_;
		_tmp0_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "remote candidate already specified");
		_inner_error0_ = _tmp0_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			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;
		}
	}
	candidate = NULL;
	if (cid != NULL) {
		XmppXepJingleSocks5BytestreamsCandidate* _tmp14_;
		{
			GeeList* _c_list = NULL;
			GeeList* _tmp1_;
			gint _c_size = 0;
			GeeList* _tmp2_;
			gint _tmp3_;
			gint _tmp4_;
			gint _c_index = 0;
			_tmp1_ = self->local_candidates;
			_c_list = _tmp1_;
			_tmp2_ = _c_list;
			_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
			_tmp4_ = _tmp3_;
			_c_size = _tmp4_;
			_c_index = -1;
			while (TRUE) {
				gint _tmp5_;
				gint _tmp6_;
				XmppXepJingleSocks5BytestreamsCandidate* c = NULL;
				GeeList* _tmp7_;
				gpointer _tmp8_;
				XmppXepJingleSocks5BytestreamsCandidate* _tmp9_;
				const gchar* _tmp10_;
				const gchar* _tmp11_;
				_c_index = _c_index + 1;
				_tmp5_ = _c_index;
				_tmp6_ = _c_size;
				if (!(_tmp5_ < _tmp6_)) {
					break;
				}
				_tmp7_ = _c_list;
				_tmp8_ = gee_list_get (_tmp7_, _c_index);
				c = (XmppXepJingleSocks5BytestreamsCandidate*) _tmp8_;
				_tmp9_ = c;
				_tmp10_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (_tmp9_);
				_tmp11_ = _tmp10_;
				if (g_strcmp0 (_tmp11_, cid) == 0) {
					XmppXepJingleSocks5BytestreamsCandidate* _tmp12_;
					XmppXepJingleSocks5BytestreamsCandidate* _tmp13_;
					_tmp12_ = c;
					_tmp13_ = _g_object_ref0 (_tmp12_);
					_g_object_unref0 (candidate);
					candidate = _tmp13_;
					_g_object_unref0 (c);
					break;
				}
				_g_object_unref0 (c);
			}
		}
		_tmp14_ = candidate;
		if (_tmp14_ == NULL) {
			GError* _tmp15_;
			_tmp15_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "unknown cid");
			_inner_error0_ = _tmp15_;
			if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
				g_propagate_error (error, _inner_error0_);
				_g_object_unref0 (candidate);
				return;
			} else {
				_g_object_unref0 (candidate);
				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;
			}
		}
	}
	self->priv->remote_sent_selected_candidate = TRUE;
	_tmp16_ = candidate;
	_tmp17_ = _g_object_ref0 (_tmp16_);
	_g_object_unref0 (self->priv->remote_selected_candidate);
	self->priv->remote_selected_candidate = _tmp17_;
	_tmp19_ = candidate;
	if (_tmp19_ != NULL) {
		XmppXepJingleSocks5BytestreamsCandidate* _tmp20_;
		const gchar* _tmp21_;
		const gchar* _tmp22_;
		_tmp20_ = candidate;
		_tmp21_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp18_ = _tmp22_;
	} else {
		_tmp18_ = "(null)";
	}
	g_debug ("0260_jingle_socks5_bytestreams.vala:488: Remote selected candidate %s", _tmp18_);
	xmpp_xep_jingle_socks5_bytestreams_parameters_try_completing_negotiation (self);
	_g_object_unref0 (candidate);
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_handle_activated (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                const gchar* cid,
                                                                GError** error)
{
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	GSourceFunc _tmp4_;
	gpointer _tmp4__target;
	GDestroyNotify _tmp4__target_destroy_notify;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cid != NULL);
	_tmp1_ = self->priv->waiting_for_activation_cid;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->waiting_for_activation_cid;
		_tmp0_ = g_strcmp0 (cid, _tmp2_) != 0;
	}
	if (_tmp0_) {
		GError* _tmp3_;
		_tmp3_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "unexpected proxy activation message");
		_inner_error0_ = _tmp3_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			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;
		}
	}
	_tmp4_ = self->priv->waiting_for_activation_callback;
	_tmp4__target = self->priv->waiting_for_activation_callback_target;
	_tmp4__target_destroy_notify = self->priv->waiting_for_activation_callback_target_destroy_notify;
	self->priv->waiting_for_activation_callback = NULL;
	self->priv->waiting_for_activation_callback_target = NULL;
	self->priv->waiting_for_activation_callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _tmp4_, _tmp4__target, _tmp4__target_destroy_notify);
	_g_free0 (self->priv->waiting_for_activation_cid);
	self->priv->waiting_for_activation_cid = NULL;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_handle_proxy_error (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                  GError** error)
{
	const gchar* _tmp0_;
	GSourceFunc _tmp2_;
	gpointer _tmp2__target;
	GDestroyNotify _tmp2__target_destroy_notify;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->waiting_for_activation_cid;
	if (_tmp0_ == NULL) {
		GError* _tmp1_;
		_tmp1_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "unexpected proxy error message");
		_inner_error0_ = _tmp1_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			return;
		} else {
			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;
		}
	}
	_tmp2_ = self->priv->waiting_for_activation_callback;
	_tmp2__target = self->priv->waiting_for_activation_callback_target;
	_tmp2__target_destroy_notify = self->priv->waiting_for_activation_callback_target_destroy_notify;
	self->priv->waiting_for_activation_callback = NULL;
	self->priv->waiting_for_activation_callback_target = NULL;
	self->priv->waiting_for_activation_callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _tmp2_, _tmp2__target, _tmp2__target_destroy_notify);
	_g_free0 (self->priv->waiting_for_activation_cid);
	self->priv->waiting_for_activation_cid = NULL;
	self->priv->waiting_for_activation_error = TRUE;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_try_completing_negotiation (XmppXepJingleSocks5BytestreamsParameters* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp2_;
	gboolean remote_wins = FALSE;
	gboolean _tmp6_ = FALSE;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp7_;
	g_return_if_fail (self != NULL);
	if (!self->priv->remote_sent_selected_candidate) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = !self->priv->local_determined_selected_candidate;
	}
	if (_tmp0_) {
		return;
	}
	_tmp2_ = self->priv->remote_selected_candidate;
	if (_tmp2_ == NULL) {
		XmppXepJingleSocks5BytestreamsCandidate* _tmp3_;
		_tmp3_ = self->priv->local_selected_candidate;
		_tmp1_ = _tmp3_ == NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GError* _tmp4_;
		GError* _tmp5_;
		_tmp4_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, "No candidates");
		_tmp5_ = _tmp4_;
		xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection_error (self, _tmp5_);
		_g_error_free0 (_tmp5_);
		return;
	}
	_tmp7_ = self->priv->remote_selected_candidate;
	if (_tmp7_ != NULL) {
		XmppXepJingleSocks5BytestreamsCandidate* _tmp8_;
		_tmp8_ = self->priv->local_selected_candidate;
		_tmp6_ = _tmp8_ != NULL;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		XmppXepJingleSocks5BytestreamsCandidate* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		XmppXepJingleSocks5BytestreamsCandidate* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		_tmp9_ = self->priv->local_selected_candidate;
		_tmp10_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = self->priv->remote_selected_candidate;
		_tmp13_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (_tmp12_);
		_tmp14_ = _tmp13_;
		if (_tmp11_ == _tmp14_) {
			XmppXepJingleRole _tmp15_;
			_tmp15_ = self->priv->_role;
			remote_wins = _tmp15_ == XMPP_XEP_JINGLE_ROLE_INITIATOR;
		} else {
			XmppXepJingleSocks5BytestreamsCandidate* _tmp16_;
			gint _tmp17_;
			gint _tmp18_;
			XmppXepJingleSocks5BytestreamsCandidate* _tmp19_;
			gint _tmp20_;
			gint _tmp21_;
			_tmp16_ = self->priv->local_selected_candidate;
			_tmp17_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = self->priv->remote_selected_candidate;
			_tmp20_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (_tmp19_);
			_tmp21_ = _tmp20_;
			remote_wins = _tmp18_ < _tmp21_;
		}
	} else {
		XmppXepJingleSocks5BytestreamsCandidate* _tmp22_;
		_tmp22_ = self->priv->remote_selected_candidate;
		remote_wins = _tmp22_ != NULL;
	}
	if (!remote_wins) {
		XmppXepJingleSocks5BytestreamsCandidate* _tmp23_;
		XmppXepJingleSocks5BytestreamsCandidateType _tmp24_;
		XmppXepJingleSocks5BytestreamsCandidateType _tmp25_;
		_tmp23_ = self->priv->local_selected_candidate;
		_tmp24_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_type_ (_tmp23_);
		_tmp25_ = _tmp24_;
		if (_tmp25_ != XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_PROXY) {
			XmppXepJingleSession* strong = NULL;
			XmppXepJingleSession* _tmp26_;
			XmppXepJingleSession* _tmp27_;
			XmppXepJingleSession* _tmp28_;
			GSocketConnection* _tmp29_;
			_tmp26_ = self->priv->session;
			_tmp27_ = _g_object_ref0 (_tmp26_);
			strong = _tmp27_;
			_tmp28_ = strong;
			if (_tmp28_ == NULL) {
				_g_object_unref0 (strong);
				return;
			}
			_tmp29_ = self->priv->local_selected_candidate_conn;
			xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection (self, (GIOStream*) _tmp29_);
			_g_object_unref0 (strong);
		} else {
			XmppXepJingleSocks5BytestreamsCandidate* _tmp30_;
			GSocketConnection* _tmp31_;
			_tmp30_ = self->priv->local_selected_candidate;
			_tmp31_ = self->priv->local_selected_candidate_conn;
			xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation (self, _tmp30_, _tmp31_, NULL, NULL);
		}
	} else {
		XmppXepJingleSocks5BytestreamsCandidate* _tmp32_;
		XmppXepJingleSocks5BytestreamsCandidateType _tmp33_;
		XmppXepJingleSocks5BytestreamsCandidateType _tmp34_;
		_tmp32_ = self->priv->remote_selected_candidate;
		_tmp33_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_type_ (_tmp32_);
		_tmp34_ = _tmp33_;
		if (_tmp34_ == XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_CANDIDATE_TYPE_DIRECT) {
			XmppXepJingleSession* strong = NULL;
			XmppXepJingleSession* _tmp35_;
			XmppXepJingleSession* _tmp36_;
			XmppXepJingleSession* _tmp37_;
			GSocketConnection* conn = NULL;
			XmppXepJingleSocks5BytestreamsLocalListener* _tmp38_;
			XmppXepJingleSocks5BytestreamsCandidate* _tmp39_;
			const gchar* _tmp40_;
			const gchar* _tmp41_;
			GSocketConnection* _tmp42_;
			GSocketConnection* _tmp43_;
			GSocketConnection* _tmp46_;
			_tmp35_ = self->priv->session;
			_tmp36_ = _g_object_ref0 (_tmp35_);
			strong = _tmp36_;
			_tmp37_ = strong;
			if (_tmp37_ == NULL) {
				_g_object_unref0 (strong);
				return;
			}
			_tmp38_ = self->listener;
			_tmp39_ = self->priv->remote_selected_candidate;
			_tmp40_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (_tmp39_);
			_tmp41_ = _tmp40_;
			_tmp42_ = xmpp_xep_jingle_socks5_bytestreams_local_listener_get_connection (_tmp38_, _tmp41_);
			conn = _tmp42_;
			_tmp43_ = conn;
			if (_tmp43_ == NULL) {
				GError* _tmp44_;
				GError* _tmp45_;
				_tmp44_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, "Remote hasn't actually connected to us?!");
				_tmp45_ = _tmp44_;
				xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection_error (self, _tmp45_);
				_g_error_free0 (_tmp45_);
				_g_object_unref0 (conn);
				_g_object_unref0 (strong);
				return;
			}
			_tmp46_ = conn;
			xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection (self, (GIOStream*) _tmp46_);
			_g_object_unref0 (conn);
			_g_object_unref0 (strong);
		} else {
			XmppXepJingleSocks5BytestreamsCandidate* _tmp47_;
			_tmp47_ = self->priv->remote_selected_candidate;
			xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate (self, _tmp47_, NULL, NULL);
		}
	}
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_data_free (gpointer _data)
{
	XmppXepJingleSocks5BytestreamsParametersWaitForRemoteActivationData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->candidate);
	_g_object_unref0 (_data_->conn);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleSocks5BytestreamsParametersWaitForRemoteActivationData, _data_);
}

void
xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                          XmppXepJingleSocks5BytestreamsCandidate* candidate,
                                                                          GSocketConnection* conn,
                                                                          GAsyncReadyCallback _callback_,
                                                                          gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsParametersWaitForRemoteActivationData* _data_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp0_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp1_;
	GSocketConnection* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (candidate != NULL);
	g_return_if_fail (conn != NULL);
	_data_ = g_slice_new0 (XmppXepJingleSocks5BytestreamsParametersWaitForRemoteActivationData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (candidate);
	_g_object_unref0 (_data_->candidate);
	_data_->candidate = _tmp1_;
	_tmp2_ = _g_object_ref0 (conn);
	_g_object_unref0 (_data_->conn);
	_data_->conn = _tmp2_;
	xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_co (_data_);
}

void
xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_finish (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                 GAsyncResult* _res_)
{
	XmppXepJingleSocks5BytestreamsParametersWaitForRemoteActivationData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gboolean
_xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_co_gsource_func (gpointer self)
{
	gboolean result;
	result = xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_co (self);
	return result;
}

static gboolean
xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_co (XmppXepJingleSocks5BytestreamsParametersWaitForRemoteActivationData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (_data_->candidate);
	_data_->_tmp1_ = _data_->_tmp0_;
	g_debug ("0260_jingle_socks5_bytestreams.vala:562: Waiting for remote activation" \
" of %s", _data_->_tmp1_);
	_data_->_tmp2_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (_data_->candidate);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = g_strdup (_data_->_tmp3_);
	_g_free0 (_data_->self->priv->waiting_for_activation_cid);
	_data_->self->priv->waiting_for_activation_cid = _data_->_tmp4_;
	(_data_->self->priv->waiting_for_activation_callback_target_destroy_notify == NULL) ? NULL : (_data_->self->priv->waiting_for_activation_callback_target_destroy_notify (_data_->self->priv->waiting_for_activation_callback_target), NULL);
	_data_->self->priv->waiting_for_activation_callback = NULL;
	_data_->self->priv->waiting_for_activation_callback_target = NULL;
	_data_->self->priv->waiting_for_activation_callback_target_destroy_notify = NULL;
	_data_->self->priv->waiting_for_activation_callback = _xmpp_xep_jingle_socks5_bytestreams_parameters_wait_for_remote_activation_co_gsource_func;
	_data_->self->priv->waiting_for_activation_callback_target = _data_;
	_data_->self->priv->waiting_for_activation_callback_target_destroy_notify = NULL;
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->_tmp5_ = _data_->self->priv->session;
	_data_->_tmp6_ = _g_object_ref0 (_data_->_tmp5_);
	_data_->strong = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->strong;
	if (_data_->_tmp7_ == NULL) {
		_g_object_unref0 (_data_->strong);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (!_data_->self->priv->waiting_for_activation_error) {
		xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection (_data_->self, (GIOStream*) _data_->conn);
	} else {
		_data_->_tmp8_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_FAILED, "waiting_for_activation_error");
		_data_->_tmp9_ = _data_->_tmp8_;
		xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection_error (_data_->self, _data_->_tmp9_);
		_g_error_free0 (_data_->_tmp9_);
	}
	_g_object_unref0 (_data_->strong);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_data_free (gpointer _data)
{
	XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->candidate);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData, _data_);
}

void
xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                          XmppXepJingleSocks5BytestreamsCandidate* candidate,
                                                                          GAsyncReadyCallback _callback_,
                                                                          gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData* _data_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp0_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (candidate != NULL);
	_data_ = g_slice_new0 (XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (candidate);
	_g_object_unref0 (_data_->candidate);
	_data_->candidate = _tmp1_;
	xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_co (_data_);
}

void
xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_finish (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                 GAsyncResult* _res_)
{
	XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		XmppXepJingleSocks5BytestreamsParameters* self;
		self = _data14_->self;
		(_data14_->callback_target_destroy_notify == NULL) ? NULL : (_data14_->callback_target_destroy_notify (_data14_->callback_target), NULL);
		_data14_->callback = NULL;
		_data14_->callback_target = NULL;
		_data14_->callback_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block14Data, _data14_);
	}
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_ready (GObject* source_object,
                                                                                GAsyncResult* _res_,
                                                                                gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_co (_data_);
}

static gboolean
_xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_co_gsource_func (gpointer self)
{
	gboolean result;
	result = xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_co (self);
	return result;
}

static void
___lambda29_ (Block14Data* _data14_,
              XmppXmppStream* stream,
              XmppIqStanza* iq)
{
	XmppXepJingleSocks5BytestreamsParameters* self;
	GSourceFunc _tmp0_;
	gpointer _tmp0__target;
	GDestroyNotify _tmp0__target_destroy_notify;
	self = _data14_->self;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (iq != NULL);
	_data14_->activation_error = xmpp_stanza_is_error ((XmppStanza*) iq);
	_tmp0_ = _data14_->callback;
	_tmp0__target = _data14_->callback_target;
	_tmp0__target_destroy_notify = _data14_->callback_target_destroy_notify;
	_data14_->callback = NULL;
	_data14_->callback_target = NULL;
	_data14_->callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _tmp0_, _tmp0__target, _tmp0__target_destroy_notify);
}

static void
____lambda29__xmpp_iq_module_on_result (XmppXmppStream* stream,
                                        XmppIqStanza* iq,
                                        gpointer self)
{
	___lambda29_ (self, stream, iq);
}

static gboolean
xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_co (XmppXepJingleSocks5BytestreamsParametersConnectToLocalCandidateData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (_data_->candidate);
	_data_->_tmp1_ = _data_->_tmp0_;
	g_debug ("0260_jingle_socks5_bytestreams.vala:579: Connecting to candidate %s", _data_->_tmp1_);
	{
		_data_->_data14_ = g_slice_new0 (Block14Data);
		_data_->_data14_->_ref_count_ = 1;
		_data_->_data14_->self = g_object_ref (_data_->self);
		_data_->_tmp2_ = _data_->self->priv->_local_dstaddr;
		_data_->_state_ = 1;
		xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5 (_data_->self, _data_->candidate, _data_->_tmp2_, xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp3_ = xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->conn = _data_->_tmp3_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			block14_data_unref (_data_->_data14_);
			_data_->_data14_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_data14_->activation_error = FALSE;
		_data_->_data14_->callback = _xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_local_candidate_co_gsource_func;
		_data_->_data14_->callback_target = _data_;
		_data_->_data14_->callback_target_destroy_notify = NULL;
		_data_->_tmp4_ = xmpp_stanza_node_new_build ("query", XMPP_XEP_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp5_);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _data_->self->priv->_sid;
		_data_->_tmp9_ = xmpp_stanza_node_put_attribute (_data_->_tmp7_, "sid", _data_->_tmp8_, NULL);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = xmpp_stanza_node_new_build ("activate", XMPP_XEP_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = _data_->self->priv->peer_full_jid;
		_data_->_tmp14_ = xmpp_jid_to_string (_data_->_tmp13_);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = xmpp_stanza_node_new_text (_data_->_tmp15_);
		_data_->_tmp17_ = _data_->_tmp16_;
		_data_->_tmp18_ = xmpp_stanza_node_put_node (_data_->_tmp12_, _data_->_tmp17_);
		_data_->_tmp19_ = _data_->_tmp18_;
		_data_->_tmp20_ = xmpp_stanza_node_put_node (_data_->_tmp10_, _data_->_tmp19_);
		_data_->_tmp21_ = _data_->_tmp20_;
		_xmpp_stanza_entry_unref0 (_data_->_tmp19_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp17_);
		_g_free0 (_data_->_tmp15_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp12_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp10_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp7_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp5_);
		_data_->query = _data_->_tmp21_;
		_data_->_tmp22_ = _data_->query;
		_data_->_tmp23_ = xmpp_xep_socks5_bytestreams_proxy_get_jid ((XmppXepSocks5BytestreamsProxy*) _data_->candidate);
		_data_->_tmp24_ = _data_->_tmp23_;
		_data_->_tmp25_ = _xmpp_jid_ref0 (_data_->_tmp24_);
		_data_->_tmp26_ = NULL;
		_data_->_tmp26_ = xmpp_iq_stanza_new_set (_data_->_tmp22_, NULL);
		xmpp_stanza_set_to ((XmppStanza*) _data_->_tmp26_, _data_->_tmp25_);
		_xmpp_jid_unref0 (_data_->_tmp25_);
		_data_->iq = _data_->_tmp26_;
		_data_->_tmp27_ = _data_->self->priv->hack;
		_data_->_tmp28_ = xmpp_iq_module_IDENTITY;
		_data_->_tmp29_ = xmpp_xmpp_stream_get_module (_data_->_tmp27_, XMPP_IQ_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp28_);
		_data_->_tmp30_ = (XmppIqModule*) _data_->_tmp29_;
		_data_->_tmp31_ = _data_->self->priv->hack;
		_data_->_tmp32_ = _data_->iq;
		xmpp_iq_module_send_iq (_data_->_tmp30_, _data_->_tmp31_, _data_->_tmp32_, ____lambda29__xmpp_iq_module_on_result, block14_data_ref (_data_->_data14_), block14_data_unref, G_PRIORITY_DEFAULT);
		_g_object_unref0 (_data_->_tmp30_);
		_data_->_state_ = 2;
		return FALSE;
		_state_2:
		;
		if (_data_->_data14_->activation_error) {
			_data_->_tmp33_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, "activation iq error");
			_data_->_inner_error0_ = _data_->_tmp33_;
			_g_object_unref0 (_data_->iq);
			_xmpp_stanza_entry_unref0 (_data_->query);
			_g_object_unref0 (_data_->conn);
			block14_data_unref (_data_->_data14_);
			_data_->_data14_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp34_ = _data_->self->priv->content;
		_data_->_tmp35_ = _g_object_ref0 (_data_->_tmp34_);
		_data_->strong_content = _data_->_tmp35_;
		_data_->_tmp36_ = _data_->strong_content;
		if (_data_->_tmp36_ == NULL) {
			_g_object_unref0 (_data_->strong_content);
			_g_object_unref0 (_data_->iq);
			_xmpp_stanza_entry_unref0 (_data_->query);
			_g_object_unref0 (_data_->conn);
			block14_data_unref (_data_->_data14_);
			_data_->_data14_ = NULL;
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp37_ = _data_->strong_content;
		_data_->_tmp38_ = xmpp_stanza_node_new_build ("transport", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
		_data_->_tmp39_ = _data_->_tmp38_;
		_data_->_tmp40_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp39_);
		_data_->_tmp41_ = _data_->_tmp40_;
		_data_->_tmp42_ = _data_->self->priv->_sid;
		_data_->_tmp43_ = xmpp_stanza_node_put_attribute (_data_->_tmp41_, "sid", _data_->_tmp42_, NULL);
		_data_->_tmp44_ = _data_->_tmp43_;
		_data_->_tmp45_ = xmpp_stanza_node_new_build ("activated", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
		_data_->_tmp46_ = _data_->_tmp45_;
		_data_->_tmp47_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (_data_->candidate);
		_data_->_tmp48_ = _data_->_tmp47_;
		_data_->_tmp49_ = xmpp_stanza_node_put_attribute (_data_->_tmp46_, "cid", _data_->_tmp48_, NULL);
		_data_->_tmp50_ = _data_->_tmp49_;
		_data_->_tmp51_ = xmpp_stanza_node_put_node (_data_->_tmp44_, _data_->_tmp50_);
		_data_->_tmp52_ = _data_->_tmp51_;
		xmpp_xep_jingle_content_send_transport_info (_data_->_tmp37_, _data_->_tmp52_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp52_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp50_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp46_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp44_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp41_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp39_);
		_data_->_tmp53_ = _data_->conn;
		xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection (_data_->self, (GIOStream*) _data_->_tmp53_);
		_g_object_unref0 (_data_->strong_content);
		_g_object_unref0 (_data_->iq);
		_xmpp_stanza_entry_unref0 (_data_->query);
		_g_object_unref0 (_data_->conn);
		block14_data_unref (_data_->_data14_);
		_data_->_data14_ = NULL;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp54_ = _data_->self->priv->content;
		_data_->_tmp55_ = _g_object_ref0 (_data_->_tmp54_);
		_data_->_vala1_strong_content = _data_->_tmp55_;
		_data_->_tmp56_ = _data_->_vala1_strong_content;
		if (_data_->_tmp56_ == NULL) {
			_g_object_unref0 (_data_->_vala1_strong_content);
			_g_error_free0 (_data_->e);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp57_ = _data_->_vala1_strong_content;
		_data_->_tmp58_ = xmpp_stanza_node_new_build ("transport", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
		_data_->_tmp59_ = _data_->_tmp58_;
		_data_->_tmp60_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp59_);
		_data_->_tmp61_ = _data_->_tmp60_;
		_data_->_tmp62_ = _data_->self->priv->_sid;
		_data_->_tmp63_ = xmpp_stanza_node_put_attribute (_data_->_tmp61_, "sid", _data_->_tmp62_, NULL);
		_data_->_tmp64_ = _data_->_tmp63_;
		_data_->_tmp65_ = xmpp_stanza_node_new_build ("proxy-error", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
		_data_->_tmp66_ = _data_->_tmp65_;
		_data_->_tmp67_ = xmpp_stanza_node_put_node (_data_->_tmp64_, _data_->_tmp66_);
		_data_->_tmp68_ = _data_->_tmp67_;
		xmpp_xep_jingle_content_send_transport_info (_data_->_tmp57_, _data_->_tmp68_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp68_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp66_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp64_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp61_);
		_xmpp_stanza_entry_unref0 (_data_->_tmp59_);
		_data_->_tmp69_ = _data_->e;
		_data_->_tmp70_ = _data_->_tmp69_->message;
		_data_->_tmp71_ = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "Connect to local candidate error: %s", _data_->_tmp70_);
		_data_->_tmp72_ = _data_->_tmp71_;
		xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection_error (_data_->self, _data_->_tmp72_);
		_g_error_free0 (_data_->_tmp72_);
		_g_object_unref0 (_data_->_vala1_strong_content);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_data_free (gpointer _data)
{
	XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->candidate);
	_g_free0 (_data_->dstaddr);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data, _data_);
}

void
xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5 (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                 XmppXepJingleSocks5BytestreamsCandidate* candidate,
                                                                 const gchar* dstaddr,
                                                                 GAsyncReadyCallback _callback_,
                                                                 gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data* _data_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp0_;
	XmppXepJingleSocks5BytestreamsCandidate* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (candidate != NULL);
	g_return_if_fail (dstaddr != NULL);
	_data_ = g_slice_new0 (XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (candidate);
	_g_object_unref0 (_data_->candidate);
	_data_->candidate = _tmp1_;
	_tmp2_ = g_strdup (dstaddr);
	_g_free0 (_data_->dstaddr);
	_data_->dstaddr = _tmp2_;
	xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_co (_data_);
}

GSocketConnection*
xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_finish (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                        GAsyncResult* _res_,
                                                                        GError** error)
{
	GSocketConnection* result;
	XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_ready (GObject* source_object,
                                                                       GAsyncResult* _res_,
                                                                       gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_co (_data_);
}

static gboolean
xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_co (XmppXepJingleSocks5BytestreamsParametersConnectToSocks5Data* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = g_socket_client_new ();
	g_socket_client_set_timeout (_data_->_tmp0_, (guint) XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NEGOTIATION_TIMEOUT);
	_data_->socket_client = _data_->_tmp0_;
	_data_->_tmp1_ = xmpp_xep_socks5_bytestreams_proxy_get_host ((XmppXepSocks5BytestreamsProxy*) _data_->candidate);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = string_to_string (_data_->_tmp2_);
	_data_->_tmp4_ = xmpp_xep_socks5_bytestreams_proxy_get_port ((XmppXepSocks5BytestreamsProxy*) _data_->candidate);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = g_strdup_printf ("%i", _data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = g_strconcat ("[", _data_->_tmp3_, "]:", _data_->_tmp7_, NULL);
	_data_->_tmp9_ = _data_->_tmp8_;
	_g_free0 (_data_->_tmp7_);
	_data_->address = _data_->_tmp9_;
	_data_->_tmp10_ = _data_->address;
	g_debug ("0260_jingle_socks5_bytestreams.vala:633: Connecting to SOCKS5 server a" \
"t %s", _data_->_tmp10_);
	_data_->_tmp11_ = g_new0 (guint8, 1024);
	_data_->read_buffer = _data_->_tmp11_;
	_data_->read_buffer_length1 = 1024;
	_data_->_read_buffer_size_ = _data_->read_buffer_length1;
	_data_->_tmp12_ = g_byte_array_new ();
	_data_->write_buffer = _data_->_tmp12_;
	_data_->_tmp13_ = _data_->socket_client;
	_data_->_tmp14_ = _data_->address;
	_data_->_state_ = 1;
	g_socket_client_connect_to_host_async (_data_->_tmp13_, _data_->_tmp14_, (guint16) 0, NULL, xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp15_ = g_socket_client_connect_to_host_finish (_data_->_tmp13_, _data_->_res_, &_data_->_inner_error0_);
	_data_->conn = _data_->_tmp15_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp16_ = _data_->conn;
	_data_->_tmp17_ = g_io_stream_get_output_stream ((GIOStream*) _data_->_tmp16_);
	_data_->_tmp18_ = _data_->_tmp17_;
	_data_->_tmp19_ = g_new0 (guint8, 3);
	_data_->_tmp19_[0] = (guint8) 0x05;
	_data_->_tmp19_[1] = (guint8) 0x01;
	_data_->_tmp19_[2] = (guint8) 0x00;
	_data_->_tmp20_ = _data_->_tmp19_;
	_data_->_tmp20__length1 = 3;
	_data_->_tmp21_ = 0UL;
	_data_->_state_ = 2;
	g_output_stream_write_all_async (_data_->_tmp18_, _data_->_tmp20_, (gsize) 3, G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_ready, _data_);
	return FALSE;
	_state_2:
	g_output_stream_write_all_finish (_data_->_tmp18_, _data_->_res_, &_data_->_tmp21_, &_data_->_inner_error0_);
	_data_->written = _data_->_tmp21_;
	_data_->_tmp20_ = (g_free (_data_->_tmp20_), NULL);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp22_ = _data_->conn;
	_data_->_tmp23_ = g_io_stream_get_input_stream ((GIOStream*) _data_->_tmp22_);
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_tmp25_ = _data_->read_buffer;
	_data_->_tmp25__length1 = _data_->read_buffer_length1;
	_data_->_tmp26_ = 0UL;
	_data_->_state_ = 3;
	g_input_stream_read_all_async (_data_->_tmp24_, _data_->_tmp25_ + 0, (gsize) (2 - 0), G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_ready, _data_);
	return FALSE;
	_state_3:
	g_input_stream_read_all_finish (_data_->_tmp24_, _data_->_res_, &_data_->_tmp26_, &_data_->_inner_error0_);
	_data_->read = _data_->_tmp26_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->read != ((gsize) 2)) {
		_data_->_tmp27_ = g_strdup_printf ("wanted 05 00, only got %d bytes", (gint) _data_->read);
		_data_->_tmp28_ = _data_->_tmp27_;
		_data_->_tmp29_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp28_);
		_data_->_tmp30_ = _data_->_tmp29_;
		_g_free0 (_data_->_tmp28_);
		_data_->_inner_error0_ = _data_->_tmp30_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp32_ = _data_->read_buffer;
	_data_->_tmp32__length1 = _data_->read_buffer_length1;
	_data_->_tmp33_ = _data_->_tmp32_[0];
	if (((gint) _data_->_tmp33_) != 0x05) {
		_data_->_tmp31_ = TRUE;
	} else {
		_data_->_tmp34_ = _data_->read_buffer;
		_data_->_tmp34__length1 = _data_->read_buffer_length1;
		_data_->_tmp35_ = _data_->_tmp34_[1];
		_data_->_tmp31_ = ((gint) _data_->_tmp35_) != 0x00;
	}
	if (_data_->_tmp31_) {
		_data_->_tmp36_ = _data_->read_buffer;
		_data_->_tmp36__length1 = _data_->read_buffer_length1;
		_data_->_tmp37_ = _data_->_tmp36_[0];
		_data_->_tmp38_ = _data_->read_buffer;
		_data_->_tmp38__length1 = _data_->read_buffer_length1;
		_data_->_tmp39_ = _data_->_tmp38_[1];
		_data_->_tmp40_ = g_strdup_printf ("wanted 05 00, got %02x %02x", (guint) _data_->_tmp37_, (guint) _data_->_tmp39_);
		_data_->_tmp41_ = _data_->_tmp40_;
		_data_->_tmp42_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp41_);
		_data_->_tmp43_ = _data_->_tmp42_;
		_g_free0 (_data_->_tmp41_);
		_data_->_inner_error0_ = _data_->_tmp43_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp44_ = _data_->write_buffer;
	_data_->_tmp45_ = g_new0 (guint8, 4);
	_data_->_tmp45_[0] = (guint8) 0x05;
	_data_->_tmp45_[1] = (guint8) 0x01;
	_data_->_tmp45_[2] = (guint8) 0x00;
	_data_->_tmp45_[3] = (guint8) 0x03;
	_data_->_tmp46_ = _data_->_tmp45_;
	_data_->_tmp46__length1 = 4;
	g_byte_array_append (_data_->_tmp44_, _data_->_tmp46_, (gint) 4);
	_data_->_tmp46_ = (g_free (_data_->_tmp46_), NULL);
	_data_->_tmp47_ = _data_->write_buffer;
	_data_->_tmp48_ = strlen (_data_->dstaddr);
	_data_->_tmp49_ = _data_->_tmp48_;
	_data_->_tmp50_ = g_new0 (guint8, 1);
	_data_->_tmp50_[0] = (guint8) _data_->_tmp49_;
	_data_->_tmp51_ = _data_->_tmp50_;
	_data_->_tmp51__length1 = 1;
	g_byte_array_append (_data_->_tmp47_, _data_->_tmp51_, (gint) 1);
	_data_->_tmp51_ = (g_free (_data_->_tmp51_), NULL);
	_data_->_tmp52_ = _data_->write_buffer;
	_data_->_tmp54_ = 0;
	_data_->_tmp53_ = string_get_data (_data_->dstaddr, &_data_->_tmp54_);
	_data_->_tmp53__length1 = _data_->_tmp54_;
	_data_->_tmp55_ = _data_->_tmp53_;
	_data_->_tmp55__length1 = _data_->_tmp53__length1;
	g_byte_array_append (_data_->_tmp52_, _data_->_tmp55_, (gint) _data_->_tmp55__length1);
	_data_->_tmp56_ = _data_->write_buffer;
	_data_->_tmp57_ = g_new0 (guint8, 2);
	_data_->_tmp57_[0] = (guint8) 0x00;
	_data_->_tmp57_[1] = (guint8) 0x00;
	_data_->_tmp58_ = _data_->_tmp57_;
	_data_->_tmp58__length1 = 2;
	g_byte_array_append (_data_->_tmp56_, _data_->_tmp58_, (gint) 2);
	_data_->_tmp58_ = (g_free (_data_->_tmp58_), NULL);
	_data_->_tmp59_ = _data_->conn;
	_data_->_tmp60_ = g_io_stream_get_output_stream ((GIOStream*) _data_->_tmp59_);
	_data_->_tmp61_ = _data_->_tmp60_;
	_data_->_tmp62_ = _data_->write_buffer;
	_data_->_tmp63_ = _data_->_tmp62_->data;
	_data_->_tmp63__length1 = _data_->_tmp62_->len;
	_data_->_tmp64_ = 0UL;
	_data_->_state_ = 4;
	g_output_stream_write_all_async (_data_->_tmp61_, _data_->_tmp63_, (gsize) _data_->_tmp63__length1, G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_ready, _data_);
	return FALSE;
	_state_4:
	g_output_stream_write_all_finish (_data_->_tmp61_, _data_->_res_, &_data_->_tmp64_, &_data_->_inner_error0_);
	_data_->written = _data_->_tmp64_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp65_ = _data_->conn;
	_data_->_tmp66_ = g_io_stream_get_input_stream ((GIOStream*) _data_->_tmp65_);
	_data_->_tmp67_ = _data_->_tmp66_;
	_data_->_tmp68_ = _data_->read_buffer;
	_data_->_tmp68__length1 = _data_->read_buffer_length1;
	_data_->_tmp69_ = _data_->write_buffer;
	_data_->_tmp70_ = 0UL;
	_data_->_state_ = 5;
	g_input_stream_read_all_async (_data_->_tmp67_, _data_->_tmp68_ + 0, (gsize) (((gint) _data_->_tmp69_->len) - 0), G_PRIORITY_DEFAULT, NULL, xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_ready, _data_);
	return FALSE;
	_state_5:
	g_input_stream_read_all_finish (_data_->_tmp67_, _data_->_res_, &_data_->_tmp70_, &_data_->_inner_error0_);
	_data_->read = _data_->_tmp70_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp71_ = _data_->write_buffer;
	if (_data_->read != ((gsize) _data_->_tmp71_->len)) {
		_data_->_tmp72_ = _data_->write_buffer;
		_data_->_tmp73_ = g_strdup_printf ("wanted server success response consisting of %d bytes, only got %d byt" \
"es", (gint) _data_->_tmp72_->len, (gint) _data_->read);
		_data_->_tmp74_ = _data_->_tmp73_;
		_data_->_tmp75_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp74_);
		_data_->_tmp76_ = _data_->_tmp75_;
		_g_free0 (_data_->_tmp74_);
		_data_->_inner_error0_ = _data_->_tmp76_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp79_ = _data_->read_buffer;
	_data_->_tmp79__length1 = _data_->read_buffer_length1;
	_data_->_tmp80_ = _data_->_tmp79_[0];
	if (((gint) _data_->_tmp80_) != 0x05) {
		_data_->_tmp78_ = TRUE;
	} else {
		_data_->_tmp81_ = _data_->read_buffer;
		_data_->_tmp81__length1 = _data_->read_buffer_length1;
		_data_->_tmp82_ = _data_->_tmp81_[1];
		_data_->_tmp78_ = ((gint) _data_->_tmp82_) != 0x00;
	}
	if (_data_->_tmp78_) {
		_data_->_tmp77_ = TRUE;
	} else {
		_data_->_tmp83_ = _data_->read_buffer;
		_data_->_tmp83__length1 = _data_->read_buffer_length1;
		_data_->_tmp84_ = _data_->_tmp83_[3];
		_data_->_tmp77_ = ((gint) _data_->_tmp84_) != 0x03;
	}
	if (_data_->_tmp77_) {
		_data_->_tmp85_ = _data_->read_buffer;
		_data_->_tmp85__length1 = _data_->read_buffer_length1;
		_data_->_tmp86_ = _data_->_tmp85_[0];
		_data_->_tmp87_ = _data_->read_buffer;
		_data_->_tmp87__length1 = _data_->read_buffer_length1;
		_data_->_tmp88_ = _data_->_tmp87_[1];
		_data_->_tmp89_ = _data_->read_buffer;
		_data_->_tmp89__length1 = _data_->read_buffer_length1;
		_data_->_tmp90_ = _data_->_tmp89_[2];
		_data_->_tmp91_ = _data_->read_buffer;
		_data_->_tmp91__length1 = _data_->read_buffer_length1;
		_data_->_tmp92_ = _data_->_tmp91_[3];
		_data_->_tmp93_ = g_strdup_printf ("wanted 05 00 ?? 03, got %02x %02x %02x %02x", (guint) _data_->_tmp86_, (guint) _data_->_tmp88_, (guint) _data_->_tmp90_, (guint) _data_->_tmp92_);
		_data_->_tmp94_ = _data_->_tmp93_;
		_data_->_tmp95_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp94_);
		_data_->_tmp96_ = _data_->_tmp95_;
		_g_free0 (_data_->_tmp94_);
		_data_->_inner_error0_ = _data_->_tmp96_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp97_ = _data_->read_buffer;
	_data_->_tmp97__length1 = _data_->read_buffer_length1;
	_data_->_tmp98_ = _data_->_tmp97_[4];
	_data_->_tmp99_ = strlen (_data_->dstaddr);
	_data_->_tmp100_ = _data_->_tmp99_;
	if (_data_->_tmp98_ != ((guint8) _data_->_tmp100_)) {
		_data_->_tmp101_ = strlen (_data_->dstaddr);
		_data_->_tmp102_ = _data_->_tmp101_;
		_data_->_tmp103_ = _data_->read_buffer;
		_data_->_tmp103__length1 = _data_->read_buffer_length1;
		_data_->_tmp104_ = _data_->_tmp103_[4];
		_data_->_tmp105_ = g_strdup_printf ("wanted %02x for length, got %02x", (guint) _data_->_tmp102_, (guint) _data_->_tmp104_);
		_data_->_tmp106_ = _data_->_tmp105_;
		_data_->_tmp107_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp106_);
		_data_->_tmp108_ = _data_->_tmp107_;
		_g_free0 (_data_->_tmp106_);
		_data_->_inner_error0_ = _data_->_tmp108_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp109_ = _data_->read_buffer;
	_data_->_tmp109__length1 = _data_->read_buffer_length1;
	_data_->_tmp110_ = strlen (_data_->dstaddr);
	_data_->_tmp111_ = _data_->_tmp110_;
	_data_->_tmp113_ = 0;
	_data_->_tmp112_ = string_get_data (_data_->dstaddr, &_data_->_tmp113_);
	_data_->_tmp112__length1 = _data_->_tmp113_;
	_data_->_tmp114_ = _data_->_tmp112_;
	_data_->_tmp114__length1 = _data_->_tmp112__length1;
	if (!xmpp_xep_jingle_socks5_bytestreams_bytes_equal (_data_->_tmp109_ + 5, (gint) ((5 + _data_->_tmp111_) - 5), _data_->_tmp114_, (gint) _data_->_tmp114__length1)) {
		_data_->_tmp115_ = _data_->read_buffer;
		_data_->_tmp115__length1 = _data_->read_buffer_length1;
		_data_->_tmp116_ = strlen (_data_->dstaddr);
		_data_->_tmp117_ = _data_->_tmp116_;
		_data_->_tmp118_ = g_strescape ((const gchar*) (_data_->_tmp115_ + 5), NULL);
		_data_->repr = _data_->_tmp118_;
		_data_->_tmp119_ = string_to_string (_data_->dstaddr);
		_data_->_tmp120_ = _data_->repr;
		_data_->_tmp121_ = string_to_string (_data_->_tmp120_);
		_data_->_tmp122_ = g_strconcat ("wanted dstaddr ", _data_->_tmp119_, ", got ", _data_->_tmp121_, NULL);
		_data_->_tmp123_ = _data_->_tmp122_;
		_data_->_tmp124_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp123_);
		_data_->_tmp125_ = _data_->_tmp124_;
		_g_free0 (_data_->_tmp123_);
		_data_->_inner_error0_ = _data_->_tmp125_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_free0 (_data_->repr);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp127_ = _data_->read_buffer;
	_data_->_tmp127__length1 = _data_->read_buffer_length1;
	_data_->_tmp128_ = strlen (_data_->dstaddr);
	_data_->_tmp129_ = _data_->_tmp128_;
	_data_->_tmp130_ = _data_->_tmp127_[5 + _data_->_tmp129_];
	if (((gint) _data_->_tmp130_) != 0x00) {
		_data_->_tmp126_ = TRUE;
	} else {
		_data_->_tmp131_ = _data_->read_buffer;
		_data_->_tmp131__length1 = _data_->read_buffer_length1;
		_data_->_tmp132_ = strlen (_data_->dstaddr);
		_data_->_tmp133_ = _data_->_tmp132_;
		_data_->_tmp134_ = _data_->_tmp131_[(5 + _data_->_tmp133_) + 1];
		_data_->_tmp126_ = ((gint) _data_->_tmp134_) != 0x00;
	}
	if (_data_->_tmp126_) {
		_data_->_tmp135_ = _data_->read_buffer;
		_data_->_tmp135__length1 = _data_->read_buffer_length1;
		_data_->_tmp136_ = strlen (_data_->dstaddr);
		_data_->_tmp137_ = _data_->_tmp136_;
		_data_->_tmp138_ = _data_->_tmp135_[5 + _data_->_tmp137_];
		_data_->_tmp139_ = _data_->read_buffer;
		_data_->_tmp139__length1 = _data_->read_buffer_length1;
		_data_->_tmp140_ = strlen (_data_->dstaddr);
		_data_->_tmp141_ = _data_->_tmp140_;
		_data_->_tmp142_ = _data_->_tmp139_[(5 + _data_->_tmp141_) + 1];
		_data_->_tmp143_ = g_strdup_printf ("wanted port 00 00, got %02x %02x", (guint) _data_->_tmp138_, (guint) _data_->_tmp142_);
		_data_->_tmp144_ = _data_->_tmp143_;
		_data_->_tmp145_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_PROXY_FAILED, _data_->_tmp144_);
		_data_->_tmp146_ = _data_->_tmp145_;
		_g_free0 (_data_->_tmp144_);
		_data_->_inner_error0_ = _data_->_tmp146_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->conn);
		_g_byte_array_unref0 (_data_->write_buffer);
		_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
		_g_free0 (_data_->address);
		_g_object_unref0 (_data_->socket_client);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp147_ = _data_->conn;
	_data_->_tmp148_ = g_socket_connection_get_socket (_data_->_tmp147_);
	_data_->_tmp149_ = _data_->_tmp148_;
	g_socket_set_timeout (_data_->_tmp149_, (guint) 0);
	_data_->result = _data_->conn;
	_g_byte_array_unref0 (_data_->write_buffer);
	_data_->read_buffer = (g_free (_data_->read_buffer), NULL);
	_g_free0 (_data_->address);
	_g_object_unref0 (_data_->socket_client);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_data_free (gpointer _data)
{
	XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->session);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData, _data_);
}

void
xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                            XmppXmppStream* stream,
                                                                            XmppXepJingleSession* session,
                                                                            GAsyncReadyCallback _callback_,
                                                                            gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData* _data_;
	XmppXepJingleSocks5BytestreamsParameters* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXepJingleSession* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (stream != NULL);
	g_return_if_fail (session != NULL);
	_data_ = g_slice_new0 (XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_tmp2_ = _g_object_ref0 (session);
	_g_object_unref0 (_data_->session);
	_data_->session = _tmp2_;
	xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_co (_data_);
}

void
xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_finish (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                   GAsyncResult* _res_,
                                                                                   GError** error)
{
	XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gint
__lambda30_ (XmppXepJingleSocks5BytestreamsParameters* self,
             XmppXepJingleSocks5BytestreamsCandidate* c1,
             XmppXepJingleSocks5BytestreamsCandidate* c2)
{
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gint result;
	g_return_val_if_fail (c1 != NULL, -1);
	g_return_val_if_fail (c2 != NULL, -1);
	_tmp0_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (c1);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (c2);
	_tmp3_ = _tmp2_;
	if (_tmp1_ < _tmp3_) {
		result = 1;
		return result;
	}
	_tmp4_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (c1);
	_tmp5_ = _tmp4_;
	_tmp6_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (c2);
	_tmp7_ = _tmp6_;
	if (_tmp5_ > _tmp7_) {
		result = -1;
		return result;
	}
	result = 0;
	return result;
}

static gint
___lambda30__gcompare_data_func (gconstpointer a,
                                 gconstpointer b,
                                 gpointer self)
{
	gint result;
	result = __lambda30_ ((XmppXepJingleSocks5BytestreamsParameters*) self, (XmppXepJingleSocks5BytestreamsCandidate*) a, (XmppXepJingleSocks5BytestreamsCandidate*) b);
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_ready (GObject* source_object,
                                                                                  GAsyncResult* _res_,
                                                                                  gpointer _user_data_)
{
	XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_co (_data_);
}

static gboolean
xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_co (XmppXepJingleSocks5BytestreamsParametersTryConnectingToCandidatesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->remote_candidates;
	gee_list_sort (_data_->_tmp0_, ___lambda30__gcompare_data_func, g_object_ref (_data_->self), g_object_unref);
	{
		_data_->_tmp1_ = _data_->self->remote_candidates;
		_data_->_candidate_list = _data_->_tmp1_;
		_data_->_tmp2_ = _data_->_candidate_list;
		_data_->_tmp3_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp2_);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_candidate_size = _data_->_tmp4_;
		_data_->_candidate_index = -1;
		while (TRUE) {
			_data_->_candidate_index = _data_->_candidate_index + 1;
			_data_->_tmp5_ = _data_->_candidate_index;
			_data_->_tmp6_ = _data_->_candidate_size;
			if (!(_data_->_tmp5_ < _data_->_tmp6_)) {
				break;
			}
			_data_->_tmp7_ = _data_->_candidate_list;
			_data_->_tmp8_ = gee_list_get (_data_->_tmp7_, _data_->_candidate_index);
			_data_->candidate = (XmppXepJingleSocks5BytestreamsCandidate*) _data_->_tmp8_;
			_data_->_tmp10_ = _data_->self->priv->remote_selected_candidate;
			if (_data_->_tmp10_ != NULL) {
				_data_->_tmp11_ = _data_->self->priv->remote_selected_candidate;
				_data_->_tmp12_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (_data_->_tmp11_);
				_data_->_tmp13_ = _data_->_tmp12_;
				_data_->_tmp14_ = _data_->candidate;
				_data_->_tmp15_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_priority (_data_->_tmp14_);
				_data_->_tmp16_ = _data_->_tmp15_;
				_data_->_tmp9_ = _data_->_tmp13_ > _data_->_tmp16_;
			} else {
				_data_->_tmp9_ = FALSE;
			}
			if (_data_->_tmp9_) {
				_g_object_unref0 (_data_->candidate);
				break;
			}
			{
				_data_->_tmp17_ = _data_->candidate;
				_data_->_tmp18_ = _data_->self->priv->_remote_dstaddr;
				_data_->_state_ = 1;
				xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5 (_data_->self, _data_->_tmp17_, _data_->_tmp18_, xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates_ready, _data_);
				return FALSE;
				_state_1:
				_data_->_tmp19_ = xmpp_xep_jingle_socks5_bytestreams_parameters_connect_to_socks5_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
				_data_->conn = _data_->_tmp19_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_data_->self->priv->local_determined_selected_candidate = TRUE;
				_data_->_tmp20_ = _data_->candidate;
				_data_->_tmp21_ = _g_object_ref0 (_data_->_tmp20_);
				_g_object_unref0 (_data_->self->priv->local_selected_candidate);
				_data_->self->priv->local_selected_candidate = _data_->_tmp21_;
				_data_->_tmp22_ = _data_->conn;
				_data_->_tmp23_ = _g_object_ref0 (_data_->_tmp22_);
				_g_object_unref0 (_data_->self->priv->local_selected_candidate_conn);
				_data_->self->priv->local_selected_candidate_conn = _data_->_tmp23_;
				_data_->_tmp24_ = _data_->candidate;
				_data_->_tmp25_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (_data_->_tmp24_);
				_data_->_tmp26_ = _data_->_tmp25_;
				g_debug ("0260_jingle_socks5_bytestreams.vala:721: Selected candidate %s", _data_->_tmp26_);
				_data_->_tmp27_ = _data_->self->priv->content;
				_data_->_tmp28_ = xmpp_stanza_node_new_build ("transport", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
				_data_->_tmp29_ = _data_->_tmp28_;
				_data_->_tmp30_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp29_);
				_data_->_tmp31_ = _data_->_tmp30_;
				_data_->_tmp32_ = _data_->self->priv->_sid;
				_data_->_tmp33_ = xmpp_stanza_node_put_attribute (_data_->_tmp31_, "sid", _data_->_tmp32_, NULL);
				_data_->_tmp34_ = _data_->_tmp33_;
				_data_->_tmp35_ = xmpp_stanza_node_new_build ("candidate-used", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
				_data_->_tmp36_ = _data_->_tmp35_;
				_data_->_tmp37_ = _data_->candidate;
				_data_->_tmp38_ = xmpp_xep_jingle_socks5_bytestreams_candidate_get_cid (_data_->_tmp37_);
				_data_->_tmp39_ = _data_->_tmp38_;
				_data_->_tmp40_ = xmpp_stanza_node_put_attribute (_data_->_tmp36_, "cid", _data_->_tmp39_, NULL);
				_data_->_tmp41_ = _data_->_tmp40_;
				_data_->_tmp42_ = xmpp_stanza_node_put_node (_data_->_tmp34_, _data_->_tmp41_);
				_data_->_tmp43_ = _data_->_tmp42_;
				xmpp_xep_jingle_content_send_transport_info (_data_->_tmp27_, _data_->_tmp43_);
				_xmpp_stanza_entry_unref0 (_data_->_tmp43_);
				_xmpp_stanza_entry_unref0 (_data_->_tmp41_);
				_xmpp_stanza_entry_unref0 (_data_->_tmp36_);
				_xmpp_stanza_entry_unref0 (_data_->_tmp34_);
				_xmpp_stanza_entry_unref0 (_data_->_tmp31_);
				_xmpp_stanza_entry_unref0 (_data_->_tmp29_);
				xmpp_xep_jingle_socks5_bytestreams_parameters_try_completing_negotiation (_data_->self);
				_g_object_unref0 (_data_->conn);
				_g_object_unref0 (_data_->candidate);
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
				if (_data_->_state_ != 0) {
					while (!g_task_get_completed (_data_->_async_result)) {
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
					}
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			goto __finally0;
			__catch0_g_error:
			{
				g_clear_error (&_data_->_inner_error0_);
			}
			__finally0:
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_g_object_unref0 (_data_->candidate);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_g_object_unref0 (_data_->candidate);
		}
	}
	_data_->self->priv->local_determined_selected_candidate = TRUE;
	_g_object_unref0 (_data_->self->priv->local_selected_candidate);
	_data_->self->priv->local_selected_candidate = NULL;
	_data_->_tmp44_ = _data_->self->priv->content;
	_data_->_tmp45_ = xmpp_stanza_node_new_build ("transport", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
	_data_->_tmp46_ = _data_->_tmp45_;
	_data_->_tmp47_ = xmpp_stanza_node_add_self_xmlns (_data_->_tmp46_);
	_data_->_tmp48_ = _data_->_tmp47_;
	_data_->_tmp49_ = _data_->self->priv->_sid;
	_data_->_tmp50_ = xmpp_stanza_node_put_attribute (_data_->_tmp48_, "sid", _data_->_tmp49_, NULL);
	_data_->_tmp51_ = _data_->_tmp50_;
	_data_->_tmp52_ = xmpp_stanza_node_new_build ("candidate-error", XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI, NULL, NULL);
	_data_->_tmp53_ = _data_->_tmp52_;
	_data_->_tmp54_ = xmpp_stanza_node_put_node (_data_->_tmp51_, _data_->_tmp53_);
	_data_->_tmp55_ = _data_->_tmp54_;
	xmpp_xep_jingle_content_send_transport_info (_data_->_tmp44_, _data_->_tmp55_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp55_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp53_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp51_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp48_);
	_xmpp_stanza_entry_unref0 (_data_->_tmp46_);
	xmpp_xep_jingle_socks5_bytestreams_parameters_try_completing_negotiation (_data_->self);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                GIOStream* ios)
{
	GIOStream* iostream = NULL;
	GIOStream* _tmp0_;
	XmppXepJingleContent* strong_content = NULL;
	XmppXepJingleContent* _tmp1_;
	XmppXepJingleContent* _tmp2_;
	XmppXepJingleContent* _tmp3_;
	XmppXepJingleContent* _tmp4_;
	XmppXepJingleSecurityParameters* _tmp5_;
	XmppXepJingleStreamingConnection* _tmp10_;
	GIOStream* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ios != NULL);
	_tmp0_ = _g_object_ref0 (ios);
	iostream = _tmp0_;
	_tmp1_ = self->priv->content;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	strong_content = _tmp2_;
	_tmp3_ = strong_content;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (strong_content);
		_g_object_unref0 (iostream);
		return;
	}
	_tmp4_ = strong_content;
	_tmp5_ = _tmp4_->security_params;
	if (_tmp5_ != NULL) {
		XmppXepJingleContent* _tmp6_;
		XmppXepJingleSecurityParameters* _tmp7_;
		GIOStream* _tmp8_;
		GIOStream* _tmp9_;
		_tmp6_ = strong_content;
		_tmp7_ = _tmp6_->security_params;
		_tmp8_ = iostream;
		_tmp9_ = xmpp_xep_jingle_security_parameters_wrap_stream (_tmp7_, _tmp8_);
		_g_object_unref0 (iostream);
		iostream = _tmp9_;
	}
	_tmp10_ = self->priv->connection;
	_tmp11_ = iostream;
	xmpp_xep_jingle_streaming_connection_set_stream (_tmp10_, _tmp11_, NULL, NULL);
	_g_object_unref0 (strong_content);
	_g_object_unref0 (iostream);
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_content_set_transport_connection_error (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                                      GError* e)
{
	XmppXepJingleContent* strong_content = NULL;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleContent* _tmp1_;
	XmppXepJingleContent* _tmp2_;
	XmppXepJingleContent* _tmp3_;
	XmppXepJingleStreamingConnection* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (e != NULL);
	_tmp0_ = self->priv->content;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	strong_content = _tmp1_;
	_tmp2_ = strong_content;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (strong_content);
		return;
	}
	_tmp3_ = strong_content;
	xmpp_xep_jingle_content_select_new_transport (_tmp3_, NULL, NULL);
	_tmp4_ = self->priv->connection;
	xmpp_xep_jingle_streaming_connection_set_error (_tmp4_, e);
	_g_object_unref0 (strong_content);
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_real_create_transport_connection (XmppXepJingleTransportParameters* base,
                                                                                XmppXmppStream* stream,
                                                                                XmppXepJingleContent* content)
{
	XmppXepJingleSocks5BytestreamsParameters * self;
	XmppXepJingleSession* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXepJingleSession* _tmp2_;
	XmppXepJingleContent* _tmp3_;
	XmppXepJingleStreamingConnection* _tmp4_;
	self = (XmppXepJingleSocks5BytestreamsParameters*) base;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (content != NULL);
	_tmp0_ = content->session;
	self->priv->session = _tmp0_;
	self->priv->content = content;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (self->priv->hack);
	self->priv->hack = _tmp1_;
	_tmp2_ = self->priv->session;
	xmpp_xep_jingle_socks5_bytestreams_parameters_try_connecting_to_candidates (self, stream, _tmp2_, NULL, NULL);
	_tmp3_ = self->priv->content;
	_tmp4_ = self->priv->connection;
	xmpp_xep_jingle_content_set_transport_connection (_tmp3_, (XmppXepJingleComponentConnection*) _tmp4_, (guint8) 1);
}

static const gchar*
xmpp_xep_jingle_socks5_bytestreams_parameters_real_get_ns_uri (XmppXepJingleTransportParameters* base)
{
	const gchar* result;
	XmppXepJingleSocks5BytestreamsParameters* self;
	self = (XmppXepJingleSocks5BytestreamsParameters*) base;
	result = XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_NS_URI;
	return result;
}

static guint8
xmpp_xep_jingle_socks5_bytestreams_parameters_real_get_components (XmppXepJingleTransportParameters* base)
{
	guint8 result;
	XmppXepJingleSocks5BytestreamsParameters* self;
	self = (XmppXepJingleSocks5BytestreamsParameters*) base;
	result = (guint8) 1;
	return result;
}

XmppXepJingleRole
xmpp_xep_jingle_socks5_bytestreams_parameters_get_role (XmppXepJingleSocks5BytestreamsParameters* self)
{
	XmppXepJingleRole result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_role;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_set_role (XmppXepJingleSocks5BytestreamsParameters* self,
                                                        XmppXepJingleRole value)
{
	XmppXepJingleRole old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_socks5_bytestreams_parameters_get_role (self);
	if (old_value != value) {
		self->priv->_role = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_socks5_bytestreams_parameters_get_sid (XmppXepJingleSocks5BytestreamsParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sid;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_set_sid (XmppXepJingleSocks5BytestreamsParameters* self,
                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_socks5_bytestreams_parameters_get_sid (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_sid);
		self->priv->_sid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_SID_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_socks5_bytestreams_parameters_get_remote_dstaddr (XmppXepJingleSocks5BytestreamsParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_remote_dstaddr;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_set_remote_dstaddr (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_socks5_bytestreams_parameters_get_remote_dstaddr (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_remote_dstaddr);
		self->priv->_remote_dstaddr = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_REMOTE_DSTADDR_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_socks5_bytestreams_parameters_get_local_dstaddr (XmppXepJingleSocks5BytestreamsParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_local_dstaddr;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_set_local_dstaddr (XmppXepJingleSocks5BytestreamsParameters* self,
                                                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_socks5_bytestreams_parameters_get_local_dstaddr (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_local_dstaddr);
		self->priv->_local_dstaddr = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_LOCAL_DSTADDR_PROPERTY]);
	}
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_class_init (XmppXepJingleSocks5BytestreamsParametersClass * klass,
                                                          gpointer klass_data)
{
	xmpp_xep_jingle_socks5_bytestreams_parameters_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleSocks5BytestreamsParameters_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_socks5_bytestreams_parameters_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_socks5_bytestreams_parameters_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_socks5_bytestreams_parameters_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_NS_URI_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_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_SOCKS5_BYTESTREAMS_PARAMETERS_COMPONENTS_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_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_SOCKS5_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY] = g_param_spec_enum ("role", "role", "role", XMPP_XEP_JINGLE_TYPE_ROLE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_SID_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_SID_PROPERTY] = g_param_spec_string ("sid", "sid", "sid", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_REMOTE_DSTADDR_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_REMOTE_DSTADDR_PROPERTY] = g_param_spec_string ("remote-dstaddr", "remote-dstaddr", "remote-dstaddr", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_LOCAL_DSTADDR_PROPERTY, xmpp_xep_jingle_socks5_bytestreams_parameters_properties[XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_LOCAL_DSTADDR_PROPERTY] = g_param_spec_string ("local-dstaddr", "local-dstaddr", "local-dstaddr", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_xmpp_xep_jingle_transport_parameters_interface_init (XmppXepJingleTransportParametersIface * iface,
                                                                                                   gpointer iface_data)
{
	xmpp_xep_jingle_socks5_bytestreams_parameters_xmpp_xep_jingle_transport_parameters_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_content = (void (*) (XmppXepJingleTransportParameters*, XmppXepJingleContent*)) xmpp_xep_jingle_socks5_bytestreams_parameters_real_set_content;
	iface->to_transport_stanza_node = (XmppStanzaNode* (*) (XmppXepJingleTransportParameters*, const gchar*)) xmpp_xep_jingle_socks5_bytestreams_parameters_real_to_transport_stanza_node;
	iface->handle_transport_accept = (void (*) (XmppXepJingleTransportParameters*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_socks5_bytestreams_parameters_real_handle_transport_accept;
	iface->handle_transport_info = (void (*) (XmppXepJingleTransportParameters*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_socks5_bytestreams_parameters_real_handle_transport_info;
	iface->create_transport_connection = (void (*) (XmppXepJingleTransportParameters*, XmppXmppStream*, XmppXepJingleContent*)) xmpp_xep_jingle_socks5_bytestreams_parameters_real_create_transport_connection;
	iface->get_ns_uri = xmpp_xep_jingle_socks5_bytestreams_parameters_real_get_ns_uri;
	iface->get_components = xmpp_xep_jingle_socks5_bytestreams_parameters_real_get_components;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_instance_init (XmppXepJingleSocks5BytestreamsParameters * self,
                                                             gpointer klass)
{
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	XmppXepJingleStreamingConnection* _tmp2_;
	self->priv = xmpp_xep_jingle_socks5_bytestreams_parameters_get_instance_private (self);
	_tmp0_ = gee_array_list_new (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->local_candidates = (GeeList*) _tmp0_;
	_tmp1_ = gee_array_list_new (XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_CANDIDATE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->remote_candidates = (GeeList*) _tmp1_;
	self->listener = NULL;
	self->priv->remote_sent_selected_candidate = FALSE;
	self->priv->remote_selected_candidate = NULL;
	self->priv->local_determined_selected_candidate = FALSE;
	self->priv->local_selected_candidate = NULL;
	self->priv->local_selected_candidate_conn = NULL;
	self->priv->session = NULL;
	self->priv->content = NULL;
	self->priv->hack = NULL;
	self->priv->waiting_for_activation_cid = NULL;
	self->priv->waiting_for_activation_error = FALSE;
	_tmp2_ = xmpp_xep_jingle_streaming_connection_new ();
	self->priv->connection = _tmp2_;
}

static void
xmpp_xep_jingle_socks5_bytestreams_parameters_finalize (GObject * obj)
{
	XmppXepJingleSocks5BytestreamsParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleSocks5BytestreamsParameters);
	_g_free0 (self->priv->_sid);
	_g_free0 (self->priv->_remote_dstaddr);
	_g_free0 (self->priv->_local_dstaddr);
	_g_object_unref0 (self->local_candidates);
	_g_object_unref0 (self->remote_candidates);
	_xmpp_xep_jingle_socks5_bytestreams_local_listener_unref0 (self->listener);
	_xmpp_jid_unref0 (self->priv->local_full_jid);
	_xmpp_jid_unref0 (self->priv->peer_full_jid);
	_g_object_unref0 (self->priv->remote_selected_candidate);
	_g_object_unref0 (self->priv->local_selected_candidate);
	_g_object_unref0 (self->priv->local_selected_candidate_conn);
	_g_object_unref0 (self->priv->hack);
	_g_free0 (self->priv->waiting_for_activation_cid);
	(self->priv->waiting_for_activation_callback_target_destroy_notify == NULL) ? NULL : (self->priv->waiting_for_activation_callback_target_destroy_notify (self->priv->waiting_for_activation_callback_target), NULL);
	self->priv->waiting_for_activation_callback = NULL;
	self->priv->waiting_for_activation_callback_target = NULL;
	self->priv->waiting_for_activation_callback_target_destroy_notify = NULL;
	_g_object_unref0 (self->priv->connection);
	G_OBJECT_CLASS (xmpp_xep_jingle_socks5_bytestreams_parameters_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_socks5_bytestreams_parameters_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleSocks5BytestreamsParametersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_socks5_bytestreams_parameters_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleSocks5BytestreamsParameters), 0, (GInstanceInitFunc) xmpp_xep_jingle_socks5_bytestreams_parameters_instance_init, NULL };
	static const GInterfaceInfo xmpp_xep_jingle_transport_parameters_info = { (GInterfaceInitFunc) xmpp_xep_jingle_socks5_bytestreams_parameters_xmpp_xep_jingle_transport_parameters_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_jingle_socks5_bytestreams_parameters_type_id;
	xmpp_xep_jingle_socks5_bytestreams_parameters_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleSocks5BytestreamsParameters", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_jingle_socks5_bytestreams_parameters_type_id, XMPP_XEP_JINGLE_TYPE_TRANSPORT_PARAMETERS, &xmpp_xep_jingle_transport_parameters_info);
	XmppXepJingleSocks5BytestreamsParameters_private_offset = g_type_add_instance_private (xmpp_xep_jingle_socks5_bytestreams_parameters_type_id, sizeof (XmppXepJingleSocks5BytestreamsParametersPrivate));
	return xmpp_xep_jingle_socks5_bytestreams_parameters_type_id;
}

GType
xmpp_xep_jingle_socks5_bytestreams_parameters_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_socks5_bytestreams_parameters_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_socks5_bytestreams_parameters_type_id__once)) {
		GType xmpp_xep_jingle_socks5_bytestreams_parameters_type_id;
		xmpp_xep_jingle_socks5_bytestreams_parameters_type_id = xmpp_xep_jingle_socks5_bytestreams_parameters_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_socks5_bytestreams_parameters_type_id__once, xmpp_xep_jingle_socks5_bytestreams_parameters_type_id);
	}
	return xmpp_xep_jingle_socks5_bytestreams_parameters_type_id__once;
}

static void
_vala_xmpp_xep_jingle_socks5_bytestreams_parameters_get_property (GObject * object,
                                                                  guint property_id,
                                                                  GValue * value,
                                                                  GParamSpec * pspec)
{
	XmppXepJingleSocks5BytestreamsParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleSocks5BytestreamsParameters);
	switch (property_id) {
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_NS_URI_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_transport_parameters_get_ns_uri ((XmppXepJingleTransportParameters*) self));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_COMPONENTS_PROPERTY:
		g_value_set_uchar (value, xmpp_xep_jingle_transport_parameters_get_components ((XmppXepJingleTransportParameters*) self));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_socks5_bytestreams_parameters_get_role (self));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_SID_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_socks5_bytestreams_parameters_get_sid (self));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_REMOTE_DSTADDR_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_socks5_bytestreams_parameters_get_remote_dstaddr (self));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_LOCAL_DSTADDR_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_socks5_bytestreams_parameters_get_local_dstaddr (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_socks5_bytestreams_parameters_set_property (GObject * object,
                                                                  guint property_id,
                                                                  const GValue * value,
                                                                  GParamSpec * pspec)
{
	XmppXepJingleSocks5BytestreamsParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleSocks5BytestreamsParameters);
	switch (property_id) {
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY:
		xmpp_xep_jingle_socks5_bytestreams_parameters_set_role (self, g_value_get_enum (value));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_SID_PROPERTY:
		xmpp_xep_jingle_socks5_bytestreams_parameters_set_sid (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_REMOTE_DSTADDR_PROPERTY:
		xmpp_xep_jingle_socks5_bytestreams_parameters_set_remote_dstaddr (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_SOCKS5_BYTESTREAMS_PARAMETERS_LOCAL_DSTADDR_PROPERTY:
		xmpp_xep_jingle_socks5_bytestreams_parameters_set_local_dstaddr (self, g_value_get_string (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;
}

