int ret;
dnssd_handle_s *local_handle = NULL;
dnssd_register_data_s *reg;
- DNSServiceRef sd_ref;
- DNSRecordRef record_client;
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
}
reg = GET_REG_DATA_P(local_handle);
- sd_ref = local_handle->sd_ref;
- record_client = reg->record_ref;
DNSSD_LOGD("Record Type %d Record len %d", type, length);
- if (record_client == NULL) {
+ if (reg->record_ref == NULL) {
DNSSD_LOGD("Adding DNS Service Record");
- ret = DNSServiceAddRecord(sd_ref, &(reg->record_ref),
+ ret = DNSServiceAddRecord(local_handle->sd_ref, &(reg->record_ref),
local_handle->flags, type, length, data, 0);
} else {
DNSSD_LOGD("Updating DNS Service Record"); //LCOV_EXCL_LINE
- ret = DNSServiceUpdateRecord(sd_ref, record_client, //LCOV_EXCL_LINE
+ ret = DNSServiceUpdateRecord(local_handle->sd_ref, reg->record_ref, //LCOV_EXCL_LINE
local_handle->flags, length, data, 0); //LCOV_EXCL_LINE
}
int ret;
dnssd_handle_s *local_handle;
dnssd_register_data_s *reg;
- DNSServiceRef sd_ref;
- DNSRecordRef record_client;
int dnssd_err = 0;
uint32_t version = 0;
uint32_t size = sizeof(version);
}
reg = GET_REG_DATA_P(local_handle);
- sd_ref = local_handle->sd_ref;
- record_client = reg->record_ref;
- if (NULL == record_client) {
+ if (reg->record_ref == NULL) {
DNSSD_LOGE("Invalid DNS SD Client");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
else
DNSSD_LOGE("Daemon is not running");
- ret = DNSServiceRemoveRecord(sd_ref, record_client,
+ ret = DNSServiceRemoveRecord(local_handle->sd_ref, reg->record_ref,
local_handle->flags);
if (ret < 0) {
DNSSD_LOGE("Failed to Remove Record for DNS Service, error[%s]", //LCOV_EXCL_LINE
int ret;
dnssd_handle_s *local_handle = NULL;
dnssd_register_data_s *reg = NULL;
- DNSServiceRef *sd_ref;
void *data;
unsigned short length;
}
reg = GET_REG_DATA_P(local_handle);
- sd_ref = &(local_handle->sd_ref);
if (reg->service_name == NULL) {
DNSSD_LOGD("No Service Name Provided"); //LCOV_EXCL_LINE
dnssd_service_get_all_txt_record(local_service, &length, &data);
- ret = DNSServiceRegister(sd_ref, local_handle->flags,
+ ret = DNSServiceRegister(&(local_handle->sd_ref), local_handle->flags,
reg->if_index, reg->service_name,
local_handle->service_type, local_handle->domain,
NULL, htons((unsigned short int)reg->port),
__DNSSD_LOG_FUNC_ENTER__;
dnssd_handle_s *local_handle = NULL;
dnssd_register_data_s *reg;
- DNSServiceRef sd_ref;
- DNSRecordRef record_client;
int ret;
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
return DNSSD_ERROR_SERVICE_NOT_FOUND;
}
- sd_ref = local_handle->sd_ref;
- if (NULL == sd_ref) {
+ if (local_handle->sd_ref == NULL) {
DNSSD_LOGE("Invalid DNS SD Client");
__DNSSD_LOG_FUNC_EXIT__;
return DNSSD_ERROR_INVALID_PARAMETER;
}
reg = GET_REG_DATA_P(local_handle);
- record_client = reg->record_ref;
- if (record_client) {
- ret = DNSServiceRemoveRecord(sd_ref, record_client,
+ if (reg->record_ref) {
+ ret = DNSServiceRemoveRecord(local_handle->sd_ref, reg->record_ref,
local_handle->flags);
if (ret < 0) //LCOV_EXCL_LINE
DNSSD_LOGE("Failed to Remove Record for DNS Service, " //LCOV_EXCL_LINE
local_handle->watch_id = 0;
}
- DNSServiceRefDeallocate(sd_ref);
+ DNSServiceRefDeallocate(local_handle->sd_ref);
local_handle->sd_ref = NULL;
__DNSSD_LOG_FUNC_EXIT__;
unsigned short txt_len, int port)
{
int ret;
- DNSServiceRef *sd_ref;
dnssd_handle_s *local_handle = NULL;
dnssd_found_data_s *found = NULL;
char *name;
DNSSD_LOGD("g_slist length [%d]", g_slist_length(dnssd_handle_list));
- sd_ref = &(local_handle->sd_ref);
-
- ret = DNSServiceGetAddrInfo(sd_ref, flags, if_index,
+ ret = DNSServiceGetAddrInfo(&(local_handle->sd_ref), flags, if_index,
dns_protocol, host_name,
__dnssd_getaddrinfo_reply_cb, local_handle);
if (ret < 0) {
__DNSSD_LOG_FUNC_ENTER__;
int ret;
resolve_reply_data *data;
- DNSServiceRef *sd_ref;
data = g_try_malloc0(sizeof(resolve_reply_data));
if (data == NULL) {
resolve_handle_list = g_slist_prepend(resolve_handle_list, data);
- sd_ref = &(data->sd_ref);
-
- ret = DNSServiceResolve(sd_ref, flags, if_index, service_name,
+ ret = DNSServiceResolve(&(data->sd_ref), flags, if_index, service_name,
type, domain, __dnssd_resolve_reply_cb, data);
if (ret < 0) {
DNSSD_LOGE("Failed to Resolve DNS Service, error[%s]",
int ret;
dnssd_handle_s *local_handle;
dnssd_browse_data_s *browse;
- DNSServiceRef *sd_ref;
unsigned int handler;
CHECK_FEATURE_SUPPORTED(NETWORK_SERVICE_DISCOVERY_FEATURE);
local_handle->flags = 0;
local_handle->watch_id = 0;
browse = GET_BROWSE_DATA_P(local_handle);
- sd_ref = &(local_handle->sd_ref);
DNSSD_LOGD("New browse handle created [%p]->[%u] type %s", local_handle,
*dnssd_service, local_handle->service_type);
- ret = DNSServiceBrowse(sd_ref, local_handle->flags,
+ ret = DNSServiceBrowse(&(local_handle->sd_ref), local_handle->flags,
kDNSServiceInterfaceIndexAny, local_handle->service_type,
local_handle->domain, __dnssd_browse_reply_cb,
NULL);
int ret;
dnssd_handle_s *local_handle;
dnssd_browse_data_s *browse;
- DNSServiceRef *sd_ref;
unsigned int handler;
unsigned int if_index;
local_handle->flags = 0;
local_handle->watch_id = 0;
browse = GET_BROWSE_DATA_P(local_handle);
- sd_ref = &(local_handle->sd_ref);
DNSSD_LOGD("New browse handle created [%p]->[%u] type %s", local_handle,
*dnssd_service, local_handle->service_type);
- ret = DNSServiceBrowse(sd_ref, local_handle->flags,
+ ret = DNSServiceBrowse(&(local_handle->sd_ref), local_handle->flags,
if_index, local_handle->service_type,
local_handle->domain, __dnssd_browse_reply_cb,
NULL);
{
__DNSSD_LOG_FUNC_ENTER__;
dnssd_handle_s *local_handle;
- DNSServiceRef sd_ref;
GSList *list;
resolve_reply_data *resolve_data;
return DNSSD_ERROR_INVALID_PARAMETER;
}
- sd_ref = local_handle->sd_ref;
- if (NULL == sd_ref) {
+ if (local_handle->sd_ref == NULL) {
DNSSD_LOGE("Invalid DNS SD Client"); //LCOV_EXCL_LINE
__DNSSD_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
return DNSSD_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
if (local_handle->watch_id > 0)
g_source_remove(local_handle->watch_id);
- DNSServiceRefDeallocate(sd_ref);
- sd_ref = NULL;
+ DNSServiceRefDeallocate(local_handle->sd_ref);
+ local_handle->sd_ref = NULL;
DNSSD_LOGD("g_slist length [%d]", g_slist_length(dnssd_handle_list));
__DNSSD_LOG_FUNC_EXIT__;