/system/bt/hci/src/ |
D | packet_fragmenter.c | 66 static void fragment_and_dispatch(BT_HDR *packet) { in fragment_and_dispatch() argument 67 assert(packet != NULL); in fragment_and_dispatch() 69 uint16_t event = packet->event & MSG_EVT_MASK; in fragment_and_dispatch() 70 uint8_t *stream = packet->data + packet->offset; in fragment_and_dispatch() 74 callbacks->fragmented(packet, true); in fragment_and_dispatch() 79 SUB_EVENT(packet->event) == LOCAL_BR_EDR_CONTROLLER_ID ? in fragment_and_dispatch() 84 uint16_t remaining_length = packet->len; in fragment_and_dispatch() 92 stream = packet->data + packet->offset; in fragment_and_dispatch() 96 packet->len = max_packet_size; in fragment_and_dispatch() 97 callbacks->fragmented(packet, false); in fragment_and_dispatch() [all …]
|
D | btsnoop_mem.c | 30 void btsnoop_mem_capture(const BT_HDR *packet) { in btsnoop_mem_capture() argument 34 assert(packet); in btsnoop_mem_capture() 36 const uint8_t *data = &packet->data[packet->offset]; in btsnoop_mem_capture() 37 const uint16_t type = packet->event & BT_EVT_MASK; in btsnoop_mem_capture() 42 if (packet->len > 2) in btsnoop_mem_capture() 47 if (packet->len > 1) in btsnoop_mem_capture() 53 if (packet->len > 3) in btsnoop_mem_capture() 59 if (packet->len > 2) in btsnoop_mem_capture()
|
D | hci_packet_factory.c | 49 BT_HDR *packet = make_command(HCI_HOST_BUFFER_SIZE, parameter_size, &stream); in make_host_buffer_size() local 55 return packet; in make_host_buffer_size() 73 BT_HDR *packet = make_command(HCI_READ_LOCAL_EXT_FEATURES, parameter_size, &stream); in make_read_local_extended_features() local 76 return packet; in make_read_local_extended_features() 82 BT_HDR *packet = make_command(HCI_WRITE_SIMPLE_PAIRING_MODE, parameter_size, &stream); in make_write_simple_pairing_mode() local 85 return packet; in make_write_simple_pairing_mode() 91 BT_HDR *packet = make_command(HCI_WRITE_SECURE_CONNS_SUPPORT, parameter_size, &stream); in make_write_secure_connections_host_support() local 94 return packet; in make_write_secure_connections_host_support() 100 BT_HDR *packet = make_command(HCI_SET_EVENT_MASK, parameter_size, &stream); in make_set_event_mask() local 103 return packet; in make_set_event_mask() [all …]
|
D | btsnoop.c | 65 static void btsnoop_write_packet(packet_type_t type, const uint8_t *packet, bool is_received); 198 static void btsnoop_write_packet(packet_type_t type, const uint8_t *packet, bool is_received) { in btsnoop_write_packet() argument 205 length_he = packet[2] + 4; in btsnoop_write_packet() 209 length_he = (packet[3] << 8) + packet[2] + 5; in btsnoop_write_packet() 213 length_he = packet[2] + 4; in btsnoop_write_packet() 217 length_he = packet[1] + 3; in btsnoop_write_packet() 239 btsnoop_write(packet, length_he - 1); in btsnoop_write_packet()
|
D | hci_layer.c | 159 static bool filter_incoming_event(BT_HDR *packet); 495 BT_HDR *packet = (BT_HDR *)fixed_queue_dequeue(queue); in event_packet_ready() local 498 packet_fragmenter->fragment_and_dispatch(packet); in event_packet_ready() 503 static void transmit_fragment(BT_HDR *packet, bool send_transmit_finished) { in transmit_fragment() argument 504 uint16_t event = packet->event & MSG_EVT_MASK; in transmit_fragment() 507 btsnoop->capture(packet, false); in transmit_fragment() 508 hal->transmit_data(type, packet->data + packet->offset, packet->len); in transmit_fragment() 511 buffer_allocator->free(packet); in transmit_fragment() 514 static void fragmenter_transmit_finished(BT_HDR *packet, bool all_fragments_sent) { in fragmenter_transmit_finished() argument 516 buffer_allocator->free(packet); in fragmenter_transmit_finished() [all …]
|
/system/bt/tools/hci/ |
D | main.c | 32 static bool write_hci_command(hci_packet_t type, const void *packet, size_t length); 71 uint8_t packet[] = { 0x1A, 0x0C, 0x01, 0x00 }; in set_discoverable() local 73 packet[ARRAY_SIZE(packet) - 1] = 0x03; in set_discoverable() 75 return !write_hci_command(HCI_PACKET_COMMAND, packet, ARRAY_SIZE(packet)); in set_discoverable() 90 uint8_t packet[251] = { 0x13, 0x0C, 248 }; in set_name() local 91 memcpy(&packet[3], argv[0], len + 1); in set_name() 93 if (!write_hci_command(HCI_PACKET_COMMAND, packet, sizeof(packet))) in set_name() 96 memset(&packet[0], 0, sizeof(packet)); in set_name() 97 packet[0] = 0x52; in set_name() 98 packet[1] = 0x0C; in set_name() [all …]
|
/system/bt/hci/test/ |
D | packet_fragmenter_test.cpp | 73 BT_HDR *packet = (BT_HDR *)osi_malloc(size + sizeof(BT_HDR)); in manufacture_packet_for_fragmentation() local 74 packet->len = size; in manufacture_packet_for_fragmentation() 75 packet->offset = 0; in manufacture_packet_for_fragmentation() 76 packet->event = event; in manufacture_packet_for_fragmentation() 77 packet->layer_specific = 0; in manufacture_packet_for_fragmentation() 78 uint8_t *packet_data = packet->data; in manufacture_packet_for_fragmentation() 86 return packet; in manufacture_packet_for_fragmentation() 89 static void expect_packet_fragmented(uint16_t event, int max_acl_data_size, BT_HDR *packet, const c… in expect_packet_fragmented() argument 90 uint8_t *data = packet->data + packet->offset; in expect_packet_fragmented() 106 int packet_data_length = packet->len - HCI_ACL_PREAMBLE_SIZE; in expect_packet_fragmented() [all …]
|
/system/core/libnetutils/ |
D | packet.c | 165 } packet; in receive_packet() local 171 nread = read(s, &packet, sizeof(packet)); in receive_packet() 185 } else if (packet.ip.version != IPVERSION || packet.ip.ihl != (sizeof(packet.ip) >> 2)) { in receive_packet() 189 } else if (nread < ntohs(packet.ip.tot_len)) { in receive_packet() 191 ALOGD("Packet was truncated (read %d, needed %d)", nread, ntohs(packet.ip.tot_len)); in receive_packet() 193 } else if (packet.ip.protocol != IPPROTO_UDP) { in receive_packet() 195 ALOGD("IP protocol (%d) is not UDP", packet.ip.protocol); in receive_packet() 197 } else if (packet.udp.dest != htons(PORT_BOOTP_CLIENT)) { in receive_packet() 199 ALOGD("UDP dest port (%d) is not DHCP client", ntohs(packet.udp.dest)); in receive_packet() 211 sum = finish_sum(checksum(&packet.ip, sizeof(packet.ip), 0)); in receive_packet() [all …]
|
/system/extras/tests/net_test/ |
D | packets.py | 48 def _SetPacketTos(packet, tos): argument 49 if isinstance(packet, scapy.IPv6): 50 packet.tc = tos 51 elif isinstance(packet, scapy.IP): 52 packet.tos = tos 67 packet = (scapy.IP(src=srcaddr, dst=dstaddr, ttl=39, tos=0x83) / 71 packet = (scapy.IPv6(src=srcaddr, dst=dstaddr, 75 return ("UDPv%d packet with options" % version, packet) 87 def RST(version, srcaddr, dstaddr, packet): argument 89 original = packet.getlayer("TCP") [all …]
|
/system/connectivity/shill/ |
D | arp_packet.cc | 67 bool ArpPacket::Parse(const ByteString& packet) { in Parse() argument 69 if (packet.GetLength() < sizeof(header)) { in Parse() 70 LOG(ERROR) << "Packet size " << packet.GetLength() in Parse() 75 memcpy(&header, packet.GetConstData(), sizeof(header)); in Parse() 114 if (packet.GetLength() < min_packet_size) { in Parse() 116 << packet.GetLength() in Parse() 123 local_mac_address_ = packet.GetSubstring(sizeof(header), ETH_ALEN); in Parse() 124 local_ip_address_ = IPAddress(family, packet.GetSubstring( in Parse() 126 remote_mac_address_ = packet.GetSubstring( in Parse() 128 remote_ip_address_ = IPAddress(family, packet.GetSubstring( in Parse() [all …]
|
D | arp_client_unittest.cc | 78 void SetupValidPacket(ArpPacket* packet); 116 void ArpClientTest::SetupValidPacket(ArpPacket* packet) { in SetupValidPacket() argument 119 packet->set_local_ip_address(local_ip); in SetupValidPacket() 122 packet->set_remote_ip_address(remote_ip); in SetupValidPacket() 124 packet->set_local_mac_address(local_mac); in SetupValidPacket() 126 packet->set_remote_mac_address(remote_mac); in SetupValidPacket() 239 ArpPacket packet; in TEST_F() local 240 SetupValidPacket(&packet); in TEST_F() 241 packet.FormatRequest(&recvfrom_reply_data_); in TEST_F() 250 EXPECT_TRUE(reply.local_ip_address().Equals(packet.local_ip_address())); in TEST_F() [all …]
|
D | arp_client_test_helper.cc | 47 bool ArpClientTestHelper::SimulateReceivePacket(ArpPacket* packet, in SimulateReceivePacket() argument 49 packet->set_operation(packet_.operation()); in SimulateReceivePacket() 50 packet->set_local_ip_address(packet_.local_ip_address()); in SimulateReceivePacket() 51 packet->set_local_mac_address(packet_.local_mac_address()); in SimulateReceivePacket() 52 packet->set_remote_ip_address(packet_.remote_ip_address()); in SimulateReceivePacket() 53 packet->set_remote_mac_address(packet_.remote_mac_address()); in SimulateReceivePacket()
|
D | active_link_monitor.cc | 239 ArpPacket packet; in ReceiveResponse() local 241 if (!arp_client_->ReceivePacket(&packet, &sender)) { in ReceiveResponse() 245 if (!packet.IsReply()) { in ReceiveResponse() 251 packet.remote_ip_address().address())) { in ReceiveResponse() 256 if (!local_mac_address_.Equals(packet.remote_mac_address())) { in ReceiveResponse() 262 packet.local_ip_address().address())) { in ReceiveResponse() 289 if (!gateway_mac_address_.Equals(packet.local_mac_address())) { in ReceiveResponse() 290 const ByteString& new_mac_address = packet.local_mac_address(); in ReceiveResponse()
|
/system/connectivity/shill/wifi/ |
D | callback80211_metrics_unittest.cc | 159 NetlinkPacket packet(kDisconnectMessage, sizeof(kDisconnectMessage)); in TEST_F() local 161 &packet, NetlinkMessage::MessageContext())); in TEST_F() 168 NetlinkPacket packet(kDeauthenticateMessage, sizeof(kDeauthenticateMessage)); in TEST_F() local 170 &packet, NetlinkMessage::MessageContext())); in TEST_F() 178 NetlinkPacket packet( in TEST_F() local 181 &packet, NetlinkMessage::MessageContext())); in TEST_F() 187 NetlinkPacket packet( in TEST_F() local 190 &packet, NetlinkMessage::MessageContext())); in TEST_F() 197 NetlinkPacket packet(kNewStationMessage, sizeof(kNewStationMessage)); in TEST_F() local 199 &packet, NetlinkMessage::MessageContext())); in TEST_F() [all …]
|
/system/connectivity/shill/shims/ |
D | netfilter_queue_processor.cc | 253 Packet packet; in InputQueueCallback() local 254 if (!packet.ParseNetfilterData(netfilter_data)) { in InputQueueCallback() 262 if (processor->IsIncomingPacketAllowed(packet, now)) { in InputQueueCallback() 267 return nfq_set_verdict(queue_handle, packet.packet_id(), verdict, 0, NULL); in InputQueueCallback() 276 Packet packet; in OutputQueueCallback() local 277 if (!packet.ParseNetfilterData(netfilter_data)) { in OutputQueueCallback() 284 processor->LogOutgoingPacket(packet, now); in OutputQueueCallback() 285 return nfq_set_verdict(queue_handle, packet.packet_id(), NF_ACCEPT, 0, NULL); in OutputQueueCallback() 359 const Packet& packet, time_t now) { in IsIncomingPacketAllowed() argument 362 << AddressAndPortToString(packet.source_ip(), in IsIncomingPacketAllowed() [all …]
|
/system/connectivity/shill/net/ |
D | netlink_packet_unittest.cc | 112 NetlinkPacket packet(data, sizeof(data)); in TEST_F() local 113 EXPECT_EQ(22, packet.GetRemainingLength()); in TEST_F() 117 EXPECT_TRUE(packet.ConsumeData(2, &string_piece)); in TEST_F() 119 EXPECT_EQ(18, packet.GetRemainingLength()); in TEST_F() 122 EXPECT_TRUE(packet.ConsumeData(8, &string_piece)); in TEST_F() 124 EXPECT_EQ(10, packet.GetRemainingLength()); in TEST_F() 127 EXPECT_TRUE(packet.ConsumeData(3, &string_piece)); in TEST_F() 129 EXPECT_EQ(6, packet.GetRemainingLength()); in TEST_F() 132 EXPECT_FALSE(packet.ConsumeData(7, &string_piece)); in TEST_F() 133 EXPECT_EQ(6, packet.GetRemainingLength()); in TEST_F() [all …]
|
D | netlink_message.cc | 74 bool NetlinkMessage::InitAndStripHeader(NetlinkPacket* packet) { in InitAndStripHeader() argument 75 const nlmsghdr& header = packet->GetNlMsgHeader(); in InitAndStripHeader() 83 bool NetlinkMessage::InitFromPacket(NetlinkPacket* packet, in InitFromPacket() argument 85 if (!packet) { in InitFromPacket() 89 if (!InitAndStripHeader(packet)) { in InitFromPacket() 118 void NetlinkMessage::PrintPacket(int log_level, const NetlinkPacket& packet) { in PrintPacket() argument 120 if (!packet.IsValid()) { in PrintPacket() 125 PrintHeader(log_level, &packet.GetNlMsgHeader()); in PrintPacket() 126 const ByteString& payload = packet.GetPayload(); in PrintPacket() 172 bool ErrorAckMessage::InitFromPacket(NetlinkPacket* packet, in InitFromPacket() argument [all …]
|
D | generic_netlink_message.cc | 75 bool GenericNetlinkMessage::InitAndStripHeader(NetlinkPacket* packet) { in InitAndStripHeader() argument 76 if (!packet) { in InitAndStripHeader() 80 if (!NetlinkMessage::InitAndStripHeader(packet)) { in InitAndStripHeader() 85 if (!packet->ConsumeData(sizeof(gnlh), &gnlh)) { in InitAndStripHeader() 110 NetlinkPacket* packet, NetlinkMessage::MessageContext context) { in InitFromPacket() argument 111 if (!packet) { in InitFromPacket() 116 if (!InitAndStripHeader(packet)) { in InitFromPacket() 120 return packet->ConsumeAttributes( in InitFromPacket() 140 const NetlinkPacket& packet) { in CreateMessage() argument 142 if (!packet.GetGenlMsgHdr(&header)) { in CreateMessage()
|
D | netlink_message.h | 104 virtual bool InitFromPacket(NetlinkPacket* packet, MessageContext context); 120 static void PrintPacket(int log_level, const NetlinkPacket& packet); 131 virtual bool InitAndStripHeader(NetlinkPacket* packet); 161 bool InitFromPacket(NetlinkPacket* packet, MessageContext context) override; 239 typedef base::Callback<NetlinkMessage*(const NetlinkPacket& packet)> 250 NetlinkMessage* CreateMessage(NetlinkPacket* packet,
|
D | netlink_manager.cc | 577 const NetlinkPacket& packet) { in InferMessageContext() argument 580 const uint32_t sequence_number = packet.GetMessageSequence(); in InferMessageContext() 582 packet.GetMessageType() != ErrorAckMessage::kMessageType) { in InferMessageContext() 587 if (packet.GetMessageType() == Nl80211Message::GetMessageType() && in InferMessageContext() 588 packet.GetGenlMsgHdr(&genl_header)) { in InferMessageContext() 669 NetlinkPacket packet(buf, end - buf); in OnRawNlMessageReceived() local 670 if (!packet.IsValid()) { in OnRawNlMessageReceived() 673 buf += packet.GetLength(); in OnRawNlMessageReceived() 674 OnNlMessageReceived(&packet); in OnRawNlMessageReceived() 678 void NetlinkManager::OnNlMessageReceived(NetlinkPacket* packet) { in OnNlMessageReceived() argument [all …]
|
/system/bt/vendor_libs/test_vendor_lib/test/ |
D | packet_stream_unittest.cc | 59 std::vector<uint8_t> packet; in CheckedReceiveCommand() local 61 packet.push_back(DATA_TYPE_COMMAND); in CheckedReceiveCommand() 62 packet.push_back(opcode); in CheckedReceiveCommand() 63 packet.push_back(opcode >> 8); in CheckedReceiveCommand() 64 packet.push_back(payload_size); in CheckedReceiveCommand() 68 packet.push_back(payload[i]); in CheckedReceiveCommand() 71 write(socketpair_fds_[1], &packet[1], packet.size()); in CheckedReceiveCommand() 81 EXPECT_EQ(packet.size(), command->GetPacketSize()); in CheckedReceiveCommand() 86 EXPECT_EQ(packet[4 + i], received_payload[i]); in CheckedReceiveCommand()
|
/system/bt/hci/include/ |
D | packet_fragmenter.h | 25 typedef void (*transmit_finished_cb)(BT_HDR *packet, bool all_fragments_sent); 26 typedef void (*packet_reassembled_cb)(BT_HDR *packet); 27 typedef void (*packet_fragmented_cb)(BT_HDR *packet, bool send_transmit_finished); 49 void (*fragment_and_dispatch)(BT_HDR *packet); 53 void (*reassemble_and_dispatch)(BT_HDR *packet);
|
/system/bt/stack/l2cap/ |
D | l2cap_client.c | 52 static void read_ready_cb(uint16_t local_channel_id, BT_HDR *packet); 55 static void fragment_packet(l2cap_client_t *client, buffer_t *packet); 175 bool l2cap_client_write(l2cap_client_t *client, buffer_t *packet) { in l2cap_client_write() argument 177 assert(packet != NULL); in l2cap_client_write() 183 fragment_packet(client, packet); in l2cap_client_write() 344 static void read_ready_cb(uint16_t local_channel_id, BT_HDR *packet) { in read_ready_cb() argument 354 buffer_t *buffer = buffer_new(packet->len); in read_ready_cb() 355 memcpy(buffer_ptr(buffer), packet->data + packet->offset, packet->len); in read_ready_cb() 356 osi_free(packet); in read_ready_cb() 368 static void fragment_packet(l2cap_client_t *client, buffer_t *packet) { in fragment_packet() argument [all …]
|
/system/core/fastboot/ |
D | fastboot_protocol.txt | 15 * Max packet size must be 64 bytes for full-speed, 512 bytes for 30 packet no greater than 64 bytes. 32 2. Client response with a single packet no greater than 64 bytes. 48 A DATA response packet will be 12 bytes long, in the form of 58 4. Client responds with a single packet no greater than 64 bytes. 205 fastboot packet. The 8-byte length is intended to provide future-proofing even 231 2. Maximum UDP packet size is negotiated during initialization. 232 3. The host drives all communication; the device may only send a packet as a 233 response to a host packet. 252 C=1 indicates a continuation packet; the data is too large and will [all …]
|
/system/core/liblog/tests/ |
D | liblog_benchmark.cpp | 203 struct packet { in BM_pmsg_short_aligned() struct 208 char buf[sizeof(struct packet) + 8] __aligned(8); in BM_pmsg_short_aligned() 210 struct packet *buffer = (struct packet*)(((uintptr_t)buf + 7) & ~7); in BM_pmsg_short_aligned() 279 struct packet { in BM_pmsg_short_unaligned1() struct 284 char buf[sizeof(struct packet) + 8] __aligned(8); in BM_pmsg_short_unaligned1() 286 struct packet *buffer = (struct packet*)((((uintptr_t)buf + 7) & ~7) + 1); in BM_pmsg_short_unaligned1() 355 struct packet { in BM_pmsg_long_aligned() struct 360 char buf[sizeof(struct packet) + 8 + LOGGER_ENTRY_MAX_PAYLOAD] __aligned(8); in BM_pmsg_long_aligned() 362 struct packet *buffer = (struct packet*)(((uintptr_t)buf + 7) & ~7); in BM_pmsg_long_aligned() 428 struct packet { in BM_pmsg_long_unaligned1() struct [all …]
|