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

#include "ice.h"
#include <gee.h>
#include <glib-object.h>
#include "libdino.h"
#include <glib.h>
#include <nice.h>
#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>

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

enum  {
	DINO_PLUGINS_ICE_PLUGIN_0_PROPERTY,
	DINO_PLUGINS_ICE_PLUGIN_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_ice_plugin_properties[DINO_PLUGINS_ICE_PLUGIN_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block2Data Block2Data;
#define _xmpp_xep_external_service_discovery_service_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_external_service_discovery_service_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _DinoPluginsIcePluginExternalDiscoveryRefreshServicesData DinoPluginsIcePluginExternalDiscoveryRefreshServicesData;
typedef struct _DinoPluginsIcePluginLookupIpv4AddessData DinoPluginsIcePluginLookupIpv4AddessData;

struct _DinoPluginsIcePluginPrivate {
	GeeHashMap* timeouts;
};

struct _Block2Data {
	int _ref_count_;
	DinoPluginsIcePlugin* self;
	DinoEntitiesAccount* account;
	XmppXmppStream* stream;
	gpointer _async_data_;
};

struct _DinoPluginsIcePluginExternalDiscoveryRefreshServicesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoPluginsIcePlugin* self;
	DinoEntitiesAccount* account;
	XmppXmppStream* stream;
	Block2Data* _data2_;
	DinoPluginsIceModule* ice_udp_module;
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepJingleIceUdpModule* _tmp2_;
	DinoPluginsIceModule* _tmp3_;
	DinoPluginsIceModule* _tmp4_;
	GeeList* services;
	GeeList* _tmp5_;
	GeeList* _service_list;
	GeeList* _tmp6_;
	gint _service_size;
	GeeList* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	gint _service_index;
	gint _tmp10_;
	gint _tmp11_;
	XmppXepExternalServiceDiscoveryService* service;
	GeeList* _tmp12_;
	gpointer _tmp13_;
	gboolean _tmp14_;
	XmppXepExternalServiceDiscoveryService* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	gboolean _tmp18_;
	XmppXepExternalServiceDiscoveryService* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	XmppXepExternalServiceDiscoveryService* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	GInetAddress* ip;
	XmppXepExternalServiceDiscoveryService* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	GInetAddress* _tmp28_;
	GInetAddress* _tmp29_;
	gboolean _tmp30_;
	gboolean _tmp31_;
	gboolean _tmp32_;
	gboolean _tmp33_;
	GInetAddress* _tmp34_;
	gboolean _tmp35_;
	gboolean _tmp36_;
	GInetAddress* _tmp37_;
	gboolean _tmp38_;
	gboolean _tmp39_;
	GInetAddress* _tmp40_;
	gboolean _tmp41_;
	gboolean _tmp42_;
	GInetAddress* _tmp43_;
	gboolean _tmp44_;
	gboolean _tmp45_;
	GInetAddress* _tmp46_;
	gboolean _tmp47_;
	gboolean _tmp48_;
	XmppXepExternalServiceDiscoveryService* _tmp49_;
	const gchar* _tmp50_;
	const gchar* _tmp51_;
	XmppXepExternalServiceDiscoveryService* _tmp52_;
	const gchar* _tmp53_;
	const gchar* _tmp54_;
	XmppXepExternalServiceDiscoveryService* _tmp55_;
	const gchar* _tmp56_;
	const gchar* _tmp57_;
	XmppXepExternalServiceDiscoveryService* _tmp58_;
	guint _tmp59_;
	guint _tmp60_;
	GInetAddress* _tmp61_;
	gchar* _tmp62_;
	gchar* _tmp63_;
	DinoPluginsIceModule* _tmp64_;
	GInetAddress* _tmp65_;
	gchar* _tmp66_;
	DinoPluginsIceModule* _tmp67_;
	XmppXepExternalServiceDiscoveryService* _tmp68_;
	guint _tmp69_;
	guint _tmp70_;
	XmppXepExternalServiceDiscoveryService* _tmp71_;
	const gchar* _tmp72_;
	const gchar* _tmp73_;
	XmppXepExternalServiceDiscoveryService* _tmp74_;
	const gchar* _tmp75_;
	const gchar* _tmp76_;
	XmppXepExternalServiceDiscoveryService* _tmp77_;
	guint _tmp78_;
	guint _tmp79_;
	GInetAddress* _tmp80_;
	gchar* _tmp81_;
	gchar* _tmp82_;
	DinoPluginsIceModule* _tmp83_;
	GInetAddress* _tmp84_;
	gchar* _tmp85_;
	DinoPluginsIceModule* _tmp86_;
	XmppXepExternalServiceDiscoveryService* _tmp87_;
	XmppXepExternalServiceDiscoveryService* _tmp88_;
	DinoPluginsIceModule* _tmp89_;
	const gchar* _tmp90_;
	GInetAddress* _vala1_ip;
	GInetAddress* _tmp91_;
	GInetAddress* _tmp92_;
	GInetAddress* _tmp93_;
	gchar* _tmp94_;
	gchar* _tmp95_;
	DinoPluginsIceModule* _tmp96_;
	GInetAddress* _tmp97_;
	gchar* _tmp98_;
	DinoPluginsIceModule* _tmp99_;
	DinoPluginsIceModule* _tmp100_;
	XmppXepExternalServiceDiscoveryService* _tmp101_;
	GDateTime* expires;
	DinoPluginsIceModule* _tmp102_;
	XmppXepExternalServiceDiscoveryService* _tmp103_;
	GDateTime* _tmp104_;
	GDateTime* _tmp105_;
	GDateTime* _tmp106_;
	GDateTime* _tmp107_;
	guint refresh_delay;
	GDateTime* _tmp108_;
	GDateTime* _tmp109_;
	GDateTime* _tmp110_;
	guint _tmp111_;
	gboolean _tmp112_;
	GeeHashMap* _tmp113_;
	GeeHashMap* _tmp114_;
};

struct _DinoPluginsIcePluginLookupIpv4AddessData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoPluginsIcePlugin* self;
	gchar* host;
	GInetAddress* result;
	GResolver* resolver;
	GResolver* _tmp0_;
	GList* ips;
	GResolver* _tmp1_;
	GList* _tmp2_;
	GList* _tmp3_;
	GList* ina_collection;
	GList* ina_it;
	GInetAddress* _tmp4_;
	GInetAddress* ina;
	GInetAddress* _tmp5_;
	GError* _inner_error0_;
};

