Home
last modified time | relevance | path

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

12

/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/libs/net/common/framework/com/android/net/module/util/
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.java89 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 …]
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.java221 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()
DINetdEventCallback.aidl59 int prefixLength); in onNat64PrefixEvent() argument
DIConnectivityManager.aidl202 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/
DTetheredClientTest.kt34 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/
DRouterAdvertisementDaemon.java500 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);
DIpServer.java474 intToInet4AddressHTH(lease.netAddr), lease.prefixLength, in onLeasesChanged()
/frameworks/base/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/
DWifiConfigurationHelper.java250 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/
DBaseNetdEventCallback.java36 int prefixLength) { in onNat64PrefixEvent() argument
/frameworks/libs/net/common/tests/unit/src/com/android/net/module/util/
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.java1667 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/
DConnectedClientsTrackerTest.kt67 AddressInfo(LinkAddress(it.address, it.prefixLength, it.flags, it.scope, in makeAddrInfo()
DBpfCoordinatorTest.java318 && (128 == parcel.prefixLength) in matches()
/frameworks/base/packages/Tethering/src/com/android/networkstack/tethering/
DBpfCoordinator.java494 parcel.prefixLength = 128; in toTetherOffloadRuleParcel()
/frameworks/base/services/core/java/com/android/server/
DConnectivityService.java1963 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()
DNetworkManagementService.java774 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/
DIpServerTest.java177 mInterfaceConfiguration.prefixLength = BLUETOOTH_DHCP_PREFIX_LENGTH; in initStateMachine()
698 && (128 == parcel.prefixLength) in matches()
/frameworks/av/media/libstagefright/
DACodec.cpp7798 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()

12