Subject: [Tsvwg] SCTP API: sctp_assoc_t / structure element alignment

From: Mark Butler <[email-masked]>
Date: Fri, 03 Mar 2006 19:59:44 -0700

One more issue - why is the type sctp_assoc_t defined, and in 
particular used as the layout type in all the different structure 
fields.  The main problem is one of structure alignment.  Many 
environments have a need to present a uniform ABI between 32 bit and 64 
bit applications, which means that the size of any structure fields 
cannot vary.  So "short", "int" and "long" are out, as far as structure 
elements are concerned.

The problem with leaving the width of the association_id fields 
unspecified is it makes it difficult to order fields for portable (and 
efficient) alignment when defining new structures.  struct 
sctp_sndrcvinfo has a wasted 16bit slot right after sinfo_flags under a 
normal alignment scheme - otherwise the succeeding 32-bit fields are 
unaligned.

There is also an aesthetic issue - fields of type "sctp_assoc_t" 
currently have a jagged column alignment in the documentation.  This 
will look worse when new fields are added after it. (How did it always 
end up at the end anyway?)

Question: Are there any platforms that define sctp_assoc_t as something 
other than a 32-bit quantity? 

I would like to see sctp_assoc_t be deprecated and replaced with either 
int32_t or uint32_t.  Surely no one is going to run several billion 
associations simultaneously.

 - Mark

_______________________________________________
tsvwg mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/tsvwg