From 6556fbf649ad1edcd93f30632e8665bf5dcabcbe Mon Sep 17 00:00:00 2001 From: Marcel Peterkau Date: Thu, 11 Sep 2025 10:07:18 +0200 Subject: [PATCH] got that thing Fly --- requirements.txt | 4 ++-- src/{types => custom_types}/__init__.py | 0 src/utils.py | 13 ++++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) rename src/{types => custom_types}/__init__.py (100%) diff --git a/requirements.txt b/requirements.txt index e976618..b92ec1d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -tkinter -scapy \ No newline at end of file +scapy +psutil \ No newline at end of file diff --git a/src/types/__init__.py b/src/custom_types/__init__.py similarity index 100% rename from src/types/__init__.py rename to src/custom_types/__init__.py diff --git a/src/utils.py b/src/utils.py index 86363ea..91e7192 100644 --- a/src/utils.py +++ b/src/utils.py @@ -26,4 +26,15 @@ def validate_subnet_mask(mask): '192.0.0.0', '128.0.0.0', '0.0.0.0' ] if mask not in valid_masks: - raise ValueError("Invalid subnet mask") \ No newline at end of file + raise ValueError("Invalid subnet mask") + +import socket +import psutil + +def get_network_interfaces(): + interfaces = [] + for iface, addrs in psutil.net_if_addrs().items(): + for addr in addrs: + if addr.family == socket.AF_INET: + interfaces.append(iface) + return interfaces \ No newline at end of file