original_docstring: Analyze a single packet read from a capture file
docstring: Analyze a single packet read from a capture file
docstring_tokens: Analyze a single packet read from a capture file
code: def analyze_read_packet(self, pkt):
          """Analyze a single packet read from a capture file"""
          if isinstance(pkt, Ether):
              # Base captured packets is Ethernet II
              self.analyze_ether_packet(pkt)
              return
          if isinstance(pkt, Dot3):  # IEEE 802.3 Ethernet
              if pkt.haslayer(STP):
                  # IEEE 802.1D Spanning Tree Protocol
                  self.hwaddrdb.add_bridge(pkt[STP].bridgemac)
                  return
              # logger.debug("Skipping IEEE 802.3 packet %r", pkt)
              return
          if isinstance(pkt, CookedLinux):  # Captured from any interface
              self.analyze_ether_packet(pkt, is_cookedlinux=True)
              return
          if isinstance(pkt, IP):  # IPv4 packet (for example on a VPN interface)
              self.analyze_ipv4_packet(pkt)
              return
          if isinstance(pkt, IPv6):  # IPv6 packet (for example on a VPN interface)
              self.analyze_ipv6_packet(pkt)
              return
          logger.warning("Unknown packet type %r", pkt)
code_tokens: def analyze_read_packet ( self , pkt ) : if isinstance ( pkt , Ether ) : self . analyze_ether_packet ( pkt ) return if isinstance ( pkt , Dot3 ) : if pkt . haslayer ( STP ) : self . hwaddrdb . add_bridge ( pkt [ STP ] . bridgemac ) return return if isinstance ( pkt , CookedLinux ) : self . analyze_ether_packet ( pkt , is_cookedlinux = True ) return if isinstance ( pkt , IP ) : self . analyze_ipv4_packet ( pkt ) return if isinstance ( pkt , IPv6 ) : self . analyze_ipv6_packet ( pkt ) return logger . warning ( "Unknown packet type %r" , pkt )
short_docstring: Analyze a single packet read from a capture file
short_docstring_tokens: Analyze a single packet read from a capture file
comment: """Analyze a single packet read from a capture file"""$SEP$# Base captured packets is Ethernet II$SEP$# IEEE 802.3 Ethernet$SEP$# IEEE 802.1D Spanning Tree Protocol$SEP$# logger.debug("Skipping IEEE 802.3 packet %r", pkt)$SEP$# Captured from any interface$SEP$# IPv4 packet (for example on a VPN interface)$SEP$# IPv6 packet (for example on a VPN interface)