Home
last modified time | relevance | path

Searched refs:answers (Results 1 – 25 of 46) sorted by relevance

12

/packages/modules/Connectivity/staticlibs/testutils/devicetests/com/android/testutils/
DFakeDns.kt39 val answers = ArrayList<DnsEntry>() in match() constant in com.android.testutils.FakeDns
41 fun getAnswer(hostname: String, type: Int): DnsEntry? = synchronized(answers) { in match()
42 return answers.firstOrNull { it.match(hostname, type) } in match()
45 fun setAnswer(hostname: String, answer: Array<String>, type: Int) = synchronized(answers) { in <lambda>()
48 when (val index = answers.indexOfFirst { it.match(hostname, type) }) { in <lambda>()
49 -1 -> answers.add(ans) in <lambda>()
50 else -> answers[index] = ans in <lambda>()
91 fun clearAll() = synchronized(answers) { in <lambda>()
92 answers.clear() in <lambda>()
/packages/modules/Connectivity/tests/unit/java/com/android/server/connectivity/mdns/
DMdnsReplySenderTest.kt70 private val answers = listOf( constant in com.android.server.connectivity.mdns.MdnsReplySenderTest
158 answers, in createSender()
191 assertEquals(mdnsPacket.answers.toSet(), remainingAnswers.toSet()) in verifyReplySent()
197 val reply = MdnsReplyInfo(answers, additionalAnswers, 20L /* sendDelayMs */, in testQueueReply()
200 verifyReplySent(handler, message, answers) in testQueueReply()
206 val reply = MdnsReplyInfo(answers, additionalAnswers, 20L /* sendDelayMs */, in testQueueReply_KnownAnswerSuppressionEnabled()
209 verifyReplySent(handler, message, answers) in testQueueReply_KnownAnswerSuppressionEnabled()
215 val reply = MdnsReplyInfo(answers, additionalAnswers, 400L /* sendDelayMs */, in testQueueReply_MultiplePacket()
221 IPV4_SOCKET_ADDR, source, answers) in testQueueReply_MultiplePacket()
229 val reply = MdnsReplyInfo(answers, additionalAnswers, 400L /* sendDelayMs */, in testQueueReply_MultiplePacket_LostSubsequentPacket()
[all …]
DMdnsInterfaceAdvertiserTest.kt327 assertEquals(0, it.answers.size) in testReplyToQuery()
349 argThat { pkg -> pkg.questions.size != 0 && pkg.answers.size == 0 && in testReplyToQuery_TruncatedBitSet()
353 argThat { pkg -> pkg.questions.size == 0 && pkg.answers.size != 0 && in testReplyToQuery_TruncatedBitSet()
357 argThat { pkg -> pkg.questions.size == 0 && pkg.answers.size != 0 && in testReplyToQuery_TruncatedBitSet()
377 assertEquals(0, it.answers.size) in testReplyToQuery_TruncatedBitSet()
405 assertEquals(1, it.answers.size) in testReplyToQuery_TruncatedBitSet()
409 assertTrue(it.answers[0] is MdnsPointerRecord) in testReplyToQuery_TruncatedBitSet()
410 assertContentEquals(arrayOf("_testtype", "_tcp", "local"), it.answers[0].name) in testReplyToQuery_TruncatedBitSet()
433 assertEquals(1, it.answers.size) in testReplyToQuery_TruncatedBitSet()
437 assertTrue(it.answers[0] is MdnsPointerRecord) in testReplyToQuery_TruncatedBitSet()
[all …]
DMdnsRecordRepositoryTest.kt199 assertEquals(0, packet.answers.size) in makeFlags()
260 ), reply.answers) in testAddAndUpdates()
313 ), packet.answers) in testExitAnnouncements()
337 assertThat(packet.answers).containsExactly( in testExitAnnouncements_WithSubtypes()
397 assertThat(packet.answers).containsExactly( in testOnProbingSucceeded()
558 ), offloadPacket.answers) in testGetOffloadPacket()
582 assertEquals(1, replyCaseInsensitive.answers.size) in testGetReplyCaseInsensitive()
620 reply.answers) in testGetReply_singlePtrQuestion_returnsSrvTxtAddressNsecRecords()
654 reply.answers) in testGetReply_ptrQuestionForServiceWithCustomHost_customHostUsedInAdditionalAnswers()
701 reply.answers) in testGetReply_ptrQuestionForServicesWithSameCustomHost_customHostUsedInAdditionalAnswers()
[all …]
DMdnsServiceTypeClientTests.java1232 assertEquals(0, srvTxtQueryPacket.answers.size()); in testProcessResponse_Resolve()
1273 assertEquals(0, addressQueryPacket.answers.size()); in testProcessResponse_Resolve()
1510 packetWithoutSubtype.answers, r -> r instanceof MdnsPointerRecord); in testProcessResponse_SubtypeDiscoveryLimitedToSubtype()
1513 final ArrayList<MdnsRecord> newAnswers = new ArrayList<>(packetWithoutSubtype.answers); in testProcessResponse_SubtypeDiscoveryLimitedToSubtype()
1593 packetWithoutSubtype.answers, r -> r instanceof MdnsPointerRecord); in testProcessResponse_SubtypeChange()
1596 final ArrayList<MdnsRecord> newAnswers = new ArrayList<>(packetWithoutSubtype.answers); in testProcessResponse_SubtypeChange()
1968 packetWithoutSubtype.answers, r -> r instanceof MdnsPointerRecord); in testSendQueryWithKnownAnswers()
1971 final ArrayList<MdnsRecord> newAnswers = new ArrayList<>(packetWithoutSubtype.answers); in testSendQueryWithKnownAnswers()
2035 packetWithoutSubtype.answers, r -> r instanceof MdnsPointerRecord); in testSendQueryWithSubTypeWithKnownAnswers()
2038 final ArrayList<MdnsRecord> newAnswers = new ArrayList<>(packetWithoutSubtype.answers); in testSendQueryWithSubTypeWithKnownAnswers()
[all …]
DMdnsPacketTest.kt50 assertEquals(0, packet.answers.size) in makeFlags()
/packages/modules/Connectivity/service-t/src/com/android/server/connectivity/mdns/
DMdnsReplySender.java152 final ArraySet<MdnsRecord> answers = new ArraySet<>(); in queueReply() local
156 answers.addAll(queuingReply.answers); in queueReply()
160 answers.addAll(reply.answers); in queueReply()
168 final int idx = answers.indexOf(knownAnswer); in queueReply()
169 if (idx >= 0 && knownAnswer.getTtl() > answers.valueAt(idx).getTtl() / 2) { in queueReply()
170 answers.removeAt(idx); in queueReply()
174 if (answers.size() == 0) { in queueReply()
179 new ArrayList<>(answers), in queueReply()
253 replyInfo.answers, in handleMessage()
DMdnsReplyInfo.java29 public final List<MdnsRecord> answers; field in MdnsReplyInfo
41 @NonNull List<MdnsRecord> answers, in MdnsReplyInfo()
47 this.answers = answers; in MdnsReplyInfo()
58 + ", answers: " + answers.size() in toString()
DMdnsPacket.java39 public final List<MdnsRecord> answers; field in MdnsPacket
47 @NonNull List<MdnsRecord> answers, in MdnsPacket() argument
50 this(0, flags, questions, answers, authorityRecords, additionalRecords); in MdnsPacket()
55 @NonNull List<MdnsRecord> answers, in MdnsPacket() argument
61 this.answers = Collections.unmodifiableList(answers); in MdnsPacket()
109 final ArrayList<MdnsRecord> answers = parseRecords(reader, numAnswers, false); in parseRecordsSection() local
113 return new MdnsPacket(transactionId, flags, questions, answers, authority, additional); in parseRecordsSection()
DMdnsRecordRepository.java642 return packet.questions.size() == 0 && packet.answers.size() != 0; in isTruncatedKnownAnswerPacket()
684 answerInfo, additionalAnswerInfo, packet.answers, isQuestionOnIpv4)) { in getReply()
787 new ArrayList<>(packet.answers)); in getReply()
940 for (Iterator<RecordInfo<?>> answers : answerRecords) { in addNsecRecordsForUniqueNames()
941 addNonSharedRecordsToMap(answers, nsecByName, namesInAddedOrder); in addNsecRecordsForUniqueNames()
1135 final ArrayList<MdnsRecord> answers = new ArrayList<>(); in getOffloadPacket() local
1139 answers.add(ptrRecord.record); in getOffloadPacket()
1142 answers.add(registration.srvRecord.record); in getOffloadPacket()
1145 answers.add(registration.txtRecord.record); in getOffloadPacket()
1150 answers.add(record.record); in getOffloadPacket()
[all …]
DMdnsResponseDecoder.java101 if (mdnsPacket.answers.size() < 1) { in parseResponse()
133 mdnsPacket.questions.size() + mdnsPacket.answers.size() in augmentResponses()
135 records.addAll(mdnsPacket.answers); in augmentResponses()
DMdnsInterfaceAdvertiser.java421 + packet.answers.size() + " answers, " in handlePacket()
442 final MdnsReplyInfo answers = mRecordRepository.getReply(packet, srcCopy); in handlePacket() local
444 if (answers == null) return; in handlePacket()
445 mReplySender.queueReply(answers); in handlePacket()
/packages/modules/Connectivity/tests/unit/java/com/android/server/connectivity/mdns/util/
DMdnsUtilsTest.kt176 assertContentEquals(query.answers, mdnsPacket.answers) in <lambda>()
184 val answers = mutableListOf<MdnsRecord>() in <lambda>() constant
192 answers.addAll(mdnsPacket.answers) in <lambda>()
194 return MdnsPacket(flags, questions, answers, emptyList(), emptyList()) in <lambda>()
/packages/modules/Connectivity/tests/cts/net/native/dns/
DNativeDnsAsyncTest.cpp65 std::vector<std::string> answers; in extractIpAddressAnswers() local
73 answers.push_back(buffer); in extractIpAddressAnswers()
76 return answers; in extractIpAddressAnswers()
87 auto answers = extractIpAddressAnswers(buf, res, ipType); in expectAnswersValid() local
88 EXPECT_GE(answers.size(), 0U); in expectAnswersValid()
89 for (auto &answer : answers) { in expectAnswersValid()
/packages/modules/Connectivity/service-t/src/com/android/server/connectivity/mdns/util/
DMdnsUtils.java204 writer.writeUInt16(packet.answers.size()); // answers count in writeMdnsPacket()
212 for (MdnsRecord record : packet.answers) { in writeMdnsPacket()
272 for (MdnsRecord record : packet.answers) { in writePossibleMdnsPacket()
292 packet.answers.subList( in writePossibleMdnsPacket()
293 writtenAnswers, packet.answers.size()), in writePossibleMdnsPacket()
/packages/modules/DnsResolver/tests/dns_responder/
Ddns_responder.cpp372 answers.resize(ancount); in read()
374 cur = answers[i].read(cur, buffer_end); in read()
421 header.ancount = htons(answers.size()); in write()
429 for (const DNSRecord& answer : answers) { in write()
756 if (!header.answers.empty()) { in handleDNSRequest()
757 LOG(INFO) << "already " << header.answers.size() << " answers present in query"; in handleDNSRequest()
801 std::vector<DNSRecord>* answers) const { in addAnswerRecords()
831 answers->push_back(std::move(record)); in addAnswerRecords()
837 if (answers->size() == 0) { in addAnswerRecords()
909 header->answers.clear(); in makeErrorResponse()
[all …]
Ddns_responder.h96 std::vector<DNSRecord> answers; member
259 bool addAnswerRecords(const DNSQuestion& question, std::vector<DNSRecord>* answers) const;
/packages/modules/Connectivity/framework/src/android/net/util/
DDnsUtils.java141 @NonNull List<InetAddress> answers) { in rfc6724Sort() argument
143 for (InetAddress addr : answers) { in rfc6724Sort()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/adselection/
DDebugReportSenderWorkerTest.java48 import org.mockito.internal.stubbing.answers.AnswersWithDelay;
49 import org.mockito.internal.stubbing.answers.Returns;
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/encryptionkey/
DEncryptionKeyJobServiceTest.java59 import org.mockito.internal.stubbing.answers.AnswersWithDelay;
60 import org.mockito.internal.stubbing.answers.CallsRealMethods;
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/measurement/reporting/
DVerboseDebugReportingJobServiceTest.java68 import org.mockito.internal.stubbing.answers.AnswersWithDelay;
69 import org.mockito.internal.stubbing.answers.CallsRealMethods;
DDebugReportingJobServiceTest.java68 import org.mockito.internal.stubbing.answers.AnswersWithDelay;
69 import org.mockito.internal.stubbing.answers.CallsRealMethods;
DDebugReportingFallbackJobServiceTest.java72 import org.mockito.internal.stubbing.answers.AnswersWithDelay;
73 import org.mockito.internal.stubbing.answers.CallsRealMethods;
DImmediateAggregateReportingJobServiceTest.java72 import org.mockito.internal.stubbing.answers.AnswersWithDelay;
73 import org.mockito.internal.stubbing.answers.CallsRealMethods;
DEventFallbackReportingJobServiceTest.java74 import org.mockito.internal.stubbing.answers.AnswersWithDelay;
75 import org.mockito.internal.stubbing.answers.CallsRealMethods;

12