Lines Matching refs:msg
145 e->rq_seq, e->req.msg.cmd); in ipmi_req_add_entry()
153 while (e && (e->rq_seq != seq || e->req.msg.cmd != cmd)) { in ipmi_req_lookup_entry()
168 while (e && (e->rq_seq != seq || e->req.msg.cmd != cmd)) { in ipmi_req_remove_entry()
208 e->rq_seq, e->req.msg.cmd); in ipmi_req_clear_entries()
615 entry->req.msg.cmd = entry->req.msg.target_cmd; in ipmi_lan_poll_recv()
617 ipmi_req_remove_entry(entry->rq_seq, entry->req.msg.cmd); in ipmi_lan_poll_recv()
629 entry->req.msg.cmd = entry->req.msg.target_cmd; in ipmi_lan_poll_recv()
700 uint8_t * msg, * temp; in ipmi_lan_build_cmd() local
725 entry = ipmi_req_lookup_entry(curr_seq, req->msg.cmd); in ipmi_lan_build_cmd()
746 len = req->msg.data_len + 29; in ipmi_lan_build_cmd()
751 msg = malloc(len); in ipmi_lan_build_cmd()
752 if (msg == NULL) { in ipmi_lan_build_cmd()
756 memset(msg, 0, len); in ipmi_lan_build_cmd()
759 memcpy(msg, &rmcp, sizeof(rmcp)); in ipmi_lan_build_cmd()
763 msg[len++] = s->active ? s->authtype : 0; in ipmi_lan_build_cmd()
765 msg[len++] = s->in_seq & 0xff; in ipmi_lan_build_cmd()
766 msg[len++] = (s->in_seq >> 8) & 0xff; in ipmi_lan_build_cmd()
767 msg[len++] = (s->in_seq >> 16) & 0xff; in ipmi_lan_build_cmd()
768 msg[len++] = (s->in_seq >> 24) & 0xff; in ipmi_lan_build_cmd()
769 memcpy(msg+len, &s->session_id, 4); in ipmi_lan_build_cmd()
775 memcpy(msg+len, s->authcode, 16); in ipmi_lan_build_cmd()
782 msg[len++] = req->msg.data_len + 7; in ipmi_lan_build_cmd()
787 msg[len++] = req->msg.data_len + 15 + in ipmi_lan_build_cmd()
790 msg[len++] = IPMI_BMC_SLAVE_ADDR; in ipmi_lan_build_cmd()
791 msg[len++] = IPMI_NETFN_APP << 2; in ipmi_lan_build_cmd()
793 msg[len++] = ipmi_csum(msg+cs, tmp); in ipmi_lan_build_cmd()
795 msg[len++] = IPMI_REMOTE_SWID; in ipmi_lan_build_cmd()
796 msg[len++] = curr_seq << 2; in ipmi_lan_build_cmd()
797 msg[len++] = 0x34; /* Send Message rqst */ in ipmi_lan_build_cmd()
798 entry->req.msg.target_cmd = entry->req.msg.cmd; /* Save target command */ in ipmi_lan_build_cmd()
799 entry->req.msg.cmd = 0x34; /* (fixup request entry) */ in ipmi_lan_build_cmd()
802 msg[len++] = (0x40|intf->target_channel); /* Track request*/ in ipmi_lan_build_cmd()
805 msg[len++] = (0x40|intf->transit_channel); /* Track request*/ in ipmi_lan_build_cmd()
807 msg[len++] = intf->transit_addr; in ipmi_lan_build_cmd()
808 msg[len++] = IPMI_NETFN_APP << 2; in ipmi_lan_build_cmd()
810 msg[len++] = ipmi_csum(msg+cs, tmp); in ipmi_lan_build_cmd()
812 msg[len++] = intf->my_addr; in ipmi_lan_build_cmd()
813 msg[len++] = curr_seq << 2; in ipmi_lan_build_cmd()
814 msg[len++] = 0x34; /* Send Message rqst */ in ipmi_lan_build_cmd()
815 msg[len++] = (0x40|intf->target_channel); /* Track request */ in ipmi_lan_build_cmd()
821 msg[len++] = entry->bridging_level ? intf->target_addr : IPMI_BMC_SLAVE_ADDR; in ipmi_lan_build_cmd()
822 msg[len++] = req->msg.netfn << 2 | (req->msg.lun & 3); in ipmi_lan_build_cmd()
824 msg[len++] = ipmi_csum(msg+cs, tmp); in ipmi_lan_build_cmd()
828 msg[len++] = IPMI_REMOTE_SWID; in ipmi_lan_build_cmd()
831 msg[len++] = intf->my_addr; in ipmi_lan_build_cmd()
834 msg[len++] = entry->rq_seq << 2; in ipmi_lan_build_cmd()
835 msg[len++] = req->msg.cmd; in ipmi_lan_build_cmd()
844 lprintf(LOG_DEBUG+1, ">> NetFn : %02x", req->msg.netfn); in ipmi_lan_build_cmd()
849 lprintf(LOG_DEBUG+1, ">> Command : %02x", req->msg.cmd); in ipmi_lan_build_cmd()
852 if (req->msg.data_len) { in ipmi_lan_build_cmd()
853 memcpy(msg+len, req->msg.data, req->msg.data_len); in ipmi_lan_build_cmd()
854 len += req->msg.data_len; in ipmi_lan_build_cmd()
859 msg[len++] = ipmi_csum(msg+cs, tmp); in ipmi_lan_build_cmd()
865 msg[len++] = ipmi_csum(msg+cs3, tmp); in ipmi_lan_build_cmd()
868 msg[len++] = ipmi_csum(msg+cs2, tmp); in ipmi_lan_build_cmd()
879 temp = ipmi_auth_md5(s, msg+mp, msg[mp-1]); in ipmi_lan_build_cmd()
880 memcpy(msg+ap, temp, 16); in ipmi_lan_build_cmd()
883 temp = ipmi_auth_md2(s, msg+mp, msg[mp-1]); in ipmi_lan_build_cmd()
884 memcpy(msg+ap, temp, 16); in ipmi_lan_build_cmd()
896 entry->msg_data = msg; in ipmi_lan_build_cmd()
933 ipmi_req_remove_entry(entry->rq_seq, entry->req.msg.target_cmd); in ipmi_lan_send_cmd()
1003 uint8_t * msg; in ipmi_lan_build_rsp() local
1009 msg = malloc(len); in ipmi_lan_build_rsp()
1010 if (msg == NULL) { in ipmi_lan_build_rsp()
1014 memset(msg, 0, len); in ipmi_lan_build_rsp()
1017 memcpy(msg, &rmcp, 4); in ipmi_lan_build_rsp()
1021 msg[len++] = s->active ? s->authtype : 0; in ipmi_lan_build_rsp()
1028 memcpy(msg+len, &s->in_seq, 4); in ipmi_lan_build_rsp()
1030 memcpy(msg+len, &s->session_id, 4); in ipmi_lan_build_rsp()
1036 memcpy(msg+len, s->authcode, 16); in ipmi_lan_build_rsp()
1041 msg[len++] = rsp->data_len + 8; in ipmi_lan_build_rsp()
1045 msg[len++] = IPMI_REMOTE_SWID; in ipmi_lan_build_rsp()
1046 msg[len++] = rsp->msg.netfn << 2; in ipmi_lan_build_rsp()
1048 msg[len++] = ipmi_csum(msg+cs, tmp); in ipmi_lan_build_rsp()
1050 msg[len++] = IPMI_BMC_SLAVE_ADDR; in ipmi_lan_build_rsp()
1051 msg[len++] = (rsp->msg.seq << 2) | (rsp->msg.lun & 3); in ipmi_lan_build_rsp()
1052 msg[len++] = rsp->msg.cmd; in ipmi_lan_build_rsp()
1055 msg[len++] = rsp->ccode; in ipmi_lan_build_rsp()
1059 memcpy(msg+len, rsp->data, rsp->data_len); in ipmi_lan_build_rsp()
1065 msg[len++] = ipmi_csum(msg+cs, tmp); in ipmi_lan_build_rsp()
1071 d = ipmi_auth_md5(s, msg+mp, msg[mp-1]); in ipmi_lan_build_rsp()
1072 memcpy(msg+ap, d, 16); in ipmi_lan_build_rsp()
1075 d = ipmi_auth_md2(s, msg+mp, msg[mp-1]); in ipmi_lan_build_rsp()
1076 memcpy(msg+ap, d, 16); in ipmi_lan_build_rsp()
1082 return msg; in ipmi_lan_build_rsp()
1088 uint8_t * msg; in ipmi_lan_send_rsp() local
1092 msg = ipmi_lan_build_rsp(intf, rsp, &len); in ipmi_lan_send_rsp()
1093 if (len <= 0 || msg == NULL) { in ipmi_lan_send_rsp()
1095 if (msg != NULL) { in ipmi_lan_send_rsp()
1096 free(msg); in ipmi_lan_send_rsp()
1097 msg = NULL; in ipmi_lan_send_rsp()
1102 rv = sendto(intf->fd, msg, len, 0, in ipmi_lan_send_rsp()
1107 if (msg != NULL) { in ipmi_lan_send_rsp()
1108 free(msg); in ipmi_lan_send_rsp()
1109 msg = NULL; in ipmi_lan_send_rsp()
1114 if (msg != NULL) { in ipmi_lan_send_rsp()
1115 free(msg); in ipmi_lan_send_rsp()
1116 msg = NULL; in ipmi_lan_send_rsp()
1156 uint8_t * msg; in ipmi_lan_build_sol_msg() local
1165 msg = malloc(len); in ipmi_lan_build_sol_msg()
1166 if (msg == NULL) { in ipmi_lan_build_sol_msg()
1170 memset(msg, 0, len); in ipmi_lan_build_sol_msg()
1173 memcpy(msg, &rmcp, sizeof(rmcp)); in ipmi_lan_build_sol_msg()
1177 msg[len++] = 0; /* SOL is always authtype = NONE */ in ipmi_lan_build_sol_msg()
1178 msg[len++] = session->in_seq & 0xff; in ipmi_lan_build_sol_msg()
1179 msg[len++] = (session->in_seq >> 8) & 0xff; in ipmi_lan_build_sol_msg()
1180 msg[len++] = (session->in_seq >> 16) & 0xff; in ipmi_lan_build_sol_msg()
1181 msg[len++] = (session->in_seq >> 24) & 0xff; in ipmi_lan_build_sol_msg()
1183 msg[len++] = session->session_id & 0xff; in ipmi_lan_build_sol_msg()
1184 msg[len++] = (session->session_id >> 8) & 0xff; in ipmi_lan_build_sol_msg()
1185 msg[len++] = (session->session_id >> 16) & 0xff; in ipmi_lan_build_sol_msg()
1186 msg[len++] = ((session->session_id >> 24) + 0x10) & 0xff; /* Add 0x10 to MSB for SOL */ in ipmi_lan_build_sol_msg()
1188 msg[len++] = payload->payload.sol_packet.character_count + 5; in ipmi_lan_build_sol_msg()
1191 msg[len++] = payload->payload.sol_packet.packet_sequence_number; in ipmi_lan_build_sol_msg()
1192 msg[len++] = payload->payload.sol_packet.acked_packet_number; in ipmi_lan_build_sol_msg()
1193 msg[len++] = payload->payload.sol_packet.accepted_character_count; in ipmi_lan_build_sol_msg()
1194 msg[len] = payload->payload.sol_packet.is_nack ? 0x40 : 0; in ipmi_lan_build_sol_msg()
1195 msg[len] |= payload->payload.sol_packet.assert_ring_wor ? 0x20 : 0; in ipmi_lan_build_sol_msg()
1196 msg[len] |= payload->payload.sol_packet.generate_break ? 0x10 : 0; in ipmi_lan_build_sol_msg()
1197 msg[len] |= payload->payload.sol_packet.deassert_cts ? 0x08 : 0; in ipmi_lan_build_sol_msg()
1198 msg[len] |= payload->payload.sol_packet.deassert_dcd_dsr ? 0x04 : 0; in ipmi_lan_build_sol_msg()
1199 msg[len] |= payload->payload.sol_packet.flush_inbound ? 0x02 : 0; in ipmi_lan_build_sol_msg()
1200 msg[len++] |= payload->payload.sol_packet.flush_outbound ? 0x01 : 0; in ipmi_lan_build_sol_msg()
1206 memcpy(msg + len, in ipmi_lan_build_sol_msg()
1217 return msg; in ipmi_lan_build_sol_msg()
1255 uint8_t * msg; in ipmi_lan_send_sol_payload() local
1264 msg = ipmi_lan_build_sol_msg(intf, payload, &len); in ipmi_lan_send_sol_payload()
1265 if (len <= 0 || msg == NULL) { in ipmi_lan_send_sol_payload()
1267 if (msg != NULL) { in ipmi_lan_send_sol_payload()
1268 free(msg); in ipmi_lan_send_sol_payload()
1269 msg = NULL; in ipmi_lan_send_sol_payload()
1277 if (ipmi_lan_send_packet(intf, msg, len) < 0) { in ipmi_lan_send_sol_payload()
1315 if (msg != NULL) { in ipmi_lan_send_sol_payload()
1316 free(msg); in ipmi_lan_send_sol_payload()
1317 msg = NULL; in ipmi_lan_send_sol_payload()
1557 .msg = { in ipmi_lan_keepalive()
1591 req.msg.netfn = IPMI_NETFN_APP; in ipmi_get_auth_capabilities_cmd()
1592 req.msg.cmd = 0x38; in ipmi_get_auth_capabilities_cmd()
1593 req.msg.data = msg_data; in ipmi_get_auth_capabilities_cmd()
1594 req.msg.data_len = 2; in ipmi_get_auth_capabilities_cmd()
1613 val2str(req.msg.data[1], ipmi_privlvl_vals)); in ipmi_get_auth_capabilities_cmd()
1706 req.msg.netfn = IPMI_NETFN_APP; in ipmi_get_session_challenge_cmd()
1707 req.msg.cmd = 0x39; in ipmi_get_session_challenge_cmd()
1708 req.msg.data = msg_data; in ipmi_get_session_challenge_cmd()
1709 req.msg.data_len = 17; /* 1 byte for authtype, 16 for user */ in ipmi_get_session_challenge_cmd()
1756 req.msg.netfn = IPMI_NETFN_APP; in ipmi_activate_session_cmd()
1757 req.msg.cmd = 0x3a; in ipmi_activate_session_cmd()
1776 req.msg.data = msg_data; in ipmi_activate_session_cmd()
1777 req.msg.data_len = 22; in ipmi_activate_session_cmd()
1869 req.msg.netfn = IPMI_NETFN_APP; in ipmi_set_session_privlvl_cmd()
1870 req.msg.cmd = 0x3b; in ipmi_set_session_privlvl_cmd()
1871 req.msg.data = &privlvl; in ipmi_set_session_privlvl_cmd()
1872 req.msg.data_len = 1; in ipmi_set_session_privlvl_cmd()
1916 req.msg.netfn = IPMI_NETFN_APP; in ipmi_close_session_cmd()
1917 req.msg.cmd = 0x3c; in ipmi_close_session_cmd()
1918 req.msg.data = msg_data; in ipmi_close_session_cmd()
1919 req.msg.data_len = 4; in ipmi_close_session_cmd()