Lines Matching defs:ilp

181 	ipmi_lan_t *ilp = (ipmi_lan_t *)ihp->ih_tdata;
183 return (send(ilp->il_sd, data, dlen, 0));
192 ipmi_lan_t *ilp = (ipmi_lan_t *)ihp->ih_tdata;
196 FD_SET(ilp->il_sd, &read_set);
199 FD_SET(ilp->il_sd, &err_set);
201 tmout.tv_sec = ilp->il_timeout;
204 ret = select(ilp->il_sd + 1, &read_set, NULL, &err_set, &tmout);
205 if (ret < 0 || FD_ISSET(ilp->il_sd, &err_set) ||
206 !FD_ISSET(ilp->il_sd, &read_set))
220 ret = recv(ilp->il_sd, &rsp.ir_data, IPMI_BUF_SIZE, 0);
224 FD_SET(ilp->il_sd, &read_set);
227 FD_SET(ilp->il_sd, &err_set);
229 tmout.tv_sec = ilp->il_timeout;
232 ret = select(ilp->il_sd + 1, &read_set, NULL, &err_set, &tmout);
234 if (FD_ISSET(ilp->il_sd, &err_set) ||
235 !FD_ISSET(ilp->il_sd, &read_set))
238 ret = recv(ilp->il_sd, &rsp.ir_data, IPMI_BUF_SIZE, 0);
337 ipmi_lan_t *ilp = (ipmi_lan_t *)ihp->ih_tdata;
363 if (ilp->il_send_authcode && (rsp_authtype || ilp->il_authtype))
420 ipmi_lan_t *ilp = (ipmi_lan_t *)ihp->ih_tdata;
436 if (ilp->il_send_authcode && ilp->il_authtype)
453 if (! ilp->il_send_authcode)
459 (void) memcpy(&session_hdr.sh_seq, &ilp->il_in_seq, sizeof (uint32_t));
460 (void) memcpy(&session_hdr.sh_id, &ilp->il_session_id,
467 if (ilp->il_send_authcode && ilp->il_authtype) {
468 (void) memcpy(msg + off, ilp->il_authcode, 16);
501 if (ilp->il_in_seq) {
502 ilp->il_in_seq++;
503 if (ilp->il_in_seq == 0)
504 ilp->il_in_seq++;
517 ipmi_lan_t *ilp = (ipmi_lan_t *)data;
523 if ((entry = ipmi_lan_build_cmd(ilp->il_ihp, cmd)) == NULL)
526 if (ipmi_lan_send_packet(ilp->il_ihp, entry->ire_msg_data,
528 if (++try >= ilp->il_num_retries)
536 if ((rsp = ipmi_lan_poll_recv(ilp->il_ihp)) != NULL)
540 ipmi_req_remove_entry(ilp->il_ihp, entry->ire_rq_seq,
543 if (++try >= ilp->il_num_retries)
574 ipmi_lan_t *ilp = (ipmi_lan_t *)ihp->ih_tdata;
580 switch (ilp->il_authtype) {
597 (void) memcpy(msg_data + 1, ilp->il_user, 16);
605 if (ipmi_lan_send(ilp, &cmd, &resp, &ccode) != 0 || ccode)
623 ipmi_lan_t *ilp = (ipmi_lan_t *)ihp->ih_tdata;
631 switch (ilp->il_authtype) {
648 msg_data[1] = ilp->il_privlvl;
650 (void) memcpy(msg_data + 2, ilp->il_challenge, 16);
658 ilp->il_send_authcode = B_TRUE;
660 if (ipmi_lan_send(ilp, &cmd, &resp, &ccode) != 0 || ccode) {
661 ilp->il_send_authcode = B_FALSE;
666 (void) memcpy(&ilp->il_session_id, resp_data + 1, 4);
667 ilp->il_in_seq = resp_data[8] << 24 | resp_data[7] << 16 |
669 if (ilp->il_in_seq == 0)
670 ++ilp->il_in_seq;
708 ipmi_lan_t *ilp = (ipmi_lan_t *)ihp->ih_tdata;
713 if (! ilp->il_session_active)
716 (void) memcpy(&msg_data, &ilp->il_session_id, 4);
724 if (ipmi_lan_send(ilp, &cmd, &resp, &ccode) != 0)
752 ipmi_lan_t *ilp = (ipmi_lan_t *)ihp->ih_tdata;
759 ilp->il_privlvl)) == NULL)
773 if (ipmi_get_session_challenge_cmd(ihp, &ilp->il_session_id,
774 ilp->il_challenge) != 0)
780 ilp->il_session_active = B_TRUE;
782 if (ipmi_set_session_privlvl_cmd(ihp, ilp->il_privlvl) != 0)
791 ipmi_lan_t *ilp = (ipmi_lan_t *)data;
793 if (ilp->il_session_active)
794 (void) ipmi_close_session_cmd(ilp->il_ihp);
796 if (ilp->il_sd >= 0)
797 (void) close(ilp->il_sd);
799 ipmi_req_clear_entries(ilp->il_ihp);
800 ipmi_free(ilp->il_ihp, ipmi_req_entries);
801 ipmi_free(ilp->il_ihp, ilp);
809 ipmi_lan_t *ilp;
812 if ((ilp = ipmi_zalloc(ihp, sizeof (ipmi_lan_t))) == NULL) {
816 ilp->il_ihp = ihp;
817 ihp->ih_tdata = ilp;
829 ipmi_free(ihp, ilp);
833 (void) strncpy(ilp->il_host, hostname, MAXHOSTNAMELEN);
834 (void) strncpy(ilp->il_user, user, 16);
835 (void) strncpy(ilp->il_authcode, authcode, 16);
843 if (nvlist_lookup_uint16(params, IPMI_LAN_PORT, &ilp->il_port))
844 ilp->il_port = RMCP_UDP_PORT;
846 if (nvlist_lookup_uint8(params, IPMI_LAN_PRIVLVL, &ilp->il_privlvl))
847 ilp->il_privlvl = IPMI_SESSION_PRIV_ADMIN;
849 if (nvlist_lookup_uint32(params, IPMI_LAN_TIMEOUT, &ilp->il_timeout))
850 ilp->il_timeout = DEF_IPMI_LAN_TIMEOUT;
853 &ilp->il_num_retries))
854 ilp->il_num_retries = DEF_IPMI_LAN_NUM_RETRIES;
856 ilp->il_authtype = IPMI_SESSION_AUTHTYPE_PASSWORD;
862 ilp->il_addr.sin_family = AF_INET;
863 ilp->il_addr.sin_port = htons(ilp->il_port);
865 rc = inet_pton(AF_INET, (const char *)ilp->il_host,
866 &ilp->il_addr.sin_addr);
868 if ((host = gethostbyname((const char *)ilp->il_host))
870 ipmi_free(ihp, ilp);
874 ilp->il_addr.sin_family = host->h_addrtype;
875 (void) memcpy(&ilp->il_addr.sin_addr, host->h_addr,
879 if ((ilp->il_sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
880 ipmi_free(ihp, ilp);
884 if (connect(ilp->il_sd, (struct sockaddr *)&ilp->il_addr,
886 ipmi_lan_close(ilp);
899 ipmi_lan_close(ilp);
903 return (ilp);