Hi Jim, I think the open_lan_session() function was created a long time ago as a convenience function for libfreeipmi users. I know that the ipmiutil author (ipmiutil.sourceforge.net) atleast uses it. I suppose it has never been used for the FreeIPMI tools because:
A) some tools like bmc-config only work in-band B) some tools like ipmipower need to work more reliably/quickly and therefore "manually" setup a lan session As for the reason why your code isn't working with MD5, I'm guessing: sizeof(password), should instead be strlen(password) ??? > By the way it seems to return < 0 but set errno to Success?? I see a few corner cases in the code. In particular the fallout case for "goto error;". I'll let AB talk about this since its his part of the lib :P Al -- Albert Chu [EMAIL PROTECTED] Lawrence Livermore National Laboratory ----- Original Message ----- From: James Laros <[EMAIL PROTECTED]> Date: Tuesday, September 27, 2005 2:51 pm Subject: [Freeipmi-devel] ipmi_lan_open_session() question > I have a question about the usage of ipmi_lan_open_session. > First off I don't see it used in any of the utilities > that come with the distro? Any reason? > > I was doing things more "by hand" as in ipmipower until > I noticed this call. > > More specific question if I use the call as follows the > Activate Session Application Response returns a completion > code of 0xcc (Invalid data field in request) > > Wasn't sure if I need to pass in something for session_seq_num > or session_id??? In the request message the session_id seems be > set properly to a temp session id, session_seq is 0 which should be > ok yes? > > Note that if I run it with MD5 as an auth type and provide username > and password I never get an app response. > > By the way it seems to return < 0 but set errno to Success?? > > ------------------------------ > > u_int8_t auth_type; > u_int8_t *username = "root"; > u_int8_t *password = "yada"; > u_int8_t priv; > priv = IPMI_PRIV_LEVEL_OPERATOR; > u_int32_t *session_seq_num; > u_int32_t *session_id; > > session_seq_num = (u_int32_t *)malloc(sizeof(u_int32_t)); > session_id = (u_int32_t *)malloc(sizeof(u_int32_t)); > > auth_type = IPMI_SESSION_AUTH_TYPE_MD5; > > if (ipmi_lan_open_session(conn->fd, > (struct sockaddr *)&(conn->target_addr), > sizeof(struct sockaddr_in), > IPMI_SESSION_AUTH_TYPE_NONE, > // auth_type, > username, > // password, > // sizeof(password), > NULL, > 0, > INITIAL_OUTBOUND_SEQ_NUM, > priv, > session_seq_num, > session_id) < 0 ) { > fprintf(stderr, "Error: ipmi_lan_open_session %s\n", > strerror(errno)); return -1; > } > > ------------------------------------------- > > Thanks if anyone can help. > > Jim > -- > ______________________________________________________________ > > James Laros ............................... [EMAIL PROTECTED] > Dept. 09224 > Scalable Systems Integration .............. PHONE:505.845.8532 > Sandia National Labs ........................ FAX:505.844.9297 > ______________________________________________________________ > > Is someone getting the best of you? > - Foo Fighters > > > > _______________________________________________ > Freeipmi-devel mailing list > Freeipmi-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/freeipmi-devel > _______________________________________________ Freeipmi-devel mailing list Freeipmi-devel@gnu.org http://lists.gnu.org/mailman/listinfo/freeipmi-devel