在java中制作自定义ipv6数据包

发布于 2024-12-22 19:37:30 字数 520 浏览 1 评论 0原文

我正在 java 中开发移动 ipv6,并且想要制作自定义 ipv6 数据包。

如何编写类来制作 ipv6 数据包并自己放置有效负载?

以下是同类课程的例子:

CustomIPv6 ipv6 = new CustomIPv6();
ipv6.setSource("::1");
ipv6.setDestination("::1");
ipv6.setPayload(MyArrayOfByte); //The byte array which I made it myself. -> the mobile ipv6 extention
ipv6.setUpperLayerType(CustomIPv6.MobilityHeader);
ipv6.sendPacket();
byte[] recv = ipv6.ReceivPacket();
//Now is the time for process the received packet and send some kind of ack.

先谢谢各位朋友了。

I'm working on mobile ipv6 in java and want to make custom ipv6 packets.

how do I write class to make ipv6 packets and I put the payload myself?

Following is the example of the similar class:

CustomIPv6 ipv6 = new CustomIPv6();
ipv6.setSource("::1");
ipv6.setDestination("::1");
ipv6.setPayload(MyArrayOfByte); //The byte array which I made it myself. -> the mobile ipv6 extention
ipv6.setUpperLayerType(CustomIPv6.MobilityHeader);
ipv6.sendPacket();
byte[] recv = ipv6.ReceivPacket();
//Now is the time for process the received packet and send some kind of ack.

Thanks all friends in advance.

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

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

发布评论

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

评论(1

红焚 2024-12-29 19:37:30

您可以使用 http://jnetpcap.com/ 执行此操作,但需要安装 libpcap 或 winpcap。此功能对于网络黑客攻击非常有用,这可能就是它没有得到更好支持的原因。 ;)

You can do this with http://jnetpcap.com/ however it requires libpcap or winpcap be installed. This facility is useful for network hacking which could be why it is not better supported. ;)

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