19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25
26 #include <sys/stropts.h>
27 #include <sys/debug.h>
28 #include <sys/isa_defs.h>
29 #include <sys/int_limits.h>
30 #include <sys/nvpair.h>
31 #include <sys/nvpair_impl.h>
32 #include <rpc/types.h>
33 #include <rpc/xdr.h>
34
35 #if defined(_KERNEL) && !defined(_BOOT)
36 #include <sys/varargs.h>
37 #include <sys/ddi.h>
38 #include <sys/sunddi.h>
39 #else
40 #include <stdarg.h>
41 #include <stdlib.h>
42 #include <string.h>
43 #include <strings.h>
44 #endif
45
46 #ifndef offsetof
47 #define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
48 #endif
49 #define skip_whitespace(p) while ((*(p) == ' ') || (*(p) == '\t')) p++
50
51 /*
52 * nvpair.c - Provides kernel & userland interfaces for manipulating
53 * name-value pairs.
54 *
55 * Overview Diagram
56 *
57 * +--------------+
58 * | nvlist_t |
59 * |--------------|
60 * | nvl_version |
61 * | nvl_nvflag |
62 * | nvl_priv -+-+
63 * | nvl_flag | |
64 * | nvl_pad | |
65 * +--------------+ |
66 * V
67 * +--------------+ last i_nvp in list
68 * | nvpriv_t | +--------------------->
|
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25
26 #include <sys/stropts.h>
27 #include <sys/debug.h>
28 #include <sys/isa_defs.h>
29 #include <sys/int_limits.h>
30 #include <sys/nvpair.h>
31 #include <sys/nvpair_impl.h>
32 #include <rpc/types.h>
33 #include <rpc/xdr.h>
34
35 #if defined(_KERNEL) && !defined(_BOOT)
36 #include <sys/varargs.h>
37 #include <sys/ddi.h>
38 #include <sys/sunddi.h>
39 #include <sys/sysmacros.h>
40 #else
41 #include <stdarg.h>
42 #include <stdlib.h>
43 #include <string.h>
44 #include <strings.h>
45 #include <stddef.h>
46 #endif
47
48 #define skip_whitespace(p) while ((*(p) == ' ') || (*(p) == '\t')) p++
49
50 /*
51 * nvpair.c - Provides kernel & userland interfaces for manipulating
52 * name-value pairs.
53 *
54 * Overview Diagram
55 *
56 * +--------------+
57 * | nvlist_t |
58 * |--------------|
59 * | nvl_version |
60 * | nvl_nvflag |
61 * | nvl_priv -+-+
62 * | nvl_flag | |
63 * | nvl_pad | |
64 * +--------------+ |
65 * V
66 * +--------------+ last i_nvp in list
67 * | nvpriv_t | +--------------------->
|