ipmi_util.c revision 9113a79cf228b8f7bd509b1328adf88659dfe218
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libipmi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "ipmi_impl.h"
/*
* Error handling
*/
int
{
else
return (-1);
}
int
{
}
static struct {
int err;
const char *msg;
} errno_table[] = {
{ EIPMI_NOMEM, "memory allocation failure" },
{ EIPMI_BMC_OPEN_FAILED, "failed to open /dev/bmc" },
{ EIPMI_BMC_PUTMSG, "failed to send message to /dev/bmc" },
{ EIPMI_INVALID_COMMAND, "invalid command" },
{ EIPMI_COMMAND_TIMEOUT, "command timed out" },
{ EIPMI_DATA_LENGTH_EXCEEDED, "maximum data length exceeded" },
{ EIPMI_SEND_FAILED, "failed to send BMC request" },
{ EIPMI_UNSPECIFIED, "unspecified BMC error" },
"unexpected command response data length" },
{ EIPMI_INVALID_RESERVATION, "invalid or cancelled reservation" },
{ EIPMI_NOT_PRESENT, "request entity not present" },
{ EIPMI_INVALID_REQUEST, "malformed request data" },
{ EIPMI_BUSY, "service processor is busy" },
{ EIPMI_NOSPACE, "service processor is out of space" },
{ EIPMI_UNAVAILABLE, "service processor is unavailable" },
{ EIPMI_ACCESS, "insufficient privileges" }
};
/* ARGSUSED */
const char *
{
int i;
const char *str;
for (i = 0; i < sizeof (errno_table) / sizeof (errno_table[0]); i++) {
break;
}
}
str = "unknown failure";
return (str);
}
/*
* Memory allocation
*/
void *
{
void *ptr;
return (ptr);
}
void *
{
void *ptr;
return (ptr);
}
/* ARGSUSED */
void
{
}