Ejemplo n.º 1
0
TEST(filter, match_false){
	char * filter_str = my_strdup("(&(test_attr1=attr1)(&(test_attr2=attr2)(test_attr3=attr3)))");
	filter_pt filter = filter_create(filter_str);
	properties_pt props = properties_create();
	char * key = my_strdup("test_attr1");
	char * val = my_strdup("attr1");
	char * key2 = my_strdup("test_attr2");
	char * val2 = my_strdup("attr2");
	properties_set(props, key, val);
	properties_set(props, key2, val2);

	bool result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//cleanup
	properties_destroy(props);
	filter_destroy(filter);
	free(filter_str);
	free(key);
	free(key2);
	free(val);
	free(val2);

	mock().checkExpectations();
}
Ejemplo n.º 2
0
celix_status_t wiringAdmin_destroy(wiring_admin_pt* admin) {
    celix_status_t status;

    status = wiringAdmin_stopWebserver(*admin);

    if (status == CELIX_SUCCESS) {
		celixThreadMutex_lock(&((*admin)->exportedWiringEndpointLock));
		hashMap_destroy((*admin)->wiringReceiveServices, false, false);
		hashMap_destroy((*admin)->wiringReceiveTracker, false, false);
		celixThreadMutex_unlock(&((*admin)->exportedWiringEndpointLock));
		celixThreadMutex_destroy(&((*admin)->exportedWiringEndpointLock));

		celixThreadMutex_lock(&((*admin)->importedWiringEndpointLock));
		hashMap_destroy((*admin)->wiringSendServices, false, false);
		hashMap_destroy((*admin)->wiringSendRegistrations, false, false);
		celixThreadMutex_unlock(&((*admin)->importedWiringEndpointLock));
		celixThreadMutex_destroy(&((*admin)->importedWiringEndpointLock));

		properties_destroy((*admin)->adminProperties);

		free(*admin);
		*admin = NULL;
    }

    return status;
}
static celix_status_t remoteProxyFactory_unregisterProxyService(remote_proxy_factory_pt remote_proxy_factory_ptr, endpoint_description_pt endpointDescription) {
	celix_status_t status = CELIX_SUCCESS;
	proxy_instance_pt proxy_instance_ptr = NULL;

	if (!remote_proxy_factory_ptr || !endpointDescription || !remote_proxy_factory_ptr->proxy_instances || !remote_proxy_factory_ptr->handle) {
		status = CELIX_ILLEGAL_ARGUMENT;
	}

	if (status == CELIX_SUCCESS) {
		proxy_instance_ptr = hashMap_remove(remote_proxy_factory_ptr->proxy_instances, endpointDescription);
		if (proxy_instance_ptr == NULL) {
			status = CELIX_BUNDLE_EXCEPTION;
		}
	}

	if (status == CELIX_SUCCESS) {
		if (proxy_instance_ptr->registration_ptr) {
			status = serviceRegistration_unregister(proxy_instance_ptr->registration_ptr);
			proxy_instance_ptr->properties = NULL;
		}
		if (proxy_instance_ptr->service) {
			status = remote_proxy_factory_ptr->destroy_proxy_service_ptr(remote_proxy_factory_ptr->handle, proxy_instance_ptr->service);
		}
		if (proxy_instance_ptr->properties) {
			properties_destroy(proxy_instance_ptr->properties);
		}
		if (proxy_instance_ptr) {
			free(proxy_instance_ptr);
		}
	}

	return status;
}
Ejemplo n.º 4
0
celix_status_t manifest_destroy(manifest_pt manifest) {
	if (manifest != NULL) {
	    properties_destroy(manifest->mainAttributes);
		hashMap_destroy(manifest->attributes, true, false);
		manifest->mainAttributes = NULL;
		manifest->attributes = NULL;
		free(manifest);
		manifest = NULL;
	}
	return CELIX_SUCCESS;
}
Ejemplo n.º 5
0
celix_status_t serviceRegistration_destroy(service_registration_pt registration) {
    free(registration->className);
	registration->className = NULL;
	registration->registry = NULL;

	properties_destroy(registration->properties);

	celixThreadMutex_destroy(&registration->mutex);

	free(registration);
	registration = NULL;

	return CELIX_SUCCESS;
}
Ejemplo n.º 6
0
static void update_service(DBusGProxy *proxy, const char *path)
{
    if (path == NULL) {
        status_offline();
        return;
    }

    if (service != NULL) {
        if (g_strcmp0(dbus_g_proxy_get_path(service), path) == 0)
            return;

        properties_destroy(service);
    }

    service = dbus_g_proxy_new_from_proxy(proxy,
                                          "net.connman.Service", path);

    properties_create(service, service_property_changed, NULL);
}
Ejemplo n.º 7
0
// configuration->dictionary must not contain keys reserved to ConfigAdmin (i.e. "service.pid")
celix_status_t configuration_updateDictionary(configuration_impl_pt configuration, properties_pt properties) {

    properties_pt newDictionary = NULL;

    if ( configuration->dictionary != NULL && configuration->dictionary != properties ) {
        properties_destroy(configuration->dictionary); //free
    }

    newDictionary = properties; // properties == NULL | properties != NULL

    if ( newDictionary != NULL ) {

        hashMap_remove(newDictionary, (void *) OSGI_FRAMEWORK_SERVICE_PID);
        hashMap_remove(newDictionary, (void *) SERVICE_FACTORYPID);
        hashMap_remove(newDictionary, (void *) SERVICE_BUNDLELOCATION);
    }

    configuration->dictionary = newDictionary;
    return CELIX_SUCCESS;

}
celix_status_t remoteProxyFactory_unregister(remote_proxy_factory_pt remote_proxy_factory_ptr) {
	celix_status_t status = CELIX_SUCCESS;

	if (!remote_proxy_factory_ptr) {
		status = CELIX_ILLEGAL_ARGUMENT;
	}

	// #TODO Remove proxy registrations
	if (status == CELIX_SUCCESS) {
		if (remote_proxy_factory_ptr->registration) {
			status = serviceRegistration_unregister(remote_proxy_factory_ptr->registration);
			remote_proxy_factory_ptr->properties = NULL;
		}
		if (remote_proxy_factory_ptr->properties) {
			properties_destroy(remote_proxy_factory_ptr->properties);
		}
		if (remote_proxy_factory_ptr->remote_proxy_factory_service_ptr) {
			free(remote_proxy_factory_ptr->remote_proxy_factory_service_ptr);
		}
	}

	return status;
}
Ejemplo n.º 9
0
static int set_message_id(MESSAGE_HANDLE message, unsigned long next_message_id)
{
	int result = 0;

	PROPERTIES_HANDLE properties;
	if (message_get_properties(message, &properties) != 0)
	{
		result = __LINE__;
	}
	else
	{
		AMQP_VALUE message_id = amqpvalue_create_message_id_ulong(next_message_id);
		if (message_id == NULL)
		{
			result = __LINE__;
		}
		else
		{
			if (properties_set_message_id(properties, message_id) != 0)
			{
				result = __LINE__;
			}

			amqpvalue_destroy(message_id);
		}

		if (message_set_properties(message, properties) != 0)
		{
			result = __LINE__;
		}

		properties_destroy(properties);
	}

	return result;
}
Ejemplo n.º 10
0
TEST(filter, match_operators){
	char * filter_str;
	filter_pt filter;
	properties_pt props = properties_create();
	char * key = my_strdup("test_attr1");
	char * val = my_strdup("attr1");
	char * key2 = my_strdup("test_attr2");
	char * val2 = my_strdup("attr2");
	properties_set(props, key, val);
	properties_set(props, key2, val2);

	//test EQUALS
	filter_str = my_strdup("(test_attr1=attr1)");
	filter = filter_create(filter_str);
	bool result = false;
	filter_match(filter, props, &result);
	CHECK(result);

	//test EQUALS false
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr1=falseString)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//test APPROX TODO: update this test once APPROX is implemented
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr1~=attr1)");
	filter = filter_create(filter_str);
	result = false;
	filter_match(filter, props, &result);
	CHECK(result);

	//test APROX false TODO: update this test once APPROX is implemented
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr1~=ATTR1)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//test PRESENT
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr1=*)");
	filter = filter_create(filter_str);
	result = false;
	filter_match(filter, props, &result);
	CHECK(result);

	//test PRESENT false
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr3=*)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//test LESSEQUAL less
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr1<=attr5)");
	filter = filter_create(filter_str);
	result = false;
	filter_match(filter, props, &result);
	CHECK(result);

	//test LESSEQUAL equals
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr2<=attr2)");
	filter = filter_create(filter_str);
	result = false;
	filter_match(filter, props, &result);
	CHECK(result);

	//test LESSEQUAL false
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr2<=attr1)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//test GREATEREQUAL greater
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr2>=attr1)");
	filter = filter_create(filter_str);
	result = false;
	filter_match(filter, props, &result);
	CHECK(result);

	//test GREATEREQUAL equals
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr2>=attr2)");
	filter = filter_create(filter_str);
	result = false;
	filter_match(filter, props, &result);
	CHECK(result);

	//test GREATEREQUAL false
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr1>=attr5)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//test LESS less
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr1<attr5)");
	filter = filter_create(filter_str);
	result = false;
	filter_match(filter, props, &result);
	CHECK(result);

	//test LESS equals
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr2<attr2)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//test LESS false
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr2<attr1)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//test GREATER greater
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr2>attr1)");
	filter = filter_create(filter_str);
	result = false;
	filter_match(filter, props, &result);
	CHECK(result);

	//test GREATER equals
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr2>attr2)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//test GREATER false
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr1>attr5)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//test SUBSTRING equals
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr1=attr*)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK(result);

	//test SUBSTRING false
	filter_destroy(filter);
	free(filter_str);
	filter_str = my_strdup("(test_attr1=attr*charsNotPresent)");
	filter = filter_create(filter_str);
	result = true;
	filter_match(filter, props, &result);
	CHECK_FALSE(result);

	//cleanup
	properties_destroy(props);
	filter_destroy(filter);
	free(filter_str);
	free(key);
	free(key2);
	free(val);
	free(val2);

	mock().checkExpectations();
}
Ejemplo n.º 11
0
static SEND_ONE_MESSAGE_RESULT send_one_message(MESSAGE_SENDER_INSTANCE* message_sender_instance, MESSAGE_WITH_CALLBACK* message_with_callback, MESSAGE_HANDLE message)
{
	SEND_ONE_MESSAGE_RESULT result;

	size_t encoded_size;
	size_t total_encoded_size = 0;
	MESSAGE_BODY_TYPE message_body_type;
    message_format message_format;

	if ((message_get_body_type(message, &message_body_type) != 0) ||
        (message_get_message_format(message, &message_format) != 0))
	{
		result = SEND_ONE_MESSAGE_ERROR;
	}
	else
	{
		// header
		HEADER_HANDLE header;
		AMQP_VALUE header_amqp_value;
		PROPERTIES_HANDLE properties;
		AMQP_VALUE properties_amqp_value;
		AMQP_VALUE application_properties;
		AMQP_VALUE application_properties_value;
		AMQP_VALUE body_amqp_value = NULL;
        size_t body_data_count;

		message_get_header(message, &header);
		header_amqp_value = amqpvalue_create_header(header);
		if (header != NULL)
		{
			amqpvalue_get_encoded_size(header_amqp_value, &encoded_size);
			total_encoded_size += encoded_size;
		}

		// properties
		message_get_properties(message, &properties);
		properties_amqp_value = amqpvalue_create_properties(properties);
		if (properties != NULL)
		{
			amqpvalue_get_encoded_size(properties_amqp_value, &encoded_size);
			total_encoded_size += encoded_size;
		}

		// application properties
		message_get_application_properties(message, &application_properties);
		application_properties_value = amqpvalue_create_application_properties(application_properties);
		if (application_properties != NULL)
		{
			amqpvalue_get_encoded_size(application_properties_value, &encoded_size);
			total_encoded_size += encoded_size;
		}

		result = SEND_ONE_MESSAGE_OK;

		// body - amqp data
		switch (message_body_type)
		{
			default:
				result = SEND_ONE_MESSAGE_ERROR;
				break;

			case MESSAGE_BODY_TYPE_VALUE:
			{
				AMQP_VALUE message_body_amqp_value;
				if (message_get_inplace_body_amqp_value(message, &message_body_amqp_value) != 0)
				{
					result = SEND_ONE_MESSAGE_ERROR;
				}
				else
				{
					body_amqp_value = amqpvalue_create_amqp_value(message_body_amqp_value);
					if ((body_amqp_value == NULL) ||
						(amqpvalue_get_encoded_size(body_amqp_value, &encoded_size) != 0))
					{
						result = SEND_ONE_MESSAGE_ERROR;
					}
					else
					{
						total_encoded_size += encoded_size;
					}
				}

				break;
			}

			case MESSAGE_BODY_TYPE_DATA:
			{
				BINARY_DATA binary_data;
                size_t i;

                if (message_get_body_amqp_data_count(message, &body_data_count) != 0)
                {
                    result = SEND_ONE_MESSAGE_ERROR;
                }
                else
                {
                    for (i = 0; i < body_data_count; i++)
                    {
                        if (message_get_body_amqp_data(message, i, &binary_data) != 0)
                        {
                            result = SEND_ONE_MESSAGE_ERROR;
                        }
                        else
                        {
                            amqp_binary binary_value = { binary_data.bytes, binary_data.length };
                            AMQP_VALUE body_amqp_data = amqpvalue_create_data(binary_value);
                            if (body_amqp_data == NULL)
                            {
                                result = SEND_ONE_MESSAGE_ERROR;
                            }
                            else
                            {
                                if (amqpvalue_get_encoded_size(body_amqp_data, &encoded_size) != 0)
                                {
                                    result = SEND_ONE_MESSAGE_ERROR;
                                }
                                else
                                {
                                    total_encoded_size += encoded_size;
                                }

                                amqpvalue_destroy(body_amqp_data);
                            }
                        }
                    }
                }
				break;
			}
		}

		if (result == 0)
		{
			void* data_bytes = amqpalloc_malloc(total_encoded_size);
			PAYLOAD payload = { data_bytes, 0 };
			result = SEND_ONE_MESSAGE_OK;

			if (header != NULL)
			{
				if (amqpvalue_encode(header_amqp_value, encode_bytes, &payload) != 0)
				{
					result = SEND_ONE_MESSAGE_ERROR;
				}

				log_message_chunk(message_sender_instance, "Header:", header_amqp_value);
			}

			if ((result == SEND_ONE_MESSAGE_OK) && (properties != NULL))
			{
				if (amqpvalue_encode(properties_amqp_value, encode_bytes, &payload) != 0)
				{
					result = SEND_ONE_MESSAGE_ERROR;
				}

				log_message_chunk(message_sender_instance, "Properties:", properties_amqp_value);
			}

			if ((result == SEND_ONE_MESSAGE_OK) && (application_properties != NULL))
			{
				if (amqpvalue_encode(application_properties_value, encode_bytes, &payload) != 0)
				{
					result = SEND_ONE_MESSAGE_ERROR;
				}

				log_message_chunk(message_sender_instance, "Application properties:", application_properties_value);
			}

			if (result == SEND_ONE_MESSAGE_OK)
			{
				switch (message_body_type)
				{
				case MESSAGE_BODY_TYPE_VALUE:
				{
					if (amqpvalue_encode(body_amqp_value, encode_bytes, &payload) != 0)
					{
						result = SEND_ONE_MESSAGE_ERROR;
					}

					log_message_chunk(message_sender_instance, "Body - amqp value:", body_amqp_value);
					break;
				}
				case MESSAGE_BODY_TYPE_DATA:
				{
                    BINARY_DATA binary_data;
                    size_t i;

                    for (i = 0; i < body_data_count; i++)
                    {
                        if (message_get_body_amqp_data(message, i, &binary_data) != 0)
                        {
                            result = SEND_ONE_MESSAGE_ERROR;
                        }
                        else
                        {
                            amqp_binary binary_value = { binary_data.bytes, binary_data.length };
                            AMQP_VALUE body_amqp_data = amqpvalue_create_data(binary_value);
                            if (body_amqp_data == NULL)
                            {
                                result = SEND_ONE_MESSAGE_ERROR;
                            }
                            else
                            {
                                if (amqpvalue_encode(body_amqp_data, encode_bytes, &payload) != 0)
                                {
                                    result = SEND_ONE_MESSAGE_ERROR;
                                    break;
                                }

                                amqpvalue_destroy(body_amqp_data);
                            }
                        }
                    }
					break;
				}
				}
			}

			if (result == SEND_ONE_MESSAGE_OK)
			{
				message_with_callback->message_send_state = MESSAGE_SEND_STATE_PENDING;
				switch (link_transfer(message_sender_instance->link, message_format, &payload, 1, on_delivery_settled, message_with_callback))
				{
				default:
				case LINK_TRANSFER_ERROR:
					if (message_with_callback->on_message_send_complete != NULL)
					{
						message_with_callback->on_message_send_complete(message_with_callback->context, MESSAGE_SEND_ERROR);
					}

					result = SEND_ONE_MESSAGE_ERROR;
					break;

				case LINK_TRANSFER_BUSY:
					message_with_callback->message_send_state = MESSAGE_SEND_STATE_NOT_SENT;
					result = SEND_ONE_MESSAGE_BUSY;
					break;

				case LINK_TRANSFER_OK:
					result = SEND_ONE_MESSAGE_OK;
					break;
				}
			}

			amqpalloc_free(data_bytes);

			if (body_amqp_value != NULL)
			{
				amqpvalue_destroy(body_amqp_value);
			}

			amqpvalue_destroy(application_properties);
			amqpvalue_destroy(application_properties_value);
			amqpvalue_destroy(properties_amqp_value);
			properties_destroy(properties);
		}
	}

	return result;
}
Ejemplo n.º 12
0
static AMQP_VALUE on_message_received(const void* context, MESSAGE_HANDLE message)
{
	AMQP_MANAGEMENT_INSTANCE* amqp_management_instance = (AMQP_MANAGEMENT_INSTANCE*)context;

	AMQP_VALUE application_properties;
	if (message_get_application_properties(message, &application_properties) != 0)
	{
		/* error */
	}
	else
	{
		PROPERTIES_HANDLE response_properties;

		if (message_get_properties(message, &response_properties) != 0)
		{
			/* error */
		}
		else
		{
			AMQP_VALUE key;
			AMQP_VALUE value;
			AMQP_VALUE map;
			AMQP_VALUE correlation_id_value;

			if (properties_get_correlation_id(response_properties, &correlation_id_value) != 0)
			{
				/* error */
			}
			else
			{
				map = amqpvalue_get_inplace_described_value(application_properties);
				if (map == NULL)
				{
					/* error */
				}
				else
				{
					key = amqpvalue_create_string("status-code");
					if (key == NULL)
					{
						/* error */
					}
					else
					{
						value = amqpvalue_get_map_value(map, key);
						if (value == NULL)
						{
							/* error */
						}
						else
						{
							int32_t status_code;
							if (amqpvalue_get_int(value, &status_code) != 0)
							{
								/* error */
							}
							else
							{
								size_t i = 0;
								while (i < amqp_management_instance->operation_message_count)
								{
									if (amqp_management_instance->operation_messages[i]->operation_state == OPERATION_STATE_AWAIT_REPLY)
									{
										AMQP_VALUE expected_message_id = amqpvalue_create_ulong(amqp_management_instance->operation_messages[i]->message_id);
										OPERATION_RESULT operation_result;

										if (expected_message_id == NULL)
										{
											break;
										}
										else
										{
											if (amqpvalue_are_equal(correlation_id_value, expected_message_id))
											{
												/* 202 is not mentioned in the draft in any way, this is a workaround for an EH bug for now */
												if ((status_code != 200) && (status_code != 202))
												{
													operation_result = OPERATION_RESULT_OPERATION_FAILED;
												}
												else
												{
													operation_result = OPERATION_RESULT_OK;
												}

												amqp_management_instance->operation_messages[i]->on_operation_complete(amqp_management_instance->operation_messages[i]->callback_context, operation_result, 0, NULL);

												remove_operation_message_by_index(amqp_management_instance, i);

												amqpvalue_destroy(expected_message_id);

												break;
											}

											amqpvalue_destroy(expected_message_id);
										}
									}
								}
							}

							amqpvalue_destroy(value);
						}

						amqpvalue_destroy(key);
					}
				}
			}

			properties_destroy(response_properties);
		}

		application_properties_destroy(application_properties);
	}

	return messaging_delivery_accepted();
}
Ejemplo n.º 13
0
static celix_status_t deviceManager_attachAlgorithm(device_manager_pt manager, service_reference_pt ref, void *service) {
	celix_status_t status = CELIX_SUCCESS;

	driver_loader_pt loader = NULL;
	status = driverLoader_create(manager->context, &loader);
	if (status == CELIX_SUCCESS) {
		array_list_pt included = NULL;
		array_list_pt excluded = NULL;

		array_list_pt driverIds = NULL;

		hashMap_put(manager->devices, ref, service);

		status = arrayList_create(&included);
		if (status == CELIX_SUCCESS) {
			status = arrayList_create(&excluded);
			if (status == CELIX_SUCCESS) {
				properties_pt properties = properties_create();

				unsigned int size = 0;
				char **keys;

				serviceReference_getPropertyKeys(ref, &keys, &size);
				for (int i = 0; i < size; i++) {
					char* key = keys[i];
					const char* value = NULL;
					serviceReference_getProperty(ref, key, &value);
					properties_set(properties, key, value);
				}

				status = driverLoader_findDrivers(loader, manager->locators, properties, &driverIds);
				if (status == CELIX_SUCCESS) {
					hash_map_iterator_pt iter = hashMapIterator_create(manager->drivers);
					while (hashMapIterator_hasNext(iter)) {
						driver_attributes_pt driverAttributes = hashMapIterator_nextValue(iter);
						arrayList_add(included, driverAttributes);

						// Each driver that already is installed can be removed from the list
						char *id = NULL;
						celix_status_t substatus = driverAttributes_getDriverId(driverAttributes, &id);
						if (substatus == CELIX_SUCCESS) {
							// arrayList_removeElement(driverIds, id);
							array_list_iterator_pt idsIter = arrayListIterator_create(driverIds);
							while (arrayListIterator_hasNext(idsIter)) {
								char *value = arrayListIterator_next(idsIter);
								if (strcmp(value, id) == 0) {
									arrayListIterator_remove(idsIter);
								}
							}
							arrayListIterator_destroy(idsIter);
						}
						if(id != NULL){
							free(id);
						}
					}
					hashMapIterator_destroy(iter);

					status = deviceManager_matchAttachDriver(manager, loader, driverIds, included, excluded, service, ref);

				}
				arrayList_destroy(driverIds);
				properties_destroy(properties);
				arrayList_destroy(excluded);
			}
			arrayList_destroy(included);
		}

	}

	driverLoader_destroy(&loader);
	return status;
}
Ejemplo n.º 14
0
static void manager_cleanup(void)
{
    properties_destroy(manager);
}