This commit is contained in:
2022-12-05 15:29:03 +03:00
parent affbd18de2
commit c4b15d7387
12 changed files with 33 additions and 2 deletions

67
classlib/class/subnet.cs Normal file
View File

@@ -0,0 +1,67 @@
namespace PS.IPAM;
using System;
[Serializable]
public class Subnetwork {
public int Id { get; }
public string Subnet { get; }
public int Mask { get; }
public int SectionId { get; }
public string Description { get; }
public string LinkedSubnet { get; }
public int FirewallAddressObject { get; }
public int VrfId { get; }
public int MasterSubnetId { get; }
public bool AllowRequests { get; }
public int VlanId { get; }
public bool ShowName { get; }
public int Device { get; }
public bool PingSubnet { get; }
public bool DiscoverSubnet { get; }
public bool ResolveDNS { get; }
public Subnetwork(
int id,
string subnet,
int mask,
int sectionId,
string description,
string linkedSubnet,
int firewallAddressObject,
int vrfId,
int masterSubnetId,
string permissions,
bool allowRequests,
int vlanId,
bool showName,
int device,
bool pingSubnet,
bool discoverSubnet,
bool resolveDNS
) {
this.Id = id;
this.Subnet = subnet;
this.Mask = mask;
this.SectionId = sectionId;
this.Description = description;
this.LinkedSubnet = linkedSubnet;
this.FirewallAddressObject = firewallAddressObject;
this.VrfId = vrfId;
this.MasterSubnetId = masterSubnetId;
this.AllowRequests = allowRequests;
this.VlanId = vlanId;
this.ShowName = showName;
this.Device = device;
this.PingSubnet = pingSubnet;
this.DiscoverSubnet = discoverSubnet;
this.ResolveDNS = resolveDNS;
}
public string GetCIDR() {
return $"{this.Subnet}/{this.Mask}";
}
public override string ToString()
{
return this.GetCIDR();
}
}