mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
Replace whitespaces with tabs, remove trailing spaces/tabs and other formatting inconsistencies.
This commit is contained in:
parent
55ee48696a
commit
835fe8886c
@ -204,6 +204,7 @@ ipmi_cmd_run(struct ipmi_intf * intf, char * name, int argc, char ** argv)
|
|||||||
cmd = intf->cmdlist;
|
cmd = intf->cmdlist;
|
||||||
if (strncmp(cmd->name, "default", 7) == 0)
|
if (strncmp(cmd->name, "default", 7) == 0)
|
||||||
return cmd->func(intf, argc+1, argv-1);
|
return cmd->func(intf, argc+1, argv-1);
|
||||||
|
|
||||||
lprintf(LOG_ERR, "Invalid command: %s", name);
|
lprintf(LOG_ERR, "Invalid command: %s", name);
|
||||||
ipmi_cmd_print(intf->cmdlist);
|
ipmi_cmd_print(intf->cmdlist);
|
||||||
return -1;
|
return -1;
|
||||||
@ -270,13 +271,11 @@ ipmi_option_usage(const char * progname, struct ipmi_cmd * cmdlist, struct ipmi_
|
|||||||
*/
|
*/
|
||||||
void ipmi_catch_sigint()
|
void ipmi_catch_sigint()
|
||||||
{
|
{
|
||||||
if (ipmi_main_intf != NULL)
|
if (ipmi_main_intf != NULL) {
|
||||||
{
|
|
||||||
printf("\nSIGN INT: Close Interface %s\n",ipmi_main_intf->desc);
|
printf("\nSIGN INT: Close Interface %s\n",ipmi_main_intf->desc);
|
||||||
ipmi_main_intf->close(ipmi_main_intf);
|
ipmi_main_intf->close(ipmi_main_intf);
|
||||||
}
|
}
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ipmi_parse_hex - convert hexadecimal numbers to ascii string
|
/* ipmi_parse_hex - convert hexadecimal numbers to ascii string
|
||||||
@ -480,8 +479,7 @@ ipmi_main(int argc, char ** argv,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'K':
|
case 'K':
|
||||||
if ((tmp = getenv("IPMI_KGKEY")))
|
if ((tmp = getenv("IPMI_KGKEY"))) {
|
||||||
{
|
|
||||||
if (kgkey)
|
if (kgkey)
|
||||||
free(kgkey);
|
free(kgkey);
|
||||||
kgkey = strdup(tmp);
|
kgkey = strdup(tmp);
|
||||||
@ -489,8 +487,7 @@ ipmi_main(int argc, char ** argv,
|
|||||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lprintf(LOG_WARN, "Unable to read kgkey from environment");
|
lprintf(LOG_WARN, "Unable to read kgkey from environment");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -565,8 +562,7 @@ ipmi_main(int argc, char ** argv,
|
|||||||
memset(optarg, 'X', i);
|
memset(optarg, 'X', i);
|
||||||
break;
|
break;
|
||||||
case 'E':
|
case 'E':
|
||||||
if ((tmp = getenv("IPMITOOL_PASSWORD")))
|
if ((tmp = getenv("IPMITOOL_PASSWORD"))) {
|
||||||
{
|
|
||||||
if (password)
|
if (password)
|
||||||
free(password);
|
free(password);
|
||||||
password = strdup(tmp);
|
password = strdup(tmp);
|
||||||
@ -575,8 +571,7 @@ ipmi_main(int argc, char ** argv,
|
|||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((tmp = getenv("IPMI_PASSWORD")))
|
else if ((tmp = getenv("IPMI_PASSWORD"))) {
|
||||||
{
|
|
||||||
if (password)
|
if (password)
|
||||||
free(password);
|
free(password);
|
||||||
password = strdup(tmp);
|
password = strdup(tmp);
|
||||||
@ -749,15 +744,15 @@ ipmi_main(int argc, char ** argv,
|
|||||||
/* setup IPMB local and target address if given */
|
/* setup IPMB local and target address if given */
|
||||||
if (my_addr) {
|
if (my_addr) {
|
||||||
ipmi_main_intf->my_addr = my_addr;
|
ipmi_main_intf->my_addr = my_addr;
|
||||||
}
|
} else {
|
||||||
else {
|
/* Check if PICMG extension is available to use the function
|
||||||
|
* GetDeviceLocator to retreive i2c address PICMG hack to set
|
||||||
/* Check if PICMG extension is available to use the function GetDeviceLocator
|
* right IPMB address, If extension is not supported, should
|
||||||
* to retreive i2c address PICMG hack to set right IPMB address,
|
* not give any problems
|
||||||
* If extension is not supported, should not give any problems
|
|
||||||
* PICMG Extension Version 2.0 (PICMG 3.0 Revision 1.0 ATCA) to
|
* PICMG Extension Version 2.0 (PICMG 3.0 Revision 1.0 ATCA) to
|
||||||
* PICMG Extension Version 2.3 (PICMG 3.0 Revision 3.0 ATCA)
|
* PICMG Extension Version 2.3 (PICMG 3.0 Revision 3.0 ATCA)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* First, check if PICMG extension is available and supported */
|
/* First, check if PICMG extension is available and supported */
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
struct ipmi_rs *rsp;
|
struct ipmi_rs *rsp;
|
||||||
@ -775,12 +770,8 @@ ipmi_main(int argc, char ** argv,
|
|||||||
|
|
||||||
rsp = ipmi_main_intf->sendrecv(ipmi_main_intf, &req);
|
rsp = ipmi_main_intf->sendrecv(ipmi_main_intf, &req);
|
||||||
if (rsp && !rsp->ccode) {
|
if (rsp && !rsp->ccode) {
|
||||||
if
|
if ( (rsp->data[0] == 0) &&
|
||||||
(
|
((rsp->data[1] & 0x0F) == PICMG_ATCA_MAJOR_VERSION) ) {
|
||||||
(rsp->data[0] == 0)
|
|
||||||
&&
|
|
||||||
((rsp->data[1] & 0x0F ) == PICMG_ATCA_MAJOR_VERSION )
|
|
||||||
){
|
|
||||||
version_accepted = 1;
|
version_accepted = 1;
|
||||||
lprintf(LOG_INFO, "Discovered PICMG Extension %d.%d",
|
lprintf(LOG_INFO, "Discovered PICMG Extension %d.%d",
|
||||||
(rsp->data[1] & 0x0f), (rsp->data[1] >> 4));
|
(rsp->data[1] & 0x0f), (rsp->data[1] >> 4));
|
||||||
@ -801,28 +792,26 @@ ipmi_main(int argc, char ** argv,
|
|||||||
if (rsp && !rsp->ccode) {
|
if (rsp && !rsp->ccode) {
|
||||||
ipmi_main_intf->my_addr = rsp->data[2];
|
ipmi_main_intf->my_addr = rsp->data[2];
|
||||||
ipmi_main_intf->target_addr = ipmi_main_intf->my_addr;
|
ipmi_main_intf->target_addr = ipmi_main_intf->my_addr;
|
||||||
lprintf(LOG_INFO, "Discovered IPMB address = 0x%x", ipmi_main_intf->my_addr);
|
lprintf(LOG_INFO, "Discovered IPMB address = 0x%x",
|
||||||
|
ipmi_main_intf->my_addr);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
lprintf(LOG_INFO,
|
lprintf(LOG_INFO,
|
||||||
"No PICMG Extenstion discovered, keeping IPMB address 0x20");
|
"No PICMG Extenstion discovered, keeping IPMB address 0x20");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( target_addr > 0 && (target_addr != my_addr) ) {
|
if ( target_addr > 0 && (target_addr != my_addr) ) {
|
||||||
/* need to open the interface first */
|
/* need to open the interface first */
|
||||||
if (ipmi_main_intf->open != NULL)
|
if (ipmi_main_intf->open != NULL)
|
||||||
ipmi_main_intf->open(ipmi_main_intf);
|
ipmi_main_intf->open(ipmi_main_intf);
|
||||||
|
|
||||||
ipmi_main_intf->target_addr = target_addr;
|
ipmi_main_intf->target_addr = target_addr;
|
||||||
|
|
||||||
if (transit_addr > 0) {
|
if (transit_addr > 0) {
|
||||||
ipmi_main_intf->transit_addr = transit_addr;
|
ipmi_main_intf->transit_addr = transit_addr;
|
||||||
ipmi_main_intf->transit_channel = transit_channel;
|
ipmi_main_intf->transit_channel = transit_channel;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
ipmi_main_intf->transit_addr = ipmi_main_intf->my_addr;
|
ipmi_main_intf->transit_addr = ipmi_main_intf->my_addr;
|
||||||
}
|
}
|
||||||
/* must be admin level to do this over lan */
|
/* must be admin level to do this over lan */
|
||||||
@ -841,8 +830,7 @@ ipmi_main(int argc, char ** argv,
|
|||||||
|
|
||||||
/* Enable Big Buffer when requested */
|
/* Enable Big Buffer when requested */
|
||||||
ipmi_main_intf->channel_buf_size = 0;
|
ipmi_main_intf->channel_buf_size = 0;
|
||||||
if( my_long_packet_size != 0 )
|
if ( my_long_packet_size != 0 ) {
|
||||||
{
|
|
||||||
printf("Setting large buffer to %i\n", my_long_packet_size);
|
printf("Setting large buffer to %i\n", my_long_packet_size);
|
||||||
if (ipmi_kontronoem_set_large_buffer( ipmi_main_intf, my_long_packet_size ) == 0)
|
if (ipmi_kontronoem_set_large_buffer( ipmi_main_intf, my_long_packet_size ) == 0)
|
||||||
{
|
{
|
||||||
@ -860,8 +848,7 @@ ipmi_main(int argc, char ** argv,
|
|||||||
else
|
else
|
||||||
rc = ipmi_cmd_run(ipmi_main_intf, NULL, 0, NULL);
|
rc = ipmi_cmd_run(ipmi_main_intf, NULL, 0, NULL);
|
||||||
|
|
||||||
if(my_long_packet_set == 1)
|
if (my_long_packet_set == 1) {
|
||||||
{
|
|
||||||
/* Restore defaults */
|
/* Restore defaults */
|
||||||
ipmi_kontronoem_set_large_buffer( ipmi_main_intf, 0 );
|
ipmi_kontronoem_set_large_buffer( ipmi_main_intf, 0 );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user