/frameworks/base/tests/net/java/android/net/util/ |
D | IpUtilsTest.java | 81 ByteBuffer packet = ByteBuffer.wrap(new byte[] { in testIpv6TcpChecksum() local 103 int transportLen = packet.limit() - IPV6_HEADER_LENGTH; in testIpv6TcpChecksum() 104 assertEquals(0, IpUtils.tcpChecksum(packet, 0, IPV6_HEADER_LENGTH, transportLen)); in testIpv6TcpChecksum() 108 int sum = getUnsignedByte(packet, sumOffset) * 256 + getUnsignedByte(packet, sumOffset + 1); in testIpv6TcpChecksum() 111 packet.put(sumOffset, (byte) 0); in testIpv6TcpChecksum() 112 packet.put(sumOffset + 1, (byte) 0); in testIpv6TcpChecksum() 113 assertChecksumEquals(sum, IpUtils.tcpChecksum(packet, 0, IPV6_HEADER_LENGTH, transportLen)); in testIpv6TcpChecksum() 116 packet.putShort( in testIpv6TcpChecksum() 118 IpUtils.tcpChecksum(packet, 0, IPV6_HEADER_LENGTH, transportLen)); in testIpv6TcpChecksum() 119 assertEquals(0, IpUtils.tcpChecksum(packet, 0, IPV6_HEADER_LENGTH, transportLen)); in testIpv6TcpChecksum() [all …]
|
/frameworks/av/media/mtp/ |
D | MtpObjectInfo.cpp | 58 bool MtpObjectInfo::read(MtpDataPacket& packet) { in read() argument 62 if (!packet.getUInt32(mStorageID)) return false; in read() 63 if (!packet.getUInt16(mFormat)) return false; in read() 64 if (!packet.getUInt16(mProtectionStatus)) return false; in read() 65 if (!packet.getUInt32(mCompressedSize)) return false; in read() 66 if (!packet.getUInt16(mThumbFormat)) return false; in read() 67 if (!packet.getUInt32(mThumbCompressedSize)) return false; in read() 68 if (!packet.getUInt32(mThumbPixWidth)) return false; in read() 69 if (!packet.getUInt32(mThumbPixHeight)) return false; in read() 70 if (!packet.getUInt32(mImagePixWidth)) return false; in read() [all …]
|
D | MtpProperty.cpp | 130 bool MtpProperty::read(MtpDataPacket& packet) { in read() argument 133 if (!packet.getUInt16(mCode)) return false; in read() 135 if (!packet.getUInt16(mType)) return false; in read() 136 if (!packet.getUInt8(temp8)) return false; in read() 149 mDefaultArrayValues = readArrayValues(packet, mDefaultArrayLength); in read() 152 mCurrentArrayValues = readArrayValues(packet, mCurrentArrayLength); in read() 157 if (!readValue(packet, mDefaultValue)) return false; in read() 159 if (!readValue(packet, mCurrentValue)) return false; in read() 163 if (!packet.getUInt32(mGroupCode)) return false; in read() 165 if (!packet.getUInt8(mFormFlag)) return false; in read() [all …]
|
D | MtpDeviceInfo.cpp | 62 bool MtpDeviceInfo::read(MtpDataPacket& packet) { in read() argument 66 if (!packet.getUInt16(mStandardVersion)) return false; in read() 67 if (!packet.getUInt32(mVendorExtensionID)) return false; in read() 68 if (!packet.getUInt16(mVendorExtensionVersion)) return false; in read() 70 if (!packet.getString(string)) return false; in read() 74 if (!packet.getUInt16(mFunctionalMode)) return false; in read() 75 mOperations = packet.getAUInt16(); in read() 77 mEvents = packet.getAUInt16(); in read() 79 mDeviceProperties = packet.getAUInt16(); in read() 81 mCaptureFormats = packet.getAUInt16(); in read() [all …]
|
D | MtpStorageInfo.cpp | 48 bool MtpStorageInfo::read(MtpDataPacket& packet) { in read() argument 52 if (!packet.getUInt16(mStorageType)) return false; in read() 53 if (!packet.getUInt16(mFileSystemType)) return false; in read() 54 if (!packet.getUInt16(mAccessCapability)) return false; in read() 55 if (!packet.getUInt64(mMaxCapacity)) return false; in read() 56 if (!packet.getUInt64(mFreeSpaceBytes)) return false; in read() 57 if (!packet.getUInt32(mFreeSpaceObjects)) return false; in read() 59 if (!packet.getString(string)) return false; in read() 62 if (!packet.getString(string)) return false; in read()
|
D | MtpStringBuffer.cpp | 66 bool MtpStringBuffer::readFromPacket(MtpDataPacket* packet) { in readFromPacket() argument 68 if (!packet->getUInt8(count)) in readFromPacket() 76 if (!packet->getUInt16(ch)) in readFromPacket() 88 void MtpStringBuffer::writeToPacket(MtpDataPacket* packet) const { in writeToPacket() 93 packet->putUInt8(0); in writeToPacket() 96 packet->putUInt8(std::min(count + 1, MTP_STRING_MAX_CHARACTER_NUMBER)); in writeToPacket() 105 packet->putUInt16(c); in writeToPacket() 109 packet->putUInt16(0); in writeToPacket()
|
D | MtpProperty.h | 89 bool read(MtpDataPacket& packet); 90 void write(MtpDataPacket& packet); 94 void setCurrentValue(MtpDataPacket& packet); 109 bool readValue(MtpDataPacket& packet, MtpPropertyValue& value); 110 void writeValue(MtpDataPacket& packet, MtpPropertyValue& value); 111 MtpPropertyValue* readArrayValues(MtpDataPacket& packet, uint32_t& length); 112 void writeArrayValues(MtpDataPacket& packet,
|
D | IMtpDatabase.h | 65 MtpDataPacket& packet) = 0; 69 MtpDataPacket& packet) = 0; 72 MtpDataPacket& packet) = 0; 75 MtpDataPacket& packet) = 0; 82 MtpDataPacket& packet) = 0;
|
D | MtpStringBuffer.h | 51 bool readFromPacket(MtpDataPacket* packet); 52 void writeToPacket(MtpDataPacket* packet) const;
|
/frameworks/libs/net/common/hostdevice/com/android/testutils/ |
D | PacketFilter.kt | 37 override fun test(packet: ByteArray) = in test() 38 bytes.withIndex().all { it.value == packet[offset + it.index] } in test() 65 override fun test(packet: ByteArray): Boolean { in test() 66 val option = findDhcpOption(packet, option) ?: return false in test() 74 fun findDhcpOption(packet: ByteArray, option: Byte): ByteArray? = in findDhcpOption() 75 findOptionOffset(packet, option, DHCP_OPTIONS_OFFSET)?.let { in findDhcpOption() 76 val optionLen = packet[it + 1] in findDhcpOption() 77 return packet.copyOfRange(it + 2 /* type, length bytes */, it + 2 + optionLen) in findDhcpOption() 80 private tailrec fun findOptionOffset(packet: ByteArray, option: Byte, searchOffset: Int): Int? { in findOptionOffset() 81 if (packet.size <= searchOffset + 2 /* type, length bytes */) return null in findOptionOffset() [all …]
|
/frameworks/base/media/jni/ |
D | android_mtp_MtpDatabase.cpp | 135 MtpDataPacket& packet); 139 MtpDataPacket& packet); 142 MtpDataPacket& packet); 145 MtpDataPacket& packet); 152 MtpDataPacket& packet); 379 MtpDataPacket& packet) { in getObjectPropertyValue() argument 415 packet.putInt8(longValue); in getObjectPropertyValue() 418 packet.putUInt8(longValue); in getObjectPropertyValue() 421 packet.putInt16(longValue); in getObjectPropertyValue() 424 packet.putUInt16(longValue); in getObjectPropertyValue() [all …]
|
/frameworks/base/obex/javax/obex/ |
D | ServerOperation.java | 141 ObexPacket packet; in ServerOperation() local 180 packet = ObexPacket.read(request, mInput); in ServerOperation() 185 if (packet.mLength > ObexHelper.getMaxRxPacketSize(mTransport)) { in ServerOperation() 188 + packet.mLength + " maxLength: " + ObexHelper.getMaxRxPacketSize(mTransport)); in ServerOperation() 194 if (packet.mLength > 3) { in ServerOperation() 195 if(!handleObexPacket(packet)) { in ServerOperation() 238 private boolean handleObexPacket(ObexPacket packet) throws IOException { in handleObexPacket() argument 239 byte[] body = updateRequestHeaders(packet); in handleObexPacket() 284 private byte[] updateRequestHeaders(ObexPacket packet) throws IOException { in updateRequestHeaders() argument 286 if (packet.mPayload != null) { in updateRequestHeaders() [all …]
|
D | ClientSession.java | 393 byte[] packet = new byte[totalLength]; in setPath() 394 packet[0] = (byte)flags; in setPath() 395 packet[1] = (byte)0x00; in setPath() 397 System.arraycopy(head, 0, packet, 2, head.length); in setPath() 401 sendRequest(ObexHelper.OBEX_OPCODE_SETPATH, packet, returnHeaderSet, null, false); in setPath()
|
/frameworks/libs/net/common/tests/unit/src/com/android/module/util/ |
D | DnsPacketTest.java | 99 TestDnsPacket packet = new TestDnsPacket(v4blob); in testV4Answer() local 102 assertHeaderParses(packet.getHeader(), 0x5566, 0x8180, 1, 1, 0, 0); in testV4Answer() 106 packet.getRecordList(DnsPacket.QDSECTION); in testV4Answer() 111 packet.getRecordList(DnsPacket.ANSECTION); in testV4Answer() 141 TestDnsPacket packet = new TestDnsPacket(v6blob); in testV6Answer() local 144 assertHeaderParses(packet.getHeader(), 0x7722, 0x8180, 1, 1, 0, 0); in testV6Answer() 148 packet.getRecordList(DnsPacket.QDSECTION); in testV6Answer() 153 packet.getRecordList(DnsPacket.ANSECTION); in testV6Answer()
|
/frameworks/base/tests/net/java/android/net/ |
D | TcpKeepalivePacketDataTest.java | 82 final byte[] packet = resultData.getPacket(); in testV4TcpKeepalivePacket() 84 assertEquals(packet[0], 0x45); in testV4TcpKeepalivePacket() 86 assertEquals(packet[1], tos); in testV4TcpKeepalivePacket() 88 assertEquals(packet[8], ttl); in testV4TcpKeepalivePacket() 91 ByteBuffer buf = ByteBuffer.wrap(packet, 12, 4); in testV4TcpKeepalivePacket() 95 buf = ByteBuffer.wrap(packet, 16, 4); in testV4TcpKeepalivePacket() 99 buf = ByteBuffer.wrap(packet, 20, 12); in testV4TcpKeepalivePacket() 109 buf = ByteBuffer.wrap(packet, 34, 2); in testV4TcpKeepalivePacket()
|
/frameworks/libs/net/common/devicetests/com/android/testutils/ |
D | TapPacketReader.java | 71 return mReadHead.getValue().poll(timeoutMs, packet -> true); in popPacket() 98 public void sendResponse(final ByteBuffer packet) throws IOException { in sendResponse() argument 100 byte[] packetBytes = new byte[packet.limit()]; in sendResponse() 101 packet.get(packetBytes); in sendResponse() 102 packet.flip(); // So we can reuse it in the future. in sendResponse()
|
/frameworks/base/lowpan/java/android/net/lowpan/ |
D | LowpanCommissioningSession.java | 53 public void onReceiveFromCommissioner(@NonNull byte[] packet) {}; in onReceiveFromCommissioner() argument 73 public void onReceiveFromCommissioner(byte[] packet) { in onReceiveFromCommissioner() argument 78 mCallback.onReceiveFromCommissioner(packet); in onReceiveFromCommissioner() 165 public void sendToCommissioner(@NonNull byte[] packet) { in sendToCommissioner() argument 168 mBinder.sendToCommissioner(packet); in sendToCommissioner()
|
/frameworks/ml/nn/common/ |
D | ExecutionBurstServer.cpp | 338 const auto packet = getPacketBlocking(); in getBlocking() local 339 if (!packet) { in getBlocking() 343 return deserialize(*packet); in getBlocking() 393 std::vector<FmqRequestDatum> packet(available); in getPacketBlocking() local 394 const bool success = mFmqRequestChannel->read(packet.data(), available); in getPacketBlocking() 399 return std::make_optional(std::move(packet)); in getPacketBlocking() 425 std::vector<FmqRequestDatum> packet(count + 1); in getPacketBlocking() local 426 std::memcpy(&packet.front(), &datum, sizeof(datum)); in getPacketBlocking() 427 success &= mFmqRequestChannel->read(packet.data() + 1, count); in getPacketBlocking() 440 return std::make_optional(std::move(packet)); in getPacketBlocking() [all …]
|
D | ExecutionBurstController.cpp | 259 const auto packet = getPacketBlocking(); in getBlocking() local 260 if (!packet) { in getBlocking() 264 return deserialize(*packet); in getBlocking() 306 std::vector<FmqResultDatum> packet(available); in getPacketBlocking() local 307 const bool success = mFmqResultChannel->read(packet.data(), available); in getPacketBlocking() 312 return std::make_optional(std::move(packet)); in getPacketBlocking() 332 std::vector<FmqResultDatum> packet(count + 1); in getPacketBlocking() local 333 std::memcpy(&packet.front(), &datum, sizeof(datum)); in getPacketBlocking() 334 success &= mFmqResultChannel->read(packet.data() + 1, count); in getPacketBlocking() 346 return std::make_optional(std::move(packet)); in getPacketBlocking() [all …]
|
/frameworks/av/media/libstagefright/mpeg2ts/test/ |
D | Mpeg2tsUnitTest.cpp | 115 uint8_t packet[kTSPacketSize]; in TEST_P() local 123 while ((numBytesRead = mSource->readAt(mOffset, packet, kTSPacketSize)) == kTSPacketSize) { in TEST_P() 124 ASSERT_TRUE(packet[0] == kTSSyncByte) << "Sync byte error!"; in TEST_P() 127 uint16_t pid = (packet[1] + (packet[2] << 8)) & kPIDMask; in TEST_P() 130 status_t err = mParser->feedTSPacket(packet, kTSPacketSize, &event); in TEST_P()
|
/frameworks/native/libs/adbd_auth/ |
D | adbd_auth.cpp | 182 void HandlePacket(std::string_view packet) EXCLUDES(mutex_) { in HandlePacket() 183 LOG(INFO) << "received packet: " << packet; in HandlePacket() 185 if (packet.size() < 2) { in HandlePacket() 193 if (android::base::ConsumePrefix(&packet, framework_handlers_[i].code)) { in HandlePacket() 194 framework_handlers_[i].cb(packet); in HandlePacket() 200 LOG(ERROR) << "unhandled packet: " << packet; in HandlePacket() 241 auto& packet = output_queue_.front(); in SendPacket() local 244 if (auto* p = std::get_if<AdbdAuthPacketAuthenticated>(&packet)) { in SendPacket() 249 } else if (auto* p = std::get_if<AdbdAuthPacketDisconnected>(&packet)) { in SendPacket() 254 } else if (auto* p = std::get_if<AdbdAuthPacketRequestAuthorization>(&packet)) { in SendPacket() [all …]
|
/frameworks/base/packages/Tethering/tests/integration/src/android/net/ |
D | EthernetTetheringTest.java | 435 byte[] packet; in getNextDhcpPacket() 436 while ((packet = mTapPacketReader.popPacket(PACKET_READ_TIMEOUT_MS)) != null) { in getNextDhcpPacket() 438 return DhcpPacket.decodeFullPacket(packet, packet.length, DhcpPacket.ENCAP_L2); in getNextDhcpPacket() 491 ByteBuffer packet = DhcpPacket.buildDiscoverPacket(DhcpPacket.ENCAP_L2, in sendDhcpDiscover() local 495 sendPacket(fd, packet); in sendDhcpDiscover() 503 ByteBuffer packet = DhcpPacket.buildRequestPacket(DhcpPacket.ENCAP_L2, in sendDhcpRequest() local 507 sendPacket(fd, packet); in sendDhcpRequest() 510 private void sendPacket(FileDescriptor fd, ByteBuffer packet) throws Exception { in sendPacket() argument 512 Os.write(fd, packet); in sendPacket()
|
/frameworks/base/core/java/android/nfc/cardemulation/ |
D | HostNfcFService.java | 184 byte[] packet = dataBundle.getByteArray(KEY_DATA); in handleMessage() 185 if (packet != null) { in handleMessage() 186 byte[] responsePacket = processNfcFPacket(packet, null); in handleMessage()
|
/frameworks/base/services/net/java/android/net/ |
D | TcpKeepalivePacketData.java | 95 final byte[] packet; in tcpKeepalivePacket() 100 packet = buildV4Packet(tcpDetails); in tcpKeepalivePacket() 105 return new TcpKeepalivePacketData(tcpDetails, packet); in tcpKeepalivePacket() 205 byte[] packet = in.createByteArray(); in readFromParcel() 212 return new TcpKeepalivePacketData(srcAddress, srcPort, dstAddress, dstPort, packet, tcpSeq, in readFromParcel()
|
/frameworks/base/services/core/java/com/android/server/connectivity/ |
D | KeepaliveTracker.java | 158 @NonNull KeepalivePacketData packet, in KeepaliveInfo() argument 168 mPacket = packet; in KeepaliveInfo() 617 KeepalivePacketData packet; in startNattKeepalive() local 619 packet = NattKeepalivePacketData.nattKeepalivePacket( in startNattKeepalive() 627 ki = new KeepaliveInfo(cb, nai, packet, intervalSeconds, in startNattKeepalive() 658 final TcpKeepalivePacketData packet; in startTcpKeepalive() local 660 packet = TcpKeepaliveController.getTcpKeepalivePacket(fd); in startTcpKeepalive() 670 ki = new KeepaliveInfo(cb, nai, packet, intervalSeconds, in startTcpKeepalive()
|