9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] OUdphdr
@ 2007-05-06 14:58 erik quanstrom
  2007-05-06 17:09 ` Russ Cox
  0 siblings, 1 reply; 2+ messages in thread
From: erik quanstrom @ 2007-05-06 14:58 UTC (permalink / raw)
  To: 9fans

the comment in this diff confuses me.  is OUdphdr now used
for ip6 as opposed to Udphdr?  i guess i don't quite understand
the emphasis on v6 since plan 9 represents all ip addresses as v6.

also, why are there two udp packet formats defined?

- erik

  enum 
/n/sources/plan9//sys/include/ip.h:74,87 - ip.h:74,87
  typedef struct OUdphdr OUdphdr;
  struct OUdphdr
  {
- 	uchar	raddr[IPaddrlen];	/* V6 remote address */
- 	uchar	laddr[IPaddrlen];	/* V6 local address */
- 	uchar	rport[2];		/* remote port */
- 	uchar	lport[2];		/* local port */
+ 	uchar	raddr[IPaddrlen];	/* remote address and port */
+ 	uchar	laddr[IPaddrlen];	/* local address and port */
+ 	uchar	rport[2];
+ 	uchar	lport[2];
  };



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] OUdphdr
  2007-05-06 14:58 [9fans] OUdphdr erik quanstrom
@ 2007-05-06 17:09 ` Russ Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Russ Cox @ 2007-05-06 17:09 UTC (permalink / raw)
  To: 9fans

> the comment in this diff confuses me.  is OUdphdr now used
> for ip6 as opposed to Udphdr?  i guess i don't quite understand
> the emphasis on v6 since plan 9 represents all ip addresses as v6.
> 
> also, why are there two udp packet formats defined?
> 
> - erik
> 
>   enum 
> /n/sources/plan9//sys/include/ip.h:74,87 - ip.h:74,87
>   typedef struct OUdphdr OUdphdr;
>   struct OUdphdr
>   {
> - 	uchar	raddr[IPaddrlen];	/* V6 remote address */
> - 	uchar	laddr[IPaddrlen];	/* V6 local address */
> - 	uchar	rport[2];		/* remote port */
> - 	uchar	lport[2];		/* local port */
> + 	uchar	raddr[IPaddrlen];	/* remote address and port */
> + 	uchar	laddr[IPaddrlen];	/* local address and port */
> + 	uchar	rport[2];
> + 	uchar	lport[2];
>   };

Don't worry about the comment.  
It's just a clarification (since obviously
raddr doesn't have a port in it).
Nothing has actually changed in the format.

As the name suggests, OUdphdr is old and 
obsolete.  The new Udphdr added the interface
where the packet came in, which is needed for
things like dhcpd.  

There are two formats because the user space
programs and kernels couldn't be updated all
in one go.  Now that the kernels with the new
headers have propagated, the programs
that still use the old header format should really be
changed to use the new format.  Those programs
appear to be just ip/dhcpclient, ip/ipconfig,
ip/rip, and ip/udpecho.  But like a lot of Plan 9 
maintenance, it just never happened.

Russ




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-06 17:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-06 14:58 [9fans] OUdphdr erik quanstrom
2007-05-06 17:09 ` Russ Cox

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).