Home
last modified time | relevance | path

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

123

/frameworks/base/tests/net/common/java/android/net/
DIpPrefixTest.java57 IpPrefix p; in testConstructor()
59 p = new IpPrefix((byte[]) null, 9); in testConstructor()
64 p = new IpPrefix((InetAddress) null, 10); in testConstructor()
69 p = new IpPrefix((String) null); in testConstructor()
76 p = new IpPrefix(b2, 29); in testConstructor()
81 p = new IpPrefix("1.2.3.4"); in testConstructor()
86 p = new IpPrefix("1.2.3.4/"); in testConstructor()
91 p = new IpPrefix("foo/32"); in testConstructor()
96 p = new IpPrefix("1/32"); in testConstructor()
101 p = new IpPrefix("1.2.3.256/32"); in testConstructor()
[all …]
DRouteInfoTest.java36 private IpPrefix Prefix(String prefix) { in Prefix()
37 return new IpPrefix(prefix); in Prefix()
46 r = new RouteInfo((IpPrefix) null, null, "rmnet0"); in testConstructor()
51 r = new RouteInfo((IpPrefix) null, Address("2001:db8::1"), null); in testConstructor()
56 r = new RouteInfo((IpPrefix) null, Address("192.0.2.1"), "wlan0"); in testConstructor()
77 public PatchedRouteInfo(IpPrefix destination, InetAddress gateway, String iface) { in testMatches()
224 r = new RouteInfo(new IpPrefix(Inet4Address.ANY, 0), RTN_UNREACHABLE); in testHostAndDefaultRoutes()
230 r = new RouteInfo(new IpPrefix(Inet6Address.ANY, 0), RTN_UNREACHABLE); in testHostAndDefaultRoutes()
DLinkPropertiesTest.java122 lp.setNat64Prefix(new IpPrefix("2001:db8:0:64::/96")); in makeTestObject()
589 IpPrefix p = new IpPrefix("64:ff9b::/96"); in testNat64Prefix()
593 p = new IpPrefix("2001:db8:a:b:1:2:3::/96"); in testNat64Prefix()
597 p = new IpPrefix("2001:db8:a:b:1:2::/80"); in testNat64Prefix()
603 p = new IpPrefix("64:ff9b::/64"); in testNat64Prefix()
609 assertEquals(new IpPrefix("2001:db8:a:b:1:2:3::/96"), lp.getNat64Prefix()); in testNat64Prefix()
738 new IpPrefix(NetworkUtils.numericToInetAddress("75.208.0.0"), 16)))); in testIsReachable()
765 assertTrue(v6lp.addRoute(new RouteInfo(new IpPrefix(Address("fe80::"), 64)))); in testIsReachable()
781 assertTrue(v6lp.addRoute(new RouteInfo(new IpPrefix(Address("2001:db8:85a3::"), 64)))); in testIsReachable()
820 stacked.addRoute(new RouteInfo((IpPrefix) null, stackedAddress)); in testIsReachable()
[all …]
DStaticIpConfigurationTest.java154 final RouteInfo connectedRoute = new RouteInfo(new IpPrefix(ADDRSTR), null, IFACE); in testToLinkProperties()
161 RouteInfo defaultRoute = new RouteInfo(new IpPrefix("0.0.0.0/0"), GATEWAY, IFACE); in testToLinkProperties()
167 defaultRoute = new RouteInfo(new IpPrefix("0.0.0.0/0"), OFFLINKGATEWAY, IFACE); in testToLinkProperties()
170 RouteInfo gatewayRoute = new RouteInfo(new IpPrefix("192.0.2.129/32"), null, IFACE); in testToLinkProperties()
271 assertEquals(new RouteInfo((IpPrefix) null, GATEWAY, IFACE), routeInfoList.get(1)); in testGetRoutes()
/frameworks/base/tests/net/java/android/net/
DNetworkUtilsTest.java34 final TreeSet<IpPrefix> set = new TreeSet<>(IpPrefix.lengthComparator()); in testRoutedIPv4AddressCount()
38 set.add(new IpPrefix("0.0.0.0/0")); in testRoutedIPv4AddressCount()
41 set.add(new IpPrefix("20.18.0.0/16")); in testRoutedIPv4AddressCount()
42 set.add(new IpPrefix("20.18.0.0/24")); in testRoutedIPv4AddressCount()
43 set.add(new IpPrefix("20.18.0.0/8")); in testRoutedIPv4AddressCount()
48 set.add(new IpPrefix("20.18.0.0/24")); in testRoutedIPv4AddressCount()
49 set.add(new IpPrefix("20.18.0.0/8")); in testRoutedIPv4AddressCount()
53 set.add(new IpPrefix("10.10.10.126/25")); in testRoutedIPv4AddressCount()
58 set.add(new IpPrefix("1.2.3.4/32")); in testRoutedIPv4AddressCount()
59 set.add(new IpPrefix("1.2.3.4/32")); in testRoutedIPv4AddressCount()
[all …]
/frameworks/base/services/net/java/android/net/util/
DPrefixUtils.java19 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");
45 public static Set<IpPrefix> getNonForwardablePrefixes() { in getNonForwardablePrefixes()
46 final HashSet<IpPrefix> prefixes = new HashSet<>(); in getNonForwardablePrefixes()
51 public static void addNonForwardablePrefixes(Set<IpPrefix> prefixes) { in addNonForwardablePrefixes()
55 public static Set<IpPrefix> localPrefixesFrom(LinkProperties lp) { in localPrefixesFrom()
56 final HashSet<IpPrefix> localPrefixes = new HashSet<>(); in localPrefixesFrom()
69 public static IpPrefix asIpPrefix(LinkAddress addr) { in asIpPrefix()
70 return new IpPrefix(addr.getAddress(), addr.getPrefixLength()); in asIpPrefix()
[all …]
/frameworks/base/core/java/android/net/
DIpPrefix.java53 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 …]
DRouteInfo.java71 private final IpPrefix mDestination;
133 public RouteInfo(@Nullable IpPrefix destination, @Nullable InetAddress gateway, in RouteInfo()
157 destination = new IpPrefix(Inet4Address.ANY, 0); in RouteInfo()
159 destination = new IpPrefix(Inet6Address.ANY, 0); in RouteInfo()
209 public RouteInfo(@Nullable IpPrefix destination, @Nullable InetAddress gateway, in RouteInfo()
221 new IpPrefix(destination.getAddress(), destination.getPrefixLength()), in RouteInfo()
240 public RouteInfo(@Nullable IpPrefix destination, @Nullable InetAddress gateway) { in RouteInfo()
263 this((IpPrefix) null, gateway, null); in RouteInfo()
274 public RouteInfo(@NonNull IpPrefix destination) { in RouteInfo()
288 public RouteInfo(@NonNull IpPrefix destination, @RouteType int type) { in RouteInfo()
[all …]
DNetworkUtils.java402 private static TreeSet<IpPrefix> deduplicatePrefixSet(final TreeSet<IpPrefix> src) { in deduplicatePrefixSet()
403 final TreeSet<IpPrefix> dst = new TreeSet<>(src.comparator()); in deduplicatePrefixSet()
412 for (IpPrefix newPrefix : src) { in deduplicatePrefixSet()
413 for (IpPrefix existingPrefix : dst) { in deduplicatePrefixSet()
432 public static long routedIPv4AddressCount(final TreeSet<IpPrefix> prefixes) { in routedIPv4AddressCount()
434 for (final IpPrefix prefix : deduplicatePrefixSet(prefixes)) { in routedIPv4AddressCount()
451 public static BigInteger routedIPv6AddressCount(final TreeSet<IpPrefix> prefixes) { in routedIPv6AddressCount()
453 for (final IpPrefix prefix : deduplicatePrefixSet(prefixes)) { in routedIPv6AddressCount()
/frameworks/native/libs/binder/include/binder/
DIpPrefix.h35 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/
DIpPrefix.cpp48 status_t IpPrefix::writeToParcel(Parcel* parcel) const { in writeToParcel()
69 status_t IpPrefix::readFromParcel(const Parcel* parcel) { in readFromParcel()
95 const struct in6_addr& IpPrefix::getAddressAsIn6Addr() const in getAddressAsIn6Addr()
100 const struct in_addr& IpPrefix::getAddressAsInAddr() const in getAddressAsInAddr()
105 bool IpPrefix::getAddressAsIn6Addr(struct in6_addr* addr) const in getAddressAsIn6Addr()
114 bool IpPrefix::getAddressAsInAddr(struct in_addr* addr) const in getAddressAsInAddr()
123 bool IpPrefix::isIpv6() const in isIpv6()
128 bool IpPrefix::isIpv4() const in isIpv4()
133 int32_t IpPrefix::getPrefixLength() const in getPrefixLength()
138 void IpPrefix::setAddress(const struct in6_addr& addr) in setAddress()
[all …]
/frameworks/base/lowpan/java/android/net/lowpan/
DILowpanInterface.aidl19 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()
DILowpanInterfaceListener.aidl19 import android.net.IpPrefix;
36 oneway void onLinkNetworkAdded(in IpPrefix value); in onLinkNetworkAdded()
38 oneway void onLinkNetworkRemoved(in IpPrefix value); in onLinkNetworkRemoved()
DLowpanInterface.java22 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()
DLowpanCommissioningSession.java21 import android.net.IpPrefix;
101 public void onLinkNetworkAdded(IpPrefix value) {} in onLinkNetworkAdded()
104 public void onLinkNetworkRemoved(IpPrefix value) {} in onLinkNetworkRemoved()
/frameworks/base/services/net/java/android/net/shared/
DInitialConfiguration.java25 import android.net.IpPrefix;
40 public final Set<IpPrefix> directlyConnectedRoutes = new HashSet<>();
135 for (IpPrefix prefix : directlyConnectedRoutes) { in isProvisionedBy()
151 p.directlyConnectedRoutes = directlyConnectedRoutes.toArray(new IpPrefix[0]); in toStableParcelable()
180 private static boolean isDirectlyConnectedRoute(RouteInfo route, IpPrefix prefix) { in isDirectlyConnectedRoute()
188 private static boolean isPrefixLengthCompliant(IpPrefix prefix) { in isPrefixLengthCompliant()
197 private static boolean isIPv4(IpPrefix prefix) { in isIPv4()
205 private static boolean isIPv6DefaultRoute(IpPrefix prefix) { in isIPv6DefaultRoute()
/frameworks/base/services/net/java/android/net/ip/
DRouterAdvertisementDaemon.java28 import android.net.IpPrefix;
134 public HashSet<IpPrefix> prefixes;
141 prefixes = new HashSet<IpPrefix>(); in RaParams()
161 for (IpPrefix ipp : oldRa.prefixes) { in getDeprecatedRaParams()
179 private final HashMap<IpPrefix, Integer> mPrefixes = new HashMap<>();
182 Set<IpPrefix> getPrefixes() { return mPrefixes.keySet(); } in getPrefixes()
184 void putPrefixes(Set<IpPrefix> prefixes) { in putPrefixes()
185 for (IpPrefix ipp : prefixes) { in putPrefixes()
190 void removePrefixes(Set<IpPrefix> prefixes) { in removePrefixes()
191 for (IpPrefix ipp : prefixes) { in removePrefixes()
[all …]
DIpServer.java30 import android.net.IpPrefix;
532 final IpPrefix prefix = new IpPrefix( in updateUpstreamIPv6LinkProperties()
550 HashSet<IpPrefix> deprecatedPrefixes, HashSet<IpPrefix> newPrefixes) { in configureLocalIPv6Routes()
570 HashSet<IpPrefix> addedPrefixes = (HashSet) newPrefixes.clone(); in configureLocalIPv6Routes()
976 String ifname, HashSet<IpPrefix> prefixes) { in getLocalRoutesFor()
978 for (IpPrefix ipp : prefixes) { in getLocalRoutesFor()
985 private static Inet6Address getLocalDnsIpFor(IpPrefix localPrefix) { in getLocalDnsIpFor()
/frameworks/base/tests/net/java/android/net/shared/
DInitialConfigurationTest.java26 import android.net.IpPrefix;
54 new IpPrefix(parseNumericAddress("192.168.46.46"), 17), in setUp()
55 new IpPrefix(parseNumericAddress("2001:db8::46"), 34))); in setUp()
77 new IpPrefix(parseNumericAddress("192.168.46.46"), 32))); in testEquals()
/frameworks/base/services/net/java/android/net/
DInitialConfigurationParcelable.aidl19 import android.net.IpPrefix;
24 IpPrefix[] directlyConnectedRoutes;
/frameworks/base/services/core/java/com/android/server/connectivity/tethering/
DIPv6TetheringCoordinator.java20 import android.net.IpPrefix;
229 final IpPrefix destination = routeInfo.getDestination(); in getIPv6OnlyLinkProperties()
262 final IpPrefix local48 = makeUniqueLocalPrefix(ulp, (short) 0, 48); in getUniqueLocalConfig()
265 final IpPrefix local64 = makeUniqueLocalPrefix(ulp, subnetId, 64); in getUniqueLocalConfig()
275 private static IpPrefix makeUniqueLocalPrefix(byte[] in6addr, short subnetId, int prefixlen) { in makeUniqueLocalPrefix()
279 return new IpPrefix(bytes, prefixlen); in makeUniqueLocalPrefix()
DUpstreamNetworkMonitor.java30 import android.net.IpPrefix;
94 private HashSet<IpPrefix> mLocalPrefixes;
277 public Set<IpPrefix> getLocalPrefixes() { in getLocalPrefixes()
278 return (Set<IpPrefix>) mLocalPrefixes.clone(); in getLocalPrefixes()
383 final HashSet<IpPrefix> localPrefixes = allLocalPrefixes(mNetworkMap.values()); in recomputeLocalPrefixes()
528 private static HashSet<IpPrefix> allLocalPrefixes(Iterable<NetworkState> netStates) { in allLocalPrefixes()
529 final HashSet<IpPrefix> prefixSet = new HashSet<>(); in allLocalPrefixes()
DOffloadController.java28 import android.net.IpPrefix;
91 private Set<IpPrefix> mExemptPrefixes;
379 public void setLocalPrefixes(Set<IpPrefix> localPrefixes) { in setLocalPrefixes()
514 Set<IpPrefix> localPrefixes, LinkProperties upstreamLinkProperties) { in computeLocalPrefixStrings()
516 final Set<IpPrefix> prefixSet = new HashSet<>(localPrefixes); in computeLocalPrefixStrings()
532 prefixSet.add(new IpPrefix(ip, 128)); in computeLocalPrefixStrings()
537 for (IpPrefix pfx : prefixSet) localPrefixStrs.add(pfx.toString()); in computeLocalPrefixStrings()
/frameworks/base/tests/net/java/com/android/server/connectivity/tethering/
DOffloadControllerTest.java48 import android.net.IpPrefix;
239 final Set<IpPrefix> minimumLocalPrefixes = new HashSet<>(); in testSetUpstreamLinkPropertiesWorking()
242 minimumLocalPrefixes.add(new IpPrefix(s)); in testSetUpstreamLinkPropertiesWorking()
276 lp.addRoute(new RouteInfo(new IpPrefix("192.0.2.0/24"))); in testSetUpstreamLinkPropertiesWorking()
355 lp.addRoute(new RouteInfo(new IpPrefix("2001:db8::/64"))); in testSetUpstreamLinkPropertiesWorking()
581 usbLinkProperties.addRoute(new RouteInfo(new IpPrefix(USB_PREFIX))); in testAddRemoveDownstreams()
587 usbLinkProperties.addRoute(new RouteInfo(new IpPrefix(IPV6_LINKLOCAL))); in testAddRemoveDownstreams()
595 usbLinkProperties.addRoute(new RouteInfo(new IpPrefix(IPV6_DOC_PREFIX))); in testAddRemoveDownstreams()
608 usbLinkProperties.removeRoute(new RouteInfo(new IpPrefix(IPV6_DOC_PREFIX), null, RNDIS0)); in testAddRemoveDownstreams()
609 usbLinkProperties.addRoute(new RouteInfo(new IpPrefix(IPV6_DISCARD_PREFIX))); in testAddRemoveDownstreams()
[all …]
/frameworks/base/tests/net/java/com/android/server/connectivity/
DNat464XlatTest.java33 import android.net.IpPrefix;
142 mNai.linkProperties.setNat64Prefix(new IpPrefix("2001:db8:0:64::/96"));
184 nat.setNat64Prefix(new IpPrefix(NAT64_PREFIX));
225 nat.setNat64Prefix(new IpPrefix(NAT64_PREFIX));
312 nat.setNat64Prefix(new IpPrefix(NAT64_PREFIX));
351 nat.setNat64Prefix(new IpPrefix(NAT64_PREFIX));
383 nat.setNat64Prefix(new IpPrefix(NAT64_PREFIX));

123