Lines Matching refs:ncph
200 nwam_ncp_get_name(nwam_ncp_handle_t ncph, char **namep)
202 return (nwam_get_name(ncph, namep));
630 nwam_ncp_enable(nwam_ncp_handle_t ncph)
635 assert(ncph != NULL);
637 err = nwam_enable(NULL, ncph);
644 if ((err = nwam_ncp_get_name(ncph, &name)) != NWAM_SUCCESS)
659 nwam_ncp_handle_t ncph;
662 if ((err = nwam_lists_to_handle(idp, objp, NWAM_OBJECT_TYPE_NCP, &ncph))
666 *cbobj = ncph;
688 nwam_ncp_get_read_only(nwam_ncp_handle_t ncph, boolean_t *readp)
693 assert(ncph != NULL && readp != NULL);
695 if ((err = nwam_ncp_get_name(ncph, &name)) != NWAM_SUCCESS)
715 nwam_ncp_handle_t ncph;
719 if ((err = nwam_ncu_get_ncp(ncuh, &ncph)) != NWAM_SUCCESS)
722 err = nwam_ncp_get_read_only(ncph, readp);
723 nwam_ncp_free(ncph);
728 nwam_ncp_commit(nwam_ncp_handle_t ncph, uint64_t flags)
733 assert(ncph != NULL && ncph->nwh_data != NULL);
735 if ((err = nwam_ncp_get_read_only(ncph, &ro)) != NWAM_SUCCESS)
740 if ((err = nwam_ncp_validate(ncph, NULL)) != NWAM_SUCCESS)
743 return (nwam_commit(NWAM_NCP_CONF_FILE, ncph, flags));
748 nwam_ncp_is_active(nwam_ncp_handle_t ncph)
753 assert(ncph != NULL);
760 if (nwam_ncp_get_name(ncph, &name) != NWAM_SUCCESS ||
774 nwam_ncp_destroy(nwam_ncp_handle_t ncph, uint64_t flags)
780 assert(ncph != NULL);
782 if ((err = nwam_ncp_get_read_only(ncph, &read_only)) != NWAM_SUCCESS)
785 NWAM_NCP_DEFAULT_FIXED(ncph->nwh_name))
788 if (nwam_ncp_is_active(ncph))
792 if ((err = nwam_ncu_filename(NWAM_NCU_TYPE_LINK, ncph->nwh_name,
794 (err = nwam_ncu_filename(NWAM_NCU_TYPE_INTERFACE, ncph->nwh_name,
799 STATIC_ROUTES_PREFIX, ncph->nwh_name);
801 if ((err = nwam_destroy(NWAM_NCP_CONF_FILE, ncph, flags))
820 nwam_ncp_delete_prop(nwam_ncp_handle_t ncph, const char *propname,
827 assert(ncph != NULL && propname != NULL);
831 (err = nwam_ncp_get_read_only(ncph, &ro_ncp)) != NWAM_SUCCESS)
840 if ((err = nwam_dup_object_list(ncph->nwh_data, &olddata))
843 if ((err = nwam_delete_prop(ncph->nwh_data, propname)) != NWAM_SUCCESS)
845 if ((err = nwam_ncp_validate(ncph, NULL)) != NWAM_SUCCESS)
852 nwam_free_object_list(ncph->nwh_data);
853 ncph->nwh_data = olddata;
858 nwam_ncp_set_prop_value(nwam_ncp_handle_t ncph, const char *propname,
864 assert(ncph != NULL && propname != NULL && value != NULL);
866 if ((err = nwam_ncp_validate_prop(ncph, propname, value))
873 return (nwam_set_prop_value(ncph->nwh_data, propname, value));
877 nwam_ncp_get_prop_value(nwam_ncp_handle_t ncph, const char *propname,
880 assert(ncph != NULL);
882 return (nwam_get_prop_value(ncph->nwh_data, propname, valuep));
886 nwam_ncp_walk_props(nwam_ncp_handle_t ncph,
890 return (nwam_walk_props(ncph, cb, data, flags, retp));
920 nwam_ncp_is_fixed(nwam_ncp_handle_t ncph, boolean_t *fixedp)
928 err = nwam_ncp_get_prop_value(ncph, NWAM_NCP_PROP_MGMT_TYPE,
1502 nwam_ncp_walk_ncus(nwam_ncp_handle_t ncph,
1509 assert(ncph != NULL && cb != NULL);
1517 if ((err = nwam_ncu_filename(NWAM_NCU_TYPE_LINK, ncph->nwh_name,
1532 ncph->nwh_name, &ncufile)) != NWAM_SUCCESS)
1544 nwam_ncp_free(nwam_ncp_handle_t ncph)
1546 nwam_free(ncph, B_TRUE);
1568 nwam_ncu_create(nwam_ncp_handle_t ncph, const char *name, nwam_ncu_type_t type,
1578 assert(ncph != NULL && name != NULL && ncuhp != NULL);
1583 if ((err = nwam_ncp_get_read_only(ncph, &read_only)) != NWAM_SUCCESS)
1589 if ((err = nwam_ncp_is_fixed(ncph, &fixed)) != NWAM_SUCCESS)
1599 if (nwam_ncu_read(ncph, name, type, 0, &ncuh) == NWAM_SUCCESS) {
1612 if ((err = nwam_ncu_filename(type, ncph->nwh_name, &ncufile))
1630 (err = nwam_value_create_string(ncph->nwh_name, &parentval))
1683 nwam_ncu_read(nwam_ncp_handle_t ncph, const char *name,
1692 assert(ncph != NULL && name != NULL && ncuhp != NULL);
1695 if ((err = nwam_ncp_is_fixed(ncph, &fixed)) != NWAM_SUCCESS)
1707 err_ip = nwam_ncu_read(ncph, name, NWAM_NCU_TYPE_INTERFACE,
1709 err_link = nwam_ncu_read(ncph, name, NWAM_NCU_TYPE_LINK,
1732 if ((err = nwam_ncu_filename(type, ncph->nwh_name, &ncufile))
1762 err = nwam_make_ncu_from_dlmgmt(*ncuhp, ncph->nwh_name);
1764 err = nwam_make_ncu_from_ipmgmt(*ncuhp, ncph->nwh_name);
1971 nwam_ncp_handle_t ncph;
1985 err = nwam_ncu_get_ncp(ncuh, &ncph);
1998 if (err == NWAM_SUCCESS && nwam_ncp_is_active(ncph) &&
2000 nwam_ncp_free(ncph);
2004 nwam_ncp_free(ncph);
2876 nwam_ncp_validate_prop(nwam_ncp_handle_t ncph, const char *propname,
2879 assert(ncph != NULL && propname != NULL);
2881 return (nwam_validate_prop(ncp_prop_table, ncph, propname, value));
3063 nwam_ncp_validate(nwam_ncp_handle_t ncph, const char **errpropp)
3065 return (nwam_validate(ncp_prop_table, ncph, errpropp));
3091 nwam_ncp_get_state(nwam_ncp_handle_t ncph, nwam_state_t *statep,
3094 assert(ncph != NULL);
3096 return (nwam_get_state(ncph->nwh_name, ncph, statep, auxp));
3103 nwam_ncp_handle_t ncph;
3109 if ((err = nwam_ncu_get_ncp(ncuh, &ncph)) != NWAM_SUCCESS)
3111 if (!nwam_ncp_is_active(ncph)) {
3112 nwam_ncp_free(ncph);
3115 nwam_ncp_free(ncph);
3164 nwam_ncp_handle_t ncph = NULL;
3184 if (nwam_ncp_read(ncp, 0, &ncph) != NWAM_SUCCESS)
3198 if (nwam_ncu_create(ncph, typedover, NWAM_NCU_TYPE_LINK,
3210 nwam_ncp_free(ncph);
3221 ncp_dr_walker(nwam_ncp_handle_t ncph, void *data)
3232 if (nwam_ncp_get_state(ncph, &state, &aux) != NWAM_SUCCESS ||
3236 if (nwam_ncp_is_fixed(ncph, &fixed) == NWAM_SUCCESS && fixed) {
3241 if (nwam_ncu_read(ncph, arg->ncu_name, arg->ncu_type, 0, &ncuh)