Пример #1
0
 def _on_configuration_request_default(self, l2cap_control_view):
     request = l2cap_packets.ConfigurationRequestView(l2cap_control_view)
     dcid = request.GetDestinationCid()
     if dcid not in self.scid_to_channel:
         logging.warning("Received config request with unknown dcid")
         return
     self._control_behaviors.on_config_req_behavior.run(request)
Пример #2
0
 def _is_matching_configuration_request_with_cid(packet, cid=None):
     frame = L2capMatchers.control_frame_with_code(packet, CommandCode.CONFIGURATION_REQUEST)
     if frame is None:
         return False
     request = l2cap_packets.ConfigurationRequestView(frame)
     dcid = request.GetDestinationCid()
     return cid is None or cid == dcid
Пример #3
0
 def _is_matching_configuration_request_with_ertm(packet):
     frame = L2capMatchers.control_frame_with_code(packet, CommandCode.CONFIGURATION_REQUEST)
     if frame is None:
         return False
     request = l2cap_packets.ConfigurationRequestView(frame)
     config_bytes = request.GetBytes()
     # TODO(b/153189503): Use packet struct parser.
     return b"\x04\x09\x03" in config_bytes
Пример #4
0
 def _extract_configuration_request(packet):
     frame = L2capMatchers.control_frame_with_code(
         packet, CommandCode.CONFIGURATION_REQUEST)
     return l2cap_packets.ConfigurationRequestView(frame)