From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [patch 5/6] IP support for PPP
Date: Tue, 16 Mar 2010 21:39:09 -0700 [thread overview]
Message-ID: <1268800749.2700.34.camel@localhost.localdomain> (raw)
In-Reply-To: <20100316155344.5d0dd744@kcaccard-MOBL3>
[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]
Hi Kristen,
> > > +/****** 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,
> > > +};
> >
> > I don't think enum is the right way for this. I can see it for the
> > option types, but for IPCP_PROTO and IPCP_SUPPORTED_CODES. I would say
> > just using simple defines is way better.
> >
> > Feel free to convince me other way or show me what I have missed here.
>
> It's mostly just a habit, but in general there are advantages to
> using enum vs. a define. You are assured that the scope is kept local,
> even if you are uncreative with your name choices, whereas with a macro
> it is not. Also it's sometimes easier to debug with an enum vs. a macro.
> I can certainly change it if you really want me too.
I have nothing against enums. I actually like them a lot if used
correctly, because gcc and gdb does make your life easier.
The thing that I dislike is clashing namespaces and scopes in just one
enum. In the example of both you mix two or more things that should at
least in different enums.
Regards
Marcel
next prev parent reply other threads:[~2010-03-17 4:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100311214022.838696145@linux.intel.com>
2010-03-11 22:00 ` [patch 1/6] Add PPP protocol support with HDLC framing kristen
2010-03-12 2:17 ` Denis Kenzior
2010-03-15 22:04 ` Kristen Carlson Accardi
2010-03-15 22:20 ` Denis Kenzior
2010-03-12 2:24 ` Denis Kenzior
2010-03-12 6:51 ` Marcel Holtmann
2010-03-11 22:00 ` [patch 2/6] Generic PPP control protocol kristen
2010-03-11 22:00 ` [patch 3/6] LCP support kristen
2010-03-11 22:00 ` [patch 4/6] CHAP with MD5 authentication kristen
2010-03-11 22:00 ` [patch 5/6] IP support for PPP kristen
2010-03-14 20:22 ` Marcel Holtmann
2010-03-16 22:53 ` Kristen Carlson Accardi
2010-03-17 4:39 ` Marcel Holtmann [this message]
2010-03-11 22:00 ` [patch 6/6] Allow gsmdial to use gatchat ppp support kristen
2010-03-14 20:02 ` Marcel Holtmann
2010-03-16 23:52 ` Kristen Carlson Accardi
[not found] <20100317000824.420232401@linux.intel.com>
2010-03-17 0:13 ` [patch 5/6] IP support for PPP Kristen Carlson Accardi
2010-03-17 6:38 ` Marcel Holtmann
2010-03-18 0:12 ` Kristen Carlson Accardi
2010-03-18 11:26 ` Marcel Holtmann
2010-03-19 17:58 ` Kristen Carlson Accardi
[not found] <20100319194705.214150215@linux.intel.com>
2010-03-19 19:46 ` Kristen Carlson Accardi
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
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=1268800749.2700.34.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