xref: /freebsd/sys/contrib/openzfs/include/sys/nvpair.h (revision 53b70c86)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
23  * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
24  */
25 
26 #ifndef	_SYS_NVPAIR_H
27 #define	_SYS_NVPAIR_H extern __attribute__((visibility("default")))
28 
29 #include <sys/types.h>
30 #include <sys/time.h>
31 #include <sys/errno.h>
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 typedef enum {
38 	DATA_TYPE_DONTCARE = -1,
39 	DATA_TYPE_UNKNOWN = 0,
40 	DATA_TYPE_BOOLEAN,
41 	DATA_TYPE_BYTE,
42 	DATA_TYPE_INT16,
43 	DATA_TYPE_UINT16,
44 	DATA_TYPE_INT32,
45 	DATA_TYPE_UINT32,
46 	DATA_TYPE_INT64,
47 	DATA_TYPE_UINT64,
48 	DATA_TYPE_STRING,
49 	DATA_TYPE_BYTE_ARRAY,
50 	DATA_TYPE_INT16_ARRAY,
51 	DATA_TYPE_UINT16_ARRAY,
52 	DATA_TYPE_INT32_ARRAY,
53 	DATA_TYPE_UINT32_ARRAY,
54 	DATA_TYPE_INT64_ARRAY,
55 	DATA_TYPE_UINT64_ARRAY,
56 	DATA_TYPE_STRING_ARRAY,
57 	DATA_TYPE_HRTIME,
58 	DATA_TYPE_NVLIST,
59 	DATA_TYPE_NVLIST_ARRAY,
60 	DATA_TYPE_BOOLEAN_VALUE,
61 	DATA_TYPE_INT8,
62 	DATA_TYPE_UINT8,
63 	DATA_TYPE_BOOLEAN_ARRAY,
64 	DATA_TYPE_INT8_ARRAY,
65 #if !defined(_KERNEL) && !defined(_STANDALONE)
66 	DATA_TYPE_UINT8_ARRAY,
67 	DATA_TYPE_DOUBLE
68 #else
69 	DATA_TYPE_UINT8_ARRAY
70 #endif
71 } data_type_t;
72 
73 typedef struct nvpair {
74 	int32_t nvp_size;	/* size of this nvpair */
75 	int16_t	nvp_name_sz;	/* length of name string */
76 	int16_t	nvp_reserve;	/* not used */
77 	int32_t	nvp_value_elem;	/* number of elements for array types */
78 	data_type_t nvp_type;	/* type of value */
79 	/* name string */
80 	/* aligned ptr array for string arrays */
81 	/* aligned array of data for value */
82 } nvpair_t;
83 
84 /* nvlist header */
85 typedef struct nvlist {
86 	int32_t		nvl_version;
87 	uint32_t	nvl_nvflag;	/* persistent flags */
88 	uint64_t	nvl_priv;	/* ptr to private data if not packed */
89 	uint32_t	nvl_flag;
90 	int32_t		nvl_pad;	/* currently not used, for alignment */
91 } nvlist_t;
92 
93 /* nvp implementation version */
94 #define	NV_VERSION	0
95 
96 /* nvlist pack encoding */
97 #define	NV_ENCODE_NATIVE	0
98 #define	NV_ENCODE_XDR		1
99 
100 /* nvlist persistent unique name flags, stored in nvl_nvflags */
101 #define	NV_UNIQUE_NAME		0x1
102 #define	NV_UNIQUE_NAME_TYPE	0x2
103 
104 /* nvlist lookup pairs related flags */
105 #define	NV_FLAG_NOENTOK		0x1
106 
107 /* convenience macros */
108 #define	NV_ALIGN(x)		(((ulong_t)(x) + 7ul) & ~7ul)
109 #define	NV_ALIGN4(x)		(((x) + 3) & ~3)
110 
111 #define	NVP_SIZE(nvp)		((nvp)->nvp_size)
112 #define	NVP_NAME(nvp)		((char *)(nvp) + sizeof (nvpair_t))
113 #define	NVP_TYPE(nvp)		((nvp)->nvp_type)
114 #define	NVP_NELEM(nvp)		((nvp)->nvp_value_elem)
115 #define	NVP_VALUE(nvp)		((char *)(nvp) + NV_ALIGN(sizeof (nvpair_t) \
116 				+ (nvp)->nvp_name_sz))
117 
118 #define	NVL_VERSION(nvl)	((nvl)->nvl_version)
119 #define	NVL_SIZE(nvl)		((nvl)->nvl_size)
120 #define	NVL_FLAG(nvl)		((nvl)->nvl_flag)
121 
122 /* NV allocator framework */
123 typedef struct nv_alloc_ops nv_alloc_ops_t;
124 
125 typedef struct nv_alloc {
126 	const nv_alloc_ops_t *nva_ops;
127 	void *nva_arg;
128 } nv_alloc_t;
129 
130 struct nv_alloc_ops {
131 	int (*nv_ao_init)(nv_alloc_t *, va_list);
132 	void (*nv_ao_fini)(nv_alloc_t *);
133 	void *(*nv_ao_alloc)(nv_alloc_t *, size_t);
134 	void (*nv_ao_free)(nv_alloc_t *, void *, size_t);
135 	void (*nv_ao_reset)(nv_alloc_t *);
136 };
137 
138 _SYS_NVPAIR_H const nv_alloc_ops_t *nv_fixed_ops;
139 _SYS_NVPAIR_H nv_alloc_t *nv_alloc_nosleep;
140 
141 #if defined(_KERNEL)
142 _SYS_NVPAIR_H nv_alloc_t *nv_alloc_sleep;
143 _SYS_NVPAIR_H nv_alloc_t *nv_alloc_pushpage;
144 #endif
145 
146 _SYS_NVPAIR_H int nv_alloc_init(nv_alloc_t *, const nv_alloc_ops_t *,
147 	/* args */ ...);
148 _SYS_NVPAIR_H void nv_alloc_reset(nv_alloc_t *);
149 _SYS_NVPAIR_H void nv_alloc_fini(nv_alloc_t *);
150 
151 /* list management */
152 _SYS_NVPAIR_H int nvlist_alloc(nvlist_t **, uint_t, int);
153 _SYS_NVPAIR_H void nvlist_free(nvlist_t *);
154 _SYS_NVPAIR_H int nvlist_size(nvlist_t *, size_t *, int);
155 _SYS_NVPAIR_H int nvlist_pack(nvlist_t *, char **, size_t *, int, int);
156 _SYS_NVPAIR_H int nvlist_unpack(char *, size_t, nvlist_t **, int);
157 _SYS_NVPAIR_H int nvlist_dup(nvlist_t *, nvlist_t **, int);
158 _SYS_NVPAIR_H int nvlist_merge(nvlist_t *, nvlist_t *, int);
159 
160 _SYS_NVPAIR_H uint_t nvlist_nvflag(nvlist_t *);
161 
162 _SYS_NVPAIR_H int nvlist_xalloc(nvlist_t **, uint_t, nv_alloc_t *);
163 _SYS_NVPAIR_H int nvlist_xpack(nvlist_t *, char **, size_t *, int,
164     nv_alloc_t *);
165 _SYS_NVPAIR_H int nvlist_xunpack(char *, size_t, nvlist_t **, nv_alloc_t *);
166 _SYS_NVPAIR_H int nvlist_xdup(nvlist_t *, nvlist_t **, nv_alloc_t *);
167 _SYS_NVPAIR_H nv_alloc_t *nvlist_lookup_nv_alloc(nvlist_t *);
168 
169 _SYS_NVPAIR_H int nvlist_add_nvpair(nvlist_t *, nvpair_t *);
170 _SYS_NVPAIR_H int nvlist_add_boolean(nvlist_t *, const char *);
171 _SYS_NVPAIR_H int nvlist_add_boolean_value(nvlist_t *, const char *, boolean_t);
172 _SYS_NVPAIR_H int nvlist_add_byte(nvlist_t *, const char *, uchar_t);
173 _SYS_NVPAIR_H int nvlist_add_int8(nvlist_t *, const char *, int8_t);
174 _SYS_NVPAIR_H int nvlist_add_uint8(nvlist_t *, const char *, uint8_t);
175 _SYS_NVPAIR_H int nvlist_add_int16(nvlist_t *, const char *, int16_t);
176 _SYS_NVPAIR_H int nvlist_add_uint16(nvlist_t *, const char *, uint16_t);
177 _SYS_NVPAIR_H int nvlist_add_int32(nvlist_t *, const char *, int32_t);
178 _SYS_NVPAIR_H int nvlist_add_uint32(nvlist_t *, const char *, uint32_t);
179 _SYS_NVPAIR_H int nvlist_add_int64(nvlist_t *, const char *, int64_t);
180 _SYS_NVPAIR_H int nvlist_add_uint64(nvlist_t *, const char *, uint64_t);
181 _SYS_NVPAIR_H int nvlist_add_string(nvlist_t *, const char *, const char *);
182 _SYS_NVPAIR_H int nvlist_add_nvlist(nvlist_t *, const char *, nvlist_t *);
183 _SYS_NVPAIR_H int nvlist_add_boolean_array(nvlist_t *, const char *,
184     boolean_t *, uint_t);
185 _SYS_NVPAIR_H int nvlist_add_byte_array(nvlist_t *, const char *, uchar_t *,
186     uint_t);
187 _SYS_NVPAIR_H int nvlist_add_int8_array(nvlist_t *, const char *, int8_t *,
188     uint_t);
189 _SYS_NVPAIR_H int nvlist_add_uint8_array(nvlist_t *, const char *, uint8_t *,
190     uint_t);
191 _SYS_NVPAIR_H int nvlist_add_int16_array(nvlist_t *, const char *, int16_t *,
192     uint_t);
193 _SYS_NVPAIR_H int nvlist_add_uint16_array(nvlist_t *, const char *, uint16_t *,
194     uint_t);
195 _SYS_NVPAIR_H int nvlist_add_int32_array(nvlist_t *, const char *, int32_t *,
196     uint_t);
197 _SYS_NVPAIR_H int nvlist_add_uint32_array(nvlist_t *, const char *, uint32_t *,
198     uint_t);
199 _SYS_NVPAIR_H int nvlist_add_int64_array(nvlist_t *, const char *, int64_t *,
200     uint_t);
201 _SYS_NVPAIR_H int nvlist_add_uint64_array(nvlist_t *, const char *, uint64_t *,
202     uint_t);
203 _SYS_NVPAIR_H int nvlist_add_string_array(nvlist_t *, const char *,
204     char * const *, uint_t);
205 _SYS_NVPAIR_H int nvlist_add_nvlist_array(nvlist_t *, const char *,
206     nvlist_t **, uint_t);
207 _SYS_NVPAIR_H int nvlist_add_hrtime(nvlist_t *, const char *, hrtime_t);
208 #if !defined(_KERNEL) && !defined(_STANDALONE)
209 _SYS_NVPAIR_H int nvlist_add_double(nvlist_t *, const char *, double);
210 #endif
211 
212 _SYS_NVPAIR_H int nvlist_remove(nvlist_t *, const char *, data_type_t);
213 _SYS_NVPAIR_H int nvlist_remove_all(nvlist_t *, const char *);
214 _SYS_NVPAIR_H int nvlist_remove_nvpair(nvlist_t *, nvpair_t *);
215 
216 _SYS_NVPAIR_H int nvlist_lookup_boolean(nvlist_t *, const char *);
217 _SYS_NVPAIR_H int nvlist_lookup_boolean_value(nvlist_t *, const char *,
218     boolean_t *);
219 _SYS_NVPAIR_H int nvlist_lookup_byte(nvlist_t *, const char *, uchar_t *);
220 _SYS_NVPAIR_H int nvlist_lookup_int8(nvlist_t *, const char *, int8_t *);
221 _SYS_NVPAIR_H int nvlist_lookup_uint8(nvlist_t *, const char *, uint8_t *);
222 _SYS_NVPAIR_H int nvlist_lookup_int16(nvlist_t *, const char *, int16_t *);
223 _SYS_NVPAIR_H int nvlist_lookup_uint16(nvlist_t *, const char *, uint16_t *);
224 _SYS_NVPAIR_H int nvlist_lookup_int32(nvlist_t *, const char *, int32_t *);
225 _SYS_NVPAIR_H int nvlist_lookup_uint32(nvlist_t *, const char *, uint32_t *);
226 _SYS_NVPAIR_H int nvlist_lookup_int64(nvlist_t *, const char *, int64_t *);
227 _SYS_NVPAIR_H int nvlist_lookup_uint64(nvlist_t *, const char *, uint64_t *);
228 _SYS_NVPAIR_H int nvlist_lookup_string(nvlist_t *, const char *, char **);
229 _SYS_NVPAIR_H int nvlist_lookup_nvlist(nvlist_t *, const char *, nvlist_t **);
230 _SYS_NVPAIR_H int nvlist_lookup_boolean_array(nvlist_t *, const char *,
231     boolean_t **, uint_t *);
232 _SYS_NVPAIR_H int nvlist_lookup_byte_array(nvlist_t *, const char *, uchar_t **,
233     uint_t *);
234 _SYS_NVPAIR_H int nvlist_lookup_int8_array(nvlist_t *, const char *, int8_t **,
235     uint_t *);
236 _SYS_NVPAIR_H int nvlist_lookup_uint8_array(nvlist_t *, const char *,
237     uint8_t **, uint_t *);
238 _SYS_NVPAIR_H int nvlist_lookup_int16_array(nvlist_t *, const char *,
239     int16_t **, uint_t *);
240 _SYS_NVPAIR_H int nvlist_lookup_uint16_array(nvlist_t *, const char *,
241     uint16_t **, uint_t *);
242 _SYS_NVPAIR_H int nvlist_lookup_int32_array(nvlist_t *, const char *,
243     int32_t **, uint_t *);
244 _SYS_NVPAIR_H int nvlist_lookup_uint32_array(nvlist_t *, const char *,
245     uint32_t **, uint_t *);
246 _SYS_NVPAIR_H int nvlist_lookup_int64_array(nvlist_t *, const char *,
247     int64_t **, uint_t *);
248 _SYS_NVPAIR_H int nvlist_lookup_uint64_array(nvlist_t *, const char *,
249     uint64_t **, uint_t *);
250 _SYS_NVPAIR_H int nvlist_lookup_string_array(nvlist_t *, const char *,
251     char ***, uint_t *);
252 _SYS_NVPAIR_H int nvlist_lookup_nvlist_array(nvlist_t *, const char *,
253     nvlist_t ***, uint_t *);
254 _SYS_NVPAIR_H int nvlist_lookup_hrtime(nvlist_t *, const char *, hrtime_t *);
255 _SYS_NVPAIR_H int nvlist_lookup_pairs(nvlist_t *, int, ...);
256 #if !defined(_KERNEL) && !defined(_STANDALONE)
257 _SYS_NVPAIR_H int nvlist_lookup_double(nvlist_t *, const char *, double *);
258 #endif
259 
260 _SYS_NVPAIR_H int nvlist_lookup_nvpair(nvlist_t *, const char *, nvpair_t **);
261 _SYS_NVPAIR_H int nvlist_lookup_nvpair_embedded_index(nvlist_t *, const char *,
262     nvpair_t **, int *, char **);
263 _SYS_NVPAIR_H boolean_t nvlist_exists(nvlist_t *, const char *);
264 _SYS_NVPAIR_H boolean_t nvlist_empty(nvlist_t *);
265 
266 /* processing nvpair */
267 _SYS_NVPAIR_H nvpair_t *nvlist_next_nvpair(nvlist_t *, nvpair_t *);
268 _SYS_NVPAIR_H nvpair_t *nvlist_prev_nvpair(nvlist_t *, nvpair_t *);
269 _SYS_NVPAIR_H char *nvpair_name(nvpair_t *);
270 _SYS_NVPAIR_H data_type_t nvpair_type(nvpair_t *);
271 _SYS_NVPAIR_H int nvpair_type_is_array(nvpair_t *);
272 _SYS_NVPAIR_H int nvpair_value_boolean_value(nvpair_t *, boolean_t *);
273 _SYS_NVPAIR_H int nvpair_value_byte(nvpair_t *, uchar_t *);
274 _SYS_NVPAIR_H int nvpair_value_int8(nvpair_t *, int8_t *);
275 _SYS_NVPAIR_H int nvpair_value_uint8(nvpair_t *, uint8_t *);
276 _SYS_NVPAIR_H int nvpair_value_int16(nvpair_t *, int16_t *);
277 _SYS_NVPAIR_H int nvpair_value_uint16(nvpair_t *, uint16_t *);
278 _SYS_NVPAIR_H int nvpair_value_int32(nvpair_t *, int32_t *);
279 _SYS_NVPAIR_H int nvpair_value_uint32(nvpair_t *, uint32_t *);
280 _SYS_NVPAIR_H int nvpair_value_int64(nvpair_t *, int64_t *);
281 _SYS_NVPAIR_H int nvpair_value_uint64(nvpair_t *, uint64_t *);
282 _SYS_NVPAIR_H int nvpair_value_string(nvpair_t *, char **);
283 _SYS_NVPAIR_H int nvpair_value_nvlist(nvpair_t *, nvlist_t **);
284 _SYS_NVPAIR_H int nvpair_value_boolean_array(nvpair_t *, boolean_t **,
285     uint_t *);
286 _SYS_NVPAIR_H int nvpair_value_byte_array(nvpair_t *, uchar_t **, uint_t *);
287 _SYS_NVPAIR_H int nvpair_value_int8_array(nvpair_t *, int8_t **, uint_t *);
288 _SYS_NVPAIR_H int nvpair_value_uint8_array(nvpair_t *, uint8_t **, uint_t *);
289 _SYS_NVPAIR_H int nvpair_value_int16_array(nvpair_t *, int16_t **, uint_t *);
290 _SYS_NVPAIR_H int nvpair_value_uint16_array(nvpair_t *, uint16_t **, uint_t *);
291 _SYS_NVPAIR_H int nvpair_value_int32_array(nvpair_t *, int32_t **, uint_t *);
292 _SYS_NVPAIR_H int nvpair_value_uint32_array(nvpair_t *, uint32_t **, uint_t *);
293 _SYS_NVPAIR_H int nvpair_value_int64_array(nvpair_t *, int64_t **, uint_t *);
294 _SYS_NVPAIR_H int nvpair_value_uint64_array(nvpair_t *, uint64_t **, uint_t *);
295 _SYS_NVPAIR_H int nvpair_value_string_array(nvpair_t *, char ***, uint_t *);
296 _SYS_NVPAIR_H int nvpair_value_nvlist_array(nvpair_t *, nvlist_t ***, uint_t *);
297 _SYS_NVPAIR_H int nvpair_value_hrtime(nvpair_t *, hrtime_t *);
298 #if !defined(_KERNEL) && !defined(_STANDALONE)
299 _SYS_NVPAIR_H int nvpair_value_double(nvpair_t *, double *);
300 #endif
301 
302 _SYS_NVPAIR_H nvlist_t *fnvlist_alloc(void);
303 _SYS_NVPAIR_H void fnvlist_free(nvlist_t *);
304 _SYS_NVPAIR_H size_t fnvlist_size(nvlist_t *);
305 _SYS_NVPAIR_H char *fnvlist_pack(nvlist_t *, size_t *);
306 _SYS_NVPAIR_H void fnvlist_pack_free(char *, size_t);
307 _SYS_NVPAIR_H nvlist_t *fnvlist_unpack(char *, size_t);
308 _SYS_NVPAIR_H nvlist_t *fnvlist_dup(nvlist_t *);
309 _SYS_NVPAIR_H void fnvlist_merge(nvlist_t *, nvlist_t *);
310 _SYS_NVPAIR_H size_t fnvlist_num_pairs(nvlist_t *);
311 
312 _SYS_NVPAIR_H void fnvlist_add_boolean(nvlist_t *, const char *);
313 _SYS_NVPAIR_H void fnvlist_add_boolean_value(nvlist_t *, const char *,
314     boolean_t);
315 _SYS_NVPAIR_H void fnvlist_add_byte(nvlist_t *, const char *, uchar_t);
316 _SYS_NVPAIR_H void fnvlist_add_int8(nvlist_t *, const char *, int8_t);
317 _SYS_NVPAIR_H void fnvlist_add_uint8(nvlist_t *, const char *, uint8_t);
318 _SYS_NVPAIR_H void fnvlist_add_int16(nvlist_t *, const char *, int16_t);
319 _SYS_NVPAIR_H void fnvlist_add_uint16(nvlist_t *, const char *, uint16_t);
320 _SYS_NVPAIR_H void fnvlist_add_int32(nvlist_t *, const char *, int32_t);
321 _SYS_NVPAIR_H void fnvlist_add_uint32(nvlist_t *, const char *, uint32_t);
322 _SYS_NVPAIR_H void fnvlist_add_int64(nvlist_t *, const char *, int64_t);
323 _SYS_NVPAIR_H void fnvlist_add_uint64(nvlist_t *, const char *, uint64_t);
324 _SYS_NVPAIR_H void fnvlist_add_string(nvlist_t *, const char *, const char *);
325 _SYS_NVPAIR_H void fnvlist_add_nvlist(nvlist_t *, const char *, nvlist_t *);
326 _SYS_NVPAIR_H void fnvlist_add_nvpair(nvlist_t *, nvpair_t *);
327 _SYS_NVPAIR_H void fnvlist_add_boolean_array(nvlist_t *, const char *,
328     boolean_t *, uint_t);
329 _SYS_NVPAIR_H void fnvlist_add_byte_array(nvlist_t *, const char *, uchar_t *,
330     uint_t);
331 _SYS_NVPAIR_H void fnvlist_add_int8_array(nvlist_t *, const char *, int8_t *,
332     uint_t);
333 _SYS_NVPAIR_H void fnvlist_add_uint8_array(nvlist_t *, const char *, uint8_t *,
334     uint_t);
335 _SYS_NVPAIR_H void fnvlist_add_int16_array(nvlist_t *, const char *, int16_t *,
336     uint_t);
337 _SYS_NVPAIR_H void fnvlist_add_uint16_array(nvlist_t *, const char *,
338     uint16_t *, uint_t);
339 _SYS_NVPAIR_H void fnvlist_add_int32_array(nvlist_t *, const char *, int32_t *,
340     uint_t);
341 _SYS_NVPAIR_H void fnvlist_add_uint32_array(nvlist_t *, const char *,
342     uint32_t *, uint_t);
343 _SYS_NVPAIR_H void fnvlist_add_int64_array(nvlist_t *, const char *, int64_t *,
344     uint_t);
345 _SYS_NVPAIR_H void fnvlist_add_uint64_array(nvlist_t *, const char *,
346     uint64_t *, uint_t);
347 _SYS_NVPAIR_H void fnvlist_add_string_array(nvlist_t *, const char *,
348     char * const *, uint_t);
349 _SYS_NVPAIR_H void fnvlist_add_nvlist_array(nvlist_t *, const char *,
350     nvlist_t **, uint_t);
351 
352 _SYS_NVPAIR_H void fnvlist_remove(nvlist_t *, const char *);
353 _SYS_NVPAIR_H void fnvlist_remove_nvpair(nvlist_t *, nvpair_t *);
354 
355 _SYS_NVPAIR_H nvpair_t *fnvlist_lookup_nvpair(nvlist_t *, const char *);
356 _SYS_NVPAIR_H boolean_t fnvlist_lookup_boolean(nvlist_t *, const char *);
357 _SYS_NVPAIR_H boolean_t fnvlist_lookup_boolean_value(nvlist_t *, const char *);
358 _SYS_NVPAIR_H uchar_t fnvlist_lookup_byte(nvlist_t *, const char *);
359 _SYS_NVPAIR_H int8_t fnvlist_lookup_int8(nvlist_t *, const char *);
360 _SYS_NVPAIR_H int16_t fnvlist_lookup_int16(nvlist_t *, const char *);
361 _SYS_NVPAIR_H int32_t fnvlist_lookup_int32(nvlist_t *, const char *);
362 _SYS_NVPAIR_H int64_t fnvlist_lookup_int64(nvlist_t *, const char *);
363 _SYS_NVPAIR_H uint8_t fnvlist_lookup_uint8(nvlist_t *, const char *);
364 _SYS_NVPAIR_H uint16_t fnvlist_lookup_uint16(nvlist_t *, const char *);
365 _SYS_NVPAIR_H uint32_t fnvlist_lookup_uint32(nvlist_t *, const char *);
366 _SYS_NVPAIR_H uint64_t fnvlist_lookup_uint64(nvlist_t *, const char *);
367 _SYS_NVPAIR_H char *fnvlist_lookup_string(nvlist_t *, const char *);
368 _SYS_NVPAIR_H nvlist_t *fnvlist_lookup_nvlist(nvlist_t *, const char *);
369 _SYS_NVPAIR_H boolean_t *fnvlist_lookup_boolean_array(nvlist_t *, const char *,
370     uint_t *);
371 _SYS_NVPAIR_H uchar_t *fnvlist_lookup_byte_array(nvlist_t *, const char *,
372     uint_t *);
373 _SYS_NVPAIR_H int8_t *fnvlist_lookup_int8_array(nvlist_t *, const char *,
374     uint_t *);
375 _SYS_NVPAIR_H uint8_t *fnvlist_lookup_uint8_array(nvlist_t *, const char *,
376     uint_t *);
377 _SYS_NVPAIR_H int16_t *fnvlist_lookup_int16_array(nvlist_t *, const char *,
378     uint_t *);
379 _SYS_NVPAIR_H uint16_t *fnvlist_lookup_uint16_array(nvlist_t *, const char *,
380     uint_t *);
381 _SYS_NVPAIR_H int32_t *fnvlist_lookup_int32_array(nvlist_t *, const char *,
382     uint_t *);
383 _SYS_NVPAIR_H uint32_t *fnvlist_lookup_uint32_array(nvlist_t *, const char *,
384     uint_t *);
385 _SYS_NVPAIR_H int64_t *fnvlist_lookup_int64_array(nvlist_t *, const char *,
386     uint_t *);
387 _SYS_NVPAIR_H uint64_t *fnvlist_lookup_uint64_array(nvlist_t *, const char *,
388     uint_t *);
389 
390 _SYS_NVPAIR_H boolean_t fnvpair_value_boolean_value(nvpair_t *nvp);
391 _SYS_NVPAIR_H uchar_t fnvpair_value_byte(nvpair_t *nvp);
392 _SYS_NVPAIR_H int8_t fnvpair_value_int8(nvpair_t *nvp);
393 _SYS_NVPAIR_H int16_t fnvpair_value_int16(nvpair_t *nvp);
394 _SYS_NVPAIR_H int32_t fnvpair_value_int32(nvpair_t *nvp);
395 _SYS_NVPAIR_H int64_t fnvpair_value_int64(nvpair_t *nvp);
396 _SYS_NVPAIR_H uint8_t fnvpair_value_uint8(nvpair_t *nvp);
397 _SYS_NVPAIR_H uint16_t fnvpair_value_uint16(nvpair_t *nvp);
398 _SYS_NVPAIR_H uint32_t fnvpair_value_uint32(nvpair_t *nvp);
399 _SYS_NVPAIR_H uint64_t fnvpair_value_uint64(nvpair_t *nvp);
400 _SYS_NVPAIR_H char *fnvpair_value_string(nvpair_t *nvp);
401 _SYS_NVPAIR_H nvlist_t *fnvpair_value_nvlist(nvpair_t *nvp);
402 
403 #ifdef	__cplusplus
404 }
405 #endif
406 
407 #endif	/* _SYS_NVPAIR_H */
408