/frameworks/base/core/java/android/net/shared/ |
D | Inet4AddressUtils.java | 90 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/libs/net/common/framework/com/android/net/module/util/ |
D | Inet4AddressUtils.java | 90 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/ |
D | IpPrefix.java | 55 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 …]
|
D | LinkAddress.java | 89 private int prefixLength; field in LinkAddress 192 private void init(InetAddress address, int prefixLength, int flags, int scope, in init() argument 196 prefixLength < 0 || in init() 197 (address instanceof Inet4Address && prefixLength > 32) || in init() 198 (prefixLength > 128)) { in init() 200 "/" + prefixLength); in init() 227 this.prefixLength = prefixLength; in init() 247 public LinkAddress(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength, in LinkAddress() 249 init(address, prefixLength, flags, scope, LIFETIME_UNKNOWN, LIFETIME_UNKNOWN); in LinkAddress() 279 public LinkAddress(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength, in LinkAddress() [all …]
|
D | VpnService.java | 301 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 …]
|
D | NetworkUtils.java | 203 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 …]
|
D | DhcpResults.java | 221 public boolean setIpAddress(String addrString, int prefixLength) { in setIpAddress() argument 224 ipAddress = new LinkAddress(addr, prefixLength); in setIpAddress() 226 Log.e(TAG, "setIpAddress failed with addrString " + addrString + "/" + prefixLength); in setIpAddress()
|
D | INetdEventCallback.aidl | 59 int prefixLength); in onNat64PrefixEvent() argument
|
D | IConnectivityManager.aidl | 202 boolean addVpnAddress(String address, int prefixLength); in addVpnAddress() argument 203 boolean removeVpnAddress(String address, int prefixLength); in removeVpnAddress() argument
|
/frameworks/base/packages/Tethering/tests/unit/common/android/net/ |
D | TetheredClientTest.kt | 34 private val TEST_ADDR1 = makeLinkAddress("192.168.113.3", prefixLength = 24, expTime = 123L) 35 private val TEST_ADDR2 = makeLinkAddress("fe80::1:2:3", prefixLength = 64, expTime = 456L) 41 private fun makeLinkAddress(addr: String, prefixLength: Int, expTime: Long) = LinkAddress( in makeLinkAddress() 43 prefixLength, in makeLinkAddress()
|
/frameworks/base/packages/Tethering/src/android/net/ip/ |
D | RouterAdvertisementDaemon.java | 500 final int prefixLength = ipp.getPrefixLength(); 501 if (prefixLength != 64) { 514 .put(asByte(prefixLength)) 538 final int prefixLength = ipp.getPrefixLength(); 539 if (prefixLength > 64) { 544 (prefixLength == 0) ? 1 : (prefixLength <= 8) ? 2 : 3); 549 .put(asByte(prefixLength)) 554 if (prefixLength > 0) { 555 ra.put(addr, 0, (prefixLength <= 64) ? 8 : 16);
|
D | IpServer.java | 474 intToInet4AddressHTH(lease.netAddr), lease.prefixLength, in onLeasesChanged()
|
/frameworks/base/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/ |
D | WifiConfigurationHelper.java | 250 int prefixLength = getPrefixLength(jsonConfig.getInt("prefix_length")); in getWifiConfiguration() local 251 staticIpConfig.ipAddress = new LinkAddress(ipAddress, prefixLength); in getWifiConfiguration() 355 private static int getPrefixLength(int prefixLength) { in getPrefixLength() argument 356 if (prefixLength < 0 || prefixLength > 32) { in getPrefixLength() 359 return prefixLength; in getPrefixLength()
|
/frameworks/base/core/java/com/android/server/net/ |
D | BaseNetdEventCallback.java | 36 int prefixLength) { in onNat64PrefixEvent() argument
|
/frameworks/libs/net/common/tests/unit/src/com/android/net/module/util/ |
D | Inet4AddressUtilsTest.java | 119 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/ |
D | ApplicationErrorReport.java | 398 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/ |
D | NetdEventListenerService.java | 219 boolean added, String prefixString, int prefixLength) in onNat64PrefixEvent() argument 223 callback.onNat64PrefixEvent(netId, added, prefixString, prefixLength); in onNat64PrefixEvent()
|
D | Vpn.java | 1667 public synchronized boolean addAddress(String address, int prefixLength) { 1671 boolean success = jniAddAddress(mInterface, address, prefixLength); 1676 public synchronized boolean removeAddress(String address, int prefixLength) { 1680 boolean success = jniDelAddress(mInterface, address, prefixLength);
|
/frameworks/base/packages/Tethering/tests/unit/src/com/android/networkstack/tethering/ |
D | ConnectedClientsTrackerTest.kt | 67 AddressInfo(LinkAddress(it.address, it.prefixLength, it.flags, it.scope, in makeAddrInfo()
|
D | BpfCoordinatorTest.java | 318 && (128 == parcel.prefixLength) in matches()
|
/frameworks/base/packages/Tethering/src/com/android/networkstack/tethering/ |
D | BpfCoordinator.java | 494 parcel.prefixLength = 128; in toTetherOffloadRuleParcel()
|
/frameworks/base/services/core/java/com/android/server/ |
D | ConnectivityService.java | 1963 String prefixString, int prefixLength) { 1964 mHandler.post(() -> handleNat64PrefixEvent(netId, added, prefixString, prefixLength)); 3195 int prefixLength) { in handleNat64PrefixEvent() argument 3200 (added ? "added" : "removed"), netId, prefixString, prefixLength)); in handleNat64PrefixEvent() 3206 prefixLength); in handleNat64PrefixEvent() 3208 loge("Invalid NAT64 prefix " + prefixString + "/" + prefixLength); in handleNat64PrefixEvent() 7439 public boolean addVpnAddress(String address, int prefixLength) { in addVpnAddress() argument 7443 return mVpns.get(user).addAddress(address, prefixLength); in addVpnAddress() 7448 public boolean removeVpnAddress(String address, int prefixLength) { in removeVpnAddress() argument 7452 return mVpns.get(user).removeAddress(address, prefixLength); in removeVpnAddress()
|
D | NetworkManagementService.java | 774 cfgParcel.prefixLength = cfg.getLinkAddress().getPrefixLength(); in toStableParcel() 792 cfg.setLinkAddress(new LinkAddress(addr, p.prefixLength)); in fromStableParcel()
|
/frameworks/base/packages/Tethering/tests/unit/src/android/net/ip/ |
D | IpServerTest.java | 177 mInterfaceConfiguration.prefixLength = BLUETOOTH_DHCP_PREFIX_LENGTH; in initStateMachine() 698 && (128 == parcel.prefixLength) in matches()
|
/frameworks/av/media/libstagefright/ |
D | ACodec.cpp | 7798 constexpr size_t prefixLength = sizeof(prefix) - 1; in setVendorParameters() local 7806 if (key != nullptr && !strncmp(key, prefix, prefixLength) in setVendorParameters() 7810 && strlen(key + prefixLength) < sizeof(reducedKey) in setVendorParameters() 7814 strcpy(reducedKey, key + prefixLength); in setVendorParameters() 7939 constexpr size_t prefixLength = sizeof(prefix) - 1; in getVendorParameters() local 7941 sizeof(OMX_CONFIG_ANDROID_VENDOR_PARAMTYPE::cKey) + prefixLength]; in getVendorParameters() 7962 strcpy(key + prefixLength, (const char *)config->cName); in getVendorParameters()
|