Here you can find the source of getAllAvailableInterfaces()
public static List<NetworkInterface> getAllAvailableInterfaces() throws SocketException
//package com.java2s; //License from project: LGPL import java.net.*; import java.util.*; public class Main { public static List<NetworkInterface> getAllAvailableInterfaces() throws SocketException { List<NetworkInterface> retval = new ArrayList<NetworkInterface>(10); NetworkInterface intf;/*from ww w . j a va 2 s . c om*/ for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { intf = (NetworkInterface) en.nextElement(); retval.add(intf); } return retval; } }