freeipmi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freeipmi-devel] libfreeipmi struct/pack(1) vs byte array


From: Albert Chu
Subject: Re: [Freeipmi-devel] libfreeipmi struct/pack(1) vs byte array
Date: Fri, 05 Dec 2003 13:38:51 -0800

> In struct model:
> The data type of the member will remain as word (u_int16_t) or
> dword (u_int32_t). Macros will just swap the order of LS and MS bytes
> based on the platform endianess. Take a look at endian.h and
> bits/endian.h

I think we're using the same term to mean different things.  According
to webopedia.com, marshalling is "gathering data and transforming it
into a standard format" and unmarshalling "the receiving computer
converts the marshaled data back into an object."  So to me, using 
"htonl" and "ntohl" type functions is indeed marshalling &
unmarshalling, even though the data may still be in the struct ...

Oh well, we're on the same page now anyways ...

> Without #pragma pack(1), I cannot predict if this is byte-alignment or
> byte-ordering problem.
> 
> Can you do a sizeof (foo) under AIX and tell me?

On both machines foo is 1 byte ... 
 
> I will post a libfreeipmi byte-array model reference code before I
> begin my work, in a separate email thread.

Ok ... start it in a new thread and we'll iterate.  Note that I still
want to keep all of the ipmi_session_t and ipmi_get_session_challenge_t
structures in their current format.  We should only use marshall()
functions to read the data out of those structures and copy that data
into a buffer.  unmarhall() does the opposite and puts it in the structure.

Here's a list of things that need to be done.  List it in the new thread
and we'll decide who does what.  We need to coordinate since Savannah is
still wacky ...

ping assemble / pong disassemble

marshall/unmarshall for each packet type

lan packet checksum functions - need to check both checksums

lan packet checksum functions - can it be generic?  Or do we need one
for each packet type??  I am thinking the later ... 
   - checksum functions will have to use marshall/unmarshall functions
     to check checksums properly.

assemble_lan_header_data - the function that creates the RMCP,
session_t, and request_t stuff.

remove pragma stuff

fix macros, ipmi-debug, etc. etc.

Al

--
Albert Chu
address@hidden
Lawrence Livermore National Laboratory







reply via email to

[Prev in Thread] Current Thread [Next in Thread]