[pisa-src] Re: r1588 - trunk/community-operator/hipl.c

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Mon, 09 Nov 2009 14:21:47 +0100

On Mon, Nov 09, 2009 at 01:58:03PM +0100, Thomas Jansen wrote:
> On Mon, Nov 09, 2009 at 01:34:16PM +0100, Diego Biurrun wrote:
> > > + * Initialize a new packet. This has to be the first function called 
> > > after
> > > + * hip_msg_alloc as we reset the packet size to indicate that no 
> > > parameter has
> > > + * been added yet.
> > 
> > .. which makes me wonder why hip_msg_alloc does not take care of this ..
> 
> hip_msg_alloc just allocates a buffer and memsets it to 0. hip_build_user_hdr
> takes such a generic buffer and initializes the HIP packet within. It's not
> necessary with our current use of those functions to separate both steps.
> However the separation is quite useful if you want to receive such a message
> and just need a buffer. As you read the packet from the socket the basic HIP
> packet layout created by hip_build_user_hdr would be overwritten.
> 
> If the implementation of the HIPL interface remains this specialized we can
> merge these functions, if someone were to pick it up from here and extend
> this stub to be a complete library the separation might come in handy.

I would think that HIPL itself rather than PISA would serve as the basis
for such an endeavour.  Thus, if a merger simplifies the usage of these
functions, I think we would benefit from it.

Diego

Other related posts: