Class ArpUtils


  • public class ArpUtils
    extends Object
    • Constructor Detail

      • ArpUtils

        public ArpUtils()
    • Method Detail

      • scanNetworkDevice

        public static Set<InetAddress> scanNetworkDevice​(org.pcap4j.core.PcapNetworkInterface nif)
        Scans the network for alive IP addresses.
        Parameters:
        nif - network device
        Returns:
        ip address
      • resolveMacAddress

        public static Optional<org.pcap4j.util.MacAddress> resolveMacAddress​(org.pcap4j.core.PcapNetworkInterface nif,
                                                                             InetSocketAddress remoteAddress,
                                                                             InetSocketAddress localAddress,
                                                                             org.pcap4j.util.MacAddress localMacAddress)
        Used to get the mac address for a given IP address.
        Parameters:
        nif - network device
        remoteAddress - remote ip address that we want to get the mac address for
        localAddress - local ip address of the device asking the question
        localMacAddress - local mac address of the device asking the question
        Returns:
        optional that possibly contains the mac address we were looking for.