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([getpassphrase])
|
||||
|
||||
dnl CFLAGS="$CFLAGS -Wall -Werror"
|
||||
dnl AC_SUBST(CFLAGS)
|
||||
CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Werror"
|
||||
AC_SUBST(CFLAGS)
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
LIBTOOL="$LIBTOOL --silent"
|
||||
|
@ -159,7 +159,7 @@ struct ipmi_intf {
|
||||
};
|
||||
|
||||
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_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 fru_info fru;
|
||||
unsigned char spd_data[256], msg_data[4];
|
||||
int i, len, offset;
|
||||
int size, conf;
|
||||
int len, offset, size;
|
||||
|
||||
msg_data[0] = id;
|
||||
|
||||
|
@ -190,7 +190,6 @@ static int ipmi_bmc_get_enables(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct bmc_enables_data en;
|
||||
struct bitfield_data * bf;
|
||||
|
||||
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_MINOR(devid->ipmi_version));
|
||||
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",
|
||||
buf2short((unsigned char *)(devid->product_id)),
|
||||
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;
|
||||
unsigned char rqdata[2];
|
||||
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);
|
||||
|
||||
|
@ -182,7 +182,7 @@ static void ipmi_chassis_poh(struct ipmi_intf * intf)
|
||||
memcpy(&count, rsp->data+1, 4);
|
||||
|
||||
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)
|
||||
|
@ -53,7 +53,7 @@ static char * get_fru_area_str(unsigned char * data, int * offset)
|
||||
{
|
||||
static const char bcd_plus[] = "0123456789 -.:,_";
|
||||
char * str;
|
||||
int len, size, i, j, k;
|
||||
int len, size=0, i, j, k;
|
||||
int off = *offset;
|
||||
union {
|
||||
uint32_t bits;
|
||||
@ -561,7 +561,7 @@ static void ipmi_fru_print_all(struct ipmi_intf * intf)
|
||||
if (!(itr = ipmi_sdr_start(intf)))
|
||||
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)
|
||||
continue;
|
||||
|
@ -34,6 +34,10 @@
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_raw.h>
|
||||
|
@ -110,10 +110,9 @@ ipmi_sensor_print_full_discrete(struct ipmi_intf * intf,
|
||||
{
|
||||
char id[17];
|
||||
char * unitstr = "discrete";
|
||||
int i=0, validread=1;
|
||||
unsigned char val;
|
||||
int validread=1;
|
||||
unsigned char val = 0;
|
||||
struct ipmi_rs * rsp;
|
||||
char * status;
|
||||
|
||||
if (!sensor)
|
||||
return;
|
||||
@ -238,9 +237,9 @@ ipmi_sensor_print_full_analog(struct ipmi_intf * intf,
|
||||
{
|
||||
char unitstr[16], id[17];
|
||||
int i=0, validread=1, thresh_available = 1;
|
||||
float val;
|
||||
float val = 0.0;
|
||||
struct ipmi_rs * rsp;
|
||||
char * status;
|
||||
char * status = NULL;
|
||||
|
||||
if (!sensor)
|
||||
return;
|
||||
@ -320,7 +319,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf * intf,
|
||||
printf("| %-10.3f | %-10s | %-6s",
|
||||
val,
|
||||
unitstr,
|
||||
status);
|
||||
status ? : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -387,7 +386,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf * intf,
|
||||
(tol==(int)tol) ? 0 : 3,
|
||||
tol,
|
||||
unitstr);
|
||||
printf("Status : %s\n", status);
|
||||
printf("Status : %s\n", status ? : "");
|
||||
|
||||
if (thresh_available)
|
||||
{
|
||||
@ -443,10 +442,9 @@ void ipmi_sensor_print_compact(struct ipmi_intf * intf,
|
||||
{
|
||||
char id[17];
|
||||
char * unitstr = "discrete";
|
||||
int i=0, validread=1;
|
||||
unsigned char val;
|
||||
int validread=1;
|
||||
unsigned char val = 0;
|
||||
struct ipmi_rs * rsp;
|
||||
char * status;
|
||||
|
||||
if (!sensor)
|
||||
return;
|
||||
@ -581,7 +579,7 @@ ipmi_sensor_list(struct ipmi_intf * intf)
|
||||
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);
|
||||
if (!rec)
|
||||
|
@ -296,6 +296,8 @@ ipmi_get_session_info(struct ipmi_intf * intf,
|
||||
rqdata[1] = (unsigned char)id_or_handle;
|
||||
req.msg.data_len = 2;
|
||||
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;
|
||||
uint32_t id_or_handle;
|
||||
uint32_t id_or_handle = 0;
|
||||
|
||||
if (!strncmp(argv[1], "active", 6))
|
||||
session_request_type = IPMI_SESSION_REQUEST_CURRENT;
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
#include <termios.h>
|
||||
@ -67,7 +68,6 @@
|
||||
|
||||
static struct termios _saved_tio;
|
||||
static int _in_raw_mode = 0;
|
||||
static int bShouldExit = 0;
|
||||
|
||||
extern int verbose;
|
||||
|
||||
@ -699,8 +699,6 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
|
||||
*/
|
||||
else if (! strcmp(param, "non-volatile-bit-rate"))
|
||||
{
|
||||
struct sol_config_parameters params;
|
||||
|
||||
req.msg.data_len = 3;
|
||||
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"))
|
||||
{
|
||||
struct sol_config_parameters params;
|
||||
|
||||
req.msg.data_len = 3;
|
||||
data[1] = SOL_PARAMETER_SOL_VOLATILE_BIT_RATE;
|
||||
|
||||
@ -1142,8 +1138,6 @@ ipmi_sol_red_pill(struct ipmi_intf * intf)
|
||||
fd_set read_fds;
|
||||
struct timeval tv;
|
||||
int retval;
|
||||
size_t num_read;
|
||||
char c;
|
||||
int buffer_size = intf->session->sol_data.max_inbound_payload_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))
|
||||
{
|
||||
int i;
|
||||
struct ipmi_rs * rs =intf->recv_sol(intf);
|
||||
if (! rs)
|
||||
{
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
@ -489,7 +490,7 @@ ipmi_user_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
if ((argc >= 3) &&
|
||||
(! strcmp("password", argv[1])))
|
||||
{
|
||||
char * password;
|
||||
char * password = NULL;
|
||||
unsigned char user_id = (unsigned char)strtol(argv[2],
|
||||
NULL,
|
||||
0);
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/poll.h>
|
||||
|
||||
#include <config.h>
|
||||
@ -67,7 +68,9 @@ static void daemonize(void)
|
||||
{
|
||||
pid_t pid;
|
||||
int fd;
|
||||
#ifdef SIGHUP
|
||||
sigset_t sighup;
|
||||
#endif
|
||||
|
||||
/* if we are started from init no need to become daemon */
|
||||
if (getppid() == 1)
|
||||
@ -128,7 +131,6 @@ static int enable_event_msg_buffer(struct ipmi_intf * intf)
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
unsigned char bmc_global_enables;
|
||||
int r;
|
||||
|
||||
/* we must read/modify/write bmc global enables */
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/log.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.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];
|
||||
int __argc, rc=0;
|
||||
|
||||
while (pbuf = (char *)readline(PROMPT)) {
|
||||
while ((pbuf = (char *)readline(PROMPT)) != NULL) {
|
||||
if (strlen(pbuf) == 0) {
|
||||
continue;
|
||||
}
|
||||
@ -265,7 +266,6 @@ int main(int argc, char ** argv)
|
||||
char * progname = NULL;
|
||||
int port = 0;
|
||||
int argflag, i;
|
||||
int intfarg = 0;
|
||||
int rc = 0;
|
||||
int thump = 0;
|
||||
|
||||
@ -418,7 +418,6 @@ int main(int argc, char ** argv)
|
||||
/* now we finally run the command */
|
||||
ipmi_cmd_run(intf, argv[optind], argc-optind-1, &(argv[optind+1]));
|
||||
|
||||
out_close:
|
||||
if (intf->opened && intf->close)
|
||||
intf->close(intf);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*M*
|
||||
// PVCS:
|
||||
// $Workfile: imbapi.c $
|
||||
// $Revision: 1.1 $
|
||||
// $Revision: 1.2 $
|
||||
// $Modtime: 06 Aug 2001 13:16:56 $
|
||||
// $Author: iceblink $
|
||||
//
|
||||
@ -39,6 +39,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*----------------------------------------------------------------------*/
|
||||
/*
|
||||
* $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
|
||||
* add support for Intel IMB kernel driver (for legacy kernel support)
|
||||
* 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) */
|
||||
|
||||
HANDLE AsyncEventHandle = 0;
|
||||
static void * AsyncEventObject = 0;
|
||||
//static void * AsyncEventObject = 0;
|
||||
static int IpmiVersion;
|
||||
|
||||
/*////////////////////////////////////////////////////////////////////////////
|
||||
@ -1743,7 +1746,7 @@ RegisterForImbAsyncMessageNotification (unsigned int *handleId)
|
||||
if( (respLength != sizeof(int)) || (status != TRUE ))
|
||||
return ACCESN_ERROR;
|
||||
|
||||
/* printf("imbapi: Register handle = %x\n",AsyncEventHandle); /*++++*/
|
||||
/* printf("imbapi: Register handle = %x\n",AsyncEventHandle); *//*++++*/
|
||||
*handleId = (unsigned int) AsyncEventHandle;
|
||||
|
||||
#ifndef NO_MACRO_ARGS
|
||||
@ -1958,7 +1961,7 @@ UnmapPhysicalMemory (
|
||||
ACCESN_STATUS
|
||||
MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
|
||||
{
|
||||
int fd, i;
|
||||
int fd;
|
||||
unsigned int length = addressLength;
|
||||
off_t startpAddress = (off_t)startAddress;
|
||||
unsigned int diff;
|
||||
@ -2012,7 +2015,7 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
|
||||
}
|
||||
#endif /*LINUX_DEBUG_MAX */
|
||||
|
||||
*virtualAddress = (int)(startvAddress + diff);
|
||||
*virtualAddress = (long)(startvAddress + diff);
|
||||
return ACCESN_OK;
|
||||
}
|
||||
|
||||
@ -2029,7 +2032,7 @@ UnmapPhysicalMemory( int virtualAddress, int Length )
|
||||
DEBUG("%s: calling munmap(0x%x,%d)\n",__FUNCTION__,virtualAddress,Length);
|
||||
#endif
|
||||
|
||||
if(munmap((caddr_t)virtualAddress, Length) != 0)
|
||||
if(munmap(&virtualAddress, Length) != 0)
|
||||
{
|
||||
char buf[128];
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*M*
|
||||
// PVCS:
|
||||
// $Workfile: imb_api.h $
|
||||
// $Revision: 1.1 $
|
||||
// $Revision: 1.2 $
|
||||
// $Modtime: Jul 22 2002 16:40:32 $
|
||||
// $Author: iceblink $
|
||||
//
|
||||
@ -378,15 +378,15 @@ typedef struct {
|
||||
*/
|
||||
#define FILE_DEVICE_IMB 0x00008010
|
||||
#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_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_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_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_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_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_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_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_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_POLL_ASYNC CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 20), METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#endif /* IMB_IF__ */
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* No asynchronous messages available */
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <config.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
@ -76,7 +77,7 @@ struct ipmi_intf * ipmi_intf_table[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
char * ipmi_intf_print(void)
|
||||
void ipmi_intf_print(void)
|
||||
{
|
||||
struct ipmi_intf ** intf;
|
||||
int def = 1;
|
||||
|
@ -80,7 +80,6 @@ const struct valstr ipmi_authtype_session_vals[] = {
|
||||
{ 0, NULL },
|
||||
};
|
||||
|
||||
static int recv_timeout = IPMI_LAN_TIMEOUT;
|
||||
static sigjmp_buf jmpbuf;
|
||||
|
||||
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("<< Authtype : %s\n",
|
||||
val2str(rsp->session.authtype, ipmi_authtype_session_vals));
|
||||
printf("<< Sequence : 0x%08lx\n", rsp->session.seq);
|
||||
printf("<< Session ID : 0x%08lx\n", rsp->session.id);
|
||||
printf("<< Sequence : 0x%08lx\n", (long)rsp->session.seq);
|
||||
printf("<< Session ID : 0x%08lx\n", (long)rsp->session.id);
|
||||
|
||||
printf("<< IPMI Response Message Header\n");
|
||||
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,
|
||||
};
|
||||
unsigned char * msg, * temp;
|
||||
int cs, cs2, mp, tmp;
|
||||
int cs, mp, tmp;
|
||||
int ap = 0;
|
||||
int len = 0;
|
||||
int cs2 = 0;
|
||||
struct ipmi_rq_entry * entry;
|
||||
struct ipmi_session * s = intf->session;
|
||||
static curr_seq = 0;
|
||||
static int curr_seq = 0;
|
||||
|
||||
if (curr_seq >= 64)
|
||||
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(">> Authtype : %s\n",
|
||||
val2str(s->authtype, ipmi_authtype_session_vals));
|
||||
printf(">> Sequence : 0x%08lx\n", s->in_seq);
|
||||
printf(">> Session ID : 0x%08lx\n", s->session_id);
|
||||
printf(">> Sequence : 0x%08lx\n", (long)s->in_seq);
|
||||
printf(">> Session ID : 0x%08lx\n", (long)s->session_id);
|
||||
|
||||
printf(">> IPMI Request Message Header\n");
|
||||
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,
|
||||
.seq = 0xff,
|
||||
};
|
||||
int cs, mp, ap = 0, tmp, rv;
|
||||
int cs, mp, ap = 0, tmp;
|
||||
int len;
|
||||
unsigned char * msg;
|
||||
|
||||
@ -1009,10 +1009,8 @@ ipmi_get_session_challenge_cmd(struct ipmi_intf * intf)
|
||||
|
||||
if (verbose > 1) {
|
||||
printf("Opening Session\n");
|
||||
printf(" Session ID : %08lx\n",
|
||||
s->session_id);
|
||||
printf(" Challenge : %s\n",
|
||||
buf2str(s->challenge, 16));
|
||||
printf(" Session ID : %08lx\n", (long)s->session_id);
|
||||
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));
|
||||
printf(" Max Priv Level : %s\n",
|
||||
val2str(rsp->data[9], ipmi_privlvl_vals));
|
||||
printf(" Session ID : %08lx\n", s->session_id);
|
||||
printf(" Inbound Seq : %08lx\n", s->in_seq);
|
||||
printf(" Session ID : %08lx\n", (long)s->session_id);
|
||||
printf(" Inbound Seq : %08lx\n", (long)s->in_seq);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
@ -1182,7 +1180,7 @@ impi_close_session_cmd(struct ipmi_intf * intf)
|
||||
|
||||
if (rsp->ccode == 0x87) {
|
||||
printf("Failed to Close Session: invalid session ID %08lx\n",
|
||||
session_id);
|
||||
(long)session_id);
|
||||
return -1;
|
||||
}
|
||||
if (rsp->ccode) {
|
||||
@ -1191,7 +1189,7 @@ impi_close_session_cmd(struct ipmi_intf * intf)
|
||||
}
|
||||
|
||||
if (verbose > 1)
|
||||
printf("\nClosed Session %08lx\n\n", session_id);
|
||||
printf("\nClosed Session %08lx\n\n", (long)session_id);
|
||||
|
||||
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(
|
||||
struct ipmi_intf * intf,
|
||||
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_rs *rsp);
|
||||
static void ack_sol_packet(
|
||||
@ -546,9 +546,9 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
||||
printf("<< Payload type : 0x%x\n",
|
||||
rsp->session.payloadtype);
|
||||
printf("<< Session ID : 0x%08lx\n",
|
||||
rsp->session.id);
|
||||
(long)rsp->session.id);
|
||||
printf("<< Sequence : 0x%08lx\n",
|
||||
rsp->session.seq);
|
||||
(long)rsp->session.seq);
|
||||
|
||||
printf("<< IPMI Msg/Payload Length : %d\n",
|
||||
rsp->session.msglen);
|
||||
@ -1702,8 +1702,8 @@ ipmi_lanplus_build_v15_ipmi_cmd(
|
||||
printf(">> IPMI Request Session Header\n");
|
||||
printf(">> Authtype : %s\n", val2str(IPMI_SESSION_AUTHTYPE_NONE,
|
||||
ipmi_authtype_vals));
|
||||
printf(">> Sequence : 0x%08lx\n", session->out_seq);
|
||||
printf(">> Session ID : 0x%08lx\n", 0);
|
||||
printf(">> Sequence : 0x%08lx\n", (long)session->out_seq);
|
||||
printf(">> Session ID : 0x%08lx\n", (long)0);
|
||||
|
||||
printf(">> IPMI Request Message Header\n");
|
||||
printf(">> Rs Addr : %02x\n", IPMI_BMC_SLAVE_ADDR);
|
||||
@ -1772,7 +1772,7 @@ ipmi_lanplus_send_payload(
|
||||
struct ipmi_intf * intf,
|
||||
struct ipmi_v2_payload * payload)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rs * rsp = NULL;
|
||||
unsigned char * msg_data;
|
||||
int msg_length;
|
||||
struct ipmi_session * session = intf->session;
|
||||
@ -2368,7 +2368,7 @@ impi_close_session_cmd(struct ipmi_intf * intf)
|
||||
|
||||
if (rsp->ccode == 0x87) {
|
||||
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;
|
||||
}
|
||||
if (rsp->ccode) {
|
||||
@ -2377,7 +2377,7 @@ impi_close_session_cmd(struct ipmi_intf * intf)
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -62,10 +62,10 @@ void lanplus_dump_open_session_response(const struct ipmi_rs * rsp)
|
||||
ipmi_priv_levels));
|
||||
printf("%s Console Session ID : 0x%08lx\n",
|
||||
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",
|
||||
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",
|
||||
DUMP_PREFIX_INCOMING,
|
||||
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",
|
||||
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);
|
||||
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",
|
||||
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);
|
||||
for (i = 0; i < 16; ++i)
|
||||
|
Loading…
x
Reference in New Issue
Block a user