diff --git a/EduNetworkBuilder/NetworkDevice.cs b/EduNetworkBuilder/NetworkDevice.cs index 57d44e5..310c24a 100644 --- a/EduNetworkBuilder/NetworkDevice.cs +++ b/EduNetworkBuilder/NetworkDevice.cs @@ -655,6 +655,53 @@ namespace EduNetworkBuilder } } + /// + /// Return the list of devices connected to this device + /// + /// A list of devices + List ConnectedTo() + { + List connected = new List(); + foreach(NetworkCard nic in NICs) + { + NetworkDevice nd = ConnectedTo(nic); + if (nd != null) connected.Add(nd); + } + return connected; + } + + /// + /// return the device this nic is attached to + /// + /// + /// + NetworkDevice ConnectedTo(NetworkCard NIC) + { + return NIC.ConnectedTo(); + } + /// + /// return the device this nic is attached to + /// + /// the network card ID + /// + NetworkDevice ConnectedTo(HostNicID NIC) + { + NetworkCard nic = NicFromID(NIC); + if (nic == null) return null; + return nic.ConnectedTo(); + } + /// + /// return the device this nic is attached to + /// + /// The network card name + /// + NetworkDevice ConnectedTo(string nicname) + { + NetworkCard nic = NicFromName(nicname); + if (nic == null) return null; + return nic.ConnectedTo(); + } + /// /// Check to see if the device has a link to the specified host ///