Lines Matching defs:hp
124 struct nwam_handle *hp;
128 if (nwam_read(type, dbname, name, 0, &hp) == NWAM_SUCCESS) {
129 nwam_free(hp);
137 nwam_get_name(struct nwam_handle *hp, char **namep)
139 assert(hp != NULL && namep != NULL);
141 if ((*namep = strdup(hp->nwh_name)) == NULL) {
149 nwam_set_name(struct nwam_handle *hp, const char *name)
151 assert(hp != NULL && name != NULL);
153 if (hp->nwh_committed)
156 if (strlen(name) >= sizeof (hp->nwh_name))
159 (void) strcpy(hp->nwh_name, name);
209 struct nwam_handle *hp;
253 flags & NWAM_FLAG_GLOBAL_MASK, &hp);
261 if ((selectcb == NULL) || (selectcb(hp, flags, data) == 0)) {
262 ret = cb(hp, data);
264 nwam_free(hp);
271 nwam_free(hp);
281 nwam_free(struct nwam_handle *hp)
283 if (hp != NULL) {
284 if (hp->nwh_data != NULL)
285 nwam_free_object_list(hp->nwh_data);
286 free(hp);
299 struct nwam_handle *hp;
303 if (nwam_read(oldhp->nwh_object_type, dbname, newname, 0, &hp)
305 nwam_free(hp);
324 nwam_walk_props(struct nwam_handle *hp,
333 assert(hp != NULL && hp->nwh_data != NULL && cb != NULL);
337 while ((err = nwam_next_object_prop(hp->nwh_data, lastpropname,
365 nwam_commit(const char *dbname, struct nwam_handle *hp, uint64_t flags)
373 assert(hp != NULL);
382 (hp->nwh_object_type == NWAM_OBJECT_TYPE_KNOWN_WLAN ?
387 is_ncu = (hp->nwh_object_type == NWAM_OBJECT_TYPE_NCU);
392 switch (nwam_read(hp->nwh_object_type, (char *)dbname, hp->nwh_name, 0,
399 if (hp->nwh_object_type == NWAM_OBJECT_TYPE_NCP)
408 hp->nwh_object_type == NWAM_OBJECT_TYPE_NCP ? NULL : hp->nwh_name,
409 iflags, hp->nwh_data);
413 hp->nwh_committed = B_TRUE;
423 (void) nwam_request_action(hp->nwh_object_type,
424 hp->nwh_name, ncpname, action);
428 (void) nwam_request_action(hp->nwh_object_type, hp->nwh_name,
435 nwam_is_active(struct nwam_handle *hp)
440 return ((nwam_get_state(NULL, hp, &state, &aux) == NWAM_SUCCESS &&
445 nwam_destroy(const char *dbname, struct nwam_handle *hp, uint64_t flags)
451 assert(hp != NULL);
456 (hp->nwh_object_type == NWAM_OBJECT_TYPE_KNOWN_WLAN ?
460 is_ncp = hp->nwh_object_type == NWAM_OBJECT_TYPE_NCP;
461 is_ncu = hp->nwh_object_type == NWAM_OBJECT_TYPE_NCU;
462 name = hp->nwh_name;
465 if (!is_ncp && !is_ncu && nwam_is_active(hp))
480 (void) nwam_request_action(hp->nwh_object_type, name,
485 (void) nwam_request_action(hp->nwh_object_type, name, NULL,
490 nwam_free(hp);
501 nwam_enable(const char *parent, struct nwam_handle *hp)
503 return (nwam_request_action(hp->nwh_object_type, hp->nwh_name,
508 nwam_disable(const char *parent, struct nwam_handle *hp)
510 return (nwam_request_action(hp->nwh_object_type, hp->nwh_name,
515 nwam_get_state(const char *parent, struct nwam_handle *hp, nwam_state_t *statep,
518 return (nwam_request_state(hp->nwh_object_type, hp->nwh_name, parent,
676 nwam_validate_prop(struct nwam_prop_table table, struct nwam_handle *hp,
681 assert(hp != NULL && propname != NULL);
691 nwam_validate(struct nwam_prop_table table, struct nwam_handle *hp,
697 assert(hp != NULL);
702 err1 = nwam_walk_props(hp, nwam_validate_prop_internal, &via,