Home
last modified time | relevance | path

Searched refs:IPAddress (Results 1 – 4 of 4) sorted by relevance

/system/netd/libnetdutils/
DInternetAddressesTest.cpp94 const std::vector<OperatorExpectation<IPAddress>> kExpectations{ in TEST()
95 {EQ, IPAddress(), IPAddress()}, in TEST()
96 {EQ, IPAddress(IPV4_ONES), IPAddress(IPV4_ONES)}, in TEST()
97 {EQ, IPAddress(IPV6_ONES), IPAddress(IPV6_ONES)}, in TEST()
98 {EQ, IPAddress(FE80_1), IPAddress(FE80_1)}, in TEST()
99 {EQ, IPAddress(FE80_2), IPAddress(FE80_2)}, in TEST()
100 {LT, IPAddress(), IPAddress(IPV4_ANY)}, in TEST()
101 {LT, IPAddress(), IPAddress(IPV4_ONES)}, in TEST()
102 {LT, IPAddress(), IPAddress(IPV6_ANY)}, in TEST()
103 {LT, IPAddress(), IPAddress(IPV6_ONES)}, in TEST()
[all …]
DInternetAddresses.cpp33 std::string IPAddress::toString() const noexcept { in toString()
60 bool IPAddress::forString(const std::string& repr, IPAddress* ip) { in forString()
75 if (ip) *ip = IPAddress(sin->sin_addr); in forString()
80 if (ip) *ip = IPAddress(sin6->sin6_addr, sin6->sin6_scope_id); in forString()
91 IPPrefix::IPPrefix(const IPAddress& ip, int length) : IPPrefix(ip) { in IPPrefix()
133 IPAddress ip; in forString()
134 if (!IPAddress::forString(repr.substr(0, index), &ip)) return false; in forString()
/system/netd/libnetdutils/include/netdutils/
DInternetAddresses.h124 class IPAddress {
126 static bool forString(const std::string& repr, IPAddress* ip);
127 static IPAddress forString(const std::string& repr) { in forString()
128 IPAddress ip; in forString()
129 if (!forString(repr, &ip)) return IPAddress(); in forString()
133 IPAddress() = default;
134 IPAddress(const IPAddress&) = default;
135 IPAddress(IPAddress&&) = default;
137 explicit IPAddress(const in_addr& ipv4) in IPAddress() function
139 explicit IPAddress(const in6_addr& ipv6) in IPAddress() function
[all …]
/system/netd/tests/
Dbinder_test.cpp107 using android::netdutils::IPAddress;
2150 std::vector<IPAddress> findDnsSockets(SockDiag* sd, unsigned numExpected) { in findDnsSockets()
2151 std::vector<IPAddress> listenAddrs; in findDnsSockets()
2157 IPAddress addr(*(in_addr*)msg->id.idiag_src); in findDnsSockets()
2208 IPAddress addr1, addr2; in TEST_F()
2209 ASSERT_TRUE(IPAddress::forString("192.0.2.1", &addr1)); in TEST_F()
2210 ASSERT_TRUE(IPAddress::forString("192.0.2.2", &addr2)); in TEST_F()
2250 std::vector<IPAddress> listenAddrs = findDnsSockets(&sd, 0); in TEST_F()
2262 EXPECT_EQ(1, std::count(listenAddrs.begin(), listenAddrs.end(), IPAddress(loopback))); in TEST_F()