Working on the firewall
This commit is contained in:
@@ -230,6 +230,54 @@ namespace EduNetworkBuilder
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class FirewallRule
|
||||
{
|
||||
public string Source;
|
||||
public string Destination;
|
||||
public FirewallRuleType Action;
|
||||
|
||||
public FirewallRule(string source, string dest, FirewallRuleType action)
|
||||
{
|
||||
Source = source;
|
||||
Destination = dest;
|
||||
Action = action;
|
||||
}
|
||||
|
||||
public FirewallRule(XmlNode theNode)
|
||||
{
|
||||
foreach (XmlNode Individual in theNode.ChildNodes)
|
||||
{
|
||||
XmlNodeType myNodetype = Individual.NodeType;
|
||||
if (myNodetype == XmlNodeType.Element)
|
||||
{
|
||||
switch (Individual.Name.ToLower())
|
||||
{
|
||||
case "source":
|
||||
Source = Individual.InnerText;
|
||||
break;
|
||||
case "destination":
|
||||
Destination = Individual.InnerText;
|
||||
break;
|
||||
case "action":
|
||||
Action = NB.ParseEnum<FirewallRuleType>(Individual.InnerText);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Save(XmlWriter writer, string tag)
|
||||
{
|
||||
writer.WriteStartElement(tag);
|
||||
writer.WriteElementString("source", Source);
|
||||
writer.WriteElementString("destination", Destination);
|
||||
writer.WriteElementString("action", Action.ToString());
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class NB
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user