Lines Matching defs:object
147 nwamd_object_t object;
157 object = nwamd_object_find(NWAM_OBJECT_TYPE_ENM, object_name);
158 if (object == NULL) {
163 enmh = object->nwamd_object_handle;
166 (object->nwamd_object_state == NWAM_STATE_OFFLINE_TO_ONLINE);
224 object->nwamd_script_time = now;
227 * Release the object so that it is not blocked while the
230 nwamd_object_release(object);
235 * Find the object again, now that the script has finished
237 * comparing the object's script time with the one from above.
239 object = nwamd_object_find(NWAM_OBJECT_TYPE_ENM, object_name);
240 if (object == NULL) {
247 if (object->nwamd_script_time.tv_sec != now.tv_sec ||
248 object->nwamd_script_time.tv_usec != now.tv_usec) {
252 nwamd_object_release(object);
255 (void) gettimeofday(&object->nwamd_script_time, NULL);
260 * object, go to maintenance.
266 if (object->nwamd_object_aux_state !=
291 switch (object->nwamd_object_aux_state) {
310 object->nwamd_object_state = state;
311 object->nwamd_object_aux_state = aux_state;
312 (void) nwamd_object_release_and_destroy_after_preserve(object);
315 object->nwamd_object_name, state, aux_state);
316 (void) nwamd_object_release_after_preserve(object);
329 * Run start/stop method for ENM in a separate thread. The object lock is not
330 * held across threads, so we duplicate the object name for the method
334 nwamd_enm_run_method(nwamd_object_t object)
341 * to complete. Do not hold object lock across threads.
343 if ((name = strdup(object->nwamd_object_name)) == NULL) {
345 object->nwamd_object_name);
371 nwamd_object_t object;
381 object = nwamd_object_find(NWAM_OBJECT_TYPE_ENM, object_name);
382 if (object == NULL) {
387 state = object->nwamd_object_state;
388 aux_state = object->nwamd_object_aux_state;
389 enmh = object->nwamd_object_handle;
392 object->nwamd_object_name);
401 object->nwamd_object_name);
410 "for enm %s", fmri, object->nwamd_object_name);
418 fmri, object->nwamd_object_name);
435 object->nwamd_object_name);
446 if (!nwamd_enm_run_method(object)) {
456 if (state != object->nwamd_object_state ||
457 aux_state != object->nwamd_object_aux_state) {
459 object->nwamd_object_name, state, aux_state);
464 * object without decreasing the reference count, ensuring it will not
468 nwamd_object_release_and_preserve(object);
470 nwamd_object_release(object);
478 nwamd_object_t object;
487 object = nwamd_object_find(NWAM_OBJECT_TYPE_ENM, object_name);
488 if (object == NULL) {
494 state = object->nwamd_object_state;
495 aux_state = object->nwamd_object_aux_state;
496 enmh = object->nwamd_object_handle;
497 state = object->nwamd_object_state;
502 object->nwamd_object_name);
510 * object without decreasing the reference count, ensuring it
513 if (nwamd_enm_run_method(object)) {
514 nwamd_object_release_and_preserve(object);
526 object->nwamd_object_name);
535 object->nwamd_object_name);
547 "for enm %s", fmri, object->nwamd_object_name);
555 object->nwamd_object_name,
567 if (state == object->nwamd_object_state &&
568 aux_state == object->nwamd_object_aux_state) {
575 switch (object->nwamd_object_aux_state) {
592 if (!destroying && (state != object->nwamd_object_state ||
593 aux_state != object->nwamd_object_aux_state)) {
595 object->nwamd_object_name, state, aux_state);
601 (void) nwamd_object_release_and_destroy(object);
603 (void) nwamd_object_release(object);
612 nwamd_enm_check(nwamd_object_t object, void *data)
622 state = object->nwamd_object_state;
624 enmh = object->nwamd_object_handle;
636 object->nwamd_object_name);
643 if (nwamd_enm_action(object->nwamd_object_name,
647 object->nwamd_object_name);
653 object->nwamd_object_name);
656 if (nwamd_enm_action(object->nwamd_object_name,
660 object->nwamd_object_name);
671 object->nwamd_object_name,
698 "%s satisfied", object->nwamd_object_name,
702 object->nwamd_object_name,
708 object->nwamd_object_name,
744 nwamd_object_t object;
752 "read object '%s': %s", event->event_object,
757 if ((object = nwamd_object_find(NWAM_OBJECT_TYPE_ENM,
759 nwam_enm_free(object->nwamd_object_handle);
760 object->nwamd_object_handle = enmh;
762 object = nwamd_object_init(NWAM_OBJECT_TYPE_ENM,
764 object->nwamd_object_state = NWAM_STATE_OFFLINE;
765 object->nwamd_object_aux_state =
768 /* (Re)set script time to now as the object has just been (re)read */
769 (void) gettimeofday(&object->nwamd_script_time, NULL);
781 object->nwamd_object_state == NWAM_STATE_ONLINE) {
786 nwamd_object_release(object);
811 * Do not free the handle and object.
821 nwamd_object_t object;
825 object = nwamd_object_find(NWAM_OBJECT_TYPE_ENM,
827 if (object == NULL) {
833 if (object->nwamd_object_state == NWAM_STATE_ONLINE) {
837 nwamd_object_release(object);
840 nwamd_object_release(object);
847 object = nwamd_object_find(NWAM_OBJECT_TYPE_ENM,
849 if (object == NULL) {
855 if (object->nwamd_object_state == NWAM_STATE_DISABLED) {
859 nwamd_object_release(object);
862 nwamd_object_release(object);
886 nwamd_object_t object;
890 if ((object = nwamd_object_find(NWAM_OBJECT_TYPE_ENM,
901 if (new_state == object->nwamd_object_state &&
902 new_aux_state == object->nwamd_object_aux_state) {
905 object->nwamd_object_name, nwam_state_to_string(new_state),
907 nwamd_object_release(object);
911 object->nwamd_object_state = new_state;
912 object->nwamd_object_aux_state = new_aux_state;
915 "%s to (%s , %s)", object->nwamd_object_name,
916 nwam_state_to_string(object->nwamd_object_state),
917 nwam_aux_state_to_string(object->nwamd_object_aux_state));
919 nwamd_object_release(object);