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

/*
 * Copyright (C) 2010-2011 Simon Busch <morphis@gravedo.de>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <fsogsm.h>
#include <gio/gio.h>
#include <freesmartphone.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_MSM_PDP_ACTIVATE_CONTEXT (msm_pdp_activate_context_get_type ())
#define MSM_PDP_ACTIVATE_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_PDP_ACTIVATE_CONTEXT, MsmPdpActivateContext))
#define MSM_PDP_ACTIVATE_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_PDP_ACTIVATE_CONTEXT, MsmPdpActivateContextClass))
#define IS_MSM_PDP_ACTIVATE_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_PDP_ACTIVATE_CONTEXT))
#define IS_MSM_PDP_ACTIVATE_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_PDP_ACTIVATE_CONTEXT))
#define MSM_PDP_ACTIVATE_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_PDP_ACTIVATE_CONTEXT, MsmPdpActivateContextClass))

typedef struct _MsmPdpActivateContext MsmPdpActivateContext;
typedef struct _MsmPdpActivateContextClass MsmPdpActivateContextClass;
typedef struct _MsmPdpActivateContextPrivate MsmPdpActivateContextPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _MsmPdpActivateContextRunData MsmPdpActivateContextRunData;

#define TYPE_MSM_PDP_DEACTIVATE_CONTEXT (msm_pdp_deactivate_context_get_type ())
#define MSM_PDP_DEACTIVATE_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_PDP_DEACTIVATE_CONTEXT, MsmPdpDeactivateContext))
#define MSM_PDP_DEACTIVATE_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_PDP_DEACTIVATE_CONTEXT, MsmPdpDeactivateContextClass))
#define IS_MSM_PDP_DEACTIVATE_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_PDP_DEACTIVATE_CONTEXT))
#define IS_MSM_PDP_DEACTIVATE_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_PDP_DEACTIVATE_CONTEXT))
#define MSM_PDP_DEACTIVATE_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_PDP_DEACTIVATE_CONTEXT, MsmPdpDeactivateContextClass))

typedef struct _MsmPdpDeactivateContext MsmPdpDeactivateContext;
typedef struct _MsmPdpDeactivateContextClass MsmPdpDeactivateContextClass;
typedef struct _MsmPdpDeactivateContextPrivate MsmPdpDeactivateContextPrivate;
typedef struct _MsmPdpDeactivateContextRunData MsmPdpDeactivateContextRunData;

#define TYPE_MSM_PDP_GET_CREDENTIALS (msm_pdp_get_credentials_get_type ())
#define MSM_PDP_GET_CREDENTIALS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_PDP_GET_CREDENTIALS, MsmPdpGetCredentials))
#define MSM_PDP_GET_CREDENTIALS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_PDP_GET_CREDENTIALS, MsmPdpGetCredentialsClass))
#define IS_MSM_PDP_GET_CREDENTIALS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_PDP_GET_CREDENTIALS))
#define IS_MSM_PDP_GET_CREDENTIALS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_PDP_GET_CREDENTIALS))
#define MSM_PDP_GET_CREDENTIALS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_PDP_GET_CREDENTIALS, MsmPdpGetCredentialsClass))

typedef struct _MsmPdpGetCredentials MsmPdpGetCredentials;
typedef struct _MsmPdpGetCredentialsClass MsmPdpGetCredentialsClass;
typedef struct _MsmPdpGetCredentialsPrivate MsmPdpGetCredentialsPrivate;
typedef struct _MsmPdpGetCredentialsRunData MsmPdpGetCredentialsRunData;

#define TYPE_MSM_PDP_SET_CREDENTIALS (msm_pdp_set_credentials_get_type ())
#define MSM_PDP_SET_CREDENTIALS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MSM_PDP_SET_CREDENTIALS, MsmPdpSetCredentials))
#define MSM_PDP_SET_CREDENTIALS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MSM_PDP_SET_CREDENTIALS, MsmPdpSetCredentialsClass))
#define IS_MSM_PDP_SET_CREDENTIALS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MSM_PDP_SET_CREDENTIALS))
#define IS_MSM_PDP_SET_CREDENTIALS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MSM_PDP_SET_CREDENTIALS))
#define MSM_PDP_SET_CREDENTIALS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MSM_PDP_SET_CREDENTIALS, MsmPdpSetCredentialsClass))

typedef struct _MsmPdpSetCredentials MsmPdpSetCredentials;
typedef struct _MsmPdpSetCredentialsClass MsmPdpSetCredentialsClass;
typedef struct _MsmPdpSetCredentialsPrivate MsmPdpSetCredentialsPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _fso_gsm_context_params_unref0(var) ((var == NULL) ? NULL : (var = (fso_gsm_context_params_unref (var), NULL)))
typedef struct _MsmPdpSetCredentialsRunData MsmPdpSetCredentialsRunData;

struct _MsmPdpActivateContext {
	FsoGsmPdpActivateContext parent_instance;
	MsmPdpActivateContextPrivate * priv;
};

struct _MsmPdpActivateContextClass {
	FsoGsmPdpActivateContextClass parent_class;
};

struct _MsmPdpActivateContextRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmPdpActivateContext* self;
	GError* _tmp0_;
	GError * _inner_error_;
};

struct _MsmPdpDeactivateContext {
	FsoGsmPdpDeactivateContext parent_instance;
	MsmPdpDeactivateContextPrivate * priv;
};

struct _MsmPdpDeactivateContextClass {
	FsoGsmPdpDeactivateContextClass parent_class;
};

struct _MsmPdpDeactivateContextRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmPdpDeactivateContext* self;
	GError* _tmp0_;
	GError * _inner_error_;
};

struct _MsmPdpGetCredentials {
	FsoGsmPdpGetCredentials parent_instance;
	MsmPdpGetCredentialsPrivate * priv;
};

struct _MsmPdpGetCredentialsClass {
	FsoGsmPdpGetCredentialsClass parent_class;
};

struct _MsmPdpGetCredentialsRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmPdpGetCredentials* self;
	GError* _tmp0_;
	GError * _inner_error_;
};

struct _MsmPdpSetCredentials {
	FsoGsmPdpSetCredentials parent_instance;
	MsmPdpSetCredentialsPrivate * priv;
};

struct _MsmPdpSetCredentialsClass {
	FsoGsmPdpSetCredentialsClass parent_class;
};

struct _MsmPdpSetCredentialsRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	MsmPdpSetCredentials* self;
	gchar* apn;
	gchar* username;
	gchar* password;
	FsoGsmModem* _tmp0_;
	FsoGsmModemData* _tmp1_;
	FsoGsmModemData* data;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	FsoGsmContextParams* _tmp5_;
};


static gpointer msm_pdp_activate_context_parent_class = NULL;
static GType msm_pdp_activate_context_type_id = 0;
static gpointer msm_pdp_deactivate_context_parent_class = NULL;
static GType msm_pdp_deactivate_context_type_id = 0;
static gpointer msm_pdp_get_credentials_parent_class = NULL;
static GType msm_pdp_get_credentials_type_id = 0;
static gpointer msm_pdp_set_credentials_parent_class = NULL;
static GType msm_pdp_set_credentials_type_id = 0;

GType msm_pdp_activate_context_get_type (void) G_GNUC_CONST;
GType msm_pdp_activate_context_register_type (GTypeModule * module);
enum  {
	MSM_PDP_ACTIVATE_CONTEXT_DUMMY_PROPERTY
};
static void msm_pdp_activate_context_real_run_data_free (gpointer _data);
static void msm_pdp_activate_context_real_run (FsoGsmPdpActivateContext* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_pdp_activate_context_real_run_co (MsmPdpActivateContextRunData* _data_);
MsmPdpActivateContext* msm_pdp_activate_context_new (void);
MsmPdpActivateContext* msm_pdp_activate_context_construct (GType object_type);
GType msm_pdp_deactivate_context_get_type (void) G_GNUC_CONST;
GType msm_pdp_deactivate_context_register_type (GTypeModule * module);
enum  {
	MSM_PDP_DEACTIVATE_CONTEXT_DUMMY_PROPERTY
};
static void msm_pdp_deactivate_context_real_run_data_free (gpointer _data);
static void msm_pdp_deactivate_context_real_run (FsoGsmPdpDeactivateContext* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_pdp_deactivate_context_real_run_co (MsmPdpDeactivateContextRunData* _data_);
MsmPdpDeactivateContext* msm_pdp_deactivate_context_new (void);
MsmPdpDeactivateContext* msm_pdp_deactivate_context_construct (GType object_type);
GType msm_pdp_get_credentials_get_type (void) G_GNUC_CONST;
GType msm_pdp_get_credentials_register_type (GTypeModule * module);
enum  {
	MSM_PDP_GET_CREDENTIALS_DUMMY_PROPERTY
};
static void msm_pdp_get_credentials_real_run_data_free (gpointer _data);
static void msm_pdp_get_credentials_real_run (FsoGsmPdpGetCredentials* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_pdp_get_credentials_real_run_co (MsmPdpGetCredentialsRunData* _data_);
MsmPdpGetCredentials* msm_pdp_get_credentials_new (void);
MsmPdpGetCredentials* msm_pdp_get_credentials_construct (GType object_type);
GType msm_pdp_set_credentials_get_type (void) G_GNUC_CONST;
GType msm_pdp_set_credentials_register_type (GTypeModule * module);
enum  {
	MSM_PDP_SET_CREDENTIALS_DUMMY_PROPERTY
};
static void msm_pdp_set_credentials_real_run_data_free (gpointer _data);
static void msm_pdp_set_credentials_real_run (FsoGsmPdpSetCredentials* base, const gchar* apn, const gchar* username, const gchar* password, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean msm_pdp_set_credentials_real_run_co (MsmPdpSetCredentialsRunData* _data_);
MsmPdpSetCredentials* msm_pdp_set_credentials_new (void);
MsmPdpSetCredentials* msm_pdp_set_credentials_construct (GType object_type);


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


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


static void msm_pdp_activate_context_real_run (FsoGsmPdpActivateContext* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmPdpActivateContext * self;
	MsmPdpActivateContextRunData* _data_;
	MsmPdpActivateContext* _tmp0_;
	self = (MsmPdpActivateContext*) base;
	_data_ = g_slice_new0 (MsmPdpActivateContextRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_pdp_activate_context_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_pdp_activate_context_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	msm_pdp_activate_context_real_run_co (_data_);
}


static void msm_pdp_activate_context_real_run_finish (FsoGsmPdpActivateContext* base, GAsyncResult* _res_, GError** error) {
	MsmPdpActivateContextRunData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean msm_pdp_activate_context_real_run_co (MsmPdpActivateContextRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_UNSUPPORTED, "Not implemented yet!");
	_data_->_inner_error_ = _data_->_tmp0_;
	if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


MsmPdpActivateContext* msm_pdp_activate_context_construct (GType object_type) {
	MsmPdpActivateContext * self = NULL;
	self = (MsmPdpActivateContext*) fso_gsm_pdp_activate_context_construct (object_type);
	return self;
}


MsmPdpActivateContext* msm_pdp_activate_context_new (void) {
	return msm_pdp_activate_context_construct (TYPE_MSM_PDP_ACTIVATE_CONTEXT);
}


static void msm_pdp_activate_context_class_init (MsmPdpActivateContextClass * klass) {
	msm_pdp_activate_context_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_PDP_ACTIVATE_CONTEXT_CLASS (klass)->run = msm_pdp_activate_context_real_run;
	FSO_GSM_PDP_ACTIVATE_CONTEXT_CLASS (klass)->run_finish = msm_pdp_activate_context_real_run_finish;
}


static void msm_pdp_activate_context_instance_init (MsmPdpActivateContext * self) {
}


/**
 * PDP Mediators
 **/
