summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/ialarms.c2
-rw-r--r--util/icmd.c2
-rw-r--r--util/iconfig.c2
-rw-r--r--util/idcmi.c2
-rw-r--r--util/ievents.c2
-rw-r--r--util/ifirewall.c2
-rw-r--r--util/ifru.c20
-rw-r--r--util/ifruset.c2
-rw-r--r--util/igetevent.c2
-rw-r--r--util/ihealth.c2
-rw-r--r--util/ilan.c2
-rw-r--r--util/imb_api.h29
-rw-r--r--util/ipicmg.c2
-rw-r--r--util/ipmicmd.c8
-rw-r--r--util/ipmidir.c6
-rw-r--r--util/ipmimv.c6
-rw-r--r--util/ipmiutil.c2
-rw-r--r--util/ireset.c2
-rw-r--r--util/isel.c2
-rw-r--r--util/iseltime.c2
-rw-r--r--util/isensor.c3
-rw-r--r--util/iserial.c2
-rw-r--r--util/isol.c2
-rw-r--r--util/itsol.c2
-rw-r--r--util/iwdt.c2
-rw-r--r--util/oem_dell.c2
-rw-r--r--util/oem_sun.c2
-rw-r--r--util/oem_supermicro.c2
28 files changed, 64 insertions, 52 deletions
diff --git a/util/ialarms.c b/util/ialarms.c
index e13960b..2519345 100644
--- a/util/ialarms.c
+++ b/util/ialarms.c
@@ -75,7 +75,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "ialarms";
static char fdebug = 0;
static char fbmctam = 0;
diff --git a/util/icmd.c b/util/icmd.c
index 4472879..b481c96 100644
--- a/util/icmd.c
+++ b/util/icmd.c
@@ -78,7 +78,7 @@ extern void ipmi_lan_set_timeout(int ipmito, int tries, int pingto);
/*
* Global variables
*/
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "icmd";
static char fdebug = 0;
static char fquiet = 0;
diff --git a/util/iconfig.c b/util/iconfig.c
index ea2b65d..6f7fd83 100644
--- a/util/iconfig.c
+++ b/util/iconfig.c
@@ -171,7 +171,7 @@ typedef struct
/*
* Global variables
*/
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "iconfig";
static char fdebug = 0;
static char fipmilan = 0;
diff --git a/util/idcmi.c b/util/idcmi.c
index 173e55a..2786efb 100644
--- a/util/idcmi.c
+++ b/util/idcmi.c
@@ -62,7 +62,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "idcmi.h"
static char * progname = "idcmi";
-static char * progver = "2.97";
+static char * progver = "2.98";
extern char fdebug; /*from ipmicmd.c*/
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
diff --git a/util/ievents.c b/util/ievents.c
index dcef599..cc40318 100644
--- a/util/ievents.c
+++ b/util/ievents.c
@@ -76,7 +76,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define SELprintf printf
#define SMS_SA 0x41
#define SMI_SA 0x21
-static char *progver = "2.97";
+static char *progver = "2.98";
static char *progname = "ievents";
static char fsensdesc = 0; /* 1= get extended sensor descriptions*/
static char fcanonical = 0; /* 1= show canonical, delimited output*/
diff --git a/util/ifirewall.c b/util/ifirewall.c
index 9a9fa25..18dca7a 100644
--- a/util/ifirewall.c
+++ b/util/ifirewall.c
@@ -64,7 +64,7 @@
/* global variables */
static char * progname = "ifirewall";
-static char * progver = "2.97";
+static char * progver = "2.98";
static char fdebug = 0;
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
diff --git a/util/ifru.c b/util/ifru.c
index 61a19f3..b10c42e 100644
--- a/util/ifru.c
+++ b/util/ifru.c
@@ -116,7 +116,7 @@ extern int ipmi_kontronoem_main(void * intf, int argc, char ** argv);
#endif
static char *progname = "ifru";
-static char *progver = "2.97";
+static char *progver = "2.98";
static int vend_id = 0;
static int prod_id = 0;
static char fdebug = 0;
@@ -736,33 +736,33 @@ void show_fru_multi(char *tag, int midx, uchar mtype, uchar *pdata, int dlen)
printf("\t Standby power \t%c %s\n", bdelim,
(b2 ? "Yes" : "No"));
v1 = pdata[1] + (pdata[2] << 8);
- printf("\t Nominal voltage \t%c %.2f V\n", bdelim, v1 / 100);
+ printf("\t Nominal voltage \t%c %.2f V\n", bdelim, (double)v1 / 100);
v2 = pdata[3] + (pdata[4] << 8);
v3 = pdata[5] + (pdata[6] << 8);
printf("\t Voltage deviation \t%c + %.2f V / - %.2f V\n",
- bdelim, v3/100, v2/100);
+ bdelim, (double)v3/100, (double)v2/100);
v4 = pdata[7] + (pdata[8] << 8);
printf("\t Ripple and noise pk-pk \t%c %d mV\n", bdelim, v4);
v5 = pdata[9] + (pdata[10] << 8);
- printf("\t Min current draw \t%c %.3f A\n", bdelim, v5/1000);
+ printf("\t Min current draw \t%c %.3f A\n", bdelim, (double)v5/1000);
v6 = pdata[11] + (pdata[12] << 8);
- printf("\t Max current draw \t%c %.3f A\n", bdelim, v6/1000);
+ printf("\t Max current draw \t%c %.3f A\n", bdelim, (double)v6/1000);
break;
case 0x02: /*DC Load*/
b1 = pdata[0] & 0x0f;
printf("%sDC Load %c number %d\n",mystr,bdelim,b1);
v1 = pdata[1] + (pdata[2] << 8);
- printf("\t Nominal voltage \t%c %.2f V\n", bdelim, v1 / 100);
+ printf("\t Nominal voltage \t%c %.2f V\n", bdelim, (double)v1 / 100);
v2 = pdata[3] + (pdata[4] << 8);
v3 = pdata[5] + (pdata[6] << 8);
- printf("\t Min voltage allowed \t%c %.2f A\n", bdelim, v2);
- printf("\t Max voltage allowed \t%c %.2f A\n", bdelim, v3);
+ printf("\t Min voltage allowed \t%c %.2f A\n", bdelim, (double)v2);
+ printf("\t Max voltage allowed \t%c %.2f A\n", bdelim, (double)v3);
v4 = pdata[7] + (pdata[8] << 8);
printf("\t Ripple and noise pk-pk \t%c %d mV\n", bdelim, v4);
v5 = pdata[9] + (pdata[10] << 8);
- printf("\t Min current load \t%c %.3f A\n", bdelim, v5/1000);
+ printf("\t Min current load \t%c %.3f A\n", bdelim, (double)v5/1000);
v6 = pdata[11] + (pdata[12] << 8);
- printf("\t Max current load \t%c %.3f A\n", bdelim, v6/1000);
+ printf("\t Max current load \t%c %.3f A\n", bdelim, (double)v6/1000);
break;
case 0x03: /*Management Access*/
b1 = pdata[0];
diff --git a/util/ifruset.c b/util/ifruset.c
index f8beada..b7a894c 100644
--- a/util/ifruset.c
+++ b/util/ifruset.c
@@ -106,7 +106,7 @@ extern void fmt_time(time_t etime, char *buf, int bufsz); /*see ievents.c*/
#define IPROD_OEM 7
static char *progname = "ifruset";
-static char *progver = "2.97";
+static char *progver = "2.98";
static char fdebug = 0;
static char fpicmg = 0;
static char fonlybase = 0;
diff --git a/util/igetevent.c b/util/igetevent.c
index 25d0d8e..9d1786c 100644
--- a/util/igetevent.c
+++ b/util/igetevent.c
@@ -169,7 +169,7 @@ extern void free_sdr_cache(uchar *pret); /*see isensor.c*/
* Global variables
*/
static char * progname = "igetevent";
-static char * progver = "2.97";
+static char * progver = "2.98";
static char fdebug = 0;
static char fipmilan = 0;
static char frunonce = 0;
diff --git a/util/ihealth.c b/util/ihealth.c
index fbe5f0d..76f1121 100644
--- a/util/ihealth.c
+++ b/util/ihealth.c
@@ -82,7 +82,7 @@ extern int oem_supermicro_get_firmware_str(char *pstr, int sz); /*oem_supermicro
* Global variables
*/
static char * progname = "ihealth";
-static char * progver = "2.97";
+static char * progver = "2.98";
static char fdebug = 0;
static char fipmilan = 0;
static char fcanonical = 0;
diff --git a/util/ilan.c b/util/ilan.c
index b314c73..3499ed9 100644
--- a/util/ilan.c
+++ b/util/ilan.c
@@ -305,7 +305,7 @@ extern char *get_sensor_type_desc(uchar stype); /*from ievents.c*/
/*
* Global variables
*/
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "ilan";
static char fdebug = 0;
static char fipmilan = 0;
diff --git a/util/imb_api.h b/util/imb_api.h
index e6951f8..cca3c5f 100644
--- a/util/imb_api.h
+++ b/util/imb_api.h
@@ -37,24 +37,27 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef _WINDEFS_H
#define _WINDEFS_H
-#ifndef NULL
-#define NULL 0
-#endif
-#define TRUE 1
-#define FALSE 0
-
#if defined(WIN32) | defined(BSD) | defined(DOS)
/* WIN32 defines wchar_t in stdio.h */
/* BSD defines wchar_t in stdlib.h */
/* DOS defines wchar_t in stdlib.h */
-#else
- // defined(LINUX) | defined(SOLARIS)
-#if !defined(_WCHAR_T) && !defined(__WCHAR_TYPE__)
-#define _WCHAR_T
+#else
+#if defined(LINUX)
+/* LINUX should define wchar_t in stdlib.h */
+#include <stdlib.h>
+#endif
+// SOLARIS or MACOS may need wchar_t
+#include "config.h"
+#if !HAVE_WCHAR_T
typedef long wchar_t;
#endif
#endif
+#ifndef NULL
+#define NULL 0
+#endif
+#define TRUE 1
+#define FALSE 0
#define far
#define near
#define FAR far
@@ -136,9 +139,6 @@ typedef LARGE_INTEGER * PPHYSICAL_ADDRESS;
typedef ULARGE_INTEGER * PULARGE_INTEGER;
typedef UCHAR BOOLEAN;
typedef BOOLEAN *PBOOLEAN;
-typedef wchar_t WCHAR;
-typedef WCHAR *PWCHAR, *PWSTR;
-typedef CONST WCHAR *LPCWSTR, *PCWSTR;
/*
Unicode strings are counted 16-bit character strings. If they are
@@ -147,10 +147,9 @@ typedef CONST WCHAR *LPCWSTR, *PCWSTR;
typedef struct _UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
- PWSTR Buffer;
+ wchar_t *Buffer;
} UNICODE_STRING;
typedef UNICODE_STRING *PUNICODE_STRING;
-#define UNICODE_NULL ((WCHAR)0) /* winnt*/
#define IN /* */
#define OUT /* */
#define OPTIONAL /* */
diff --git a/util/ipicmg.c b/util/ipicmg.c
index 7315270..a920f37 100644
--- a/util/ipicmg.c
+++ b/util/ipicmg.c
@@ -81,7 +81,7 @@
/* Global data */
static char * progname = "ipicmg";
-static char * progver = "2.97";
+static char * progver = "2.98";
static char fdebug = 0;
static char fset_mc = 0;
static uint8_t g_bus = PUBLIC_BUS;
diff --git a/util/ipmicmd.c b/util/ipmicmd.c
index d969173..efaadec 100644
--- a/util/ipmicmd.c
+++ b/util/ipmicmd.c
@@ -1058,6 +1058,14 @@ int ipmi_getdeviceid(uchar *presp, int sresp, char fdebug)
i = sresp;
if (i > sizeof(my_devid)) i = sizeof(my_devid);
memcpy(my_devid,presp,i); /* save device id for later use */
+ if (fdebug) {
+ uchar maj,min,iver;
+ int vend, prod;
+ get_devid_ver(&maj,&min,&iver);
+ get_mfgid(&vend, &prod);
+ printf("devid: firmware ver %x.%02x, IPMI v%02x, vendor=%d prod=%d\n",
+ maj,min,iver,vend,prod);
+ }
return(ACCESS_OK); /* success */
}
diff --git a/util/ipmidir.c b/util/ipmidir.c
index 501f47b..2aeb6f3 100644
--- a/util/ipmidir.c
+++ b/util/ipmidir.c
@@ -473,8 +473,10 @@ int ipmi_close_direct(void)
{
int status = 0;
#if defined(BSD) || defined(MACOS) || defined(HPUX)
- close(iofd);
- iofd = -1;
+ if (iofd >= 0) {
+ close(iofd);
+ iofd = -1;
+ }
#endif
/* clear lock for driverless interface */
status = clear_lock_dir();
diff --git a/util/ipmimv.c b/util/ipmimv.c
index 4404beb..accda41 100644
--- a/util/ipmimv.c
+++ b/util/ipmimv.c
@@ -112,7 +112,7 @@ struct timeval {
#endif
int ipmi_timeout_mv = 10; /* 10 seconds, was 5 sec */
-#if defined(BSD) || defined(MACOS) || defined(HPUX)
+#if defined(BSD7)
#pragma pack(1)
#endif
@@ -153,8 +153,10 @@ struct ipmi_cmdspec
unsigned char netfn;
unsigned char cmd;
};
-#if defined(BSD) || defined(MACOS) || defined(HPUX)
+#if defined(BSD7)
#pragma pack()
+#endif
+#if defined(BSD) || defined(MACOS) || defined(HPUX)
/* FreeBSD 7.x ipmi ioctls, use _IOW */
#define IPMI_IOC_MAGIC 'i'
#define IPMICTL_RECEIVE_MSG_TRUNC _IOWR(IPMI_IOC_MAGIC, 11, struct ipmi_recv)
diff --git a/util/ipmiutil.c b/util/ipmiutil.c
index d5ad57d..4c04956 100644
--- a/util/ipmiutil.c
+++ b/util/ipmiutil.c
@@ -57,7 +57,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ipmiutil.h"
static char *progname = "ipmiutil";
-static char *progver = "2.97";
+static char *progver = "2.98";
// static char fdebug = 0;
/*int ipmiutil(int argc, char **argv); */
diff --git a/util/ireset.c b/util/ireset.c
index 713599d..a796393 100644
--- a/util/ireset.c
+++ b/util/ireset.c
@@ -108,7 +108,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "ireset";
static uchar ipmi_maj;
static uchar ipmi_min;
diff --git a/util/isel.c b/util/isel.c
index 3492342..04c7c97 100644
--- a/util/isel.c
+++ b/util/isel.c
@@ -162,7 +162,7 @@ typedef struct
#define RDATA_OFFSET 13 //byte offset to the record event data
static char *progname = "isel";
-static char *progver = "2.97";
+static char *progver = "2.98";
#ifdef WIN32
#define IDXFILE "sel.idx"
static char idxfile[80] = IDXFILE;
diff --git a/util/iseltime.c b/util/iseltime.c
index 0675cce..9b74231 100644
--- a/util/iseltime.c
+++ b/util/iseltime.c
@@ -75,7 +75,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "iseltime";
static char fdebug = 0;
static char fset = 0;
diff --git a/util/isensor.c b/util/isensor.c
index 6be2836..6aaf3fb 100644
--- a/util/isensor.c
+++ b/util/isensor.c
@@ -247,7 +247,7 @@ char *decode_entity_id(int id) {
* Global Data
************************/
static char *progname = "isensor";
-static char *progver = "2.97";
+static char *progver = "2.98";
#ifdef WIN32
static char savefile[] = "%ipmiutildir%\\thresholds.cmd";
#else
@@ -1298,6 +1298,7 @@ int GetSDR(int r_id, int *r_next, uchar *recdata, int srecdata, int *rlen)
if (sresp >= 2) thislen = sresp - 2;
else thislen = 0;
reclen = off + thislen; /* truncate, stop reading */
+ fprintf(stderr,"SDR record %x is malformed, length %d is less than minimum %d\n",sresp,thislen+2);
}
/* successful */
memcpy(&resp[off],&respchunk[2],thislen);
diff --git a/util/iserial.c b/util/iserial.c
index 48145ea..d4fd427 100644
--- a/util/iserial.c
+++ b/util/iserial.c
@@ -155,7 +155,7 @@ typedef struct
/*
* Global variables
*/
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "iserial";
static int vend_id = 0;
static int prod_id = 0;
diff --git a/util/isol.c b/util/isol.c
index c73099a..d141452 100644
--- a/util/isol.c
+++ b/util/isol.c
@@ -165,7 +165,7 @@ void dbglog( char *pattn, ... ); /*local prototype*/
/*
* Global variables
*/
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "isol";
static char fdebug = 0;
static char fpicmg = 0;
diff --git a/util/itsol.c b/util/itsol.c
index e713982..9aad458 100644
--- a/util/itsol.c
+++ b/util/itsol.c
@@ -98,7 +98,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz);
extern int verbose;
extern char fdebug; /*from ipmicmd.c*/
static char * progname = "itsol";
-static char * progver = "2.97";
+static char * progver = "2.98";
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
static uchar g_lun = BMC_LUN;
diff --git a/util/iwdt.c b/util/iwdt.c
index 66db234..552867d 100644
--- a/util/iwdt.c
+++ b/util/iwdt.c
@@ -100,7 +100,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "iwdt";
static char fdebug = 0;
static char fdontlog = 0;
diff --git a/util/oem_dell.c b/util/oem_dell.c
index 530f16a..e700ebd 100644
--- a/util/oem_dell.c
+++ b/util/oem_dell.c
@@ -132,7 +132,7 @@ char NIC_Selection_Mode_String_12g[] [50] = {
"shared with failover all loms"
};
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "idelloem";
static int verbose = 0;
static char fdebug = 0;
diff --git a/util/oem_sun.c b/util/oem_sun.c
index fc899bd..7ab480e 100644
--- a/util/oem_sun.c
+++ b/util/oem_sun.c
@@ -109,7 +109,7 @@ static const struct valstr sunoem_led_mode_optvals[] = {
/* global variables */
static char * progname = "isunoem";
-static char * progver = "2.97";
+static char * progver = "2.98";
static char fdebug = 0;
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
diff --git a/util/oem_supermicro.c b/util/oem_supermicro.c
index 35df1bd..0c4a001 100644
--- a/util/oem_supermicro.c
+++ b/util/oem_supermicro.c
@@ -66,7 +66,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void set_loglevel(int level); /*prototype */
extern char fsm_debug; /*mem_if.c*/
-static char * progver = "2.97";
+static char * progver = "2.98";
static char * progname = "ismcoem";
static int verbose = 0;
static char fdebug = 0;