如何在Mac上从Java读写原始IP数据包? [英] How do I read and write raw ip packets from java on a mac?

查看:58
本文介绍了如何在Mac上从Java读写原始IP数据包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

能够发送和接收原始网络数据包的最简单方法是什么.我是否必须编写自己的某些c API的JNI包装,在那种情况下,我要寻找什么API?

What would be the easiest way to be able to send and receive raw network packets. Do I have to write my own JNI wrapping of some c API, and in that case what API am I looking for?

我希望能够做Wireshark所做的事情,即在接口上记录所有传入的数据包,并且还能够发回我自己创建的数据包.我想在Mac上做.

I want to be able to do what wireshark does, i.e. record all incomming packets on an interface, and in addition be able to send back my own created packets. And I want to do it on a mac.

推荐答案

如果首先想到的是您需要像包嗅探器那样的东西,那么您将需要查看 http://netresearch.ics.uci.edu/kfujii/jpcap/doc/.

If you start with the idea that you need something like a packet sniffer, you'll want to look at http://netresearch.ics.uci.edu/kfujii/jpcap/doc/.

这篇关于如何在Mac上从Java读写原始IP数据包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