Lines Matching refs:packet
54 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
171 if (packet->GetMessageType() != GENL_ID_CTRL) { in OnNewFamily()
175 if (packet->GetCommand() != CTRL_CMD_NEWFAMILY) { in OnNewFamily()
180 if (!packet->GetAttributeValue(CTRL_ATTR_FAMILY_ID, &family_id)) { in OnNewFamily()
185 if (!packet->GetAttributeValue(CTRL_ATTR_FAMILY_NAME, &family_name)) { in OnNewFamily()
196 if (packet->GetAttribute(CTRL_ATTR_MCAST_GROUPS, &multicast_groups)) { in OnNewFamily()
264 const NL80211Packet& packet, in RegisterHandlerAndSendMessage() argument
266 if (packet.IsDump()) { in RegisterHandlerAndSendMessage()
270 if (!SendMessageInternal(packet, async_netlink_fd_.get())) { in RegisterHandlerAndSendMessage()
273 message_handlers_[packet.GetMessageSequence()] = handler; in RegisterHandlerAndSendMessage()
278 const NL80211Packet& packet, in SendMessageAndGetResponses() argument
280 if (!SendMessageInternal(packet, sync_netlink_fd_.get())) { in SendMessageAndGetResponses()
289 uint32_t sequence = packet.GetMessageSequence(); in SendMessageAndGetResponses()
327 const NL80211Packet& packet, in SendMessageAndGetSingleResponse() argument
330 if (!SendMessageAndGetSingleResponseOrError(packet, &response_or_error)) { in SendMessageAndGetSingleResponse()
345 const NL80211Packet& packet, in SendMessageAndGetSingleResponseOrError() argument
348 if (!SendMessageAndGetResponses(packet, &response_vec)) { in SendMessageAndGetSingleResponseOrError()
360 bool NetlinkManager::SendMessageAndGetAckOrError(const NL80211Packet& packet, in SendMessageAndGetAckOrError() argument
363 if (!SendMessageAndGetSingleResponseOrError(packet, &response)) { in SendMessageAndGetAckOrError()
376 bool NetlinkManager::SendMessageAndGetAck(const NL80211Packet& packet) { in SendMessageAndGetAck() argument
378 if (!SendMessageAndGetAckOrError(packet, &error_code)) { in SendMessageAndGetAck()
389 bool NetlinkManager::SendMessageInternal(const NL80211Packet& packet, int fd) { in SendMessageInternal() argument
390 const vector<uint8_t>& data = packet.GetConstData(); in SendMessageInternal()
487 void NetlinkManager::BroadcastHandler(unique_ptr<const NL80211Packet> packet) { in BroadcastHandler() argument
488 if (packet->GetMessageType() != GetFamilyId()) { in BroadcastHandler()
492 uint32_t command = packet->GetCommand(); in BroadcastHandler()
498 OnScanResultsReady(std::move(packet)); in BroadcastHandler()
504 OnSchedScanResultsReady(std::move(packet)); in BroadcastHandler()
521 OnMlmeEvent(std::move(packet)); in BroadcastHandler()
525 OnRegChangeEvent(std::move(packet)); in BroadcastHandler()
532 if (!packet->GetAttributeValue(NL80211_ATTR_IFINDEX, &if_index)) { in BroadcastHandler()
539 if (!packet->GetAttributeValue(NL80211_ATTR_MAC, &mac_address)) { in BroadcastHandler()
552 OnChannelSwitchEvent(std::move(packet)); in BroadcastHandler()
556 OnFrameTxStatusEvent(std::move(packet)); in BroadcastHandler()
561 void NetlinkManager::OnRegChangeEvent(unique_ptr<const NL80211Packet> packet) { in OnRegChangeEvent() argument
563 if (!packet->GetAttributeValue(NL80211_ATTR_REG_TYPE, ®_type)) { in OnRegChangeEvent()
571 if (!packet->GetAttributeValue(NL80211_ATTR_REG_ALPHA2, &country_code)) { in OnRegChangeEvent()
596 void NetlinkManager::OnMlmeEvent(unique_ptr<const NL80211Packet> packet) { in OnMlmeEvent() argument
599 if (!packet->GetAttributeValue(NL80211_ATTR_IFINDEX, &if_index)) { in OnMlmeEvent()
609 uint32_t command = packet->GetCommand(); in OnMlmeEvent()
611 auto event = MlmeConnectEvent::InitFromPacket(packet.get()); in OnMlmeEvent()
618 auto event = MlmeAssociateEvent::InitFromPacket(packet.get()); in OnMlmeEvent()
625 auto event = MlmeRoamEvent::InitFromPacket(packet.get()); in OnMlmeEvent()
632 auto event = MlmeDisconnectEvent::InitFromPacket(packet.get()); in OnMlmeEvent()
639 auto event = MlmeDisassociateEvent::InitFromPacket(packet.get()); in OnMlmeEvent()
648 void NetlinkManager::OnSchedScanResultsReady(unique_ptr<const NL80211Packet> packet) { in OnSchedScanResultsReady() argument
650 if (!packet->GetAttributeValue(NL80211_ATTR_IFINDEX, &if_index)) { in OnSchedScanResultsReady()
662 handler->second(if_index, packet->GetCommand() == NL80211_CMD_SCHED_SCAN_STOPPED); in OnSchedScanResultsReady()
665 void NetlinkManager::OnScanResultsReady(unique_ptr<const NL80211Packet> packet) { in OnScanResultsReady() argument
667 if (!packet->GetAttributeValue(NL80211_ATTR_IFINDEX, &if_index)) { in OnScanResultsReady()
672 if (packet->GetCommand() == NL80211_CMD_SCAN_ABORTED) { in OnScanResultsReady()
685 if (!packet->GetAttribute(NL80211_ATTR_SCAN_SSIDS, &ssids_attr)) { in OnScanResultsReady()
696 if (!packet->GetAttribute(NL80211_ATTR_SCAN_FREQUENCIES, &freqs_attr)) { in OnScanResultsReady()
709 void NetlinkManager::OnChannelSwitchEvent(unique_ptr<const NL80211Packet> packet) { in OnChannelSwitchEvent() argument
711 if (!packet->GetAttributeValue(NL80211_ATTR_IFINDEX, &if_index)) { in OnChannelSwitchEvent()
717 if (!packet->GetAttributeValue(NL80211_ATTR_WIPHY_FREQ, &frequency)) { in OnChannelSwitchEvent()
723 if (!packet->GetAttributeValue(NL80211_ATTR_CHANNEL_WIDTH, &bandwidth)) { in OnChannelSwitchEvent()
736 unique_ptr<const NL80211Packet> packet) { in OnFrameTxStatusEvent() argument
739 if (!packet->GetAttributeValue(NL80211_ATTR_IFINDEX, &if_index)) { in OnFrameTxStatusEvent()
746 if (!packet->GetAttributeValue(NL80211_ATTR_COOKIE, &cookie)) { in OnFrameTxStatusEvent()
752 bool was_acked = packet->HasAttribute(NL80211_ATTR_ACK); in OnFrameTxStatusEvent()