summaryrefslogtreecommitdiff
path: root/util/ilan.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-05-08 23:32:28 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-05-08 23:32:28 +0200
commit55adddbc16f65732b57ab8585c47001fced91d77 (patch)
tree27e8239d48c8a6b353db356aff92ee4d225c0a0e /util/ilan.c
parentd3c90cdcdf56146af89056ed36bfcc7b4d4956c5 (diff)
Imported Upstream version 2.9.9upstream/2.9.9
Diffstat (limited to 'util/ilan.c')
-rw-r--r--util/ilan.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/util/ilan.c b/util/ilan.c
index 3499ed9..c81c7a9 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.98";
+static char * progver = "2.99";
static char * progname = "ilan";
static char fdebug = 0;
static char fipmilan = 0;
@@ -721,7 +721,7 @@ SetPasswd(int unum, char *uname, char *upswd)
int responseLength = MAX_BUFFER_SIZE;
int status, i, psw_len;
uchar completionCode;
- char inputData[24];
+ uchar inputData[24];
int ret = 0;
inputData[0] = (uchar)unum; /*user 1 = null user */
@@ -797,7 +797,7 @@ SetPasswd(int unum, char *uname, char *upswd)
psw_len = PSW_LEN; /*=16 change if 20-byte passwords supported */
memset(&inputData[2],0,psw_len);
if (upswd != NULL)
- strcpy(&inputData[2],upswd);
+ strcpy((char *)&inputData[2],upswd);
if (fdebug) {
char apsw[PSW_MAX+1];
char c;
@@ -824,7 +824,7 @@ SetPasswd(int unum, char *uname, char *upswd)
inputData[1] = 0x03; /*test password*/
memset(&inputData[2],0,psw_len);
if (upswd != NULL)
- strcpy(&inputData[2],upswd);
+ strcpy((char *)&inputData[2],upswd);
responseLength = sizeof(responseData);
status = ipmi_cmd(SET_USER_PASSWORD, inputData, 2+psw_len,
responseData,&responseLength, &completionCode,fdebug);
@@ -870,7 +870,7 @@ DisableUser(int unum)
int responseLength = MAX_BUFFER_SIZE;
int status;
uchar completionCode;
- char inputData[24];
+ uchar inputData[24];
inputData[0] = 0x80 | lan_ch; /* = 0x87, no IPMI */
inputData[1] = (uchar)unum; /* user 1 */
@@ -931,7 +931,7 @@ int GetUser(uchar user_num)
int responseLength = MAX_BUFFER_SIZE;
int status;
uchar completionCode;
- char inputData[24];
+ uchar inputData[24];
inputData[0] = lan_ch;
inputData[1] = user_num; /* usually = 1 for BMC LAN */
@@ -2070,7 +2070,7 @@ int FindEthNum(uchar *macadrin)
#endif
{
uchar *pb;
- pb = get_ifreq_mac(&ifr);
+ pb = (uchar *)get_ifreq_mac(&ifr);
#ifdef DBG
if (fdebug) {
printf("%s mac: %02x:%02x:%02x:%02x:%02x:%02x\n",
@@ -2948,7 +2948,7 @@ int Get_IPMac_Addr()
else if (fdebug)
printf("ioctl(SIOCGIFADDR,%s) error, errno=%d\n",_ifname,err);
} else { /* got the local OS IP successfully */
- pc = &ifr.ifr_addr.sa_data[2];
+ pc = (uchar *)&ifr.ifr_addr.sa_data[2];
if (fdebug)
printf("%s addr = %d.%d.%d.%d\n",_ifname,pc[0],pc[1],pc[2],pc[3]);
memcpy(osmyip, pc, 4);
@@ -2962,7 +2962,7 @@ int Get_IPMac_Addr()
printf("ioctl(SIOCGIFNETMASK) error, errno=%d\n",get_errno());
/* if leave invalid, will use default rgsubnet */
} else { // sizeof(struct sockaddr)
- pc = &ifr.ifr_netmask.sa_data[2];
+ pc = (uchar *)&ifr.ifr_netmask.sa_data[2];
if (fdebug)
printf("subnet = %d.%d.%d.%d \n", pc[0],pc[1],pc[2],pc[3]);
memcpy(ossubnet, pc, 4);
@@ -3675,6 +3675,8 @@ main(int argc, char **argv)
char mystr[80];
char fpefok = 1;
uchar * pc; int sz;
+ char *pa;
+ char *pb;
// progname = argv[0];
printf("%s ver %s \n",progname,progver);
@@ -4188,7 +4190,6 @@ main(int argc, char **argv)
{
ret = GetPefEntry( 0x06, (ushort)idx, &PefRecord);
if (ret == 0) { // Show the PEF record
- char *pa;
pc = (uchar *)&PefRecord;
sz = 21; // sizeof(PEF_RECORD) = 21
if (PefRecord.sensor_type == 0) {
@@ -4198,8 +4199,8 @@ main(int argc, char **argv)
if (fAdjustPefNum) pefnum = (char)idx;
} else {
memcpy(pef_array[idx-1], &PefRecord, sz);
- if (PefRecord.fconfig & 0x80) pc = "enabled";
- else pc = "disabled";
+ if (PefRecord.fconfig & 0x80) pb = "enabled";
+ else pb = "disabled";
i = PefRecord.rec_id;
switch(PefRecord.action) {
case 0x01: pa = "alert"; break;
@@ -4212,7 +4213,7 @@ main(int argc, char **argv)
}
printf("PEFilter(%02d): %02x %s event - %s for %s\n",
idx, PefRecord.sensor_type,
- PefDesc(i,PefRecord.sensor_type), pc,pa);
+ PefDesc(i,PefRecord.sensor_type), pb,pa);
}
if (fdebug) { /* show raw PEFilter record */
pc = &PefRecord.rec_id;
@@ -5062,7 +5063,7 @@ main(int argc, char **argv)
printf("snmp community \t%s\n",rgcommunity);
/* Only need the SNMP community if there is an Alert Destination */
memset(&LanRecord.data[0], 0, 18); /* make sure zero-filled */
- strcpy(&LanRecord.data[0],rgcommunity);
+ strcpy((char *)&LanRecord.data[0],rgcommunity);
ret = SetLanEntry(16, &LanRecord, 18);
printf("SetLanEntry(16), ret = %d\n",ret);
if (ret != 0) { nerrs++; lasterr = ret; }