Home
last modified time | relevance | path

Searched refs:nvl (Results 1 – 25 of 162) sorted by relevance

1234567

/freebsd/sys/netpfil/pf/
H A Dpf_nv.c42 pf_nv ## fnname ## _opt(const nvlist_t *nvl, const char *name, \
46 if (! nvlist_exists_number(nvl, name)) { \
50 raw = nvlist_get_number(nvl, name); \
57 pf_nv ## fnname(const nvlist_t *nvl, const char *name, type *val) \
60 if (! nvlist_exists_number(nvl, name)) \
62 raw = nvlist_get_number(nvl, name); \
69 pf_nv ## fnname ## _array(const nvlist_t *nvl, const char *name, \
75 if (! nvlist_exists_number_array(nvl, name)) \
77 n = nvlist_get_number_array(nvl, name, &nitems); \
90 pf_ ## fnname ## _array_nv(nvlist_t *nvl, const char *name, \
[all …]
H A Dpfsync_nv.c44 pfsync_syncpeer_nvlist_to_sockaddr(const nvlist_t *nvl, in pfsync_syncpeer_nvlist_to_sockaddr() argument
49 if (!nvlist_exists_number(nvl, "af")) in pfsync_syncpeer_nvlist_to_sockaddr()
51 if (!nvlist_exists_binary(nvl, "address")) in pfsync_syncpeer_nvlist_to_sockaddr()
54 af = nvlist_get_number(nvl, "af"); in pfsync_syncpeer_nvlist_to_sockaddr()
61 const void *addr = nvlist_get_binary(nvl, "address", &len); in pfsync_syncpeer_nvlist_to_sockaddr()
75 const void *addr = nvlist_get_binary(nvl, "address", &len); in pfsync_syncpeer_nvlist_to_sockaddr()
99 nvlist_t *nvl; in pfsync_sockaddr_to_syncpeer_nvlist() local
101 nvl = nvlist_create(0); in pfsync_sockaddr_to_syncpeer_nvlist()
102 if (nvl == NULL) { in pfsync_sockaddr_to_syncpeer_nvlist()
103 return (nvl); in pfsync_sockaddr_to_syncpeer_nvlist()
[all …]
/freebsd/lib/libnv/tests/
H A Dnv_tests.cc44 nvlist_t *nvl; in ATF_TEST_CASE_BODY() local
48 nvl = nvlist_create(0); in ATF_TEST_CASE_BODY()
50 ATF_REQUIRE(nvl != NULL); in ATF_TEST_CASE_BODY()
52 ATF_REQUIRE_EQ(nvlist_error(nvl), 0); in ATF_TEST_CASE_BODY()
53 ATF_REQUIRE(nvlist_empty(nvl)); in ATF_TEST_CASE_BODY()
56 ATF_REQUIRE_EQ(nvlist_next(nvl, &type, &it), static_cast<const char *>(NULL)); in ATF_TEST_CASE_BODY()
58 nvlist_destroy(nvl); in ATF_TEST_CASE_BODY()
64 nvlist_t *nvl; in ATF_TEST_CASE_BODY() local
70 nvl = nvlist_create(0); in ATF_TEST_CASE_BODY()
72 ATF_REQUIRE(nvl != NULL); in ATF_TEST_CASE_BODY()
[all …]
H A Dcnv_tests.cc43 nvlist_t *nvl; in ATF_TEST_CASE_BODY() local
49 nvl = nvlist_create(0); in ATF_TEST_CASE_BODY()
50 ATF_REQUIRE(nvl != NULL); in ATF_TEST_CASE_BODY()
51 ATF_REQUIRE_EQ(nvlist_error(nvl), 0); in ATF_TEST_CASE_BODY()
52 ATF_REQUIRE(nvlist_empty(nvl)); in ATF_TEST_CASE_BODY()
58 nvlist_add_bool(nvl, key, value); in ATF_TEST_CASE_BODY()
59 ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); in ATF_TEST_CASE_BODY()
60 ATF_REQUIRE_EQ(nvlist_error(nvl), 0); in ATF_TEST_CASE_BODY()
62 ATF_REQUIRE(!nvlist_empty(nvl)); in ATF_TEST_CASE_BODY()
63 ATF_REQUIRE(nvlist_exists(nvl, key)); in ATF_TEST_CASE_BODY()
[all …]
H A Ddnv_tests.cc36 nvlist_t *nvl; in ATF_TEST_CASE_BODY() local
40 nvl = nvlist_create(0); in ATF_TEST_CASE_BODY()
44 nvlist_add_bool(nvl, key, value); in ATF_TEST_CASE_BODY()
46 ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, key, false), value); in ATF_TEST_CASE_BODY()
47 ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "name", false), value); in ATF_TEST_CASE_BODY()
49 nvlist_destroy(nvl); in ATF_TEST_CASE_BODY()
55 nvlist_t *nvl; in ATF_TEST_CASE_BODY() local
59 nvl = nvlist_create(0); in ATF_TEST_CASE_BODY()
61 ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, key, false), false); in ATF_TEST_CASE_BODY()
62 ATF_REQUIRE_EQ(dnvlist_get_bool(nvl, "123", true), true); in ATF_TEST_CASE_BODY()
[all …]
H A Dnv_array_tests.cc50 nvlist_t *nvl; in ATF_TEST_CASE_BODY() local
56 nvl = nvlist_create(0); in ATF_TEST_CASE_BODY()
57 ATF_REQUIRE(nvl != NULL); in ATF_TEST_CASE_BODY()
58 ATF_REQUIRE(nvlist_empty(nvl)); in ATF_TEST_CASE_BODY()
59 ATF_REQUIRE(!nvlist_exists_string_array(nvl, key)); in ATF_TEST_CASE_BODY()
64 nvlist_add_bool_array(nvl, key, testbool, 16); in ATF_TEST_CASE_BODY()
65 ATF_REQUIRE_EQ(nvlist_error(nvl), 0); in ATF_TEST_CASE_BODY()
66 ATF_REQUIRE(!nvlist_empty(nvl)); in ATF_TEST_CASE_BODY()
67 ATF_REQUIRE(nvlist_exists_bool_array(nvl, key)); in ATF_TEST_CASE_BODY()
68 ATF_REQUIRE(nvlist_exists_bool_array(nvl, "nvl/bool")); in ATF_TEST_CASE_BODY()
[all …]
H A Dnvlist_send_recv_test.c55 nvlist_t *nvl; in send_nvlist_child() local
59 nvl = nvlist_create(0); in send_nvlist_child()
62 nvlist_add_bool(nvl, "nvlist/bool/true", true); in send_nvlist_child()
63 nvlist_add_bool(nvl, "nvlist/bool/false", false); in send_nvlist_child()
64 nvlist_add_number(nvl, "nvlist/number/0", 0); in send_nvlist_child()
65 nvlist_add_number(nvl, "nvlist/number/1", 1); in send_nvlist_child()
66 nvlist_add_number(nvl, "nvlist/number/-1", -1); in send_nvlist_child()
67 nvlist_add_number(nvl, "nvlist/number/UINT64_MAX", UINT64_MAX); in send_nvlist_child()
68 nvlist_add_number(nvl, "nvlist/number/INT64_MIN", INT64_MIN); in send_nvlist_child()
69 nvlist_add_number(nvl, "nvlist/number/INT64_MAX", INT64_MAX); in send_nvlist_child()
[all …]
H A Dnvlist_append_test.c51 nvlist_t *nvl, *nvl1, *nvl2, **items; in main() local
57 nvl = nvlist_create(0); in main()
60 nvlist_append_bool_array(nvl, "nvl/bool", i % 2 == 0); in main()
62 CHECK(nvlist_error(nvl) == 0); in main()
63 CHECK(!nvlist_empty(nvl)); in main()
64 CHECK(nvlist_exists_bool_array(nvl, "nvl/bool")); in main()
66 bool_result = nvlist_get_bool_array(nvl, "nvl/bool", &nitems); in main()
73 nvlist_append_string_array(nvl, "nvl/string", "a"); in main()
74 nvlist_append_string_array(nvl, "nvl/string", "abc"); in main()
75 string_result = nvlist_get_string_array(nvl, "nvl/string", &nitems); in main()
[all …]
/freebsd/sys/sys/
H A Dnv.h80 void nvlist_destroy(nvlist_t *nvl);
81 int nvlist_error(const nvlist_t *nvl);
82 bool nvlist_empty(const nvlist_t *nvl);
83 int nvlist_flags(const nvlist_t *nvl);
84 void nvlist_set_error(nvlist_t *nvl, int error);
86 nvlist_t *nvlist_clone(const nvlist_t *nvl);
89 void nvlist_dump(const nvlist_t *nvl, int fd);
90 void nvlist_fdump(const nvlist_t *nvl, FILE *fp);
93 size_t nvlist_size(const nvlist_t *nvl);
94 void *nvlist_pack(const nvlist_t *nvl, size_t *sizep);
[all …]
/freebsd/sys/contrib/libnv/
H A Dnvlist.c108 #define NVLIST_ASSERT(nvl) do { \ argument
109 PJDLOG_ASSERT((nvl) != NULL); \
110 PJDLOG_ASSERT((nvl)->nvl_magic == NVLIST_MAGIC); \
125 nvlist_t *nvl; in nvlist_create() local
129 nvl = nv_malloc(sizeof(*nvl)); in nvlist_create()
130 if (nvl == NULL) in nvlist_create()
132 nvl->nvl_error = 0; in nvlist_create()
133 nvl->nvl_flags = flags; in nvlist_create()
134 nvl->nvl_parent = NULL; in nvlist_create()
135 nvl->nvl_array_next = NULL; in nvlist_create()
[all …]
/freebsd/sbin/ifconfig/
H A Difpfsync.c52 pfsync_do_ioctl(if_ctx *ctx, uint cmd, nvlist_t **nvl) in pfsync_do_ioctl() argument
58 data = nvlist_pack(*nvl, &nvlen); in pfsync_do_ioctl()
71 nvlist_destroy(*nvl); in pfsync_do_ioctl()
72 *nvl = NULL; in pfsync_do_ioctl()
74 *nvl = nvlist_unpack(ifr.ifr_cap_nv.buffer, ifr.ifr_cap_nv.length, 0); in pfsync_do_ioctl()
75 if (*nvl == NULL) { in pfsync_do_ioctl()
87 nvlist_t *nvl; in pfsync_sockaddr_to_syncpeer_nvlist() local
89 nvl = nvlist_create(0); in pfsync_sockaddr_to_syncpeer_nvlist()
90 if (nvl == NULL) { in pfsync_sockaddr_to_syncpeer_nvlist()
91 return (nvl); in pfsync_sockaddr_to_syncpeer_nvlist()
[all …]
/freebsd/sys/contrib/openzfs/module/nvpair/
H A Dfnvpair.c53 nvlist_t *nvl; in fnvlist_alloc() local
54 VERIFY0(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP)); in fnvlist_alloc()
55 return (nvl); in fnvlist_alloc()
59 fnvlist_free(nvlist_t *nvl) in fnvlist_free() argument
61 nvlist_free(nvl); in fnvlist_free()
65 fnvlist_size(nvlist_t *nvl) in fnvlist_size() argument
68 VERIFY0(nvlist_size(nvl, &size, NV_ENCODE_NATIVE)); in fnvlist_size()
77 fnvlist_pack(nvlist_t *nvl, size_t *sizep) in fnvlist_pack() argument
80 VERIFY3U(nvlist_pack(nvl, &packed, sizep, NV_ENCODE_NATIVE, in fnvlist_pack()
105 fnvlist_dup(const nvlist_t *nvl) in fnvlist_dup() argument
[all …]
H A Dnvpair.c138 static int nvlist_add_common(nvlist_t *nvl, const char *name, data_type_t type,
189 nvlist_lookup_nv_alloc(nvlist_t *nvl) in nvlist_lookup_nv_alloc() argument
193 if (nvl == NULL || in nvlist_lookup_nv_alloc()
194 (priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv) == NULL) in nvlist_lookup_nv_alloc()
328 nvt_lookup_name_type(const nvlist_t *nvl, const char *name, data_type_t type) in nvt_lookup_name_type() argument
330 const nvpriv_t *priv = (const nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvt_lookup_name_type()
360 nvt_lookup_name(const nvlist_t *nvl, const char *name) in nvt_lookup_name() argument
362 return (nvt_lookup_name_type(nvl, name, DATA_TYPE_DONTCARE)); in nvt_lookup_name()
466 nvt_remove_nvpair(nvlist_t *nvl, const nvpair_t *nvp) in nvt_remove_nvpair() argument
468 nvpriv_t *priv = (nvpriv_t *)(uintptr_t)nvl->nvl_priv; in nvt_remove_nvpair()
[all …]
/freebsd/lib/libcasper/services/cap_syslog/
H A Dcap_syslog.c61 nvlist_t *nvl; in cap_vsyslog() local
66 nvl = nvlist_create(0); in cap_vsyslog()
67 nvlist_add_string(nvl, "cmd", "vsyslog"); in cap_vsyslog()
68 nvlist_add_number(nvl, "priority", priority); in cap_vsyslog()
69 nvlist_add_string(nvl, "message", message); in cap_vsyslog()
70 nvl = cap_xfer_nvlist(chan, nvl); in cap_vsyslog()
71 if (nvl == NULL) { in cap_vsyslog()
74 nvlist_destroy(nvl); in cap_vsyslog()
80 nvlist_t *nvl; in cap_openlog() local
82 nvl = nvlist_create(0); in cap_openlog()
[all …]
/freebsd/sys/contrib/openzfs/tests/zfs-tests/cmd/
H A Dnvlist_to_lua.c26 static nvlist_t *nvl; variable
92 dump_nvlist(nvl, 4); in test()
95 10 * 1000 * 1000, 10 * 1024 * 1024, nvl, &outnvl); in test()
109 if (!nvlist_equal(nvl, real_outnvl)) { in test()
120 fnvlist_free(nvl); in test()
121 nvl = fnvlist_alloc(); in test()
141 nvl = fnvlist_alloc(); in run_tests()
143 fnvlist_add_boolean(nvl, key); in run_tests()
146 fnvlist_add_boolean_value(nvl, key, B_TRUE); in run_tests()
149 fnvlist_add_byte(nvl, key, 1); in run_tests()
[all …]
/freebsd/stand/libsa/zfs/
H A Dnvlist.c347 nvlist_destroy(nvlist_t *nvl) in nvlist_destroy() argument
349 if (nvl != NULL) { in nvlist_destroy()
351 if (nvl->nv_asize > 0) in nvlist_destroy()
352 free(nvl->nv_data); in nvlist_destroy()
354 free(nvl); in nvlist_destroy()
377 nvlist_t *nvl; in nvlist_create() local
380 nvl = calloc(1, sizeof(*nvl)); in nvlist_create()
381 if (nvl == NULL) in nvlist_create()
382 return (nvl); in nvlist_create()
384 nvl->nv_header.nvh_encoding = NV_ENCODE_XDR; in nvlist_create()
[all …]
/freebsd/usr.sbin/syslogd/
H A Dsyslogd_cap_log.c43 nvlist_t *nvl = nvlist_create(0); in cap_p_open() local
46 nvlist_add_string(nvl, "cmd", "p_open"); in cap_p_open()
47 nvlist_add_number(nvl, "filed_idx", filed_idx); in cap_p_open()
48 nvlist_add_string(nvl, "prog", prog); in cap_p_open()
49 nvl = cap_xfer_nvlist(chan, nvl); in cap_p_open()
50 if (nvl == NULL) { in cap_p_open()
54 error = nvlist_get_number(nvl, "error"); in cap_p_open()
59 pipedesc_w = dnvlist_take_descriptor(nvl, "pipedesc_w", -1); in cap_p_open()
60 *procdesc = dnvlist_take_descriptor(nvl, "procdesc", -1); in cap_p_open()
62 nvlist_destroy(nvl); in cap_p_open()
[all …]
/freebsd/lib/libcasper/services/cap_net/
H A Dcap_net.c93 hostent_unpack(const nvlist_t *nvl, struct hostent *hp) in hostent_unpack() argument
101 hp->h_name = strdup(nvlist_get_string(nvl, "name")); in hostent_unpack()
104 hp->h_addrtype = (int)nvlist_get_number(nvl, "addrtype"); in hostent_unpack()
105 hp->h_length = (int)nvlist_get_number(nvl, "length"); in hostent_unpack()
107 nitems = (unsigned int)nvlist_get_number(nvl, "naliases"); in hostent_unpack()
115 strdup(nvlist_get_string(nvl, nvlname)); in hostent_unpack()
121 nitems = (unsigned int)nvlist_get_number(nvl, "naddrs"); in hostent_unpack()
131 bcopy(nvlist_get_binary(nvl, nvlname, NULL), in hostent_unpack()
147 nvlist_t *nvl; in request_cb() local
150 nvl = nvlist_create(0); in request_cb()
[all …]
/freebsd/lib/libcasper/services/cap_netdb/
H A Dcap_netdb.c46 protoent_unpack(nvlist_t *nvl) in protoent_unpack() argument
54 nvlist_destroy(nvl); in protoent_unpack()
58 pp->p_name = nvlist_take_string(nvl, "name"); in protoent_unpack()
60 aliases = nvlist_take_string_array(nvl, "aliases", &n); in protoent_unpack()
68 nvlist_destroy(nvl); in protoent_unpack()
73 pp->p_proto = (int)nvlist_take_number(nvl, "proto"); in protoent_unpack()
75 nvlist_destroy(nvl); in protoent_unpack()
82 nvlist_t *nvl; in cap_getprotobyname() local
84 nvl = nvlist_create(0); in cap_getprotobyname()
85 nvlist_add_string(nvl, "cmd", "getprotobyname"); in cap_getprotobyname()
[all …]
/freebsd/sys/contrib/openzfs/module/zfs/
H A Dspa_history.c198 spa_history_log_notify(spa_t *spa, nvlist_t *nvl) in spa_history_log_notify() argument
204 if (nvlist_lookup_string(nvl, ZPOOL_HIST_CMD, &string) == 0) in spa_history_log_notify()
207 if (nvlist_lookup_string(nvl, ZPOOL_HIST_INT_NAME, &string) == 0) in spa_history_log_notify()
210 if (nvlist_lookup_string(nvl, ZPOOL_HIST_ZONE, &string) == 0) in spa_history_log_notify()
213 if (nvlist_lookup_string(nvl, ZPOOL_HIST_HOST, &string) == 0) in spa_history_log_notify()
216 if (nvlist_lookup_string(nvl, ZPOOL_HIST_DSNAME, &string) == 0) in spa_history_log_notify()
219 if (nvlist_lookup_string(nvl, ZPOOL_HIST_INT_STR, &string) == 0) in spa_history_log_notify()
222 if (nvlist_lookup_string(nvl, ZPOOL_HIST_IOCTL, &string) == 0) in spa_history_log_notify()
225 if (nvlist_lookup_string(nvl, ZPOOL_HIST_INT_NAME, &string) == 0) in spa_history_log_notify()
228 if (nvlist_lookup_uint64(nvl, ZPOOL_HIST_DSID, &uint64) == 0) in spa_history_log_notify()
[all …]
/freebsd/cddl/contrib/opensolaris/lib/pyzfs/common/
H A Dioctl.c75 nvl2py(nvlist_t *nvl) in nvl2py() argument
82 for (nvp = nvlist_next_nvpair(nvl, NULL); nvp; in nvl2py()
83 nvp = nvlist_next_nvpair(nvl, nvp)) { in nvl2py()
132 nvlist_t *nvl; in dict2nvl() local
142 err = nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0); in dict2nvl()
149 nvlist_free(nvl); in dict2nvl()
155 err = nvlist_add_nvlist(nvl, keystr, valnvl); in dict2nvl()
158 err = nvlist_add_boolean(nvl, keystr); in dict2nvl()
161 err = nvlist_add_string(nvl, keystr, valstr); in dict2nvl()
164 err = nvlist_add_uint64(nvl, keystr, valint); in dict2nvl()
[all …]
/freebsd/lib/libcasper/libcasper/
H A Dlibcasper.c173 nvlist_t *nvl; in cap_clone() local
179 nvl = nvlist_create(channel_nvlist_flags(chan)); in cap_clone()
180 nvlist_add_string(nvl, "cmd", "clone"); in cap_clone()
181 nvl = cap_xfer_nvlist(chan, nvl); in cap_clone()
182 if (nvl == NULL) in cap_clone()
184 if (nvlist_get_number(nvl, "error") != 0) { in cap_clone()
185 errno = (int)nvlist_get_number(nvl, "error"); in cap_clone()
186 nvlist_destroy(nvl); in cap_clone()
189 newsock = nvlist_take_descriptor(nvl, "sock"); in cap_clone()
190 nvlist_destroy(nvl); in cap_clone()
[all …]
/freebsd/sys/contrib/openzfs/cmd/zed/
H A Dzed_disk_event.c61 zed_udev_event(const char *class, const char *subclass, nvlist_t *nvl) in zed_udev_event() argument
69 if (nvlist_lookup_string(nvl, DEV_NAME, &strval) == 0) in zed_udev_event()
71 if (nvlist_lookup_string(nvl, DEV_PATH, &strval) == 0) in zed_udev_event()
73 if (nvlist_lookup_string(nvl, DEV_IDENTIFIER, &strval) == 0) in zed_udev_event()
75 if (nvlist_lookup_boolean(nvl, DEV_IS_PART) == B_TRUE) in zed_udev_event()
77 if (nvlist_lookup_string(nvl, DEV_PHYS_PATH, &strval) == 0) in zed_udev_event()
79 if (nvlist_lookup_uint64(nvl, DEV_SIZE, &numval) == 0) in zed_udev_event()
81 if (nvlist_lookup_uint64(nvl, DEV_PARENT_SIZE, &numval) == 0) in zed_udev_event()
83 if (nvlist_lookup_uint64(nvl, ZFS_EV_POOL_GUID, &numval) == 0) in zed_udev_event()
85 if (nvlist_lookup_uint64(nvl, ZFS_EV_VDEV_GUID, &numval) == 0) in zed_udev_event()
[all …]
/freebsd/lib/libpfctl/
H A Dlibpfctl.c141 pfctl_do_ioctl(int dev, uint cmd, size_t size, nvlist_t **nvl) in pfctl_do_ioctl() argument
148 data = nvlist_pack(*nvl, &nvlen); in pfctl_do_ioctl()
171 nvlist_destroy(*nvl); in pfctl_do_ioctl()
172 *nvl = NULL; in pfctl_do_ioctl()
175 *nvl = nvlist_unpack(nv.data, nv.len, 0); in pfctl_do_ioctl()
176 if (*nvl == NULL) { in pfctl_do_ioctl()
192 pf_nvuint_8_array(const nvlist_t *nvl, const char *name, size_t maxelems, in pf_nvuint_8_array() argument
198 tmp = nvlist_get_number_array(nvl, name, &elems); in pf_nvuint_8_array()
209 pf_nvuint_16_array(const nvlist_t *nvl, const char *name, size_t maxelems, in pf_nvuint_16_array() argument
215 tmp = nvlist_get_number_array(nvl, name, &elems); in pf_nvuint_16_array()
[all …]
/freebsd/usr.sbin/rtsold/
H A Dcap_script.c87 nvlist_t *nvl; in cap_script_run() local
94 nvl = nvlist_create(0); in cap_script_run()
95 nvlist_add_string(nvl, "cmd", "script_run"); in cap_script_run()
96 nvlist_add_string_array(nvl, "argv", argv, argc); in cap_script_run()
97 nvl = cap_xfer_nvlist(cap, nvl); in cap_script_run()
98 if (nvl == NULL) in cap_script_run()
101 error = (int)dnvlist_get_number(nvl, "error", 0); in cap_script_run()
103 wfd = nvlist_take_descriptor(nvl, "fd"); in cap_script_run()
104 nvlist_destroy(nvl); in cap_script_run()
131 nvlist_t *nvl; in cap_script_wait() local
[all …]

1234567