Home
last modified time | relevance | path

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

12

/frameworks/libs/net/common/src_frameworkcommon/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.java204 public static int prefixLengthToNetmaskInt(int prefixLength) in prefixLengthToNetmaskInt() argument
206 return Inet4AddressUtils.prefixLengthToV4NetmaskIntHTL(prefixLength); in prefixLengthToNetmaskInt()
253 public static void maskRawAddress(byte[] array, int prefixLength) { in maskRawAddress() argument
254 if (prefixLength < 0 || prefixLength > array.length * 8) { in maskRawAddress()
256 " bytes has invalid prefix length " + prefixLength); in maskRawAddress()
259 int offset = prefixLength / 8; in maskRawAddress()
260 int remainder = prefixLength % 8; in maskRawAddress()
277 public static InetAddress getNetworkPart(InetAddress address, int prefixLength) { in getNetworkPart() argument
279 maskRawAddress(array, prefixLength); in getNetworkPart()
305 int prefixLength = -1; in parseIpAndMask() local
[all …]
DDhcpResults.java222 public boolean setIpAddress(String addrString, int prefixLength) { in setIpAddress() argument
225 ipAddress = new LinkAddress(addr, prefixLength); in setIpAddress()
227 Log.e(TAG, "setIpAddress failed with addrString " + addrString + "/" + prefixLength); in setIpAddress()
DINetdEventCallback.aidl59 int prefixLength); in onNat64PrefixEvent() argument
DIConnectivityManager.aidl201 boolean addVpnAddress(String address, int prefixLength); in addVpnAddress() argument
202 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.java467 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/opt/net/wifi/service/java/com/android/server/wifi/util/
DNetdWrapper.java282 cfgParcel.prefixLength = cfg.getLinkAddress().getPrefixLength(); in toStableParcel()
300 cfg.setLinkAddress(new LinkAddress(addr, p.prefixLength)); in fromStableParcel()
/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.java1962 String prefixString, int prefixLength) {
1963 mHandler.post(() -> handleNat64PrefixEvent(netId, added, prefixString, prefixLength));
3203 int prefixLength) { in handleNat64PrefixEvent() argument
3208 (added ? "added" : "removed"), netId, prefixString, prefixLength)); in handleNat64PrefixEvent()
3214 prefixLength); in handleNat64PrefixEvent()
3216 loge("Invalid NAT64 prefix " + prefixString + "/" + prefixLength); in handleNat64PrefixEvent()
7454 public boolean addVpnAddress(String address, int prefixLength) { in addVpnAddress() argument
7458 return mVpns.get(user).addAddress(address, prefixLength); in addVpnAddress()
7463 public boolean removeVpnAddress(String address, int prefixLength) { in removeVpnAddress() argument
7467 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.java187 mInterfaceConfiguration.prefixLength = BLUETOOTH_DHCP_PREFIX_LENGTH; in initStateMachine()
692 && (128 == parcel.prefixLength) in matches()
/frameworks/av/media/libstagefright/
DACodec.cpp7888 constexpr size_t prefixLength = sizeof(prefix) - 1; in setVendorParameters() local
7896 if (key != nullptr && !strncmp(key, prefix, prefixLength) in setVendorParameters()
7900 && strlen(key + prefixLength) < sizeof(reducedKey) in setVendorParameters()
7904 strcpy(reducedKey, key + prefixLength); in setVendorParameters()
8029 constexpr size_t prefixLength = sizeof(prefix) - 1; in getVendorParameters() local
8031 sizeof(OMX_CONFIG_ANDROID_VENDOR_PARAMTYPE::cKey) + prefixLength]; in getVendorParameters()
8052 strcpy(key + prefixLength, (const char *)config->cName); in getVendorParameters()

12