/* * Obtain an object handle, generic version */ static ni_dbus_object_t * __ni_call_get_proxy_object(const ni_dbus_service_t *service, const char *relative_path) { ni_dbus_object_t *root_object, *child; if (!(root_object = ni_call_create_client())) return NULL; child = ni_dbus_object_create(root_object, relative_path, service->compatible, NULL); ni_dbus_object_set_default_interface(child, service->name); return child; }
ni_bool_t ni_client_create(ni_fsm_t *fsm, void *user_data) { ni_dbus_client_t *client; if (!(fsm->client_root_object = ni_call_create_client())) return FALSE; client = ni_dbus_object_get_client(fsm->client_root_object); ni_dbus_client_add_signal_handler(client, NULL, NULL, NI_OBJECTMODEL_MANAGED_NETIF_INTERFACE, ni_state_change_signal_handler, user_data); return TRUE; }