Home
last modified time | relevance | path

Searched refs:mac (Results 1 – 25 of 77) sorted by relevance

1234

/packages/modules/Connectivity/tests/unit/java/android/net/
DMacAddressTest.java93 String mac = pair[0]; in testToOuiString() local
95 assertEquals(expected, MacAddress.fromString(mac).toOuiString()); in testToOuiString()
108 for (String mac : macs) { in testHexPaddingWhenPrinting()
109 assertEquals(mac, MacAddress.fromString(mac).toString()); in testHexPaddingWhenPrinting()
110 assertEquals(mac, in testHexPaddingWhenPrinting()
111 MacAddress.stringAddrFromByteAddr(MacAddress.byteAddrFromStringAddr(mac))); in testHexPaddingWhenPrinting()
129 for (MacAddress mac : multicastAddresses) { in testIsMulticastAddress()
130 String msg = mac.toString() + " expected to be a multicast address"; in testIsMulticastAddress()
131 assertTrue(msg, MacAddressUtils.isMulticastAddress(mac)); in testIsMulticastAddress()
133 for (MacAddress mac : unicastAddresses) { in testIsMulticastAddress()
[all …]
/packages/modules/Connectivity/tests/cts/net/src/android/net/cts/
DMacAddressTest.java92 MacAddress mac = MacAddress.fromString(tc.macAddress); in testMacAddress() local
94 if (!tc.ouiString.equals(mac.toOuiString())) { in testMacAddress()
96 tc.ouiString, mac.toOuiString())); in testMacAddress()
99 if (tc.isLocallyAssigned != mac.isLocallyAssigned()) { in testMacAddress()
100 fail(String.format("expected %s to be %s, got %s", mac, in testMacAddress()
102 localAssignedToString(mac.isLocallyAssigned()))); in testMacAddress()
105 if (tc.addressType != mac.getAddressType()) { in testMacAddress()
106 fail(String.format("expected %s address type to be %s, got %s", mac, in testMacAddress()
107 typeToString(tc.addressType), typeToString(mac.getAddressType()))); in testMacAddress()
110 if (!tc.macAddress.equals(mac.toString())) { in testMacAddress()
[all …]
/packages/modules/Connectivity/tests/unit/java/com/android/server/connectivity/
DNetdEventListenerServiceTest.java86 final byte[] mac = MAC_ADDR; in testWakeupEventLogging()
104 wakeupEvent(iface, uids[0], v4, tcp, mac, srcIp, dstIp, sport, dport, now); in testWakeupEventLogging()
105 wakeupEvent(iface, uids[1], v6, udp, mac, srcIp6, dstIp6, sport, dport, now); in testWakeupEventLogging()
106 wakeupEvent(iface, uids[2], v6, udp, mac, srcIp6, dstIp6, sport, dport, now); in testWakeupEventLogging()
107 wakeupEvent(iface, uids[3], v4, icmp6, mac, srcIp, dstIp, sport, dport, now); in testWakeupEventLogging()
108 wakeupEvent(iface, uids[4], v6, tcp, mac, srcIp6, dstIp6, sport, dport, now); in testWakeupEventLogging()
109 wakeupEvent(iface, uids[5], v4, tcp, mac, srcIp, dstIp, sport, dport, now); in testWakeupEventLogging()
110 wakeupEvent(iface, uids[6], v6, udp, mac, srcIp6, dstIp6, sport, dport, now); in testWakeupEventLogging()
111 wakeupEvent(iface, uids[7], v6, tcp, mac, srcIp6, dstIp6, sport, dport, now); in testWakeupEventLogging()
112 wakeupEvent(iface, uids[8], v6, udp, mac, srcIp6, dstIp6, sport, dport, now); in testWakeupEventLogging()
[all …]
DIpConnectivityMetricsTest.java332 final byte[] mac = {0x48, 0x7c, 0x2b, 0x6a, 0x3e, 0x4b}; in testEndToEndLogging()
341 wakeupEvent("wlan0", 1000, v4, tcp, mac, srcIp, dstIp, sport, dport, 1001L); in testEndToEndLogging()
342 wakeupEvent("wlan0", 10123, v4, tcp, mac, srcIp, dstIp, sport, dport, 1001L); in testEndToEndLogging()
343 wakeupEvent("wlan0", 1000, v4, udp, mac, srcIp, dstIp, sport, dport, 1001L); in testEndToEndLogging()
344 wakeupEvent("wlan0", 10008, v4, udp, mac, srcIp, dstIp, sport, dport, 1001L); in testEndToEndLogging()
345 wakeupEvent("wlan0", -1, v4, udp, mac, srcIp, dstIp, sport, dport, 1001L); in testEndToEndLogging()
346 wakeupEvent("wlan0", 10008, v4, tcp, mac, srcIp, dstIp, sport, dport, 1001L); in testEndToEndLogging()
608 void wakeupEvent(String iface, int uid, int ether, int ip, byte[] mac, String srcIp, in wakeupEvent() argument
611 mNetdListener.onWakeupEvent(prefix, uid, ether, ip, mac, srcIp, dstIp, sport, dport, now); in wakeupEvent()
/packages/modules/Bluetooth/system/types/
Draw_address.cc37 RawAddress::RawAddress(const std::array<uint8_t, kLength> mac) { in RawAddress() argument
38 std::copy(mac.begin(), mac.end(), address); in RawAddress()
58 std::array<uint8_t, kLength> mac; in ToArray() local
59 std::copy(std::begin(address), std::end(address), std::begin(mac)); in ToArray()
60 return mac; in ToArray()
/packages/modules/Wifi/service/java/com/android/server/wifi/hotspot2/
DUtils.java51 long mac = 0; in parseMac() local
56 mac = (mac << 4) | nibble; in parseMac()
63 return mac; in parseMac()
71 public static String macToSimpleString(long mac) { in macToSimpleString() argument
74 long b = (mac >>> (n * Byte.SIZE)) & BYTE_MASK; in macToSimpleString()
85 public static String macToString(long mac) { in macToString() argument
86 int len = (mac & ~EUI48Mask) != 0 ? EUI64Length : EUI48Length; in macToString()
95 long b = (mac >>> n) & Constants.BYTE_MASK; in macToString()
/packages/modules/Wifi/service/java/com/android/server/wifi/aware/
DWifiAwareClientState.java239 public void onInterfaceAddressChange(byte[] mac) { in onInterfaceAddressChange() argument
244 HexEncoding.encode(mac)) + ", mLastDiscoveryInterfaceMac=" in onInterfaceAddressChange()
247 if (mNotifyIdentityChange && !Arrays.equals(mac, mLastDiscoveryInterfaceMac)) { in onInterfaceAddressChange()
253 mCallback.onIdentityChanged(hasPermission ? mac : ALL_ZERO_MAC); in onInterfaceAddressChange()
259 mLastDiscoveryInterfaceMac = mac; in onInterfaceAddressChange()
272 public void onClusterChange(int flag, byte[] mac, byte[] currentDiscoveryInterfaceMac) { in onClusterChange() argument
277 HexEncoding.encode(mac)) + ", currentDiscoveryInterfaceMac=" in onClusterChange()
DWifiAwareDataPathStateManager.java383 public boolean onDataPathRequest(int pubSubId, byte[] mac, int ndpId, in onDataPathRequest() argument
388 HexEncoding.encode(mac)) + ", ndpId=" + ndpId); in onDataPathRequest()
442 if (Arrays.equals(requestInfo.specifiedPeerDiscoveryMac, mac) && requestInfo.state in onDataPathRequest()
465 + ", mac=" + String.valueOf(HexEncoding.encode(mac))); in onDataPathRequest()
487 ndpInfo.peerDiscoveryMac = mac; in onDataPathRequest()
575 public boolean onDataPathConfirm(int ndpId, byte[] mac, boolean accept, in onDataPathConfirm() argument
579 HexEncoding.encode(mac)) + ", accept=" + accept + ", reason=" + reason in onDataPathConfirm()
614 ndpInfo.peerDataMac = mac; in onDataPathConfirm()
660 handleAddressValidation(nnri, ndpInfo, networkSpecifier.isOutOfBand(), mac); in onDataPathConfirm()
677 private void getInet6Address(NdpInfo ndpInfo, byte[] mac, String interfaceName) { in getInet6Address() argument
[all …]
/packages/modules/IPsec/src/java/com/android/internal/net/eap/statemachine/
DEapSimAkaMethodStateMachine.java280 byte[] mac = getMac(message.eapCode, message.eapIdentifier, typeData, extraData); in isValidMac()
285 boolean isValidMac = Arrays.equals(mac, atMac.mac); in isValidMac()
291 + " received=" + Log.byteArrayToHexString(atMac.mac) in isValidMac()
292 + ", computed=" + Log.byteArrayToHexString(mac)); in isValidMac()
441 byte[] mac = mMacAlgorithm.doFinal(buffer.array()); in getMac()
446 return Arrays.copyOfRange(mac, 0, AtMac.MAC_LENGTH); in getMac()
472 byte[] mac = getMac(EAP_CODE_RESPONSE, identifier, eapSimAkaTypeData, extraData); in buildResponseMessageWithMac()
474 eapSimAkaTypeData.attributeMap.put(EAP_AT_MAC, new AtMac(mac)); in buildResponseMessageWithMac()
533 byte[] mac = getMac(EAP_CODE_REQUEST, identifier, eapSimAkaTypeData, new byte[0]); in handleEapSimAkaNotification()
536 if (!Arrays.equals(mac, atMac.mac)) { in handleEapSimAkaNotification()
DEapAkaPrimeMethodStateMachine.java332 Mac mac = Mac.getInstance(MAC_ALGORITHM_STRING); in deriveCkIkPrime() local
333 mac.init(new SecretKeySpec(key.array(), MAC_ALGORITHM_STRING)); in deriveCkIkPrime()
334 return mac.doFinal(dataToSign.array()); in deriveCkIkPrime()
/packages/modules/ExtServices/java/src/android/ext/services/displayhash/
DHmacKeyManager.java43 Mac mac = Mac.getInstance(ALGORITHM); in generateHmac() local
45 mac.init(keySpec); in generateHmac()
49 mac.update(object.convertToBytes()); in generateHmac()
51 return mac.doFinal(); in generateHmac()
/packages/modules/IPsec/src/java/com/android/internal/net/eap/crypto/
DHmacSha256ByteSigner.java49 Mac mac = Mac.getInstance(MAC_ALGORITHM_STRING); in signBytes() local
50 mac.init(new SecretKeySpec(keyBytes, MAC_ALGORITHM_STRING)); in signBytes()
51 return mac.doFinal(dataToSign); in signBytes()
/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/eap/message/simaka/attributes/
DAtMacTest.java60 assertArrayEquals(new byte[MAC_LENGTH], atMac.mac); in testConstructor()
68 assertArrayEquals(MAC_BYTES, atMac.mac); in testParameterizedConstructor()
90 assertArrayEquals(MAC_BYTES, atMac.mac); in testDecode()
118 assertArrayEquals(new byte[MAC_LENGTH], clearedMac.mac); in testGetAtMacWithMacCleared()
/packages/modules/Connectivity/nearby/service/java/com/android/server/nearby/common/bluetooth/fastpair/
DHmacSha256.java80 Mac mac = Mac.getInstance("HmacSHA256"); in buildWith64BytesKey() local
82 mac.init(keySpec); in buildWith64BytesKey()
84 return mac.doFinal(data); in buildWith64BytesKey()
/packages/modules/Wifi/service/java/com/android/server/wifi/
DSoftApBackupRestore.java267 byte[] mac = iterator.next().toByteArray(); in writeMacAddressList()
268 out.write(mac, 0, ETHER_ADDR_LEN); in writeMacAddressList()
276 byte[] mac = new byte[ETHER_ADDR_LEN]; in macAddressListFromByteArray()
277 in.read(mac, 0, ETHER_ADDR_LEN); in macAddressListFromByteArray()
278 macList.add(MacAddress.fromBytes(mac)); in macAddressListFromByteArray()
/packages/modules/Wifi/framework/java/android/net/wifi/rtt/
DRangingResult.java115 public RangingResult(@RangeResultStatus int status, @NonNull MacAddress mac, int distanceMm, in RangingResult() argument
120 mMac = mac; in RangingResult()
413 MacAddress mac = null;
415 mac = MacAddress.CREATOR.createFromParcel(in);
438 return new RangingResult(status, mac, distanceMm, distanceStdDevMm, rssi,
/packages/modules/NetworkStack/src/android/net/dhcp/
DDhcpPacket.java864 public static String macToString(byte[] mac) { in macToString() argument
867 for (int i = 0; i < mac.length; i++) { in macToString()
868 String hexString = "0" + Integer.toHexString(mac[i]); in macToString()
874 if (i != (mac.length - 1)) { in macToString()
1512 Inet4Address yourIp, byte[] mac, Integer timeout, Inet4Address netMask, in buildOfferPacket() argument
1518 INADDR_ANY /* clientIp */, yourIp, mac); in buildOfferPacket()
1543 Inet4Address yourIp, byte[] mac, Integer timeout, Inet4Address netMask, in buildOfferPacket() argument
1548 mac, timeout, netMask, bcAddr, gateways, dnsServers, dhcpServerIdentifier, in buildOfferPacket()
1557 Inet4Address requestClientIp, byte[] mac, Integer timeout, Inet4Address netMask, in buildAckPacket() argument
1563 mac, rapidCommit); in buildAckPacket()
[all …]
/packages/modules/IPsec/src/java/com/android/internal/net/eap/message/simaka/
DEapSimAkaAttribute.java656 public final byte[] mac; field in EapSimAkaAttribute.AtMac
666 mac = new byte[MAC_LENGTH]; in AtMac()
667 byteBuffer.get(mac); in AtMac()
676 public AtMac(byte[] mac) throws EapSimAkaInvalidAttributeException { in AtMac() argument
677 this(new byte[RESERVED_BYTES_LEN], mac); in AtMac()
681 public AtMac(byte[] reservedBytes, byte[] mac) throws EapSimAkaInvalidAttributeException { in AtMac() argument
684 if (mac.length != MAC_LENGTH) { in AtMac()
687 this.mac = mac; in AtMac()
694 byteBuffer.put(mac); in encode()
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/util/bluetooth/
DBluetoothDeviceCriteria.java68 public boolean isMatchingMacAddress(String mac) { in isMatchingMacAddress() argument
69 return mAddressPattern.matcher(mac).matches(); in isMatchingMacAddress()
/packages/modules/Connectivity/nearby/tests/robotests/src/com/android/libraries/testing/deviceshadower/internal/bluetooth/connection/
DPageScanHandler.java184 byte[] mac = MacAddressGenerator.convertStringMacAddress(addr); in initialConnectionInfo()
194 .put(mac) in initialConnectionInfo()
206 .put(mac) in initialConnectionInfo()
/packages/modules/Bluetooth/system/types/test/
Draw_address_unittest.cc192 std::array<uint8_t, 6> mac = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; in TEST() local
193 RawAddress bdaddr(mac); in TEST()
199 ASSERT_EQ(mac, mac2); in TEST()
/packages/modules/Wifi/framework/tests/src/android/net/wifi/rtt/
DWifiRttManagerTest.java437 final MacAddress mac = MacAddress.fromString("00:01:02:03:04:05"); in testRangingResultsParcel() local
449 RangingResult result = new RangingResult(status, mac, distanceCm, distanceStdDevCm, rssi, in testRangingResultsParcel()
488 final MacAddress mac = MacAddress.fromString("00:01:02:03:04:05"); in testRangingResultsEqualityLciLcr() local
499 RangingResult rr1 = new RangingResult(status, mac, distanceCm, distanceStdDevCm, rssi, in testRangingResultsEqualityLciLcr()
502 RangingResult rr2 = new RangingResult(status, mac, distanceCm, distanceStdDevCm, rssi, in testRangingResultsEqualityLciLcr()
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/crypto/
DIkeMacPrf.java109 return new AesXCbcImpl().mac(keyBytes, dataToSign, false /*needTruncation*/); in signBytes()
136 keyBytes = new AesXCbcImpl().mac(new byte[16], keyBytes, false /*needTruncation*/); in modifyAesXCbcKeyIfNeeded()
/packages/modules/NetworkStack/src/android/net/util/
DConnectivityPacketSummary.java416 private static String getMacAddressString(ByteBuffer mac) { in getMacAddressString() argument
417 if (mac == null || mac.remaining() < ETHER_ADDR_LEN) return "invalid"; in getMacAddressString()
420 mac.get(bytes, 0, bytes.length); in getMacAddressString()
/packages/modules/NetworkStack/tests/unit/src/android/net/dhcp/
DDhcpLeaseRepositoryTest.java525 for (MacAddress mac : new MacAddress[] { TEST_MAC_1, TEST_MAC_2, TEST_MAC_3 }) { in testReleaseLease_StableOffer()
526 final DhcpLease lease = mRepo.getOffer(CLIENTID_UNSPEC, mac, in testReleaseLease_StableOffer()
529 requestLeaseSelecting(mac, lease.getNetAddr()); in testReleaseLease_StableOffer()
530 mRepo.releaseLease(CLIENTID_UNSPEC, mac, lease.getNetAddr()); in testReleaseLease_StableOffer()
533 final DhcpLease newLease = mRepo.getOffer(CLIENTID_UNSPEC, mac, in testReleaseLease_StableOffer()

1234