/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright (c) 2012 Joyent, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
#include <libipd.h>
struct ipd_stat {
};
static ipd_errno_t
xlate_errno(int e)
{
switch (e) {
case 0:
return (EIPD_NOERROR);
case ENOMEM:
case EAGAIN:
return (EIPD_NOMEM);
case ERANGE:
return (EIPD_RANGE);
case EPERM:
return (EIPD_PERM);
case EFAULT:
return (EIPD_FAULT);
case ENOTTY:
return (EIPD_INTERNAL);
default:
return (EIPD_UNKNOWN);
}
}
const char *
{
switch (e) {
case EIPD_NOERROR:
return ("no error");
case EIPD_NOMEM:
return ("out of memory");
case EIPD_ZC_NOENT:
return ("zone does not exist or is not using ipd");
case EIPD_RANGE:
return ("argument out of range");
case EIPD_PERM:
return ("permission denied");
case EIPD_FAULT:
return ("bad pointer");
case EIPD_INTERNAL:
return ("internal library error");
case EIPD_UNKNOWN:
default:
return ("unknown error");
}
}
static int
{
ipd_errno = e;
} else {
(void) strlcpy(ipd_errmsg,
ipd_strerror(e), sizeof (ipd_errmsg));
}
return (-1);
}
int
{
int fd;
path = IPD_DEV_PATH;
if (fd < 0) {
}
return (fd);
}
int
{
return (0);
}
int
{
uint_t i;
}
for (;;) {
break;
"unable to retrieve ipd zone list: %s",
}
break;
}
}
return (0);
}
}
}
}
return (0);
}
void
{
uint_t i;
}
int
{
uint_t i;
if (isp->is_zoneids[i] == z) {
return (0);
}
}
return (ipd_set_errno(EIPD_ZC_NOENT,
"zone %d does not exist or has no ipd configuration", z));
}
void
{
}
}
int
{
ipip.ipip_zoneid = z;
if (icp->ic_corrupt == 0)
}
}
}
"unable to remove cleared ipd settings: %s",
}
ipip.ipip_zoneid = z;
"unable to set corruption rate to %d: %s",
}
}
ipip.ipip_zoneid = z;
"unable to set delay time to %d: %s",
}
}
ipip.ipip_zoneid = z;
"unable to set drop probability to %d: %s",
}
}
return (0);
}