static gint DinoPluginsIcePlugin_private_offset;
static gpointer dino_plugins_ice_plugin_parent_class = NULL;
static DinoPluginsRootInterfaceIface * dino_plugins_ice_plugin_dino_plugins_root_interface_parent_iface = NULL;

static guint _dino_entities_account_hash_func_gee_hash_data_func (gconstpointer v,
                                                           gpointer self);
static gboolean _dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                                 gconstpointer b,
                                                                 gpointer self);
static void dino_plugins_ice_plugin_real_registered (DinoPluginsRootInterface* base,
                                              DinoApplication* app);
static void __lambda11_ (DinoPluginsIcePlugin* self,
                  DinoEntitiesAccount* account,
                  GeeArrayList* list);
static void ___lambda11__dino_module_manager_initialize_account_modules (DinoModuleManager* _sender,
                                                                  DinoEntitiesAccount* account,
                                                                  GeeArrayList* modules,
                                                                  gpointer self);
static void __lambda12_ (DinoPluginsIcePlugin* self,
                  DinoEntitiesAccount* account,
                  XmppXmppStream* stream);
VALA_EXTERN GeeList* dino_plugins_ice_get_local_ip_addresses (void);
static GeeList* _dino_plugins_ice_get_local_ip_addresses_xmpp_xep_socks5_bytestreams_get_local_ip_addresses (gpointer self);
static GeeList* _dino_plugins_ice_get_local_ip_addresses_xmpp_xep_jingle_raw_udp_get_local_ip_addresses (gpointer self);
static void ___lambda12__dino_stream_interactor_stream_attached_modules (DinoStreamInteractor* _sender,
                                                                  DinoEntitiesAccount* account,
                                                                  XmppXmppStream* stream,
                                                                  gpointer self);
static void dino_plugins_ice_plugin_external_discovery_refresh_services (DinoPluginsIcePlugin* self,
                                                                  DinoEntitiesAccount* account,
                                                                  XmppXmppStream* stream,
                                                                  GAsyncReadyCallback _callback_,
                                                                  gpointer _user_data_);
static void dino_plugins_ice_plugin_external_discovery_refresh_services_finish (DinoPluginsIcePlugin* self,
                                                                         GAsyncResult* _res_);
static void _dino_plugins_ice_plugin_external_discovery_refresh_services_dino_stream_interactor_stream_negotiated (DinoStreamInteractor* _sender,
                                                                                                            DinoEntitiesAccount* account,
                                                                                                            XmppXmppStream* stream,
                                                                                                            gpointer self);
