mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
fix lots of little errors that show up with -Werror -Wall
This commit is contained in:
parent
ea146566c5
commit
6da8379fe4
@ -33,8 +33,8 @@ AC_CHECK_FUNCS([alarm gethostbyname socket select])
|
|||||||
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
|
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
|
||||||
AC_CHECK_FUNCS([getpassphrase])
|
AC_CHECK_FUNCS([getpassphrase])
|
||||||
|
|
||||||
dnl CFLAGS="$CFLAGS -Wall -Werror"
|
CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Werror"
|
||||||
dnl AC_SUBST(CFLAGS)
|
AC_SUBST(CFLAGS)
|
||||||
|
|
||||||
AM_PROG_LIBTOOL
|
AM_PROG_LIBTOOL
|
||||||
LIBTOOL="$LIBTOOL --silent"
|
LIBTOOL="$LIBTOOL --silent"
|
||||||
|
@ -159,7 +159,7 @@ struct ipmi_intf {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct ipmi_intf * ipmi_intf_load(char * name);
|
struct ipmi_intf * ipmi_intf_load(char * name);
|
||||||
char * ipmi_intf_print(void);
|
void ipmi_intf_print(void);
|
||||||
|
|
||||||
void ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname);
|
void ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname);
|
||||||
void ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username);
|
void ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username);
|
||||||
|
@ -676,8 +676,7 @@ void ipmi_spd_print(struct ipmi_intf * intf, unsigned char id)
|
|||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
struct fru_info fru;
|
struct fru_info fru;
|
||||||
unsigned char spd_data[256], msg_data[4];
|
unsigned char spd_data[256], msg_data[4];
|
||||||
int i, len, offset;
|
int len, offset, size;
|
||||||
int size, conf;
|
|
||||||
|
|
||||||
msg_data[0] = id;
|
msg_data[0] = id;
|
||||||
|
|
||||||
|
@ -190,7 +190,6 @@ static int ipmi_bmc_get_enables(struct ipmi_intf * intf)
|
|||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
struct bmc_enables_data en;
|
|
||||||
struct bitfield_data * bf;
|
struct bitfield_data * bf;
|
||||||
|
|
||||||
memset(&req, 0, sizeof(req));
|
memset(&req, 0, sizeof(req));
|
||||||
@ -337,7 +336,7 @@ static int ipmi_bmc_get_deviceid(struct ipmi_intf * intf)
|
|||||||
IPM_DEV_IPMI_VERSION_MAJOR(devid->ipmi_version),
|
IPM_DEV_IPMI_VERSION_MAJOR(devid->ipmi_version),
|
||||||
IPM_DEV_IPMI_VERSION_MINOR(devid->ipmi_version));
|
IPM_DEV_IPMI_VERSION_MINOR(devid->ipmi_version));
|
||||||
printf("Manufacturer ID : %lu\n",
|
printf("Manufacturer ID : %lu\n",
|
||||||
IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id));
|
(long)IPM_DEV_MANUFACTURER_ID(devid->manufacturer_id));
|
||||||
printf("Product ID : %u (0x%02x%02x)\n",
|
printf("Product ID : %u (0x%02x%02x)\n",
|
||||||
buf2short((unsigned char *)(devid->product_id)),
|
buf2short((unsigned char *)(devid->product_id)),
|
||||||
devid->product_id[1], devid->product_id[0]);
|
devid->product_id[1], devid->product_id[0]);
|
||||||
|
@ -388,7 +388,7 @@ ipmi_get_user_access(struct ipmi_intf * intf, unsigned char channel, unsigned ch
|
|||||||
struct ipmi_rq req1, req2;
|
struct ipmi_rq req1, req2;
|
||||||
unsigned char rqdata[2];
|
unsigned char rqdata[2];
|
||||||
struct get_user_access_rsp user_access;
|
struct get_user_access_rsp user_access;
|
||||||
int curr_uid, max_uid, init = 1;
|
int curr_uid, max_uid = 0, init = 1;
|
||||||
|
|
||||||
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
ipmi_intf_session_set_privlvl(intf, IPMI_SESSION_PRIV_ADMIN);
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ static void ipmi_chassis_poh(struct ipmi_intf * intf)
|
|||||||
memcpy(&count, rsp->data+1, 4);
|
memcpy(&count, rsp->data+1, 4);
|
||||||
|
|
||||||
printf("POH Counter : %li hours total (%li days, %li hours)\n",
|
printf("POH Counter : %li hours total (%li days, %li hours)\n",
|
||||||
count, (uint32_t)(count / 24), (uint32_t)(count % 24));
|
(long)count, (long)(count / 24), (long)(count % 24));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
static void ipmi_chassis_restart_cause(struct ipmi_intf * intf)
|
||||||
|
@ -53,7 +53,7 @@ static char * get_fru_area_str(unsigned char * data, int * offset)
|
|||||||
{
|
{
|
||||||
static const char bcd_plus[] = "0123456789 -.:,_";
|
static const char bcd_plus[] = "0123456789 -.:,_";
|
||||||
char * str;
|
char * str;
|
||||||
int len, size, i, j, k;
|
int len, size=0, i, j, k;
|
||||||
int off = *offset;
|
int off = *offset;
|
||||||
union {
|
union {
|
||||||
uint32_t bits;
|
uint32_t bits;
|
||||||
@ -561,7 +561,7 @@ static void ipmi_fru_print_all(struct ipmi_intf * intf)
|
|||||||
if (!(itr = ipmi_sdr_start(intf)))
|
if (!(itr = ipmi_sdr_start(intf)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (header = ipmi_sdr_get_next_header(intf, itr))
|
while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL)
|
||||||
{
|
{
|
||||||
if (header->type != SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR)
|
if (header->type != SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR)
|
||||||
continue;
|
continue;
|
||||||
|
@ -34,6 +34,10 @@
|
|||||||
* facility.
|
* facility.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <ipmitool/ipmi.h>
|
#include <ipmitool/ipmi.h>
|
||||||
#include <ipmitool/ipmi_intf.h>
|
#include <ipmitool/ipmi_intf.h>
|
||||||
#include <ipmitool/ipmi_raw.h>
|
#include <ipmitool/ipmi_raw.h>
|
||||||
|
@ -110,10 +110,9 @@ ipmi_sensor_print_full_discrete(struct ipmi_intf * intf,
|
|||||||
{
|
{
|
||||||
char id[17];
|
char id[17];
|
||||||
char * unitstr = "discrete";
|
char * unitstr = "discrete";
|
||||||
int i=0, validread=1;
|
int validread=1;
|
||||||
unsigned char val;
|
unsigned char val = 0;
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
char * status;
|
|
||||||
|
|
||||||
if (!sensor)
|
if (!sensor)
|
||||||
return;
|
return;
|
||||||
@ -238,9 +237,9 @@ ipmi_sensor_print_full_analog(struct ipmi_intf * intf,
|
|||||||
{
|
{
|
||||||
char unitstr[16], id[17];
|
char unitstr[16], id[17];
|
||||||
int i=0, validread=1, thresh_available = 1;
|
int i=0, validread=1, thresh_available = 1;
|
||||||
float val;
|
float val = 0.0;
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
char * status;
|
char * status = NULL;
|
||||||
|
|
||||||
if (!sensor)
|
if (!sensor)
|
||||||
return;
|
return;
|
||||||
@ -320,7 +319,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf * intf,
|
|||||||
printf("| %-10.3f | %-10s | %-6s",
|
printf("| %-10.3f | %-10s | %-6s",
|
||||||
val,
|
val,
|
||||||
unitstr,
|
unitstr,
|
||||||
status);
|
status ? : "");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -387,7 +386,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf * intf,
|
|||||||
(tol==(int)tol) ? 0 : 3,
|
(tol==(int)tol) ? 0 : 3,
|
||||||
tol,
|
tol,
|
||||||
unitstr);
|
unitstr);
|
||||||
printf("Status : %s\n", status);
|
printf("Status : %s\n", status ? : "");
|
||||||
|
|
||||||
if (thresh_available)
|
if (thresh_available)
|
||||||
{
|
{
|
||||||
@ -443,10 +442,9 @@ void ipmi_sensor_print_compact(struct ipmi_intf * intf,
|
|||||||
{
|
{
|
||||||
char id[17];
|
char id[17];
|
||||||
char * unitstr = "discrete";
|
char * unitstr = "discrete";
|
||||||
int i=0, validread=1;
|
int validread=1;
|
||||||
unsigned char val;
|
unsigned char val = 0;
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
char * status;
|
|
||||||
|
|
||||||
if (!sensor)
|
if (!sensor)
|
||||||
return;
|
return;
|
||||||
@ -581,7 +579,7 @@ ipmi_sensor_list(struct ipmi_intf * intf)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (header = ipmi_sdr_get_next_header(intf, itr))
|
while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL)
|
||||||
{
|
{
|
||||||
unsigned char * rec = ipmi_sdr_get_record(intf, header, itr);
|
unsigned char * rec = ipmi_sdr_get_record(intf, header, itr);
|
||||||
if (!rec)
|
if (!rec)
|
||||||
|
@ -296,6 +296,8 @@ ipmi_get_session_info(struct ipmi_intf * intf,
|
|||||||
rqdata[1] = (unsigned char)id_or_handle;
|
rqdata[1] = (unsigned char)id_or_handle;
|
||||||
req.msg.data_len = 2;
|
req.msg.data_len = 2;
|
||||||
break;
|
break;
|
||||||
|
case IPMI_SESSION_REQUEST_ALL:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -377,7 +379,7 @@ ipmi_session_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
{
|
{
|
||||||
|
|
||||||
Ipmi_Session_Request_Type session_request_type;
|
Ipmi_Session_Request_Type session_request_type;
|
||||||
uint32_t id_or_handle;
|
uint32_t id_or_handle = 0;
|
||||||
|
|
||||||
if (!strncmp(argv[1], "active", 6))
|
if (!strncmp(argv[1], "active", 6))
|
||||||
session_request_type = IPMI_SESSION_REQUEST_CURRENT;
|
session_request_type = IPMI_SESSION_REQUEST_CURRENT;
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
@ -67,7 +68,6 @@
|
|||||||
|
|
||||||
static struct termios _saved_tio;
|
static struct termios _saved_tio;
|
||||||
static int _in_raw_mode = 0;
|
static int _in_raw_mode = 0;
|
||||||
static int bShouldExit = 0;
|
|
||||||
|
|
||||||
extern int verbose;
|
extern int verbose;
|
||||||
|
|
||||||
@ -699,8 +699,6 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
|
|||||||
*/
|
*/
|
||||||
else if (! strcmp(param, "non-volatile-bit-rate"))
|
else if (! strcmp(param, "non-volatile-bit-rate"))
|
||||||
{
|
{
|
||||||
struct sol_config_parameters params;
|
|
||||||
|
|
||||||
req.msg.data_len = 3;
|
req.msg.data_len = 3;
|
||||||
data[1] = SOL_PARAMETER_SOL_NON_VOLATILE_BIT_RATE;
|
data[1] = SOL_PARAMETER_SOL_NON_VOLATILE_BIT_RATE;
|
||||||
|
|
||||||
@ -740,8 +738,6 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
|
|||||||
*/
|
*/
|
||||||
else if (! strcmp(param, "volatile-bit-rate"))
|
else if (! strcmp(param, "volatile-bit-rate"))
|
||||||
{
|
{
|
||||||
struct sol_config_parameters params;
|
|
||||||
|
|
||||||
req.msg.data_len = 3;
|
req.msg.data_len = 3;
|
||||||
data[1] = SOL_PARAMETER_SOL_VOLATILE_BIT_RATE;
|
data[1] = SOL_PARAMETER_SOL_VOLATILE_BIT_RATE;
|
||||||
|
|
||||||
@ -1142,8 +1138,6 @@ ipmi_sol_red_pill(struct ipmi_intf * intf)
|
|||||||
fd_set read_fds;
|
fd_set read_fds;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
int retval;
|
int retval;
|
||||||
size_t num_read;
|
|
||||||
char c;
|
|
||||||
int buffer_size = intf->session->sol_data.max_inbound_payload_size;
|
int buffer_size = intf->session->sol_data.max_inbound_payload_size;
|
||||||
|
|
||||||
buffer = (char*)malloc(buffer_size);
|
buffer = (char*)malloc(buffer_size);
|
||||||
@ -1206,7 +1200,6 @@ ipmi_sol_red_pill(struct ipmi_intf * intf)
|
|||||||
*/
|
*/
|
||||||
else if (FD_ISSET(intf->fd, &read_fds))
|
else if (FD_ISSET(intf->fd, &read_fds))
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
struct ipmi_rs * rs =intf->recv_sol(intf);
|
struct ipmi_rs * rs =intf->recv_sol(intf);
|
||||||
if (! rs)
|
if (! rs)
|
||||||
{
|
{
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <ipmitool/helper.h>
|
#include <ipmitool/helper.h>
|
||||||
#include <ipmitool/ipmi.h>
|
#include <ipmitool/ipmi.h>
|
||||||
@ -489,7 +490,7 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
if ((argc >= 3) &&
|
if ((argc >= 3) &&
|
||||||
(! strcmp("password", argv[1])))
|
(! strcmp("password", argv[1])))
|
||||||
{
|
{
|
||||||
char * password;
|
char * password = NULL;
|
||||||
unsigned char user_id = (unsigned char)strtol(argv[2],
|
unsigned char user_id = (unsigned char)strtol(argv[2],
|
||||||
NULL,
|
NULL,
|
||||||
0);
|
0);
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <sys/poll.h>
|
#include <sys/poll.h>
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@ -67,7 +68,9 @@ static void daemonize(void)
|
|||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int fd;
|
int fd;
|
||||||
|
#ifdef SIGHUP
|
||||||
sigset_t sighup;
|
sigset_t sighup;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* if we are started from init no need to become daemon */
|
/* if we are started from init no need to become daemon */
|
||||||
if (getppid() == 1)
|
if (getppid() == 1)
|
||||||
@ -128,7 +131,6 @@ static int enable_event_msg_buffer(struct ipmi_intf * intf)
|
|||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
unsigned char bmc_global_enables;
|
unsigned char bmc_global_enables;
|
||||||
int r;
|
|
||||||
|
|
||||||
/* we must read/modify/write bmc global enables */
|
/* we must read/modify/write bmc global enables */
|
||||||
memset(&req, 0, sizeof(req));
|
memset(&req, 0, sizeof(req));
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <ipmitool/helper.h>
|
#include <ipmitool/helper.h>
|
||||||
|
#include <ipmitool/log.h>
|
||||||
#include <ipmitool/ipmi.h>
|
#include <ipmitool/ipmi.h>
|
||||||
#include <ipmitool/ipmi_intf.h>
|
#include <ipmitool/ipmi_intf.h>
|
||||||
#include <ipmitool/ipmi_session.h>
|
#include <ipmitool/ipmi_session.h>
|
||||||
@ -218,7 +219,7 @@ static int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
char *pbuf, **ap, *__argv[10];
|
char *pbuf, **ap, *__argv[10];
|
||||||
int __argc, rc=0;
|
int __argc, rc=0;
|
||||||
|
|
||||||
while (pbuf = (char *)readline(PROMPT)) {
|
while ((pbuf = (char *)readline(PROMPT)) != NULL) {
|
||||||
if (strlen(pbuf) == 0) {
|
if (strlen(pbuf) == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -265,7 +266,6 @@ int main(int argc, char ** argv)
|
|||||||
char * progname = NULL;
|
char * progname = NULL;
|
||||||
int port = 0;
|
int port = 0;
|
||||||
int argflag, i;
|
int argflag, i;
|
||||||
int intfarg = 0;
|
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int thump = 0;
|
int thump = 0;
|
||||||
|
|
||||||
@ -418,7 +418,6 @@ int main(int argc, char ** argv)
|
|||||||
/* now we finally run the command */
|
/* now we finally run the command */
|
||||||
ipmi_cmd_run(intf, argv[optind], argc-optind-1, &(argv[optind+1]));
|
ipmi_cmd_run(intf, argv[optind], argc-optind-1, &(argv[optind+1]));
|
||||||
|
|
||||||
out_close:
|
|
||||||
if (intf->opened && intf->close)
|
if (intf->opened && intf->close)
|
||||||
intf->close(intf);
|
intf->close(intf);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*M*
|
/*M*
|
||||||
// PVCS:
|
// PVCS:
|
||||||
// $Workfile: imbapi.c $
|
// $Workfile: imbapi.c $
|
||||||
// $Revision: 1.1 $
|
// $Revision: 1.2 $
|
||||||
// $Modtime: 06 Aug 2001 13:16:56 $
|
// $Modtime: 06 Aug 2001 13:16:56 $
|
||||||
// $Author: iceblink $
|
// $Author: iceblink $
|
||||||
//
|
//
|
||||||
@ -39,6 +39,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
*----------------------------------------------------------------------*/
|
*----------------------------------------------------------------------*/
|
||||||
/*
|
/*
|
||||||
* $Log: imbapi.c,v $
|
* $Log: imbapi.c,v $
|
||||||
|
* Revision 1.2 2004/08/31 23:52:58 iceblink
|
||||||
|
* fix lots of little errors that show up with -Werror -Wall
|
||||||
|
*
|
||||||
* Revision 1.1 2004/08/27 16:33:25 iceblink
|
* Revision 1.1 2004/08/27 16:33:25 iceblink
|
||||||
* add support for Intel IMB kernel driver (for legacy kernel support)
|
* add support for Intel IMB kernel driver (for legacy kernel support)
|
||||||
* imbapi.[ch] code is BSD licensed and taken from panicsel.sf.net
|
* imbapi.[ch] code is BSD licensed and taken from panicsel.sf.net
|
||||||
@ -113,7 +116,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
// pre-processor directives to separate os-specific code (pai 11/21) */
|
// pre-processor directives to separate os-specific code (pai 11/21) */
|
||||||
|
|
||||||
HANDLE AsyncEventHandle = 0;
|
HANDLE AsyncEventHandle = 0;
|
||||||
static void * AsyncEventObject = 0;
|
//static void * AsyncEventObject = 0;
|
||||||
static int IpmiVersion;
|
static int IpmiVersion;
|
||||||
|
|
||||||
/*////////////////////////////////////////////////////////////////////////////
|
/*////////////////////////////////////////////////////////////////////////////
|
||||||
@ -1743,7 +1746,7 @@ RegisterForImbAsyncMessageNotification (unsigned int *handleId)
|
|||||||
if( (respLength != sizeof(int)) || (status != TRUE ))
|
if( (respLength != sizeof(int)) || (status != TRUE ))
|
||||||
return ACCESN_ERROR;
|
return ACCESN_ERROR;
|
||||||
|
|
||||||
/* printf("imbapi: Register handle = %x\n",AsyncEventHandle); /*++++*/
|
/* printf("imbapi: Register handle = %x\n",AsyncEventHandle); *//*++++*/
|
||||||
*handleId = (unsigned int) AsyncEventHandle;
|
*handleId = (unsigned int) AsyncEventHandle;
|
||||||
|
|
||||||
#ifndef NO_MACRO_ARGS
|
#ifndef NO_MACRO_ARGS
|
||||||
@ -1958,7 +1961,7 @@ UnmapPhysicalMemory (
|
|||||||
ACCESN_STATUS
|
ACCESN_STATUS
|
||||||
MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
|
MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
|
||||||
{
|
{
|
||||||
int fd, i;
|
int fd;
|
||||||
unsigned int length = addressLength;
|
unsigned int length = addressLength;
|
||||||
off_t startpAddress = (off_t)startAddress;
|
off_t startpAddress = (off_t)startAddress;
|
||||||
unsigned int diff;
|
unsigned int diff;
|
||||||
@ -2012,7 +2015,7 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
|
|||||||
}
|
}
|
||||||
#endif /*LINUX_DEBUG_MAX */
|
#endif /*LINUX_DEBUG_MAX */
|
||||||
|
|
||||||
*virtualAddress = (int)(startvAddress + diff);
|
*virtualAddress = (long)(startvAddress + diff);
|
||||||
return ACCESN_OK;
|
return ACCESN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2029,7 +2032,7 @@ UnmapPhysicalMemory( int virtualAddress, int Length )
|
|||||||
DEBUG("%s: calling munmap(0x%x,%d)\n",__FUNCTION__,virtualAddress,Length);
|
DEBUG("%s: calling munmap(0x%x,%d)\n",__FUNCTION__,virtualAddress,Length);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(munmap((caddr_t)virtualAddress, Length) != 0)
|
if(munmap(&virtualAddress, Length) != 0)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*M*
|
/*M*
|
||||||
// PVCS:
|
// PVCS:
|
||||||
// $Workfile: imb_api.h $
|
// $Workfile: imb_api.h $
|
||||||
// $Revision: 1.1 $
|
// $Revision: 1.2 $
|
||||||
// $Modtime: Jul 22 2002 16:40:32 $
|
// $Modtime: Jul 22 2002 16:40:32 $
|
||||||
// $Author: iceblink $
|
// $Author: iceblink $
|
||||||
//
|
//
|
||||||
@ -378,15 +378,15 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
#define FILE_DEVICE_IMB 0x00008010
|
#define FILE_DEVICE_IMB 0x00008010
|
||||||
#define IOCTL_IMB_BASE 0x00000880
|
#define IOCTL_IMB_BASE 0x00000880
|
||||||
#define IOCTL_IMB_SEND_MESSAGE CTL_CODE(FILE_DEVICE_IMB, IOCTL_IMB_BASE + 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
#define IOCTL_IMB_SEND_MESSAGE CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 2), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#define IOCTL_IMB_GET_ASYNC_MSG CTL_CODE(FILE_DEVICE_IMB, IOCTL_IMB_BASE + 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
#define IOCTL_IMB_GET_ASYNC_MSG CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 8), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#define IOCTL_IMB_MAP_MEMORY CTL_CODE(FILE_DEVICE_IMB, IOCTL_IMB_BASE + 14,METHOD_BUFFERED, FILE_ANY_ACCESS)
|
#define IOCTL_IMB_MAP_MEMORY CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 14), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#define IOCTL_IMB_UNMAP_MEMORY CTL_CODE(FILE_DEVICE_IMB, IOCTL_IMB_BASE + 16,METHOD_BUFFERED, FILE_ANY_ACCESS)
|
#define IOCTL_IMB_UNMAP_MEMORY CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 16), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#define IOCTL_IMB_SHUTDOWN_CODE CTL_CODE(FILE_DEVICE_IMB, IOCTL_IMB_BASE + 18,METHOD_BUFFERED, FILE_ANY_ACCESS)
|
#define IOCTL_IMB_SHUTDOWN_CODE CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 18), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#define IOCTL_IMB_REGISTER_ASYNC_OBJ CTL_CODE(FILE_DEVICE_IMB, IOCTL_IMB_BASE + 24,METHOD_BUFFERED, FILE_ANY_ACCESS)
|
#define IOCTL_IMB_REGISTER_ASYNC_OBJ CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 24), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#define IOCTL_IMB_DEREGISTER_ASYNC_OBJ CTL_CODE(FILE_DEVICE_IMB, IOCTL_IMB_BASE + 26,METHOD_BUFFERED, FILE_ANY_ACCESS)
|
#define IOCTL_IMB_DEREGISTER_ASYNC_OBJ CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 26), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#define IOCTL_IMB_CHECK_EVENT CTL_CODE(FILE_DEVICE_IMB, IOCTL_IMB_BASE + 28,METHOD_BUFFERED, FILE_ANY_ACCESS)
|
#define IOCTL_IMB_CHECK_EVENT CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 28), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#define IOCTL_IMB_POLL_ASYNC CTL_CODE(FILE_DEVICE_IMB, IOCTL_IMB_BASE + 20,METHOD_BUFFERED, FILE_ANY_ACCESS)
|
#define IOCTL_IMB_POLL_ASYNC CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 20), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||||
#endif /* IMB_IF__ */
|
#endif /* IMB_IF__ */
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
/* No asynchronous messages available */
|
/* No asynchronous messages available */
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <ipmitool/ipmi_intf.h>
|
#include <ipmitool/ipmi_intf.h>
|
||||||
@ -76,7 +77,7 @@ struct ipmi_intf * ipmi_intf_table[] = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
char * ipmi_intf_print(void)
|
void ipmi_intf_print(void)
|
||||||
{
|
{
|
||||||
struct ipmi_intf ** intf;
|
struct ipmi_intf ** intf;
|
||||||
int def = 1;
|
int def = 1;
|
||||||
|
@ -80,7 +80,6 @@ const struct valstr ipmi_authtype_session_vals[] = {
|
|||||||
{ 0, NULL },
|
{ 0, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
static int recv_timeout = IPMI_LAN_TIMEOUT;
|
|
||||||
static sigjmp_buf jmpbuf;
|
static sigjmp_buf jmpbuf;
|
||||||
|
|
||||||
static int ipmi_lan_send_packet(struct ipmi_intf * intf, unsigned char * data, int data_len);
|
static int ipmi_lan_send_packet(struct ipmi_intf * intf, unsigned char * data, int data_len);
|
||||||
@ -483,8 +482,8 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
|||||||
printf("<< IPMI Response Session Header\n");
|
printf("<< IPMI Response Session Header\n");
|
||||||
printf("<< Authtype : %s\n",
|
printf("<< Authtype : %s\n",
|
||||||
val2str(rsp->session.authtype, ipmi_authtype_session_vals));
|
val2str(rsp->session.authtype, ipmi_authtype_session_vals));
|
||||||
printf("<< Sequence : 0x%08lx\n", rsp->session.seq);
|
printf("<< Sequence : 0x%08lx\n", (long)rsp->session.seq);
|
||||||
printf("<< Session ID : 0x%08lx\n", rsp->session.id);
|
printf("<< Session ID : 0x%08lx\n", (long)rsp->session.id);
|
||||||
|
|
||||||
printf("<< IPMI Response Message Header\n");
|
printf("<< IPMI Response Message Header\n");
|
||||||
printf("<< Rq Addr : %02x\n", rsp->payload.ipmi_response.rq_addr);
|
printf("<< Rq Addr : %02x\n", rsp->payload.ipmi_response.rq_addr);
|
||||||
@ -569,12 +568,13 @@ ipmi_lan_build_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
|
|||||||
.seq = 0xff,
|
.seq = 0xff,
|
||||||
};
|
};
|
||||||
unsigned char * msg, * temp;
|
unsigned char * msg, * temp;
|
||||||
int cs, cs2, mp, tmp;
|
int cs, mp, tmp;
|
||||||
int ap = 0;
|
int ap = 0;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
int cs2 = 0;
|
||||||
struct ipmi_rq_entry * entry;
|
struct ipmi_rq_entry * entry;
|
||||||
struct ipmi_session * s = intf->session;
|
struct ipmi_session * s = intf->session;
|
||||||
static curr_seq = 0;
|
static int curr_seq = 0;
|
||||||
|
|
||||||
if (curr_seq >= 64)
|
if (curr_seq >= 64)
|
||||||
curr_seq = 0;
|
curr_seq = 0;
|
||||||
@ -648,8 +648,8 @@ ipmi_lan_build_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
|
|||||||
printf(">> IPMI Request Session Header\n");
|
printf(">> IPMI Request Session Header\n");
|
||||||
printf(">> Authtype : %s\n",
|
printf(">> Authtype : %s\n",
|
||||||
val2str(s->authtype, ipmi_authtype_session_vals));
|
val2str(s->authtype, ipmi_authtype_session_vals));
|
||||||
printf(">> Sequence : 0x%08lx\n", s->in_seq);
|
printf(">> Sequence : 0x%08lx\n", (long)s->in_seq);
|
||||||
printf(">> Session ID : 0x%08lx\n", s->session_id);
|
printf(">> Session ID : 0x%08lx\n", (long)s->session_id);
|
||||||
|
|
||||||
printf(">> IPMI Request Message Header\n");
|
printf(">> IPMI Request Message Header\n");
|
||||||
printf(">> Rs Addr : %02x\n", intf->target_addr);
|
printf(">> Rs Addr : %02x\n", intf->target_addr);
|
||||||
@ -752,7 +752,7 @@ unsigned char * ipmi_lan_build_rsp(struct ipmi_intf * intf, struct ipmi_rs * rsp
|
|||||||
.class = RMCP_CLASS_IPMI,
|
.class = RMCP_CLASS_IPMI,
|
||||||
.seq = 0xff,
|
.seq = 0xff,
|
||||||
};
|
};
|
||||||
int cs, mp, ap = 0, tmp, rv;
|
int cs, mp, ap = 0, tmp;
|
||||||
int len;
|
int len;
|
||||||
unsigned char * msg;
|
unsigned char * msg;
|
||||||
|
|
||||||
@ -1009,10 +1009,8 @@ ipmi_get_session_challenge_cmd(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
if (verbose > 1) {
|
if (verbose > 1) {
|
||||||
printf("Opening Session\n");
|
printf("Opening Session\n");
|
||||||
printf(" Session ID : %08lx\n",
|
printf(" Session ID : %08lx\n", (long)s->session_id);
|
||||||
s->session_id);
|
printf(" Challenge : %s\n", buf2str(s->challenge, 16));
|
||||||
printf(" Challenge : %s\n",
|
|
||||||
buf2str(s->challenge, 16));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1104,8 +1102,8 @@ ipmi_activate_session_cmd(struct ipmi_intf * intf)
|
|||||||
val2str(rsp->data[0], ipmi_authtype_session_vals));
|
val2str(rsp->data[0], ipmi_authtype_session_vals));
|
||||||
printf(" Max Priv Level : %s\n",
|
printf(" Max Priv Level : %s\n",
|
||||||
val2str(rsp->data[9], ipmi_privlvl_vals));
|
val2str(rsp->data[9], ipmi_privlvl_vals));
|
||||||
printf(" Session ID : %08lx\n", s->session_id);
|
printf(" Session ID : %08lx\n", (long)s->session_id);
|
||||||
printf(" Inbound Seq : %08lx\n", s->in_seq);
|
printf(" Inbound Seq : %08lx\n", (long)s->in_seq);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1182,7 +1180,7 @@ impi_close_session_cmd(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
if (rsp->ccode == 0x87) {
|
if (rsp->ccode == 0x87) {
|
||||||
printf("Failed to Close Session: invalid session ID %08lx\n",
|
printf("Failed to Close Session: invalid session ID %08lx\n",
|
||||||
session_id);
|
(long)session_id);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (rsp->ccode) {
|
if (rsp->ccode) {
|
||||||
@ -1191,7 +1189,7 @@ impi_close_session_cmd(struct ipmi_intf * intf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (verbose > 1)
|
if (verbose > 1)
|
||||||
printf("\nClosed Session %08lx\n\n", session_id);
|
printf("\nClosed Session %08lx\n\n", (long)session_id);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ static struct ipmi_rs * ipmi_lanplus_recv_sol(struct ipmi_intf * intf);
|
|||||||
static struct ipmi_rs * ipmi_lanplus_send_sol(
|
static struct ipmi_rs * ipmi_lanplus_send_sol(
|
||||||
struct ipmi_intf * intf,
|
struct ipmi_intf * intf,
|
||||||
struct ipmi_v2_payload * payload);
|
struct ipmi_v2_payload * payload);
|
||||||
static int check_sol_packet_for_data(
|
static int check_sol_packet_for_new_data(
|
||||||
struct ipmi_intf * intf,
|
struct ipmi_intf * intf,
|
||||||
struct ipmi_rs *rsp);
|
struct ipmi_rs *rsp);
|
||||||
static void ack_sol_packet(
|
static void ack_sol_packet(
|
||||||
@ -546,9 +546,9 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
|||||||
printf("<< Payload type : 0x%x\n",
|
printf("<< Payload type : 0x%x\n",
|
||||||
rsp->session.payloadtype);
|
rsp->session.payloadtype);
|
||||||
printf("<< Session ID : 0x%08lx\n",
|
printf("<< Session ID : 0x%08lx\n",
|
||||||
rsp->session.id);
|
(long)rsp->session.id);
|
||||||
printf("<< Sequence : 0x%08lx\n",
|
printf("<< Sequence : 0x%08lx\n",
|
||||||
rsp->session.seq);
|
(long)rsp->session.seq);
|
||||||
|
|
||||||
printf("<< IPMI Msg/Payload Length : %d\n",
|
printf("<< IPMI Msg/Payload Length : %d\n",
|
||||||
rsp->session.msglen);
|
rsp->session.msglen);
|
||||||
@ -1702,8 +1702,8 @@ ipmi_lanplus_build_v15_ipmi_cmd(
|
|||||||
printf(">> IPMI Request Session Header\n");
|
printf(">> IPMI Request Session Header\n");
|
||||||
printf(">> Authtype : %s\n", val2str(IPMI_SESSION_AUTHTYPE_NONE,
|
printf(">> Authtype : %s\n", val2str(IPMI_SESSION_AUTHTYPE_NONE,
|
||||||
ipmi_authtype_vals));
|
ipmi_authtype_vals));
|
||||||
printf(">> Sequence : 0x%08lx\n", session->out_seq);
|
printf(">> Sequence : 0x%08lx\n", (long)session->out_seq);
|
||||||
printf(">> Session ID : 0x%08lx\n", 0);
|
printf(">> Session ID : 0x%08lx\n", (long)0);
|
||||||
|
|
||||||
printf(">> IPMI Request Message Header\n");
|
printf(">> IPMI Request Message Header\n");
|
||||||
printf(">> Rs Addr : %02x\n", IPMI_BMC_SLAVE_ADDR);
|
printf(">> Rs Addr : %02x\n", IPMI_BMC_SLAVE_ADDR);
|
||||||
@ -1772,7 +1772,7 @@ ipmi_lanplus_send_payload(
|
|||||||
struct ipmi_intf * intf,
|
struct ipmi_intf * intf,
|
||||||
struct ipmi_v2_payload * payload)
|
struct ipmi_v2_payload * payload)
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp = NULL;
|
||||||
unsigned char * msg_data;
|
unsigned char * msg_data;
|
||||||
int msg_length;
|
int msg_length;
|
||||||
struct ipmi_session * session = intf->session;
|
struct ipmi_session * session = intf->session;
|
||||||
@ -2368,7 +2368,7 @@ impi_close_session_cmd(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
if (rsp->ccode == 0x87) {
|
if (rsp->ccode == 0x87) {
|
||||||
printf("Failed to Close Session: invalid session ID %08lx\n",
|
printf("Failed to Close Session: invalid session ID %08lx\n",
|
||||||
intf->session->v2_data.bmc_id);
|
(long)intf->session->v2_data.bmc_id);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (rsp->ccode) {
|
if (rsp->ccode) {
|
||||||
@ -2377,7 +2377,7 @@ impi_close_session_cmd(struct ipmi_intf * intf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (verbose > 1)
|
if (verbose > 1)
|
||||||
printf("\nClosed Session %08lx\n\n", intf->session->v2_data.bmc_id);
|
printf("\nClosed Session %08lx\n\n", (long)intf->session->v2_data.bmc_id);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -62,10 +62,10 @@ void lanplus_dump_open_session_response(const struct ipmi_rs * rsp)
|
|||||||
ipmi_priv_levels));
|
ipmi_priv_levels));
|
||||||
printf("%s Console Session ID : 0x%08lx\n",
|
printf("%s Console Session ID : 0x%08lx\n",
|
||||||
DUMP_PREFIX_INCOMING,
|
DUMP_PREFIX_INCOMING,
|
||||||
rsp->payload.open_session_response.console_id);
|
(long)rsp->payload.open_session_response.console_id);
|
||||||
printf("%s BMC Session ID : 0x%08lx\n",
|
printf("%s BMC Session ID : 0x%08lx\n",
|
||||||
DUMP_PREFIX_INCOMING,
|
DUMP_PREFIX_INCOMING,
|
||||||
rsp->payload.open_session_response.bmc_id);
|
(long)rsp->payload.open_session_response.bmc_id);
|
||||||
printf("%s Negotiated authenticatin algorithm : %s\n",
|
printf("%s Negotiated authenticatin algorithm : %s\n",
|
||||||
DUMP_PREFIX_INCOMING,
|
DUMP_PREFIX_INCOMING,
|
||||||
val2str(rsp->payload.open_session_response.auth_alg,
|
val2str(rsp->payload.open_session_response.auth_alg,
|
||||||
@ -100,7 +100,7 @@ void lanplus_dump_rakp2_message(const struct ipmi_rs * rsp, unsigned char auth_a
|
|||||||
|
|
||||||
printf("%s Console Session ID : 0x%08lx\n",
|
printf("%s Console Session ID : 0x%08lx\n",
|
||||||
DUMP_PREFIX_INCOMING,
|
DUMP_PREFIX_INCOMING,
|
||||||
rsp->payload.rakp2_message.console_id);
|
(long)rsp->payload.rakp2_message.console_id);
|
||||||
|
|
||||||
printf("%s BMC random number : 0x", DUMP_PREFIX_INCOMING);
|
printf("%s BMC random number : 0x", DUMP_PREFIX_INCOMING);
|
||||||
for (i = 0; i < 16; ++i)
|
for (i = 0; i < 16; ++i)
|
||||||
@ -154,7 +154,7 @@ void lanplus_dump_rakp4_message(const struct ipmi_rs * rsp, unsigned char auth_a
|
|||||||
|
|
||||||
printf("%s Console Session ID : 0x%08lx\n",
|
printf("%s Console Session ID : 0x%08lx\n",
|
||||||
DUMP_PREFIX_INCOMING,
|
DUMP_PREFIX_INCOMING,
|
||||||
rsp->payload.rakp2_message.console_id);
|
(long)rsp->payload.rakp2_message.console_id);
|
||||||
|
|
||||||
printf("%s BMC random number : 0x", DUMP_PREFIX_INCOMING);
|
printf("%s BMC random number : 0x", DUMP_PREFIX_INCOMING);
|
||||||
for (i = 0; i < 16; ++i)
|
for (i = 0; i < 16; ++i)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user