Home
last modified time | relevance | path

Searched refs:packet (Results 1 – 25 of 50) sorted by relevance

12

/frameworks/base/tests/net/java/android/net/util/
DIpUtilsTest.java81 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 …]
DConnectivityPacketSummaryTest.java50 final String packet = in testParseICMPv6DADProbe() local
67 assertEquals(expected, getSummary(packet)); in testParseICMPv6DADProbe()
72 final String packet = in testParseICMPv6RS() local
89 assertEquals(expected, getSummary(packet)); in testParseICMPv6RS()
94 final String packet = in testParseICMPv6RA() local
122 assertEquals(expected, getSummary(packet)); in testParseICMPv6RA()
127 final String packet = in testParseICMPv6NS() local
145 assertEquals(expected, getSummary(packet)); in testParseICMPv6NS()
150 final String packet = in testInvalidICMPv6NDLength() local
170 assertEquals(expected, getSummary(packet)); in testInvalidICMPv6NDLength()
[all …]
/frameworks/base/tests/net/java/android/net/dhcp/
DDhcpPacketTest.java139 ByteBuffer packet = new TestDhcpPacket(DHCP_MESSAGE_TYPE_OFFER) in assertDomainAndVendorInfoParses() local
143 DhcpPacket offerPacket = DhcpPacket.decodeFullPacket(packet, ENCAP_BOOTP); in assertDomainAndVendorInfoParses()
184 ByteBuffer packet = testPacket.build(); in assertLeaseTimeParses() local
189 offerPacket = DhcpPacket.decodeFullPacket(packet, ENCAP_BOOTP); in assertLeaseTimeParses()
196 offerPacket = DhcpPacket.decodeFullPacket(packet, ENCAP_BOOTP); in assertLeaseTimeParses()
237 ByteBuffer packet = new TestDhcpPacket(type, clientIp, yourIp) in checkIpAddress() local
240 DhcpPacket offerPacket = DhcpPacket.decodeFullPacket(packet, ENCAP_BOOTP); in checkIpAddress()
300 final ByteBuffer packet = ByteBuffer.wrap(HexDump.hexStringToByteArray( in testOffer1() local
321 DhcpPacket offerPacket = DhcpPacket.decodeFullPacket(packet, ENCAP_L3); in testOffer1()
330 final ByteBuffer packet = ByteBuffer.wrap(HexDump.hexStringToByteArray( in testOffer2() local
[all …]
/frameworks/av/media/mtp/
DMtpObjectInfo.cpp58 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 …]
DMtpProperty.cpp130 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 …]
DMtpDeviceInfo.cpp62 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 …]
DMtpStorageInfo.cpp48 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()
DMtpStringBuffer.cpp66 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()
DMtpProperty.h89 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,
DIMtpDatabase.h65 MtpDataPacket& packet) = 0;
69 MtpDataPacket& packet) = 0;
72 MtpDataPacket& packet) = 0;
75 MtpDataPacket& packet) = 0;
82 MtpDataPacket& packet) = 0;
DMtpStringBuffer.h51 bool readFromPacket(MtpDataPacket* packet);
52 void writeToPacket(MtpDataPacket* packet) const;
/frameworks/base/tests/net/java/android/net/apf/
DApfTest.java129 private void assertVerdict(int expected, byte[] program, byte[] packet, int filterAge) { in assertVerdict() argument
130 assertReturnCodesEqual(expected, apfSimulate(program, packet, null, filterAge)); in assertVerdict()
133 private void assertVerdict(int expected, byte[] program, byte[] packet) { in assertVerdict() argument
134 assertReturnCodesEqual(expected, apfSimulate(program, packet, null, 0)); in assertVerdict()
137 private void assertPass(byte[] program, byte[] packet, int filterAge) { in assertPass() argument
138 assertVerdict(PASS, program, packet, filterAge); in assertPass()
141 private void assertPass(byte[] program, byte[] packet) { in assertPass() argument
142 assertVerdict(PASS, program, packet); in assertPass()
145 private void assertDrop(byte[] program, byte[] packet, int filterAge) { in assertDrop() argument
146 assertVerdict(DROP, program, packet, filterAge); in assertDrop()
[all …]
/frameworks/base/services/net/java/android/net/dhcp/
DDhcpPacket.java670 private static Inet4Address readIpAddress(ByteBuffer packet) { in readIpAddress() argument
673 packet.get(ipAddr); in readIpAddress()
733 static DhcpPacket decodeFullPacket(ByteBuffer packet, int pktType) throws ParseException in decodeFullPacket() argument
771 packet.order(ByteOrder.BIG_ENDIAN); in decodeFullPacket()
775 if (packet.remaining() < MIN_PACKET_LENGTH_L2) { in decodeFullPacket()
777 "L2 packet too short, %d < %d", packet.remaining(), MIN_PACKET_LENGTH_L2); in decodeFullPacket()
783 packet.get(l2dst); in decodeFullPacket()
784 packet.get(l2src); in decodeFullPacket()
786 short l2type = packet.getShort(); in decodeFullPacket()
795 if (packet.remaining() < MIN_PACKET_LENGTH_L3) { in decodeFullPacket()
[all …]
DDhcpClient.java365 DhcpPacket packet = null; in run() local
366 packet = DhcpPacket.decodeFullPacket(mPacket, length, DhcpPacket.ENCAP_L2); in run()
367 if (DBG) Log.d(TAG, "Received packet: " + packet); in run()
368 sendMessage(CMD_RECEIVED_PACKET, packet); in run()
426 ByteBuffer packet = DhcpPacket.buildDiscoverPacket( in sendDiscoverPacket() local
429 return transmitPacket(packet, "DHCPDISCOVER", DhcpPacket.ENCAP_L2, INADDR_BROADCAST); in sendDiscoverPacket()
439 ByteBuffer packet = DhcpPacket.buildRequestPacket( in sendRequestPacket() local
447 return transmitPacket(packet, description, encap, to); in sendRequestPacket()
648 public boolean isValidPacket(DhcpPacket packet) { in isValidPacket() argument
650 int xid = packet.getTransactionId(); in isValidPacket()
[all …]
/frameworks/base/media/jni/
Dandroid_mtp_MtpDatabase.cpp140 MtpDataPacket& packet);
144 MtpDataPacket& packet);
147 MtpDataPacket& packet);
150 MtpDataPacket& packet);
157 MtpDataPacket& packet);
384 MtpDataPacket& packet) { in getObjectPropertyValue() argument
420 packet.putInt8(longValue); in getObjectPropertyValue()
423 packet.putUInt8(longValue); in getObjectPropertyValue()
426 packet.putInt16(longValue); in getObjectPropertyValue()
429 packet.putUInt16(longValue); in getObjectPropertyValue()
[all …]
/frameworks/base/obex/javax/obex/
DServerOperation.java141 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 …]
DClientSession.java393 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/base/tools/preload2/src/com/android/preload/classdataretrieval/jdwp/
DJDWPClassDataRetriever.java83 CommandPacket packet = new CommandPacket( in retrieveImpl() local
86 ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet); in retrieveImpl()
93 CommandPacket packet = new CommandPacket( in retrieveImpl() local
96 ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet); in retrieveImpl()
152 CommandPacket packet = new CommandPacket( in retrieveImpl() local
155 /* ReplyPacket reply = */ debuggeeWrapper.vmMirror.performCommand(packet); in retrieveImpl()
161 CommandPacket packet = new CommandPacket( in checkClass() local
164 packet.setNextValueAsReferenceTypeID(typeID); in checkClass()
165 ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet); in checkClass()
182 CommandPacket packet = new CommandPacket( in checkArrayClass() local
[all …]
/frameworks/base/lowpan/java/android/net/lowpan/
DLowpanCommissioningSession.java53 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/base/core/java/android/nfc/cardemulation/
DHostNfcFService.java184 byte[] packet = dataBundle.getByteArray(KEY_DATA); in handleMessage()
185 if (packet != null) { in handleMessage()
186 byte[] responsePacket = processNfcFPacket(packet, null); in handleMessage()
/frameworks/base/tests/net/jni/
Dapf_jni.cpp31 JNIEnv* env, jclass, jbyteArray program, jbyteArray packet, in com_android_server_ApfTest_apfSimulate() argument
34 uint8_t* packet_raw = (uint8_t*)env->GetByteArrayElements(packet, nullptr); in com_android_server_ApfTest_apfSimulate()
37 uint32_t packet_len = env->GetArrayLength(packet); in com_android_server_ApfTest_apfSimulate()
53 env->ReleaseByteArrayElements(packet, (jbyte*)packet_raw, JNI_ABORT); in com_android_server_ApfTest_apfSimulate()
/frameworks/av/media/extractors/ogg/
DOggExtractor.cpp273 MediaBufferBase *packet; in read() local
274 status_t err = mExtractor->mImpl->readNextPacket(&packet); in read()
282 if (packet->meta_data().findInt64(kKeyTime, &timeUs)) { in read()
289 packet->meta_data().setInt32(kKeyIsSyncFrame, 1); in read()
291 *out = packet; in read()
838 MediaBufferBase *packet; in init() local
841 if ((err = _readNextPacket(&packet, /* calcVorbisTimestamp = */ false)) != OK) { in init()
844 ALOGV("read packet of size %zu\n", packet->range_length()); in init()
845 err = verifyHeader(packet, /* type = */ i * 2 + 1); in init()
846 packet->release(); in init()
[all …]
/frameworks/base/services/net/java/android/net/apf/
DApfFilter.java616 Ra(byte[] packet, int length) throws InvalidRaException { in Ra() argument
621 mPacket = ByteBuffer.wrap(Arrays.copyOf(packet, length)); in Ra()
707 mMinLifetime = minLifetime(packet, length); in Ra()
712 boolean matches(byte[] packet, int length) { in matches() argument
717 if (packet[i] != referencePacket[i]) return false; in matches()
725 long minLifetime(byte[] packet, int length) { in minLifetime() argument
728 ByteBuffer byteBuffer = ByteBuffer.wrap(packet); in minLifetime()
1304 private void hexDump(String msg, byte[] packet, int length) { in hexDump() argument
1305 log(msg + HexDump.toHexString(packet, 0, length, false /* lowercase */)); in hexDump()
1326 synchronized ProcessRaResult processRa(byte[] packet, int length) { in processRa() argument
[all …]
/frameworks/base/services/core/java/com/android/server/connectivity/
DKeepaliveTracker.java102 KeepalivePacketData packet, int interval) { in KeepaliveInfo() argument
109 mPacket = packet; in KeepaliveInfo()
348 KeepalivePacketData packet; in startNattKeepalive() local
350 packet = KeepalivePacketData.nattKeepalivePacket( in startNattKeepalive()
356 KeepaliveInfo ki = new KeepaliveInfo(messenger, binder, nai, packet, intervalSeconds); in startNattKeepalive()
/frameworks/av/media/extractors/mpeg2/
DMPEG2TSExtractor.cpp328 uint8_t packet[kTSPacketSize]; in feedMore() local
329 ssize_t n = mDataSource->readAt(mOffset, packet, kTSPacketSize); in feedMore()
340 status_t err = mParser->feedTSPacket(packet, kTSPacketSize, &event); in feedMore()
387 uint8_t packet[kTSPacketSize]; in estimateDurationsFromTimesUsAtEnd() local
390 if (mDataSource->readAt(offset, &packet, 0) < 0) { in estimateDurationsFromTimesUsAtEnd()
408 ssize_t n = mDataSource->readAt(offset, packet, kTSPacketSize); in estimateDurationsFromTimesUsAtEnd()
417 err = parser->feedTSPacket(packet, kTSPacketSize, &ev); in estimateDurationsFromTimesUsAtEnd()

12