Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH_v3 2/3] emulator: add drivers to request/release private network from ConnMan
Date: Wed, 04 May 2011 23:11:13 -0500	[thread overview]
Message-ID: <4DC22361.5000906@gmail.com> (raw)
In-Reply-To: <1304433883-3806-3-git-send-email-guillaume.zajac@linux.intel.com>

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

Hi Guillaume,

On 05/03/2011 09:44 AM, Guillaume Zajac wrote:
> ---
>  include/emulator.h |   18 +++++++++++
>  src/emulator.c     |   83 +++++++++++++++++++++++++++++++++++++++------------
>  2 files changed, 81 insertions(+), 20 deletions(-)

Please remember to separate patches according to directories whenever
possible.  See HACKING for more details.  This should be two patches,
one for include and one for emulator.

> 
> diff --git a/include/emulator.h b/include/emulator.h
> index 5cd894b..a7fc23b 100644
> --- a/include/emulator.h
> +++ b/include/emulator.h
> @@ -105,6 +105,24 @@ enum ofono_emulator_request_type ofono_emulator_request_get_type(
>  void ofono_emulator_set_indicator(struct ofono_emulator *em,
>  					const char *name, int value);
>  
> +ofono_bool_t ofono_emulator_setup_ppp(struct ofono_emulator *em, int fd,
> +				const char *server_ip, const char *peer_ip,
> +				const char *primary_dns,
> +				const char *secondary_dns);
> +
> +int ofono_emulator_get_uid(struct ofono_emulator *em);
> +

I'm not particularly happy with this, we should try to de-couple the
private network provider from the emulator.  We might end up with other
consumers later.

> +struct emulator_network_provision_driver {
> +	char *name;
> +	int (*get_settings)(struct ofono_emulator *em);
> +	void (*release)(int uid);
> +};
> +

I'd say you're on the right track here, but modeling this even closer to
gprs-provision might be a good idea.  Except you'll need to use a
callback, so something like:

struct ofono_private_network_settings {
	...
};

typedef (ofono_private_network_cb_t)(...);

struct ofono_private_network_driver {
	char *name;
	int (*request)(ofono_private_network_cb_t cb, void *data);
	void (*release)(int id);
};

> +int ofono_emulator_network_driver_register(
> +			const struct emulator_network_provision_driver *d);
> +void ofono_emulator_network_driver_unregister(
> +			const struct emulator_network_provision_driver *d);
> +

And then add __ofono_private_network_request / release to src/ofono.h
for now.  Similar to how gprs_provision does things.

>  #ifdef __cplusplus
>  }
>  #endif

Regards,
-Denis

  reply	other threads:[~2011-05-05  4:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03 14:44 [PATCH_v3 0/3] Request private network to ConnMan Guillaume Zajac
2011-05-03 14:44 ` [PATCH_v3 1/3] gatppp: Add new contructor to use external fd Guillaume Zajac
2011-05-05  4:04   ` Denis Kenzior
2011-05-03 14:44 ` [PATCH_v3 2/3] emulator: add drivers to request/release private network from ConnMan Guillaume Zajac
2011-05-05  4:11   ` Denis Kenzior [this message]
2011-05-05  8:38     ` Guillaume Zajac
2011-05-05  8:46       ` Denis Kenzior
2011-05-03 14:44 ` [PATCH_v3 3/3] connman: add plugin in oFono to request request/release private network Guillaume Zajac
2011-05-03 15:06 ` Guillaume Zajac

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=4DC22361.5000906@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