From 14304e0827cd7de7fc55b1ba587ccdd380525b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 12 Nov 2014 17:25:25 +0100 Subject: New upstream release --- util/Makefile.am | 26 ++++++++++++++------------ util/Makefile.in | 30 +++++++++++++++++++----------- util/ialarms.c | 4 ++-- util/icmd.c | 7 ++++--- util/iconfig.c | 6 +++--- util/idcmi.c | 7 ++++--- util/iekanalyzer.c | 2 +- util/ievents.c | 10 +++++----- util/ifirewall.c | 2 +- util/ifirewall.h | 2 +- util/ifru.c | 4 ++-- util/ifruset.c | 4 ++-- util/igetevent.c | 7 ++++--- util/ihealth.c | 4 ++-- util/ilan.c | 4 ++-- util/ipicmg.c | 2 +- util/ipmi_sample.c | 5 +++-- util/ipmi_sample_evt.c | 5 +++-- util/ipmicmd.c | 26 ++++++++++++++++++++------ util/ipmicmd.h | 24 +++++++++++++----------- util/ipmilan.c | 26 +++++++++++++------------- util/ipmilan.h | 2 +- util/ipmiutil.c | 4 ++-- util/ipmiutil.mak | 12 ++++++------ util/ireset.c | 4 ++-- util/isel.c | 15 ++++++++------- util/iseltime.c | 15 ++++++++------- util/isensor.c | 4 ++-- util/iserial.c | 4 ++-- util/isol.c | 7 ++++--- util/itsol.c | 2 +- util/iwdt.c | 4 ++-- util/oem_dell.c | 2 +- util/oem_sun.c | 2 +- util/oem_supermicro.c | 2 +- 35 files changed, 160 insertions(+), 126 deletions(-) mode change 100755 => 100644 util/ifru.c (limited to 'util') diff --git a/util/Makefile.am b/util/Makefile.am index d7ed5eb..16a8665 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -22,9 +22,9 @@ CMDMOD += md5.c md2.c ipmilan.c CMDMOD += ipmilanplus.c # CMDMOD = ipmicmd.c mem_if.c @OS_DRIVERS@ # am: configure substitutions are not allowed in _SOURCES variables -LIBOBJ = ipmicmd.o mem_if.o ipmidir.o imbapi.o ipmimv.o ipmild.o ipmibmc.o ipmilipmi.o subs.o md5.o md2.o $(tmpobj)/ipmilan.o $(tmpobj)/ipmilanplus.o +LIBOBJ = ipmicmd.o mem_if.o ipmidir.o imbapi.o ipmimv.o ipmild.o ipmibmc.o ipmilipmi.o subs.o md5.o md2.o $(tmpobj)/ipmilan.o $(tmpobj)/ipmilanplus.o @LIBSENSORS@ OEMMOD = oem_kontron.c oem_fujitsu.c oem_intel.c oem_sun.c oem_supermicro.c oem_dell.c oem_quanta.c oem_hp.c oem_newisys.c iekanalyzer.c - +L2OBJ = @SAM2OBJ@ AM_CPPFLAGS += -I. -I.. -DMETACOMMAND METASOURCE = ipmiutil.c ialarms.c ihealth.c ievents.c ifru.c ifru_picmg.c igetevent.c ireset.c icmd.c ilan.c isensor.c isel.c iserial.c iwdt.c isol.c idiscover.c iconfig.c ipicmg.c ifirewall.c ifwum.c ihpm.c itsol.c idcmi.c $(OEMMOD) $(CMDMOD) @@ -77,7 +77,7 @@ libimbapi.a: imbapi.c # Build a lib to support all of the IPMI drivers (libipmiutil.a) # If LANPLUS_SAM = yes, include LANPLUS_OBJ, else do not. # See configure --enable-liblanplus to change this -$(DEV_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ +$(DEV_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ @LIBSENSORS@ mkdir -p $(tmpobj) if [ "x@LANPLUS_SAM@" = "xyes" ]; then \ $(CC) $(CFLAGS_SAMX) -o $(tmpobj)/ipmilanplus.o -c ipmilanplus.c; \ @@ -92,7 +92,7 @@ $(DEV_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ $(RANLIB) $(DEV_LIB) ; \ fi -$(SHR_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ +$(SHR_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ @LIBSENSORS@ mkdir -p $(tmpobj) if [ "x@LANPLUS_SAM@" = "xyes" ]; then \ $(CC) $(CFLAGS_SAMX) -o $(tmpobj)/ipmilanplus.o -c ipmilanplus.c; \ @@ -125,24 +125,26 @@ ialarms_enc: $(DEV_LIB) ialarms.c oem_intel.c $(CC) $(CFLAGS_SAM) -DNO_EVENTS -o oem_intel2.o -c oem_intel.c $(CC) -g -O2 -o ialarms_enc ialarms2.o oem_intel2.o $(DEV_LIB) $(LDFLAGS) $(LDSAM) +isensor2.o: isensor.c + $(CC) $(CFLAGS_SAM) -o isensor2.o -c isensor.c + +ievents2.o: ievents.c + $(CC) $(CFLAGS_SAM) -DSENSORS_OK -o ievents2.o -c ievents.c + ifru_picmg2.o: ifru_picmg.c $(CC) $(CFLAGS_SAM) -o ifru_picmg2.o -c ifru_picmg.c # To build ipmi_sample with GET_SENSORS enabled, need isensors.o, ievents.o # Note that this does not include oem_intel, etc. for OEM SEL decoding. -ipmi_sample2: $(DEV_LIB) ipmi_sample.c isensor.c ievents.c ifru.c isel.c ifru_picmg2.o +ipmi_sample2: $(DEV_LIB) ipmi_sample.c ifru.c isel.c ifru_picmg2.o $(L2OBJ) $(CC) $(CFLAGS_SAM) -D GET_SENSORS -D GET_FRU -o ipmi_sample2.o -c ipmi_sample.c - $(CC) $(CFLAGS_SAM) -o isensor2.o -c isensor.c - $(CC) $(CFLAGS_SAM) -o ievents2.o -c ievents.c $(CC) $(CFLAGS_SAM) -o ifru2.o -c ifru.c $(CC) $(CFLAGS_SAM) -o isel2.o -c isel.c - $(CC) -g -O2 -o ipmi_sample2 ipmi_sample2.o isensor2.o ievents2.o ifru2.o ifru_picmg2.o isel2.o $(DEV_LIB) $(LDFLAGS) $(LDSAM) + $(CC) -g -O2 -o ipmi_sample2 ipmi_sample2.o $(L2OBJ) ifru2.o ifru_picmg2.o isel2.o $(DEV_LIB) $(LDFLAGS) $(LDSAM) -ipmi_sample_evt: $(DEV_LIB) ipmi_sample_evt.c isensor.c ievents.c +ipmi_sample_evt: $(DEV_LIB) ipmi_sample_evt.c $(L2OBJ) $(CC) $(CFLAGS_SAM) -o ipmi_sample_evt.o -c ipmi_sample_evt.c - $(CC) $(CFLAGS_SAM) -o isensor2.o -c isensor.c - $(CC) $(CFLAGS_SAM) -DSENSORS_OK -o ievents2.o -c ievents.c - $(CC) -g -O2 -o ipmi_sample_evt ipmi_sample_evt.o isensor2.o ievents2.o $(DEV_LIB) $(LDFLAGS) $(LDSAM) + $(CC) -g -O2 -o ipmi_sample_evt ipmi_sample_evt.o $(L2OBJ) $(DEV_LIB) $(LDFLAGS) $(LDSAM) ifruset: $(DEV_LIB) ifruset.c ifru_picmg2.o $(CC) $(CFLAGS_SAM) -c ifruset.c diff --git a/util/Makefile.in b/util/Makefile.in index e18d0ac..6d79806 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -168,6 +168,7 @@ LDFLAGS = @LDFLAGS@ LD_SAMX = @LD_SAMX@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ +LIBSENSORS = @LIBSENSORS@ LIBTOOL = @LIBTOOL@ LIB_DIR = @LIB_DIR@ LN_S = @LN_S@ @@ -186,6 +187,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_DIR = @PKG_DIR@ RANLIB = @RANLIB@ +SAM2OBJ = @SAM2OBJ@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -194,6 +196,8 @@ STRIP = @STRIP@ SUBDIR_S = @SUBDIR_S@ SYSTEMD_DIR = @SYSTEMD_DIR@ VERSION = @VERSION@ +WITH_PKG_CONFIG_FALSE = @WITH_PKG_CONFIG_FALSE@ +WITH_PKG_CONFIG_TRUE = @WITH_PKG_CONFIG_TRUE@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ @@ -231,6 +235,7 @@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ @@ -279,8 +284,9 @@ CMDMOD = ipmicmd.c mem_if.c ipmidir.c imbapi.c ipmimv.c ipmild.c \ ipmilanplus.c # CMDMOD = ipmicmd.c mem_if.c @OS_DRIVERS@ # am: configure substitutions are not allowed in _SOURCES variables -LIBOBJ = ipmicmd.o mem_if.o ipmidir.o imbapi.o ipmimv.o ipmild.o ipmibmc.o ipmilipmi.o subs.o md5.o md2.o $(tmpobj)/ipmilan.o $(tmpobj)/ipmilanplus.o +LIBOBJ = ipmicmd.o mem_if.o ipmidir.o imbapi.o ipmimv.o ipmild.o ipmibmc.o ipmilipmi.o subs.o md5.o md2.o $(tmpobj)/ipmilan.o $(tmpobj)/ipmilanplus.o @LIBSENSORS@ OEMMOD = oem_kontron.c oem_fujitsu.c oem_intel.c oem_sun.c oem_supermicro.c oem_dell.c oem_quanta.c oem_hp.c oem_newisys.c iekanalyzer.c +L2OBJ = @SAM2OBJ@ METASOURCE = ipmiutil.c ialarms.c ihealth.c ievents.c ifru.c ifru_picmg.c igetevent.c ireset.c icmd.c ilan.c isensor.c isel.c iserial.c iwdt.c isol.c idiscover.c iconfig.c ipicmg.c ifirewall.c ifwum.c ihpm.c itsol.c idcmi.c $(OEMMOD) $(CMDMOD) LANPLUS_OBJ = $(shell ar t @LANPLUS_LIB@ 2>/dev/null) DEV_LIB = libipmiutil.a @@ -651,7 +657,7 @@ libimbapi.a: imbapi.c # Build a lib to support all of the IPMI drivers (libipmiutil.a) # If LANPLUS_SAM = yes, include LANPLUS_OBJ, else do not. # See configure --enable-liblanplus to change this -$(DEV_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ +$(DEV_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ @LIBSENSORS@ mkdir -p $(tmpobj) if [ "x@LANPLUS_SAM@" = "xyes" ]; then \ $(CC) $(CFLAGS_SAMX) -o $(tmpobj)/ipmilanplus.o -c ipmilanplus.c; \ @@ -666,7 +672,7 @@ $(DEV_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ $(RANLIB) $(DEV_LIB) ; \ fi -$(SHR_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ +$(SHR_LIB): $(CMDMOD:.c=.o) @LANPLUS_LIB@ @LIBSENSORS@ mkdir -p $(tmpobj) if [ "x@LANPLUS_SAM@" = "xyes" ]; then \ $(CC) $(CFLAGS_SAMX) -o $(tmpobj)/ipmilanplus.o -c ipmilanplus.c; \ @@ -699,24 +705,26 @@ ialarms_enc: $(DEV_LIB) ialarms.c oem_intel.c $(CC) $(CFLAGS_SAM) -DNO_EVENTS -o oem_intel2.o -c oem_intel.c $(CC) -g -O2 -o ialarms_enc ialarms2.o oem_intel2.o $(DEV_LIB) $(LDFLAGS) $(LDSAM) +isensor2.o: isensor.c + $(CC) $(CFLAGS_SAM) -o isensor2.o -c isensor.c + +ievents2.o: ievents.c + $(CC) $(CFLAGS_SAM) -DSENSORS_OK -o ievents2.o -c ievents.c + ifru_picmg2.o: ifru_picmg.c $(CC) $(CFLAGS_SAM) -o ifru_picmg2.o -c ifru_picmg.c # To build ipmi_sample with GET_SENSORS enabled, need isensors.o, ievents.o # Note that this does not include oem_intel, etc. for OEM SEL decoding. -ipmi_sample2: $(DEV_LIB) ipmi_sample.c isensor.c ievents.c ifru.c isel.c ifru_picmg2.o +ipmi_sample2: $(DEV_LIB) ipmi_sample.c ifru.c isel.c ifru_picmg2.o $(L2OBJ) $(CC) $(CFLAGS_SAM) -D GET_SENSORS -D GET_FRU -o ipmi_sample2.o -c ipmi_sample.c - $(CC) $(CFLAGS_SAM) -o isensor2.o -c isensor.c - $(CC) $(CFLAGS_SAM) -o ievents2.o -c ievents.c $(CC) $(CFLAGS_SAM) -o ifru2.o -c ifru.c $(CC) $(CFLAGS_SAM) -o isel2.o -c isel.c - $(CC) -g -O2 -o ipmi_sample2 ipmi_sample2.o isensor2.o ievents2.o ifru2.o ifru_picmg2.o isel2.o $(DEV_LIB) $(LDFLAGS) $(LDSAM) + $(CC) -g -O2 -o ipmi_sample2 ipmi_sample2.o $(L2OBJ) ifru2.o ifru_picmg2.o isel2.o $(DEV_LIB) $(LDFLAGS) $(LDSAM) -ipmi_sample_evt: $(DEV_LIB) ipmi_sample_evt.c isensor.c ievents.c +ipmi_sample_evt: $(DEV_LIB) ipmi_sample_evt.c $(L2OBJ) $(CC) $(CFLAGS_SAM) -o ipmi_sample_evt.o -c ipmi_sample_evt.c - $(CC) $(CFLAGS_SAM) -o isensor2.o -c isensor.c - $(CC) $(CFLAGS_SAM) -DSENSORS_OK -o ievents2.o -c ievents.c - $(CC) -g -O2 -o ipmi_sample_evt ipmi_sample_evt.o isensor2.o ievents2.o $(DEV_LIB) $(LDFLAGS) $(LDSAM) + $(CC) -g -O2 -o ipmi_sample_evt ipmi_sample_evt.o $(L2OBJ) $(DEV_LIB) $(LDFLAGS) $(LDSAM) ifruset: $(DEV_LIB) ifruset.c ifru_picmg2.o $(CC) $(CFLAGS_SAM) -c ifruset.c diff --git a/util/ialarms.c b/util/ialarms.c index 6f9f15b..6554256 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.94"; +static char * progver = "2.95"; static char * progname = "ialarms"; static char fdebug = 0; static char fbmctam = 0; @@ -434,7 +434,7 @@ main(int argc, char **argv) printf(" -o sets all Alarms off\n"); printf(" -w21b writes picmg LED 2 on(1) color=blue(b)\n"); printf(" -x show eXtra debug messages\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); ret = ERR_USAGE; goto do_exit; } diff --git a/util/icmd.c b/util/icmd.c index 20949be..523248b 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.94"; +static char * progver = "2.95"; static char * progname = "icmd"; static char fdebug = 0; static char fquiet = 0; @@ -175,7 +175,7 @@ main(int argc, char **argv) char *s1; istart = 1; - while ( (c = getopt( argc, argv,"djkm:qst:xN:P:R:U:EF:J:T:V:YZ:?")) != EOF ) + while ( (c = getopt( argc, argv,"djkm:qst:xp:N:P:R:U:EF:J:T:V:YZ:?")) != EOF ) switch(c) { case 'j': /* just pass the bytes to KCS */ fjustpass = 1; @@ -209,6 +209,7 @@ main(int argc, char **argv) case 'x': fdebug = 1; break; /* debug messages */ case 'V': /* priv level */ fprivset = 1; + case 'p': /* port */ case 'N': /* nodename */ case 'U': /* remote username */ case 'P': /* remote password */ @@ -230,7 +231,7 @@ main(int argc, char **argv) printf(" -m002000 specific MC (bus 00,sa 20,lun 00)\n"); printf(" -q quiet mode, with minimal headers\n"); printf(" -s skips the GetDeviceID command\n"); - print_lan_opt_usage(); + print_lan_opt_usage(1); ret = ERR_USAGE; goto do_exit; } diff --git a/util/iconfig.c b/util/iconfig.c index cbbe78d..5fb8680 100644 --- a/util/iconfig.c +++ b/util/iconfig.c @@ -171,7 +171,7 @@ typedef struct /* * Global variables */ -static char * progver = "2.94"; +static char * progver = "2.95"; static char * progname = "iconfig"; static char fdebug = 0; static char fipmilan = 0; @@ -1765,7 +1765,7 @@ int SerialIsOptional(int bparam) int optvals[9] = { 5, 9, 10, 11, 12, 13, 14, 20, 21 }; int rv = 0; int i; - for (i = 0; i < sizeof(optvals); i++) { + for (i = 0; i < (sizeof(optvals) / sizeof(int)); i++) { if (optvals[i] == bparam) { rv = 1; break; } } return(rv); @@ -1898,7 +1898,7 @@ main(int argc, char **argv) printf(" -x show eXtra debug messages\n"); printf(" -p specify a user password to set\n"); printf(" -L 3 specify lan channel number 3\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); ret = ERR_USAGE; goto do_exit; } diff --git a/util/idcmi.c b/util/idcmi.c index 1ba08cd..bcd728f 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.94"; +static char * progver = "2.95"; extern char fdebug; /*from ipmicmd.c*/ static uchar g_bus = PUBLIC_BUS; static uchar g_sa = BMC_SA; @@ -109,7 +109,7 @@ static int dcmi_usage(void) printf(" -m002000 specific MC (bus 00,sa 20,lun 00)\n"); printf(" -s Get DCMI sensor info\n"); printf(" -x Display extra debug messages\n"); - print_lan_opt_usage(); + print_lan_opt_usage(1); printf("where is one of:\n"); printf(" info Get DCMI Capabilities, MC ID, asset tag (default)\n"); printf(" power [get] Get Power reading & limit\n"); @@ -747,7 +747,7 @@ main(int argc, char **argv) printf("%s ver %s\n", progname,progver); parse_lan_options('V',"4",0); /*default to admin priv*/ - while ( (c = getopt( argc, argv,"a:d:m:sT:V:J:EYF:P:N:R:U:Z:x?")) != EOF ) + while ( (c = getopt( argc, argv,"a:d:m:p:sT:V:J:EYF:P:N:R:U:Z:x?")) != EOF ) switch (c) { case 'a': set_asset = 1; asset_new = optarg; break; case 'd': set_mcid = 1; mcid_new = optarg; break; @@ -765,6 +765,7 @@ main(int argc, char **argv) break; case 's': do_sensors = 1; break; case 'x': fdebug = 1; break; /* debug messages */ + case 'p': /* port */ case 'N': /* nodename */ case 'U': /* remote username */ case 'P': /* remote password */ diff --git a/util/iekanalyzer.c b/util/iekanalyzer.c index ddeeba8..1f405cc 100644 --- a/util/iekanalyzer.c +++ b/util/iekanalyzer.c @@ -4086,7 +4086,7 @@ main(int argc, char **argv) printf("%s ver %s\n", progname,progver); - while ( (c = getopt( argc, argv,"m:T:V:J:EYF:P:N:R:U:Z:x?")) != EOF ) + while ( (c = getopt( argc, argv,"m:p:T:V:J:EYF:P:N:R:U:Z:x?")) != EOF ) switch (c) { case 'm': /* specific IPMB MC, 3-byte address, e.g. "409600" */ g_bus = htoi(&optarg[0]); /*bus/channel*/ diff --git a/util/ievents.c b/util/ievents.c index cbc7622..098df46 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.94"; +static char *progver = "2.95"; static char *progname = "ievents"; static char fsensdesc = 0; /* 1= get extended sensor descriptions*/ static char fcanonical = 0; /* 1= show canonical, delimited output*/ @@ -193,10 +193,10 @@ static const char *sensor_types[NSTYPES] = { /* 2Eh */ "ME" /* 0xDC == ME Node Manager */ }; -#define NFWERRS 15 +#define NFWERRS 14 static struct { /* See Table 36-3, type 0Fh, offset 00h */ int code; char *msg; - } fwerrs[NFWERRS] = { + } fwerrs[NFWERRS + 1] = { { 0x00, "Unspecified"}, { 0x01, "No system memory"}, { 0x02, "No usable memory"}, @@ -214,10 +214,10 @@ static struct { /* See Table 36-3, type 0Fh, offset 00h */ { 0x0E, "Reserved" } }; -#define NFWSTAT 27 +#define NFWSTAT 26 static struct { /* See Table 36-3, type 0Fh, offset 01h & 02h */ int code; char *msg; - } fwstat[NFWSTAT] = { + } fwstat[NFWSTAT + 1] = { { 0x00, "Unspecified"}, { 0x01, "Memory init"}, { 0x02, "Hard disk init"}, diff --git a/util/ifirewall.c b/util/ifirewall.c index 3956668..9adfd24 100644 --- a/util/ifirewall.c +++ b/util/ifirewall.c @@ -64,7 +64,7 @@ /* global variables */ static char * progname = "ifirewall"; -static char * progver = "2.94"; +static char * progver = "2.95"; static char fdebug = 0; static uchar g_bus = PUBLIC_BUS; static uchar g_sa = BMC_SA; diff --git a/util/ifirewall.h b/util/ifirewall.h index 14a04f4..3953b09 100644 --- a/util/ifirewall.h +++ b/util/ifirewall.h @@ -82,7 +82,7 @@ struct lun_netfn_support { }; struct lun_support { unsigned char support; - struct lun_netfn_support netfn[MAX_NETFN_PAIR]; + struct lun_netfn_support netfn[MAX_NETFN]; }; struct bmc_fn_support { struct lun_support lun[MAX_LUN]; diff --git a/util/ifru.c b/util/ifru.c old mode 100755 new mode 100644 index b1ac4ba..af4d94b --- 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.94"; +static char *progver = "2.95"; static int vend_id = 0; static int prod_id = 0; static char fdebug = 0; @@ -1779,7 +1779,7 @@ int i_fru(int argc, char **argv) printf(" -s snum Sets the Product Serial Number\n"); printf(" -v pver Sets the Product Version Number\n"); printf(" -x Display extra debug messages\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); ret = ERR_USAGE; goto do_exit; } diff --git a/util/ifruset.c b/util/ifruset.c index ee0fac8..5939b56 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.94"; +static char *progver = "2.95"; static char fdebug = 0; static char fpicmg = 0; static char fonlybase = 0; @@ -1378,7 +1378,7 @@ main(int argc, char **argv) printf(" -i 00 Get/Set a specific FRU ID\n"); printf(" -m002000 specific MC (bus 00,sa 20,lun 00)\n"); printf(" -x Display extra debug messages\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); ret = ERR_USAGE; goto do_exit; } diff --git a/util/igetevent.c b/util/igetevent.c index e2eb587..fb3b4ab 100644 --- a/util/igetevent.c +++ b/util/igetevent.c @@ -168,7 +168,7 @@ extern void free_sdr_cache(uchar *pret); /*see isensor.c*/ * Global variables */ static char * progname = "igetevent"; -static char * progver = "2.94"; +static char * progver = "2.95"; static char fdebug = 0; static char fipmilan = 0; static char frunonce = 0; @@ -1047,7 +1047,7 @@ main(int argc, char **argv) fdout = stdout; msgout("%s ver %s\n", progname,progver); - while ( (c = getopt(argc,argv,"abce:lmn:or:st:uvT:V:J:YEF:P:N:R:U:Z:x?")) != EOF ) + while ( (c = getopt(argc,argv,"abce:lmn:op:r:st:uvT:V:J:YEF:P:N:R:U:Z:x?")) != EOF ) switch(c) { case 'a': fAsync = 1; /* imb async message method */ /* chenge the output log filename */ @@ -1086,6 +1086,7 @@ main(int argc, char **argv) case 'u': futc = 1; break; case 'x': fdebug = 1; break; /* debug messages */ case 'v': fdebug = 3; break; /* verbose debug with lan */ + case 'p': case 'N': /* nodename */ case 'U': /* remote username */ case 'P': /* remote password */ @@ -1112,7 +1113,7 @@ main(int argc, char **argv) printf(" -t N set timeout to N seconds\n"); printf(" -u use raw UTC time\n"); printf(" -x show eXtra debug messages\n"); - print_lan_opt_usage(); + print_lan_opt_usage(1); ret = ERR_USAGE; goto do_exit; } diff --git a/util/ihealth.c b/util/ihealth.c index 466131e..986185f 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.94"; +static char * progver = "2.95"; static char fdebug = 0; static char fipmilan = 0; static char fcanonical = 0; @@ -905,7 +905,7 @@ main(int argc, char **argv) printf(" -o set Operating System to this string\n"); printf(" -p1 set restore policy: 0=off, 1=last, 2=on\n"); printf(" -s get the IPMI Session info also\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); ret = ERR_USAGE; goto health_end; } diff --git a/util/ilan.c b/util/ilan.c index 8415b07..910b1fa 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.94"; +static char * progver = "2.95"; static char * progname = "ilan"; static char fdebug = 0; static char fipmilan = 0; @@ -3924,7 +3924,7 @@ main(int argc, char **argv) printf(" -K (Kontron) IPMI hostname to set\n"); printf(" -Q VLAN Priority (default =0)\n"); printf(" -O Force LAN security: no null user, cipher 0 off\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); ret = ERR_USAGE; goto do_exit; } /*end switch*/ diff --git a/util/ipicmg.c b/util/ipicmg.c index 73bed68..15613f6 100644 --- a/util/ipicmg.c +++ b/util/ipicmg.c @@ -81,7 +81,7 @@ /* Global data */ static char * progname = "ipicmg"; -static char * progver = "2.94"; +static char * progver = "2.95"; static char fdebug = 0; static char fset_mc = 0; static uint8_t g_bus = PUBLIC_BUS; diff --git a/util/ipmi_sample.c b/util/ipmi_sample.c index ddda7f3..faa0d51 100644 --- a/util/ipmi_sample.c +++ b/util/ipmi_sample.c @@ -115,7 +115,7 @@ main(int argc, char **argv) printf("%s ver %s\n", progname,progver); - while ((c = getopt( argc, argv,"i:l:m:f:s:t:xEF:N:P:R:T:U:V:YZ:?")) != EOF ) + while ((c = getopt( argc, argv,"i:l:m:p:f:s:t:xEF:N:P:R:T:U:V:YZ:?")) != EOF ) switch(c) { case 'm': /* specific IPMB MC, 3-byte address, e.g. "409600" */ g_bus = htoi(&optarg[0]); /*bus/channel*/ @@ -136,6 +136,7 @@ main(int argc, char **argv) case 's': sdrfile = optarg; break; case 't': mytag = optarg; break; /* specific sensor tag */ case 'x': fdebug = 1; break; /* debug messages */ + case 'p': /* port */ case 'N': /* nodename */ case 'U': /* remote username */ case 'P': /* remote password */ @@ -158,7 +159,7 @@ main(int argc, char **argv) printf(" -m002000 specific MC (bus 00,sa 20,lun 00)\n"); printf(" -s File loads SDRs from File\n"); printf(" -t tag search for 'tag' in SDRs\n"); - print_lan_opt_usage(); + print_lan_opt_usage(1); exit(1); } /* Rather than parse_lan_options above, the set_lan_options function diff --git a/util/ipmi_sample_evt.c b/util/ipmi_sample_evt.c index eada5eb..f0f8e97 100644 --- a/util/ipmi_sample_evt.c +++ b/util/ipmi_sample_evt.c @@ -328,7 +328,7 @@ main(int argc, char **argv) fdout = stderr; printf("%s ver %s\n", progname,progver); - while ( (c = getopt( argc, argv,"m:s:t:xEF:N:P:R:T:U:V:YZ:?")) != EOF ) + while ( (c = getopt( argc, argv,"m:p:s:t:xEF:N:P:R:T:U:V:YZ:?")) != EOF ) switch(c) { case 'm': /* specific IPMB MC, 3-byte address, e.g. "409600" */ g_bus = htoi(&optarg[0]); /*bus/channel*/ @@ -346,6 +346,7 @@ main(int argc, char **argv) case 's': sdrfile = optarg; break; case 't': mytag = optarg; break; /* specific sensor tag */ case 'x': fdebug = 1; break; /* debug messages */ + case 'p': /* port */ case 'N': /* nodename */ case 'U': /* remote username */ case 'P': /* remote password */ @@ -364,7 +365,7 @@ main(int argc, char **argv) printf(" -m002000 specific MC (bus 00,sa 20,lun 00)\n"); printf(" -s File loads SDRs from File\n"); printf(" -t tag search for 'tag' in SDRs\n"); - print_lan_opt_usage(); + print_lan_opt_usage(1); exit(1); } /* Rather than parse_lan_options above, the set_lan_options function diff --git a/util/ipmicmd.c b/util/ipmicmd.c index 8501359..9d56630 100644 --- a/util/ipmicmd.c +++ b/util/ipmicmd.c @@ -267,7 +267,7 @@ uchar my_devid[20] = {0,0,0,0,0,0,0,0}; /*saved devid, only needs 16 bytes*/ int gshutdown = 0; /* see ipmilan.c ipmilanplus.c */ LAN_OPT lanp = { "localhost","","", IPMI_SESSION_AUTHTYPE_MD5, - IPMI_PRIV_LEVEL_USER, 3, "", 0 }; + IPMI_PRIV_LEVEL_USER, 3, "", 0, RMCP_PRI_RMCP_PORT }; static char *gnode = lanp.node; //char *guser = lanp.user; //char *gpswd = lanp.pswd; @@ -655,7 +655,7 @@ int ipmi_open(char fdebugcmd) /* first time, so try each */ if (fipmi_lan) { /* Try IPMI LAN 1.5 first */ - rc = ipmi_open_lan(gnode,lanp.user,lanp.pswd,fdebugcmd); + rc = ipmi_open_lan(gnode,lanp.port,lanp.user,lanp.pswd,fdebugcmd); fDriverTyp = DRV_LAN; if (rc == LAN_ERR_V2) { /* Use IPMI LAN 2.0 if BMC said it only supports LAN2 */ @@ -1125,9 +1125,15 @@ int ipmi_sendrecv(struct ipmi_rq * req, uchar *rsp, int *rsp_len) rlen = IPMI_RSPBUF_SIZE; *rsp_len = 0; - rv = ipmi_cmdraw_mc(req->msg.cmd, req->msg.netfn, - req->msg.data, (uchar)req->msg.data_len, - rsp, &rlen, &ccode, fdebug); + if ((fDriverTyp != DRV_MV) && (mc->adrtype == ADDR_IPMB) && !fipmi_lan) { + rv = ipmi_cmd_ipmb( req->msg.cmd, req->msg.netfn, mc->sa,mc->bus, + req->msg.lun, req->msg.data, (uchar)req->msg.data_len, + rsp, &rlen, &ccode, fdebug); + } else { /* use ADDR_SMI */ + rv = ipmi_cmdraw(req->msg.cmd, req->msg.netfn, mc->sa,mc->bus, + req->msg.lun, req->msg.data, (uchar)req->msg.data_len, + rsp, &rlen, &ccode, fdebug); + } if (rv == 0 && ccode != 0) rv = ccode; if (rv == 0) { /*success*/ *rsp_len = rlen; @@ -1340,6 +1346,12 @@ void parse_lan_options(int c, char *popt, char fdebugcmd) switch(c) { + case 'p': + i = atoi(popt); + if (i > 0) lanp.port = i; + else printf("-p port %d < 0, defaults to %d\n", + i,RMCP_PRI_RMCP_PORT); + break; case 'F': /* force driver type */ i = set_driver_type(popt); if (i == 0) fset_dtype = 1; @@ -1406,11 +1418,13 @@ void parse_lan_options(int c, char *popt, char fdebugcmd) #endif } /*end parse_lan_options*/ -void print_lan_opt_usage(void) +void print_lan_opt_usage(int opt) { #if defined(EFI) | defined(DOS) return; #else + if (opt == 1) /*port ok*/ + printf(" -p port UDP Port of target system\n"); printf(" -N node Nodename or IP address of target system\n"); printf(" -U user Username for remote node\n"); printf(" -P/-R pswd Remote Password\n"); diff --git a/util/ipmicmd.h b/util/ipmicmd.h index bf735ef..a4c911b 100644 --- a/util/ipmicmd.h +++ b/util/ipmicmd.h @@ -344,6 +344,7 @@ typedef struct { int cipher; unsigned char addr[128]; /* sizeof(struct sockaddr_storage) = 128 */ int addr_len; /* struct sockaddr_in/_in6 gaddr; _in6=28, _in=16 bytes*/ + int port; } LAN_OPT; /* used for IPMI LAN, specified with option -NUP, etc. */ #ifndef _IPMI_RQ_ @@ -351,8 +352,8 @@ typedef struct { /* structure used in ipmi_sendrecv, maps to ipmitool syntax. */ struct ipmi_rq { struct { - uchar netfn:6; - uchar lun:2; + uchar netfn:6; + uchar lun:2; uchar cmd; uchar target_cmd; ushort data_len; @@ -421,17 +422,18 @@ int ipmi_close(void); /*ditto*/ * parse_lan_options * Parse the IPMI LAN options from the command-line getopt. * int c (input): command-line option from getopt, one of: + case 'p': UDP port case 'F': force driver type - case 'T': auth type - case 'V': priv level - case 'J': cipher suite - case 'N': nodename + case 'T': auth type + case 'V': priv level + case 'J': cipher suite + case 'N': nodename case 'U': username case 'R': remote password - case 'P': remote password - case 'E': get password from IPMI_PASSWORD environment var - case 'Y': prompt for remote password - case 'Z': set local MC address + case 'P': remote password + case 'E': get password from IPMI_PASSWORD environment var + case 'Y': prompt for remote password + case 'Z': set local MC address * char *optarg (input): command-line argument from getopt * char fdebug (input): show debug messages if =1, default=0 */ @@ -467,7 +469,7 @@ int set_lan_options(char *node, char *user, char *pswd, int auth, int priv, int cipher, void *addr, int addr_len); int get_lan_options(char *node, char *user, char *pswd, int *auth, int *priv, int *cipher, void *addr, int *addr_len); -void print_lan_opt_usage(void); +void print_lan_opt_usage(int opt); int ipmi_getdeviceid(uchar *presp, int sresp, char fdebugcmd); /* int ipmi_open(void); * embedded in ipmi_cmd() */ int ipmi_getpicmg(uchar *presp, int sresp, char fdebug); diff --git a/util/ipmilan.c b/util/ipmilan.c index b852f3a..814092e 100644 --- a/util/ipmilan.c +++ b/util/ipmilan.c @@ -215,7 +215,7 @@ extern char * get_iana_str(int mfg); /*subs.c*/ #define dbg_dump dump_buf extern FILE *fperr; /*defined in ipmicmd.c, usu stderr */ extern FILE *fpdbg; /*defined in ipmicmd.c, usu stdout */ -extern int gshutdown; /* from ipmicmd.c */ +extern int gshutdown; /* from ipmicmd.c, usu =0 */ extern int fauth_type_set; /* from ipmicmd.c */ extern LAN_OPT lanp; /* from ipmicmd.c */ //extern char *gnode; /* from ipmicmd.c */ @@ -236,7 +236,7 @@ static int vend_id = 0; static int prod_id = 0; #if defined(DOS) || defined(EFI) -int ipmi_open_lan(char *node, char *user, char *pswd, int fdebugcmd) +int ipmi_open_lan(char *node, char *user, int port, char *pswd, int fdebugcmd) { printf("IPMI LAN is not supported under DOS.\n"); return(-1); @@ -520,9 +520,9 @@ void close_sockfd(SockType sfd) pconn->sockfd = 0; /*set global to zero */ } -int open_sockfd(char *node, SockType *sfd, SOCKADDR_T *daddr, +int open_sockfd(char *node, int port, SockType *sfd, SOCKADDR_T *daddr, int *daddr_len, int foutput); -int open_sockfd(char *node, SockType *sfd, SOCKADDR_T *daddr, +int open_sockfd(char *node, int port, SockType *sfd, SOCKADDR_T *daddr, int *daddr_len, int foutput) { int rv = 0; @@ -560,7 +560,7 @@ int open_sockfd(char *node, SockType *sfd, SOCKADDR_T *daddr, #ifdef HAVE_IPV6 memset(&_srcaddr, 0, sizeof(_srcaddr)); memset(daddr, 0, sizeof(_destaddr)); - sprintf(service, "%d", RMCP_PRI_RMCP_PORT); + sprintf(service, "%d", port); /* Obtain address(es) matching host/port */ memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ @@ -623,7 +623,7 @@ int open_sockfd(char *node, SockType *sfd, SOCKADDR_T *daddr, memset(daddr, 0, sizeof(SOCKADDR_T)); daddr->sin_family = AF_INET; - daddr->sin_port = htons(RMCP_PRI_RMCP_PORT); /*0x26f = 623.*/ + daddr->sin_port = htons(port); /*RMCP_PRI_RMCP_PORT 0x26f = 623.*/ if (StrIsIp(node)) { /* the node string is an IP address */ uchar in_ip[4]; atoip(in_ip,node); @@ -1645,7 +1645,7 @@ int ping_bmc(char *node, int fdebugcmd) SockType sfd; int rv; - rv = open_sockfd(node,&sfd, &toaddr, &toaddr_len, fdebugcmd); + rv = open_sockfd(node, RMCP_PRI_RMCP_PORT, &sfd, &toaddr, &toaddr_len, fdebugcmd); if (rv != 0) return(rv); rv = rmcp_ping(sfd, (struct sockaddr *)&toaddr,toaddr_len, fdebugcmd); @@ -1676,7 +1676,7 @@ static int get_rand(void *data, int len) /* * ipmi_open_lan */ -int ipmi_open_lan(char *node, char *user, char *pswd, int fdebugcmd) +int ipmi_open_lan(char *node, int port, char *user, char *pswd, int fdebugcmd) { char *username; uchar priv_level; @@ -1697,21 +1697,21 @@ int ipmi_open_lan(char *node, char *user, char *pswd, int fdebugcmd) goto EXIT; } else { - if ((gshutdown==0) || fdebugcmd) + if (fdebugcmd) fprintf(fpdbg,"Opening lan connection to node %s ...\n",node); /* save nodename for sig_abort later */ if (strlen(node) > SZGNODE) { strncpy(nodename, node, SZGNODE); nodename[SZGNODE] = 0; } else strcpy(nodename, node); - - rv = open_sockfd(node, &(pconn->sockfd), &_destaddr, &_destaddr_len, 1); + rv = open_sockfd(node, port, &(pconn->sockfd), &_destaddr, &_destaddr_len, 1); if (fdebugcmd) printf("open_sockfd returned %d, fd=%d\n", rv, pconn->sockfd); if (rv != 0) goto EXIT; #ifdef HAVE_IPV6 strcpy(gnodename,nodename); - fprintf(fpdbg,"Connecting to node %s\n",gnodename); + if (fdebugcmd) + fprintf(fpdbg,"Connecting to node %s\n",gnodename); #else #ifdef WIN32 /* check for ws2_32.lib(getnameinfo) resolution */ @@ -1904,7 +1904,7 @@ int ipmicmd_lan(char *node, if (pconn->sockfd == 0) { /* closed, do re-open */ if (fdebugcmd) fprintf(fpdbg,"sockfd==0, node %s needs re-open\n",node); - rv = ipmi_open_lan(lanp.node, lanp.user, lanp.pswd, fdebugcmd); + rv = ipmi_open_lan(lanp.node, lanp.port, lanp.user, lanp.pswd, fdebugcmd); if (rv != 0) goto EXIT; } if (fdebugcmd) { diff --git a/util/ipmilan.h b/util/ipmilan.h index 9e92e55..9a47efe 100644 --- a/util/ipmilan.h +++ b/util/ipmilan.h @@ -65,7 +65,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* see ipmicmd.h for LAN_ERR definitions */ -int ipmi_open_lan(char *node, char *user, char *pswd, int fdebugcmd); +int ipmi_open_lan(char *node, int port, char *user, char *pswd, int fdebugcmd); int ipmi_close_lan(char *node); int ipmi_flush_lan(char *node); int ipmi_cmd_lan(char *node, ushort cmd, uchar *pdata, int sdata, diff --git a/util/ipmiutil.c b/util/ipmiutil.c index dc54f41..d51e469 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.94"; +static char *progver = "2.95"; // static char fdebug = 0; /*int ipmiutil(int argc, char **argv); */ @@ -110,7 +110,7 @@ static void show_usage() for (i=0; iNUL $(RM) $(TARG_EXE) 2>NUL $(RM) *.exe 2>NUL - -$(RM) $(TMP_D)\*.obj 2>NUL + $(RM) $(TMP_D)\*.obj 2>NUL distclean: $(RM) *.obj 2>NUL $(RM) $(TARG_EXE) 2>NUL $(RM) *.exe 2>NUL - -$(RM) $(TMP_D)\*.* 2>NUL + $(RM) $(TMP_D)\*.* 2>NUL rmdir $(TMP_D) 2>NUL $(RM) *.rc 2>NUL $(RM) *.bin 2>NUL @@ -385,7 +385,8 @@ $(TMP_D)\iwdt.obj: iwdt.c $(CC) /c $(CFLAGS_M) /Fo$(TMP_D)\iwdt.obj iwdt.c $(E_EXE): $(E_OBJ) - $(LINK) $(LFLAGS) /OUT:$(E_EXE) $(E_OBJ) $(LF_LANPLUS) $(LIBS_PEF) $(LIBS_EX) + $(LINK) $(LFLAGS) /OUT:$(E_EXE) $(E_OBJ) $(LF_LANPLUS) $(LIBS_PEF) $(LIBS_EX) + mt.exe -manifest $(E_EXE).manifest -outputresource:$(E_EXE);1 ipmi_sample.obj: ipmi_sample.c $(CC) /c $(CFLAGS_SAM) ipmi_sample.c @@ -400,8 +401,7 @@ $(SAMP_DLL): $(CMD_OBJ) mem_if.obj $(LINK) /DLL $(LFLAGS) /OUT:$(SAMP_DLL) /def:ipmiutillib.def $(CMD_OBJ) mem_if.obj $(LIBS_PEF) $(LIBS_EX) del ipmilanplus.obj -ipmi_sample.exe: $(SAMP_LIB) ipmi_sample.c - $(CC) /c $(CFLAGS_SAM) ipmi_sample.c +ipmi_sample.exe: $(SAMP_LIB) ipmi_sample.obj $(LINK) $(LFLAGS) /OUT:ipmi_sample.exe ipmi_sample.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX) ipmi_sample2.exe: $(SAMP_LIB) ipmi_sample.c isensor.c ievents.c diff --git a/util/ireset.c b/util/ireset.c index 08794e0..3ca5312 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.94"; +static char * progver = "2.95"; static char * progname = "ireset"; static uchar ipmi_maj; static uchar ipmi_min; @@ -486,7 +486,7 @@ static void show_usage(void) printf(" -w Wait for BMC ready after reset\n"); printf(" -x show eXtra debug messages\n"); printf(" -y Yes, persist boot options [-befhpms]\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); } #ifdef METACOMMAND diff --git a/util/isel.c b/util/isel.c index d4914d5..21fb932 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.94"; +static char *progver = "2.95"; #ifdef WIN32 #define IDXFILE "sel.idx" static char idxfile[80] = IDXFILE; @@ -651,7 +651,7 @@ int i_sel(int argc, char **argv) char *s1; printf("%s: version %s\n",progname,progver); - while ((c = getopt(argc,argv,"a:b:cdef:h:l:m:nprs:uwvx:T:V:J:EYF:P:N:U:R:Z:?")) != EOF) + while ((c = getopt(argc,argv,"a:b:cdef:h:l:m:np:rs:uwvx:T:V:J:EYF:P:N:U:R:Z:?")) != EOF) switch(c) { case 'a': faddsel = 1; /*undocumented option, to prevent misuse*/ addstr = optarg; /*text string, max 13 bytes*/ @@ -686,13 +686,14 @@ int i_sel(int argc, char **argv) fsensdesc = 1; /*extended sensor descriptions*/ /* Note that this option does not show event data bytes */ break; - case 'p': fall = 0; break; /*crit stop (panic) only*/ + // case 'p': fall = 0; break; /*crit stop (panic) only*/ case 'r': fshowraw = 1; break; case 's': min_sev = atob(optarg); break; /*show sev >= value*/ case 'u': futc = 1; break; case 'v': fonlyver = 1; break; case 'w': fwritesel = 1; break; case 'x': fdebug = 1; break; + case 'p': /* port */ case 'N': /* nodename */ case 'U': /* remote username */ case 'P': /* remote password */ @@ -717,13 +718,13 @@ int i_sel(int argc, char **argv) printf(" -l5 Show last 5 SEL records (reverse order)\n"); printf(" -r Show uninterpreted raw SEL records in ascii hex\n"); printf(" -n Show nominal/canonical output (same as -c)\n"); - printf(" -p Show only Panic/Critical Stop records\n"); + //printf(" -p Show only Panic/Critical Stop records\n"); printf(" -s1 Show only Severity >= value (0,1,2,3)\n"); printf(" -u use raw UTC time\n"); printf(" -v Only show version information\n"); printf(" -w Writes new SEL records to syslog\n"); printf(" -x Display extra debug messages\n"); - print_lan_opt_usage(); + print_lan_opt_usage(1); ret = ERR_USAGE; goto do_exit; } @@ -866,10 +867,10 @@ int i_sel(int argc, char **argv) /* PEF alerts and other log messages fail if low free space, so show a warning. */ if (vfree < MIN_FREE) { - printf("WARNING: free space is very low (=%d), need to clear with -c\n", + printf("WARNING: free space is very low (=%d), need to clear with -d\n", vfree); } else if ((vfree/vsize) < ((vtotal * 20)/100)) { - printf("WARNING: free space is low (=%d), need to clear with -c\n", + printf("WARNING: free space is low (=%d), need to clear with -d\n", vfree); } } diff --git a/util/iseltime.c b/util/iseltime.c index e72c93b..28ec5cc 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.94"; +static char * progver = "2.95"; static char * progname = "iseltime"; static char fdebug = 0; static char fset = 0; @@ -139,14 +139,15 @@ time_t utc2local(time_t t) } #define TIMESTR_SZ 30 -void show_time(time_t etime) +void show_time(time_t etime, int doutc) { char buf[TIMESTR_SZ]; int bufsz = TIMESTR_SZ; time_t t; strcpy(buf,"00/00/00 00:00:00"); - t = utc2local(etime); + if (doutc) t = utc2local(etime); + else t = etime; strftime(buf,bufsz, "%x %H:%M:%S", gmtime(&t)); /*or "%x %T"*/ printf("%s\n",buf); return; @@ -195,7 +196,7 @@ main(int argc, char **argv) printf("Usage: %s [-sx -NUPRETVF]\n", progname); printf(" where -s Set SEL time (usually once a day)\n"); printf(" -x show eXtra debug messages\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); exit(1); } @@ -220,10 +221,10 @@ main(int argc, char **argv) exit(1); } time(<ime2); - printf("Current System time: "); show_time(ltime2); + printf("Current System time: "); show_time(ltime2,1); ltime1 = timebuf[0] + (timebuf[1] << 8) + (timebuf[2] << 16) + (timebuf[3] << 24); - printf("Current SEL time: "); show_time(ltime1); + printf("Current SEL time: "); show_time(ltime1,0); // if (fdebug) ltime3 = utc2local(ltime1); @@ -239,7 +240,7 @@ main(int argc, char **argv) else { ltime3 = timebuf[0] + (timebuf[1] << 8) + (timebuf[2] << 16) + (timebuf[3] << 24); - printf("New SEL time: "); show_time(ltime3); + printf("New SEL time: "); show_time(ltime3,0); } } } diff --git a/util/isensor.c b/util/isensor.c index e24eea0..6ce290d 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.94"; +static char *progver = "2.95"; #ifdef WIN32 static char savefile[] = "%ipmiutildir%\\thresholds.cmd"; #else @@ -3222,7 +3222,7 @@ int i_sensor(int argc, char **argv) printf(" -v Verbose: thresholds, max/min, hysteresis\n"); printf(" -w Wrap thresholds on sensor line\n"); printf(" -L n Loop n times\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); ret = ERR_USAGE; goto do_exit; } diff --git a/util/iserial.c b/util/iserial.c index a7f722c..af90f8f 100644 --- a/util/iserial.c +++ b/util/iserial.c @@ -155,7 +155,7 @@ typedef struct /* * Global variables */ -static char * progver = "2.94"; +static char * progver = "2.95"; static char * progname = "iserial"; static int vend_id = 0; static int prod_id = 0; @@ -942,7 +942,7 @@ main(int argc, char **argv) printf(" -t Configure serial port for shared Terminal Mode & Console (same as -c)\n"); printf(" -v4 access priVilege: 4=Admin, 3=Operator, 2=User\n"); printf(" -x eXtra debug messages\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); ret = ERR_USAGE; goto do_exit; } diff --git a/util/isol.c b/util/isol.c index 460411e..c092361 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.94"; +static char * progver = "2.95"; static char * progname = "isol"; static char fdebug = 0; static char fpicmg = 0; @@ -1114,7 +1114,7 @@ static void show_usage(void) printf(" -v debug log filename (default=isoldbg.log)\n"); printf(" -x show eXtra debug messages in debug log\n"); printf(" -z show even more debug messages\n"); - print_lan_opt_usage(); + print_lan_opt_usage(1); } #ifdef METACOMMAND @@ -1138,7 +1138,7 @@ main(int argc, char **argv) parse_lan_options('V',"2",0); /*default to user priv*/ - while ( (c = getopt( argc, argv,"ac:dei:k:ln:o:rs:t:u:wv:xzEF:J:N:P:R:T:U:V:YZ:?")) != EOF ) + while ( (c = getopt( argc, argv,"ac:dei:k:ln:o:p:rs:t:u:wv:xzEF:J:N:P:R:T:U:V:YZ:?")) != EOF ) switch(c) { case 'a': factivate = 1; break; /*activate*/ case 'd': fdeactivate = 1; break; /*deactivate*/ @@ -1183,6 +1183,7 @@ main(int argc, char **argv) case 'z': fdebug = 3; break; /*full debug messages */ case 'V': /* priv level */ fprivset = 1; + case 'p': /* port */ case 'N': /* nodename */ case 'U': /* remote username */ case 'P': /* remote password */ diff --git a/util/itsol.c b/util/itsol.c index ce3f98c..64b1865 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.94"; +static char * progver = "2.95"; 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 dbc6f9a..8486b3d 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.94"; +static char * progver = "2.95"; static char * progname = "iwdt"; static char fdebug = 0; static char fdontlog = 0; @@ -335,7 +335,7 @@ main(int argc, char **argv) printf(" -q N set watchdog pretimeout to N sec\n"); printf(" -t N set timeout to N seconds\n"); printf(" -x show eXtra debug messages\n"); - print_lan_opt_usage(); + print_lan_opt_usage(0); ret = ERR_USAGE; goto do_exit; } diff --git a/util/oem_dell.c b/util/oem_dell.c index aab64d9..ef2fe4c 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.94"; +static char * progver = "2.95"; 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 25686c0..8171915 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.94"; +static char * progver = "2.95"; 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 5da8614..fa0da75 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.94"; +static char * progver = "2.95"; static char * progname = "ismcoem"; static int verbose = 0; static char fdebug = 0; -- cgit v1.2.3