[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freeipmi-devel] Re: [llnl-devel] New FreeIPMI API thouoghts
From: |
Anand Babu |
Subject: |
Re: [Freeipmi-devel] Re: [llnl-devel] New FreeIPMI API thouoghts |
Date: |
Fri, 05 Dec 2003 11:16:35 -0800 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
Albert Chu <address@hidden> writes:
>> >assemble_pkt(rmcp_hdr_t *rmcp_hdr, ipmi_session_t *ipmi_session,
>> > ipmi_request_hdr_t *ipmi_rq, void *ipmi_cmd, int
>> > ipmi_cmd_len, void *buffer, int buflen);
>> >
>> >To some extent mirror the unassemble functions.
>>
>> You mean assemble_pkt will only memcpy those structures into a
>> byte-array and we will have to fill the values from outside?
>
> That or the assemble_pkt function returns the data it put into the
> buffer into the rmcp_hdr, ipmi_session header, and ipmi_request header.
> Right now, the user has no way to access the session header, request
> header, or rmcp header information. I think that is completely
> unacceptable. Most of the time, a user/we won't need to access that
> information. But the first time that we need to, we're screwed ...
If we want to fill data outside assemble function, we will do
something like this
make header
make command
assemble lan pkt
send
Example:
ipmi_lan_header_rq (IPMI_SESSION_AUTH_TYPE_STRAIGHT_PASSWD_KEY,
inbound_seq_num, session_id, passwd, IPMI_SESSION_MAX_AUTH_CODE_LEN,
fn, lun, session_seq_num, &rmcp_hdr, &session, &msg);
ipmi_chassis_ctrl_rq (chassis_ctrl, &cmd);
assemble_ipmi_lan_rq_pkt (rmcp_hdr, session, msg, &cmd, cmd_len, lan_pkt,
lan_pkt_len);
status = ipmi_lan_sendto (sockfd, lan_pkt, lan_pkt_len, 0, (struct
sockaddr *)&to_addr, sizeof (struct sockaddr_in));
What do you think of this interface?
--
_.|_
(_||_)
Free as in Freedom <www.gnu.org>