Skip to content
English

Jumpstart Winpcap [top] ◆ | TOP |

Enter adapter NAME from above (or press Enter for default): >

def packet_callback(packet): """Process each captured packet.""" timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3] summary = packet.summary() log_line = f"[timestamp] summary\n" jumpstart winpcap

:param interface: adapter name (None = auto select) :param packet_count: stop after N packets :param timeout_sec: stop after N seconds :param filter_str: BPF filter (e.g., "tcp", "udp", "arp", "icmp") """ print(f"\n--- Starting capture ---") print(f"Filter: filter_str") print(f"Max packets: packet_count | Timeout: timeout_secs") print("Press Ctrl+C to stop early\n") Enter adapter NAME from above (or press Enter

def list_adapters(): """Show all network adapters available for capture.""" ifaces = get_windows_if_list() print("\n=== Available Network Adapters (WinPcap/Npcap) ===\n") for iface in ifaces: name = iface.get('name', 'Unknown') desc = iface.get('description', 'No description') ips = iface.get('ips', []) ip_str = ', '.join([ip['addr'] for ip in ips if ip.get('addr')]) if ips else 'No IP' print(f"Name: name") print(f"Description: desc") print(f"IPs: ip_str\n") return ifaces 'Unknown') desc = iface.get('description'

if not adapters: print("No WinPcap/Npcap adapters found. Install Npcap first.") sys.exit(1)