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