Go:如何从数据包中删除数据链路层?
我正在使用 gopacket 库,我从电线中读取数据包。目前,我阅读的所有数据包都包含四个层:链接,网络,传输和应用程序数据。
我需要从所有数据包中删除链接层,然后将其余的保存到文件中。尚未找到任何有关使数据包剥离部分正确的信息或文档。
有人知道该怎么做吗?
I am using the gopacket library, and I read packets from the wire. Right now, all packets I read contain four layers: Link, Network, Transport, and Application Data.
I need to remove the Link layer from all packets and save the rest to a file. Haven't found any information or docs about making the packet stripping part right.
Does anyone know how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了一种可能的方法 - 从必要的数据包层中加入字节:
I found one possible way - to concatenate bytes from necessary packet layers: