xref: /illumos-gate/usr/src/uts/common/sys/nvpair.h (revision 92241e0b80813d0b83c08e730a29b9d1831794fc)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
51af98250Seschrock  * Common Development and Distribution License (the "License").
61af98250Seschrock  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*92241e0bSTom Erickson  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYS_NVPAIR_H
277c478bd9Sstevel@tonic-gate #define	_SYS_NVPAIR_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #include <sys/types.h>
307c478bd9Sstevel@tonic-gate #include <sys/errno.h>
317c478bd9Sstevel@tonic-gate #include <sys/va_list.h>
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #if defined(_KERNEL) && !defined(_BOOT)
347c478bd9Sstevel@tonic-gate #include <sys/kmem.h>
357c478bd9Sstevel@tonic-gate #endif
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
387c478bd9Sstevel@tonic-gate extern "C" {
397c478bd9Sstevel@tonic-gate #endif
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate typedef enum {
427c478bd9Sstevel@tonic-gate 	DATA_TYPE_UNKNOWN = 0,
437c478bd9Sstevel@tonic-gate 	DATA_TYPE_BOOLEAN,
447c478bd9Sstevel@tonic-gate 	DATA_TYPE_BYTE,
457c478bd9Sstevel@tonic-gate 	DATA_TYPE_INT16,
467c478bd9Sstevel@tonic-gate 	DATA_TYPE_UINT16,
477c478bd9Sstevel@tonic-gate 	DATA_TYPE_INT32,
487c478bd9Sstevel@tonic-gate 	DATA_TYPE_UINT32,
497c478bd9Sstevel@tonic-gate 	DATA_TYPE_INT64,
507c478bd9Sstevel@tonic-gate 	DATA_TYPE_UINT64,
517c478bd9Sstevel@tonic-gate 	DATA_TYPE_STRING,
527c478bd9Sstevel@tonic-gate 	DATA_TYPE_BYTE_ARRAY,
537c478bd9Sstevel@tonic-gate 	DATA_TYPE_INT16_ARRAY,
547c478bd9Sstevel@tonic-gate 	DATA_TYPE_UINT16_ARRAY,
557c478bd9Sstevel@tonic-gate 	DATA_TYPE_INT32_ARRAY,
567c478bd9Sstevel@tonic-gate 	DATA_TYPE_UINT32_ARRAY,
577c478bd9Sstevel@tonic-gate 	DATA_TYPE_INT64_ARRAY,
587c478bd9Sstevel@tonic-gate 	DATA_TYPE_UINT64_ARRAY,
597c478bd9Sstevel@tonic-gate 	DATA_TYPE_STRING_ARRAY,
607c478bd9Sstevel@tonic-gate 	DATA_TYPE_HRTIME,
617c478bd9Sstevel@tonic-gate 	DATA_TYPE_NVLIST,
627c478bd9Sstevel@tonic-gate 	DATA_TYPE_NVLIST_ARRAY,
637c478bd9Sstevel@tonic-gate 	DATA_TYPE_BOOLEAN_VALUE,
647c478bd9Sstevel@tonic-gate 	DATA_TYPE_INT8,
657c478bd9Sstevel@tonic-gate 	DATA_TYPE_UINT8,
667c478bd9Sstevel@tonic-gate 	DATA_TYPE_BOOLEAN_ARRAY,
677c478bd9Sstevel@tonic-gate 	DATA_TYPE_INT8_ARRAY,
68825ba0f2Srobj #if !defined(_KERNEL)
69825ba0f2Srobj 	DATA_TYPE_UINT8_ARRAY,
70825ba0f2Srobj 	DATA_TYPE_DOUBLE
71825ba0f2Srobj #else
727c478bd9Sstevel@tonic-gate 	DATA_TYPE_UINT8_ARRAY
73825ba0f2Srobj #endif
747c478bd9Sstevel@tonic-gate } data_type_t;
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate typedef struct nvpair {
777c478bd9Sstevel@tonic-gate 	int32_t nvp_size;	/* size of this nvpair */
787c478bd9Sstevel@tonic-gate 	int16_t	nvp_name_sz;	/* length of name string */
797c478bd9Sstevel@tonic-gate 	int16_t	nvp_reserve;	/* not used */
807c478bd9Sstevel@tonic-gate 	int32_t	nvp_value_elem;	/* number of elements for array types */
817c478bd9Sstevel@tonic-gate 	data_type_t nvp_type;	/* type of value */
827c478bd9Sstevel@tonic-gate 	/* name string */
837c478bd9Sstevel@tonic-gate 	/* aligned ptr array for string arrays */
847c478bd9Sstevel@tonic-gate 	/* aligned array of data for value */
857c478bd9Sstevel@tonic-gate } nvpair_t;
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate /* nvlist header */
887c478bd9Sstevel@tonic-gate typedef struct nvlist {
897c478bd9Sstevel@tonic-gate 	int32_t		nvl_version;
907c478bd9Sstevel@tonic-gate 	uint32_t	nvl_nvflag;	/* persistent flags */
917c478bd9Sstevel@tonic-gate 	uint64_t	nvl_priv;	/* ptr to private data if not packed */
927c478bd9Sstevel@tonic-gate 	uint32_t	nvl_flag;
937c478bd9Sstevel@tonic-gate 	int32_t		nvl_pad;	/* currently not used, for alignment */
947c478bd9Sstevel@tonic-gate } nvlist_t;
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate /* nvp implementation version */
977c478bd9Sstevel@tonic-gate #define	NV_VERSION	0
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate /* nvlist pack encoding */
1007c478bd9Sstevel@tonic-gate #define	NV_ENCODE_NATIVE	0
1017c478bd9Sstevel@tonic-gate #define	NV_ENCODE_XDR		1
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate /* nvlist persistent unique name flags, stored in nvl_nvflags */
1047c478bd9Sstevel@tonic-gate #define	NV_UNIQUE_NAME		0x1
1057c478bd9Sstevel@tonic-gate #define	NV_UNIQUE_NAME_TYPE	0x2
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate /* nvlist lookup pairs related flags */
1087c478bd9Sstevel@tonic-gate #define	NV_FLAG_NOENTOK		0x1
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate /* convenience macros */
1117c478bd9Sstevel@tonic-gate #define	NV_ALIGN(x)		(((ulong_t)(x) + 7ul) & ~7ul)
1127c478bd9Sstevel@tonic-gate #define	NV_ALIGN4(x)		(((x) + 3) & ~3)
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate #define	NVP_SIZE(nvp)		((nvp)->nvp_size)
1157c478bd9Sstevel@tonic-gate #define	NVP_NAME(nvp)		((char *)(nvp) + sizeof (nvpair_t))
1167c478bd9Sstevel@tonic-gate #define	NVP_TYPE(nvp)		((nvp)->nvp_type)
1177c478bd9Sstevel@tonic-gate #define	NVP_NELEM(nvp)		((nvp)->nvp_value_elem)
1187c478bd9Sstevel@tonic-gate #define	NVP_VALUE(nvp)		((char *)(nvp) + NV_ALIGN(sizeof (nvpair_t) \
1197c478bd9Sstevel@tonic-gate 				+ (nvp)->nvp_name_sz))
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate #define	NVL_VERSION(nvl)	((nvl)->nvl_version)
1227c478bd9Sstevel@tonic-gate #define	NVL_SIZE(nvl)		((nvl)->nvl_size)
1237c478bd9Sstevel@tonic-gate #define	NVL_FLAG(nvl)		((nvl)->nvl_flag)
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate /* NV allocator framework */
1267c478bd9Sstevel@tonic-gate typedef struct nv_alloc_ops nv_alloc_ops_t;
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate typedef struct nv_alloc {
1297c478bd9Sstevel@tonic-gate 	const nv_alloc_ops_t *nva_ops;
1307c478bd9Sstevel@tonic-gate 	void *nva_arg;
1317c478bd9Sstevel@tonic-gate } nv_alloc_t;
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate struct nv_alloc_ops {
1347c478bd9Sstevel@tonic-gate 	int (*nv_ao_init)(nv_alloc_t *, __va_list);
1357c478bd9Sstevel@tonic-gate 	void (*nv_ao_fini)(nv_alloc_t *);
1367c478bd9Sstevel@tonic-gate 	void *(*nv_ao_alloc)(nv_alloc_t *, size_t);
1377c478bd9Sstevel@tonic-gate 	void (*nv_ao_free)(nv_alloc_t *, void *, size_t);
1387c478bd9Sstevel@tonic-gate 	void (*nv_ao_reset)(nv_alloc_t *);
1397c478bd9Sstevel@tonic-gate };
1407c478bd9Sstevel@tonic-gate 
1417c478bd9Sstevel@tonic-gate extern const nv_alloc_ops_t *nv_fixed_ops;
1427c478bd9Sstevel@tonic-gate extern nv_alloc_t *nv_alloc_nosleep;
1437c478bd9Sstevel@tonic-gate 
1447c478bd9Sstevel@tonic-gate #if defined(_KERNEL) && !defined(_BOOT)
1457c478bd9Sstevel@tonic-gate extern nv_alloc_t *nv_alloc_sleep;
1467c478bd9Sstevel@tonic-gate #endif
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate int nv_alloc_init(nv_alloc_t *, const nv_alloc_ops_t *, /* args */ ...);
1497c478bd9Sstevel@tonic-gate void nv_alloc_reset(nv_alloc_t *);
1507c478bd9Sstevel@tonic-gate void nv_alloc_fini(nv_alloc_t *);
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate /* list management */
1537c478bd9Sstevel@tonic-gate int nvlist_alloc(nvlist_t **, uint_t, int);
1547c478bd9Sstevel@tonic-gate void nvlist_free(nvlist_t *);
1557c478bd9Sstevel@tonic-gate int nvlist_size(nvlist_t *, size_t *, int);
1567c478bd9Sstevel@tonic-gate int nvlist_pack(nvlist_t *, char **, size_t *, int, int);
1577c478bd9Sstevel@tonic-gate int nvlist_unpack(char *, size_t, nvlist_t **, int);
1587c478bd9Sstevel@tonic-gate int nvlist_dup(nvlist_t *, nvlist_t **, int);
1597c478bd9Sstevel@tonic-gate int nvlist_merge(nvlist_t *, nvlist_t *, int);
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate int nvlist_xalloc(nvlist_t **, uint_t, nv_alloc_t *);
1627c478bd9Sstevel@tonic-gate int nvlist_xpack(nvlist_t *, char **, size_t *, int, nv_alloc_t *);
1637c478bd9Sstevel@tonic-gate int nvlist_xunpack(char *, size_t, nvlist_t **, nv_alloc_t *);
1647c478bd9Sstevel@tonic-gate int nvlist_xdup(nvlist_t *, nvlist_t **, nv_alloc_t *);
1657c478bd9Sstevel@tonic-gate nv_alloc_t *nvlist_lookup_nv_alloc(nvlist_t *);
1667c478bd9Sstevel@tonic-gate 
1677c478bd9Sstevel@tonic-gate int nvlist_add_nvpair(nvlist_t *, nvpair_t *);
1687c478bd9Sstevel@tonic-gate int nvlist_add_boolean(nvlist_t *, const char *);
1697c478bd9Sstevel@tonic-gate int nvlist_add_boolean_value(nvlist_t *, const char *, boolean_t);
1707c478bd9Sstevel@tonic-gate int nvlist_add_byte(nvlist_t *, const char *, uchar_t);
1717c478bd9Sstevel@tonic-gate int nvlist_add_int8(nvlist_t *, const char *, int8_t);
1727c478bd9Sstevel@tonic-gate int nvlist_add_uint8(nvlist_t *, const char *, uint8_t);
1737c478bd9Sstevel@tonic-gate int nvlist_add_int16(nvlist_t *, const char *, int16_t);
1747c478bd9Sstevel@tonic-gate int nvlist_add_uint16(nvlist_t *, const char *, uint16_t);
1757c478bd9Sstevel@tonic-gate int nvlist_add_int32(nvlist_t *, const char *, int32_t);
1767c478bd9Sstevel@tonic-gate int nvlist_add_uint32(nvlist_t *, const char *, uint32_t);
1777c478bd9Sstevel@tonic-gate int nvlist_add_int64(nvlist_t *, const char *, int64_t);
1787c478bd9Sstevel@tonic-gate int nvlist_add_uint64(nvlist_t *, const char *, uint64_t);
1797c478bd9Sstevel@tonic-gate int nvlist_add_string(nvlist_t *, const char *, const char *);
1807c478bd9Sstevel@tonic-gate int nvlist_add_nvlist(nvlist_t *, const char *, nvlist_t *);
1817c478bd9Sstevel@tonic-gate int nvlist_add_boolean_array(nvlist_t *, const char *, boolean_t *, uint_t);
1827c478bd9Sstevel@tonic-gate int nvlist_add_byte_array(nvlist_t *, const char *, uchar_t *, uint_t);
1837c478bd9Sstevel@tonic-gate int nvlist_add_int8_array(nvlist_t *, const char *, int8_t *, uint_t);
1847c478bd9Sstevel@tonic-gate int nvlist_add_uint8_array(nvlist_t *, const char *, uint8_t *, uint_t);
1857c478bd9Sstevel@tonic-gate int nvlist_add_int16_array(nvlist_t *, const char *, int16_t *, uint_t);
1867c478bd9Sstevel@tonic-gate int nvlist_add_uint16_array(nvlist_t *, const char *, uint16_t *, uint_t);
1877c478bd9Sstevel@tonic-gate int nvlist_add_int32_array(nvlist_t *, const char *, int32_t *, uint_t);
1887c478bd9Sstevel@tonic-gate int nvlist_add_uint32_array(nvlist_t *, const char *, uint32_t *, uint_t);
1897c478bd9Sstevel@tonic-gate int nvlist_add_int64_array(nvlist_t *, const char *, int64_t *, uint_t);
1907c478bd9Sstevel@tonic-gate int nvlist_add_uint64_array(nvlist_t *, const char *, uint64_t *, uint_t);
1917c478bd9Sstevel@tonic-gate int nvlist_add_string_array(nvlist_t *, const char *, char *const *, uint_t);
1927c478bd9Sstevel@tonic-gate int nvlist_add_nvlist_array(nvlist_t *, const char *, nvlist_t **, uint_t);
1937c478bd9Sstevel@tonic-gate int nvlist_add_hrtime(nvlist_t *, const char *, hrtime_t);
194825ba0f2Srobj #if !defined(_KERNEL)
195825ba0f2Srobj int nvlist_add_double(nvlist_t *, const char *, double);
196825ba0f2Srobj #endif
1977c478bd9Sstevel@tonic-gate 
1987c478bd9Sstevel@tonic-gate int nvlist_remove(nvlist_t *, const char *, data_type_t);
1997c478bd9Sstevel@tonic-gate int nvlist_remove_all(nvlist_t *, const char *);
200*92241e0bSTom Erickson int nvlist_remove_nvpair(nvlist_t *, nvpair_t *);
2017c478bd9Sstevel@tonic-gate 
2027c478bd9Sstevel@tonic-gate int nvlist_lookup_boolean(nvlist_t *, const char *);
2037c478bd9Sstevel@tonic-gate int nvlist_lookup_boolean_value(nvlist_t *, const char *, boolean_t *);
2047c478bd9Sstevel@tonic-gate int nvlist_lookup_byte(nvlist_t *, const char *, uchar_t *);
2057c478bd9Sstevel@tonic-gate int nvlist_lookup_int8(nvlist_t *, const char *, int8_t *);
2067c478bd9Sstevel@tonic-gate int nvlist_lookup_uint8(nvlist_t *, const char *, uint8_t *);
2077c478bd9Sstevel@tonic-gate int nvlist_lookup_int16(nvlist_t *, const char *, int16_t *);
2087c478bd9Sstevel@tonic-gate int nvlist_lookup_uint16(nvlist_t *, const char *, uint16_t *);
2097c478bd9Sstevel@tonic-gate int nvlist_lookup_int32(nvlist_t *, const char *, int32_t *);
2107c478bd9Sstevel@tonic-gate int nvlist_lookup_uint32(nvlist_t *, const char *, uint32_t *);
2117c478bd9Sstevel@tonic-gate int nvlist_lookup_int64(nvlist_t *, const char *, int64_t *);
2127c478bd9Sstevel@tonic-gate int nvlist_lookup_uint64(nvlist_t *, const char *, uint64_t *);
2137c478bd9Sstevel@tonic-gate int nvlist_lookup_string(nvlist_t *, const char *, char **);
2147c478bd9Sstevel@tonic-gate int nvlist_lookup_nvlist(nvlist_t *, const char *, nvlist_t **);
2157c478bd9Sstevel@tonic-gate int nvlist_lookup_boolean_array(nvlist_t *, const char *,
2167c478bd9Sstevel@tonic-gate     boolean_t **, uint_t *);
2177c478bd9Sstevel@tonic-gate int nvlist_lookup_byte_array(nvlist_t *, const char *, uchar_t **, uint_t *);
2187c478bd9Sstevel@tonic-gate int nvlist_lookup_int8_array(nvlist_t *, const char *, int8_t **, uint_t *);
2197c478bd9Sstevel@tonic-gate int nvlist_lookup_uint8_array(nvlist_t *, const char *, uint8_t **, uint_t *);
2207c478bd9Sstevel@tonic-gate int nvlist_lookup_int16_array(nvlist_t *, const char *, int16_t **, uint_t *);
2217c478bd9Sstevel@tonic-gate int nvlist_lookup_uint16_array(nvlist_t *, const char *, uint16_t **, uint_t *);
2227c478bd9Sstevel@tonic-gate int nvlist_lookup_int32_array(nvlist_t *, const char *, int32_t **, uint_t *);
2237c478bd9Sstevel@tonic-gate int nvlist_lookup_uint32_array(nvlist_t *, const char *, uint32_t **, uint_t *);
2247c478bd9Sstevel@tonic-gate int nvlist_lookup_int64_array(nvlist_t *, const char *, int64_t **, uint_t *);
2257c478bd9Sstevel@tonic-gate int nvlist_lookup_uint64_array(nvlist_t *, const char *, uint64_t **, uint_t *);
2267c478bd9Sstevel@tonic-gate int nvlist_lookup_string_array(nvlist_t *, const char *, char ***, uint_t *);
2277c478bd9Sstevel@tonic-gate int nvlist_lookup_nvlist_array(nvlist_t *, const char *,
2287c478bd9Sstevel@tonic-gate     nvlist_t ***, uint_t *);
2297c478bd9Sstevel@tonic-gate int nvlist_lookup_hrtime(nvlist_t *, const char *, hrtime_t *);
230602ca9eaScth int nvlist_lookup_pairs(nvlist_t *, int, ...);
231825ba0f2Srobj #if !defined(_KERNEL)
232825ba0f2Srobj int nvlist_lookup_double(nvlist_t *, const char *, double *);
233825ba0f2Srobj #endif
2347c478bd9Sstevel@tonic-gate 
235602ca9eaScth int nvlist_lookup_nvpair(nvlist_t *, const char *, nvpair_t **);
236602ca9eaScth int nvlist_lookup_nvpair_embedded_index(nvlist_t *, const char *, nvpair_t **,
237602ca9eaScth     int *, char **);
238602ca9eaScth boolean_t nvlist_exists(nvlist_t *, const char *);
239*92241e0bSTom Erickson boolean_t nvlist_empty(nvlist_t *);
2401af98250Seschrock 
2417c478bd9Sstevel@tonic-gate /* processing nvpair */
242602ca9eaScth nvpair_t *nvlist_next_nvpair(nvlist_t *, nvpair_t *);
243*92241e0bSTom Erickson nvpair_t *nvlist_prev_nvpair(nvlist_t *, nvpair_t *);
2447c478bd9Sstevel@tonic-gate char *nvpair_name(nvpair_t *);
2457c478bd9Sstevel@tonic-gate data_type_t nvpair_type(nvpair_t *);
246602ca9eaScth int nvpair_type_is_array(nvpair_t *);
2477c478bd9Sstevel@tonic-gate int nvpair_value_boolean_value(nvpair_t *, boolean_t *);
2487c478bd9Sstevel@tonic-gate int nvpair_value_byte(nvpair_t *, uchar_t *);
2497c478bd9Sstevel@tonic-gate int nvpair_value_int8(nvpair_t *, int8_t *);
2507c478bd9Sstevel@tonic-gate int nvpair_value_uint8(nvpair_t *, uint8_t *);
2517c478bd9Sstevel@tonic-gate int nvpair_value_int16(nvpair_t *, int16_t *);
2527c478bd9Sstevel@tonic-gate int nvpair_value_uint16(nvpair_t *, uint16_t *);
2537c478bd9Sstevel@tonic-gate int nvpair_value_int32(nvpair_t *, int32_t *);
2547c478bd9Sstevel@tonic-gate int nvpair_value_uint32(nvpair_t *, uint32_t *);
2557c478bd9Sstevel@tonic-gate int nvpair_value_int64(nvpair_t *, int64_t *);
2567c478bd9Sstevel@tonic-gate int nvpair_value_uint64(nvpair_t *, uint64_t *);
2577c478bd9Sstevel@tonic-gate int nvpair_value_string(nvpair_t *, char **);
2587c478bd9Sstevel@tonic-gate int nvpair_value_nvlist(nvpair_t *, nvlist_t **);
2597c478bd9Sstevel@tonic-gate int nvpair_value_boolean_array(nvpair_t *, boolean_t **, uint_t *);
2607c478bd9Sstevel@tonic-gate int nvpair_value_byte_array(nvpair_t *, uchar_t **, uint_t *);
2617c478bd9Sstevel@tonic-gate int nvpair_value_int8_array(nvpair_t *, int8_t **, uint_t *);
2627c478bd9Sstevel@tonic-gate int nvpair_value_uint8_array(nvpair_t *, uint8_t **, uint_t *);
2637c478bd9Sstevel@tonic-gate int nvpair_value_int16_array(nvpair_t *, int16_t **, uint_t *);
2647c478bd9Sstevel@tonic-gate int nvpair_value_uint16_array(nvpair_t *, uint16_t **, uint_t *);
2657c478bd9Sstevel@tonic-gate int nvpair_value_int32_array(nvpair_t *, int32_t **, uint_t *);
2667c478bd9Sstevel@tonic-gate int nvpair_value_uint32_array(nvpair_t *, uint32_t **, uint_t *);
2677c478bd9Sstevel@tonic-gate int nvpair_value_int64_array(nvpair_t *, int64_t **, uint_t *);
2687c478bd9Sstevel@tonic-gate int nvpair_value_uint64_array(nvpair_t *, uint64_t **, uint_t *);
2697c478bd9Sstevel@tonic-gate int nvpair_value_string_array(nvpair_t *, char ***, uint_t *);
2707c478bd9Sstevel@tonic-gate int nvpair_value_nvlist_array(nvpair_t *, nvlist_t ***, uint_t *);
2717c478bd9Sstevel@tonic-gate int nvpair_value_hrtime(nvpair_t *, hrtime_t *);
272825ba0f2Srobj #if !defined(_KERNEL)
273825ba0f2Srobj int nvpair_value_double(nvpair_t *, double *);
274825ba0f2Srobj #endif
2757c478bd9Sstevel@tonic-gate 
2767c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
2777c478bd9Sstevel@tonic-gate }
2787c478bd9Sstevel@tonic-gate #endif
2797c478bd9Sstevel@tonic-gate 
2807c478bd9Sstevel@tonic-gate #endif	/* _SYS_NVPAIR_H */
281