Add an initial RenumberData class. Used when processing devices and figuring out which devices are part of a particular broadcast network.

This commit is contained in:
Tim Young 2019-03-06 12:30:28 +03:00
parent 966f4fe8a8
commit 199ecbcf06

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EduNetworkBuilder
{
public class NBRenumberData
{
public string Hostname = "";
public NetworkDevice Device {
get {
Network myNet = NB.GetNetwork();
if (myNet == null) return null;
return myNet.DeviceFromName(Hostname);
}
}
public int ActiveCount=0;
public string nicname;
public string SuggestedIP;
private bool _isRouter = false;
/// <summary>
/// Return true if the Device specified by hostname does routing.
/// </summary>
public bool IsRouter {
get {
if (_isRouter) return true;
NetworkDevice ND = Device;
if(ND.RoutesPackets())
{
_isRouter = true;
return true;
}
return false;
}
}
}
}