public class ARP { public static byte[] arp(InetAddress ip) throws java.io.IOException{ //发现本机器的网络接口 int i; NetworkInterface[] devices=JpcapCaptor.getDeviceList(); NetworkInterface device=null; for (i = 0; i < devices.length; i++) { System.out.PRintln(devices[i].description); } device = devices[2];//我的机器是第三个进行网络通信
if(device==null) throw new IllegalArgumentException(ip+" is not a local address");