freeipmi-devel
[Top][All Lists]
Advanced

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

Re: RE: RE: [Freeipmi-devel] Using libfreeipmi interface


From: Albert Chu
Subject: Re: RE: RE: [Freeipmi-devel] Using libfreeipmi interface
Date: Thu, 28 Oct 2004 17:04:04 -0700

> I also found a problem with the  IPMI_LAN_SEQ_NUM_MAX (=0x3F).
> There isn't any precedent in IPMI 1.5 for this, and limiting the 32-
> bitsequence number to 6 bits causes some problems, since the BMC 
> LAN won't handle wrapping the sequence number back to 0 or 1 after 63 
> (0x3f).

I'm not quite convinced this is a problem.  The bounds check makes the
user knowledgeable to the fact that arbitrary sequence numbers aren't
allowed.  I spoke to a few other developers I work with, and they feel
that the bounds checking is more appropriate.  Ab, Ian, Bala, what are
your thoughts??

> Also, the line that uses ipmi_comp_test to return -1 if the 
> comp_code != 0 is an issue.

Agreed.  

AB, we might want to do mini-audit over the use of the ERR() macro.  I
removed some instances of it before because I didn't think they were
appropriate for all error situations.

Al

--
Albert Chu
address@hidden
Lawrence Livermore National Laboratory

----- Original Message -----
From: "Cress, Andrew R" <address@hidden>
Date: Thursday, October 28, 2004 3:07 pm
Subject: RE: RE: [Freeipmi-devel] Using libfreeipmi interface