static void dino_plugins_ice_plugin_external_discovery_refresh_services_data_free (gpointer _data);
static gboolean dino_plugins_ice_plugin_external_discovery_refresh_services_co (DinoPluginsIcePluginExternalDiscoveryRefreshServicesData* _data_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void dino_plugins_ice_plugin_external_discovery_refresh_services_ready (GObject* source_object,
                                                                        GAsyncResult* _res_,
                                                                        gpointer _user_data_);
static void dino_plugins_ice_plugin_lookup_ipv4_addess (DinoPluginsIcePlugin* self,
                                                 const gchar* host,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static GInetAddress* dino_plugins_ice_plugin_lookup_ipv4_addess_finish (DinoPluginsIcePlugin* self,
                                                                 GAsyncResult* _res_);
static gboolean _____lambda13_ (Block2Data* _data2_);
static gboolean ______lambda13__gsource_func (gpointer self);
static void dino_plugins_ice_plugin_real_shutdown (DinoPluginsRootInterface* base);
static void dino_plugins_ice_plugin_lookup_ipv4_addess_data_free (gpointer _data);
static gboolean dino_plugins_ice_plugin_lookup_ipv4_addess_co (DinoPluginsIcePluginLookupIpv4AddessData* _data_);
static void dino_plugins_ice_plugin_lookup_ipv4_addess_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void dino_plugins_ice_plugin_finalize (GObject * obj);
static GType dino_plugins_ice_plugin_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_plugins_ice_plugin_get_instance_private (DinoPluginsIcePlugin* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsIcePlugin_private_offset);
}

static guint
_dino_entities_account_hash_func_gee_hash_data_func (gconstpointer v,
                                                     gpointer self)
{
	guint result;
	result = dino_entities_account_hash_func ((DinoEntitiesAccount*) v);
	return result;
}

static gboolean
_dino_entities_account_equals_func_gee_equal_data_func (gconstpointer a,
                                                        gconstpointer b,
                                                        gpointer self)
{
	gboolean result;
	result = dino_entities_account_equals_func ((DinoEntitiesAccount*) a, (DinoEntitiesAccount*) b);
	return result;
}

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

static void
__lambda11_ (DinoPluginsIcePlugin* self,
             DinoEntitiesAccount* account,
             GeeArrayList* list)
{
	DinoPluginsIceModule* _tmp0_;
	DinoPluginsIceModule* _tmp1_;
	g_return_if_fail (account != NULL);
	g_return_if_fail (list != NULL);
	_tmp0_ = dino_plugins_ice_module_new ();
	_tmp1_ = _tmp0_;
	gee_abstract_collection_add ((GeeAbstractCollection*) list, (XmppXmppStreamModule*) _tmp1_);
	_g_object_unref0 (_tmp1_);
}

static void
___lambda11__dino_module_manager_initialize_account_modules (DinoModuleManager* _sender,
                                                             DinoEntitiesAccount* account,
                                                             GeeArrayList* modules,
                                                             gpointer self)
{
	__lambda11_ ((DinoPluginsIcePlugin*) self, account, modules);
}

static GeeList*
_dino_plugins_ice_get_local_ip_addresses_xmpp_xep_socks5_bytestreams_get_local_ip_addresses (gpointer self)
{
	GeeList* result;
	result = dino_plugins_ice_get_local_ip_addresses ();
	return result;
}

static GeeList*
_dino_plugins_ice_get_local_ip_addresses_xmpp_xep_jingle_raw_udp_get_local_ip_addresses (gpointer self)
{
	GeeList* result;
	result = dino_plugins_ice_get_local_ip_addresses ();
	return result;
}

static void
__lambda12_ (DinoPluginsIcePlugin* self,
             DinoEntitiesAccount* account,
             XmppXmppStream* stream)
{
	XmppModuleIdentity* _tmp0_;
	gpointer _tmp1_;
	XmppXepSocks5BytestreamsModule* _tmp2_;
	gboolean _tmp3_;
	XmppModuleIdentity* _tmp7_;
	gpointer _tmp8_;
	XmppXepJingleRawUdpModule* _tmp9_;
	gboolean _tmp10_;
	g_return_if_fail (account != NULL);
	g_return_if_fail (stream != NULL);
	_tmp0_ = xmpp_xep_socks5_bytestreams_module_IDENTITY;
	_tmp1_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_SOCKS5_BYTESTREAMS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	_tmp2_ = (XmppXepSocks5BytestreamsModule*) _tmp1_;
	_tmp3_ = _tmp2_ != NULL;
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		XmppModuleIdentity* _tmp4_;
		gpointer _tmp5_;
		XmppXepSocks5BytestreamsModule* _tmp6_;
		_tmp4_ = xmpp_xep_socks5_bytestreams_module_IDENTITY;
		_tmp5_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_SOCKS5_BYTESTREAMS_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
		_tmp6_ = (XmppXepSocks5BytestreamsModule*) _tmp5_;
		xmpp_xep_socks5_bytestreams_module_set_local_ip_address_handler (_tmp6_, _dino_plugins_ice_get_local_ip_addresses_xmpp_xep_socks5_bytestreams_get_local_ip_addresses, NULL, NULL);
		_g_object_unref0 (_tmp6_);
	}
	_tmp7_ = xmpp_xep_jingle_raw_udp_module_IDENTITY;
	_tmp8_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_JINGLE_RAW_UDP_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp7_);
	_tmp9_ = (XmppXepJingleRawUdpModule*) _tmp8_;
	_tmp10_ = _tmp9_ != NULL;
	_g_object_unref0 (_tmp9_);
	if (_tmp10_) {
		XmppModuleIdentity* _tmp11_;
		gpointer _tmp12_;
		XmppXepJingleRawUdpModule* _tmp13_;
		_tmp11_ = xmpp_xep_jingle_raw_udp_module_IDENTITY;
		_tmp12_ = xmpp_xmpp_stream_get_module (stream, XMPP_XEP_JINGLE_RAW_UDP_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp11_);
		_tmp13_ = (XmppXepJingleRawUdpModule*) _tmp12_;
		xmpp_xep_jingle_raw_udp_module_set_local_ip_address_handler (_tmp13_, _dino_plugins_ice_get_local_ip_addresses_xmpp_xep_jingle_raw_udp_get_local_ip_addresses, NULL, NULL);
		_g_object_unref0 (_tmp13_);
	}
}

static void
___lambda12__dino_stream_interactor_stream_attached_modules (DinoStreamInteractor* _sender,
                                                             DinoEntitiesAccount* account,
                                                             XmppXmppStream* stream,
                                                             gpointer self)
{
	__lambda12_ ((DinoPluginsIcePlugin*) self, account, stream);
}

static void
_dino_plugins_ice_plugin_external_discovery_refresh_services_dino_stream_interactor_stream_negotiated (DinoStreamInteractor* _sender,
                                                                                                       DinoEntitiesAccount* account,
                                                                                                       XmppXmppStream* stream,
                                                                                                       gpointer self)
{
	dino_plugins_ice_plugin_external_discovery_refresh_services ((DinoPluginsIcePlugin*) self, account, stream, NULL, NULL);
}

