/*
* 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 2014 Nexenta Systems, Inc. All rights reserved.
*/
#include <attr.h>
#include <libnvpair.h>
static int
/*
* See similar code to parse the nvlist in:
*/
int
{
int error;
return (EINVAL);
}
if (error == 0) {
}
/*
* Also get the readonly attrs, but don't fail.
*/
}
return (error);
}
static int
{
int error;
/*
* Validate the name and type of each attribute.
* Log any unknown names and continue. This will
* help if additional attributes are added later.
*/
if (attr == F_ATTR_INVAL)
continue;
/*
* Verify nvlist type matches required type and view is OK
*/
continue;
/*
*/
continue;
/*
* Retrieve data from nvpair
*/
switch (type) {
case DATA_TYPE_BOOLEAN_VALUE:
goto out;
}
break;
case DATA_TYPE_UINT64_ARRAY:
goto out;
}
if (nelems < 2)
continue;
break;
case DATA_TYPE_NVLIST:
continue;
case DATA_TYPE_UINT8_ARRAY:
continue;
default:
goto out;
}
switch (attr) {
/*
* If we have several similar optional attributes to
* process then we should do it all together here so that
* xoap and the requested bitmap can be set in one place.
*/
case F_READONLY:
break;
case F_HIDDEN:
break;
case F_SYSTEM:
break;
case F_ARCHIVE:
break;
case F_CRTIME:
break;
case F_REPARSE:
break;
case F_OFFLINE:
break;
case F_SPARSE:
break;
default:
break;
}
}
error = 0;
out:
return (error);
}
/*
* See similar code to build the nvlist in:
*/
int
{
int error;
return (EINVAL);
return (ENOMEM);
xoap->xoa_readonly) == 0);
}
xoap->xoa_hidden) == 0);
}
xoap->xoa_system) == 0);
}
xoap->xoa_archive) == 0);
}
times, 2) == 0);
}
xoap->xoa_reparse) == 0);
}
xoap->xoa_offline) == 0);
}
xoap->xoa_sparse) == 0);
}
return (error);
}