Exemple #1
0
 def buttonApplyClicked(self):
     widget = self.parent.GetCurrentTab()
     if widget != None and isinstance(widget, PacketData_ui):
         bpf = BPF()
         bpf.setFilterExpression(self.Ui.lineEditExpression.text())
         bpf.setOriginalPacketList(widget.originalList)
         bpf.filterPacketList()
         newList = bpf.getFilteredPacketList()
         widget.SetPacketList(newList)
Exemple #2
0
 def buttonApplyClicked(self):
     widget = self.parent.GetCurrentTab()
     if widget != None and isinstance(widget, PacketData_ui):
         bpf = BPF()
         bpf.setFilterExpression(self.Ui.lineEditExpression.text())
         bpf.setOriginalPacketList(widget.originalList)
         bpf.filterPacketList()
         newList = bpf.getFilteredPacketList()
         widget.SetPacketList(newList)
Exemple #3
0
    def test_EmptyFilter(self):
        x = BPF()
        x.setFilterExpression('')

        packet1 = IP(dst="10.4.12.91")/ICMP()/"HelloWorld"
        packet2 = IP(dst="10.4.12.91")/TCP(dport=23)
        packets = [packet1, packet2, packet1, packet2, packet1, packet2, packet1, packet2, packet1, packet2]

        x.setOriginalPacketList(packets)
        x.filterPacketList()
        y = x.getFilteredPacketList()

        for (packetA, packetB) in zip(packets, y):
            self.assertEqual(hexdump(packetA), hexdump(packetB) )
Exemple #4
0
    def test_EmptyFilter(self):
        x = BPF()
        x.setFilterExpression('')

        packet1 = IP(dst="10.4.12.91") / ICMP() / "HelloWorld"
        packet2 = IP(dst="10.4.12.91") / TCP(dport=23)
        packets = [
            packet1, packet2, packet1, packet2, packet1, packet2, packet1,
            packet2, packet1, packet2
        ]

        x.setOriginalPacketList(packets)
        x.filterPacketList()
        y = x.getFilteredPacketList()

        for (packetA, packetB) in zip(packets, y):
            self.assertEqual(hexdump(packetA), hexdump(packetB))