Lines Matching refs:llq
723 optRD->u.llq = *data;
736 // LLQ server to send events to us directly at port 5353 on that address, instead of at our mapped external NAT port.
746 // Normally called with llq set.
747 // May be called with llq NULL, when retransmitting a lost Challenge Response
748 mDNSlocal void sendChallengeResponse(mDNS *const m, DNSQuestion *const q, const LLQOptData *llq)
759 LogMsg("sendChallengeResponse: %d failed attempts for LLQ %##s", kLLQ_MAX_TRIES, q->qname.c);
764 if (!llq) // Retransmission: need to make a new LLQOptData
771 llq = &llqBuf;
782 responsePtr = putLLQ(&m->omsg, responsePtr, q, llq);
791 mDNSlocal void SetLLQTimer(mDNS *const m, DNSQuestion *const q, const LLQOptData *const llq)
793 mDNSs32 lease = (mDNSs32)llq->llqlease * mDNSPlatformOneSecond;
794 q->ReqLease = llq
802 mDNSlocal void recvSetupResponse(mDNS *const m, mDNSu8 rcode, DNSQuestion *const q, const LLQOptData *const llq)
807 if (llq->llqOp != kLLQOp_Setup)
808 { LogMsg("ERROR: recvSetupResponse %##s (%s) - bad op %d", q->qname.c, DNSTypeName(q->qtype), llq->llqOp); return; }
810 if (llq->vers != kLLQ_Vers)
811 { LogMsg("ERROR: recvSetupResponse %##s (%s) - bad vers %d", q->qname.c, DNSTypeName(q->qtype), llq->vers); return; }
817 if (llq->err) { LogMsg("recvSetupResponse - received llq->err %d from server", llq->err); StartLLQPolling(m,q); return; }
819 if (q->ReqLease != llq->llqlease)
820 debugf("recvSetupResponse: requested lease %lu, granted lease %lu", q->ReqLease, llq->llqlease);
823 q->ReqLease = llq->llqlease;
824 q->expire = m->timenow + ((mDNSs32)llq->llqlease * mDNSPlatformOneSecond);
828 q->id = llq->id;
830 sendChallengeResponse(m, q, llq);
838 // problem of the current implementation of TCP LLQ setup: we're not handling state transitions correctly
842 LogInfo("Private LLQ_SecondaryRequest; copying id %08X%08X", llq->id.l[0], llq->id.l[1]);
843 q->id = llq->id;
846 if (llq->err) { LogMsg("ERROR: recvSetupResponse %##s (%s) code %d from server", q->qname.c, DNSTypeName(q->qtype), llq->err); StartLLQPolling(m,q); return; }
847 if (!mDNSSameOpaque64(&q->id, &llq->id))
851 SetLLQTimer(m, q, llq);
872 opt ? opt->u.llq.id.l[0] : 0, opt ? opt->u.llq.id.l[1] : 0, q->id.l[0], q->id.l[1], opt ? opt->u.llq.llqOp : 0);
897 q->ThisQInterval = LLQ_POLL_INTERVAL + mDNSRandom(LLQ_POLL_INTERVAL/10); // Retry LLQ setup in approx 15 minutes
903 // Note: In LLQ Event packets, the msg->h.id does not match our q->TargetQID, because in that case the msg->h.id nonce is selected by the server
904 else if (opt && q->state == LLQ_Established && opt->u.llq.llqOp == kLLQOp_Event && mDNSSameOpaque64(&opt->u.llq.id, &q->id))
907 //debugf("Sending LLQ ack for %##s (%s)", q->qname.c, DNSTypeName(q->qtype));
909 ackEnd = putLLQ(&m->omsg, m->omsg.data, q, &opt->u.llq);
918 if (q->state == LLQ_Established && opt->u.llq.llqOp == kLLQOp_Refresh && mDNSSameOpaque64(&opt->u.llq.id, &q->id) && msg->h.numAdditionals && !msg->h.numAnswers)
920 if (opt->u.llq.err != LLQErr_NoError) LogMsg("recvRefreshReply: received error %d from server", opt->u.llq.err);
924 // If we're waiting to go to sleep, then this LLQ deletion may have been the thing
926 if (opt->u.llq.llqlease == 0 && m->SleepLimit) m->NextScheduledSPRetry = m->timenow;
927 GrantCacheExtensions(m, q, opt->u.llq.llqlease);
928 SetLLQTimer(m, q, &opt->u.llq);
938 recvSetupResponse(m, msg->h.flags.b[1] & kDNSFlag1_RC_Mask, q, &opt->u.llq);
940 // We have a protocol anomaly here in the LLQ definition.
941 // Both the challenge packet from the server and the ack+answers packet have opt->u.llq.llqOp == kLLQOp_Setup.
1005 LLQOptData llqData; // set llq rdata
1020 // LLQ Polling mode or non-LLQ uDNS over TCP
1167 // We get here when we fail to establish a new TCP/TLS connection that would have been used for a new LLQ request or an LLQ renewal.
1168 // Note that ThisQInterval is also zero when sendChallengeResponse resends the LLQ request on an extant TCP/TLS connection.
1188 LogMsg("tcpCallback: stream connection for LLQ %##s (%s) failed %d times, retrying in %d ms", q->qname.c, DNSTypeName(q->qtype), q->ntries, q->ThisQInterval);
1214 // ConnFailed may happen if the server sends a TCP reset or TLS fails, in which case we want to retry establishing the LLQ
1216 // If the error isn't ConnFailed, then the LLQ is in bad shape, so we switch to polling mode.
1347 q->state = LLQ_SecondaryRequest; // Right now, for private DNS, we skip the four-way LLQ handshake
1363 LogMsg("startLLQHandshake: %d failed attempts for LLQ %##s Polling.", kLLQ_MAX_TRIES, q->qname.c);
1371 // set llq rdata
1446 mDNSlocal const domainname *PUBLIC_LLQ_SERVICE_TYPE = (const domainname*)"\x08_dns-llq" "\x04_udp";
1450 mDNSlocal const domainname *PRIVATE_LLQ_SERVICE_TYPE = (const domainname*)"\x0C_dns-llq-tls" "\x04_tcp";
3577 LLQOptData llq;
3583 LogMsg("Unable to refresh LLQ %##s (%s) - will retry in %d seconds", q->qname.c, DNSTypeName(q->qtype), LLQ_POLL_INTERVAL / mDNSPlatformOneSecond);
3588 llq.vers = kLLQ_Vers;
3589 llq.llqOp = kLLQOp_Refresh;
3590 llq.err = q->tcp ? GetLLQEventPort(m, &q->servAddr) : LLQErr_NoError; // If using TCP tell server what UDP port to send notifications to
3591 llq.id = q->id;
3592 llq.llqlease = q->ReqLease;
3595 end = putLLQ(&m->omsg, m->omsg.data, q, &llq);