/*
* 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
*/
/*
*/
#include <stdlib.h>
#include <strings.h>
#include <errno.h>
#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
#include <libdevinfo.h>
#include <libdladm_impl.h>
#include <libdlflow.h>
#include <libdllink.h>
#include <libdlflow_impl.h>
#include <libintl.h>
#include <zone.h>
#include <dlfcn.h>
#include <link.h>
const char *, char **, uint_t, const char *);
const char *, char **, uint_t *);
};
};
{"maxbw", extract_maxbw},
};
sizeof (resource_prop_t))
{
*token = '\0';
token++;
return (getzoneidbyname(zonename));
} else {
return (getzoneid());
}
}
{
return (DLADM_STATUS_BADARG);
if (zoneid != inputzoneid)
return (DLADM_STATUS_FLOW_WRONG_ZONE);
return (DLADM_STATUS_FLOW_WRONG_ZONE);
if ((flags & DLADM_OPT_ACTIVE) != 0) {
if (status == DLADM_STATUS_TEMPONLY &&
(flags & DLADM_OPT_PERSIST) != 0)
return (DLADM_STATUS_TEMPONLY);
if (status != DLADM_STATUS_OK)
return (status);
}
if ((flags & DLADM_OPT_PERSIST) != 0) {
return (DLADM_STATUS_TEMPONLY);
}
return (status);
}
void *arg)
{
int i;
return (DLADM_STATUS_BADARG);
/* Then show data-flow properties if there are any */
for (i = 0; i < DLADM_MAX_FLOWPROPS; i++) {
break;
}
return (DLADM_STATUS_OK);
}
{
return (DLADM_STATUS_BADARG);
if (type == DLADM_PROP_VAL_PERSISTENT) {
return (DLADM_STATUS_TEMPONLY);
}
if (status != DLADM_STATUS_NOTFOUND)
return (status);
return (DLADM_STATUS_BADARG);
}
/* ARGSUSED */
static dladm_status_t
{
uint64_t a;
if (status != DLADM_STATUS_OK)
return (status);
int i;
for (i = 0; i < DLADM_MAX_FLOWPROPS; i++) {
a = MRP_MAXBW_RESETVAL;
if (status != 0)
return (status);
}
(void) dladm_str2bw(*prop_val, &a);
else
a = MRP_MAXBW_RESETVAL;
} else {
return (DLADM_STATUS_BADARG);
}
DLADM_TYPE_UINT64, &a);
return (status == DLADM_STATUS_OK ?
}
static dladm_status_t
{
if (status != DLADM_STATUS_OK)
return (status);
int i;
for (i = 0; i < DLADM_MAX_FLOWPROPS; i++) {
if (status != 0)
break;
}
return (status);
}
if (status != DLADM_STATUS_OK)
return (status);
*val_cntp = 1;
return (status);
}
{
int bufsize;
return (DLADM_STATUS_BADARG);
return (DLADM_STATUS_FLOW_WRONG_ZONE);
return (dladm_errno2status(errno));
bufsize *= 2;
continue;
}
}
return (dladm_errno2status(errno));
}
sizeof (attr->fa_flowname));
sizeof (attr->fa_flow_desc));
sizeof (attr->fa_resource_props));
return (DLADM_STATUS_OK);
}
/* ARGSUSED */
static dladm_status_t
{
if (status != DLADM_STATUS_OK)
return (status);
*val_cnt = 1;
} else {
return (DLADM_STATUS_NOTSUP);
}
return (DLADM_STATUS_OK);
}
/* ARGSUSED */
static dladm_status_t
{
void *val;
if (val_cnt != 1)
return (DLADM_STATUS_BADVALCNT);
} else {
}
return (dladm_errno2status(errno));
return (DLADM_STATUS_OK);
}
/* ARGSUSED */
static dladm_status_t
val_desc_t **vdpp)
{
if (val_cnt != 1)
return (DLADM_STATUS_BADVALCNT);
return (DLADM_STATUS_NOMEM);
if (status != DLADM_STATUS_OK) {
return (status);
}
return (DLADM_STATUS_MINMAXBW);
}
return (DLADM_STATUS_NOMEM);
}
return (DLADM_STATUS_OK);
}
static dladm_status_t
{
int i, j;
for (j = 0; j < DLADM_MAX_FLOWPROPS; j++) {
prop_table[j].pd_name) == 0)
}
if (!matched)
return (DLADM_STATUS_BADPROP);
}
return (DLADM_STATUS_OK);
}
{
if (status != DLADM_STATUS_OK)
return (status);
!= DLADM_STATUS_OK)) {
return (status);
}
return (DLADM_STATUS_OK);
}
/*
* Retrieve the named property from a proplist, check the value and
* convert to a kernel structure.
*/
static dladm_status_t
{
int i, j;
/* Find named property in proplist */
break;
}
/* Property not in list */
return (DLADM_STATUS_OK);
for (i = 0; i < DLADM_MAX_FLOWPROPS; i++) {
return (DLADM_STATUS_NOMEM);
continue;
return (DLADM_STATUS_BADARG);
/* Check property value */
} else {
}
if (status != DLADM_STATUS_OK)
return (status);
for (j = 0; j < DLADM_MAX_RSRC_PROP; j++) {
continue;
/* Extract kernel structure */
} else {
}
break;
}
if (status != DLADM_STATUS_OK)
return (status);
break;
}
return (status);
}
/*
* Extract properties from a proplist and convert to mac_resource_props_t.
*/
{
if (status != DLADM_STATUS_OK)
return (status);
return (status);
}