Examples of NetworkInterface


Examples of java.net.NetworkInterface

        }
        try {
            InetAddress dest = InetAddress.getByName(hostname);
            Enumeration en = NetworkInterface.getNetworkInterfaces();
            while(en.hasMoreElements()) {
                NetworkInterface iface = (NetworkInterface) en.nextElement();
                Enumeration ine = iface.getInetAddresses();
                while (ine.hasMoreElements()) {
                    InetAddress address = (InetAddress) ine.nextElement();
                    if(address.equals(dest)) {
                        isSameMachine = true;
                    }
View Full Code Here

Examples of jpcap.NetworkInterface

      System.out.println("Usage: java Traceroute <device index (e.g., 0, 1..)> <target host address>");
      System.exit(0);
    }
   
    //initialize Jpcap
    NetworkInterface device=JpcapCaptor.getDeviceList()[Integer.parseInt(args[0])];
    JpcapCaptor captor=JpcapCaptor.openDevice(device,2000,false,5000);
    InetAddress thisIP=null;
    for(NetworkInterfaceAddress addr:device.addresses)
      if(addr.address instanceof Inet4Address){
        thisIP=addr.address;
View Full Code Here

Examples of org.jclouds.abiquo.domain.infrastructure.NetworkInterface

      final String datastoreName = Config.get("abiquo.hypervisor.datastore");

      machine = datacenter.discoverSingleMachine(ip, type, user, pass);

      NetworkServiceType nst = datacenter.defaultNetworkServiceType();
      NetworkInterface vswitch = find(machine.getNetworkInterfaces(), new Predicate<NetworkInterface>() {
         @Override
         public boolean apply(NetworkInterface input) {
            return input.getName().equals(vswitchName);
         }
      });
      vswitch.setNetworkServiceType(nst);

      Datastore datastore = find(machine.getDatastores(), new Predicate<Datastore>() {
         @Override
         public boolean apply(Datastore input) {
            return input.getName().equals(datastoreName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.