• Home
  • Raw
  • Download

Lines Matching refs:sdr

117 typedef void (*ProcessReplyFn)(DNSServiceOp *const sdr, const CallbackHeader *const cbh, const char…
157 DNSServiceOp *sdr; member
432 DNSServiceOp *sdr; in ConnectToServer() local
463 sdr = malloc(sizeof(DNSServiceOp)); in ConnectToServer()
464 …if (!sdr) { syslog(LOG_WARNING, "dnssd_clientstub ConnectToServer: malloc failed"); *ref = NULL; r… in ConnectToServer()
465 sdr->next = NULL; in ConnectToServer()
466 sdr->primary = NULL; in ConnectToServer()
467 sdr->sockfd = dnssd_InvalidSocket; in ConnectToServer()
468 sdr->validator = sdr->sockfd ^ ValidatorBits; in ConnectToServer()
469 sdr->op = op; in ConnectToServer()
470 sdr->max_index = 0; in ConnectToServer()
471 sdr->logcounter = 0; in ConnectToServer()
472 sdr->moreptr = NULL; in ConnectToServer()
473 sdr->uid.u32[0] = 0; in ConnectToServer()
474 sdr->uid.u32[1] = 0; in ConnectToServer()
475 sdr->ProcessReply = ProcessReply; in ConnectToServer()
476 sdr->AppCallback = AppCallback; in ConnectToServer()
477 sdr->AppContext = AppContext; in ConnectToServer()
478 sdr->rec = NULL; in ConnectToServer()
480 sdr->disp_source = NULL; in ConnectToServer()
481 sdr->disp_queue = NULL; in ConnectToServer()
488 *p = sdr; in ConnectToServer()
491 sdr->primary = *ref; // Set our primary pointer in ConnectToServer()
492 sdr->sockfd = (*ref)->sockfd; // Inherit primary's socket in ConnectToServer()
493 sdr->validator = (*ref)->validator; in ConnectToServer()
494 sdr->uid = (*ref)->uid; in ConnectToServer()
503 sdr->sockfd = socket(AF_DNSSD, SOCK_STREAM, 0); in ConnectToServer()
504 sdr->validator = sdr->sockfd ^ ValidatorBits; in ConnectToServer()
505 if (!dnssd_SocketValid(sdr->sockfd)) in ConnectToServer()
508 FreeDNSServiceOp(sdr); in ConnectToServer()
513 if (setsockopt(sdr->sockfd, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval)) < 0) in ConnectToServer()
526 if (setsockopt(sdr->sockfd, SOL_SOCKET, SO_DEFUNCTOK, &defunct, sizeof(defunct)) < 0) in ConnectToServer()
534 int err = connect(sdr->sockfd, (struct sockaddr *) &saddr, sizeof(saddr)); in ConnectToServer()
542 … else { dnssd_close(sdr->sockfd); FreeDNSServiceOp(sdr); return kDNSServiceErr_ServiceNotRunning; } in ConnectToServer()
547 *ref = sdr; in ConnectToServer()
554 static DNSServiceErrorType deliver_request(ipc_msg_hdr *hdr, DNSServiceOp *sdr) in deliver_request() argument
568 if (sdr->primary || in deliver_request()
572 if (!DNSServiceRefValid(sdr)) in deliver_request()
574 …_clientstub deliver_request: invalid DNSServiceRef %p %08X %08X", sdr, sdr->sockfd, sdr->validator… in deliver_request()
648 …if (MakeSeparateReturnSocket || sdr->op == send_bpf) datalen--; // Okay to use sdr->op when check… in deliver_request()
660 if (write_all(sdr->sockfd, ((char *)hdr)+i, 1) < 0) in deliver_request()
665 if (write_all(sdr->sockfd, (char *)hdr, datalen + sizeof(ipc_msg_hdr)) < 0) in deliver_request()
671 sdr->sockfd, (unsigned long)(datalen + sizeof(ipc_msg_hdr))); in deliver_request()
676 if (!MakeSeparateReturnSocket) errsd = sdr->sockfd; in deliver_request()
677 …if (MakeSeparateReturnSocket || sdr->op == send_bpf) // Okay to use sdr->op when checking for op =… in deliver_request()
706 if (sdr->op == send_bpf) // Okay to use sdr->op when checking for op == send_bpf in deliver_request()
746 if (sendmsg(sdr->sockfd, &msg, 0) < 0) in deliver_request()
768 if (sdr->op == send_bpf) // Okay to use sdr->op when checking for op == send_bpf in deliver_request()
820 DNSServiceOp *sdr = sdRef; in CallbackWithError() local
826 while (sdr) in CallbackWithError()
829 sdrNext = sdr->next; in CallbackWithError()
831 sdr->moreptr = &morebytes; in CallbackWithError()
832 switch (sdr->op) in CallbackWithError()
835 …if (sdr->AppCallback)((DNSServiceResolveReply) sdr->AppCallback)(sdr, 0, 0, error, NULL, 0, 0, … in CallbackWithError()
838 …if (sdr->AppCallback)((DNSServiceQueryRecordReply)sdr->AppCallback)(sdr, 0, 0, error, NULL, 0, 0, … in CallbackWithError()
841 …if (sdr->AppCallback)((DNSServiceGetAddrInfoReply)sdr->AppCallback)(sdr, 0, 0, error, NULL, NULL, … in CallbackWithError()
844 …if (sdr->AppCallback)((DNSServiceBrowseReply) sdr->AppCallback)(sdr, 0, 0, error, NULL, 0, NUL… in CallbackWithError()
847 …if (sdr->AppCallback)((DNSServiceRegisterReply) sdr->AppCallback)(sdr, 0, error, NULL, 0, NUL… in CallbackWithError()
850 …if (sdr->AppCallback)((DNSServiceDomainEnumReply) sdr->AppCallback)(sdr, 0, 0, error, NULL, … in CallbackWithError()
853 …if (sdr->AppCallback)((DNSServiceSetHostReply) sdr->AppCallback)(sdr, 0, error, NULL, … in CallbackWithError()
857 rec = sdr->rec; in CallbackWithError()
861 …if (rec->AppCallback) ((DNSServiceRegisterRecordReply)rec->AppCallback)(sdr, 0, 0, error, rec->App… in CallbackWithError()
869 …if (sdr->AppCallback)((DNSServiceNATPortMappingReply)sdr->AppCallback)(sdr, 0, 0, error, 0, 0, 0, … in CallbackWithError()
872 syslog(LOG_WARNING, "dnssd_clientstub CallbackWithError called with bad op %d", sdr->op); in CallbackWithError()
878 sdr = sdrNext; in CallbackWithError()
1115 static void handle_resolve_response(DNSServiceOp *const sdr, const CallbackHeader *const cbh, const… in handle_resolve_response() argument
1133 …viceResolveReply)sdr->AppCallback)(sdr, cbh->cb_flags, cbh->cb_interface, cbh->cb_err, fullname, t… in handle_resolve_response()
1193 static void handle_query_response(DNSServiceOp *const sdr, const CallbackHeader *const cbh, const c… in handle_query_response() argument
1208 …ceQueryRecordReply)sdr->AppCallback)(sdr, cbh->cb_flags, cbh->cb_interface, cbh->cb_err, name, rrt… in handle_query_response()
1252 static void handle_addrinfo_response(DNSServiceOp *const sdr, const CallbackHeader *const cbh, cons… in handle_addrinfo_response() argument
1302 …((DNSServiceGetAddrInfoReply)sdr->AppCallback)(sdr, cbh->cb_flags, cbh->cb_interface, cbh->cb_err,… in handle_addrinfo_response()
1347 static void handle_browse_response(DNSServiceOp *const sdr, const CallbackHeader *const cbh, const … in handle_browse_response() argument
1354 …DNSServiceBrowseReply)sdr->AppCallback)(sdr, cbh->cb_flags, cbh->cb_interface, cbh->cb_err, replyN… in handle_browse_response()
1395 DNSServiceOp *const sdr, in handle_hostname_changed_response() argument
1404 else ((DNSHostnameChangedReply)sdr->AppCallback)( in handle_hostname_changed_response()
1405 sdr, cbh->cb_flags, cbh->cb_err, replyHostname, sdr->AppContext); in handle_hostname_changed_response()
1460 static void handle_regservice_response(DNSServiceOp *const sdr, const CallbackHeader *const cbh, co… in handle_regservice_response() argument
1467 …else ((DNSServiceRegisterReply)sdr->AppCallback)(sdr, cbh->cb_flags, cbh->cb_err, name, regtype, d… in handle_regservice_response()
1531 static void handle_enumeration_response(DNSServiceOp *const sdr, const CallbackHeader *const cbh, c… in handle_enumeration_response() argument
1536 …else ((DNSServiceDomainEnumReply)sdr->AppCallback)(sdr, cbh->cb_flags, cbh->cb_interface, cbh->cb_… in handle_enumeration_response()
1575 static void ConnectionResponse(DNSServiceOp *const sdr, const CallbackHeader *const cbh, const char… in ConnectionResponse() argument
1586 DNSServiceOp *op = sdr->next; in ConnectionResponse()
1596 if (sdr->op == connection_request) in ConnectionResponse()
1597 rref->AppCallback(rref->sdr, rref, cbh->cb_flags, cbh->cb_err, rref->AppContext); in ConnectionResponse()
1601 rref->AppCallback(rref->sdr, rref, 0, kDNSServiceErr_Unknown, rref->AppContext); in ConnectionResponse()
1686 rref->sdr = sdRef; in DNSServiceRegisterRecord()
1751 rref->sdr = sdRef; in DNSServiceAddRecord()
1883 static void handle_port_mapping_response(DNSServiceOp *const sdr, const CallbackHeader *const cbh, … in handle_port_mapping_response() argument
1905 …appingReply)sdr->AppCallback)(sdr, cbh->cb_flags, cbh->cb_interface, cbh->cb_err, addr.l, protocol… in handle_port_mapping_response()