Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [RFC 1/1] GPRS Provisioning Plugin.
Date: Fri, 08 Jul 2011 13:23:34 -0500	[thread overview]
Message-ID: <4E174B26.3080004@gmail.com> (raw)
In-Reply-To: <1310124794-7880-2-git-send-email-oleg.zhurakivskyy@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1642 bytes --]

Hi Oleg,

<snip>

> +static int gprs_provision(const char *mcc, const char *mnc,
> +				const char *spn,
> +				struct ofono_gprs_provision_data **settings,
> +				int *count)
> +{
> +	int i;
> +	struct parser_data *data;
> +	*settings = NULL;
> +
> +	DBG("Provisioning for MCC %s, MNC %s, SPN '%s'",
> +			mcc, mnc, spn);
> +
> +	data = g_try_new0(struct parser_data, 1);
> +	if (data == NULL)
> +		return -ENOMEM;
> +
> +	lookup_apn(mcc, mnc, NULL, data);

What I wonder is what is the overhead of the XML parser right now (e.g.
how long it takes on reasonable embedded hardware).  If this takes a
while, then it might be better to pre-parse the mobile-provider-info db
during plugin initialization and not every time gprs_provision is
called.  Otherwise we run the risk of hanging the daemon while the
provision settings are being looked up.

> +
> +	*count = data->count;
> +
> +	DBG("settings count: %d", *count);
> +
> +	if (!*count) {
> +		g_free(data);
> +		return -ENOENT;
> +	}
> +
> +	*settings = g_try_new0(struct ofono_gprs_provision_data, *count);
> +	if (*settings == NULL)
> +		return -ENOMEM;
> +
> +	for (i = 0; i < *count; i++) {
> +		(*settings)[i] = *(data->settings[i]);
> +
> +		(*settings)[i].proto = OFONO_GPRS_PROTO_IP;
> +		(*settings)[i].type = OFONO_GPRS_CONTEXT_TYPE_INTERNET;
> +
> +		DBG("Name: %s", (*settings)[i].name);
> +		DBG("APN: %s", (*settings)[i].apn);
> +		DBG("Username: %s", (*settings)[i].username);
> +		DBG("Password: %s", (*settings)[i].password);
> +	}
> +
> +	g_free(data);
> +
> +	return 0;
> +}
> +

<snip>

Regards,
-Denis

  parent reply	other threads:[~2011-07-08 18:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-08 11:33 [RFC 0/1] GPRS Provisioning Plugin Oleg Zhurakivskyy
2011-07-08 11:33 ` [RFC 1/1] " Oleg Zhurakivskyy
2011-07-08 16:55   ` Marcel Holtmann
2011-07-11 12:55     ` Oleg Zhurakivskyy
2011-07-08 18:23   ` Denis Kenzior [this message]
2011-07-11  7:47     ` Oleg Zhurakivskyy
2011-07-11  8:11     ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
2011-07-10 14:23       ` Denis Kenzior
2011-07-13 10:41     ` Oleg Zhurakivskyy
2011-07-13 13:18       ` Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E174B26.3080004@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox