netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rod Van Meter <Rod.VanMeter@nokia.com>
To: ext Adrian Bunk <bunk@fs.tum.de>
Cc: davem@redhat.com, netdev@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: Re: Chaotic structure of the net headers?
Date: 05 Mar 2003 15:10:35 -0800	[thread overview]
Message-ID: <1046905834.17778.400.camel@localhost.localdomain> (raw)
In-Reply-To: <20030305225441.GO20423@fs.tum.de>

On Wed, 2003-03-05 at 14:54, ext Adrian Bunk wrote:

> 
> There's some duplication, e.g. include/linux/in6.h contains
> 
> /*
>  *      IPV6 extension headers
>  */
> #define IPPROTO_HOPOPTS         0       /* IPv6 hop-by-hop options      */
> #define IPPROTO_ROUTING         43      /* IPv6 routing header          */
> #define IPPROTO_FRAGMENT        44      /* IPv6 fragmentation header    */
> #define IPPROTO_ICMPV6          58      /* ICMPv6                       */
> #define IPPROTO_NONE            59      /* IPv6 no next header          */
> #define IPPROTO_DSTOPTS         60      /* IPv6 destination options     */


According to RFC2292 (Advanced Sockets):

2.1.1.  IPv6 Next Header Values

   IPv6 defines many new values for the Next Header field.  The
   following constants are defined as a result of including
   <netinet/in.h>.

   #define IPPROTO_HOPOPTS        0 /* IPv6 Hop-by-Hop options */
   #define IPPROTO_IPV6          41 /* IPv6 header */
   #define IPPROTO_ROUTING       43 /* IPv6 Routing header */
   #define IPPROTO_FRAGMENT      44 /* IPv6 fragmentation header */
   #define IPPROTO_ESP           50 /* encapsulating security payload */
   #define IPPROTO_AH            51 /* authentication header */
   #define IPPROTO_ICMPV6        58 /* ICMPv6 */
   #define IPPROTO_NONE          59 /* IPv6 no next header */
   #define IPPROTO_DSTOPTS       60 /* IPv6 Destination options */

   Berkeley-derived IPv4 implementations also define IPPROTO_IP to be 0.
   This should not be a problem since IPPROTO_IP is used only with IPv4
   sockets and IPPROTO_HOPOPTS only with IPv6 sockets.


> 
> and include/net/ipv6.h contains:
> 
> <--  snip  -->
> 
> /*
>  *      NextHeader field of IPv6 header
>  */
> 
> #define NEXTHDR_HOP             0       /* Hop-by-hop option header. */
> #define NEXTHDR_TCP             6       /* TCP segment. */
> #define NEXTHDR_UDP             17      /* UDP message. */
> #define NEXTHDR_IPV6            41      /* IPv6 in IPv6 */
> #define NEXTHDR_ROUTING         43      /* Routing header. */
> #define NEXTHDR_FRAGMENT        44      /* Fragmentation/reassembly header. */

This form doesn't appear in RFC2292, nor in 2133 (Basic Socket...)

My interpretation is that this latter form is defined for kernel use,
while the former is for user-level manipulation of raw packet fields
(the primary purpose of 2292).

Does it make sense to have two forms, one kernel, one user?  I haven't
e.g. followed the desired include chain.  If we wanted to merge the
uses, the former form and include location would probably have to be
used.

I've been looking into this.  There are a *few* things missing from the
2292 support.  AFAICT, it's just a handful of functions/macros for
manipulating option headers that need to be added.

Does anybody actually USE this stuff (the advanced sockets API, I mean,
not IPv6)?  I'm planning to add those missing bits, just for kicks, but
haven't done it yet.

			--Rod

  parent reply	other threads:[~2003-03-05 23:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-05 22:54 Chaotic structure of the net headers? Adrian Bunk
2003-03-05 22:39 ` David S. Miller
2003-03-05 23:10 ` Rod Van Meter [this message]
2003-03-05 23:03   ` David S. Miller
2003-03-05 23:53   ` Richard Guy Briggs

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=1046905834.17778.400.camel@localhost.localdomain \
    --to=rod.vanmeter@nokia.com \
    --cc=bunk@fs.tum.de \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    /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;
as well as URLs for NNTP newsgroup(s).