/* 0261_jingle_in_band_bytestreams.c generated by valac 0.56.19, the Vala compiler
 * generated from 0261_jingle_in_band_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>

#define XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_NS_URI "urn:xmpp:jingle:transports:ibb:1"
#define XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_DEFAULT_BLOCKSIZE 4096
#define XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_MAX_BLOCKSIZE 65535
#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_IN_BAND_BYTESTREAMS_MODULE_0_PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_MODULE_NS_URI_PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_MODULE_TYPE__PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_MODULE_PRIORITY_PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_MODULE_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_in_band_bytestreams_module_properties[XMPP_XEP_JINGLE_IN_BAND_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 _XmppXepJingleInBandBytestreamsModuleIsTransportAvailableData XmppXepJingleInBandBytestreamsModuleIsTransportAvailableData;

#define XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS (xmpp_xep_jingle_in_band_bytestreams_parameters_get_type ())
#define XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleInBandBytestreamsParameters))
#define XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleInBandBytestreamsParametersClass))
#define XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_IS_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS))
#define XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_IS_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS))
#define XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleInBandBytestreamsParametersClass))

typedef struct _XmppXepJingleInBandBytestreamsParameters XmppXepJingleInBandBytestreamsParameters;
typedef struct _XmppXepJingleInBandBytestreamsParametersClass XmppXepJingleInBandBytestreamsParametersClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _XmppXepJingleInBandBytestreamsParametersPrivate XmppXepJingleInBandBytestreamsParametersPrivate;
enum  {
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_0_PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_NS_URI_PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_COMPONENTS_PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_PEER_FULL_JID_PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_SID_PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_BLOCK_SIZE_PROPERTY,
	XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_NUM_PROPERTIES];
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
#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 _XmppXepJingleInBandBytestreamsModuleIsTransportAvailableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleInBandBytestreamsModule* self;
	XmppXmppStream* stream;
	guint8 components;
	XmppJid* full_jid;
	gboolean result;
	gboolean _tmp0_;
	XmppModuleIdentity* _tmp1_;
	gpointer _tmp2_;
	XmppXepServiceDiscoveryModule* _tmp3_;
};

struct _XmppXepJingleInBandBytestreamsParameters {
	GObject parent_instance;
	XmppXepJingleInBandBytestreamsParametersPrivate * priv;
};

struct _XmppXepJingleInBandBytestreamsParametersClass {
	GObjectClass parent_class;
};

struct _XmppXepJingleInBandBytestreamsParametersPrivate {
	XmppXepJingleRole _role;
	XmppJid* _peer_full_jid;
	gchar* _sid;
	gint _block_size;
};

static gpointer xmpp_xep_jingle_in_band_bytestreams_module_parent_class = NULL;
XmppModuleIdentity* xmpp_xep_jingle_in_band_bytestreams_module_IDENTITY = NULL;
static XmppXepJingleTransportIface * xmpp_xep_jingle_in_band_bytestreams_module_xmpp_xep_jingle_transport_parent_iface = NULL;
static gint XmppXepJingleInBandBytestreamsParameters_private_offset;
static gpointer xmpp_xep_jingle_in_band_bytestreams_parameters_parent_class = NULL;
static XmppXepJingleTransportParametersIface * xmpp_xep_jingle_in_band_bytestreams_parameters_xmpp_xep_jingle_transport_parameters_parent_iface = NULL;

static void xmpp_xep_jingle_in_band_bytestreams_module_real_attach (XmppXmppStreamModule* base,
                                                             XmppXmppStream* stream);
static void xmpp_xep_jingle_in_band_bytestreams_module_real_detach (XmppXmppStreamModule* base,
                                                             XmppXmppStream* stream);
static gchar* xmpp_xep_jingle_in_band_bytestreams_module_real_get_ns (XmppXmppStreamModule* base);
static gchar* xmpp_xep_jingle_in_band_bytestreams_module_real_get_id (XmppXmppStreamModule* base);
static void xmpp_xep_jingle_in_band_bytestreams_module_real_is_transport_available_data_free (gpointer _data);
static void xmpp_xep_jingle_in_band_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_in_band_bytestreams_module_real_is_transport_available_co (XmppXepJingleInBandBytestreamsModuleIsTransportAvailableData* _data_);
static void xmpp_xep_jingle_in_band_bytestreams_module_is_transport_available_ready (GObject* source_object,
                                                                              GAsyncResult* _res_,
                                                                              gpointer _user_data_);
static XmppXepJingleTransportParameters* xmpp_xep_jingle_in_band_bytestreams_module_real_create_transport_parameters (XmppXepJingleTransport* base,
                                                                                                               XmppXmppStream* stream,
                                                                                                               guint8 components,
                                                                                                               XmppJid* local_full_jid,
                                                                                                               XmppJid* peer_full_jid,
                                                                                                               GError** error);
VALA_EXTERN XmppXepJingleInBandBytestreamsParameters* xmpp_xep_jingle_in_band_bytestreams_parameters_new_create (XmppJid* peer_full_jid,
                                                                                                     const gchar* sid);
VALA_EXTERN XmppXepJingleInBandBytestreamsParameters* xmpp_xep_jingle_in_band_bytestreams_parameters_construct_create (GType object_type,
                                                                                                           XmppJid* peer_full_jid,
                                                                                                           const gchar* sid);
VALA_EXTERN GType xmpp_xep_jingle_in_band_bytestreams_parameters_get_type (void) G_GNUC_CONST ;
static XmppXepJingleTransportParameters* xmpp_xep_jingle_in_band_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 XmppXepJingleInBandBytestreamsParameters* xmpp_xep_jingle_in_band_bytestreams_parameters_parse (XmppJid* peer_full_jid,
                                                                                                XmppStanzaNode* transport,
                                                                                                GError** error);
static void xmpp_xep_jingle_in_band_bytestreams_module_finalize (GObject * obj);
static GType xmpp_xep_jingle_in_band_bytestreams_module_get_type_once (void);
static void _vala_xmpp_xep_jingle_in_band_bytestreams_module_get_property (GObject * object,
                                                                    guint property_id,
                                                                    GValue * value,
                                                                    GParamSpec * pspec);
static XmppXepJingleInBandBytestreamsParameters* xmpp_xep_jingle_in_band_bytestreams_parameters_new (XmppXepJingleRole role,
                                                                                              XmppJid* peer_full_jid,
                                                                                              const gchar* sid,
                                                                                              gint block_size);
static XmppXepJingleInBandBytestreamsParameters* xmpp_xep_jingle_in_band_bytestreams_parameters_construct (GType object_type,
                                                                                                    XmppXepJingleRole role,
                                                                                                    XmppJid* peer_full_jid,
                                                                                                    const gchar* sid,
                                                                                                    gint block_size);
static void xmpp_xep_jingle_in_band_bytestreams_parameters_set_role (XmppXepJingleInBandBytestreamsParameters* self,
                                                              XmppXepJingleRole value);
static void xmpp_xep_jingle_in_band_bytestreams_parameters_set_peer_full_jid (XmppXepJingleInBandBytestreamsParameters* self,
                                                                       XmppJid* value);
static void xmpp_xep_jingle_in_band_bytestreams_parameters_set_sid (XmppXepJingleInBandBytestreamsParameters* self,
                                                             const gchar* value);
static void xmpp_xep_jingle_in_band_bytestreams_parameters_set_block_size (XmppXepJingleInBandBytestreamsParameters* self,
                                                                    gint value);
VALA_EXTERN gchar* xmpp_xep_jingle_in_band_bytestreams_parameters_transport_ns_uri (XmppXepJingleInBandBytestreamsParameters* self);
static void xmpp_xep_jingle_in_band_bytestreams_parameters_real_set_content (XmppXepJingleTransportParameters* base,
                                                                      XmppXepJingleContent* content);
static XmppStanzaNode* xmpp_xep_jingle_in_band_bytestreams_parameters_real_to_transport_stanza_node (XmppXepJingleTransportParameters* base,
                                                                                              const gchar* action_type);
VALA_EXTERN gint xmpp_xep_jingle_in_band_bytestreams_parameters_get_block_size (XmppXepJingleInBandBytestreamsParameters* self);
VALA_EXTERN const gchar* xmpp_xep_jingle_in_band_bytestreams_parameters_get_sid (XmppXepJingleInBandBytestreamsParameters* self);
static void xmpp_xep_jingle_in_band_bytestreams_parameters_real_handle_transport_accept (XmppXepJingleTransportParameters* base,
                                                                                  XmppStanzaNode* transport,
                                                                                  GError** error);
VALA_EXTERN XmppJid* xmpp_xep_jingle_in_band_bytestreams_parameters_get_peer_full_jid (XmppXepJingleInBandBytestreamsParameters* self);
static void xmpp_xep_jingle_in_band_bytestreams_parameters_real_handle_transport_info (XmppXepJingleTransportParameters* base,
                                                                                XmppStanzaNode* transport,
                                                                                GError** error);
static void xmpp_xep_jingle_in_band_bytestreams_parameters_real_create_transport_connection (XmppXepJingleTransportParameters* base,
                                                                                      XmppXmppStream* stream,
                                                                                      XmppXepJingleContent* content);
VALA_EXTERN XmppXepJingleRole xmpp_xep_jingle_in_band_bytestreams_parameters_get_role (XmppXepJingleInBandBytestreamsParameters* self);
static void xmpp_xep_jingle_in_band_bytestreams_parameters_finalize (GObject * obj);
static GType xmpp_xep_jingle_in_band_bytestreams_parameters_get_type_once (void);
static void _vala_xmpp_xep_jingle_in_band_bytestreams_parameters_get_property (GObject * object,
                                                                        guint property_id,
                                                                        GValue * value,
                                                                        GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_in_band_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_in_band_bytestreams_module_real_attach (XmppXmppStreamModule* base,
                                                        XmppXmppStream* stream)
{
	XmppXepJingleInBandBytestreamsModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepJingleModule* _tmp2_;
	XmppModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	XmppXepServiceDiscoveryModule* _tmp5_;
	self = (XmppXepJingleInBandBytestreamsModule*) 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_IN_BAND_BYTESTREAMS_NS_URI);
	_g_object_unref0 (_tmp5_);
}

static void
xmpp_xep_jingle_in_band_bytestreams_module_real_detach (XmppXmppStreamModule* base,
                                                        XmppXmppStream* stream)
{
	XmppXepJingleInBandBytestreamsModule * self;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepServiceDiscoveryModule* _tmp2_;
	self = (XmppXepJingleInBandBytestreamsModule*) 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_IN_BAND_BYTESTREAMS_NS_URI);
	_g_object_unref0 (_tmp2_);
}

static gchar*
xmpp_xep_jingle_in_band_bytestreams_module_real_get_ns (XmppXmppStreamModule* base)
{
	XmppXepJingleInBandBytestreamsModule * self;
	gchar* _tmp0_;
	gchar* result;
	self = (XmppXepJingleInBandBytestreamsModule*) base;
	_tmp0_ = g_strdup (XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_NS_URI);
	result = _tmp0_;
	return result;
}

static gchar*
xmpp_xep_jingle_in_band_bytestreams_module_real_get_id (XmppXmppStreamModule* base)
{
	XmppXepJingleInBandBytestreamsModule * self;
	XmppModuleIdentity* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = (XmppXepJingleInBandBytestreamsModule*) base;
	_tmp0_ = xmpp_xep_jingle_in_band_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_in_band_bytestreams_module_real_is_transport_available_data_free (gpointer _data)
{
	XmppXepJingleInBandBytestreamsModuleIsTransportAvailableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_xmpp_jid_unref0 (_data_->full_jid);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleInBandBytestreamsModuleIsTransportAvailableData, _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_in_band_bytestreams_module_real_is_transport_available (XmppXepJingleTransport* base,
                                                                        XmppXmppStream* stream,
                                                                        guint8 components,
                                                                        XmppJid* full_jid,
                                                                        GAsyncReadyCallback _callback_,
                                                                        gpointer _user_data_)
{
	XmppXepJingleInBandBytestreamsModule * self;
	XmppXepJingleInBandBytestreamsModuleIsTransportAvailableData* _data_;
	XmppXepJingleInBandBytestreamsModule* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppJid* _tmp2_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (full_jid != NULL);
	self = (XmppXepJingleInBandBytestreamsModule*) base;
	_data_ = g_slice_new0 (XmppXepJingleInBandBytestreamsModuleIsTransportAvailableData);
	_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_in_band_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_in_band_bytestreams_module_real_is_transport_available_co (_data_);
}

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

static void
xmpp_xep_jingle_in_band_bytestreams_module_is_transport_available_ready (GObject* source_object,
                                                                         GAsyncResult* _res_,
                                                                         gpointer _user_data_)
{
	XmppXepJingleInBandBytestreamsModuleIsTransportAvailableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_in_band_bytestreams_module_real_is_transport_available_co (_data_);
}

static gboolean
xmpp_xep_jingle_in_band_bytestreams_module_real_is_transport_available_co (XmppXepJingleInBandBytestreamsModuleIsTransportAvailableData* _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_IN_BAND_BYTESTREAMS_NS_URI, xmpp_xep_jingle_in_band_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 XmppXepJingleTransportParameters*
xmpp_xep_jingle_in_band_bytestreams_module_real_create_transport_parameters (XmppXepJingleTransport* base,
                                                                             XmppXmppStream* stream,
                                                                             guint8 components,
                                                                             XmppJid* local_full_jid,
                                                                             XmppJid* peer_full_jid,
                                                                             GError** error)
{
	XmppXepJingleInBandBytestreamsModule * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	XmppXepJingleInBandBytestreamsParameters* _tmp2_;
	XmppXepJingleTransportParameters* _tmp3_;
	XmppXepJingleTransportParameters* result;
	self = (XmppXepJingleInBandBytestreamsModule*) 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_in_band_bytestreams_parameters_new_create (peer_full_jid, _tmp1_);
	_tmp3_ = (XmppXepJingleTransportParameters*) _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

static XmppXepJingleTransportParameters*
xmpp_xep_jingle_in_band_bytestreams_module_real_parse_transport_parameters (XmppXepJingleTransport* base,
                                                                            XmppXmppStream* stream,
                                                                            guint8 components,
                                                                            XmppJid* local_full_jid,
                                                                            XmppJid* peer_full_jid,
                                                                            XmppStanzaNode* transport,
                                                                            GError** error)
{
	XmppXepJingleInBandBytestreamsModule * self;
	XmppXepJingleInBandBytestreamsParameters* _tmp0_ = NULL;
	XmppXepJingleInBandBytestreamsParameters* _tmp1_;
	XmppXepJingleInBandBytestreamsParameters* _tmp2_;
	GError* _inner_error0_ = NULL;
	XmppXepJingleTransportParameters* result;
	self = (XmppXepJingleInBandBytestreamsModule*) 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);
	_tmp1_ = xmpp_xep_jingle_in_band_bytestreams_parameters_parse (peer_full_jid, transport, &_inner_error0_);
	_tmp0_ = _tmp1_;
	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;
		}
	}
	_tmp2_ = _tmp0_;
	_tmp0_ = NULL;
	result = (XmppXepJingleTransportParameters*) _tmp2_;
	_g_object_unref0 (_tmp0_);
	return result;
}

XmppXepJingleInBandBytestreamsModule*
xmpp_xep_jingle_in_band_bytestreams_module_construct (GType object_type)
{
	XmppXepJingleInBandBytestreamsModule * self = NULL;
	self = (XmppXepJingleInBandBytestreamsModule*) xmpp_xmpp_stream_module_construct (object_type);
	return self;
}

XmppXepJingleInBandBytestreamsModule*
xmpp_xep_jingle_in_band_bytestreams_module_new (void)
{
	return xmpp_xep_jingle_in_band_bytestreams_module_construct (XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_MODULE);
}

static const gchar*
xmpp_xep_jingle_in_band_bytestreams_module_real_get_ns_uri (XmppXepJingleTransport* base)
{
	const gchar* result;
	XmppXepJingleInBandBytestreamsModule* self;
	self = (XmppXepJingleInBandBytestreamsModule*) base;
	result = XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_NS_URI;
	return result;
}

static XmppXepJingleTransportType
xmpp_xep_jingle_in_band_bytestreams_module_real_get_type_ (XmppXepJingleTransport* base)
{
	XmppXepJingleTransportType result;
	XmppXepJingleInBandBytestreamsModule* self;
	self = (XmppXepJingleInBandBytestreamsModule*) base;
	result = XMPP_XEP_JINGLE_TRANSPORT_TYPE_STREAMING;
	return result;
}

static gint
xmpp_xep_jingle_in_band_bytestreams_module_real_get_priority (XmppXepJingleTransport* base)
{
	gint result;
	XmppXepJingleInBandBytestreamsModule* self;
	self = (XmppXepJingleInBandBytestreamsModule*) base;
	result = 0;
	return result;
}

static void
xmpp_xep_jingle_in_band_bytestreams_module_class_init (XmppXepJingleInBandBytestreamsModuleClass * klass,
                                                       gpointer klass_data)
{
	XmppModuleIdentity* _tmp0_;
	xmpp_xep_jingle_in_band_bytestreams_module_parent_class = g_type_class_peek_parent (klass);
	((XmppXmppStreamModuleClass *) klass)->attach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_jingle_in_band_bytestreams_module_real_attach;
	((XmppXmppStreamModuleClass *) klass)->detach = (void (*) (XmppXmppStreamModule*, XmppXmppStream*)) xmpp_xep_jingle_in_band_bytestreams_module_real_detach;
	((XmppXmppStreamModuleClass *) klass)->get_ns = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_jingle_in_band_bytestreams_module_real_get_ns;
	((XmppXmppStreamModuleClass *) klass)->get_id = (gchar* (*) (XmppXmppStreamModule*)) xmpp_xep_jingle_in_band_bytestreams_module_real_get_id;
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_in_band_bytestreams_module_get_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_in_band_bytestreams_module_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_MODULE_NS_URI_PROPERTY, xmpp_xep_jingle_in_band_bytestreams_module_properties[XMPP_XEP_JINGLE_IN_BAND_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_IN_BAND_BYTESTREAMS_MODULE_TYPE__PROPERTY, xmpp_xep_jingle_in_band_bytestreams_module_properties[XMPP_XEP_JINGLE_IN_BAND_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_IN_BAND_BYTESTREAMS_MODULE_PRIORITY_PROPERTY, xmpp_xep_jingle_in_band_bytestreams_module_properties[XMPP_XEP_JINGLE_IN_BAND_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_IN_BAND_BYTESTREAMS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_NS_URI, "0261_jingle_in_band_bytestreams");
	xmpp_xep_jingle_in_band_bytestreams_module_IDENTITY = _tmp0_;
}

static void
xmpp_xep_jingle_in_band_bytestreams_module_xmpp_xep_jingle_transport_interface_init (XmppXepJingleTransportIface * iface,
                                                                                     gpointer iface_data)
{
	xmpp_xep_jingle_in_band_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_in_band_bytestreams_module_real_is_transport_available;
	iface->is_transport_available_finish = (gboolean (*) (XmppXepJingleTransport*, GAsyncResult*)) xmpp_xep_jingle_in_band_bytestreams_module_is_transport_available_finish;
	iface->create_transport_parameters = (XmppXepJingleTransportParameters* (*) (XmppXepJingleTransport*, XmppXmppStream*, guint8, XmppJid*, XmppJid*, GError**)) xmpp_xep_jingle_in_band_bytestreams_module_real_create_transport_parameters;
	iface->parse_transport_parameters = (XmppXepJingleTransportParameters* (*) (XmppXepJingleTransport*, XmppXmppStream*, guint8, XmppJid*, XmppJid*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_in_band_bytestreams_module_real_parse_transport_parameters;
	iface->get_ns_uri = xmpp_xep_jingle_in_band_bytestreams_module_real_get_ns_uri;
	iface->get_type_ = xmpp_xep_jingle_in_band_bytestreams_module_real_get_type_;
	iface->get_priority = xmpp_xep_jingle_in_band_bytestreams_module_real_get_priority;
}

static void
xmpp_xep_jingle_in_band_bytestreams_module_instance_init (XmppXepJingleInBandBytestreamsModule * self,
                                                          gpointer klass)
{
}

static void
xmpp_xep_jingle_in_band_bytestreams_module_finalize (GObject * obj)
{
	XmppXepJingleInBandBytestreamsModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_MODULE, XmppXepJingleInBandBytestreamsModule);
	G_OBJECT_CLASS (xmpp_xep_jingle_in_band_bytestreams_module_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_in_band_bytestreams_module_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleInBandBytestreamsModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_in_band_bytestreams_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleInBandBytestreamsModule), 0, (GInstanceInitFunc) xmpp_xep_jingle_in_band_bytestreams_module_instance_init, NULL };
	static const GInterfaceInfo xmpp_xep_jingle_transport_info = { (GInterfaceInitFunc) xmpp_xep_jingle_in_band_bytestreams_module_xmpp_xep_jingle_transport_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_jingle_in_band_bytestreams_module_type_id;
	xmpp_xep_jingle_in_band_bytestreams_module_type_id = g_type_register_static (XMPP_TYPE_XMPP_STREAM_MODULE, "XmppXepJingleInBandBytestreamsModule", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_jingle_in_band_bytestreams_module_type_id, XMPP_XEP_JINGLE_TYPE_TRANSPORT, &xmpp_xep_jingle_transport_info);
	return xmpp_xep_jingle_in_band_bytestreams_module_type_id;
}

GType
xmpp_xep_jingle_in_band_bytestreams_module_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_in_band_bytestreams_module_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_in_band_bytestreams_module_type_id__once)) {
		GType xmpp_xep_jingle_in_band_bytestreams_module_type_id;
		xmpp_xep_jingle_in_band_bytestreams_module_type_id = xmpp_xep_jingle_in_band_bytestreams_module_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_in_band_bytestreams_module_type_id__once, xmpp_xep_jingle_in_band_bytestreams_module_type_id);
	}
	return xmpp_xep_jingle_in_band_bytestreams_module_type_id__once;
}

static void
_vala_xmpp_xep_jingle_in_band_bytestreams_module_get_property (GObject * object,
                                                               guint property_id,
                                                               GValue * value,
                                                               GParamSpec * pspec)
{
	XmppXepJingleInBandBytestreamsModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_MODULE, XmppXepJingleInBandBytestreamsModule);
	switch (property_id) {
		case XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_MODULE_NS_URI_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_transport_get_ns_uri ((XmppXepJingleTransport*) self));
		break;
		case XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_MODULE_TYPE__PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_transport_get_type_ ((XmppXepJingleTransport*) self));
		break;
		case XMPP_XEP_JINGLE_IN_BAND_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;
	}
}

static inline gpointer
xmpp_xep_jingle_in_band_bytestreams_parameters_get_instance_private (XmppXepJingleInBandBytestreamsParameters* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleInBandBytestreamsParameters_private_offset);
}

static XmppXepJingleInBandBytestreamsParameters*
xmpp_xep_jingle_in_band_bytestreams_parameters_construct (GType object_type,
                                                          XmppXepJingleRole role,
                                                          XmppJid* peer_full_jid,
                                                          const gchar* sid,
                                                          gint block_size)
{
	XmppXepJingleInBandBytestreamsParameters * self = NULL;
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	g_return_val_if_fail (sid != NULL, NULL);
	self = (XmppXepJingleInBandBytestreamsParameters*) g_object_new (object_type, NULL);
	xmpp_xep_jingle_in_band_bytestreams_parameters_set_role (self, role);
	xmpp_xep_jingle_in_band_bytestreams_parameters_set_peer_full_jid (self, peer_full_jid);
	xmpp_xep_jingle_in_band_bytestreams_parameters_set_sid (self, sid);
	xmpp_xep_jingle_in_band_bytestreams_parameters_set_block_size (self, block_size);
	return self;
}

static XmppXepJingleInBandBytestreamsParameters*
xmpp_xep_jingle_in_band_bytestreams_parameters_new (XmppXepJingleRole role,
                                                    XmppJid* peer_full_jid,
                                                    const gchar* sid,
                                                    gint block_size)
{
	return xmpp_xep_jingle_in_band_bytestreams_parameters_construct (XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS, role, peer_full_jid, sid, block_size);
}

XmppXepJingleInBandBytestreamsParameters*
xmpp_xep_jingle_in_band_bytestreams_parameters_construct_create (GType object_type,
                                                                 XmppJid* peer_full_jid,
                                                                 const gchar* sid)
{
	XmppXepJingleInBandBytestreamsParameters * self = NULL;
	g_return_val_if_fail (peer_full_jid != NULL, NULL);
	g_return_val_if_fail (sid != NULL, NULL);
	self = (XmppXepJingleInBandBytestreamsParameters*) xmpp_xep_jingle_in_band_bytestreams_parameters_construct (object_type, XMPP_XEP_JINGLE_ROLE_INITIATOR, peer_full_jid, sid, XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_DEFAULT_BLOCKSIZE);
	return self;
}

XmppXepJingleInBandBytestreamsParameters*
xmpp_xep_jingle_in_band_bytestreams_parameters_new_create (XmppJid* peer_full_jid,
                                                           const gchar* sid)
{
	return xmpp_xep_jingle_in_band_bytestreams_parameters_construct_create (XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS, peer_full_jid, sid);
}

XmppXepJingleInBandBytestreamsParameters*
xmpp_xep_jingle_in_band_bytestreams_parameters_parse (XmppJid* peer_full_jid,
                                                      XmppStanzaNode* transport,
                                                      GError** error)
{
	gchar* sid = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gint block_size = 0;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	const gchar* _tmp6_;
	XmppXepJingleInBandBytestreamsParameters* _tmp7_;
	GError* _inner_error0_ = NULL;
	XmppXepJingleInBandBytestreamsParameters* result;
	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, "sid", NULL);
	_tmp1_ = g_strdup (_tmp0_);
	sid = _tmp1_;
	block_size = xmpp_stanza_node_get_attribute_int (transport, "block-size", -1, NULL);
	_tmp4_ = sid;
	if (_tmp4_ == NULL) {
		_tmp3_ = TRUE;
	} else {
		_tmp3_ = block_size <= 0;
	}
	if (_tmp3_) {
		_tmp2_ = TRUE;
	} else {
		_tmp2_ = block_size > XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_MAX_BLOCKSIZE;
	}
	if (_tmp2_) {
		GError* _tmp5_;
		_tmp5_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_BAD_REQUEST, "missing or invalid sid or blocksize");
		_inner_error0_ = _tmp5_;
		if (_inner_error0_->domain == XMPP_XEP_JINGLE_IQ_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_free0 (sid);
			return NULL;
		} else {
			_g_free0 (sid);
			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;
		}
	}
	_tmp6_ = sid;
	_tmp7_ = xmpp_xep_jingle_in_band_bytestreams_parameters_new (XMPP_XEP_JINGLE_ROLE_RESPONDER, peer_full_jid, _tmp6_, block_size);
	result = _tmp7_;
	_g_free0 (sid);
	return result;
}

gchar*
xmpp_xep_jingle_in_band_bytestreams_parameters_transport_ns_uri (XmppXepJingleInBandBytestreamsParameters* self)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_NS_URI);
	result = _tmp0_;
	return result;
}

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

static XmppStanzaNode*
xmpp_xep_jingle_in_band_bytestreams_parameters_real_to_transport_stanza_node (XmppXepJingleTransportParameters* base,
                                                                              const gchar* action_type)
{
	XmppXepJingleInBandBytestreamsParameters * self;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	gint _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	const gchar* _tmp9_;
	XmppStanzaNode* _tmp10_;
	XmppStanzaNode* _tmp11_;
	XmppStanzaNode* result;
	self = (XmppXepJingleInBandBytestreamsParameters*) base;
	g_return_val_if_fail (action_type != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_new_build ("transport", XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_NS_URI, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_stanza_node_add_self_xmlns (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->_block_size;
	_tmp5_ = g_strdup_printf ("%i", _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = xmpp_stanza_node_put_attribute (_tmp3_, "block-size", _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->_sid;
	_tmp10_ = xmpp_stanza_node_put_attribute (_tmp8_, "sid", _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	_xmpp_stanza_entry_unref0 (_tmp8_);
	_g_free0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (_tmp3_);
	_xmpp_stanza_entry_unref0 (_tmp1_);
	result = _tmp11_;
	return result;
}

static void
xmpp_xep_jingle_in_band_bytestreams_parameters_real_handle_transport_accept (XmppXepJingleTransportParameters* base,
                                                                             XmppStanzaNode* transport,
                                                                             GError** error)
{
	XmppXepJingleInBandBytestreamsParameters * self;
	XmppXepJingleInBandBytestreamsParameters* other = NULL;
	XmppJid* _tmp0_;
	XmppXepJingleInBandBytestreamsParameters* _tmp1_;
	gboolean _tmp2_ = FALSE;
	XmppXepJingleInBandBytestreamsParameters* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	XmppXepJingleInBandBytestreamsParameters* _tmp10_;
	gint _tmp11_;
	GError* _inner_error0_ = NULL;
	self = (XmppXepJingleInBandBytestreamsParameters*) base;
	g_return_if_fail (transport != NULL);
	_tmp0_ = self->priv->_peer_full_jid;
	_tmp1_ = xmpp_xep_jingle_in_band_bytestreams_parameters_parse (_tmp0_, transport, &_inner_error0_);
	other = _tmp1_;
	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) {
		_tmp2_ = TRUE;
	} else {
		XmppXepJingleInBandBytestreamsParameters* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp6_ = other;
		_tmp7_ = _tmp6_->priv->_block_size;
		_tmp8_ = self->priv->_block_size;
		_tmp2_ = _tmp7_ > _tmp8_;
	}
	if (_tmp2_) {
		GError* _tmp9_;
		_tmp9_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_NOT_ACCEPTABLE, "invalid IBB sid or block_size");
		_inner_error0_ = _tmp9_;
		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;
		}
	}
	_tmp10_ = other;
	_tmp11_ = _tmp10_->priv->_block_size;
	xmpp_xep_jingle_in_band_bytestreams_parameters_set_block_size (self, _tmp11_);
	_g_object_unref0 (other);
}

static void
xmpp_xep_jingle_in_band_bytestreams_parameters_real_handle_transport_info (XmppXepJingleTransportParameters* base,
                                                                           XmppStanzaNode* transport,
                                                                           GError** error)
{
	XmppXepJingleInBandBytestreamsParameters * self;
	GError* _tmp0_;
	GError* _inner_error0_ = NULL;
	self = (XmppXepJingleInBandBytestreamsParameters*) base;
	g_return_if_fail (transport != NULL);
	_tmp0_ = g_error_new_literal (XMPP_XEP_JINGLE_IQ_ERROR, XMPP_XEP_JINGLE_IQ_ERROR_UNSUPPORTED_INFO, "transport-info not supported for IBBs");
	_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;
	}
}

static void
xmpp_xep_jingle_in_band_bytestreams_parameters_real_create_transport_connection (XmppXepJingleTransportParameters* base,
                                                                                 XmppXmppStream* stream,
                                                                                 XmppXepJingleContent* content)
{
	XmppXepJingleInBandBytestreamsParameters * self;
	GIOStream* iostream = NULL;
	XmppJid* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_;
	XmppXepJingleRole _tmp3_;
	XmppXepInBandBytestreamsConnection* _tmp4_;
	XmppXepJingleStreamingConnection* connection = NULL;
	XmppXepJingleStreamingConnection* _tmp5_;
	XmppXepJingleSecurityParameters* _tmp6_;
	XmppXepJingleStreamingConnection* _tmp10_;
	GIOStream* _tmp11_;
	XmppXepJingleStreamingConnection* _tmp12_;
	self = (XmppXepJingleInBandBytestreamsParameters*) base;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (content != NULL);
	_tmp0_ = self->priv->_peer_full_jid;
	_tmp1_ = self->priv->_sid;
	_tmp2_ = self->priv->_block_size;
	_tmp3_ = self->priv->_role;
	_tmp4_ = xmpp_xep_in_band_bytestreams_connection_create (stream, _tmp0_, _tmp1_, _tmp2_, _tmp3_ == XMPP_XEP_JINGLE_ROLE_INITIATOR);
	iostream = (GIOStream*) _tmp4_;
	_tmp5_ = xmpp_xep_jingle_streaming_connection_new ();
	connection = _tmp5_;
	_tmp6_ = content->security_params;
	if (_tmp6_ != NULL) {
		XmppXepJingleSecurityParameters* _tmp7_;
		GIOStream* _tmp8_;
		GIOStream* _tmp9_;
		_tmp7_ = content->security_params;
		_tmp8_ = iostream;
		_tmp9_ = xmpp_xep_jingle_security_parameters_wrap_stream (_tmp7_, _tmp8_);
		_g_object_unref0 (iostream);
		iostream = _tmp9_;
	}
	_tmp10_ = connection;
	_tmp11_ = iostream;
	xmpp_xep_jingle_streaming_connection_set_stream (_tmp10_, _tmp11_, NULL, NULL);
	g_debug ("0261_jingle_in_band_bytestreams.vala:102: set transport conn ibb");
	_tmp12_ = connection;
	xmpp_xep_jingle_content_set_transport_connection (content, (XmppXepJingleComponentConnection*) _tmp12_, (guint8) 1);
	_g_object_unref0 (connection);
	_g_object_unref0 (iostream);
}

static const gchar*
xmpp_xep_jingle_in_band_bytestreams_parameters_real_get_ns_uri (XmppXepJingleTransportParameters* base)
{
	const gchar* result;
	XmppXepJingleInBandBytestreamsParameters* self;
	self = (XmppXepJingleInBandBytestreamsParameters*) base;
	result = XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_NS_URI;
	return result;
}

static guint8
xmpp_xep_jingle_in_band_bytestreams_parameters_real_get_components (XmppXepJingleTransportParameters* base)
{
	guint8 result;
	XmppXepJingleInBandBytestreamsParameters* self;
	self = (XmppXepJingleInBandBytestreamsParameters*) base;
	result = (guint8) 1;
	return result;
}

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

static void
xmpp_xep_jingle_in_band_bytestreams_parameters_set_role (XmppXepJingleInBandBytestreamsParameters* self,
                                                         XmppXepJingleRole value)
{
	XmppXepJingleRole old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_in_band_bytestreams_parameters_get_role (self);
	if (old_value != value) {
		self->priv->_role = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY]);
	}
}

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

static void
xmpp_xep_jingle_in_band_bytestreams_parameters_set_peer_full_jid (XmppXepJingleInBandBytestreamsParameters* self,
                                                                  XmppJid* value)
{
	XmppJid* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_in_band_bytestreams_parameters_get_peer_full_jid (self);
	if (old_value != value) {
		XmppJid* _tmp0_;
		_tmp0_ = _xmpp_jid_ref0 (value);
		_xmpp_jid_unref0 (self->priv->_peer_full_jid);
		self->priv->_peer_full_jid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_PEER_FULL_JID_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_in_band_bytestreams_parameters_get_sid (XmppXepJingleInBandBytestreamsParameters* 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_in_band_bytestreams_parameters_set_sid (XmppXepJingleInBandBytestreamsParameters* self,
                                                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_in_band_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_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_SID_PROPERTY]);
	}
}

gint
xmpp_xep_jingle_in_band_bytestreams_parameters_get_block_size (XmppXepJingleInBandBytestreamsParameters* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_block_size;
	return result;
}

static void
xmpp_xep_jingle_in_band_bytestreams_parameters_set_block_size (XmppXepJingleInBandBytestreamsParameters* self,
                                                               gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_in_band_bytestreams_parameters_get_block_size (self);
	if (old_value != value) {
		self->priv->_block_size = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_BLOCK_SIZE_PROPERTY]);
	}
}

static void
xmpp_xep_jingle_in_band_bytestreams_parameters_class_init (XmppXepJingleInBandBytestreamsParametersClass * klass,
                                                           gpointer klass_data)
{
	xmpp_xep_jingle_in_band_bytestreams_parameters_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleInBandBytestreamsParameters_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_in_band_bytestreams_parameters_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_in_band_bytestreams_parameters_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_in_band_bytestreams_parameters_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_NS_URI_PROPERTY, xmpp_xep_jingle_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_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_IN_BAND_BYTESTREAMS_PARAMETERS_COMPONENTS_PROPERTY, xmpp_xep_jingle_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_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_IN_BAND_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY, xmpp_xep_jingle_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_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_IN_BAND_BYTESTREAMS_PARAMETERS_PEER_FULL_JID_PROPERTY, xmpp_xep_jingle_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_PEER_FULL_JID_PROPERTY] = xmpp_param_spec_jid ("peer-full-jid", "peer-full-jid", "peer-full-jid", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_SID_PROPERTY, xmpp_xep_jingle_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_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_IN_BAND_BYTESTREAMS_PARAMETERS_BLOCK_SIZE_PROPERTY, xmpp_xep_jingle_in_band_bytestreams_parameters_properties[XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_BLOCK_SIZE_PROPERTY] = g_param_spec_int ("block-size", "block-size", "block-size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
xmpp_xep_jingle_in_band_bytestreams_parameters_xmpp_xep_jingle_transport_parameters_interface_init (XmppXepJingleTransportParametersIface * iface,
                                                                                                    gpointer iface_data)
{
	xmpp_xep_jingle_in_band_bytestreams_parameters_xmpp_xep_jingle_transport_parameters_parent_iface = g_type_interface_peek_parent (iface);
	iface->set_content = (void (*) (XmppXepJingleTransportParameters*, XmppXepJingleContent*)) xmpp_xep_jingle_in_band_bytestreams_parameters_real_set_content;
	iface->to_transport_stanza_node = (XmppStanzaNode* (*) (XmppXepJingleTransportParameters*, const gchar*)) xmpp_xep_jingle_in_band_bytestreams_parameters_real_to_transport_stanza_node;
	iface->handle_transport_accept = (void (*) (XmppXepJingleTransportParameters*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_in_band_bytestreams_parameters_real_handle_transport_accept;
	iface->handle_transport_info = (void (*) (XmppXepJingleTransportParameters*, XmppStanzaNode*, GError**)) xmpp_xep_jingle_in_band_bytestreams_parameters_real_handle_transport_info;
	iface->create_transport_connection = (void (*) (XmppXepJingleTransportParameters*, XmppXmppStream*, XmppXepJingleContent*)) xmpp_xep_jingle_in_band_bytestreams_parameters_real_create_transport_connection;
	iface->get_ns_uri = xmpp_xep_jingle_in_band_bytestreams_parameters_real_get_ns_uri;
	iface->get_components = xmpp_xep_jingle_in_band_bytestreams_parameters_real_get_components;
}

static void
xmpp_xep_jingle_in_band_bytestreams_parameters_instance_init (XmppXepJingleInBandBytestreamsParameters * self,
                                                              gpointer klass)
{
	self->priv = xmpp_xep_jingle_in_band_bytestreams_parameters_get_instance_private (self);
}

static void
xmpp_xep_jingle_in_band_bytestreams_parameters_finalize (GObject * obj)
{
	XmppXepJingleInBandBytestreamsParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleInBandBytestreamsParameters);
	_xmpp_jid_unref0 (self->priv->_peer_full_jid);
	_g_free0 (self->priv->_sid);
	G_OBJECT_CLASS (xmpp_xep_jingle_in_band_bytestreams_parameters_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_in_band_bytestreams_parameters_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleInBandBytestreamsParametersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_in_band_bytestreams_parameters_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleInBandBytestreamsParameters), 0, (GInstanceInitFunc) xmpp_xep_jingle_in_band_bytestreams_parameters_instance_init, NULL };
	static const GInterfaceInfo xmpp_xep_jingle_transport_parameters_info = { (GInterfaceInitFunc) xmpp_xep_jingle_in_band_bytestreams_parameters_xmpp_xep_jingle_transport_parameters_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_jingle_in_band_bytestreams_parameters_type_id;
	xmpp_xep_jingle_in_band_bytestreams_parameters_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleInBandBytestreamsParameters", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_jingle_in_band_bytestreams_parameters_type_id, XMPP_XEP_JINGLE_TYPE_TRANSPORT_PARAMETERS, &xmpp_xep_jingle_transport_parameters_info);
	XmppXepJingleInBandBytestreamsParameters_private_offset = g_type_add_instance_private (xmpp_xep_jingle_in_band_bytestreams_parameters_type_id, sizeof (XmppXepJingleInBandBytestreamsParametersPrivate));
	return xmpp_xep_jingle_in_band_bytestreams_parameters_type_id;
}

GType
xmpp_xep_jingle_in_band_bytestreams_parameters_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_in_band_bytestreams_parameters_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_in_band_bytestreams_parameters_type_id__once)) {
		GType xmpp_xep_jingle_in_band_bytestreams_parameters_type_id;
		xmpp_xep_jingle_in_band_bytestreams_parameters_type_id = xmpp_xep_jingle_in_band_bytestreams_parameters_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_in_band_bytestreams_parameters_type_id__once, xmpp_xep_jingle_in_band_bytestreams_parameters_type_id);
	}
	return xmpp_xep_jingle_in_band_bytestreams_parameters_type_id__once;
}

static void
_vala_xmpp_xep_jingle_in_band_bytestreams_parameters_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec)
{
	XmppXepJingleInBandBytestreamsParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleInBandBytestreamsParameters);
	switch (property_id) {
		case XMPP_XEP_JINGLE_IN_BAND_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_IN_BAND_BYTESTREAMS_PARAMETERS_COMPONENTS_PROPERTY:
		g_value_set_uchar (value, xmpp_xep_jingle_transport_parameters_get_components ((XmppXepJingleTransportParameters*) self));
		break;
		case XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY:
		g_value_set_enum (value, xmpp_xep_jingle_in_band_bytestreams_parameters_get_role (self));
		break;
		case XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_PEER_FULL_JID_PROPERTY:
		xmpp_value_set_jid (value, xmpp_xep_jingle_in_band_bytestreams_parameters_get_peer_full_jid (self));
		break;
		case XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_SID_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_in_band_bytestreams_parameters_get_sid (self));
		break;
		case XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_BLOCK_SIZE_PROPERTY:
		g_value_set_int (value, xmpp_xep_jingle_in_band_bytestreams_parameters_get_block_size (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_in_band_bytestreams_parameters_set_property (GObject * object,
                                                                   guint property_id,
                                                                   const GValue * value,
                                                                   GParamSpec * pspec)
{
	XmppXepJingleInBandBytestreamsParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_TYPE_PARAMETERS, XmppXepJingleInBandBytestreamsParameters);
	switch (property_id) {
		case XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_ROLE_PROPERTY:
		xmpp_xep_jingle_in_band_bytestreams_parameters_set_role (self, g_value_get_enum (value));
		break;
		case XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_PEER_FULL_JID_PROPERTY:
		xmpp_xep_jingle_in_band_bytestreams_parameters_set_peer_full_jid (self, xmpp_value_get_jid (value));
		break;
		case XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_SID_PROPERTY:
		xmpp_xep_jingle_in_band_bytestreams_parameters_set_sid (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_IN_BAND_BYTESTREAMS_PARAMETERS_BLOCK_SIZE_PROPERTY:
		xmpp_xep_jingle_in_band_bytestreams_parameters_set_block_size (self, g_value_get_int (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;
}

