Lines Matching defs:db_nvl

30  * typedef boolean_t db_wfunc_t(void *cbarg, nvlist_t *db_nvl, char *buf,
36 * `db_nvl' - representing a line from DB in nvlist_t form
41 * All the 'write' callback functions modify `db_nvl' based on `cbarg' and
42 * copy string representation of `db_nvl' (using ipadm_nvlist2str()) into `buf'.
47 * reading `db_nvl' and then populate the `cbarg'.
82 * Checks if the database nvl, `db_nvl' contains and matches ALL of the passed
86 ipmgmt_nvlist_match(nvlist_t *db_nvl, const char *proto, const char *ifname,
94 /* walk through db_nvl and retrieve all its private nvpairs */
95 for (nvp = nvlist_next_nvpair(db_nvl, NULL); nvp != NULL;
96 nvp = nvlist_next_nvpair(db_nvl, nvp)) {
139 * Checks if the database nvl, `db_nvl' and the input nvl, `in_nvl' intersects.
142 ipmgmt_nvlist_intersects(nvlist_t *db_nvl, nvlist_t *in_nvl)
160 return (ipmgmt_nvlist_match(db_nvl, proto, ifname, aobjname));
164 * Checks if the database nvl, `db_nvl', contains and matches ANY of the passed
168 ipmgmt_nvlist_contains(nvlist_t *db_nvl, const char *proto,
176 /* walk through db_nvl and retrieve all private nvpairs */
177 for (nvp = nvlist_next_nvpair(db_nvl, NULL); nvp != NULL;
178 nvp = nvlist_next_nvpair(db_nvl, nvp)) {
210 ipmgmt_db_getprop(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
220 if (!ipmgmt_nvlist_match(db_nvl, pargp->ia_module,
224 if ((err = nvlist_lookup_string(db_nvl, pargp->ia_pname,
247 ipmgmt_db_resetprop(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
253 if (!ipmgmt_nvlist_match(db_nvl, pargp->ia_module,
257 if (!nvlist_exists(db_nvl, pargp->ia_pname))
271 *errp = nvlist_lookup_string(db_nvl, pargp->ia_pname, &dbpval);
300 *errp = nvlist_add_string(db_nvl, pargp->ia_pname, pval);
305 if (ipadm_nvlist2str(db_nvl, buf, buflen) == 0) {
326 ipmgmt_db_getaddr(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
338 for (nvp = nvlist_next_nvpair(db_nvl, NULL); nvp != NULL;
339 nvp = nvlist_next_nvpair(db_nvl, nvp)) {
365 *errp = nvlist_add_nvlist(cbarg->cb_onvl, name, db_nvl);
486 ipmgmt_db_add(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen, int *errp)
497 ipmgmt_db_update(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
508 if (!ipmgmt_nvlist_intersects(db_nvl, in_nvl))
514 if (!IPADM_PRIV_NVP(name) && nvlist_exists(db_nvl, name))
531 if ((*errp = nvlist_lookup_string(db_nvl, name,
536 if ((*errp = nvlist_add_string(db_nvl, name, pval)) != 0)
540 if ((*errp = nvlist_add_string(db_nvl, name, instrval)) != 0)
545 if (ipadm_nvlist2str(db_nvl, buf, buflen) == 0) {
560 ipmgmt_db_getif(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
571 if (nvlist_lookup_string(db_nvl, IPADM_NVP_FAMILY, &afstr) != 0 ||
572 nvlist_lookup_string(db_nvl, IPADM_NVP_IFNAME, &intf) != 0 ||
615 ipmgmt_db_resetif(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
630 if (!ipmgmt_nvlist_contains(db_nvl, NULL, ifname, NULL))
633 if (nvlist_lookup_string(db_nvl, IPADM_NVP_FAMILY, &afstr) == 0) {
640 if (isv6 && (nvlist_exists(db_nvl, IPADM_NVP_IPV6ADDR) ||
641 nvlist_exists(db_nvl, IPADM_NVP_INTFID))) {
645 (nvlist_exists(db_nvl, IPADM_NVP_IPV4ADDR) ||
646 nvlist_exists(db_nvl, IPADM_NVP_DHCP))) {
650 if (nvlist_lookup_string(db_nvl, IPADM_NVP_AOBJNAME, &aobjname) == 0) {
679 if (nvlist_lookup_string(db_nvl, IPADM_NVP_PROTONAME, &modstr) == 0) {
710 ipmgmt_db_resetaddr(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
717 if (!ipmgmt_nvlist_contains(db_nvl, NULL, NULL, aobjname))
732 ipmgmt_db_initif(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
742 if (nvlist_lookup_string(db_nvl, IPADM_NVP_IFNAME, &db_ifname) == 0 &&
750 if (nvlist_lookup_string(db_nvl, IPADM_NVP_PROTONAME,
760 if (nvlist_exists(db_nvl, IPADM_NVP_IPV4ADDR) ||
761 nvlist_exists(db_nvl, IPADM_NVP_DHCP))
770 *errp = nvlist_add_nvlist(onvl, name, db_nvl);
1109 ipmgmt_aobjmap_init(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
1119 for (nvp = nvlist_next_nvpair(db_nvl, NULL); nvp != NULL;
1120 nvp = nvlist_next_nvpair(db_nvl, nvp)) {
1168 ipmgmt_update_aobjmap(void *arg, nvlist_t *db_nvl, char *buf,
1177 if (!ipmgmt_nvlist_intersects(db_nvl, in_nvl))
1181 if (nvlist_lookup_string(db_nvl, IPADM_NVP_LIFNUM,
1207 ipmgmt_delete_aobjmap(void *arg, nvlist_t *db_nvl, char *buf,
1214 if (!ipmgmt_nvlist_match(db_nvl, NULL, nodep->am_ifname,
1219 if (nvlist_lookup_string(db_nvl, IPADM_NVP_LIFNUM,
1269 ipmgmt_db_upgrade(void *arg, nvlist_t *db_nvl, char *buf, size_t buflen,
1282 if (nvlist_exists(db_nvl, IPADM_NVP_IFNAME) ||
1283 nvlist_exists(db_nvl, IPADM_NVP_AOBJNAME)) {
1286 assert(nvlist_exists(db_nvl, IPADM_NVP_PROTONAME));
1289 * extract the propname from the `db_nvl' and also extract the
1290 * protocol from the `db_nvl'.
1292 for (nvp = nvlist_next_nvpair(db_nvl, NULL); nvp != NULL;
1293 nvp = nvlist_next_nvpair(db_nvl, nvp)) {
1321 if (nvlist_add_string(db_nvl, IPADM_NVP_PROTONAME,
1330 if (nvlist_add_string(db_nvl, tmpstr, pval) != 0 ||
1331 nvlist_remove(db_nvl, pname, DATA_TYPE_STRING) != 0) {
1335 if (ipadm_nvlist2str(db_nvl, buf, buflen) == 0) {
1350 ipmgmt_db_init(void *cbarg, nvlist_t *db_nvl, char *buf, size_t buflen,
1365 for (nvp = nvlist_next_nvpair(db_nvl, NULL); nvp != NULL;
1366 nvp = nvlist_next_nvpair(db_nvl, nvp)) {