• Home
  • Raw
  • Download

Lines Matching refs:sdRef

372 static void FreeDNSRecords(DNSServiceOp *sdRef)  in FreeDNSRecords()  argument
374 DNSRecord *rec = sdRef->rec; in FreeDNSRecords()
790 int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdRef) in DNSServiceRefSockFD() argument
792 …if (!sdRef) { syslog(LOG_WARNING, "dnssd_clientstub DNSServiceRefSockFD called with NULL DNSServic… in DNSServiceRefSockFD()
794 if (!DNSServiceRefValid(sdRef)) in DNSServiceRefSockFD()
797 sdRef, sdRef->sockfd, sdRef->validator); in DNSServiceRefSockFD()
801 if (sdRef->primary) in DNSServiceRefSockFD()
803 …rviceRefSockFD undefined for kDNSServiceFlagsShareConnection subordinate DNSServiceRef %p", sdRef); in DNSServiceRefSockFD()
807 return (int) sdRef->sockfd; in DNSServiceRefSockFD()
811 static void CallbackWithError(DNSServiceRef sdRef, DNSServiceErrorType error) in CallbackWithError() argument
813 DNSServiceOp *sdr = sdRef; in CallbackWithError()
878 DNSServiceErrorType DNSSD_API DNSServiceProcessResult(DNSServiceRef sdRef) in DNSServiceProcessResult() argument
882 …if (!sdRef) { syslog(LOG_WARNING, "dnssd_clientstub DNSServiceProcessResult called with NULL DNSSe… in DNSServiceProcessResult()
884 if (!DNSServiceRefValid(sdRef)) in DNSServiceProcessResult()
886 …ProcessResult called with invalid DNSServiceRef %p %08X %08X", sdRef, sdRef->sockfd, sdRef->valida… in DNSServiceProcessResult()
890 if (sdRef->primary) in DNSServiceProcessResult()
892 …eProcessResult undefined for kDNSServiceFlagsShareConnection subordinate DNSServiceRef %p", sdRef); in DNSServiceProcessResult()
896 if (!sdRef->ProcessReply) in DNSServiceProcessResult()
913 int result = read_all(sdRef->sockfd, (void *)&cbh.ipc_hdr, sizeof(cbh.ipc_hdr)); in DNSServiceProcessResult()
918 sdRef->ProcessReply = NULL; in DNSServiceProcessResult()
923 if (sdRef->disp_source) in DNSServiceProcessResult()
925 dispatch_source_cancel(sdRef->disp_source); in DNSServiceProcessResult()
926 dispatch_release(sdRef->disp_source); in DNSServiceProcessResult()
927 sdRef->disp_source = NULL; in DNSServiceProcessResult()
928 CallbackWithError(sdRef, kDNSServiceErr_ServiceNotRunning); in DNSServiceProcessResult()
936 if (morebytes && sdRef->logcounter < 100) in DNSServiceProcessResult()
938 sdRef->logcounter++; in DNSServiceProcessResult()
948 sdRef->ProcessReply = NULL; in DNSServiceProcessResult()
954 …if (read_all(sdRef->sockfd, data, cbh.ipc_hdr.datalen) < 0) // On error, read_all will write a mes… in DNSServiceProcessResult()
958 sdRef->ProcessReply = NULL; in DNSServiceProcessResult()
963 if (sdRef->disp_source) in DNSServiceProcessResult()
965 dispatch_source_cancel(sdRef->disp_source); in DNSServiceProcessResult()
966 dispatch_release(sdRef->disp_source); in DNSServiceProcessResult()
967 sdRef->disp_source = NULL; in DNSServiceProcessResult()
968 CallbackWithError(sdRef, kDNSServiceErr_ServiceNotRunning); in DNSServiceProcessResult()
985 morebytes = more_bytes(sdRef->sockfd); in DNSServiceProcessResult()
989 sdRef->moreptr = &morebytes; in DNSServiceProcessResult()
991 if (ptr) sdRef->ProcessReply(sdRef, &cbh, ptr, data + cbh.ipc_hdr.datalen); in DNSServiceProcessResult()
1000 if (morebytes) sdRef->moreptr = NULL; in DNSServiceProcessResult()
1008 void DNSSD_API DNSServiceRefDeallocate(DNSServiceRef sdRef) in DNSServiceRefDeallocate() argument
1010 …if (!sdRef) { syslog(LOG_WARNING, "dnssd_clientstub DNSServiceRefDeallocate called with NULL DNSSe… in DNSServiceRefDeallocate()
1012 if (!DNSServiceRefValid(sdRef)) // Also verifies dnssd_SocketValid(sdRef->sockfd) for us too in DNSServiceRefDeallocate()
1014 …RefDeallocate called with invalid DNSServiceRef %p %08X %08X", sdRef, sdRef->sockfd, sdRef->valida… in DNSServiceRefDeallocate()
1019 if (sdRef->moreptr) *(sdRef->moreptr) = 0; in DNSServiceRefDeallocate()
1021 if (sdRef->primary) // If this is a subordinate DNSServiceOp, just send a 'stop' command in DNSServiceRefDeallocate()
1023 DNSServiceOp **p = &sdRef->primary->next; in DNSServiceRefDeallocate()
1024 while (*p && *p != sdRef) p = &(*p)->next; in DNSServiceRefDeallocate()
1029 ipc_msg_hdr *hdr = create_hdr(cancel_request, &len, &ptr, 0, sdRef); in DNSServiceRefDeallocate()
1033 write_all(sdRef->sockfd, (char *)hdr, len); in DNSServiceRefDeallocate()
1036 *p = sdRef->next; in DNSServiceRefDeallocate()
1037 FreeDNSServiceOp(sdRef); in DNSServiceRefDeallocate()
1044 if (sdRef->disp_source) in DNSServiceRefDeallocate()
1053 sdRef->ProcessReply = NULL; in DNSServiceRefDeallocate()
1054 dispatch_source_cancel(sdRef->disp_source); in DNSServiceRefDeallocate()
1055 dispatch_release(sdRef->disp_source); in DNSServiceRefDeallocate()
1056 sdRef->disp_source = NULL; in DNSServiceRefDeallocate()
1061 else if (!sdRef->disp_queue) dnssd_close(sdRef->sockfd); in DNSServiceRefDeallocate()
1063 dnssd_close(sdRef->sockfd); in DNSServiceRefDeallocate()
1067 while (sdRef) in DNSServiceRefDeallocate()
1069 DNSServiceOp *p = sdRef; in DNSServiceRefDeallocate()
1070 sdRef = sdRef->next; in DNSServiceRefDeallocate()
1135 DNSServiceRef *sdRef, in DNSServiceResolve() argument
1162 err = ConnectToServer(sdRef, flags, resolve_request, handle_resolve_response, callBack, context); in DNSServiceResolve()
1172 hdr = create_hdr(resolve_request, &len, &ptr, (*sdRef)->primary ? 1 : 0, *sdRef); in DNSServiceResolve()
1173 if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; } in DNSServiceResolve()
1181 err = deliver_request(hdr, *sdRef); // Will free hdr for us in DNSServiceResolve()
1182 if (err) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; } in DNSServiceResolve()
1207 DNSServiceRef *sdRef, in DNSServiceQueryRecord() argument
1220 …DNSServiceErrorType err = ConnectToServer(sdRef, flags, query_request, handle_query_response, call… in DNSServiceQueryRecord()
1231 hdr = create_hdr(query_request, &len, &ptr, (*sdRef)->primary ? 1 : 0, *sdRef); in DNSServiceQueryRecord()
1232 if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; } in DNSServiceQueryRecord()
1240 err = deliver_request(hdr, *sdRef); // Will free hdr for us in DNSServiceQueryRecord()
1241 if (err) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; } in DNSServiceQueryRecord()
1302 DNSServiceRef *sdRef, in DNSServiceGetAddrInfo() argument
1318 err = ConnectToServer(sdRef, flags, addrinfo_request, handle_addrinfo_response, callBack, context); in DNSServiceGetAddrInfo()
1327 hdr = create_hdr(addrinfo_request, &len, &ptr, (*sdRef)->primary ? 1 : 0, *sdRef); in DNSServiceGetAddrInfo()
1328 if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; } in DNSServiceGetAddrInfo()
1335 err = deliver_request(hdr, *sdRef); // Will free hdr for us in DNSServiceGetAddrInfo()
1336 if (err) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; } in DNSServiceGetAddrInfo()
1353 DNSServiceRef *sdRef, in DNSServiceBrowse() argument
1365 …DNSServiceErrorType err = ConnectToServer(sdRef, flags, browse_request, handle_browse_response, ca… in DNSServiceBrowse()
1374 hdr = create_hdr(browse_request, &len, &ptr, (*sdRef)->primary ? 1 : 0, *sdRef); in DNSServiceBrowse()
1375 if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; } in DNSServiceBrowse()
1382 err = deliver_request(hdr, *sdRef); // Will free hdr for us in DNSServiceBrowse()
1383 if (err) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; } in DNSServiceBrowse()
1403 DNSServiceRef *sdRef, in DNSSetHostname() argument
1413 DNSServiceErrorType err = ConnectToServer(sdRef, flags, sethost_request, in DNSSetHostname()
1419 (*sdRef)->primary ? 1 : 0, *sdRef); in DNSSetHostname()
1422 DNSServiceRefDeallocate(*sdRef); in DNSSetHostname()
1423 *sdRef = NULL; in DNSSetHostname()
1428 err = deliver_request(hdr, *sdRef); in DNSSetHostname()
1429 if (err) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; } in DNSSetHostname()
1466 DNSServiceRef *sdRef, in DNSServiceRegister() argument
1495 …err = ConnectToServer(sdRef, flags, reg_service_request, callBack ? handle_regservice_response : N… in DNSServiceRegister()
1504 hdr = create_hdr(reg_service_request, &len, &ptr, (*sdRef)->primary ? 1 : 0, *sdRef); in DNSServiceRegister()
1505 if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; } in DNSServiceRegister()
1519 err = deliver_request(hdr, *sdRef); // Will free hdr for us in DNSServiceRegister()
1520 if (err) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; } in DNSServiceRegister()
1535 DNSServiceRef *sdRef, in DNSServiceEnumerateDomains() argument
1551 …err = ConnectToServer(sdRef, flags, enumeration_request, handle_enumeration_response, callBack, co… in DNSServiceEnumerateDomains()
1557 hdr = create_hdr(enumeration_request, &len, &ptr, (*sdRef)->primary ? 1 : 0, *sdRef); in DNSServiceEnumerateDomains()
1558 if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; } in DNSServiceEnumerateDomains()
1563 err = deliver_request(hdr, *sdRef); // Will free hdr for us in DNSServiceEnumerateDomains()
1564 if (err) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; } in DNSServiceEnumerateDomains()
1599 DNSServiceErrorType DNSSD_API DNSServiceCreateConnection(DNSServiceRef *sdRef) in DNSServiceCreateConnection() argument
1604 …DNSServiceErrorType err = ConnectToServer(sdRef, 0, connection_request, ConnectionResponse, NULL, … in DNSServiceCreateConnection()
1607 hdr = create_hdr(connection_request, &len, &ptr, 0, *sdRef); in DNSServiceCreateConnection()
1608 if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; } in DNSServiceCreateConnection()
1610 err = deliver_request(hdr, *sdRef); // Will free hdr for us in DNSServiceCreateConnection()
1611 if (err) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; } in DNSServiceCreateConnection()
1617 DNSServiceRef sdRef, in DNSServiceRegisterRecord() argument
1640 …if (!sdRef) { syslog(LOG_WARNING, "dnssd_clientstub DNSServiceRegisterRecord called with NULL DNSS… in DNSServiceRegisterRecord()
1642 if (!DNSServiceRefValid(sdRef)) in DNSServiceRegisterRecord()
1644 …egisterRecord called with invalid DNSServiceRef %p %08X %08X", sdRef, sdRef->sockfd, sdRef->valida… in DNSServiceRegisterRecord()
1648 if (sdRef->op != connection_request) in DNSServiceRegisterRecord()
1650 …eRegisterRecord called with non-DNSServiceCreateConnection DNSServiceRef %p %d", sdRef, sdRef->op); in DNSServiceRegisterRecord()
1662 hdr = create_hdr(reg_record_request, &len, &ptr, 1, sdRef); in DNSServiceRegisterRecord()
1678 rref->record_index = sdRef->max_index++; in DNSServiceRegisterRecord()
1679 rref->sdr = sdRef; in DNSServiceRegisterRecord()
1685 p = &(sdRef)->rec; in DNSServiceRegisterRecord()
1689 return deliver_request(hdr, sdRef); // Will free hdr for us in DNSServiceRegisterRecord()
1695 DNSServiceRef sdRef, in DNSServiceAddRecord() argument
1710 …if (!sdRef) { syslog(LOG_WARNING, "dnssd_clientstub DNSServiceAddRecord called with NULL DNSSe… in DNSServiceAddRecord()
1712 if (sdRef->op != reg_service_request) in DNSServiceAddRecord()
1714 …tub DNSServiceAddRecord called with non-DNSServiceRegister DNSServiceRef %p %d", sdRef, sdRef->op); in DNSServiceAddRecord()
1718 if (!DNSServiceRefValid(sdRef)) in DNSServiceAddRecord()
1720 …viceAddRecord called with invalid DNSServiceRef %p %08X %08X", sdRef, sdRef->sockfd, sdRef->valida… in DNSServiceAddRecord()
1731 hdr = create_hdr(add_record_request, &len, &ptr, 1, sdRef); in DNSServiceAddRecord()
1743 rref->record_index = sdRef->max_index++; in DNSServiceAddRecord()
1744 rref->sdr = sdRef; in DNSServiceAddRecord()
1749 p = &(sdRef)->rec; in DNSServiceAddRecord()
1753 return deliver_request(hdr, sdRef); // Will free hdr for us in DNSServiceAddRecord()
1759 DNSServiceRef sdRef, in DNSServiceUpdateRecord() argument
1771 …if (!sdRef) { syslog(LOG_WARNING, "dnssd_clientstub DNSServiceUpdateRecord called with NULL DNSSer… in DNSServiceUpdateRecord()
1773 if (!DNSServiceRefValid(sdRef)) in DNSServiceUpdateRecord()
1775 …eUpdateRecord called with invalid DNSServiceRef %p %08X %08X", sdRef, sdRef->sockfd, sdRef->valida… in DNSServiceUpdateRecord()
1786 hdr = create_hdr(update_record_request, &len, &ptr, 1, sdRef); in DNSServiceUpdateRecord()
1793 return deliver_request(hdr, sdRef); // Will free hdr for us in DNSServiceUpdateRecord()
1798 DNSServiceRef sdRef, in DNSServiceRemoveRecord() argument
1808 …if (!sdRef) { syslog(LOG_WARNING, "dnssd_clientstub DNSServiceRemoveRecord called with … in DNSServiceRemoveRecord()
1810 …if (!sdRef->max_index) { syslog(LOG_WARNING, "dnssd_clientstub DNSServiceRemoveRecord called with … in DNSServiceRemoveRecord()
1812 if (!DNSServiceRefValid(sdRef)) in DNSServiceRemoveRecord()
1814 …eRemoveRecord called with invalid DNSServiceRef %p %08X %08X", sdRef, sdRef->sockfd, sdRef->valida… in DNSServiceRemoveRecord()
1819 hdr = create_hdr(remove_record_request, &len, &ptr, 1, sdRef); in DNSServiceRemoveRecord()
1823 err = deliver_request(hdr, sdRef); // Will free hdr for us in DNSServiceRemoveRecord()
1828 DNSRecord **p = &sdRef->rec; in DNSServiceRemoveRecord()
1908 DNSServiceRef *sdRef, in DNSServiceNATPortMappingCreate() argument
1925 …DNSServiceErrorType err = ConnectToServer(sdRef, flags, port_mapping_request, handle_port_mapping_… in DNSServiceNATPortMappingCreate()
1935 hdr = create_hdr(port_mapping_request, &len, &ptr, (*sdRef)->primary ? 1 : 0, *sdRef); in DNSServiceNATPortMappingCreate()
1936 if (!hdr) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; return kDNSServiceErr_NoMemory; } in DNSServiceNATPortMappingCreate()
1947 err = deliver_request(hdr, *sdRef); // Will free hdr for us in DNSServiceNATPortMappingCreate()
1948 if (err) { DNSServiceRefDeallocate(*sdRef); *sdRef = NULL; } in DNSServiceNATPortMappingCreate()