在哪里可以找到 tcpdump() 文件的文件/结构布局?

发布于 2024-09-03 10:23:50 字数 138 浏览 14 评论 0原文

我们使用 tcpdump() 将数据包捕获到文件中。我需要编写一个程序来解析它,有谁知道在哪里可以找到此工具创建的转储文件的文件布局?

We are capturing packets to a file using tcpdump(). I need to write a program to parse it, does anyone know where I could find a file layout for a dump file created by this tool?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烟花肆意 2024-09-10 10:23:51

解析文件最简单的方法是使用 libpcap 读取它; libpcap 可以直接在 C 和 C++ 中使用,并且还有许多其他语言的包装器。这样您就不必知道文件布局是什么(如果您的程序使用 libpcap 1.1 或更高版本,您还可以至少读取一些 pcap-ng 文件)。

The easiest way to parse the file is to read it with libpcap; libpcap can be used directly from C and C++, and there are wrappers for a number of other languages. That way you don't have to know what the file layout is (and you will also be able to read at least some pcap-ng files if your program is using libpcap 1.1 or later).

笔芯 2024-09-10 10:23:50

tcpdump 使用 libpcap;有描述 libpcap 文件格式 的文档,它应该可以满足您的需求。

tcpdump uses libpcap; there are docs describing the libpcap file format which should give you what you need.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文