Subject: (IPng 6596) Re: Basic API; "struct in6_addr" section needs to mention alignment issues

From: Mukesh Kacker <[email-masked]>
Date: Wed, 7 Oct 1998 08:53:36 -0700 (PDT)

> >struct in6_addr {
> >	union {
> >		uint8_t _S6_b[16];
> >		uint32_t _S6_w[4];
> >		uint64_t _S6_l[2];
> >	} _S6_un;
> >};
> >#define	s6_addr	_S6_un._S6_b
> 
> I can add as "EXAMPLE" the folks at the time doing Cray words did not
> want it to be specified in this manner with the union.  But as an
> example that is fine, but we need to leave in6_addr as defined now.
> 

Jim,

If I get what you above correctly....Cray had problems with hints of "word"
implying 32 bits. The hint for "long" and its size has a history too...

Here is a variation on Tim's example which might avoid those issues....
It uses union field names _S6_u8, _S_u32, _S_u64 instead of those with
letters derived from byte, word, long etc. [ I know...this is getting a bit
into field naming issues Tim warned about :-)]. If this is controversial,
feel free to drop the idea.

Thus the EXAMPLE implementation variation I am suggesting would look like.

struct in6_addr {
     union {
         uint8_t  _S6_u8[16];
         uint32_t _S6_u32[4];
         uint64_t _S6_u64[2];
     } _S6_un;
};
#define	s6_addr	_S6_un._S6_u8

-Mukesh Kacker
 [email-masked]

--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page:                      http://playground.sun.com/ipng
FTP archive:                      ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [email-masked]
--------------------------------------------------------------------

---

From: Jim Bound IPv6 Technical Leader UNIX Engineering Internet Group <[email-masked]>
Date: Wed, 07 Oct 1998 23:04:42 -0400

Sounds good to me I like the value better than the letter.

thanks
/jim