GType msm_pdp_activate_context_get_type (void) {
	return msm_pdp_activate_context_type_id;
}


GType msm_pdp_activate_context_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmPdpActivateContextClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_pdp_activate_context_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmPdpActivateContext), 0, (GInstanceInitFunc) msm_pdp_activate_context_instance_init, NULL };
	msm_pdp_activate_context_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_PDP_ACTIVATE_CONTEXT, "MsmPdpActivateContext", &g_define_type_info, 0);
	return msm_pdp_activate_context_type_id;
}


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


static void msm_pdp_deactivate_context_real_run (FsoGsmPdpDeactivateContext* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmPdpDeactivateContext * self;
	MsmPdpDeactivateContextRunData* _data_;
	MsmPdpDeactivateContext* _tmp0_;
	self = (MsmPdpDeactivateContext*) base;
	_data_ = g_slice_new0 (MsmPdpDeactivateContextRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_pdp_deactivate_context_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_pdp_deactivate_context_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	msm_pdp_deactivate_context_real_run_co (_data_);
}


static void msm_pdp_deactivate_context_real_run_finish (FsoGsmPdpDeactivateContext* base, GAsyncResult* _res_, GError** error) {
	MsmPdpDeactivateContextRunData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean msm_pdp_deactivate_context_real_run_co (MsmPdpDeactivateContextRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_UNSUPPORTED, "Not implemented yet!");
	_data_->_inner_error_ = _data_->_tmp0_;
	if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


MsmPdpDeactivateContext* msm_pdp_deactivate_context_construct (GType object_type) {
	MsmPdpDeactivateContext * self = NULL;
	self = (MsmPdpDeactivateContext*) fso_gsm_pdp_deactivate_context_construct (object_type);
	return self;
}


MsmPdpDeactivateContext* msm_pdp_deactivate_context_new (void) {
	return msm_pdp_deactivate_context_construct (TYPE_MSM_PDP_DEACTIVATE_CONTEXT);
}


static void msm_pdp_deactivate_context_class_init (MsmPdpDeactivateContextClass * klass) {
	msm_pdp_deactivate_context_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_PDP_DEACTIVATE_CONTEXT_CLASS (klass)->run = msm_pdp_deactivate_context_real_run;
	FSO_GSM_PDP_DEACTIVATE_CONTEXT_CLASS (klass)->run_finish = msm_pdp_deactivate_context_real_run_finish;
}


static void msm_pdp_deactivate_context_instance_init (MsmPdpDeactivateContext * self) {
}


GType msm_pdp_deactivate_context_get_type (void) {
	return msm_pdp_deactivate_context_type_id;
}


GType msm_pdp_deactivate_context_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmPdpDeactivateContextClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_pdp_deactivate_context_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmPdpDeactivateContext), 0, (GInstanceInitFunc) msm_pdp_deactivate_context_instance_init, NULL };
	msm_pdp_deactivate_context_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_PDP_DEACTIVATE_CONTEXT, "MsmPdpDeactivateContext", &g_define_type_info, 0);
	return msm_pdp_deactivate_context_type_id;
}


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


