/packages/modules/Connectivity/staticlibs/device/com/android/net/module/util/ |
D | Ipv6Utils.java | 41 import java.nio.ByteBuffer; 51 public static ByteBuffer buildIcmpv6Packet(final Inet6Address srcIp, final Inet6Address dstIp, in buildIcmpv6Packet() 52 short type, short code, final ByteBuffer... options) { in buildIcmpv6Packet() 56 for (ByteBuffer option: options) { in buildIcmpv6Packet() 59 final ByteBuffer packet = ByteBuffer.allocate(ipv6HeaderLen + icmpv6HeaderLen + payloadLen); in buildIcmpv6Packet() 68 for (ByteBuffer option : options) { in buildIcmpv6Packet() 87 public static ByteBuffer buildIcmpv6Packet(final MacAddress srcMac, final MacAddress dstMac, in buildIcmpv6Packet() 89 final ByteBuffer... options) { in buildIcmpv6Packet() 90 final ByteBuffer payload = buildIcmpv6Packet(srcIp, dstIp, type, code, options); in buildIcmpv6Packet() 93 final ByteBuffer packet = ByteBuffer.allocate(etherHeaderLen + payload.limit()); in buildIcmpv6Packet() [all …]
|
/packages/modules/Uwb/service/java/com/android/server/uwb/params/ |
D | TlvUtil.java | 19 import java.nio.ByteBuffer; 24 ByteBuffer buffer = ByteBuffer.allocate(Byte.BYTES).put(data); in getBytes() 29 ByteBuffer buffer = ByteBuffer.allocate(Short.BYTES).order( in getBytes() 35 ByteBuffer buffer = ByteBuffer.allocate(Short.BYTES).order( in getLeBytes() 41 ByteBuffer buffer = ByteBuffer.allocate(Integer.BYTES).order( in getBytes() 47 ByteBuffer buffer = ByteBuffer.allocate(Integer.BYTES).order( in getLeBytes() 53 ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES).order( in getBytes() 59 ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES).order( in getLeBytes() 73 ByteBuffer srcBuf = ByteBuffer.allocate(Integer.BYTES).putInt(data); in getBytes() 74 ByteBuffer dstBuf = ByteBuffer.allocate(length); in getBytes() [all …]
|
/packages/modules/Wifi/service/tests/wifitests/src/com/android/server/wifi/ |
D | ByteBufferReaderTest.java | 27 import java.nio.ByteBuffer; 45 ByteBuffer buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN); in readIntegerWithBufferUnderflow() 59 ByteBuffer buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN); in readIntegerExceedingMaximumLength() 73 ByteBuffer buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN); in readIntegerLessThanMinimumLength() 86 ByteBuffer buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN); in readIntegerWithMinimumSize() 102 ByteBuffer leBuffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN); in readIntegerWithMaximumSize() 108 ByteBuffer beBuffer = ByteBuffer.wrap(data).order(ByteOrder.BIG_ENDIAN); in readIntegerWithMaximumSize() 122 ByteBufferReader.readString(ByteBuffer.wrap(new byte[10]), -1, StandardCharsets.US_ASCII); in readStringWithNegativeSize() 133 ByteBuffer.wrap(new byte[10]), 0, StandardCharsets.US_ASCII); in readStringWithZeroSize() 146 ByteBuffer buffer = ByteBuffer.wrap(expectedValue.getBytes(StandardCharsets.US_ASCII)); in readString() [all …]
|
/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/eap/crypto/ |
D | TlsSessionTest.java | 39 import java.nio.ByteBuffer; 75 static final ByteBuffer EMPTY_APPLICATION_BUFFER = 76 ByteBuffer.allocate(APPLICATION_BUFFER_SIZE_TLS_MESSAGE); 77 static final ByteBuffer EMPTY_PACKET_BUFFER = 78 ByteBuffer.allocate(PACKET_BUFFER_SIZE_TLS_MESSAGE); 79 static final ByteBuffer APPLICATION_BUFFER_POSITION_RESET = 80 (ByteBuffer) 81 ByteBuffer.allocate(APPLICATION_BUFFER_SIZE_TLS_MESSAGE) 84 static final ByteBuffer PACKET_BUFFER_POSITION_RESET = 85 (ByteBuffer) [all …]
|
/packages/modules/Wifi/service/tests/wifitests/src/com/android/server/wifi/hotspot2/anqp/ |
D | VenueUrlElementTest.java | 33 import java.nio.ByteBuffer; 97 assertTrue(VenueUrlElement.parse(ByteBuffer.allocate(0)).getVenueUrls().isEmpty()); in parseEmptyBuffer() 108 ByteBuffer buffer = ByteBuffer.wrap(getTestData(urlList)); in parseTruncatedBuffer() 119 ByteBuffer buffer = ByteBuffer.wrap(getTestData(1, new String())); in parseBufferWithEmptyVenueUrl() 128 ByteBuffer buffer = ByteBuffer.wrap(getTestData(1, TEST_VENUE_URL_INVALID)); in parseBufferWithInvalidVenueUrl() 145 VenueUrlElement.parse(ByteBuffer.wrap(stream.toByteArray())); in parseBufferWithInvalidLength() 154 ByteBuffer buffer = ByteBuffer.wrap(getTestData(0, new String())); in parseBufferWithZeroVenueNumber() 164 ByteBuffer buffer = ByteBuffer.wrap(getTestData(0, TEST_VENUE_URL1)); in parseBufferWithZeroVenueNumberAndUrlData() 180 ByteBuffer buffer = ByteBuffer.wrap(getTestData(-7, TEST_VENUE_URL1)); in parseBufferWithNegativeVenueNumberAndUrlData() 207 ByteBuffer buffer = ByteBuffer.wrap(getTestData(urlList)); in parseBufferWithValidVenueUrls() [all …]
|
D | ANQPParserTest.java | 32 import java.nio.ByteBuffer; 186 ByteBuffer buffer = ByteBuffer.allocate(HSWanMetricsElement.EXPECTED_BUFFER_SIZE) in getHSWanMetricsPayload() 281 ByteBuffer buffer = ByteBuffer.wrap(getVenueNamePayload(language, text)); in parseVenueNameElement() 303 ByteBuffer buffer = ByteBuffer.wrap(new byte[] {(byte) ipAddressAvailability}); in parseIPAddressTypeAvailabilityElement() 319 ByteBuffer buffer = ByteBuffer.wrap(getDomainNamePayload(testNames)); in parseDomainNameElement() 336 ByteBuffer buffer = ByteBuffer.wrap(getRoamingConsortiumPayload(ois, oisLength)); in parseRoamingConsortium() 353 ByteBuffer buffer = ByteBuffer.wrap(getNAIRealmPayload(testBytes)); in parseNAIRealmElement() 373 ByteBuffer buffer = ByteBuffer.wrap(getThreeGPPNetworkPayload( in parseThreeGPPNetworkElement() 387 ByteBuffer buffer = ByteBuffer.wrap( in parseNonHS20VendorSpecificElement() 414 Constants.ANQPElementType.ANQPVendorSpec, ByteBuffer.wrap(data))); in parseVendorSpecificElementWithHSFriendlyName() [all …]
|
D | HSWanMetricsElementTest.java | 30 import java.nio.ByteBuffer; 57 private ByteBuffer getTestBuffer() { in getTestBuffer() 58 ByteBuffer buffer = ByteBuffer.allocate(HSWanMetricsElement.EXPECTED_BUFFER_SIZE) in getTestBuffer() 73 private ByteBuffer getUninitializedBuffer() { in getUninitializedBuffer() 75 ByteBuffer buffer = ByteBuffer.allocate(HSWanMetricsElement.EXPECTED_BUFFER_SIZE) in getUninitializedBuffer() 129 HSWanMetricsElement.parse(ByteBuffer.allocate(0)); in parseEmptyBuffer() 140 ByteBuffer buffer = ByteBuffer.allocate(HSWanMetricsElement.EXPECTED_BUFFER_SIZE - 1); in parseBufferWithLessThanExpectedSize() 154 ByteBuffer buffer = ByteBuffer.allocate(HSWanMetricsElement.EXPECTED_BUFFER_SIZE + 1); in parseBufferWithMoreThanExpectedSize() 168 ByteBuffer buffer = getTestBuffer(); in parseBufferWithTestData() 184 ByteBuffer buffer = getUninitializedBuffer(); in testIsInitialized()
|
D | HSConnectionCapabilityElementTest.java | 29 import java.nio.ByteBuffer; 50 private void appendProtocolPortTuple(ByteBuffer buffer, ProtocolPortTuple tuple) { in appendProtocolPortTuple() 62 private ByteBuffer getTestBuffer(ProtocolPortTuple[] tuples) { in getTestBuffer() 63 ByteBuffer buffer = ByteBuffer.allocate(tuples.length * ProtocolPortTuple.RAW_BYTE_SIZE) in getTestBuffer() 81 HSConnectionCapabilityElement.parse(ByteBuffer.allocate(0)); in parseEmptyBuffer() 93 ByteBuffer buffer = ByteBuffer.allocate(ProtocolPortTuple.RAW_BYTE_SIZE - 1); in parseBufferWithLessThanMinimumSize() 108 ByteBuffer buffer = ByteBuffer.allocate(ProtocolPortTuple.RAW_BYTE_SIZE + 1); in parseBufferWithIncompleteTupleBytes() 123 ByteBuffer buffer = getTestBuffer(new ProtocolPortTuple[] {TEST_TUPLE1, TEST_TUPLE2}); in parseBufferWithTestData()
|
D | VenueNameElementTest.java | 32 import java.nio.ByteBuffer; 88 VenueNameElement.parse(ByteBuffer.allocate(0)); in parseEmptyBuffer() 99 ByteBuffer buffer = ByteBuffer.wrap(getTestData(new String[] {TEST_VENUE_NAME1})); in parseTruncatedBuffer() 113 ByteBuffer buffer = ByteBuffer.wrap(getTestData(new String[0])); in parseBufferWithEmptyVenueName() 130 ByteBuffer buffer = ByteBuffer.wrap( in parseBufferWithValidVenueNames() 147 ByteBuffer buffer = ByteBuffer.wrap(getTestData(new String[] {text})); in parseBufferWithMaxLengthVenueName() 168 ByteBuffer buffer = ByteBuffer.wrap(getTestData(new String[] {text})); in parseBufferWithVenueNameLengthExceedMax()
|
/packages/modules/IPsec/tests/cts/src/android/ipsec/ike/cts/ |
D | PacketUtils.java | 25 import java.nio.ByteBuffer; 71 void addPacketBytes(IpHeader header, ByteBuffer resultBuffer) throws Exception; in addPacketBytes() 105 ByteBuffer resultBuffer = buildHeader(); in getPacketBytes() 111 public ByteBuffer buildHeader() { in buildHeader() 112 ByteBuffer bb = ByteBuffer.allocate(DATA_BUFFER_LEN); in buildHeader() 147 private short calculateChecksum(ByteBuffer bb) { in calculateChecksum() 152 ShortBuffer shortBuffer = ByteBuffer.wrap(getByteArrayFromBuffer(bb)).asShortBuffer(); in calculateChecksum() 174 ByteBuffer bb = ByteBuffer.allocate(DATA_BUFFER_LEN); in getPacketBytes() 220 ByteBuffer bb = ByteBuffer.allocate(DATA_BUFFER_LEN); in getPacketBytes() 226 public void addPacketBytes(IpHeader header, ByteBuffer resultBuffer) { in addPacketBytes() [all …]
|
/packages/modules/IPsec/src/java/com/android/internal/net/eap/message/simaka/ |
D | EapSimAkaAttribute.java | 27 import java.nio.ByteBuffer; 147 public abstract void encode(ByteBuffer byteBuffer); in encode() 167 int attributeType, int lengthInBytes, ByteBuffer buffer) in EapSimAkaReservedBytesAttribute() 200 public void encode(ByteBuffer buffer) { in encode() 207 protected void encodeAttributeHeader(ByteBuffer byteBuffer) { in encodeAttributeHeader() 212 void consumePadding(int bytesUsed, ByteBuffer byteBuffer) { in consumePadding() 217 void addPadding(int bytesUsed, ByteBuffer byteBuffer) { in addPadding() 234 ByteBuffer byteBuffer) throws EapSimAkaInvalidAttributeException { in EapSimAkaUnsupportedAttribute() 251 public void encode(ByteBuffer byteBuffer) { in encode() 265 public AtVersionList(int lengthInBytes, ByteBuffer byteBuffer) in AtVersionList() [all …]
|
/packages/modules/Connectivity/Tethering/tests/privileged/src/android/net/ip/ |
D | DadProxyTest.java | 58 import java.nio.ByteBuffer; 149 private static ByteBuffer createDadPacket(int type) { in createDadPacket() 154 final ByteBuffer buf = ByteBuffer.allocate(icmpLen + IPV6_HEADER_LEN + ETH_HEADER_LEN); in createDadPacket() 222 private boolean waitForPacket(ByteBuffer packet, TapPacketReader reader) { in waitForPacket() 226 final ByteBuffer buffer = ByteBuffer.wrap(p); in waitForPacket() 233 private ByteBuffer copy(ByteBuffer buf) { in copy() 236 return ByteBuffer.wrap(buf.array().clone()); in copy() 239 private void updateDstMac(ByteBuffer buf, MacAddress mac) { in updateDstMac() 243 private void updateSrcMac(ByteBuffer buf, InterfaceParams ifaceParams) { in updateSrcMac() 250 ByteBuffer in, TapPacketReader inReader, ByteBuffer out, TapPacketReader outReader) in receivePacketAndMaybeExpectForwarded() [all …]
|
/packages/modules/Connectivity/tests/cts/net/src/android/net/cts/ |
D | PacketUtils.java | 29 import java.nio.ByteBuffer; 111 void addPacketBytes(IpHeader header, ByteBuffer resultBuffer) throws Exception; in addPacketBytes() 145 ByteBuffer resultBuffer = buildHeader(); in getPacketBytes() 151 public ByteBuffer buildHeader() { in buildHeader() 152 ByteBuffer bb = ByteBuffer.allocate(DATA_BUFFER_LEN); in buildHeader() 187 private short calculateChecksum(ByteBuffer bb) { in calculateChecksum() 192 ShortBuffer shortBuffer = ByteBuffer.wrap(getByteArrayFromBuffer(bb)).asShortBuffer(); in calculateChecksum() 214 ByteBuffer bb = ByteBuffer.allocate(DATA_BUFFER_LEN); in getPacketBytes() 260 ByteBuffer bb = ByteBuffer.allocate(DATA_BUFFER_LEN); in getPacketBytes() 266 public void addPacketBytes(IpHeader header, ByteBuffer resultBuffer) { in addPacketBytes() [all …]
|
/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/eap/message/simaka/attributes/ |
D | AtIdReqTest.java | 45 import java.nio.ByteBuffer; 59 ByteBuffer input = ByteBuffer.wrap(AT_PERMANENT_ID_REQ); in testDecodeAtPermanentIdReq() 71 ByteBuffer input = ByteBuffer.wrap(PERMANENT_ID_INVALID_LENGTH); in testDecodeAtPermanentIdReqInvalidLength() 82 ByteBuffer result = ByteBuffer.allocate(EXPECTED_LENGTH); in testEncodeAtPermanentIdReq() 90 ByteBuffer input = ByteBuffer.wrap(AT_ANY_ID_REQ); in testDecodeAtAnyIdReq() 102 ByteBuffer input = ByteBuffer.wrap(ANY_ID_INVALID_LENGTH); in testDecodeAtAnyIdReqInvalidLength() 113 ByteBuffer result = ByteBuffer.allocate(EXPECTED_LENGTH); in testEncodeAtAnyIdReq() 121 ByteBuffer input = ByteBuffer.wrap(AT_FULL_AUTH_ID_REQ); in testDecodeAtFullauthIdReq() 133 ByteBuffer input = ByteBuffer.wrap(FULL_AUTH_ID_INVALID_LENGTH); in testDecodeAtFullauthIdReqInvalidLength() 144 ByteBuffer result = ByteBuffer.allocate(EXPECTED_LENGTH); in testEncodeAtFullauthIdReq()
|
D | AtResTest.java | 40 import java.nio.ByteBuffer; 52 ByteBuffer input = ByteBuffer.wrap(AT_RES); in testDecode() 64 ByteBuffer input = ByteBuffer.wrap(AT_RES_INVALID_RES_LENGTH); in testDecodeInvalidResLength() 74 ByteBuffer input = ByteBuffer.wrap(AT_RES_SHORT_RES); in testDecodeShortResLength() 84 ByteBuffer input = ByteBuffer.wrap(AT_RES_LONG_RES); in testDecodeLongResLength() 96 ByteBuffer result = ByteBuffer.allocate(AT_RES.length); in testEncode() 105 ByteBuffer result = ByteBuffer.allocate(AT_RES.length); in testGetAtRes()
|
D | AtCounterTest.java | 42 import java.nio.ByteBuffer; 56 ByteBuffer input = ByteBuffer.wrap(AT_COUNTER); in testDecodeAtCounter() 69 ByteBuffer input = ByteBuffer.wrap(AT_COUNTER_INVALID_LENGTH); in testDecodeAtCounterInvalidLength() 81 ByteBuffer result = ByteBuffer.allocate(EXPECTED_LENGTH); in testEncodeAtCounter() 95 ByteBuffer input = ByteBuffer.wrap(AT_COUNTER_TOO_SMALL); in testDecodeAtCounterTooSmall() 107 ByteBuffer input = ByteBuffer.wrap(AT_COUNTER_TOO_SMALL_INVALID_LENGTH); in testDecodeAtCounterTooSmallInvalidLength() 118 ByteBuffer result = ByteBuffer.allocate(EXPECTED_LENGTH); in testEncodeAtCounterTooSmall()
|
/packages/modules/Connectivity/Tethering/tests/integration/base/android/net/ |
D | TetheringTester.java | 90 import java.nio.ByteBuffer; 228 ByteBuffer packet = DhcpPacket.buildDiscoverPacket(DhcpPacket.ENCAP_L2, in sendDhcpDiscover() 240 ByteBuffer packet = DhcpPacket.buildRequestPacket(DhcpPacket.ENCAP_L2, in sendDhcpRequest() 274 ByteBuffer buf = ByteBuffer.wrap(packet); in maybeReplyArp() 283 final ByteBuffer arpReply = ArpPacket.buildArpPacket( in maybeReplyArp() 301 final ByteBuffer arpProbe = ArpPacket.buildArpPacket(ETHER_BROADCAST /* dst */, in getRouterMacAddressFromArp() 324 ByteBuffer buf = ByteBuffer.wrap(packet); in getRaPrefixOptions() 337 final ByteBuffer pioBuf = ByteBuffer.wrap(buf.array(), currentPos, in getRaPrefixOptions() 381 ByteBuffer slla = LlaOption.build((byte) ICMPV6_ND_OPTION_SLLA, srcMac); in sendRsPacket() 382 ByteBuffer rs = Ipv6Utils.buildRsPacket(srcMac, dstMac, (Inet6Address) LINK_LOCAL, in sendRsPacket() [all …]
|
/packages/modules/Connectivity/staticlibs/tests/unit/src/com/android/net/module/util/ |
D | PacketBuilderTest.java | 56 import java.nio.ByteBuffer; 80 private static final ByteBuffer DATA = ByteBuffer.wrap(new byte[] { 516 private ByteBuffer buildPacket(@Nullable final MacAddress srcMac, in buildPacket() 518 @Nullable final ByteBuffer payload) in buildPacket() 530 final ByteBuffer buffer = PacketBuilder.allocate(hasEther, l3proto, l4proto, in buildPacket() 575 private void checkEtherHeader(final int l3proto, final ByteBuffer actual) { in checkEtherHeader() 596 final ByteBuffer actual) { in checkIpv4Header() 633 final ByteBuffer actual) { in checkIpv6Header() 665 final ByteBuffer actual) { in checkTcpPacket() 714 final ByteBuffer actual) { in checkUdpPacket() [all …]
|
/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/ipsec/ike/message/ |
D | IkeDeletePayloadTest.java | 35 import java.nio.ByteBuffer; 55 ByteBuffer inputBuffer = in testDecodeDeleteIkePayload() 56 ByteBuffer.wrap(TestUtils.hexStringToByteArray(DELETE_IKE_PAYLOAD_HEX_STRING)); in testDecodeDeleteIkePayload() 74 ByteBuffer inputBuffer = in testDecodeDeleteChildPayload() 75 ByteBuffer.wrap(TestUtils.hexStringToByteArray(DELETE_CHILD_PAYLOAD_HEX_STRING)); in testDecodeDeleteChildPayload() 97 ByteBuffer inputBuffer = ByteBuffer.wrap(deletePayloadBytes); in testDecodeWithInvalidProtocol() 112 ByteBuffer inputBuffer = ByteBuffer.wrap(deletePayloadBytes); in testDecodeWithInvalidSpiSize() 127 ByteBuffer inputBuffer = ByteBuffer.wrap(deletePayloadBytes); in testDecodeWithInvalidNumSpi() 143 ByteBuffer inputBuffer = ByteBuffer.wrap(deletePayloadBytes); in testDecodeWithInvalidNumSpiAndSpiSize() 198 ByteBuffer bb = ByteBuffer.allocate(deletePayload.getPayloadLength()); in testEncodeForIke() [all …]
|
D | IkeSaPayloadTest.java | 84 import java.nio.ByteBuffer; 276 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeAttribute() 288 ByteBuffer byteBuffer = ByteBuffer.allocate(mAttributeKeyLength128.getAttributeLength()); in testEncodeAttribute() 299 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeEncryptionTransform() 315 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeEncryptionTransformWithInvalidKeyLength() 332 ByteBuffer byteBuffer = ByteBuffer.allocate(mEncrAesCbc128Transform.getTransformLength()); in testEncodeEncryptionTransform() 361 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodePrfTransform() 376 ByteBuffer byteBuffer = ByteBuffer.allocate(mPrfHmacSha1Transform.getTransformLength()); in testEncodePrfTransform() 396 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeIntegrityTransform() 412 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeIntegrityTransformWithUnrecognizedAttribute() [all …]
|
/packages/modules/Connectivity/staticlibs/framework/com/android/net/module/util/ |
D | DnsSvcbRecord.java | 34 import java.nio.ByteBuffer; 94 public DnsSvcbRecord(@DnsPacket.RecordType int rType, @NonNull ByteBuffer buff) in DnsSvcbRecord() 116 final ByteBuffer buf = ByteBuffer.wrap(rdata).asReadOnlyBuffer(); in DnsSvcbRecord() 211 private static SvcParam parseSvcParam(@NonNull ByteBuffer buf) throws ParseException { in parseSvcParam() 250 private SvcParamMandatory(@NonNull ByteBuffer buf) throws BufferUnderflowException, in SvcParamMandatory() 255 final ByteBuffer svcParamValue = sliceAndAdvance(buf, len); in SvcParamMandatory() 281 SvcParamAlpn(@NonNull ByteBuffer buf) throws BufferUnderflowException, ParseException { in SvcParamAlpn() 285 final ByteBuffer svcParamValue = sliceAndAdvance(buf, len); in SvcParamAlpn() 304 SvcParamNoDefaultAlpn(@NonNull ByteBuffer buf) throws BufferUnderflowException, in SvcParamNoDefaultAlpn() 328 SvcParamPort(@NonNull ByteBuffer buf) throws BufferUnderflowException, ParseException { in SvcParamPort() [all …]
|
/packages/modules/Connectivity/staticlibs/tests/unit/src/com/android/net/module/util/netlink/ |
D | RtNetlinkRouteMessageTest.java | 41 import java.nio.ByteBuffer; 65 private ByteBuffer toByteBuffer(final String hexString) { in toByteBuffer() 66 return ByteBuffer.wrap(HexDump.hexStringToByteArray(hexString)); in toByteBuffer() 99 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWROUTE_HEX); in testParseRtmRouteMessage() 120 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWROUTE_PACK_HEX); in testPackRtmNewRoute() 127 final ByteBuffer packBuffer = ByteBuffer.allocate(112); in testPackRtmNewRoute() 151 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWROUTE_MULTICAST_IPV6_HEX); in testParseRtmNewRoute_MulticastIpv6() 187 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWROUTE_MULTICAST_IPV6_PACK_HEX); in testPackRtmNewRoute_MulticastIpv6() 192 final ByteBuffer packBuffer = ByteBuffer.allocate(88); in testPackRtmNewRoute_MulticastIpv6() 208 final ByteBuffer byteBuffer = toByteBuffer(RTM_NEWROUTE_TRUNCATED_HEX); in testTruncatedRtmNewRoute() [all …]
|
D | StructInetDiagSockIdTest.java | 36 import java.nio.ByteBuffer; 143 final ByteBuffer buffer = ByteBuffer.allocate(StructInetDiagSockId.STRUCT_SIZE); in testPackStructInetDiagSockIdWithIpv4() 153 final ByteBuffer buffer = ByteBuffer.allocate(StructInetDiagSockId.STRUCT_SIZE); in testPackStructInetDiagSockIdWithIpv6() 164 final ByteBuffer buffer = ByteBuffer.allocate(StructInetDiagSockId.STRUCT_SIZE); in testPackStructInetDiagSockIdWithIpv4IfIndexCookie() 175 final ByteBuffer buffer = ByteBuffer.allocate(StructInetDiagSockId.STRUCT_SIZE); in testPackStructInetDiagSockIdWithIpv6IfIndexCookie() 182 final ByteBuffer buffer = ByteBuffer.wrap(INET_DIAG_SOCKET_ID_IPV4_IF_COOKIE); in testParseStructInetDiagSockIdWithIpv4() 195 final ByteBuffer buffer = ByteBuffer.wrap(INET_DIAG_SOCKET_ID_IPV6_IF_COOKIE); in testParseStructInetDiagSockIdWithIpv6()
|
/packages/modules/NetworkStack/tests/unit/src/android/net/dhcp/ |
D | DhcpPacketTest.java | 65 import java.nio.ByteBuffer; 142 public ByteBuffer buildPacket(int encap, short unusedDestUdp, short unusedSrcUdp) { in buildPacket() 143 ByteBuffer result = ByteBuffer.allocate(MAX_LENGTH); in buildPacket() 149 public void finishPacket(ByteBuffer buffer) { in finishPacket() 167 public ByteBuffer build() { in build() 169 ByteBuffer pkt = buildPacket(ENCAP_BOOTP, (short) 0, (short) 0); in build() 178 ByteBuffer packet = new TestDhcpPacket(DHCP_MESSAGE_TYPE_OFFER) in assertDomainAndVendorInfoParses() 224 ByteBuffer packet = testPacket.build(); in assertLeaseTimeParses() 280 ByteBuffer packet = new TestDhcpPacket(type, clientIp, yourIp) in checkIpAddress() 347 final ByteBuffer packet = ByteBuffer.wrap(HexDump.hexStringToByteArray( in testOffer1() [all …]
|
/packages/modules/Uwb/service/java/com/android/server/uwb/util/ |
D | DataTypeConversionUtil.java | 24 import java.nio.ByteBuffer; 103 return ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN).getShort(); in byteArrayToI16() 113 return ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN).getInt(); in byteArrayToI32() 123 ByteBuffer byteBuffer = ByteBuffer.allocate(Integer.BYTES); in arbitraryByteArrayToI32() 133 return ByteBuffer.allocate(Integer.BYTES).order(ByteOrder.BIG_ENDIAN).putInt(n).array(); in i32ToByteArray() 140 return ByteBuffer.allocate(Integer.BYTES).order(ByteOrder.LITTLE_ENDIAN).putInt(n).array(); in i32ToLeByteArray() 150 return ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).getShort(); in macAddressByteArrayToLong() 152 return ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).getInt(); in macAddressByteArrayToLong() 155 return ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).getShort(); in macAddressByteArrayToLong() 157 return ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).getLong(); in macAddressByteArrayToLong() [all …]
|