> Al,
> 
> I also found a problem with the  IPMI_LAN_SEQ_NUM_MAX (=0x3F).
> There isn't any precedent in IPMI 1.5 for this, and limiting the 32-
> bitsequence number to 6 bits causes some problems, since the BMC 
> LAN won't
> handle wrapping the sequence number back to 0 or 1 after 63 (0x3f).
> 
> Also, the line that uses ipmi_comp_test to return -1 if the 
> comp_code !=
> 0 is an issue.
> There has to be a way for the calling app to tell the difference 
> betweena command that never got completed (-1), and one that got 
> completed, but
> the BMC is reporting back something about why it didn't like it
> (comp_code).  I changed this code to return the comp_code, rather than
> -1, which should satisfy everyone.  If not, it could return -2 
> instead,and the app would then be able to check obj_cmd_rs[1].
> 
> So, the 3 changes I made to ipmi-lan-interface.c are attached.
> If these changes are made, my apps will run with KCS and LAN 
> interfaces.
> Andy
> 
> -----Original Message-----
> From: Albert Chu [mailto:address@hidden 
> Sent: Thursday, October 28, 2004 12:20 PM
> To: Cress, Andrew R
> Cc: address@hidden
> Subject: Re: RE: [Freeipmi-devel] Using libfreeipmi interface
> 
> 
> Hi Andrew,
> 
> You're right that it needs to be initialized, but I think it has to be
> initialized to sizeof(struct sockaddr_in).  _pkt_len is probably a 
> largeenough size that it just happened to work. 
> 
> Thanks for the catch 
> 
> Al
> 
> --
> Albert Chu
> address@hidden
> Lawrence Livermore National Laboratory
> 
> ----- Original Message -----
> From: "Cress, Andrew R" <address@hidden>
> Date: Wednesday, October 27, 2004 2:09 pm
> Subject: RE: [Freeipmi-devel] Using libfreeipmi interface
> 
> > Albert,
> > 
> > I did find the problem that was causing the recvfrom to abort.
> > 
> > In libfreeipmi/src/ipmi-lan-interface.c at about line 699:
> >    fromlen = _pkt_len;  /* added this, fromlen must be 
> initialized */
> >    pkt_len = ipmi_lan_recvfrom (sockfd, pkt, _pkt_len, 0, 
> >                                 (struct sockaddr *)&from, &fromlen);
> > There may be other places that call recvfrom where this change 
> > would be
> > needed also.
> > 
> > It works now, if the app is careful with sequence numbers.
> > 
> > Andy
> > 
> > -----Original Message-----
> > From: address@hidden
> > [mailto:address@hidden On
> > Behalf Of Cress, Andrew R
> > Sent: Wednesday, October 27, 2004 2:07 PM
> > To: Albert Chu
> > Cc: address@hidden
> > Subject: RE: [Freeipmi-devel] Using libfreeipmi interface
> > 
> > 
> > Albert,
> > 
> > I have been able to get the kcs interface working with the FreeIPMI
> > library, but not yet the  LAN interface.  I'm using
> > ipmi_lan_open_session() and ipmi_lan_cmd(), and I put in some debug
> > statements in ipmi-lan-interface.c.
> > The ipmi_lan_open_session fails at the Get_Session_Challenge command
> > response.
> > I'm confused as to why ipmi_lan_recvfrom returns -1 for this 
> command.> The ipmipower app does get status ok, but gets "invalid 
> authtype" 
> > tryingto reset.
> > The remote node does respond to BMC LAN commands via other (Intel)
> > server management applications, and I've included its configuration
> > information below.
> > 
> > Attempting to open_session to remote node:
> > assemble_ipmi_lan_pkt complete cmd=38
> > ipmi_lan_sendto status = 23
> > ipmi_lan_recvfrom len = 30
> > unassemble complete
> > get_chan_auth rsp: 38 00 07 17 01 00 00 00 00 00
> > ipmi_comp_test complete status = 1
> > assemble_ipmi_lan_pkt complete cmd=39
> > get_sess_chal rq: 39 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
> > 00 00
> > ipmi_lan_sendto status = 38
> > ipmi_lan_recvfrom len = -1
> > ipmi_lan_open_session: rv = -1 id=0
> > 
> > BMC LAN Configuration of remote node:
> > Lan Param(0) Set in progress: 00
> > Lan Param(1) Auth type support: 17
> > Lan Param(2) Auth type enables: 17 17 06 06 00
> > Lan Param(3) IP address: 10 243 42 182
> > Lan Param(4) IP addr src: 01
> > Lan Param(5) MAC addr: 00 03 47 94 ff 46
> > Lan Param(6) Subnet mask: 255 255 255 0
> > Lan Param(7) IPv4 header: 40 40 10
> > Lan Param(10) BMC grat ARP : 01
> > Lan Param(11) grat ARP interval: 04
> > Lan Param(12) Def gateway IP: 10 243 42 251
> > Lan Param(13) Def gateway MAC: 00 05 9a da d3 fc
> > Lan Param(14) Sec gateway IP: 0 0 0 0
> > Lan Param(15) Sec gateway MAC: 00 00 00 00 00 00
> > Lan Param(16) Community string: public
> > Lan Param(17) Num dest: 04
> > Lan Param(18) Dest type: 01 00 01 00 69
> > Lan Param(19) Dest address: 01 00 00 [10 243 42 182] 00 03 47 94 
> ff 46
> > Lan Param(192) DHCP Server IP: 0 0 0 0
> > Lan Param(193) DHCP MAC Address: 00 00 00 00 00 00
> > Lan Param(194) DHCP Enable: 00
> > GetChanAcc(lan), ret = 0, new value = 02
> >  Access = Always Avail, PEF Alerts Enabled
> > Lan Param(201) Channel Access Mode(Lan): 02 04
> > Get User Access(1): 04 01 00 14
> > 
> > -----Original Message-----
> > From: Albert Chu [mailto:address@hidden 
> > Sent: Monday, October 25, 2004 5:11 PM
> > To: Cress, Andrew R
> > Cc: address@hidden
> > Subject: Re: [Freeipmi-devel] Using libfreeipmi interface
> > 
> > 
> > Hi Andrew,
> > 
> > Thanks for trying to support libfreeipmi with ipmiutil.  I think 
> a 
> > goodplace to start off for how to use the LAN interface would be
> > libfreeipmi/src/ipmi-ping.c and ipmiping/src/ipmiping.c. The code in
> > ipmi-ping.c is a wrapper for a generic send/select/read loop that is
> > common to ipmiping and rmcpping.  The code in ipmiping.c contains 
> the> code to construct and parse packets.  You should be able to 
> see how
> > packets are constructed, sent, read packets with arbitrary buffer 
> > sizes.and parsed/checked.
> > 
> > For KCS, the construction/parsing of packets is similar.  You 
> just 
> > needto call ipmi_kcs_cmd() or ipmi_kcs_cmd_interruptible() 
> instead of
> > ipmi_lan_sendto() and ipmi_lan_recvfrom().  I'm not sure of 
> situations> where you may get a response from the BMC of arbitrary 
> size when 
> > workingin-band.  Presumably everything will be bounded by some 
> > length, and we
> > have accounted for those varying lengths in the templates
> > (fiid_template_t types).  Is there is a situation that you are
> > encountering this issue?  I suppose we could create a helper 
> function> that allocates space based on an integer parameter rather 
> than a
> > template parameter. AB?? Ian??
> > 
> > I'm not sure about AB's schedule for putting out a hackers guide. 
> I
> > will put libfreeipmi examples onto our collective todo list.
> > 
> > Al
> > 
> > --
> > Albert Chu
> > address@hidden
> > Lawrence Livermore National Laboratory
> > 
> > ----- Original Message -----
> > From: "Cress, Andrew R" <address@hidden>
> > Date: Monday, October 25, 2004 1:34 pm
> > Subject: [Freeipmi-devel] Using libfreeipmi interface
> > 
> > > Hi,
> > > 
> > > I have some IPMI Management Utilities which currently support 3 
> > > types of
> > > IPMI drivers, and I'd like to add support for libfreeipmi also. 
> 
> > These> utilities have the IPMI commands already composed.   See
> > > http://ipmiutil.sf.net
> > > I did download version 0.1.0 and build it on my system, and bmc-
> > info,> bmcpower, and bmcping seem to work ok.  
> > > 
> > > Looking at the freeipmi-hackers-intro.pdf, it looks like I need 
> more> > information about the LAN interface and KCS interface 
> routines.  The
> > > other documents seem to aimed at users, and not much 
> > documentation 
> > > aboutthe developers' API yet.  I tried to distill out what I 
> > needed 
> > > from the
> > > sample apps, but I'm having trouble in the general case passing a
> > > pre-formed IPMI command, with a receive buffer that is big 
> enough to
> > > handle whatever the response might be, then getting the actual 
> > > receivedbyte count.  The sample routines are targeted at 
> certain 
> > > given commands
> > > and the known return length for each.  Maybe what I need is a
> > > 'pass-through' template, or something (?).  
> > > 
> > > What would you suggest?
> > > 
> > > Andy
> > > 
> > > ---
> > > Andy Cress                      803-216-2356  fax:803-216-2178
> > > Senior Software Engineer    address@hidden
> > > Intel Corporation, Columbia Design Center, CBA1
> > > 100 Center Point Cir., Suite 200, Columbia, SC 29210
> > > http://ipmiutil.sf.net   http://scsirastools.sf.net
> > > BTW, I speak for myself, not for Intel Corp.
> > > "Do not merely look out for your own personal interests, but 
> also 
> > for> the interests of others." Phil 2:4
> > > 
> > > 
> > > _______________________________________________
> > > Freeipmi-devel mailing list
> > > address@hidden
> > > http://lists.gnu.org/mailman/listinfo/freeipmi-devel
> > > 
> > 
> > 
> > 
> > _______________________________________________
> > Freeipmi-devel mailing list
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/freeipmi-devel
> > 
> 
> 





reply via email to

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