case DNSSD_ERROR_NONE:
return "DNSSD_ERROR_NONE";
case DNSSD_ERROR_OUT_OF_MEMORY:
- return "DNSSD_ERROR_OUT_OF_MEMORY";
+ return "DNSSD_ERROR_OUT_OF_MEMORY"; //LCOV_EXCL_LINE
case DNSSD_ERROR_INVALID_PARAMETER:
- return "DNSSD_ERROR_INVALID_PARAMETER";
+ return "DNSSD_ERROR_INVALID_PARAMETER"; //LCOV_EXCL_LINE
case DNSSD_ERROR_NOT_SUPPORTED:
- return "DNSSD_ERROR_NOT_SUPPORTED";
+ return "DNSSD_ERROR_NOT_SUPPORTED"; //LCOV_EXCL_LINE
case DNSSD_ERROR_NOT_INITIALIZED:
- return "DNSSD_ERROR_NOT_INITIALIZED";
+ return "DNSSD_ERROR_NOT_INITIALIZED"; //LCOV_EXCL_LINE
case DNSSD_ERROR_ALREADY_REGISTERED:
- return "DNSSD_ERROR_ALREADY_REGISTERED";
+ return "DNSSD_ERROR_ALREADY_REGISTERED";//LCOV_EXCL_LINE
case DNSSD_ERROR_NAME_CONFLICT:
- return "DNSSD_ERROR_NAME_CONFLICT";
+ return "DNSSD_ERROR_NAME_CONFLICT"; //LCOV_EXCL_LINE
case DNSSD_ERROR_SERVICE_NOT_RUNNING:
- return "DNSSD_ERROR_SERVICE_NOT_RUNNING";
+ return "DNSSD_ERROR_SERVICE_NOT_RUNNING";//LCOV_EXCL_LINE
case DNSSD_ERROR_OPERATION_FAILED:
- return "DNSSD_ERROR_OPERATION_FAILED";
+ return "DNSSD_ERROR_OPERATION_FAILED"; //LCOV_EXCL_LINE
default:
return "UNSUPPORTED_ERROR";
}
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == true) {
- DNSSD_LOGE("Already initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_INVALID_OPERATION;
+ DNSSD_LOGE("Already initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE
}
g_is_init = true;
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
if(dnssd_service == NULL || service_type == NULL ||
local_handle = (dnssd_handle_s *)g_try_malloc0(REG_SIZE);
if (local_handle == NULL) {
- DNSSD_LOGE("Failed to Allocate Memory");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_OUT_OF_MEMORY;
+ DNSSD_LOGE("Failed to Allocate Memory"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
handler = (unsigned int)local_handle & 0xffffffff;
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
local_handle = __dnssd_check_handle_validity(dnssd_service);
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
if (service_name == NULL) {
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
if (port < 0 || port > 65535) {
}
if (local_handle->op_type != DNSSD_TYPE_REGISTER) {
- DNSSD_LOGD("DNSSD service is not a local service");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_SERVICE_NOT_FOUND;
+ DNSSD_LOGD("DNSSD service is not a local service"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_SERVICE_NOT_FOUND; //LCOV_EXCL_LINE
}
reg = GET_REG_DATA_P(local_handle);
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
local_handle = __dnssd_check_handle_validity(local_service);
}
if (length == 0 || value == NULL)
- DNSSD_LOGD("Value size is 0 or NULL value passed");
+ DNSSD_LOGD("Value size is 0 or NULL value passed"); //LCOV_EXCL_LINE
reg = GET_REG_DATA_P(local_handle);
txt_record = &(reg->txt_ref);
ret = TXTRecordSetValue(txt_record, key, length, value);
if (ret != DNSSD_ERROR_NONE) {
- DNSSD_LOGE("Failed to add value to key, error[%s]",
- dnssd_error_to_string(ret));
+ DNSSD_LOGE("Failed to add value to key, error[%s]", //LCOV_EXCL_LINE
+ dnssd_error_to_string(ret)); //LCOV_EXCL_LINE
__DNSSD_LOG_FUNC_EXIT__;
return ret;
} else {
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
if (key == NULL) {
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
local_handle = __dnssd_check_handle_validity(local_service);
ret = DNSServiceAddRecord(sd_ref, &(reg->record_ref),
local_handle->flags, type, length, data, 0);
} else {
- DNSSD_LOGD("Updating DNS Service Record");
- ret = DNSServiceUpdateRecord(sd_ref, record_client,
- local_handle->flags, length, data, 0);
+ DNSSD_LOGD("Updating DNS Service Record"); //LCOV_EXCL_LINE
+ ret = DNSServiceUpdateRecord(sd_ref, record_client, //LCOV_EXCL_LINE
+ local_handle->flags, length, data, 0); //LCOV_EXCL_LINE
}
if (ret < 0) {
- DNSSD_LOGE("Failed to Add Record for DNS Service, error[%s]",
- dnssd_error_to_string(ret));
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_OPERATION_FAILED;
+ DNSSD_LOGE("Failed to Add Record for DNS Service, error[%s]", //LCOV_EXCL_LINE
+ dnssd_error_to_string(ret)); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
DNSSD_LOGD("Successfully added record for DNS Service");
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
local_handle = __dnssd_check_handle_validity(local_service);
ret = DNSServiceRemoveRecord(sd_ref, record_client,
local_handle->flags);
if(ret < 0) {
- DNSSD_LOGE("Failed to Remove Record for DNS Service, error[%s]",
- dnssd_error_to_string(ret));
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_OPERATION_FAILED;
+ DNSSD_LOGE("Failed to Remove Record for DNS Service, error[%s]", //LCOV_EXCL_LINE
+ dnssd_error_to_string(ret)); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
reg->record_ref = NULL;
DNSSD_LOGD("Received Registration Reply");
if (error_code != DNSSD_ERROR_NONE)
- DNSSD_LOGE("Failed to register, error code %d -> %s",
- error_code,
- dnssd_error_to_string(error_code));
+ DNSSD_LOGE("Failed to register, error code %d -> %s", //LCOV_EXCL_LINE
+ error_code, //LCOV_EXCL_LINE
+ dnssd_error_to_string(error_code)); //LCOV_EXCL_LINE
for (list = dnssd_handle_list; list; list = list->next) {
dnssd_handle = (dnssd_handle_s *) list->data;
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
local_handle = __dnssd_check_handle_validity(local_service);
}
if (local_handle->op_type != DNSSD_TYPE_REGISTER) {
- DNSSD_LOGD("DNSSD service is not a local service");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_SERVICE_NOT_FOUND;
+ DNSSD_LOGD("DNSSD service is not a local service"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_SERVICE_NOT_FOUND; //LCOV_EXCL_LINE
}
reg = GET_REG_DATA_P(local_handle);
sd_ref = &(local_handle->sd_ref);
if (reg->service_name == NULL) {
- DNSSD_LOGD("No Service Name Provided");
- reg->service_name = g_strdup("");
+ DNSSD_LOGD("No Service Name Provided"); //LCOV_EXCL_LINE
+ reg->service_name = g_strdup(""); //LCOV_EXCL_LINE
} else
DNSSD_LOGD("Service Name is %s", reg->service_name);
NULL, reg->port, 1, "", __dnssd_register_reply_cb,
NULL);
if(ret < 0) {
- DNSSD_LOGE("Failed to register for dns service, error[%s]",
- dnssd_error_to_string(ret));
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_OPERATION_FAILED;
+ DNSSD_LOGE("Failed to register for dns service, error[%s]", //LCOV_EXCL_LINE
+ dnssd_error_to_string(ret)); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
reg->callback = register_cb;
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
local_handle = __dnssd_check_handle_validity(local_service);
if (record_client) {
ret = DNSServiceRemoveRecord(sd_ref, record_client,
local_handle->flags);
- if(ret < 0)
- DNSSD_LOGE("Failed to Remove Record for DNS Service, "
- "error[%s]", dnssd_error_to_string(ret));
- else
- reg->record_ref = NULL;
+ if(ret < 0) //LCOV_EXCL_LINE
+ DNSSD_LOGE("Failed to Remove Record for DNS Service, " //LCOV_EXCL_LINE
+ "error[%s]", dnssd_error_to_string(ret)); //LCOV_EXCL_LINE
+ else //LCOV_EXCL_LINE
+ reg->record_ref = NULL; //LCOV_EXCL_LINE
}
DNSServiceRefDeallocate(sd_ref);
return DNSSD_ERROR_NONE;
}
+//LCOV_EXCL_START
static void __dnssd_getaddrinfo_reply_cb(DNSServiceRef sd_ref,
unsigned int flags, unsigned int if_index,
DNSServiceErrorType error_code, const char *host_name,
}
}
+//LCOV_EXCL_STOP
+//LCOV_EXCL_START
static int __dnssd_getaddrinfo(dnssd_handle_s *dnssd_handle, unsigned int flags,
unsigned int if_index, const char *host_name,
const char *fullname, const char *txt_record,
return DNSSD_ERROR_NONE;
}
+//LCOV_EXCL_STOP
+//LCOV_EXCL_START
static void __dnssd_resolve_reply_cb(DNSServiceRef sd_ref, unsigned int flags,
unsigned int if_index, DNSServiceErrorType error_code,
const char *fullname, const char *host_name,
host_name, fullname, (const char *) txt_record,
txt_len, port);
}
+//LCOV_EXCL_STOP
+//LCOV_EXCL_START
static int __dnssd_resolve_dns_service(dnssd_handle_s *dnssd_handle,
unsigned int flags, unsigned int if_index,
const char *service_name, const char *type, const char *domain)
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_NONE;
}
+//LCOV_EXCL_STOP
+//LCOV_EXCL_START
static dnssd_handle_s *__dnssd_get_found_handle(dnssd_service_h browse_service,
const char *service_name)
{
__DNSSD_LOG_FUNC_EXIT__;
return NULL;
}
+//LCOV_EXCL_STOP
+//LCOV_EXCL_START
static void __dnssd_broswe_reply_cb(DNSServiceRef sd_ref, unsigned int flags,
unsigned int if_index, DNSServiceErrorType error_code,
const char *service_name, const char *service_type,
}
__DNSSD_LOG_FUNC_EXIT__;
}
+//LCOV_EXCL_STOP
int dnssd_start_browsing_service(const char *service_type,
dnssd_browser_h *dnssd_service, dnssd_found_cb found_cb,
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
if(dnssd_service == NULL || service_type == NULL ||
local_handle = (dnssd_handle_s *)g_try_malloc0(BROWSE_SIZE);
if (local_handle == NULL) {
- DNSSD_LOGE("Failed to Allocate Memory");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_OUT_OF_MEMORY;
+ DNSSD_LOGE("Failed to Allocate Memory"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
handler = (unsigned int)local_handle & 0xffffffff;
local_handle->domain, __dnssd_broswe_reply_cb,
NULL);
if(ret < 0) {
- DNSSD_LOGE("Failed to browse for dns service, error[%s]",
- dnssd_error_to_string(ret));
- g_free(local_handle->service_type);
- g_free(local_handle);
- __DNSSD_LOG_FUNC_EXIT__;
- return ret;
+ DNSSD_LOGE("Failed to browse for dns service, error[%s]", //LCOV_EXCL_LINE
+ dnssd_error_to_string(ret)); //LCOV_EXCL_LINE
+ g_free(local_handle->service_type); //LCOV_EXCL_LINE
+ g_free(local_handle); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return ret; //LCOV_EXCL_LINE
}
browse->callback = found_cb;
if(found_handle->op_type != DNSSD_TYPE_FOUND)
return;
+ //LCOV_EXCL_START
found_data = GET_FOUND_DATA_P(found_handle);
if(found_data->browse_handler != *handler)
return;
__DNSSD_LOG_FUNC_EXIT__;
return;
+ //LCOV_EXCL_STOP
}
int dnssd_stop_browsing_service(dnssd_browser_h dnssd_service)
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
local_handle = __dnssd_check_handle_validity(dnssd_service);
sd_ref = local_handle->sd_ref;
if(NULL == sd_ref) {
- DNSSD_LOGE("Invalid DNS SD Client");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_INVALID_PARAMETER;
+ DNSSD_LOGE("Invalid DNS SD Client"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
}
g_slist_foreach(dnssd_handle_list, (GFunc)__dnssd_remove_found_service,
list = resolve_handle_list;
while (list) {
+ //LCOV_EXCL_START
resolve_data = list->data;
list = list->next;
g_free(resolve_data);
}
+ //LCOV_EXCL_STOP
}
DNSServiceRefDeallocate(sd_ref);
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
if (service_type == NULL) {
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
if (service_name == NULL) {
}
if(local_handle->op_type == DNSSD_TYPE_FOUND) {
- dnssd_found_data_s *found = NULL;
- found = GET_FOUND_DATA_P(local_handle);
- *service_name = g_strdup(found->service_name);
+ dnssd_found_data_s *found = NULL; //LCOV_EXCL_LINE
+ found = GET_FOUND_DATA_P(local_handle); //LCOV_EXCL_LINE
+ *service_name = g_strdup(found->service_name); //LCOV_EXCL_LINE
} else if(local_handle->op_type == DNSSD_TYPE_REGISTER) {
dnssd_register_data_s *reg = NULL;
reg = GET_REG_DATA_P(local_handle);
*service_name = g_strdup(reg->service_name);
} else {
- *service_name = NULL;
+ *service_name = NULL;
DNSSD_LOGD("Invalid DNS SD service");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
return DNSSD_ERROR_NONE;
}
-
+//LCOV_EXCL_START
int dnssd_service_get_ip(dnssd_service_h dnssd_service, char **ip_v4_address,
char **ip_v6_address)
{
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_NONE;
}
+//LCOV_EXCL_STOP
int dnssd_service_get_port(dnssd_service_h dnssd_service, int *port)
{
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
if (port == NULL) {
}
if(local_handle->op_type == DNSSD_TYPE_FOUND) {
- dnssd_found_data_s *found = NULL;
- found = GET_FOUND_DATA_P(local_handle);
- *port = found->port;
+ dnssd_found_data_s *found = NULL; //LCOV_EXCL_LINE
+ found = GET_FOUND_DATA_P(local_handle); //LCOV_EXCL_LINE
+ *port = found->port; //LCOV_EXCL_LINE
} else if(local_handle->op_type == DNSSD_TYPE_REGISTER) {
dnssd_register_data_s *reg = NULL;
reg = GET_REG_DATA_P(local_handle);
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
if (__dnssd_is_init() == false) {
- DNSSD_LOGE("Not initialized");
- __DNSSD_LOG_FUNC_EXIT__;
- return DNSSD_ERROR_NOT_INITIALIZED;
+ DNSSD_LOGE("Not initialized"); //LCOV_EXCL_LINE
+ __DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return DNSSD_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
local_handle = __dnssd_check_handle_validity(dnssd_service);
if(local_handle->op_type == DNSSD_TYPE_FOUND) {
- dnssd_found_data_s *found = NULL;
- found = GET_FOUND_DATA_P(local_handle);
+ dnssd_found_data_s *found = NULL; //LCOV_EXCL_LINE
+ found = GET_FOUND_DATA_P(local_handle); //LCOV_EXCL_LINE
- *value = g_strdup(found->txt_record);
- *length = found->txt_len;
+ *value = g_strdup(found->txt_record); //LCOV_EXCL_LINE
+ *length = found->txt_len; //LCOV_EXCL_LINE
} else {
dnssd_register_data_s *reg = NULL;
/**
* free a local service
*/
+//LCOV_EXCL_START
static void __g_list_free_service(gpointer data, gpointer user_data)
{
ssdp_service_s *service = NULL;
service = (ssdp_service_s *)data;
if(service == NULL)
return;
- /* moon
- if(service->resource_group != NULL && service->resource_id != 0)
- gssdp_resource_group_remove_resource(service->resource_group, service->resource_id);
-
- if(service->resource_browser != NULL)
- g_object_unref (service->resource_browser);
- */
if(service->origin == SSDP_SERVICE_STATE_NOT_REGISTERED)
SSDP_LOGE("Free not registered service");
else if(service->origin == SSDP_SERVICE_STATE_REGISTERED)
g_free(service->url);
g_free(service);
}
+//LCOV_EXCL_STOP
/**
* free a remote service
*/
+//LCOV_EXCL_START
static void __g_hash_free_service(gpointer key, gpointer value,
gpointer user_data)
{
g_free(service->url);
g_free(service);
}
+//LCOV_EXCL_STOP
/**
* remove remove services found by request of a browser (browser_id is passed to by user_data)
*/
+//LCOV_EXCL_START
static void __g_hash_remove_related_services(gpointer key, gpointer value,
gpointer user_data)
{
g_free(service->url);
g_free(service);
}
+//LCOV_EXCL_STOP
static ssdp_service_s *__ssdp_find_local_service(GList *services,
unsigned int handler)
return service;
}
+//LCOV_EXCL_START
static void __g_hash_find_remote_service(gpointer key, gpointer value,
gpointer user_data)
{
return;
}
+//LCOV_EXCL_STOP
static ssdp_service_s *__ssdp_find_remote_service(GHashTable *services,
unsigned int handler)
return user_data.service;
}
+//LCOV_EXCL_START
static void
__ssdp_res_available_cb (GSSDPResourceBrowser *resource_browser,
const char *usn, GList *urls, gpointer user_data)
return;
}
+//LCOV_EXCL_STOP
+//LCOV_EXCL_START
static void
__ssdp_res_unavailable_cb (GSSDPResourceBrowser *resource_browser,
const char *usn, GList *urls, gpointer user_data)
__SSDP_LOG_FUNC_EXIT__;
return;
}
+//LCOV_EXCL_STOP
int ssdp_initialize()
{
if (gerror) {
SSDP_LOGE("Error creating the GSSDP client: %s\n",
gerror->message);
- g_error_free(gerror);
+ g_error_free(gerror); //LCOV_EXCL_LINE
__SSDP_LOG_FUNC_EXIT__;
return SSDP_ERROR_OPERATION_FAILED;
}
if (!g_is_gssdp_init) {
SSDP_LOGE("gssdp not initialized");
- return SSDP_ERROR_NOT_INITIALIZED;
+ return SSDP_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
if (ssdp_service == NULL) {
if (!service) {
SSDP_LOGE("Failed to get memory for gssdp service structure");
__SSDP_LOG_FUNC_EXIT__;
- return SSDP_ERROR_OUT_OF_MEMORY;
+ return SSDP_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
service->target = g_strndup(target, strlen(target));
if (!service->target) {
SSDP_LOGE("Failed to get memory for gssdp service type");
- g_free(service);
+ g_free(service); //LCOV_EXCL_LINE
__SSDP_LOG_FUNC_EXIT__;
- return SSDP_ERROR_OUT_OF_MEMORY;
+ return SSDP_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
*ssdp_service = (unsigned int)service & 0xFFFFFFFF;
if (!g_is_gssdp_init) {
SSDP_LOGE("gssdp not initialized");
- return SSDP_ERROR_NOT_INITIALIZED;
+ return SSDP_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
service = __ssdp_find_local_service(g_ssdp_local_services, ssdp_service);
return SSDP_ERROR_SERVICE_NOT_FOUND;
if (service->resource_group != NULL)
- service->resource_group = NULL;
+ service->resource_group = NULL; //LCOV_EXCL_LINE
if (service->resource_browser != NULL)
- g_object_unref(service->resource_browser);
+ g_object_unref(service->resource_browser); //LCOV_EXCL_LINE
g_ssdp_local_services = g_list_remove(g_ssdp_local_services, service);
g_free(service->target);
if (!g_is_gssdp_init) {
SSDP_LOGE("gssdp not initialized");
- return SSDP_ERROR_NOT_INITIALIZED;
+ return SSDP_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
service = __ssdp_find_local_service(g_ssdp_local_services, local_service);
if (!g_is_gssdp_init) {
SSDP_LOGE("gssdp not initialized");
- return SSDP_ERROR_NOT_INITIALIZED;
+ return SSDP_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
service = __ssdp_find_local_service(g_ssdp_local_services, local_service);
if (!g_is_gssdp_init) {
SSDP_LOGE("gssdp not initialized");
- return SSDP_ERROR_NOT_INITIALIZED;
+ return SSDP_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
service = __ssdp_find_local_service(g_ssdp_local_services, ssdp_service);
*target = g_strndup(service->target, strlen(service->target));
if (!target) {
SSDP_LOGE("Failed to get memory for gssdp service type");
- g_free(target);
+ g_free(target); //LCOV_EXCL_LINE
__SSDP_LOG_FUNC_EXIT__;
- return SSDP_ERROR_OUT_OF_MEMORY;
+ return SSDP_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
__SSDP_LOG_FUNC_EXIT__;
if (!g_is_gssdp_init) {
SSDP_LOGE("gssdp not initialized");
- return SSDP_ERROR_NOT_INITIALIZED;
+ return SSDP_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
service = __ssdp_find_local_service(g_ssdp_local_services, ssdp_service);
*usn = g_strndup(service->usn, strlen(service->usn));
if (!usn) {
SSDP_LOGE("Failed to get memory for gssdp service type");
- g_free(usn);
+ g_free(usn); //LCOV_EXCL_LINE
__SSDP_LOG_FUNC_EXIT__;
- return SSDP_ERROR_OUT_OF_MEMORY;
+ return SSDP_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
__SSDP_LOG_FUNC_EXIT__;
if (!g_is_gssdp_init) {
SSDP_LOGE("gssdp not initialized");
- return SSDP_ERROR_NOT_INITIALIZED;
+ return SSDP_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
service = __ssdp_find_local_service(g_ssdp_local_services, ssdp_service);
*url = g_strndup(service->url, strlen(service->url));
if (!url) {
SSDP_LOGE("Failed to get memory for gssdp service type");
- g_free(url);
+ g_free(url); //LCOV_EXCL_LINE
__SSDP_LOG_FUNC_EXIT__;
- return SSDP_ERROR_OUT_OF_MEMORY;
+ return SSDP_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
}
__SSDP_LOG_FUNC_EXIT__;
if (!g_is_gssdp_init) {
SSDP_LOGE("gssdp not initialized");
- return SSDP_ERROR_NOT_INITIALIZED;
+ return SSDP_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
service = __ssdp_find_local_service(g_ssdp_local_services, local_service);
if (!g_is_gssdp_init) {
SSDP_LOGE("gssdp not initialized");
- return SSDP_ERROR_NOT_INITIALIZED;
+ return SSDP_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
service = __ssdp_find_local_service(g_ssdp_local_services, local_service);
if (!g_is_gssdp_init) {
SSDP_LOGE("gssdp not initialized");
__SSDP_LOG_FUNC_EXIT__;
- return SSDP_ERROR_NOT_INITIALIZED;
+ return SSDP_ERROR_NOT_INITIALIZED; //LCOV_EXCL_LINE
}
if (ssdp_browser == NULL) {