/frameworks/base/tests/net/common/java/android/net/ |
D | IpPrefixTest.java | 59 IpPrefix p; in testConstructor() 61 p = new IpPrefix((byte[]) null, 9); in testConstructor() 66 p = new IpPrefix((InetAddress) null, 10); in testConstructor() 71 p = new IpPrefix((String) null); in testConstructor() 78 p = new IpPrefix(b2, 29); in testConstructor() 83 p = new IpPrefix("1.2.3.4"); in testConstructor() 88 p = new IpPrefix("1.2.3.4/"); in testConstructor() 93 p = new IpPrefix("foo/32"); in testConstructor() 98 p = new IpPrefix("1/32"); in testConstructor() 103 p = new IpPrefix("1.2.3.256/32"); in testConstructor() [all …]
|
D | LinkPropertiesTest.java | 157 lp.setNat64Prefix(new IpPrefix("2001:db8:0:64::/96")); in makeTestObject() 663 IpPrefix p = new IpPrefix("64:ff9b::/96"); in testNat64Prefix() 667 p = new IpPrefix("2001:db8:a:b:1:2:3::/96"); in testNat64Prefix() 671 p = new IpPrefix("2001:db8:a:b:1:2::/80"); in testNat64Prefix() 677 p = new IpPrefix("64:ff9b::/64"); in testNat64Prefix() 683 assertEquals(new IpPrefix("2001:db8:a:b:1:2:3::/96"), lp.getNat64Prefix()); in testNat64Prefix() 811 assertTrue(v4lp.addRoute(new RouteInfo(new IpPrefix(address("75.208.0.0"), 16)))); in testIsReachable() 838 assertTrue(v6lp.addRoute(new RouteInfo(new IpPrefix(address("fe80::"), 64)))); in testIsReachable() 854 assertTrue(v6lp.addRoute(new RouteInfo(new IpPrefix(address("2001:db8:85a3::"), 64)))); in testIsReachable() 893 stacked.addRoute(new RouteInfo((IpPrefix) null, stackedAddress)); in testIsReachable() [all …]
|
D | RouteInfoTest.java | 63 private IpPrefix Prefix(String prefix) { in Prefix() 64 return new IpPrefix(prefix); in Prefix() 77 r = new RouteInfo((IpPrefix) null, null, "rmnet0"); in testConstructor() 100 r = new RouteInfo((IpPrefix) null, Address("2001:db8::1"), null); in testConstructor() 105 r = new RouteInfo((IpPrefix) null, Address("192.0.2.1"), "wlan0"); in testConstructor() 127 public PatchedRouteInfo(IpPrefix destination, InetAddress gateway, String iface) { in testMatches() 310 r = new RouteInfo(new IpPrefix(Inet4Address.ANY, 0), RTN_UNREACHABLE); in testHostAndDefaultRoutes() 320 r = new RouteInfo(new IpPrefix(Inet6Address.ANY, 0), RTN_UNREACHABLE); in testHostAndDefaultRoutes()
|
/frameworks/base/tests/net/java/android/net/ |
D | NetworkUtilsTest.java | 48 final TreeSet<IpPrefix> set = new TreeSet<>(IpPrefix.lengthComparator()); in testRoutedIPv4AddressCount() 52 set.add(new IpPrefix("0.0.0.0/0")); in testRoutedIPv4AddressCount() 55 set.add(new IpPrefix("20.18.0.0/16")); in testRoutedIPv4AddressCount() 56 set.add(new IpPrefix("20.18.0.0/24")); in testRoutedIPv4AddressCount() 57 set.add(new IpPrefix("20.18.0.0/8")); in testRoutedIPv4AddressCount() 62 set.add(new IpPrefix("20.18.0.0/24")); in testRoutedIPv4AddressCount() 63 set.add(new IpPrefix("20.18.0.0/8")); in testRoutedIPv4AddressCount() 67 set.add(new IpPrefix("10.10.10.126/25")); in testRoutedIPv4AddressCount() 72 set.add(new IpPrefix("1.2.3.4/32")); in testRoutedIPv4AddressCount() 73 set.add(new IpPrefix("1.2.3.4/32")); in testRoutedIPv4AddressCount() [all …]
|
/frameworks/libs/net/common/tests/unit/src/android/net/util/ |
D | IpRangeTest.java | 26 import android.net.IpPrefix; 97 IpRange r = new IpRange(new IpPrefix(IPV4_ADDR, 32)); in testConstructor() 101 r = new IpRange(new IpPrefix(IPV4_ADDR, 16)); in testConstructor() 109 r = new IpRange(new IpPrefix(IPV6_ADDR, 128)); in testConstructor() 113 r = new IpRange(new IpPrefix(IPV6_ADDR, 16)); in testConstructor() 124 final IpRange r1 = new IpRange(new IpPrefix(IPV6_ADDR, 35)); in testContainsRangeEqualRanges() 125 final IpRange r2 = new IpRange(new IpPrefix(IPV6_ADDR, 35)); in testContainsRangeEqualRanges() 134 final IpRange r1 = new IpRange(new IpPrefix(IPV6_ADDR, 64)); in testContainsRangeSubset() 135 final IpRange r2 = new IpRange(new IpPrefix(address("2001:db8::0101"), 128)); in testContainsRangeSubset() 144 final IpRange r1 = new IpRange(new IpPrefix(IPV6_ADDR, 100)); in testContainsRangeTruncatesLowerOrderBits() [all …]
|
D | NetUtilsTest.java | 25 import android.net.IpPrefix; 72 final RouteInfo v4_expected = new RouteInfo(new IpPrefix("75.208.8.10/24"), in testSelectBestRoute() 76 routes.add(new RouteInfo(new IpPrefix("75.208.8.10/16"), V4_GATEWAY, "wlan0")); in testSelectBestRoute() 77 routes.add(new RouteInfo(new IpPrefix("75.208.7.32/24"), V4_GATEWAY, "wlan0")); in testSelectBestRoute() 79 final RouteInfo v6_expected = new RouteInfo(new IpPrefix("2001:db8:cafe::/64"), in testSelectBestRoute() 83 routes.add(new RouteInfo(new IpPrefix("2001:db8:cafe::123/32"), V6_GATEWAY, "wlan0")); in testSelectBestRoute() 84 routes.add(new RouteInfo(new IpPrefix("2001:db8:beef::/64"), V6_GATEWAY, "wlan0")); in testSelectBestRoute()
|
/frameworks/base/packages/Tethering/src/android/net/util/ |
D | PrefixUtils.java | 19 import android.net.IpPrefix; 34 private static final IpPrefix[] MIN_NON_FORWARDABLE_PREFIXES = { 43 public static final IpPrefix DEFAULT_WIFI_P2P_PREFIX = pfx("192.168.49.0/24"); 46 public static Set<IpPrefix> getNonForwardablePrefixes() { in getNonForwardablePrefixes() 47 final HashSet<IpPrefix> prefixes = new HashSet<>(); in getNonForwardablePrefixes() 53 public static void addNonForwardablePrefixes(Set<IpPrefix> prefixes) { in addNonForwardablePrefixes() 58 public static Set<IpPrefix> localPrefixesFrom(LinkProperties lp) { in localPrefixesFrom() 59 final HashSet<IpPrefix> localPrefixes = new HashSet<>(); in localPrefixesFrom() 73 public static IpPrefix asIpPrefix(LinkAddress addr) { in asIpPrefix() 74 return new IpPrefix(addr.getAddress(), addr.getPrefixLength()); in asIpPrefix() [all …]
|
/frameworks/base/core/java/android/net/ |
D | IpPrefix.java | 53 public final class IpPrefix implements Parcelable { class 75 public IpPrefix(@NonNull byte[] address, @IntRange(from = 0, to = 128) int prefixLength) { in IpPrefix() method in IpPrefix 92 public IpPrefix(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength) { in IpPrefix() method in IpPrefix 111 public IpPrefix(@NonNull String prefix) { in IpPrefix() method in IpPrefix 131 if (!(obj instanceof IpPrefix)) { in equals() 134 IpPrefix that = (IpPrefix) obj; in equals() 206 public boolean containsPrefix(@NonNull IpPrefix otherPrefix) { in containsPrefix() 261 public static Comparator<IpPrefix> lengthComparator() { in lengthComparator() 262 return new Comparator<IpPrefix>() { in lengthComparator() 264 public int compare(IpPrefix prefix1, IpPrefix prefix2) { in lengthComparator() [all …]
|
D | RouteInfo.java | 72 private final IpPrefix mDestination; 139 public RouteInfo(@Nullable IpPrefix destination, @Nullable InetAddress gateway, in RouteInfo() 164 public RouteInfo(@Nullable IpPrefix destination, @Nullable InetAddress gateway, in RouteInfo() 188 destination = new IpPrefix(Inet4Address.ANY, 0); in RouteInfo() 190 destination = new IpPrefix(Inet6Address.ANY, 0); in RouteInfo() 241 public RouteInfo(@Nullable IpPrefix destination, @Nullable InetAddress gateway, in RouteInfo() 253 new IpPrefix(destination.getAddress(), destination.getPrefixLength()), in RouteInfo() 272 public RouteInfo(@Nullable IpPrefix destination, @Nullable InetAddress gateway) { in RouteInfo() 295 this((IpPrefix) null, gateway, null); in RouteInfo() 306 public RouteInfo(@NonNull IpPrefix destination) { in RouteInfo() [all …]
|
D | NetworkUtils.java | 393 private static TreeSet<IpPrefix> deduplicatePrefixSet(final TreeSet<IpPrefix> src) { in deduplicatePrefixSet() 394 final TreeSet<IpPrefix> dst = new TreeSet<>(src.comparator()); in deduplicatePrefixSet() 403 for (IpPrefix newPrefix : src) { in deduplicatePrefixSet() 404 for (IpPrefix existingPrefix : dst) { in deduplicatePrefixSet() 423 public static long routedIPv4AddressCount(final TreeSet<IpPrefix> prefixes) { in routedIPv4AddressCount() 425 for (final IpPrefix prefix : deduplicatePrefixSet(prefixes)) { in routedIPv4AddressCount() 442 public static BigInteger routedIPv6AddressCount(final TreeSet<IpPrefix> prefixes) { in routedIPv6AddressCount() 444 for (final IpPrefix prefix : deduplicatePrefixSet(prefixes)) { in routedIPv6AddressCount()
|
/frameworks/native/libs/binder/include/binder/ |
D | IpPrefix.h | 35 class IpPrefix : public Parcelable { 37 IpPrefix() = default; 38 virtual ~IpPrefix() = default; 39 IpPrefix(const IpPrefix& prefix) = default; 41 IpPrefix(const struct in6_addr& addr, int32_t plen): in IpPrefix() function 44 IpPrefix(const struct in_addr& addr, int32_t plen): in IpPrefix() function 63 friend bool operator==(const IpPrefix& lhs, const IpPrefix& rhs); 65 friend bool operator!=(const IpPrefix& lhs, const IpPrefix& rhs) {
|
/frameworks/native/libs/binder/ |
D | IpPrefix.cpp | 47 status_t IpPrefix::writeToParcel(Parcel* parcel) const { in writeToParcel() 68 status_t IpPrefix::readFromParcel(const Parcel* parcel) { in readFromParcel() 94 const struct in6_addr& IpPrefix::getAddressAsIn6Addr() const in getAddressAsIn6Addr() 99 const struct in_addr& IpPrefix::getAddressAsInAddr() const in getAddressAsInAddr() 104 bool IpPrefix::getAddressAsIn6Addr(struct in6_addr* addr) const in getAddressAsIn6Addr() 113 bool IpPrefix::getAddressAsInAddr(struct in_addr* addr) const in getAddressAsInAddr() 122 bool IpPrefix::isIpv6() const in isIpv6() 127 bool IpPrefix::isIpv4() const in isIpv4() 132 int32_t IpPrefix::getPrefixLength() const in getPrefixLength() 137 void IpPrefix::setAddress(const struct in6_addr& addr) in setAddress() [all …]
|
/frameworks/base/packages/Tethering/src/com/android/networkstack/tethering/ |
D | PrivateAddressCoordinator.java | 22 import android.net.IpPrefix; 68 private final ArrayMap<Network, List<IpPrefix>> mUpstreamPrefixMap; 74 private final IpPrefix mTetheringPrefix; 80 mTetheringPrefix = new IpPrefix(DEFAULT_TETHERING_PREFIX); in PrivateAddressCoordinator() 90 final ArrayList<IpPrefix> ipv4Prefixes = getIpv4Prefixes(lp.getAllLinkAddresses()); in updateUpstreamPrefix() 100 private ArrayList<IpPrefix> getIpv4Prefixes(final List<LinkAddress> linkAddresses) { in getIpv4Prefixes() 101 final ArrayList<IpPrefix> list = new ArrayList<>(); in getIpv4Prefixes() 111 private void handleMaybePrefixConflict(final List<IpPrefix> prefixes) { in handleMaybePrefixConflict() 113 final IpPrefix target = getDownstreamPrefix(downstream); in handleMaybePrefixConflict() 116 for (IpPrefix source : prefixes) { in handleMaybePrefixConflict() [all …]
|
D | IPv6TetheringCoordinator.java | 19 import android.net.IpPrefix; 244 final IpPrefix destination = routeInfo.getDestination(); in getIPv6OnlyLinkProperties() 277 final IpPrefix local48 = makeUniqueLocalPrefix(ulp, (short) 0, 48); in getUniqueLocalConfig() 280 final IpPrefix local64 = makeUniqueLocalPrefix(ulp, subnetId, 64); in getUniqueLocalConfig() 290 private static IpPrefix makeUniqueLocalPrefix(byte[] in6addr, short subnetId, int prefixlen) { in makeUniqueLocalPrefix() 300 return new IpPrefix(addr, prefixlen); in makeUniqueLocalPrefix()
|
D | UpstreamNetworkMonitor.java | 34 import android.net.IpPrefix; 111 private HashSet<IpPrefix> mLocalPrefixes; 325 public Set<IpPrefix> getLocalPrefixes() { in getLocalPrefixes() 326 return (Set<IpPrefix>) mLocalPrefixes.clone(); in getLocalPrefixes() 414 final HashSet<IpPrefix> localPrefixes = allLocalPrefixes(mNetworkMap.values()); in recomputeLocalPrefixes() 542 private static HashSet<IpPrefix> allLocalPrefixes(Iterable<UpstreamNetworkState> netStates) { in allLocalPrefixes() 543 final HashSet<IpPrefix> prefixSet = new HashSet<>(); in allLocalPrefixes()
|
/frameworks/libs/net/common/framework/android/net/util/ |
D | IpRange.java | 22 import android.net.IpPrefix; 69 public IpRange(@NonNull IpPrefix prefix) { in IpRange() 119 public List<IpPrefix> asIpPrefixes() { in asIpPrefixes() 121 final List<IpPrefix> result = new ArrayList<>(); in asIpPrefixes() 122 final Queue<IpPrefix> workingSet = new LinkedList<>(); in asIpPrefixes() 126 workingSet.add(new IpPrefix(isIpv6 ? getAsInetAddress(new byte[16]) /* IPv6_ANY */ in asIpPrefixes() 131 final IpPrefix workingPrefix = workingSet.poll(); in asIpPrefixes() 162 private static List<IpPrefix> getSubsetPrefixes(IpPrefix prefix) { in getSubsetPrefixes() 163 final List<IpPrefix> result = new ArrayList<>(); in getSubsetPrefixes() 166 result.add(new IpPrefix(prefix.getAddress(), currentPrefixLen + 1)); in getSubsetPrefixes() [all …]
|
/frameworks/base/packages/Tethering/tests/unit/src/com/android/networkstack/tethering/ |
D | PrivateAddressCoordinatorTest.java | 29 import android.net.IpPrefix; 61 private final IpPrefix mBluetoothPrefix = new IpPrefix("192.168.44.0/24"); 79 final IpPrefix hotspotPrefix = PrefixUtils.asIpPrefix(address); in testDownstreamPrefixRequest() 84 final IpPrefix testDupRequest = PrefixUtils.asIpPrefix(address); in testDownstreamPrefixRequest() 91 final IpPrefix usbPrefix = PrefixUtils.asIpPrefix(address); in testDownstreamPrefixRequest() 141 final IpPrefix hotspotPrefix = PrefixUtils.asIpPrefix(address); in testReserveBluetoothPrefix() 149 final IpPrefix predefinedPrefix = new IpPrefix("192.168.43.0/24"); in testNoConflictDownstreamPrefix() 153 final IpPrefix hotspotPrefix = PrefixUtils.asIpPrefix(address); in testNoConflictDownstreamPrefix() 159 final IpPrefix usbPrefix = PrefixUtils.asIpPrefix(address); in testNoConflictDownstreamPrefix() 166 final IpPrefix allowUseFreePrefix = PrefixUtils.asIpPrefix(address); in testNoConflictDownstreamPrefix() [all …]
|
D | OffloadControllerTest.java | 60 import android.net.IpPrefix; 268 final Set<IpPrefix> minimumLocalPrefixes = new HashSet<>(); in testSetUpstreamLinkPropertiesWorking() 271 minimumLocalPrefixes.add(new IpPrefix(s)); in testSetUpstreamLinkPropertiesWorking() 305 lp.addRoute(new RouteInfo(new IpPrefix("192.0.2.0/24"), null, null, RTN_UNICAST)); in testSetUpstreamLinkPropertiesWorking() 386 lp.addRoute(new RouteInfo(new IpPrefix("2001:db8::/64"), null, null, RTN_UNICAST)); in testSetUpstreamLinkPropertiesWorking() 619 new RouteInfo(new IpPrefix(USB_PREFIX), null, null, RTN_UNICAST)); in testAddRemoveDownstreams() 626 new RouteInfo(new IpPrefix(IPV6_LINKLOCAL), null, null, RTN_UNICAST)); in testAddRemoveDownstreams() 635 new RouteInfo(new IpPrefix(IPV6_DOC_PREFIX), null, null, RTN_UNICAST)); in testAddRemoveDownstreams() 649 new RouteInfo(new IpPrefix(IPV6_DOC_PREFIX), null, RNDIS0, RTN_UNICAST)); in testAddRemoveDownstreams() 651 new RouteInfo(new IpPrefix(IPV6_DISCARD_PREFIX), null, null, RTN_UNICAST)); in testAddRemoveDownstreams() [all …]
|
/frameworks/base/lowpan/java/android/net/lowpan/ |
D | ILowpanInterface.aidl | 19 import android.net.IpPrefix; 124 IpPrefix[] getLinkNetworks(); in getLinkNetworks() 150 void addOnMeshPrefix(in IpPrefix prefix, int flags); in addOnMeshPrefix() 151 oneway void removeOnMeshPrefix(in IpPrefix prefix); in removeOnMeshPrefix() 153 void addExternalRoute(in IpPrefix prefix, int flags); in addExternalRoute() 154 oneway void removeExternalRoute(in IpPrefix prefix); in removeExternalRoute()
|
D | ILowpanInterfaceListener.aidl | 19 import android.net.IpPrefix; 36 oneway void onLinkNetworkAdded(in IpPrefix value); in onLinkNetworkAdded() 38 oneway void onLinkNetworkRemoved(in IpPrefix value); in onLinkNetworkRemoved()
|
D | LowpanInterface.java | 22 import android.net.IpPrefix; 174 public void onLinkNetworkAdded(IpPrefix prefix) {} in onLinkNetworkAdded() 176 public void onLinkNetworkRemoved(IpPrefix prefix) {} in onLinkNetworkRemoved() 601 public void onLinkNetworkAdded(IpPrefix value) { in registerCallback() 606 public void onLinkNetworkRemoved(IpPrefix value) { in registerCallback() 741 public IpPrefix[] getLinkNetworks() throws LowpanException { in getLinkNetworks() 758 public void addOnMeshPrefix(IpPrefix prefix, int flags) throws LowpanException { in addOnMeshPrefix() 776 public void removeOnMeshPrefix(IpPrefix prefix) { in removeOnMeshPrefix() 795 public void addExternalRoute(IpPrefix prefix, int flags) throws LowpanException { in addExternalRoute() 812 public void removeExternalRoute(IpPrefix prefix) { in removeExternalRoute()
|
D | LowpanCommissioningSession.java | 21 import android.net.IpPrefix; 101 public void onLinkNetworkAdded(IpPrefix value) {} in onLinkNetworkAdded() 104 public void onLinkNetworkRemoved(IpPrefix value) {} in onLinkNetworkRemoved()
|
/frameworks/base/packages/Tethering/src/android/net/ip/ |
D | RouterAdvertisementDaemon.java | 27 import android.net.IpPrefix; 133 public HashSet<IpPrefix> prefixes; 140 prefixes = new HashSet<IpPrefix>(); in RaParams() 162 for (IpPrefix ipp : oldRa.prefixes) { in getDeprecatedRaParams() 180 private final HashMap<IpPrefix, Integer> mPrefixes = new HashMap<>(); 183 Set<IpPrefix> getPrefixes() { in getPrefixes() 187 void putPrefixes(Set<IpPrefix> prefixes) { in putPrefixes() 188 for (IpPrefix ipp : prefixes) { in putPrefixes() 193 void removePrefixes(Set<IpPrefix> prefixes) { in removePrefixes() 194 for (IpPrefix ipp : prefixes) { in removePrefixes() [all …]
|
/frameworks/base/services/core/java/com/android/server/connectivity/ |
D | Nat464Xlat.java | 25 import android.net.IpPrefix; 89 private IpPrefix mNat64PrefixInUse; 91 private IpPrefix mNat64PrefixFromDns; 93 private IpPrefix mNat64PrefixFromRa; 318 private void setPrefix64(IpPrefix prefix) { in setPrefix64() 329 final IpPrefix newPrefix = selectNat64Prefix(); in maybeHandleNat64PrefixChange() 392 private IpPrefix selectNat64Prefix() { in selectNat64Prefix() 396 public void setNat64PrefixFromRa(IpPrefix prefix) { in setNat64PrefixFromRa() 400 public void setNat64PrefixFromDns(IpPrefix prefix) { in setNat64PrefixFromDns()
|
/frameworks/base/tests/net/java/com/android/server/connectivity/ |
D | Nat464XlatTest.java | 33 import android.net.IpPrefix; 153 mNai.linkProperties.setNat64Prefix(new IpPrefix(OTHER_NAT64_PREFIX)); 204 nat.setNat64PrefixFromDns(new IpPrefix(NAT64_PREFIX)); 258 nat.setNat64PrefixFromDns(new IpPrefix(NAT64_PREFIX)); 345 nat.setNat64PrefixFromDns(new IpPrefix(NAT64_PREFIX)); 385 nat.setNat64PrefixFromDns(new IpPrefix(NAT64_PREFIX)); 429 nat.setNat64PrefixFromDns(new IpPrefix(NAT64_PREFIX)); 460 final IpPrefix prefixFromDns = new IpPrefix(NAT64_PREFIX); 461 final IpPrefix prefixFromRa = new IpPrefix(OTHER_NAT64_PREFIX);
|