}
}
-static dnssd_handle_s *__dnssd_check_handle_validity(
+static dnssd_handle_s *__dnssd_check_handle_validity(dnssd_handle_s *handle)
+{
+ __DNSSD_LOG_FUNC_ENTER__;
+ dnssd_handle_s *local_handle = NULL;
+ GSList *list;
+
+ for (list = dnssd_handle_list; list; list = list->next) {
+ local_handle = (dnssd_handle_s *)list->data;
+ if (local_handle == handle) {
+ DNSSD_LOGD("Local handle %p is found", handle);
+ __DNSSD_LOG_FUNC_EXIT__;
+ return handle;
+ }
+ }
+ __DNSSD_LOG_FUNC_EXIT__;
+ return NULL;
+}
+
+static dnssd_handle_s *__dnssd_get_struct_from_handle(
dnssd_service_h dnssd_service)
{
__DNSSD_LOG_FUNC_ENTER__;
}
handle = (dnssd_handle_s*)data;
- if (__dnssd_check_handle_validity(handle->service_handler) == NULL) {
+ if (__dnssd_check_handle_validity(handle) == NULL) {
DNSSD_LOGE("handle not found %p %u", handle, handle->service_handler);
return FALSE;
}
}
if (dnssd_service == NULL || service_type == NULL ||
- __dnssd_check_handle_validity(*dnssd_service) != NULL) {
+ __dnssd_get_struct_from_handle(*dnssd_service) != NULL) {
DNSSD_LOGE("Invalid Parameter");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
- local_handle = __dnssd_check_handle_validity(dnssd_service);
+ local_handle = __dnssd_get_struct_from_handle(dnssd_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
}
- local_handle = __dnssd_check_handle_validity(local_service);
+ local_handle = __dnssd_get_struct_from_handle(local_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
}
- local_handle = __dnssd_check_handle_validity(local_service);
+ local_handle = __dnssd_get_struct_from_handle(local_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
}
DNSSD_LOGD("Interface index: %u", if_index);
- local_handle = __dnssd_check_handle_validity(local_service);
+ local_handle = __dnssd_get_struct_from_handle(local_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
- local_handle = __dnssd_check_handle_validity(local_service);
+ local_handle = __dnssd_get_struct_from_handle(local_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
}
- local_handle = __dnssd_check_handle_validity(local_service);
+ local_handle = __dnssd_get_struct_from_handle(local_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
- local_handle = __dnssd_check_handle_validity(local_service);
+ local_handle = __dnssd_get_struct_from_handle(local_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
- local_handle = __dnssd_check_handle_validity(local_service);
+ local_handle = __dnssd_get_struct_from_handle(local_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
- local_handle = __dnssd_check_handle_validity(local_service);
+ local_handle = __dnssd_get_struct_from_handle(local_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
- local_handle = __dnssd_check_handle_validity(local_service);
+ local_handle = __dnssd_get_struct_from_handle(local_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
found->if_index,
local_handle->flags);
- dnssd_handle = __dnssd_check_handle_validity(found->browse_handler);
+ dnssd_handle = __dnssd_get_struct_from_handle(found->browse_handler);
if (dnssd_handle == NULL) {
DNSSD_LOGD("Invalid browse handle");
__DNSSD_LOG_FUNC_EXIT__;
}
if (dnssd_service == NULL || service_type == NULL ||
- __dnssd_check_handle_validity(*dnssd_service) != NULL) {
+ __dnssd_get_struct_from_handle(*dnssd_service) != NULL) {
DNSSD_LOGE("Invalid Parameter");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
}
if (dnssd_service == NULL || service_type == NULL ||
- __dnssd_check_handle_validity(*dnssd_service) != NULL) {
+ __dnssd_get_struct_from_handle(*dnssd_service) != NULL) {
DNSSD_LOGE("Invalid Parameter");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
- local_handle = __dnssd_check_handle_validity(dnssd_service);
+ local_handle = __dnssd_get_struct_from_handle(dnssd_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler 0x%x not found", dnssd_service);
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
}
- local_handle = __dnssd_check_handle_validity(dnssd_service);
+ local_handle = __dnssd_get_struct_from_handle(dnssd_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
}
- local_handle = __dnssd_check_handle_validity(dnssd_service);
+ local_handle = __dnssd_get_struct_from_handle(dnssd_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
}
- local_handle = __dnssd_check_handle_validity(dnssd_service);
+ local_handle = __dnssd_get_struct_from_handle(dnssd_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
}
- local_handle = __dnssd_check_handle_validity(dnssd_service);
+ local_handle = __dnssd_get_struct_from_handle(dnssd_service);
if (local_handle == NULL) {
DNSSD_LOGD("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
- local_handle = __dnssd_check_handle_validity(dnssd_service);
+ local_handle = __dnssd_get_struct_from_handle(dnssd_service);
if (local_handle == NULL) {
DNSSD_LOGE("Service Handler not found");
__DNSSD_LOG_FUNC_EXIT__;