/**************************************************************************
 *  ICMP Java wrapper                                                     *
 *  (C) 1998 by Euclides                                                  *
 **************************************************************************/

package rex;

import java.net.*;

public class Icmp {
  public static native String IcmpInit() throws IcmpInitException;
  public static native int IcmpOpenSocket() throws IcmpInitException, IcmpOpenSocketException;
  public static native boolean IcmpCloseSocket(int HANDLE) throws IcmpInitException;
  public static native InetAddress IcmpSendEcho(int HANDLE, InetAddress Dest, int Timeout, int TTL) throws IcmpSendEchoException, IcmpSystemException, IcmpTimeoutException;
  public static native void IcmpDone() throws IcmpInitException, IcmpDoneException;
  public int roundTripTime;

  static {
    System.loadLibrary("Icmp_Lib");
  }

  //Construct the application
  public Icmp() {
  }
}

class IcmpException extends Exception {
  public IcmpException() {
    super("");
  }
  public IcmpException(String message) {
    super(message);
  }
}

class IcmpInitException extends IcmpException {
  public IcmpInitException() {
    super("");
  }
  public IcmpInitException(String message) {
    super(message);
  }
}

class IcmpOpenSocketException extends IcmpException {
  public IcmpOpenSocketException() {
    super("");
  }
  public IcmpOpenSocketException(String message) {
    super(message);
  }
}

class IcmpSendEchoException extends IcmpException {
  public IcmpSendEchoException() {
    super("");
  }
  public IcmpSendEchoException(String message) {
    super(message);
  }
}

class IcmpSystemException extends IcmpException {
  public IcmpSystemException() {
    super("");
  }
  public IcmpSystemException(String message) {
    super(message);
  }
}

class IcmpTimeoutException extends IcmpException {
  public IcmpTimeoutException() {
    super("");
  }
  public IcmpTimeoutException(String message) {
    super(message);
  }
}

class IcmpDoneException extends IcmpException {
  public IcmpDoneException() {
    super("");
  }
  public IcmpDoneException(String message) {
    super(message);
  }
}

