Home
last modified time | relevance | path

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

1234567891011

/system/memory/lmkd/include/
Dlmkd.h70 static inline void lmkd_pack_get_target(LMKD_CTRL_PACKET packet, int target_idx, in lmkd_pack_get_target() argument
72 target->minfree = ntohl(packet[target_idx * 2 + 1]); in lmkd_pack_get_target()
73 target->oom_adj_score = ntohl(packet[target_idx * 2 + 2]); in lmkd_pack_get_target()
80 static inline size_t lmkd_pack_set_target(LMKD_CTRL_PACKET packet, struct lmk_target* targets, in lmkd_pack_set_target() argument
83 packet[idx++] = htonl(LMK_TARGET); in lmkd_pack_set_target()
85 packet[idx++] = htonl(targets->minfree); in lmkd_pack_set_target()
86 packet[idx++] = htonl(targets->oom_adj_score); in lmkd_pack_set_target()
113 static inline void lmkd_pack_get_procprio(LMKD_CTRL_PACKET packet, int field_count, in lmkd_pack_get_procprio() argument
115 params->pid = (pid_t)ntohl(packet[1]); in lmkd_pack_get_procprio()
116 params->uid = (uid_t)ntohl(packet[2]); in lmkd_pack_get_procprio()
[all …]
/system/bt/gd/packet/parser/test/
Dbig_endian_test_packets.pdl3 custom_field SixBytes : 48 "packet/parser/test/"
4 custom_field Variable "packet/parser/test/"
6 packet ParentBe {
13 packet ChildBe : ParentBe {
26 packet ParentTwoBe {
32 packet ChildTwoThreeBe : ParentTwoBe (four_bits = THREE) {
38 packet ChildTwoTwoBe : ParentTwoBe (four_bits = TWO) {
43 packet ChildTwoTwoThreeBe :ChildTwoTwoBe (more_bits = THREE) {
53 packet MiddleFourBitsBe {
61 packet ParentWithSixBytesBe {
[all …]
Dtest_packets.pdl3 custom_field SixBytes : 48 "packet/parser/test/"
4 custom_field Variable "packet/parser/test/"
6 packet Parent {
13 packet Child : Parent {
26 packet ParentTwo {
32 packet ChildTwoThree : ParentTwo (four_bits = THREE) {
38 packet ChildTwoTwo : ParentTwo (four_bits = TWO) {
43 packet ChildTwoTwoThree :ChildTwoTwo (more_bits = THREE) {
53 packet MiddleFourBits {
61 packet ParentWithSixBytes {
[all …]
/system/bt/hci/src/
Dpacket_fragmenter.cc62 static void fragment_and_dispatch(BT_HDR* packet) { in fragment_and_dispatch() argument
63 CHECK(packet != NULL); in fragment_and_dispatch()
65 uint16_t event = packet->event & MSG_EVT_MASK; in fragment_and_dispatch()
66 uint8_t* stream = packet->data + packet->offset; in fragment_and_dispatch()
70 callbacks->fragmented(packet, true); in fragment_and_dispatch()
75 SUB_EVENT(packet->event) == LOCAL_BR_EDR_CONTROLLER_ID in fragment_and_dispatch()
80 uint16_t remaining_length = packet->len; in fragment_and_dispatch()
88 stream = packet->data + packet->offset; in fragment_and_dispatch()
92 packet->len = max_packet_size; in fragment_and_dispatch()
93 callbacks->fragmented(packet, false); in fragment_and_dispatch()
[all …]
Dhci_layer_android.cc53 extern void hci_event_received(const base::Location& from_here, BT_HDR* packet);
54 extern void acl_event_received(BT_HDR* packet);
55 extern void sco_data_received(BT_HDR* packet);
56 extern void iso_data_received(BT_HDR* packet);
80 BT_HDR* packet = in WrapPacketAndCopy() local
82 packet->offset = 0; in WrapPacketAndCopy()
83 packet->len = data.size(); in WrapPacketAndCopy()
84 packet->layer_specific = 0; in WrapPacketAndCopy()
85 packet->event = event; in WrapPacketAndCopy()
88 memcpy(packet->data, data.data(), data.size()); in WrapPacketAndCopy()
[all …]
Dbtsnoop_mem.cc27 void btsnoop_mem_capture(const BT_HDR* packet, uint64_t timestamp_us) { in btsnoop_mem_capture() argument
30 CHECK(packet); in btsnoop_mem_capture()
32 const uint8_t* data = &packet->data[packet->offset]; in btsnoop_mem_capture()
33 const uint16_t type = packet->event & BT_EVT_MASK; in btsnoop_mem_capture()
38 if (packet->len > 2) length = data[2] + 3; in btsnoop_mem_capture()
42 if (packet->len > 1) length = data[1] + 2; in btsnoop_mem_capture()
47 if (packet->len > 3) length = (data[2] | (data[3] << 8)) + 4; in btsnoop_mem_capture()
52 if (packet->len > 2) length = data[2] + 3; in btsnoop_mem_capture()
/system/bt/packet/tests/base/
Diterator_test.cc51 auto packet = in TEST_F() local
53 ASSERT_DEATH(Iterator(packet, 0), "index_ >= packet->packet_start_index_"); in TEST_F()
54 ASSERT_DEATH(Iterator(packet, test_l2cap_data.size()), in TEST_F()
59 auto packet = TestPacket::Make(test_l2cap_data); in TEST_F() local
60 Iterator general_case = packet->begin(); in TEST_F()
69 auto packet = TestPacket::Make(test_l2cap_data); in TEST_F() local
70 Iterator general_case = packet->begin(); in TEST_F()
79 auto packet = GetTestPacket(); in TEST_P() local
80 ASSERT_EQ(static_cast<size_t>(packet->end() - packet->begin()), in TEST_P()
83 auto it = packet->begin(); in TEST_P()
[all …]
Dpacket_test.cc29 auto packet = TestPacket::Make( in TEST() local
33 auto new_packet = TestPacket::Make(packet); in TEST()
44 auto packet = TestPacket::Make(test_avctp_data); in TEST() local
45 ASSERT_EQ(packet->size(), test_avctp_data.size()); in TEST()
47 packet = TestPacket::Make(test_avctp_data, test_avctp_data_payload_offset, in TEST()
49 ASSERT_EQ(packet->size(), test_avrcp_data.size()); in TEST()
54 auto packet = TestPacket::Make(test_l2cap_data); in TEST() local
56 ASSERT_EQ(test_l2cap_data[i], (*packet)[i]); in TEST()
59 packet = TestPacket::Make(test_avctp_data, test_avctp_data_payload_offset, in TEST()
62 ASSERT_EQ(test_avrcp_data[i], (*packet)[i]); in TEST()
[all …]
Dpacket_builder_test.cc30 auto packet = TestPacket::Make(); in TEST() local
32 builder->Serialize(packet); in TEST()
35 ASSERT_EQ(test_l2cap_data[i], (*packet)[i]); in TEST()
46 auto packet = TestPacket::Make(); in TEST() local
47 ASSERT_EQ(packet->GetData().capacity(), 0u); in TEST()
50 builder->ReserveSpace(packet, test_l2cap_data.size()); in TEST()
52 ASSERT_GE(packet->GetData().capacity(), test_l2cap_data.size()); in TEST()
57 auto packet = TestPacket::Make(); in TEST() local
59 builder->AddPayloadOctets1(packet, 0x01u); in TEST()
60 builder->AddPayloadOctets2(packet, 0x0302u); in TEST()
[all …]
/system/core/debuggerd/tombstoned/
Dtombstoned_client.cpp47 TombstonedCrashPacket packet = {}; in tombstoned_connect() local
48 packet.packet_type = CrashPacketType::kDumpRequest; in tombstoned_connect()
49 packet.packet.dump_request.pid = pid; in tombstoned_connect()
50 packet.packet.dump_request.dump_type = dump_type; in tombstoned_connect()
51 if (TEMP_FAILURE_RETRY(write(sockfd, &packet, sizeof(packet))) != sizeof(packet)) { in tombstoned_connect()
58 ssize_t rc = ReceiveFileDescriptors(sockfd, &packet, sizeof(packet), &tmp_output_fd); in tombstoned_connect()
63 } else if (rc != sizeof(packet)) { in tombstoned_connect()
67 sizeof(packet), rc); in tombstoned_connect()
86 TombstonedCrashPacket packet = {}; in tombstoned_notify_completion() local
87 packet.packet_type = CrashPacketType::kCompletedDump; in tombstoned_notify_completion()
[all …]
/system/bt/gd/hci/
Dhci_packets.pdl51 packet AclPacket {
68 packet ScoPacket {
546 packet CommandPacket {
554 packet DiscoveryCommand : CommandPacket { _payload_, }
555 packet ConnectionManagementCommand : CommandPacket { _payload_, }
556 packet SecurityCommand : CommandPacket { _payload_, }
557 packet ScoConnectionCommand : CommandPacket { _payload_, }
558 packet LeAdvertisingCommand : CommandPacket { _payload_, }
559 packet LeScanningCommand : CommandPacket { _payload_, }
560 packet LeConnectionManagementCommand : CommandPacket { _payload_, }
[all …]
/system/connectivity/wificond/net/
Dmlme_event.cpp35 bool GetCommonFields(const NL80211Packet* packet, in GetCommonFields() argument
38 if (!packet->GetAttributeValue(NL80211_ATTR_IFINDEX, if_index)) { in GetCommonFields()
43 if (!packet->GetAttributeValue(NL80211_ATTR_MAC, bssid)) { in GetCommonFields()
52 const NL80211Packet* packet) { in InitFromPacket() argument
53 if (packet->GetCommand() != NL80211_CMD_ASSOCIATE) { in InitFromPacket()
58 if (!GetCommonFields(packet, in InitFromPacket()
68 associate_event->is_timeout_ = packet->HasAttribute(NL80211_ATTR_TIMED_OUT); in InitFromPacket()
74 const NL80211Packet* packet) { in InitFromPacket() argument
75 if (packet->GetCommand() != NL80211_CMD_CONNECT) { in InitFromPacket()
79 if (!GetCommonFields(packet, in InitFromPacket()
[all …]
Dnetlink_manager.cpp54 unique_ptr<const NL80211Packet> packet) { in AppendPacket() argument
55 vec->push_back(std::move(packet)); in AppendPacket()
114 unique_ptr<NL80211Packet> packet( in ReceivePacketAndRunHandler() local
117 if (!packet->IsValid()) { in ReceivePacketAndRunHandler()
124 uint32_t sequence_number = packet->GetMessageSequence(); in ReceivePacketAndRunHandler()
128 BroadcastHandler(std::move(packet)); in ReceivePacketAndRunHandler()
141 uint32_t message_type = packet->GetMessageType(); in ReceivePacketAndRunHandler()
160 bool is_multi = packet->IsMulti(); in ReceivePacketAndRunHandler()
162 itr->second(std::move(packet)); in ReceivePacketAndRunHandler()
170 void NetlinkManager::OnNewFamily(unique_ptr<const NL80211Packet> packet) { in OnNewFamily() argument
[all …]
/system/bt/tools/hci/
Dmain.c33 static bool write_hci_command(hci_packet_t type, const void* packet,
81 uint8_t packet[] = {0x1A, 0x0C, 0x01, 0x00}; in set_discoverable() local
82 if (argv[0][0] == 't') packet[ARRAY_SIZE(packet) - 1] = 0x03; in set_discoverable()
84 return !write_hci_command(HCI_PACKET_COMMAND, packet, ARRAY_SIZE(packet)); in set_discoverable()
99 uint8_t packet[251] = {0x13, 0x0C, 248}; in set_name() local
100 memcpy(&packet[3], argv[0], len + 1); in set_name()
102 if (!write_hci_command(HCI_PACKET_COMMAND, packet, sizeof(packet))) return 1; in set_name()
104 memset(&packet[0], 0, sizeof(packet)); in set_name()
105 packet[0] = 0x52; in set_name()
106 packet[1] = 0x0C; in set_name()
[all …]
/system/bt/vendor_libs/test_vendor_lib/packets/
Dlink_layer_packets.pdl43 packet LinkLayerPacket {
50 packet Command : LinkLayerPacket (type = COMMAND) {
54 packet Response : LinkLayerPacket (type = RESPONSE) {
59 packet AclPacket : LinkLayerPacket (type = ACL) {
63 packet Disconnect : LinkLayerPacket (type = DISCONNECT) {
67 packet EncryptConnection : LinkLayerPacket (type = ENCRYPT_CONNECTION) {
71 packet EncryptConnectionResponse : LinkLayerPacket (type = ENCRYPT_CONNECTION_RESPONSE) {
86 packet Inquiry : LinkLayerPacket (type = INQUIRY) {
90 packet BasicInquiryResponse : LinkLayerPacket(type = INQUIRY_RESPONSE) {
99 packet InquiryResponse : BasicInquiryResponse (inquiry_type = STANDARD) {
[all …]
/system/bt/hci/test/
Dhci_layer_test.cc43 void hci_transmit(BT_HDR* packet) { LOG(INFO) << __func__ << " UNIMPLEMENTED"; } in hci_transmit() argument
46 void hci_log_firmware_debug_packet(int fd, BT_HDR* packet) {} in hci_log_firmware_debug_packet() argument
73 uint8_t* GetPayloadPointer(BT_HDR* packet) const { in GetPayloadPointer()
74 return static_cast<uint8_t*>(packet->data); in GetPayloadPointer()
79 BT_HDR* packet = in AllocatePacket() local
81 packet->offset = 0; in AllocatePacket()
82 packet->len = packet_length; in AllocatePacket()
83 packet->layer_specific = 0; in AllocatePacket()
84 packet->event = MSG_HC_TO_STACK_HCI_EVT; in AllocatePacket()
85 return packet; in AllocatePacket()
[all …]
Dpacket_fragmenter_test.cc70 BT_HDR* packet = (BT_HDR*)osi_malloc(size + sizeof(BT_HDR)); in manufacture_packet_for_fragmentation() local
71 packet->len = size; in manufacture_packet_for_fragmentation()
72 packet->offset = 0; in manufacture_packet_for_fragmentation()
73 packet->event = event; in manufacture_packet_for_fragmentation()
74 packet->layer_specific = 0; in manufacture_packet_for_fragmentation()
75 uint8_t* packet_data = packet->data; in manufacture_packet_for_fragmentation()
83 return packet; in manufacture_packet_for_fragmentation()
87 BT_HDR* packet, const char* expected_data, in expect_packet_fragmented() argument
89 uint8_t* data = packet->data + packet->offset; in expect_packet_fragmented()
105 int packet_data_length = packet->len - HCI_ACL_PREAMBLE_SIZE; in expect_packet_fragmented()
[all …]
/system/bt/gd/security/pairing/
Dclassic_pairing_handler.cc134 void ClassicPairingHandler::OnReceive(hci::ChangeConnectionLinkKeyCompleteView packet) { in OnReceive() argument
135 ASSERT(packet.IsValid()); in OnReceive()
136 LOG_INFO("Received unsupported event: %s", hci::EventCodeText(packet.GetEventCode()).c_str()); in OnReceive()
139 void ClassicPairingHandler::OnReceive(hci::MasterLinkKeyCompleteView packet) { in OnReceive() argument
140 ASSERT(packet.IsValid()); in OnReceive()
141 LOG_INFO("Received unsupported event: %s", hci::EventCodeText(packet.GetEventCode()).c_str()); in OnReceive()
144 void ClassicPairingHandler::OnReceive(hci::PinCodeRequestView packet) { in OnReceive() argument
145 ASSERT(packet.IsValid()); in OnReceive()
146 LOG_INFO("Received: %s", hci::EventCodeText(packet.GetEventCode()).c_str()); in OnReceive()
147 …ASSERT_LOG(GetRecord()->GetPseudoAddress().GetAddress() == packet.GetBdAddr(), "Address mismatch"); in OnReceive()
[all …]
Dpairing_handler.h49 virtual void OnReceive(hci::ChangeConnectionLinkKeyCompleteView packet) = 0;
50 virtual void OnReceive(hci::MasterLinkKeyCompleteView packet) = 0;
51 virtual void OnReceive(hci::PinCodeRequestView packet) = 0;
52 virtual void OnReceive(hci::LinkKeyRequestView packet) = 0;
53 virtual void OnReceive(hci::LinkKeyNotificationView packet) = 0;
54 virtual void OnReceive(hci::IoCapabilityRequestView packet) = 0;
55 virtual void OnReceive(hci::IoCapabilityResponseView packet) = 0;
56 virtual void OnReceive(hci::SimplePairingCompleteView packet) = 0;
57 virtual void OnReceive(hci::ReturnLinkKeysView packet) = 0;
58 virtual void OnReceive(hci::EncryptionChangeView packet) = 0;
[all …]
/system/bt/gd/l2cap/
Dl2cap_packets.pdl5 packet BasicFrame {
11 packet BasicFrameWithFcs {
25 packet GroupFrame : BasicFrame (channel_id = 0x02) {
54 packet StandardFrame : BasicFrame {
59 packet StandardFrameWithFcs : BasicFrameWithFcs {
80 packet StandardSupervisoryFrame : StandardFrame (frame_type = S_FRAME) {
84 packet StandardSupervisoryFrameWithFcs : StandardFrameWithFcs (frame_type = S_FRAME) {
88 packet StandardInformationFrame : StandardFrame (frame_type = I_FRAME) {
93 packet StandardInformationFrameWithFcs : StandardFrameWithFcs (frame_type = I_FRAME) {
98 packet StandardInformationStartFrame : StandardInformationFrame (sar = START) {
[all …]
/system/core/libnetutils/
Dpacket.c161 } packet; in receive_packet() local
167 nread = read(s, &packet, sizeof(packet)); in receive_packet()
181 } else if (packet.ip.version != IPVERSION || packet.ip.ihl != (sizeof(packet.ip) >> 2)) { in receive_packet()
185 } else if (nread < ntohs(packet.ip.tot_len)) { in receive_packet()
187 ALOGD("Packet was truncated (read %d, needed %d)", nread, ntohs(packet.ip.tot_len)); in receive_packet()
189 } else if (packet.ip.protocol != IPPROTO_UDP) { in receive_packet()
191 ALOGD("IP protocol (%d) is not UDP", packet.ip.protocol); in receive_packet()
193 } else if (packet.udp.dest != htons(PORT_BOOTP_CLIENT)) { in receive_packet()
195 ALOGD("UDP dest port (%d) is not DHCP client", ntohs(packet.udp.dest)); in receive_packet()
207 sum = finish_sum(checksum(&packet.ip, sizeof(packet.ip), 0)); in receive_packet()
[all …]
/system/bt/vendor_libs/test_vendor_lib/model/devices/
Dlink_layer_socket_device.cc41 bluetooth::packet::PacketView<bluetooth::packet::kLittleEndian> size( in TimerTick()
42 {bluetooth::packet::View(packet_size, 0, kSizeBytes)}); in TimerTick()
54 bluetooth::packet::PacketView<bluetooth::packet::kLittleEndian> packet_view( in TimerTick()
56 auto packet = model::packets::LinkLayerPacketView::Create(packet_view); in TimerTick() local
57 ASSERT(packet.IsValid()); in TimerTick()
58 SendLinkLayerPacket(packet, phy_type_); in TimerTick()
65 model::packets::LinkLayerPacketView packet) { in IncomingPacket() argument
66 auto size_packet = bluetooth::packet::RawBuilder(); in IncomingPacket()
67 size_packet.AddOctets4(packet.size()); in IncomingPacket()
69 bluetooth::packet::BitInserter bit_inserter(size_bytes); in IncomingPacket()
[all …]
/system/core/adb/
Dtransport_benchmark.cpp67 … server->SetReadCallback([&received_bytes](Connection*, std::unique_ptr<apacket> packet) -> bool { in BM_Connection_Unidirectional() argument
68 received_bytes += packet->payload.size(); in BM_Connection_Unidirectional()
82 std::unique_ptr<apacket> packet = std::make_unique<apacket>(); in BM_Connection_Unidirectional() local
83 memset(&packet->msg, 0, sizeof(packet->msg)); in BM_Connection_Unidirectional()
84 packet->msg.command = A_WRTE; in BM_Connection_Unidirectional()
85 packet->msg.data_length = data_size; in BM_Connection_Unidirectional()
86 packet->payload.resize(data_size); in BM_Connection_Unidirectional()
88 memset(&packet->payload[0], 0xff, data_size); in BM_Connection_Unidirectional()
91 client->Write(std::move(packet)); in BM_Connection_Unidirectional()
124 … client->SetReadCallback([&received_bytes](Connection*, std::unique_ptr<apacket> packet) -> bool { in BM_Connection_Echo() argument
[all …]
/system/bt/gd/l2cap/internal/
Denhanced_retransmission_mode_channel_data_controller.h43 using UpperEnqueue = packet::PacketView<packet::kLittleEndian>;
44 using UpperDequeue = packet::BasePacketBuilder;
50 void OnSdu(std::unique_ptr<packet::BasePacketBuilder> sdu) override;
51 void OnPdu(packet::PacketView<true> pdu) override;
52 std::unique_ptr<packet::BasePacketBuilder> GetNextPacket() override;
62 std::queue<std::unique_ptr<packet::BasePacketBuilder>> pdu_queue_;
78 class PacketViewForReassembly : public packet::PacketView<kLittleEndian> {
81 void AppendPacketView(packet::PacketView<kLittleEndian> to_append) { in AppendPacketView()
86 class CopyablePacketBuilder : public packet::BasePacketBuilder {
88 …CopyablePacketBuilder(std::shared_ptr<packet::RawBuilder> builder) : builder_(std::move(builder)) … in CopyablePacketBuilder()
[all …]
/system/bt/vendor_libs/test_vendor_lib/test/
Diterator_test.cc52 packet = TestPacket::make_new_packet(complete_l2cap_packet); in SetUp()
56 packet.reset(); in TearDown()
59 std::shared_ptr<TestPacket> packet; member in test_vendor_lib::IteratorTest
63 Iterator general_case = packet->get_begin(); in TEST_F()
72 Iterator bounds_test = packet->get_end(); in TEST_F()
81 Iterator dereference_test = packet->get_end(); in TEST_F()
87 Iterator plus_eq = packet->get_begin(); in TEST_F()
96 Iterator plus_plus = packet->get_begin(); in TEST_F()
105 Iterator plus_plus = packet->get_begin(); in TEST_F()
114 Iterator plus = packet->get_begin(); in TEST_F()
[all …]

1234567891011