Listing 1 Start of the networking class
import jpcap.NetworkInterface;
import jpcap.JpcapCaptor;
public class networking {
/* define the device to be a global array of NetworkInterfaces */
NetworkInterface[] devices= null;
/* Our constructor that gets the list of NetworkInterfaces and
populates the devices array */
public networking() {
devices=JpcapCaptor.getDeviceList();
}
/* Returns the array of NetworkInfaces for the system */
public NetworkInterface[] getNetowrkInterfaces() {
return devices;
}
}
|