static void
dino_plugins_ice_plugin_real_registered (DinoPluginsRootInterface* base,
                                         DinoApplication* app)
{
	DinoPluginsIcePlugin * self;
	DinoApplication* _tmp0_;
	DinoStreamInteractor* _tmp1_;
	DinoStreamInteractor* _tmp2_;
	DinoModuleManager* _tmp3_;
	DinoStreamInteractor* _tmp4_;
	DinoStreamInteractor* _tmp5_;
	DinoStreamInteractor* _tmp6_;
	DinoStreamInteractor* _tmp7_;
	self = (DinoPluginsIcePlugin*) base;
	g_return_if_fail (app != NULL);
	nice_debug_enable (TRUE);
	_tmp0_ = _g_object_ref0 (app);
	_g_object_unref0 (self->app);
	self->app = _tmp0_;
	_tmp1_ = dino_application_get_stream_interactor (app);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->module_manager;
	g_signal_connect_object (_tmp3_, "initialize-account-modules", (GCallback) ___lambda11__dino_module_manager_initialize_account_modules, self, 0);
	_tmp4_ = dino_application_get_stream_interactor (app);
	_tmp5_ = _tmp4_;
	g_signal_connect_object (_tmp5_, "stream-attached-modules", (GCallback) ___lambda12__dino_stream_interactor_stream_attached_modules, self, 0);
	_tmp6_ = dino_application_get_stream_interactor (app);
	_tmp7_ = _tmp6_;
	g_signal_connect_object (_tmp7_, "stream-negotiated", (GCallback) _dino_plugins_ice_plugin_external_discovery_refresh_services_dino_stream_interactor_stream_negotiated, self, 0);
}

static void
dino_plugins_ice_plugin_external_discovery_refresh_services_data_free (gpointer _data)
{
	DinoPluginsIcePluginExternalDiscoveryRefreshServicesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoPluginsIcePluginExternalDiscoveryRefreshServicesData, _data_);
}

static void
dino_plugins_ice_plugin_external_discovery_refresh_services (DinoPluginsIcePlugin* self,
                                                             DinoEntitiesAccount* account,
                                                             XmppXmppStream* stream,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_)
{
	DinoPluginsIcePluginExternalDiscoveryRefreshServicesData* _data_;
	DinoPluginsIcePlugin* _tmp0_;
	DinoEntitiesAccount* _tmp1_;
	XmppXmppStream* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (stream != NULL);
	_data_ = g_slice_new0 (DinoPluginsIcePluginExternalDiscoveryRefreshServicesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_plugins_ice_plugin_external_discovery_refresh_services_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (account);
	_g_object_unref0 (_data_->account);
	_data_->account = _tmp1_;
	_tmp2_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp2_;
	dino_plugins_ice_plugin_external_discovery_refresh_services_co (_data_);
}

static void
dino_plugins_ice_plugin_external_discovery_refresh_services_finish (DinoPluginsIcePlugin* self,
                                                                    GAsyncResult* _res_)
{
	DinoPluginsIcePluginExternalDiscoveryRefreshServicesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		DinoPluginsIcePlugin* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->account);
		_g_object_unref0 (_data2_->stream);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static void
dino_plugins_ice_plugin_external_discovery_refresh_services_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_)
{
	DinoPluginsIcePluginExternalDiscoveryRefreshServicesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_plugins_ice_plugin_external_discovery_refresh_services_co (_data_);
}

static gpointer
_xmpp_xep_external_service_discovery_service_ref0 (gpointer self)
{
	return self ? xmpp_xep_external_service_discovery_service_ref (self) : NULL;
}

static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

static gboolean
_____lambda13_ (Block2Data* _data2_)
{
	DinoPluginsIcePlugin* self;
	gboolean result;
	self = _data2_->self;
	dino_plugins_ice_plugin_external_discovery_refresh_services (self, _data2_->account, _data2_->stream, NULL, NULL);
	result = FALSE;
	return result;
}

static gboolean
______lambda13__gsource_func (gpointer self)
{
	gboolean result;
	result = _____lambda13_ (self);
	return result;
}

