All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCHv2 2/6] gatppp: Add IPv6 CP hooks
Date: Tue, 15 Nov 2011 07:59:07 -0600	[thread overview]
Message-ID: <4EC2702B.7030308@gmail.com> (raw)
In-Reply-To: <4EC3AF04.7030804@intel.com>

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

Hi Oleg,

>>> +gboolean g_at_ppp_set_ipv6cp_info(GAtPPP *ppp, gboolean is_server,
>>> +                    const char *local, const char *peer);
>>
>> So for consistency sake I think we should introduce
>> g_at_ppp_set_ipv6_server_info(GAtPPP *ppp, const char *remote_prefix);
>>
>> For the local prefix, I'm leaning towards creating a new set of v6 and
>> dual-stack specific constructors:
>>
>> g_at_ppp_ipv6_new(const char *local_prefix);
>> g_at_ppp_ipv6_server_new(const char *local_prefix);
>> g_at_ppp_ipv4v6_new(const char *local_prefix);
>> g_at_ppp_ipv4v6_server_new(const char *local_ip, const char
>> *local_prefix);
>>
>> The key difference between constructors being whether to create ipcp,
>> ipv6cp or both.  We might need a _full version of the server
>> constructors as well.  I'm not entirely happy with this, so if you have
>> better ideas, I'd love to hear them.
> 
> That looks OK to me. Regarding alternatives, one would be:
> 
> enum ofono_ppp_proto {
>     OFONO_PPP_PROTO_IP     = 0x1,
>     OFONO_PPP_PROTO_IPV6   = 0x2,
>     OFONO_PPP_PROTO_IPV4V6 = 0x4,
> };
> 
> struct _GAtPPP {
>     [...]
>     guint8 proto;
> };
> 
> g_at_ppp_new(guint8 proto);
> 
> or/and
> 
> g_at_ppp_set_proto(GAtPPP *ppp, guint8 proto, ...);
> 
> The usage would be:
> 
> - IPv4 only:
> 
>     g_at_ppp_new(OFONO_GPRS_PROTO_IP);
> 
> - IPv6 only:
> 
>     g_at_ppp_new(OFONO_GPRS_PROTO_IPV6);
> 
> - IPv4v6, both optional, but at least one is mandatory:
> 
>     g_at_ppp_new(OFONO_GPRS_PROTO_IPV4V6);
> 
> - IPv4v6, both mandatory:
> 
>     g_at_ppp_new(OFONO_GPRS_PROTO_IPV4V6 |
>          OFONO_GPRS_PROTO_IP | OFONO_GPRS_PROTO_IPV6);
> 
> - IPv4v6, IPv4 mandatory:
> 
>     g_at_ppp_new(OFONO_GPRS_PROTO_IPV4V6 | OFONO_GPRS_PROTO_IP);
> 
> and so on.
> 
> For g_at_ppp_set_proto(GAtPPP *ppp, guint8 proto, ...) there might be
> optional parameters (one IPv4/IPv6 local address or both IPv4 and IPv6
> local addresses), depending on the need. And similarly for
> g_at_ppp_set_server_info().
> 

There are some interesting ideas here, but I want to keep the API
changes and the impact on existing code minimal for now.  This means not
touching the original API if possible.

Besides, we simply don't know if we need all this flexibility, so lets
just consider the ipv4 only, ipv6 only and both ipv4 and ipv6 being
required as use cases we want to address.

Regards,
-Denis

  reply	other threads:[~2011-11-15 13:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08 12:46 [PATCHv2 0/6] gatchat IPv6 CP support Oleg Zhurakivskyy
2011-11-08 12:46 ` [PATCHv2 1/6] gatchat: Add IPv6 Control Protocol Oleg Zhurakivskyy
2011-11-07 18:26   ` Denis Kenzior
2011-11-14  9:03     ` Oleg Zhurakivskyy
2011-11-13 21:29       ` Denis Kenzior
2011-11-08 12:46 ` [PATCHv2 2/6] gatppp: Add IPv6 CP hooks Oleg Zhurakivskyy
2011-11-15  2:53   ` Denis Kenzior
2011-11-16 12:39     ` Oleg Zhurakivskyy
2011-11-15 13:59       ` Denis Kenzior [this message]
2011-11-17  8:05         ` Oleg Zhurakivskyy
2011-11-08 12:46 ` [PATCHv2 3/6] gsmdial: Add IPv6 CP option Oleg Zhurakivskyy
2011-11-08 12:46 ` [PATCHv2 4/6] test-server: Add IPv6 CP options Oleg Zhurakivskyy
2011-11-08 12:46 ` [PATCHv2 5/6] gatppp: Add IPv6 CP connect, disconnect callbacks Oleg Zhurakivskyy
2011-11-15  2:59   ` Denis Kenzior
2011-11-16 14:05     ` Oleg Zhurakivskyy
2011-11-15 13:43       ` Denis Kenzior
2011-11-17  8:10         ` Oleg Zhurakivskyy
2011-11-08 12:46 ` [PATCHv2 6/6] gsmdial: Add IPv6 CP connect hook Oleg Zhurakivskyy

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=4EC2702B.7030308@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.