editcap -A 和 -B:我应该使用哪个时区?

editcap -A and -B: what time zone should I use?

我需要从大型 pcap 中提取特定时间范围内的数据包。而且我发现 editcap 的 -A 和 -B 选项非常适合这项任务,除了我的目标时间范围是纪元时间并且 -A/B 需要格式为 YYYY-MM-DD HH:MM:SS.[=10 的时间=]

我的问题是,当我将纪元时间转换为 YYYY-MM-DD HH:MM:SS 时,我应该使用哪个时区? (我不确定这是否相关,但我使用的大 pcap 是从不同时区捕获的较小 pcap 的合并)。

我尝试了 tshark,它允许基于纪元时间进行过滤 (frame.time_epoch>=X),但 tshark 似乎资源昂贵并且经常被我使用的 ubuntu 服务器杀死。

感谢任何帮助!

Use your system's time.

100% 正确。时间被解析,然后被提供给例程 (mtkime()),该例程将机器时区本地时间的 year/month/day/hour/minute/second 值转换为 POSIX 时间("Epoch time",其中"Epoch" 是 1970-01-01 00:00:00 UTC 的 UN*X/POSIX 纪元。

am I right that the capture timstamps are stored as epoch time in pcap internally

是的。

and thus once the system time I feed into editcap get converted into epoch time, editcap can extract the right packets no matter which time zone the packets are captured from?

是的。