freeipmi-devel
[Top][All Lists]
Advanced

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

Re: [llnl-devel] Re: [Freeipmi-devel] kcs byte array model - validation


From: Anand Babu
Subject: Re: [llnl-devel] Re: [Freeipmi-devel] kcs byte array model - validation
Date: Thu, 11 Dec 2003 15:59:04 -0800
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

,----[ "Mark A. Grondona" <address@hidden> ]
| Will user's of the freeipmi API be calling the marshall and unmarshall
| functions directly? If so, you might want to think about whether that
| is strictly necessary. A nice API would abstract marshall/buffer/send
| operations from the user, so they do not even have to worry that their
| structure/request is being packed up for the network. An especially
| nice API would wrap your two operations above into one:
| 
|  /* send a request foo to the foo server s */ foo_send_req
|  (foo_server_t s, struct foo_req_t * foo);
| 
| This hides the actual protocol implementation from the user of the
| API, who frankly doesn't care how the data gets from here to there.
| 
| In this case, the argument of whether to use a buffer allocated on the
| heap or the stack is irrelevant. In fact, it could change without
| breaking the API.
| 
| If the API user needs to do something between marshalling the packet
| data and sending it over the wire, and thus the above abstraction
| won't work, you might want to think about why they need to do that,
| and whether you can alleviate their need in some other way.
`----
Excellent suggestion. 
And 
Instead of marshalling from within send_pkt, we can do it inside
assemble_pkt function which constructs pkt from header, command and
data.

-- 
 _.|_ 
(_||_)
Free as in Freedom <www.gnu.org>




reply via email to

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