public static NATRule CreateNATRule(global::System.Guid stampId, global::System.Guid ID) { NATRule nATRule = new NATRule(); nATRule.StampId = stampId; nATRule.ID = ID; return nATRule; }
private VShieldEdgeConfig InitObject() { VShieldEdgeConfig vsec = new VShieldEdgeConfig(); NATConfig natConfig = new NATConfig(); NATRule natRule = new NATRule(); PortInfo ipi = new PortInfo(); PortInfo epi = new PortInfo(); IpInfo iip = new IpInfo(); IpInfo eip = new IpInfo(); try { natRule.externalIpAddress = eip; natRule.externalPort = epi; natRule.internalIpAddress = iip; natRule.internalPort = ipi; if (_NatRules.NATConfig.Count > 0) { _NatRules.NATConfig.Add(natRule); return _NatRules; } else { natConfig.Add(natRule); vsec.NATConfig = natConfig; return vsec; } } catch (Exception e) { WriteObject("C-Sharp Exception: " + e); return null; } }