Open Source Telephony
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [patch 5/6] IP support for PPP
Date: Tue, 16 Mar 2010 23:38:33 -0700	[thread overview]
Message-ID: <1268807913.2700.80.camel@localhost.localdomain> (raw)
In-Reply-To: <20100316171324.75e1155d@kcaccard-MOBL3>

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

Hi Kristen,

> Signed-off-by:  Kristen Carlson Accardi <kristen@linux.intel.com>

we don't do signed-off-by statements inside oFono. So please skip these
and fix your .gitconfig.

> Implement IPCP support.  Creates a tun interface to pass IP traffic.

Also even if we would be doing signed-off-by statements, you messed them
up and have it in the wrong order ;)

> 
> ---
>  Makefile.am               |    2 
>  gatchat/gatppp.c          |    2 
>  gatchat/gatppp_internal.h |   12 +
>  gatchat/gatpppnet.c       |  369 ++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 384 insertions(+), 1 deletion(-)

Use gatchat/ppp_net.c here.

> +struct net_data {
> +	GAtPPP *ppp;
> +	char *if_name;
> +	GIOChannel *channel;
> +	struct pppcp_data *ipcp;
> +};
> +

I would prefer if you use struct ppp_net.

> +struct net_data *net_new(GAtPPP *ppp);
> +void net_open(struct net_data *data);
> +void net_free(struct net_data *data);
> +void net_close(struct net_data *data);

These are better ppp_net_new() etc.

> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ ofono/gatchat/gatpppnet.c	2010-03-16 16:22:10.237864764 -0700
> @@ -0,0 +1,369 @@
> +/*
> + *
> + *  AT chat library with GLib integration
> + *
> + *  Copyright (C) 2008-2009  Intel Corporation. All rights reserved.

Now I have to be picky with the copyright headers. Please make sure they
are in sync.

> +/****** IPCP support ****************/
> +enum {
> +	/* supported codes */
> +	IPCP_SUPPORTED_CODES	= (1 << CONFIGURE_REQUEST) |
> +				  (1 << CONFIGURE_ACK) |
> +				  (1 << CONFIGURE_NAK) |
> +				  (1 << CONFIGURE_REJECT) |
> +				  (1 << TERMINATE_REQUEST) |
> +				  (1 << TERMINATE_ACK) |
> +				  (1 << CODE_REJECT),
> +
> +	IPCP_PROTO		= 0x8021,
> +
> +	/* option types */
> +	IP_ADDRESSES		= 1,
> +	IP_COMPRESSION_PROTO	= 2,
> +	IP_ADDRESS		= 3,
> +	PRIMARY_DNS_SERVER	= 129,
> +	SECONDARY_DNS_SERVER	= 131,
> +};

As mentioned before. If you wanna keep enums, please split them into
multiple with comments in front of them. It should be clear that they
represent different things.

> +static guint32 bytes_to_32(guint8 *bytes)
> +{
> +	union addr {
> +		guint8 bytes[4];
> +		guint32 word;
> +	} a;
> +
> +	memcpy(a.bytes, bytes, 4);
> +	return(ntohl(a.word));
> +}

This works, but is pretty ugly.

Doesn't GLib has functions to ensure retrieve unaligned data? BlueZ has
the GCC magic that is required to do this right.

Regards

Marcel



  reply	other threads:[~2010-03-17  6:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100317000824.420232401@linux.intel.com>
2010-03-17  0:13 ` [patch 1/6] Add PPP protocol support with HDLC framing Kristen Carlson Accardi
2010-03-17  6:28   ` Marcel Holtmann
2010-03-17  0:13 ` [patch 2/6] Generic PPP control protocol Kristen Carlson Accardi
2010-03-17  7:06   ` Marcel Holtmann
2010-03-18 23:03     ` Kristen Carlson Accardi
2010-03-19  3:57       ` Marcel Holtmann
2010-03-17  0:13 ` [patch 3/6] LCP support Kristen Carlson Accardi
2010-03-17  7:09   ` Marcel Holtmann
2010-03-17 18:59     ` Kristen Carlson Accardi
2010-03-17 19:31       ` Marcel Holtmann
2010-03-17  0:13 ` [patch 4/6] CHAP with MD5 authentication Kristen Carlson Accardi
2010-03-17  7:12   ` Marcel Holtmann
2010-03-17  0:13 ` [patch 5/6] IP support for PPP Kristen Carlson Accardi
2010-03-17  6:38   ` Marcel Holtmann [this message]
2010-03-18  0:12     ` Kristen Carlson Accardi
2010-03-18 11:26       ` Marcel Holtmann
2010-03-19 17:58         ` Kristen Carlson Accardi
2010-03-17  0:13 ` [patch 6/6] Allow gsmdial to use gatchat ppp support Kristen Carlson Accardi
2010-03-17  6:42   ` Marcel Holtmann
2010-03-23  0:05 [PATCH 0/6] PPP Patches v3 Kristen Carlson Accardi
2010-03-23  0:06 ` [PATCH 5/6] IP support for PPP Kristen Carlson Accardi
     [not found] <20100319194705.214150215@linux.intel.com>
2010-03-19 19:46 ` [patch " Kristen Carlson Accardi
     [not found] <20100311214022.838696145@linux.intel.com>
2010-03-11 22:00 ` kristen
2010-03-14 20:22   ` Marcel Holtmann
2010-03-16 22:53     ` Kristen Carlson Accardi
2010-03-17  4:39       ` Marcel Holtmann

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=1268807913.2700.80.camel@localhost.localdomain \
    --to=marcel@holtmann.org \
    --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