enums
This commit is contained in:
67
classlib/class/subnet.cs
Normal file
67
classlib/class/subnet.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user