static gboolean
dino_plugins_ice_plugin_external_discovery_refresh_services_co (DinoPluginsIcePluginExternalDiscoveryRefreshServicesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data2_ = g_slice_new0 (Block2Data);
	_data_->_data2_->_ref_count_ = 1;
	_data_->_data2_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data2_->account);
	_data_->_data2_->account = _data_->account;
	_g_object_unref0 (_data_->_data2_->stream);
	_data_->_data2_->stream = _data_->stream;
	_data_->_data2_->_async_data_ = _data_;
	_data_->_tmp0_ = xmpp_xep_jingle_ice_udp_module_IDENTITY;
	_data_->_tmp1_ = xmpp_xmpp_stream_get_module (_data_->_data2_->stream, XMPP_XEP_JINGLE_ICE_UDP_TYPE_MODULE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _data_->_tmp0_);
	_data_->_tmp2_ = (XmppXepJingleIceUdpModule*) _data_->_tmp1_;
	_data_->_tmp3_ = DINO_PLUGINS_ICE_IS_MODULE (_data_->_tmp2_) ? ((DinoPluginsIceModule*) _data_->_tmp2_) : NULL;
	if (_data_->_tmp3_ == NULL) {
		_g_object_unref0 (_data_->_tmp2_);
	}
	_data_->ice_udp_module = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->ice_udp_module;
	if (_data_->_tmp4_ == NULL) {
		_g_object_unref0 (_data_->ice_udp_module);
		block2_data_unref (_data_->_data2_);
		_data_->_data2_ = 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_->_state_ = 1;
	xmpp_xep_external_service_discovery_request_services (_data_->_data2_->stream, dino_plugins_ice_plugin_external_discovery_refresh_services_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp5_ = xmpp_xep_external_service_discovery_request_services_finish (_data_->_res_);
	_data_->services = _data_->_tmp5_;
	{
		_data_->_tmp6_ = _data_->services;
		_data_->_service_list = _data_->_tmp6_;
		_data_->_tmp7_ = _data_->_service_list;
		_data_->_tmp8_ = gee_collection_get_size ((GeeCollection*) _data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_service_size = _data_->_tmp9_;
		_data_->_service_index = -1;
		while (TRUE) {
			_data_->_service_index = _data_->_service_index + 1;
			_data_->_tmp10_ = _data_->_service_index;
			_data_->_tmp11_ = _data_->_service_size;
			if (!(_data_->_tmp10_ < _data_->_tmp11_)) {
				break;
			}
			_data_->_tmp12_ = _data_->_service_list;
			_data_->_tmp13_ = gee_list_get (_data_->_tmp12_, _data_->_service_index);
			_data_->service = (XmppXepExternalServiceDiscoveryService*) _data_->_tmp13_;
			_data_->_tmp15_ = _data_->service;
			_data_->_tmp16_ = xmpp_xep_external_service_discovery_service_get_transport (_data_->_tmp15_);
			_data_->_tmp17_ = _data_->_tmp16_;
			if (g_strcmp0 (_data_->_tmp17_, "udp") == 0) {
				_data_->_tmp19_ = _data_->service;
				_data_->_tmp20_ = xmpp_xep_external_service_discovery_service_get_ty (_data_->_tmp19_);
				_data_->_tmp21_ = _data_->_tmp20_;
				if (g_strcmp0 (_data_->_tmp21_, "stun") == 0) {
					_data_->_tmp18_ = TRUE;
				} else {
					_data_->_tmp22_ = _data_->service;
					_data_->_tmp23_ = xmpp_xep_external_service_discovery_service_get_ty (_data_->_tmp22_);
					_data_->_tmp24_ = _data_->_tmp23_;
					_data_->_tmp18_ = g_strcmp0 (_data_->_tmp24_, "turn") == 0;
				}
				_data_->_tmp14_ = _data_->_tmp18_;
			} else {
				_data_->_tmp14_ = FALSE;
			}
			if (_data_->_tmp14_) {
				_data_->_tmp25_ = _data_->service;
				_data_->_tmp26_ = xmpp_xep_external_service_discovery_service_get_host (_data_->_tmp25_);
				_data_->_tmp27_ = _data_->_tmp26_;
				_data_->_state_ = 2;
				dino_plugins_ice_plugin_lookup_ipv4_addess (_data_->self, _data_->_tmp27_, dino_plugins_ice_plugin_external_discovery_refresh_services_ready, _data_);
				return FALSE;
				_state_2:
				_data_->_tmp28_ = dino_plugins_ice_plugin_lookup_ipv4_addess_finish (_data_->self, _data_->_res_);
				_data_->ip = _data_->_tmp28_;
				_data_->_tmp29_ = _data_->ip;
				if (_data_->_tmp29_ == NULL) {
					_g_object_unref0 (_data_->ip);
					_xmpp_xep_external_service_discovery_service_unref0 (_data_->service);
					continue;
				}
				_data_->_tmp34_ = _data_->ip;
				_data_->_tmp35_ = g_inet_address_get_is_any (_data_->_tmp34_);
				_data_->_tmp36_ = _data_->_tmp35_;
				if (_data_->_tmp36_) {
					_data_->_tmp33_ = TRUE;
				} else {
					_data_->_tmp37_ = _data_->ip;
					_data_->_tmp38_ = g_inet_address_get_is_link_local (_data_->_tmp37_);
					_data_->_tmp39_ = _data_->_tmp38_;
					_data_->_tmp33_ = _data_->_tmp39_;
				}
				if (_data_->_tmp33_) {
					_data_->_tmp32_ = TRUE;
				} else {
					_data_->_tmp40_ = _data_->ip;
					_data_->_tmp41_ = g_inet_address_get_is_loopback (_data_->_tmp40_);
					_data_->_tmp42_ = _data_->_tmp41_;
					_data_->_tmp32_ = _data_->_tmp42_;
				}
				if (_data_->_tmp32_) {
					_data_->_tmp31_ = TRUE;
				} else {
					_data_->_tmp43_ = _data_->ip;
					_data_->_tmp44_ = g_inet_address_get_is_multicast (_data_->_tmp43_);
					_data_->_tmp45_ = _data_->_tmp44_;
					_data_->_tmp31_ = _data_->_tmp45_;
				}
				if (_data_->_tmp31_) {
					_data_->_tmp30_ = TRUE;
				} else {
					_data_->_tmp46_ = _data_->ip;
					_data_->_tmp47_ = g_inet_address_get_is_site_local (_data_->_tmp46_);
					_data_->_tmp48_ = _data_->_tmp47_;
					_data_->_tmp30_ = _data_->_tmp48_;
				}
				if (_data_->_tmp30_) {
					_data_->_tmp49_ = _data_->service;
					_data_->_tmp50_ = xmpp_xep_external_service_discovery_service_get_host (_data_->_tmp49_);
					_data_->_tmp51_ = _data_->_tmp50_;
					g_warning ("plugin.vala:41: Ignoring STUN/TURN server at %s", _data_->_tmp51_);
					_g_object_unref0 (_data_->ip);
					_xmpp_xep_external_service_discovery_service_unref0 (_data_->service);
					continue;
				}
				_data_->_tmp52_ = _data_->service;
				_data_->_tmp53_ = xmpp_xep_external_service_discovery_service_get_ty (_data_->_tmp52_);
				_data_->_tmp54_ = _data_->_tmp53_;
				if (g_strcmp0 (_data_->_tmp54_, "stun") == 0) {
					_data_->_tmp55_ = _data_->service;
					_data_->_tmp56_ = xmpp_xep_external_service_discovery_service_get_host (_data_->_tmp55_);
					_data_->_tmp57_ = _data_->_tmp56_;
					_data_->_tmp58_ = _data_->service;
					_data_->_tmp59_ = xmpp_xep_external_service_discovery_service_get_port (_data_->_tmp58_);
					_data_->_tmp60_ = _data_->_tmp59_;
					_data_->_tmp61_ = _data_->ip;
					_data_->_tmp62_ = g_inet_address_to_string (_data_->_tmp61_);
					_data_->_tmp63_ = _data_->_tmp62_;
					g_debug ("plugin.vala:46: Server offers STUN server: %s:%u, resolved to %s", _data_->_tmp57_, _data_->_tmp60_, _data_->_tmp63_);
					_g_free0 (_data_->_tmp63_);
					_data_->_tmp64_ = _data_->ice_udp_module;
					_data_->_tmp65_ = _data_->ip;
					_data_->_tmp66_ = g_inet_address_to_string (_data_->_tmp65_);
					_g_free0 (_data_->_tmp64_->stun_ip);
					_data_->_tmp64_->stun_ip = _data_->_tmp66_;
					_data_->_tmp67_ = _data_->ice_udp_module;
					_data_->_tmp68_ = _data_->service;
					_data_->_tmp69_ = xmpp_xep_external_service_discovery_service_get_port (_data_->_tmp68_);
					_data_->_tmp70_ = _data_->_tmp69_;
					_data_->_tmp67_->stun_port = _data_->_tmp70_;
				} else {
					_data_->_tmp71_ = _data_->service;
					_data_->_tmp72_ = xmpp_xep_external_service_discovery_service_get_ty (_data_->_tmp71_);
					_data_->_tmp73_ = _data_->_tmp72_;
					if (g_strcmp0 (_data_->_tmp73_, "turn") == 0) {
						_data_->_tmp74_ = _data_->service;
						_data_->_tmp75_ = xmpp_xep_external_service_discovery_service_get_host (_data_->_tmp74_);
						_data_->_tmp76_ = _data_->_tmp75_;
						_data_->_tmp77_ = _data_->service;
						_data_->_tmp78_ = xmpp_xep_external_service_discovery_service_get_port (_data_->_tmp77_);
						_data_->_tmp79_ = _data_->_tmp78_;
						_data_->_tmp80_ = _data_->ip;
						_data_->_tmp81_ = g_inet_address_to_string (_data_->_tmp80_);
						_data_->_tmp82_ = _data_->_tmp81_;
						g_debug ("plugin.vala:50: Server offers TURN server: %s:%u, resolved to %s", _data_->_tmp76_, _data_->_tmp79_, _data_->_tmp82_);
						_g_free0 (_data_->_tmp82_);
						_data_->_tmp83_ = _data_->ice_udp_module;
						_data_->_tmp84_ = _data_->ip;
						_data_->_tmp85_ = g_inet_address_to_string (_data_->_tmp84_);
						_g_free0 (_data_->_tmp83_->turn_ip);
						_data_->_tmp83_->turn_ip = _data_->_tmp85_;
						_data_->_tmp86_ = _data_->ice_udp_module;
						_data_->_tmp87_ = _data_->service;
						_data_->_tmp88_ = _xmpp_xep_external_service_discovery_service_ref0 (_data_->_tmp87_);
						_xmpp_xep_external_service_discovery_service_unref0 (_data_->_tmp86_->turn_service);
						_data_->_tmp86_->turn_service = _data_->_tmp88_;
					}
				}
				_g_object_unref0 (_data_->ip);
			}
			_xmpp_xep_external_service_discovery_service_unref0 (_data_->service);
		}
	}
	_data_->_tmp89_ = _data_->ice_udp_module;
	_data_->_tmp90_ = _data_->_tmp89_->stun_ip;
	if (_data_->_tmp90_ == NULL) {
		_data_->_state_ = 3;
		dino_plugins_ice_plugin_lookup_ipv4_addess (_data_->self, "stun.dino.im", dino_plugins_ice_plugin_external_discovery_refresh_services_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp91_ = dino_plugins_ice_plugin_lookup_ipv4_addess_finish (_data_->self, _data_->_res_);
		_data_->_vala1_ip = _data_->_tmp91_;
		_data_->_tmp92_ = _data_->_vala1_ip;
		if (_data_->_tmp92_ == NULL) {
			_g_object_unref0 (_data_->_vala1_ip);
			_g_object_unref0 (_data_->services);
			_g_object_unref0 (_data_->ice_udp_module);
			block2_data_unref (_data_->_data2_);
			_data_->_data2_ = 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_->_tmp93_ = _data_->_vala1_ip;
		_data_->_tmp94_ = g_inet_address_to_string (_data_->_tmp93_);
		_data_->_tmp95_ = _data_->_tmp94_;
		g_debug ("plugin.vala:60: Using fallback STUN server: stun.dino.im:7886, resolve" \
"d to %s", _data_->_tmp95_);
		_g_free0 (_data_->_tmp95_);
		_data_->_tmp96_ = _data_->ice_udp_module;
		_data_->_tmp97_ = _data_->_vala1_ip;
		_data_->_tmp98_ = g_inet_address_to_string (_data_->_tmp97_);
		_g_free0 (_data_->_tmp96_->stun_ip);
		_data_->_tmp96_->stun_ip = _data_->_tmp98_;
		_data_->_tmp99_ = _data_->ice_udp_module;
		_data_->_tmp99_->stun_port = (guint) 7886;
		_g_object_unref0 (_data_->_vala1_ip);
	}
	_data_->_tmp100_ = _data_->ice_udp_module;
	_data_->_tmp101_ = _data_->_tmp100_->turn_service;
	if (_data_->_tmp101_ != NULL) {
		_data_->_tmp102_ = _data_->ice_udp_module;
		_data_->_tmp103_ = _data_->_tmp102_->turn_service;
		_data_->_tmp104_ = xmpp_xep_external_service_discovery_service_get_expires (_data_->_tmp103_);
		_data_->_tmp105_ = _data_->_tmp104_;
		_data_->_tmp106_ = _g_date_time_ref0 (_data_->_tmp105_);
		_data_->expires = _data_->_tmp106_;
		_data_->_tmp107_ = _data_->expires;
		if (_data_->_tmp107_ != NULL) {
			_data_->_tmp108_ = _data_->expires;
			_data_->_tmp109_ = g_date_time_new_now_utc ();
			_data_->_tmp110_ = _data_->_tmp109_;
			_data_->_tmp111_ = ((guint) (g_date_time_to_unix (_data_->_tmp108_) - g_date_time_to_unix (_data_->_tmp110_))) / 2;
			_g_date_time_unref0 (_data_->_tmp110_);
			_data_->refresh_delay = _data_->_tmp111_;
			if (_data_->refresh_delay >= ((guint) 300)) {
				_data_->_tmp112_ = ((gint64) _data_->refresh_delay) <= ((gint64) G_MAXUINT);
			} else {
				_data_->_tmp112_ = FALSE;
			}
			if (_data_->_tmp112_) {
				g_debug ("plugin.vala:73: Re-fetching TURN credentials in %u sec", _data_->refresh_delay);
				_data_->_tmp113_ = _data_->self->priv->timeouts;
				gee_abstract_map_unset ((GeeAbstractMap*) _data_->_tmp113_, _data_->_data2_->account, NULL);
				_data_->_tmp114_ = _data_->self->priv->timeouts;
				gee_abstract_map_set ((GeeAbstractMap*) _data_->_tmp114_, _data_->_data2_->account, (gpointer) ((guintptr) g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) _data_->refresh_delay, ______lambda13__gsource_func, block2_data_ref (_data_->_data2_), block2_data_unref)));
			} else {
				g_warning ("plugin.vala:81: TURN credentials' expiry time = %u, *not* re-fetching", _data_->refresh_delay);
			}
		}
		_g_date_time_unref0 (_data_->expires);
	}
	_g_object_unref0 (_data_->services);
	_g_object_unref0 (_data_->ice_udp_module);
	block2_data_unref (_data_->_data2_);
	_data_->_data2_ = 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;
}

static void
dino_plugins_ice_plugin_real_shutdown (DinoPluginsRootInterface* base)
{
	DinoPluginsIcePlugin * self;
	self = (DinoPluginsIcePlugin*) base;
}

static void
dino_plugins_ice_plugin_lookup_ipv4_addess_data_free (gpointer _data)
{
	DinoPluginsIcePluginLookupIpv4AddessData* _data_;
	_data_ = _data;
	_g_free0 (_data_->host);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DinoPluginsIcePluginLookupIpv4AddessData, _data_);
}

static void
dino_plugins_ice_plugin_lookup_ipv4_addess (DinoPluginsIcePlugin* self,
                                            const gchar* host,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	DinoPluginsIcePluginLookupIpv4AddessData* _data_;
	DinoPluginsIcePlugin* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (host != NULL);
	_data_ = g_slice_new0 (DinoPluginsIcePluginLookupIpv4AddessData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_plugins_ice_plugin_lookup_ipv4_addess_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (host);
	_g_free0 (_data_->host);
	_data_->host = _tmp1_;
	dino_plugins_ice_plugin_lookup_ipv4_addess_co (_data_);
}

static GInetAddress*
dino_plugins_ice_plugin_lookup_ipv4_addess_finish (DinoPluginsIcePlugin* self,
                                                   GAsyncResult* _res_)
{
	GInetAddress* result;
	DinoPluginsIcePluginLookupIpv4AddessData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dino_plugins_ice_plugin_lookup_ipv4_addess_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_)
{
	DinoPluginsIcePluginLookupIpv4AddessData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_plugins_ice_plugin_lookup_ipv4_addess_co (_data_);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static gboolean
dino_plugins_ice_plugin_lookup_ipv4_addess_co (DinoPluginsIcePluginLookupIpv4AddessData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp0_ = g_resolver_get_default ();
		_data_->resolver = _data_->_tmp0_;
		_data_->_tmp1_ = _data_->resolver;
		_data_->_state_ = 1;
		g_resolver_lookup_by_name_async (_data_->_tmp1_, _data_->host, NULL, dino_plugins_ice_plugin_lookup_ipv4_addess_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp2_ = g_resolver_lookup_by_name_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error0_);
		_data_->ips = _data_->_tmp2_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->resolver);
			goto __catch0_g_error;
		}
		_data_->_tmp3_ = _data_->ips;
		{
			_data_->ina_collection = _data_->_tmp3_;
			for (_data_->ina_it = _data_->ina_collection; _data_->ina_it != NULL; _data_->ina_it = _data_->ina_it->next) {
				_data_->_tmp4_ = _g_object_ref0 ((GInetAddress*) _data_->ina_it->data);
				_data_->ina = _data_->_tmp4_;
				{
					_data_->_tmp5_ = _data_->ina;
					if (g_inet_address_get_family (_data_->_tmp5_) != G_SOCKET_FAMILY_IPV4) {
						_g_object_unref0 (_data_->ina);
						continue;
					}
					_data_->result = _data_->ina;
					(_data_->ips == NULL) ? NULL : (_data_->ips = (_g_list_free__g_object_unref0_ (_data_->ips), NULL));
					_g_object_unref0 (_data_->resolver);
					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_->ips == NULL) ? NULL : (_data_->ips = (_g_list_free__g_object_unref0_ (_data_->ips), NULL));
		_g_object_unref0 (_data_->resolver);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		g_warning ("plugin.vala:100: Failed looking up IP address of %s", _data_->host);
	}
	__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;
	}
	_data_->result = 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;
}

DinoPluginsIcePlugin*
dino_plugins_ice_plugin_construct (GType object_type)
{
	DinoPluginsIcePlugin * self = NULL;
	self = (DinoPluginsIcePlugin*) g_object_new (object_type, NULL);
	return self;
}

DinoPluginsIcePlugin*
dino_plugins_ice_plugin_new (void)
{
	return dino_plugins_ice_plugin_construct (DINO_PLUGINS_ICE_TYPE_PLUGIN);
}

static void
dino_plugins_ice_plugin_class_init (DinoPluginsIcePluginClass * klass,
                                    gpointer klass_data)
{
	dino_plugins_ice_plugin_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsIcePlugin_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_ice_plugin_finalize;
}

static void
dino_plugins_ice_plugin_dino_plugins_root_interface_interface_init (DinoPluginsRootInterfaceIface * iface,
                                                                    gpointer iface_data)
{
	dino_plugins_ice_plugin_dino_plugins_root_interface_parent_iface = g_type_interface_peek_parent (iface);
	iface->registered = (void (*) (DinoPluginsRootInterface*, DinoApplication*)) dino_plugins_ice_plugin_real_registered;
	iface->shutdown = (void (*) (DinoPluginsRootInterface*)) dino_plugins_ice_plugin_real_shutdown;
}

static void
dino_plugins_ice_plugin_instance_init (DinoPluginsIcePlugin * self,
                                       gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = dino_plugins_ice_plugin_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (DINO_ENTITIES_TYPE_ACCOUNT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, G_TYPE_UINT, NULL, NULL, _dino_entities_account_hash_func_gee_hash_data_func, NULL, NULL, _dino_entities_account_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->timeouts = _tmp0_;
}

static void
dino_plugins_ice_plugin_finalize (GObject * obj)
{
	DinoPluginsIcePlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_ICE_TYPE_PLUGIN, DinoPluginsIcePlugin);
	_g_object_unref0 (self->priv->timeouts);
	_g_object_unref0 (self->app);
	G_OBJECT_CLASS (dino_plugins_ice_plugin_parent_class)->finalize (obj);
}

static GType
dino_plugins_ice_plugin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsIcePluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_ice_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsIcePlugin), 0, (GInstanceInitFunc) dino_plugins_ice_plugin_instance_init, NULL };
	static const GInterfaceInfo dino_plugins_root_interface_info = { (GInterfaceInitFunc) dino_plugins_ice_plugin_dino_plugins_root_interface_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_plugins_ice_plugin_type_id;
	dino_plugins_ice_plugin_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoPluginsIcePlugin", &g_define_type_info, 0);
	g_type_add_interface_static (dino_plugins_ice_plugin_type_id, DINO_PLUGINS_TYPE_ROOT_INTERFACE, &dino_plugins_root_interface_info);
	DinoPluginsIcePlugin_private_offset = g_type_add_instance_private (dino_plugins_ice_plugin_type_id, sizeof (DinoPluginsIcePluginPrivate));
	return dino_plugins_ice_plugin_type_id;
}

GType
dino_plugins_ice_plugin_get_type (void)
{
	static volatile gsize dino_plugins_ice_plugin_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_ice_plugin_type_id__once)) {
		GType dino_plugins_ice_plugin_type_id;
		dino_plugins_ice_plugin_type_id = dino_plugins_ice_plugin_get_type_once ();
		g_once_init_leave (&dino_plugins_ice_plugin_type_id__once, dino_plugins_ice_plugin_type_id);
	}
	return dino_plugins_ice_plugin_type_id__once;
}

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;
}

