Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
事实证明,使用 libpcap 非常简单,但是对于巨大的(在任意意义上).pcap 转储,速度始终是一个问题。
仅对转储进行采样是否有任何常见做法?也许可以有效地将“每五帧读取一次”作为 pcap 过滤器,或者我应该只是在 pcap_handler 中什么都不做?
如果您只想转储一小部分数据包,您这样做的方式实际上是让回调忽略一些数据包并写出其他数据包。Pcap 过滤器是无状态的,因此不能支持“仅匹配每五帧”或诸如此类的任何东西。