Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
|
53d13e77ae | ||
|
8a57c7d020 |
6 changed files with 10 additions and 2 deletions
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
Readme.md
Normal file → Executable file
0
Readme.md
Normal file → Executable file
0
gui.py
Normal file → Executable file
0
gui.py
Normal file → Executable file
0
license
Normal file → Executable file
0
license
Normal file → Executable file
8
qt.py
Normal file → Executable file
8
qt.py
Normal file → Executable file
|
@ -47,6 +47,9 @@ class IPReporter(QMainWindow):
|
||||||
|
|
||||||
self.listening = False
|
self.listening = False
|
||||||
|
|
||||||
|
# Set to keep track of unique IP addresses
|
||||||
|
self.unique_ips = set()
|
||||||
|
|
||||||
def extract_packet_info(self, packet):
|
def extract_packet_info(self, packet):
|
||||||
# Check if the packet is an IP packet with UDP layer
|
# Check if the packet is an IP packet with UDP layer
|
||||||
if IP in packet and UDP in packet:
|
if IP in packet and UDP in packet:
|
||||||
|
@ -61,6 +64,11 @@ class IPReporter(QMainWindow):
|
||||||
udp_destination_port == destination_port):
|
udp_destination_port == destination_port):
|
||||||
# Extract the MAC address from the Ethernet layer
|
# Extract the MAC address from the Ethernet layer
|
||||||
source_mac = packet[Ether].src
|
source_mac = packet[Ether].src
|
||||||
|
|
||||||
|
# Check if the IP address is already in the set
|
||||||
|
if source_ip not in self.unique_ips:
|
||||||
|
# Add the IP address to the set
|
||||||
|
self.unique_ips.add(source_ip)
|
||||||
# Display the information in the tree view
|
# Display the information in the tree view
|
||||||
self.tree.addTopLevelItem(QTreeWidgetItem([source_ip, source_mac]))
|
self.tree.addTopLevelItem(QTreeWidgetItem([source_ip, source_mac]))
|
||||||
|
|
||||||
|
|
0
reporter.py
Normal file → Executable file
0
reporter.py
Normal file → Executable file
Loading…
Reference in a new issue