Examples of NetworkInterface


Examples of com.google.api.services.compute.model.NetworkInterface

        create.setName(instanceName);

        create.setZone(buildZoneUrl(projectId, ZONE_US_CENTRAL1_A));

        {
          NetworkInterface networkInterface = new NetworkInterface();
          networkInterface.setNetwork(buildNetworkUrl(projectId, "default"));

          AccessConfig networkAccessConfig = new AccessConfig();
          networkAccessConfig.setType("ONE_TO_ONE_NAT");

          networkInterface.setAccessConfigs(Lists.newArrayList(networkAccessConfig));

          create.setNetworkInterfaces(Lists.newArrayList(networkInterface));
        }

        Metadata metadata = new Metadata();
View Full Code Here

Examples of freenet.io.NetworkInterface

  }

  private void maybeGetNetworkInterface() {
    if (this.networkInterface!=null) return;

    NetworkInterface tempNetworkInterface = null;
    try {
      if(ssl) {
        tempNetworkInterface = SSLNetworkInterface.create(port, bindTo, allowedHosts, node.executor, true);
      } else {
        tempNetworkInterface = NetworkInterface.create(port, bindTo, allowedHosts, node.executor, true);
View Full Code Here

Examples of freenet.io.NetworkInterface

    @Override
    public String get() {
      FCPServer server = node.getFCPServer();
      if(server == null) return NetworkInterface.DEFAULT_BIND_TO;
      NetworkInterface netIface = server.networkInterface;
      return (netIface == null ? NetworkInterface.DEFAULT_BIND_TO : netIface.getAllowedHosts());
    }
View Full Code Here

Examples of java.net.NetworkInterface

      try{
        Enumeration   nis = NetworkInterface.getNetworkInterfaces();

        while( nis.hasMoreElements()){
         
          NetworkInterface   ni = (NetworkInterface)nis.nextElement();
           
          Enumeration addresses = ni.getInetAddresses();
         
          while( addresses.hasMoreElements()){
           
            InetAddress address = (InetAddress)addresses.nextElement();
           
View Full Code Here

Examples of java.net.NetworkInterface

        Enumeration<NetworkInterface> nifs = NetworkInterface
                .getNetworkInterfaces();

        List<String> hostIps = new ArrayList<String>();
        while (nifs.hasMoreElements()) {
            NetworkInterface nif = nifs.nextElement();
            Enumeration<InetAddress> ips = nif.getInetAddresses();

            while (ips.hasMoreElements()) {
                InetAddress ip = ips.nextElement();
                if (ip instanceof java.net.Inet4Address) {
                    hostIps.add(ip.getHostAddress());
View Full Code Here

Examples of java.net.NetworkInterface

    public static InetAddress findNonLocalhostIp() throws Exception {
        Enumeration<NetworkInterface> nifs = NetworkInterface
                .getNetworkInterfaces();

        while (nifs.hasMoreElements()) {
            NetworkInterface nif = nifs.nextElement();
            Enumeration<InetAddress> ips = nif.getInetAddresses();

            while (ips.hasMoreElements()) {
                InetAddress ip = ips.nextElement();
                if (ip instanceof java.net.Inet4Address
                        && !ip.isLoopbackAddress()) {
View Full Code Here

Examples of java.net.NetworkInterface

 
   
    List<String> list = new ArrayList<String>();
   
    while (e.hasMoreElements()) {
      NetworkInterface n = e.nextElement();
     
      list.add(n.getDisplayName());
    }
   
    System.out.println(list);
   
    return list.toArray(new String[list.size()]);
View Full Code Here

Examples of java.net.NetworkInterface

    this.rawLinkType = PcapDLT.asPcap(dlt).intValue();
  }

  protected void initFromJavaNetNetworkInterface(String device)
      throws SocketException {
    NetworkInterface netint = NetworkInterface.getByName(device);

    name = netint.getName();
    displayName = netint.getDisplayName();
    timezome = TimeZone.getDefault().getRawOffset();

    Enumeration<InetAddress> e = netint.getInetAddresses();
    while (e.hasMoreElements()) {
      addresses.add(new IpAddress(e.nextElement().getAddress()));
    }

  }
View Full Code Here

Examples of java.net.NetworkInterface

   private static InetAddress findLoopbackAddress() throws SocketException
   {
      Enumeration<NetworkInterface> ifaces = NetworkInterface.getNetworkInterfaces();
      while (ifaces.hasMoreElements())
      {
         NetworkInterface iface = ifaces.nextElement();
         Enumeration<InetAddress> addrs = iface.getInetAddresses();
         while (addrs.hasMoreElements())
         {
            InetAddress addr = addrs.nextElement();
            if (addr.isLoopbackAddress())
            {
View Full Code Here

Examples of java.net.NetworkInterface

        if (hostname.equals("")) {
            try {
                Enumeration e = NetworkInterface.getNetworkInterfaces();

                while (e.hasMoreElements() && hostname == null) {
                    NetworkInterface netface = (NetworkInterface) e.nextElement();
                    Enumeration e2 = netface.getInetAddresses();
                    while (e2.hasMoreElements() && hostname == null) {
                        InetAddress ip = (InetAddress) e2.nextElement();
                        if (!ip.getCanonicalHostName().equals("localhost")
                                        && !ip.getCanonicalHostName().equals("localhost.localdomain")) {
                            hostname = ip.getCanonicalHostName();
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.