中文译文
用 C 语言和 libpcap 创建一个命令行网络数据包分析器。实现从网络接口进行数据包捕获,并支持过滤选项。为常见协议(TCP、UDP、HTTP、DNS 等)添加协议分析。包含流量统计,包括带宽使用量和连接数。实现数据包解码,提供详细的头部信息。添加 PCAP 和 CSV 格式的导出功能。包含针对可疑流量模式的告警系统。实现带状态信息的连接跟踪。添加 IP 地址的地理位置查询。为所有选项提供命令行参数,并设置合理的默认值。实现颜色编码输出,以提高可读性。
English original
Create a command-line network packet analyzer in C using libpcap. Implement packet capture from network interfaces with filtering options. Add protocol analysis for common protocols (TCP, UDP, HTTP, DNS, etc.). Include traffic statistics with bandwidth usage and connection counts. Implement packet decoding with detailed header information. Add export functionality in PCAP and CSV formats. Include alert system for suspicious traffic patterns. Implement connection tracking with state information. Add geolocation lookup for IP addresses. Include command-line arguments for all options with sensible defaults. Implement color-coded output for better readability.