Lines Matching refs:packet

11     """ Class to manage the packet capture file access from a chaos test. """
18 Gets the packets from a trace file as Pyshark packet objects for
24 of packet or not.
26 @returns List of pyshark packet objects.
39 Gets the packet that appears index |index| in the capture file.
43 of the packet or not.
45 @returns pyshark packet object or None.
57 def get_packet_after(self, packet):
59 Gets the packet that appears next in the capture file.
61 @param packet: Reference packet -- the packet after this one will
64 @returns pyshark packet object or None.
67 return self.get_packet_number(int(packet.number) + 1, summary=False)
130 packet objects for further analysis.
133 of packet or not.
137 @returns List of pyshark packet objects.
420 def _fetch_packet_field_value(self, packet, field):
421 layer_object = packet
429 def _match_packet_fields(self, packet, fields):
431 value = self._fetch_packet_field_value(packet, field)
436 def _fetch_packet_data_rate(self, packet):
437 return self._fetch_packet_field_value(packet,
440 def _does_packet_match_state(self, state, packet):
442 if self._match_packet_fields(packet, fields):
445 if packet.wlan.ra == self._dut_mac:
449 if packet.wlan.ta == self._dut_mac:
454 if ((packet.wlan.ra == self._dut_mac) and
455 (packet.wlan.ta in self._ap_macs)):
460 if ((packet.wlan.ta == self._dut_mac) and
461 (packet.wlan.ra in self._ap_macs)):
465 def _does_packet_match_error_state(self, state, packet):
467 return self._match_packet_fields(packet, fields)
469 def _get_packet_detail(self, details, packet):
471 attributes.append("Packet number: %s" % packet.number)
473 value = self._fetch_packet_field_value(packet, detail.field_name)
477 def _does_packet_match_ack_state(self, packet):
479 return self._match_packet_fields(packet, fields)
481 def _does_packet_contain_retry_flag(self, packet):
484 return self._match_packet_fields(packet, fields)
486 def _check_for_ack(self, state, packet):
487 if (packet.wlan.da == self.WLAN_BROADCAST_ADDRESS and
488 packet.wlan.fc_type == self.WLAN_FRAME_CONTROL_TYPE_MANAGEMENT):
491 next_packet = self._capture.get_packet_after(packet)
494 (next_packet.wlan.addr == packet.wlan.ta)):
502 def _check_for_error(self, packet):
504 if self._does_packet_match_error_state(error_state, packet):
506 packet)
514 def _check_for_warning(self, packet):
516 if self._does_packet_match_error_state(warning, packet):
518 packet)
525 def _check_for_repeated_state(self, packet):
527 if self._does_packet_match_state(state, packet):
530 str(packet.number)
531 if self._does_packet_contain_retry_flag(packet):
537 def _is_from_previous_state(self, packet):
539 if self._does_packet_match_state(state, packet):
543 def _step(self, reached_state, packet):
556 if packet:
557 msg += ", Packet number: " + str(packet.number) + \
558 ", Data rate: " + str(self._fetch_packet_data_rate(packet))+\
564 if packet:
578 for packet in packet_iterator:
579 self._check_for_repeated_state(packet)
581 # packet capture misses.
584 if self._does_packet_match_state(next_state, packet):
585 self._step(next_state, packet)
586 self._check_for_ack(next_state, packet)
592 if self._check_for_error(packet):
594 if not self._is_from_previous_state(packet):
595 self._check_for_warning(packet)
603 """ Class to analyze the packet capture from a chaos test . """
637 "DUT packet count Tx: %d, Rx: %d." % (tx_count, rx_count))
642 for packet in packets:
643 packet_number = int(packet.no)
645 # ACK packet does not appear in the filtered capture.
648 # ACK packet also appears in the capture.
650 yield packet
679 for packet in self._ack_interleave(
681 self._log.log_to_output_file("%s" % (packet))