public NetworkEquipment addInterface(NetworkInterface ni) { if ( ni == null || ni.Type == null ) { return this; } InterfaceTypes[ni.Type].Add(ni); return this; }
public SquareInt(int x, int y, NetworkInterface ni ) { X = x; Y = y; iface = ni; }
private void recordPosition(int x, int y, NetworkInterface ni) { boxCoordinates.Add(new SquareInt(x, y, ni)); // store coords }
public NetworkEquipment addInterface(string oid, string name) { String[] tmp = oid.Split('.'); NetworkInterface ni = new NetworkInterface(); ni.Id = tmp[(tmp.Length-1)]; ni.Descr = name; // determine type if (name.Contains("Upstream") || name.Contains("US ")) { ni.Type = "upstream"; if (name.Contains("Channel") || name.Contains(" CH ")) { ni.SubType = "channel"; } if (name.Contains("Interface")) { ni.SubType = "interface"; } } else if (name.Contains("Ethernet") || name.Contains("ETH ")) { // ethernet interface ni.Type = "ethernet"; if (name.Contains("Fast")) { ni.SubType = "fastethernet"; } } else if (name.Contains("Downstream") || name.Contains("DS ")) { ni.Type = "downstream"; } else { return this;// if we don't know what it is, we don't care } return addInterface(ni); }