static void msm_pdp_get_credentials_real_run (FsoGsmPdpGetCredentials* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmPdpGetCredentials * self;
	MsmPdpGetCredentialsRunData* _data_;
	MsmPdpGetCredentials* _tmp0_;
	self = (MsmPdpGetCredentials*) base;
	_data_ = g_slice_new0 (MsmPdpGetCredentialsRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_pdp_get_credentials_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_pdp_get_credentials_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	msm_pdp_get_credentials_real_run_co (_data_);
}


static void msm_pdp_get_credentials_real_run_finish (FsoGsmPdpGetCredentials* base, GAsyncResult* _res_, GError** error) {
	MsmPdpGetCredentialsRunData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean msm_pdp_get_credentials_real_run_co (MsmPdpGetCredentialsRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_error_new_literal (FREE_SMARTPHONE_ERROR, FREE_SMARTPHONE_ERROR_UNSUPPORTED, "Not implemented yet!");
	_data_->_inner_error_ = _data_->_tmp0_;
	if ((_data_->_inner_error_->domain == FREE_SMARTPHONE_GSM_ERROR) || (_data_->_inner_error_->domain == FREE_SMARTPHONE_ERROR)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


MsmPdpGetCredentials* msm_pdp_get_credentials_construct (GType object_type) {
	MsmPdpGetCredentials * self = NULL;
	self = (MsmPdpGetCredentials*) fso_gsm_pdp_get_credentials_construct (object_type);
	return self;
}


MsmPdpGetCredentials* msm_pdp_get_credentials_new (void) {
	return msm_pdp_get_credentials_construct (TYPE_MSM_PDP_GET_CREDENTIALS);
}


static void msm_pdp_get_credentials_class_init (MsmPdpGetCredentialsClass * klass) {
	msm_pdp_get_credentials_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_PDP_GET_CREDENTIALS_CLASS (klass)->run = msm_pdp_get_credentials_real_run;
	FSO_GSM_PDP_GET_CREDENTIALS_CLASS (klass)->run_finish = msm_pdp_get_credentials_real_run_finish;
}


static void msm_pdp_get_credentials_instance_init (MsmPdpGetCredentials * self) {
}


GType msm_pdp_get_credentials_get_type (void) {
	return msm_pdp_get_credentials_type_id;
}


GType msm_pdp_get_credentials_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmPdpGetCredentialsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_pdp_get_credentials_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmPdpGetCredentials), 0, (GInstanceInitFunc) msm_pdp_get_credentials_instance_init, NULL };
	msm_pdp_get_credentials_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_PDP_GET_CREDENTIALS, "MsmPdpGetCredentials", &g_define_type_info, 0);
	return msm_pdp_get_credentials_type_id;
}


