Is there a way to send ARP request via Java?

前端 未结 3 1458
轮回少年
轮回少年 2020-12-19 04:56

Is there a way to send ARP request within a Java application? I know that ARP is sitting a layer under TCP and UDP therefore by default Java couldn\'t send ARP request. I

相关标签:
3条回答
  • 2020-12-19 05:24

    A java app can always execute some external command, calling another tool to do it. I'm not sure what you mean by "standard java" though.

    Based on googling, there seems to be arping in kraken pcap which is in Java. See about Kraken.

    There's also jpcap as well that's used for the purpose.

    0 讨论(0)
  • 2020-12-19 05:35

    As you've stated, the Java standard library does not provide a low level enough networking API to send an ARP request.

    The pcap4j provides Java bindings for libpcap / winpcap and thus can be used to send an ARP request. Information on the library can be found on their homepage. See this sample for how to send an ARP request.

    0 讨论(0)
  • 2020-12-19 05:38

    No, not in native Java (I'm guessing this is due to security concerns). It can be done although it does require the use of C++/C native code libraries and JNI programming. https://forums.oracle.com/forums/thread.jspa?threadID=1690617

    0 讨论(0)
提交回复
热议问题