On Sun, Jul 02, 2000 at 09:40:06AM +0200, Yaniv Kaul wrote:
> Attached is the Config draft from which I've taken the data.
> 1. reserved2 is 1 byte long only!
> 2. identifier is indeed in network order and should be converted.
...and length is, as I suspected, 2 bytes long:
3.2. Attribute Payload
A new payload is defined to carry attributes as well as the type of
transaction message.
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Next Payload ! RESERVED ! Payload Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Type ! RESERVED ! Identifier !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! !
~ Attributes ~
! !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
so
struct cfg_hdr {
guint8 next_payload;
guint8 reserved;
guint8 length[2];
guint8 type;
guint8 reserved2;
guint8 identifier[2];
};
which is what I checked in (and which is in my patch), is correct.
> 3. What about cert_hdr structure? It is identical to certreq_hdr structure,
> so possibly "suffers" from the same problem.
The code I checked in (and put in the patch) changes all the headers to
use arrays of "guint8" to represent integral fields bigger than 2 bytes,
so "cert_hdr" is
struct cert_hdr {
guint8 next_payload;
guint8 reserved;
guint8 length[2];
guint8 cert_enc;
};