static void msm_pdp_set_credentials_real_run_data_free (gpointer _data) {
	MsmPdpSetCredentialsRunData* _data_;
	_data_ = _data;
	_g_free0 (_data_->apn);
	_g_free0 (_data_->username);
	_g_free0 (_data_->password);
	_g_object_unref0 (_data_->self);
	g_slice_free (MsmPdpSetCredentialsRunData, _data_);
}


static void msm_pdp_set_credentials_real_run (FsoGsmPdpSetCredentials* base, const gchar* apn, const gchar* username, const gchar* password, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	MsmPdpSetCredentials * self;
	MsmPdpSetCredentialsRunData* _data_;
	MsmPdpSetCredentials* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	self = (MsmPdpSetCredentials*) base;
	_data_ = g_slice_new0 (MsmPdpSetCredentialsRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, msm_pdp_set_credentials_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, msm_pdp_set_credentials_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = apn;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->apn = _tmp2_;
	_tmp3_ = username;
	_tmp4_ = g_strdup (_tmp3_);
	_data_->username = _tmp4_;
	_tmp5_ = password;
	_tmp6_ = g_strdup (_tmp5_);
	_data_->password = _tmp6_;
	msm_pdp_set_credentials_real_run_co (_data_);
}


static void msm_pdp_set_credentials_real_run_finish (FsoGsmPdpSetCredentials* base, GAsyncResult* _res_, GError** error) {
	MsmPdpSetCredentialsRunData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean msm_pdp_set_credentials_real_run_co (MsmPdpSetCredentialsRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = fso_gsm_theModem;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = fso_gsm_modem_data (_data_->_tmp0_);
	_data_->data = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->apn;
	_data_->_tmp3_ = _data_->username;
	_data_->_tmp4_ = _data_->password;
	_data_->_tmp5_ = fso_gsm_context_params_new (_data_->_tmp2_, _data_->_tmp3_, _data_->_tmp4_);
	_fso_gsm_context_params_unref0 (_data_->data->contextParams);
	_data_->data->contextParams = _data_->_tmp5_;
	_g_object_unref0 (_data_->data);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


MsmPdpSetCredentials* msm_pdp_set_credentials_construct (GType object_type) {
	MsmPdpSetCredentials * self = NULL;
	self = (MsmPdpSetCredentials*) fso_gsm_pdp_set_credentials_construct (object_type);
	return self;
}


MsmPdpSetCredentials* msm_pdp_set_credentials_new (void) {
	return msm_pdp_set_credentials_construct (TYPE_MSM_PDP_SET_CREDENTIALS);
}


static void msm_pdp_set_credentials_class_init (MsmPdpSetCredentialsClass * klass) {
	msm_pdp_set_credentials_parent_class = g_type_class_peek_parent (klass);
	FSO_GSM_PDP_SET_CREDENTIALS_CLASS (klass)->run = msm_pdp_set_credentials_real_run;
	FSO_GSM_PDP_SET_CREDENTIALS_CLASS (klass)->run_finish = msm_pdp_set_credentials_real_run_finish;
}


static void msm_pdp_set_credentials_instance_init (MsmPdpSetCredentials * self) {
}


GType msm_pdp_set_credentials_get_type (void) {
	return msm_pdp_set_credentials_type_id;
}


GType msm_pdp_set_credentials_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (MsmPdpSetCredentialsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) msm_pdp_set_credentials_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MsmPdpSetCredentials), 0, (GInstanceInitFunc) msm_pdp_set_credentials_instance_init, NULL };
	msm_pdp_set_credentials_type_id = g_type_module_register_type (module, FSO_GSM_TYPE_PDP_SET_CREDENTIALS, "MsmPdpSetCredentials", &g_define_type_info, 0);
	return msm_pdp_set_credentials_type_id;
}



