libpcap 可以重组 TCP 段吗

发布于 2024-07-14 07:08:53 字数 213 浏览 10 评论 0原文

我需要嗅探应用程序中的 TCP 流量。

libpcap 可以重新组装 TCP 段还是我必须手动进行?

主页上写着“完整的文档以手册页格式随源包一起提供”。 在我 sudo apt-get install libpcap-dev 之后,我只找到了一个 man pcap。 是所有可用的文档还是我只是错过了一些东西?

谢谢

I need to sniff TCP traffic into my application.

Can libpcap reassemble TCP segments or I have to do it manually?

The home page says "Full documentation is provided with the source packages in man page format". After I sudo apt-get install libpcap-dev I only find one man pcap. Is it all the documentation available or I simply missed something?

Thanks

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

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

发布评论

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

评论(4

风吹雨成花 2024-07-21 07:08:53

pcap(3) 中未提及数据包或流重组。

如果我没记错的话,dsniff 工具使用 libnids 来重新组装 IP 数据包和 TCP 流。

Packet or stream reassembly is not mentioned in pcap(3).

If I remember correctly, the dsniff tools use libnids to reassemble IP packets and TCP streams.

邮友 2024-07-21 07:08:53

三年前,我使用 libpcap,我必须自己重新组装 TCP 流,这不是很困难,但充满了极端情况。

如果许可证(GPLv2)适合您的项目,您可以查看wireshark解析器和“跟随TCP流”选项。

Three years ago I used libpcap and I had to reassemble TCP streams myself, it's not very difficult but it's full of corner cases.

You may look at wireshark dissectors and «follow TCP stream» option if license (GPLv2) is ok for your project.

小矜持 2024-07-21 07:08:53

在我的(稍旧的)系统上:

root@tower:~/desktop/ccan/ccan/tap # dpkg -L libpcap0.7-dev
/.
/usr
/usr/lib
/usr/lib/libpcap.a
/usr/include
/usr/include/net
/usr/include/net/bpf.h
/usr/include/pcap.h
/usr/include/pcap-namedb.h
/usr/share
/usr/share/man
/usr/share/man/man3
/usr/share/man/man3/pcap.3.gz

嗯,看起来它们应该在那里:

root@tower:~/desktop/ccan/ccan/tap # man 3 pcap
Reformatting pcap(3), please wait...

你应该有 man/3 文档,我看了我的,格式很糟糕。 我通过 apt-get source 获取了库的源代码,看起来唯一捆绑的文档是手册页。

您可以尝试他们的邮件列表,如果您这样做,请务必在这里回答您的问题:)

On my (slightly older) system:

root@tower:~/desktop/ccan/ccan/tap # dpkg -L libpcap0.7-dev
/.
/usr
/usr/lib
/usr/lib/libpcap.a
/usr/include
/usr/include/net
/usr/include/net/bpf.h
/usr/include/pcap.h
/usr/include/pcap-namedb.h
/usr/share
/usr/share/man
/usr/share/man/man3
/usr/share/man/man3/pcap.3.gz

Hmm, seems like they should be there:

root@tower:~/desktop/ccan/ccan/tap # man 3 pcap
Reformatting pcap(3), please wait...

You should have man/3 docs, I looked at mine, the formatting is just wretched. I grabbed the source to the library via apt-get source, it looks like the only docs bundled either way are the man pages.

You might try their mailing list, if you do, be sure to answer your question here :)

↙温凉少女 2024-07-21 07:08:53

不,libpcap 不会进行 TCP 段重组 - libpcap 捕获数据包,但数据包数据的处理由应用程序或应用程序使用的库来完成。

至于手册页,旧版本的 libpcap 只有 pcap(3) 手册页,新版本除了 pcap(3PCAP) 之外,还有一堆针对特定例程的其他手册页。

No, libpcap will not do TCP segment reassembly - libpcap captures packets, but processing the packet data is left up to the application or a library used by the application.

As for the man pages, older versions of libpcap just have the pcap(3) man page, newer versions have, in addition to pcap(3PCAP), a bunch of other man pages for particular routines.

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