Package net.azib.ipscan.core

Examples of net.azib.ipscan.core.ScanningSubject


  public ScanningSubject next() {
    currentNumber++;
    random.nextBytes(currentBytes);
    try {
      InetAddressUtils.maskPrototypeAddressBytes(currentBytes, maskBytes, prototypeBytes);
      return new ScanningSubject(InetAddress.getByAddress(currentBytes));
    }
    catch (UnknownHostException e) {
      // this should never happen
      throw new RuntimeException(e);
    }
View Full Code Here


    // this method must be fast, so we are not checking all the implementations   
    // currently only icmp pingers may not be supported, so let's check them
    if (scannerConfig.selectedPinger.startsWith("pinger.icmp")) {
      try {
        Pinger icmpPinger = createPinger(scannerConfig.selectedPinger, 250);
        icmpPinger.ping(new ScanningSubject(InetAddress.getLocalHost()), 1);
      }
      catch (Throwable e) {
        LOG.info("ICMP pinger failed: " + e);
        // win32 will use native pinger, all others get combined UDP+TCP, which doesn't require special privileges
        scannerConfig.selectedPinger = Platform.WINDOWS ? "pinger.windows" : "pinger.combined";
View Full Code Here

  public void close() {
    // not needed in this pinger
  }

  public static void main(String[] args) throws IOException {
    PingResult ping = new WindowsPinger(5000).ping(new ScanningSubject(InetAddress.getLocalHost()), 3);
    System.out.println(ping.getAverageTime() + "ms");
    System.out.println("TTL " + ping.getTTL());
  }
View Full Code Here

TOP

Related Classes of net.azib.ipscan.core.ScanningSubject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.