Home
last modified time | relevance | path

Searched refs:hostname (Results 1 – 25 of 57) sorted by relevance

123

/packages/modules/NetworkStack/common/moduleutils/src/android/net/shared/
DPrivateDnsConfig.java31 public final String hostname; field in PrivateDnsConfig
40 this.hostname = ""; in PrivateDnsConfig()
44 public PrivateDnsConfig(String hostname, InetAddress[] ips) { in PrivateDnsConfig() argument
45 this.useTls = !TextUtils.isEmpty(hostname); in PrivateDnsConfig()
46 this.hostname = useTls ? hostname : ""; in PrivateDnsConfig()
52 hostname = cfg.hostname; in PrivateDnsConfig()
60 return useTls && !TextUtils.isEmpty(hostname); in inStrictMode()
66 + "{" + useTls + ":" + hostname + "/" + Arrays.toString(ips) + "}"; in toString()
74 parcel.hostname = hostname; in toParcel()
88 return new PrivateDnsConfig(parcel.hostname, ips); in fromParcel()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/
DProxySelector.java93 String hostname = mHostnameField.getText().toString().trim(); in onCreateDialog() local
96 String msg = getActivity().getString(validate(hostname, portStr, exclList)); in onCreateDialog()
121 mHostnameField = (EditText)view.findViewById(R.id.hostname); in initView()
143 String hostname = ""; in populateFields() local
152 hostname = proxy.getHost(); in populateFields()
157 if (hostname == null) { in populateFields()
158 hostname = ""; in populateFields()
161 mHostnameField.setText(hostname); in populateFields()
187 public static int validate(String hostname, String port, String exclList) { in validate() argument
188 switch (Proxy.validate(hostname, port, exclList)) { in validate()
[all …]
/packages/apps/Settings/src/com/android/settings/
DProxySelector.java93 String hostname = mHostnameField.getText().toString().trim(); in onCreateDialog() local
96 String msg = getActivity().getString(validate(hostname, portStr, exclList)); in onCreateDialog()
121 mHostnameField = (EditText)view.findViewById(R.id.hostname); in initView()
143 String hostname = ""; in populateFields() local
152 hostname = proxy.getHost(); in populateFields()
157 if (hostname == null) { in populateFields()
158 hostname = ""; in populateFields()
161 mHostnameField.setText(hostname); in populateFields()
187 public static int validate(String hostname, String port, String exclList) { in validate() argument
188 switch (Proxy.validate(hostname, port, exclList)) { in validate()
[all …]
/packages/modules/NetworkStack/tests/lib/src/com/android/testutils/
DFakeDns.kt34 class DnsEntry(val hostname: String, val type: Int, val addresses: List<InetAddress>) { constant in com.android.testutils.FakeDns.DnsEntry
35 fun match(host: String, type: Int) = hostname.equals(host) && type == type in match()
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>()
46 val ans = DnsEntry(hostname, type, generateAnswer(answer)) in <lambda>()
48 when (val index = answers.indexOfFirst { it.match(hostname, type) }) { in <lambda>()
78 val hostname = it.arguments[posHos] as String in mockAnswer() constant
82 val answer = getAnswer(hostname, type) in mockAnswer()
/packages/modules/NetworkStack/src/android/net/dhcp/
DDhcpLeaseRepository.java190 @Nullable String hostname) throws OutOfAddressesException, InvalidSubnetException { in getOffer() argument
200 newLease = currentLease.renewedLease(expTime, hostname); in getOffer()
204 newLease = new DhcpLease(clientId, hwAddr, reqAddr, mPrefixLength, expTime, hostname); in getOffer()
207 newLease = makeNewOffer(clientId, hwAddr, expTime, hostname); in getOffer()
224 @NonNull Inet4Address relayAddr, @Nullable String hostname) in getCommittedLease() argument
227 hostname); in getCommittedLease()
279 @Nullable Inet4Address reqAddr, boolean sidSet, @Nullable String hostname) in requestLease() argument
309 checkClientAndMakeLease(clientId, hwAddr, leaseAddr, hostname, currentTime); in requestLease()
327 @NonNull Inet4Address addr, @Nullable String hostname, long currentTime) in checkClientAndMakeLease() argument
338 lease = new DhcpLease(clientId, hwAddr, addr, mPrefixLength, expTime, hostname); in checkClientAndMakeLease()
[all …]
DDhcpLease.java58 @Nullable String hostname) { in DhcpLease() argument
64 mHostname = hostname; in DhcpLease()
110 public DhcpLease renewedLease(long expTime, @Nullable String hostname) { in renewedLease() argument
113 (hostname == null ? mHostname : hostname)); in renewedLease()
177 p.hostname = mHostname; in toParcelable()
DDhcpPacket.java1393 boolean rapidCommit, String hostname) { in buildDiscoverPacket() argument
1397 pkt.mHostName = hostname; in buildDiscoverPacket()
1409 Inet4Address dhcpServerIdentifier, String domainName, String hostname, boolean metered, in buildOfferPacket() argument
1418 pkt.mHostName = hostname; in buildOfferPacket()
1437 Inet4Address dhcpServerIdentifier, String domainName, String hostname, boolean metered, in buildAckPacket() argument
1446 pkt.mHostName = hostname; in buildAckPacket()
/packages/modules/DnsResolver/
Dgetaddrinfo.cpp262 int getaddrinfo_numeric(const char* hostname, const char* servname, addrinfo hints, in getaddrinfo_numeric() argument
274 return android_getaddrinfofornetcontext(hostname, servname, &hints, &netcontext, result, in getaddrinfo_numeric()
323 int android_getaddrinfofornetcontext(const char* hostname, const char* servname, in android_getaddrinfofornetcontext() argument
338 if (hostname == nullptr && servname == nullptr) { in android_getaddrinfofornetcontext()
374 if (hostname == nullptr) in android_getaddrinfofornetcontext()
377 error = explore_numeric_scope(&tmp, hostname, servname, &cur->ai_next); in android_getaddrinfofornetcontext()
389 if (hostname == nullptr) { in android_getaddrinfofornetcontext()
398 return resolv_getaddrinfo(hostname, servname, hints, netcontext, res, event); in android_getaddrinfofornetcontext()
410 int resolv_getaddrinfo(const char* _Nonnull hostname, const char* servname, const addrinfo* hints, in resolv_getaddrinfo() argument
413 if (hostname == nullptr && servname == nullptr) return EAI_NONAME; in resolv_getaddrinfo()
[all …]
DDnsQueryLog.h35 Record(uint32_t netId, uid_t uid, pid_t pid, const std::string& hostname, in Record()
40 hostname(hostname), in Record()
47 const std::string hostname; member
DDnsQueryLog.cpp26 std::string maskHostname(const std::string& hostname) { in maskHostname() argument
28 return hostname.substr(0, 1) + "***"; in maskHostname()
78 const std::string maskedHostname = maskHostname(record.hostname); in dump()
Dresolv_unit_test.cpp589 for (const auto& hostname : illegalHostnames) { in TEST_F() local
599 dns.addMapping(hostname, ns_type::ns_t_a, "1.2.3.3"); in TEST_F()
600 dns.addMapping(hostname, ns_type::ns_t_aaaa, "2001:db8::42"); in TEST_F()
603 SCOPED_TRACE(StringPrintf("family: %d, config.name: %s", family, hostname)); in TEST_F()
608 int rv = resolv_getaddrinfo(hostname, nullptr, &hints, &mNetcontext, &res, &event); in TEST_F()
1237 for (const auto& hostname : illegalHostnames) { in TEST_F() local
1247 dns.addMapping(hostname, ns_type::ns_t_a, "1.2.3.3"); in TEST_F()
1248 dns.addMapping(hostname, ns_type::ns_t_aaaa, "2001:db8::42"); in TEST_F()
1251 SCOPED_TRACE(StringPrintf("family: %d, config.name: %s", family, hostname)); in TEST_F()
1257 int rv = resolv_gethostbyname(hostname, family, &hbuf, tmpbuf, sizeof(tmpbuf), in TEST_F()
Dgetaddrinfo.h24 int android_getaddrinfofornetcontext(const char* hostname, const char* servname,
29 int resolv_getaddrinfo(const char* hostname, const char* servname, const addrinfo* hints,
/packages/modules/NetworkStack/src/android/net/util/
DHostnameTransliterator.java98 String hostname = maybeRemoveRedundantSymbols(mTransliterator.transliterate(deviceName)); in transliterate() local
99 if (TextUtils.isEmpty(hostname)) return null; in transliterate()
100 return hostname.length() > MAX_DNS_LABEL_LENGTH in transliterate()
101 ? hostname.substring(0, MAX_DNS_LABEL_LENGTH) : hostname; in transliterate()
/packages/modules/NetworkStack/tests/unit/src/android/net/dhcp/
DDhcpLeaseRepositoryTest.java138 final String hostname = "host_" + i; in requestAddresses() local
140 IPV4_ADDR_ANY /* relayAddr */, INETADDR_UNSPEC /* reqAddr */, hostname); in requestAddresses()
144 assertEquals(hostname, lease.getHostname()); in requestAddresses()
148 requestLeaseSelecting(newMac, lease.getNetAddr(), hostname); in requestAddresses()
576 @Nullable Inet4Address reqAddr, @Nullable String hostname, boolean sidSet) in requestLease() argument
580 reqAddr, sidSet, hostname); in requestLease()
587 @NonNull Inet4Address reqAddr, @Nullable String hostname) in requestLeaseSelecting() argument
589 return requestLease(macAddr, IPV4_ADDR_ANY /* clientAddr */, reqAddr, hostname, in requestLeaseSelecting()
658 p.hostname); in fromParcelable()
DDhcpServerTest.java432 @NonNull Inet4Address clientAddr, @Nullable String hostname) { in assertMatchesLease() argument
439 assertEquals(hostname, packet.mHostName); in assertMatchesLease()
442 private void assertMatchesTestLease(@NonNull DhcpPacket packet, @Nullable String hostname) { in assertMatchesTestLease() argument
443 assertMatchesLease(packet, TEST_SERVER_ADDR, TEST_CLIENT_ADDR, hostname); in assertMatchesTestLease()
DDhcpLeaseTest.kt103 assertEquals(expected.hostname, p.hostname) in assertParcelEquals()
DDhcpPacketTest.java1145 public void checkBuildOfferPacket(int leaseTimeSecs, @Nullable String hostname) in checkBuildOfferPacket() argument
1157 SERVER_ADDR /* dhcpServerIdentifier */, null /* domainName */, hostname, in checkBuildOfferPacket()
1215 if (hostname != null) { in checkBuildOfferPacket()
1216 bos.write(new byte[]{(byte) 0x0c, (byte) hostname.length()}); in checkBuildOfferPacket()
1217 bos.write(hostname.getBytes(Charset.forName("US-ASCII"))); in checkBuildOfferPacket()
/packages/modules/DnsResolver/tests/dns_metrics_listener/
Dtest_metrics.cpp38 const std::string& hostname, in onDnsEvent() argument
60 if (hostname != result.hostname) continue; in onDnsEvent()
Dtest_metrics.h75 std::string hostname; member
87 int32_t /*latencyMs*/, const std::string& hostname,
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/connectivity/
DWifiConfigHelper.java105 public static int validate(String hostname, String port, String exclList) { in validate() argument
106 Matcher match = HOSTNAME_PATTERN.matcher(hostname); in validate()
116 if (hostname.length() > 0 && port.length() == 0) { in validate()
121 if (hostname.length() == 0) { in validate()
/packages/services/BuiltInPrintService/src/com/android/bips/ui/
DAddManualPrinterDialog.java88 mHostnameView = findViewById(R.id.hostname); in onCreate()
124 String hostname = mHostnameView.getText().toString(); in updateButtonState() local
125 Matcher uriMatcher = FULL_URI_PATTERN.matcher(hostname); in updateButtonState()
/packages/modules/NetworkStack/tests/unit/src/com/android/server/connectivity/
DNetworkMonitorTest.java330 private boolean matches(String hostname, int type) { in matches() argument
331 return hostname.endsWith(mHostname) && type == mType; in matches()
348 private synchronized List<InetAddress> getAnswer(Object mock, String hostname, int type) { in getAnswer() argument
353 return mAnswers.stream().filter(e -> e.matches(hostname, type)) in getAnswer()
358 private synchronized void setAnswer(String hostname, String[] answer, int type) in setAnswer() argument
360 DnsEntry record = new DnsEntry(hostname, type, generateAnswer(answer)); in setAnswer()
362 mAnswers.removeIf(entry -> entry.matches(hostname, type)); in setAnswer()
374 private InetAddress[] getAllByName(Object mock, String hostname) in getAllByName() argument
376 List<InetAddress> answer = queryAllTypes(mock, hostname); in getAllByName()
378 throw new UnknownHostException(hostname); in getAllByName()
[all …]
/packages/modules/NetworkStack/tests/unit/src/android/net/util/
DHostnameTransliteratorTest.java70 final String hostname) { in assertHostnameTransliteration()
71 assertEquals(hostnameAftertransliteration, mTransliterator.transliterate(hostname)); in assertHostnameTransliteration()
/packages/modules/NetworkStack/tests/integration/src/android/net/ip/
DIpClientIntegrationTest.java297 public void setHostnameConfiguration(final boolean enable, final String hostname) { in setHostnameConfiguration() argument
299 mHostname = hostname; in setHostnameConfiguration()
600 final boolean isHostnameConfigurationEnabled, final String hostname,
615 mDependencies.setHostnameConfiguration(isHostnameConfigurationEnabled, hostname);
661 final String hostname, final String hostnameAfterTransliteration,
664 if (!isHostnameConfigurationEnabled || hostname == null) {
672 private void assertNoHostname(String hostname) {
674 assertNull(hostname);
678 assertEquals(SystemProperties.get("net.hostname"), hostname);
687 final boolean isHostnameConfigurationEnabled, final String hostname,
[all …]
/packages/modules/DnsResolver/tests/
Ddnsresolver_binder_test.cpp119 std::string hostname; in TEST_F() member
174 SCOPED_TRACE(config.hostname); in TEST_F()
178 int status = getaddrinfo(config.hostname.c_str(), nullptr, &hints, &result); in TEST_F()

123