/packages/modules/NetworkStack/tests/unit/src/android/net/apf/ |
D | ApfTest.java | 171 private void assertVerdict(int expected, byte[] program, byte[] packet, int filterAge) { in assertVerdict() argument 172 assertReturnCodesEqual(expected, apfSimulate(program, packet, null, filterAge)); in assertVerdict() 175 private void assertVerdict(int expected, byte[] program, byte[] packet) { in assertVerdict() argument 176 assertReturnCodesEqual(expected, apfSimulate(program, packet, null, 0)); in assertVerdict() 179 private void assertPass(byte[] program, byte[] packet, int filterAge) { in assertPass() argument 180 assertVerdict(PASS, program, packet, filterAge); in assertPass() 183 private void assertPass(byte[] program, byte[] packet) { in assertPass() argument 184 assertVerdict(PASS, program, packet); in assertPass() 187 private void assertDrop(byte[] program, byte[] packet, int filterAge) { in assertDrop() argument 188 assertVerdict(DROP, program, packet, filterAge); in assertDrop() [all …]
|
/packages/modules/NetworkStack/tests/unit/src/android/net/dhcp/ |
D | DhcpPacketTest.java | 171 ByteBuffer packet = new TestDhcpPacket(DHCP_MESSAGE_TYPE_OFFER) in assertDomainAndVendorInfoParses() local 175 DhcpPacket offerPacket = DhcpPacket.decodeFullPacket(packet, ENCAP_BOOTP, in assertDomainAndVendorInfoParses() 217 ByteBuffer packet = testPacket.build(); in assertLeaseTimeParses() local 222 offerPacket = DhcpPacket.decodeFullPacket(packet, ENCAP_BOOTP, in assertLeaseTimeParses() 230 offerPacket = DhcpPacket.decodeFullPacket(packet, ENCAP_BOOTP, in assertLeaseTimeParses() 272 ByteBuffer packet = new TestDhcpPacket(type, clientIp, yourIp) in checkIpAddress() local 275 DhcpPacket offerPacket = DhcpPacket.decodeFullPacket(packet, ENCAP_BOOTP, in checkIpAddress() 339 final ByteBuffer packet = ByteBuffer.wrap(HexDump.hexStringToByteArray( in testOffer1() local 361 DhcpPacket offerPacket = DhcpPacket.decodeFullPacket(packet, ENCAP_L3, in testOffer1() 372 final ByteBuffer packet = ByteBuffer.wrap(HexDump.hexStringToByteArray( in testOffer2() local [all …]
|
D | DhcpServerTest.java | 248 final DhcpOfferPacket packet = assertOffer(getPacket()); in testDiscover() local 249 assertMatchesTestLease(packet); in testDiscover() 267 final DhcpAckPacket packet = assertAck(getPacket()); in testDiscover_RapidCommit() local 268 assertMatchesTestLease(packet); in testDiscover_RapidCommit() 286 final DhcpNakPacket packet = assertNak(getPacket()); in testDiscover_OutOfAddresses() local 287 assertMatchesClient(packet); in testDiscover_OutOfAddresses() 315 final DhcpAckPacket packet = assertAck(getPacket()); in testRequest_Selecting_Ack() local 316 assertMatchesTestLease(packet, TEST_HOSTNAME); in testRequest_Selecting_Ack() 333 final DhcpNakPacket packet = assertNak(getPacket()); in testRequest_Selecting_Nak() local 334 assertMatchesClient(packet); in testRequest_Selecting_Nak() [all …]
|
/packages/modules/NetworkStack/src/android/net/dhcp/ |
D | DhcpPacket.java | 826 private static Inet4Address readIpAddress(ByteBuffer packet) { in readIpAddress() argument 829 packet.get(ipAddr); in readIpAddress() 879 private static int skipOption(ByteBuffer packet, int optionLen) in skipOption() argument 884 packet.get(); in skipOption() 906 static DhcpPacket decodeFullPacket(ByteBuffer packet, int pktType, byte[] optionsToSkip) in decodeFullPacket() argument 949 packet.order(ByteOrder.BIG_ENDIAN); in decodeFullPacket() 953 if (packet.remaining() < MIN_PACKET_LENGTH_L2) { in decodeFullPacket() 955 "L2 packet too short, %d < %d", packet.remaining(), MIN_PACKET_LENGTH_L2); in decodeFullPacket() 961 packet.get(l2dst); in decodeFullPacket() 962 packet.get(l2src); in decodeFullPacket() [all …]
|
D | DhcpServer.java | 496 private void processPacket(@NonNull DhcpPacket packet) { in processPacket() argument 497 mLog.log("Received packet of type " + packet.getClass().getSimpleName()); in processPacket() 499 final Inet4Address sid = packet.mServerIdentifier; in processPacket() 506 if (packet instanceof DhcpDiscoverPacket) { in processPacket() 507 processDiscover((DhcpDiscoverPacket) packet); in processPacket() 508 } else if (packet instanceof DhcpRequestPacket) { in processPacket() 509 processRequest((DhcpRequestPacket) packet); in processPacket() 510 } else if (packet instanceof DhcpReleasePacket) { in processPacket() 511 processRelease((DhcpReleasePacket) packet); in processPacket() 512 } else if (packet instanceof DhcpDeclinePacket) { in processPacket() [all …]
|
D | DhcpClient.java | 556 private void confirmDhcpLease(DhcpPacket packet, DhcpResults results) { in confirmDhcpLease() argument 557 setDhcpLeaseExpiry(packet); in confirmDhcpLease() 620 final DhcpPacket packet = DhcpPacket.decodeFullPacket(recvbuf, length, in handlePacket() local 622 if (DBG) Log.d(TAG, "Received packet: " + packet); in handlePacket() 623 sendMessage(CMD_RECEIVED_PACKET, packet); in handlePacket() 712 final ByteBuffer packet = DhcpPacket.buildDiscoverPacket( in sendDiscoverPacket() local 716 return transmitPacket(packet, "DHCPDISCOVER", DhcpPacket.ENCAP_L2, INADDR_BROADCAST); in sendDiscoverPacket() 726 final ByteBuffer packet = DhcpPacket.buildRequestPacket( in sendRequestPacket() local 735 return transmitPacket(packet, description, encap, to); in sendRequestPacket() 741 final ByteBuffer packet = DhcpPacket.buildDeclinePacket(DhcpPacket.ENCAP_L2, in sendDeclinePacket() local [all …]
|
D | DhcpPacketListener.java | 58 final DhcpPacket packet = DhcpPacket.decodeFullPacket(recvbuf.mBytes, length, in handlePacket() local 60 onReceive(packet, recvbuf.mSrcAddr, recvbuf.mSrcPort); in handlePacket() 88 protected abstract void onReceive(@NonNull DhcpPacket packet, @NonNull Inet4Address srcAddr, in onReceive() argument 90 protected abstract void logParseError(@NonNull byte[] packet, int length, in logParseError() argument
|
/packages/modules/NetworkStack/tests/unit/src/android/net/util/ |
D | ConnectivityPacketSummaryTest.java | 50 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 …]
|
/packages/modules/NetworkStack/tests/integration/src/android/net/ip/ |
D | IpClientIntegrationTest.java | 509 private boolean packetContainsExpectedField(final byte[] packet, final int offset, 511 if (packet.length < offset + expected.length) return false; 513 if (packet[offset + i] != expected[i]) return false; 518 private boolean isDhcpPacket(final byte[] packet) { 519 final ByteBuffer buffer = ByteBuffer.wrap(packet); 522 if (packet.length < DHCP_HEADER_OFFSET) return false; 543 private ArpPacket parseArpPacketOrNull(final byte[] packet) { 545 return ArpPacket.parseArpPacket(packet, packet.length); 551 private static ByteBuffer buildDhcpOfferPacket(final DhcpPacket packet, 553 return DhcpPacket.buildOfferPacket(DhcpPacket.ENCAP_L2, packet.getTransactionId(), [all …]
|
/packages/modules/DnsResolver/ |
D | res_cache.cpp | 267 static void _dnsPacket_init(DnsPacket* packet, const uint8_t* buff, int bufflen) { in _dnsPacket_init() argument 268 packet->base = buff; in _dnsPacket_init() 269 packet->end = buff + bufflen; in _dnsPacket_init() 270 packet->cursor = buff; in _dnsPacket_init() 273 static void _dnsPacket_rewind(DnsPacket* packet) { in _dnsPacket_rewind() argument 274 packet->cursor = packet->base; in _dnsPacket_rewind() 277 static void _dnsPacket_skip(DnsPacket* packet, int count) { in _dnsPacket_skip() argument 278 const uint8_t* p = packet->cursor + count; in _dnsPacket_skip() 280 if (p > packet->end) p = packet->end; in _dnsPacket_skip() 282 packet->cursor = p; in _dnsPacket_skip() [all …]
|
/packages/modules/NetworkStack/tests/unit/src/com/android/networkstack/arp/ |
D | ArpPacketTest.java | 163 final ArpPacket packet = ArpPacket.parseArpPacket(TEST_ARP_PROBE, TEST_ARP_PROBE.length); in testParseArpProbePacket() local 164 assertEquals(packet.opCode, ARP_REQUEST); in testParseArpProbePacket() 165 assertEquals(packet.senderHwAddress, MacAddress.fromBytes(TEST_SENDER_MAC_ADDR)); in testParseArpProbePacket() 166 assertEquals(packet.targetHwAddress, MacAddress.fromBytes(TEST_TARGET_MAC_ADDR)); in testParseArpProbePacket() 167 assertEquals(packet.senderIp, INADDR_ANY); in testParseArpProbePacket() 168 assertEquals(packet.targetIp, TEST_IPV4_ADDR); in testParseArpProbePacket() 173 final ArpPacket packet = ArpPacket.parseArpPacket(TEST_ARP_ANNOUNCE, in testParseArpAnnouncePacket() local 175 assertEquals(packet.opCode, ARP_REQUEST); in testParseArpAnnouncePacket() 176 assertEquals(packet.senderHwAddress, MacAddress.fromBytes(TEST_SENDER_MAC_ADDR)); in testParseArpAnnouncePacket() 177 assertEquals(packet.targetHwAddress, MacAddress.fromBytes(TEST_TARGET_MAC_ADDR)); in testParseArpAnnouncePacket() [all …]
|
/packages/apps/Car/libs/connected-device-lib/src/com/android/car/connecteddevice/ble/ |
D | BleDeviceMessageStream.java | 172 BlePacket packet = mPacketQueue.remove(); in writeNextMessageInQueue() local 173 logd(TAG, "Writing packet " + packet.getPacketNumber() + " of " in writeNextMessageInQueue() 174 + packet.getTotalPackets() + " for " + packet.getMessageId() + "."); in writeNextMessageInQueue() 175 mWriteCharacteristic.setValue(packet.toByteArray()); in writeNextMessageInQueue() 216 BlePacket packet; in onCharacteristicWrite() local 218 packet = BlePacket.parseFrom(value); in onCharacteristicWrite() 226 processPacket(packet); in onCharacteristicWrite() 270 void processPacket(@NonNull BlePacket packet) { in processPacket() argument 275 int messageId = packet.getMessageId(); in processPacket() 280 byte[] payload = packet.getPayload().toByteArray(); in processPacket() [all …]
|
/packages/modules/IPsec/src/java/com/android/internal/net/eap/statemachine/ |
D | EapStateMachine.java | 112 protected EapResult transitionAndProcess(EapState newState, byte[] packet) { in transitionAndProcess() argument 113 return super.transitionAndProcess(newState, packet); in transitionAndProcess() 117 protected DecodeResult decode(@NonNull byte[] packet) { in decode() argument 119 "Received packet=[" + LOG.pii(packet) + "]"); in decode() 121 if (packet == null) { in decode() 127 EapMessage eapMessage = EapMessage.decode(packet); in decode() 187 public EapResult process(@NonNull byte[] packet) { in process() argument 188 DecodeResult decodeResult = decode(packet); in process() 206 return transitionAndProcess(new IdentityState(), packet); in process() 210 return transitionAndProcess(new MethodState(), packet); in process() [all …]
|
/packages/apps/TV/tuner/src/com/android/tv/tuner/hdhomerun/ |
D | HdHomeRunDiscover.java | 328 DatagramPacket packet = in send() local 334 mSocket.send(packet); in send() 353 DatagramPacket packet = new DatagramPacket(new byte[3074], 3074); in receive() local 356 mSocket.receive(packet); in receive() 357 if (DEBUG) Log.d(TAG, "Received packet, size: " + packet.getLength()); in receive() 370 HdHomeRunUtils.openFrame(packet.getData(), packet.getLength()); in receive() 374 if (DEBUG) Log.d(TAG, "Ill-formed packet: " + Arrays.toString(packet.getData())); in receive() 377 result.mIpAddress = HdHomeRunUtils.addressToInt(packet.getAddress().getAddress()); in receive()
|
/packages/apps/Nfc/src/com/android/nfc/echoserver/ |
D | EchoServer.java | 291 LlcpPacket packet; in run() local 303 packet = socket.receive(); in run() 304 if (packet == null || packet.getDataBuffer() == null) { in run() 307 byte[] dataUnit = packet.getDataBuffer(); in run() 310 if (DBG) Log.d(TAG, "read " + packet.getDataBuffer().length + " bytes"); in run() 315 mRemoteSap = packet.getRemoteSap(); in run()
|
/packages/modules/NetworkStack/tests/unit/src/android/net/ip/ |
D | IpReachabilityMonitorTest.kt | 133 fun enqueuePacket(packet: ByteArray) { in createFd() 135 pendingPackets.add(packet) in createFd() 142 val packet = pendingPackets.poll() ?: throw ErrnoException("No pending packet", EAGAIN) in readPacket() constant 143 if (packet.size > packetBuffer.size) { in readPacket() 146 System.arraycopy(packet, 0, packetBuffer, 0, packet.size) in readPacket() 147 return packet.size in readPacket()
|
/packages/modules/DnsResolver/tests/testdata/ |
D | README.md | 37 # Query packet 46 # Response packet 86 binary packet record in pbtext file. Here are the instructions and example 87 for parsing packet. 100 1. Find the packet record 'query' or 'response' in .pbtext file. 116 Assign the binary packet to be decoded into a variable. Beware of using 124 Decode packet
|
/packages/modules/IPsec/src/java/com/android/internal/net/eap/ |
D | EapResult.java | 64 public final byte[] packet; field in EapResult.EapResponse 67 protected EapResponse(byte[] packet) { in EapResponse() argument 68 this.packet = packet; in EapResponse()
|
/packages/modules/NetworkStack/src/android/net/apf/ |
D | ApfFilter.java | 773 Ra(byte[] packet, int length) throws InvalidRaException { in Ra() argument 778 mPacket = ByteBuffer.wrap(Arrays.copyOf(packet, length)); in Ra() 866 boolean matches(byte[] packet, int length) { in matches() argument 872 if (packet[i] != referencePacket[i]) return false; in matches() 1065 TcpKeepaliveAck(final TcpKeepaliveAckData packet, final byte[] srcDstAddr) { in TcpKeepaliveAck() argument 1066 mPacket = packet; in TcpKeepaliveAck() 1107 TcpKeepaliveAckV4(final TcpKeepaliveAckData packet) { in TcpKeepaliveAckV4() argument 1108 super(packet, concatArrays(packet.srcAddress, packet.dstAddress) /* srcDstAddr */); in TcpKeepaliveAckV4() 1150 TcpKeepaliveAckV6(final TcpKeepaliveAckData packet) { in TcpKeepaliveAckV6() argument 1151 super(packet, concatArrays(packet.srcAddress, packet.dstAddress) /* srcDstAddr */); in TcpKeepaliveAckV6() [all …]
|
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/message/ |
D | IkeMessage.java | 136 byte[] packet, in decode() argument 144 packet, in decode() 382 DecodeResult decode(int expectedMsgId, IkeHeader ikeHeader, byte[] packet); in decode() argument 402 byte[] packet, in decode() argument 413 byte[] packet = ikeMessage.attachEncodedHeader(encodedIkeBody); in encode() 414 getIkeLog().d("IkeMessage", "Build a complete IKE message: " + getIkeLog().pii(packet)); in encode() 415 return packet; in encode() 578 byte[] packet, in decode() argument 583 packet, in decode()
|
/packages/apps/Car/libs/connected-device-lib/tests/unit/src/com/android/car/connecteddevice/ble/ |
D | BlePacketFactoryTest.java | 136 for (BlePacket packet : packets) { in testMakePackets_correctlyChunksPayload() 137 reconstructedPayload.write(packet.getPayload().toByteArray()); in testMakePackets_correctlyChunksPayload() 157 for (BlePacket packet : packets) { in testMakePackets_correctlyChunksSplitPayload() 158 reconstructedPayload.write(packet.getPayload().toByteArray()); in testMakePackets_correctlyChunksSplitPayload()
|
/packages/modules/DnsResolver/tests/ |
D | golddata.proto | 146 // query packet as the predefined packet in |packet_mapping.query|. When the DNS responser receives 147 // the query packet, it returns the corresponding response packet from |packet_mapping.response|. 198 // Used to build the packet mapping (query, response) in DNS responser. See also
|
/packages/apps/Nfc/nci/src/com/android/nfc/dhimpl/ |
D | NativeLlcpConnectionlessSocket.java | 61 LlcpPacket packet = doReceiveFrom(mLinkMiu); in receive() local 62 if (packet == null) { in receive() 65 return packet; in receive()
|
/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/eap/statemachine/ |
D | EapSimAkaMethodStateMachineTest.java | 177 assertArrayEquals(EAP_SIM_CLIENT_ERROR_RESPONSE, eapResponse.packet); in testBuildClientErrorResponse() 195 assertArrayEquals(EAP_SIM_RESPONSE_PACKET, eapResponse.packet); in testBuildResponseMessage() 358 assertArrayEquals(EAP_SIM_CHALLENGE_RESPONSE_WITH_MAC, eapResponse.packet); in testBuildResponseMessageWithMac() 373 assertArrayEquals(EAP_SIM_NOTIFICATION_RESPONSE, eapResponse.packet); in testHandleEapSimNotificationPreChallenge() 388 assertArrayEquals(EAP_SIM_CLIENT_ERROR_UNABLE_TO_PROCESS, eapResponse.packet); in testHandleEapSimNotificationPreChallengeInvalidPBit() 421 assertArrayEquals(EAP_SIM_CLIENT_ERROR_UNABLE_TO_PROCESS, eapResponse.packet); in testHandleEapSimNotificationInvalidAtMac() 447 assertArrayEquals(EAP_SIM_NOTIFICATION_RESPONSE_WITH_MAC, eapResponse.packet); in testHandleEapSimNotificationPostChallenge() 466 assertArrayEquals(EAP_SIM_CLIENT_ERROR_UNABLE_TO_PROCESS, eapResponse.packet); in testHandleEapSimNotificationPostChallengeInvalidAtMac()
|
/packages/modules/NetworkStack/src/com/android/networkstack/metrics/ |
D | stats.proto | 31 // Is portal url option included in the DHCP packet (Yes, No) 66 // The discover packet (re)transmit count 69 // The request packet (re)transmit count 76 // The DHCP packet parsing error code in this session 121 // The request packet (re)transmit count
|