);
} catch (NumberFormatException e) {
throw new IllegalArgumentException("args[1]: " + strType, e);
}
PcapNetworkInterface nif;
try {
nif = new NifSelector().selectNetworkInterface();
} catch (IOException e) {
e.printStackTrace();
return;
}
if (nif == null) {
return;
}
System.out.println(nif.getName() + "(" + nif.getDescription() + ")");
final PcapHandle handle4capture
= nif.openLive(65536, PromiscuousMode.PROMISCUOUS, 10);
final PcapHandle handle4send
= nif.openLive(65536, PromiscuousMode.PROMISCUOUS, 10);
handle4capture.setFilter(
"(ether dst " + MAC_ADDR + ") or (arp and ether dst "
+ Pcaps.toBpfString(MacAddress.ETHER_BROADCAST_ADDRESS) +")",
BpfCompileMode.OPTIMIZE