Home
last modified time | relevance | path

Searched refs:prefixLength (Results 1 – 23 of 23) sorted by relevance

/frameworks/base/core/java/android/net/shared/
DInet4AddressUtils.java90 public static int prefixLengthToV4NetmaskIntHTH(int prefixLength) in prefixLengthToV4NetmaskIntHTH() argument
92 if (prefixLength < 0 || prefixLength > 32) { in prefixLengthToV4NetmaskIntHTH()
96 return prefixLength == 0 ? 0 : 0xffffffff << (32 - prefixLength); in prefixLengthToV4NetmaskIntHTH()
106 public static int prefixLengthToV4NetmaskIntHTL(int prefixLength) in prefixLengthToV4NetmaskIntHTL() argument
108 return Integer.reverseBytes(prefixLengthToV4NetmaskIntHTH(prefixLength)); in prefixLengthToV4NetmaskIntHTL()
121 int prefixLength = Integer.bitCount(i); in netmaskToPrefixLength() local
123 if (trailingZeros != 32 - prefixLength) { in netmaskToPrefixLength()
126 return prefixLength; in netmaskToPrefixLength()
150 public static Inet4Address getBroadcastAddress(Inet4Address addr, int prefixLength) in getBroadcastAddress() argument
153 | ~prefixLengthToV4NetmaskIntHTH(prefixLength); in getBroadcastAddress()
[all …]
/frameworks/base/core/java/android/net/
DIpPrefix.java55 private final int prefixLength; field in IpPrefix
62 NetworkUtils.maskRawAddress(address, prefixLength); in checkAndMaskAddressAndPrefixLength()
75 public IpPrefix(@NonNull byte[] address, @IntRange(from = 0, to = 128) int prefixLength) { in IpPrefix()
77 this.prefixLength = prefixLength; in IpPrefix()
92 public IpPrefix(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength) { in IpPrefix()
96 this.prefixLength = prefixLength; in IpPrefix()
118 this.prefixLength = ipAndMask.second; in IpPrefix()
135 return Arrays.equals(this.address, that.address) && this.prefixLength == that.prefixLength; in equals()
145 return Arrays.hashCode(address) + 11 * prefixLength; in hashCode()
181 return prefixLength; in getPrefixLength()
[all …]
DLinkAddress.java71 private int prefixLength; field in LinkAddress
155 private void init(InetAddress address, int prefixLength, int flags, int scope) { in init() argument
158 prefixLength < 0 || in init()
159 (address instanceof Inet4Address && prefixLength > 32) || in init()
160 (prefixLength > 128)) { in init()
162 "/" + prefixLength); in init()
165 this.prefixLength = prefixLength; in init()
182 public LinkAddress(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength, in LinkAddress()
184 init(address, prefixLength, flags, scope); in LinkAddress()
197 @IntRange(from = 0, to = 128) int prefixLength) { in LinkAddress()
[all …]
DVpnService.java301 public boolean addAddress(InetAddress address, int prefixLength) { in addAddress() argument
302 check(address, prefixLength); in addAddress()
304 return getService().addVpnAddress(address.getHostAddress(), prefixLength); in addAddress()
331 public boolean removeAddress(InetAddress address, int prefixLength) { in removeAddress() argument
332 check(address, prefixLength); in removeAddress()
334 return getService().removeVpnAddress(address.getHostAddress(), prefixLength); in removeAddress()
457 private static void check(InetAddress address, int prefixLength) { in check() argument
462 if (prefixLength < 0 || prefixLength > 32) { in check()
466 if (prefixLength < 0 || prefixLength > 128) { in check()
551 public Builder addAddress(@NonNull InetAddress address, int prefixLength) { in addAddress() argument
[all …]
DNetworkUtils.java203 public static int prefixLengthToNetmaskInt(int prefixLength) in prefixLengthToNetmaskInt() argument
205 return Inet4AddressUtils.prefixLengthToV4NetmaskIntHTL(prefixLength); in prefixLengthToNetmaskInt()
252 public static void maskRawAddress(byte[] array, int prefixLength) { in maskRawAddress() argument
253 if (prefixLength < 0 || prefixLength > array.length * 8) { in maskRawAddress()
255 " bytes has invalid prefix length " + prefixLength); in maskRawAddress()
258 int offset = prefixLength / 8; in maskRawAddress()
259 int remainder = prefixLength % 8; in maskRawAddress()
276 public static InetAddress getNetworkPart(InetAddress address, int prefixLength) { in getNetworkPart() argument
278 maskRawAddress(array, prefixLength); in getNetworkPart()
304 int prefixLength = -1; in parseIpAndMask() local
[all …]
DDhcpResults.java209 public boolean setIpAddress(String addrString, int prefixLength) { in setIpAddress() argument
212 ipAddress = new LinkAddress(addr, prefixLength); in setIpAddress()
214 Log.e(TAG, "setIpAddress failed with addrString " + addrString + "/" + prefixLength); in setIpAddress()
DINetdEventCallback.aidl59 int prefixLength); in onNat64PrefixEvent() argument
DIConnectivityManager.aidl192 boolean addVpnAddress(String address, int prefixLength); in addVpnAddress() argument
193 boolean removeVpnAddress(String address, int prefixLength); in removeVpnAddress() argument
/frameworks/base/services/net/java/android/net/ip/
DRouterAdvertisementDaemon.java485 final int prefixLength = ipp.getPrefixLength();
486 if (prefixLength != 64) {
499 .put(asByte(prefixLength))
523 final int prefixLength = ipp.getPrefixLength();
524 if (prefixLength > 64) {
529 (prefixLength == 0) ? 1 : (prefixLength <= 8) ? 2 : 3);
534 .put(asByte(prefixLength))
539 if (prefixLength > 0) {
540 ra.put(addr, 0, (prefixLength <= 64) ? 8 : 16);
DInterfaceController.java55 ifConfig.prefixLength = addr.getPrefixLength(); in setInterfaceAddress()
62 ifConfig.ipv4Addr, ifConfig.prefixLength, e); in setInterfaceAddress()
/frameworks/base/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/
DWifiConfigurationHelper.java244 int prefixLength = getPrefixLength(jsonConfig.getInt("prefix_length")); in getWifiConfiguration() local
245 staticIpConfig.ipAddress = new LinkAddress(ipAddress, prefixLength); in getWifiConfiguration()
348 private static int getPrefixLength(int prefixLength) { in getPrefixLength() argument
349 if (prefixLength < 0 || prefixLength > 32) { in getPrefixLength()
352 return prefixLength; in getPrefixLength()
/frameworks/base/services/net/java/android/net/shared/
DInitialConfiguration.java192 private static boolean isCompliantIPv6PrefixLength(int prefixLength) { in isCompliantIPv6PrefixLength() argument
193 return (RFC6177_MIN_PREFIX_LENGTH <= prefixLength) in isCompliantIPv6PrefixLength()
194 && (prefixLength <= RFC7421_PREFIX_LENGTH); in isCompliantIPv6PrefixLength()
/frameworks/base/tests/net/java/android/net/ip/
DInterfaceControllerTest.java73 assertEquals(TEST_PREFIXLENGTH, parcel.prefixLength); in testSetIPv4Address()
85 assertEquals(0, parcel.prefixLength); in testClearIPv4Address()
/frameworks/base/core/java/com/android/server/net/
DBaseNetdEventCallback.java36 int prefixLength) { in onNat64PrefixEvent() argument
/frameworks/base/tests/net/java/android/net/shared/
DInet4AddressUtilsTest.java119 private void checkAddressMasking(String expectedAddr, String addr, int prefixLength) { in checkAddressMasking() argument
120 final int prefix = prefixLengthToV4NetmaskIntHTH(prefixLength); in checkAddressMasking()
/frameworks/base/core/java/android/app/
DApplicationErrorReport.java398 int prefixLength = 10 * 1024; in sanitizeString() local
400 int acceptableLength = prefixLength + suffixLength; in sanitizeString()
407 sb.append(s.substring(0, prefixLength)); in sanitizeString()
/frameworks/base/services/core/java/com/android/server/connectivity/
DNetdEventListenerService.java219 boolean added, String prefixString, int prefixLength) in onNat64PrefixEvent() argument
223 callback.onNat64PrefixEvent(netId, added, prefixString, prefixLength); in onNat64PrefixEvent()
DVpn.java1513 public synchronized boolean addAddress(String address, int prefixLength) { in addAddress() argument
1517 boolean success = jniAddAddress(mInterface, address, prefixLength); in addAddress()
1522 public synchronized boolean removeAddress(String address, int prefixLength) { in removeAddress() argument
1526 boolean success = jniDelAddress(mInterface, address, prefixLength); in removeAddress()
/frameworks/base/services/core/java/com/android/server/
DConnectivityService.java1797 String prefixString, int prefixLength) {
1798 mHandler.post(() -> handleNat64PrefixEvent(netId, added, prefixString, prefixLength));
2891 int prefixLength) { in handleNat64PrefixEvent() argument
2896 (added ? "added" : "removed"), netId, prefixString, prefixLength)); in handleNat64PrefixEvent()
2902 prefixLength); in handleNat64PrefixEvent()
2904 loge("Invalid NAT64 prefix " + prefixString + "/" + prefixLength); in handleNat64PrefixEvent()
6812 public boolean addVpnAddress(String address, int prefixLength) { in addVpnAddress() argument
6816 return mVpns.get(user).addAddress(address, prefixLength); in addVpnAddress()
6821 public boolean removeVpnAddress(String address, int prefixLength) { in removeVpnAddress() argument
6825 return mVpns.get(user).removeAddress(address, prefixLength); in removeVpnAddress()
DNetworkManagementService.java767 cfgParcel.prefixLength = cfg.getLinkAddress().getPrefixLength(); in toStableParcel()
785 cfg.setLinkAddress(new LinkAddress(addr, p.prefixLength)); in fromStableParcel()
/frameworks/av/media/libstagefright/
DACodec.cpp7767 constexpr size_t prefixLength = sizeof(prefix) - 1; in setVendorParameters() local
7775 if (key != nullptr && !strncmp(key, prefix, prefixLength) in setVendorParameters()
7779 && strlen(key + prefixLength) < sizeof(reducedKey) in setVendorParameters()
7783 strcpy(reducedKey, key + prefixLength); in setVendorParameters()
7908 constexpr size_t prefixLength = sizeof(prefix) - 1; in getVendorParameters() local
7910 sizeof(OMX_CONFIG_ANDROID_VENDOR_PARAMTYPE::cKey) + prefixLength]; in getVendorParameters()
7931 strcpy(key + prefixLength, (const char *)config->cName); in getVendorParameters()
/frameworks/base/config/
Dboot-image-profile.txt26249 HSPLjava/io/UnixFileSystem;->prefixLength(Ljava/lang/String;)I
28169 HSPLjava/time/format/DateTimeFormatterBuilder$PrefixTree;->prefixLength(Ljava/lang/String;)I
Dhiddenapi-greylist-max-o.txt31036 Landroid/icu/text/NFRule;->prefixLength(Ljava/lang/String;Ljava/lang/String;)I
31656 Landroid/icu/text/RbnfLenientScanner;->prefixLength(Ljava/lang/String;Ljava/lang/String;)I
46766 Landroid/net/IpPrefix;->prefixLength:I
114017 Ljava/time/format/DateTimeFormatterBuilder$PrefixTree;->prefixLength(Ljava/lang/String;)I