");
-
+
obj.MembersPublishIndex = i;
file.WriteLine(obj.ToCLIScript());
@@ -2174,7 +2175,8 @@ public void CreateSmartConnector(bool isNeedGenOpt = false, bool isCurrentOptimi
i += 250000;
File.AppendAllText(cpObjectsJsonPath + cpObjectsJsonFN, JsonConvert.SerializeObject(dest, Formatting.Indented));
}
- } else File.WriteAllText(cpObjectsJsonPath + cpObjectsJsonFN, JsonConvert.SerializeObject(cpJsonObjects, Formatting.Indented));
+ }
+ else File.WriteAllText(cpObjectsJsonPath + cpObjectsJsonFN, JsonConvert.SerializeObject(cpJsonObjects, Formatting.Indented));
string smartConnectorArchiveName = "smartconnector_" + _vendorFileName;
string smartConnectorArchivePath = _targetFolder + Path.DirectorySeparatorChar + smartConnectorArchiveName;
@@ -2387,7 +2389,7 @@ private void CreateZip(string compressorsDirPath, string[] pySmartConnectorFNs,
if (isOptNeeded)
{
- if (!File.Exists(cpObjectsJsonPath + optimizedNameJson))
+ if (!File.Exists(cpObjectsJsonPath + optimizedNameJson))
return;
}
diff --git a/MigrationBase/VendorParser.cs b/MigrationBase/VendorParser.cs
index 7f760a82..2924f304 100644
--- a/MigrationBase/VendorParser.cs
+++ b/MigrationBase/VendorParser.cs
@@ -27,7 +27,7 @@ public abstract class VendorParser
#region Private Members
protected string VendorVersion = "";
-
+
#endregion
#region Properties
diff --git a/NetScreenMigration/NetScreenMigration.csproj b/NetScreenMigration/NetScreenMigration.csproj
index 9d4ffb07..5313d19e 100644
--- a/NetScreenMigration/NetScreenMigration.csproj
+++ b/NetScreenMigration/NetScreenMigration.csproj
@@ -81,11 +81,11 @@
-
-
\ No newline at end of file
+
diff --git a/NetScreenMigration/Properties/AssemblyInfo.cs b/NetScreenMigration/Properties/AssemblyInfo.cs
index 35d4907e..d4fac3c6 100644
--- a/NetScreenMigration/Properties/AssemblyInfo.cs
+++ b/NetScreenMigration/Properties/AssemblyInfo.cs
@@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NetScreenMigration")]
@@ -14,8 +14,8 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -25,11 +25,11 @@
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Build and Revision Numbers
+// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/NetScreenMigration/ScreenOSCommands.cs b/NetScreenMigration/ScreenOSCommands.cs
index 6f874309..60d240a2 100644
--- a/NetScreenMigration/ScreenOSCommands.cs
+++ b/NetScreenMigration/ScreenOSCommands.cs
@@ -63,7 +63,7 @@ public string Text
List
tempArrayList = trimmedText.Split(delimiterChars).ToList();
// Gather strings with spaces between quotes
- for (int i = 0; i < tempArrayList.Count;++i)
+ for (int i = 0; i < tempArrayList.Count; ++i)
{
if (tempArrayList[i].First() == '\"' && tempArrayList[i].Last() != '\"')
{
@@ -146,7 +146,7 @@ public virtual void Parse(ScreenOSCommand command)
NotAnInterestingCommand = true;
}
}
-
+
public int GetNumOfParams()
{
if (_words == null)
@@ -237,14 +237,14 @@ public static bool IsInQuotation(string str)
}
}
- public class ScreenOSCommand_Address: ScreenOSCommand
+ public class ScreenOSCommand_Address : ScreenOSCommand
{
public enum AddressTypeEnum { NA, Host, Network, Domain };
private string _zone = "";
private string _objectName = "";
private string _mask = "";
-
+
public AddressTypeEnum AddressType { get; set; }
public string IpAddress { get; set; }
public string Domain { get; set; }
@@ -308,7 +308,7 @@ public ScreenOSCommand_Address()
public override void Parse(ScreenOSCommand command)
{
base.Parse(command);
-
+
// Check if base parse marked the command as interesting
if (NotAnInterestingCommand)
{
@@ -342,7 +342,7 @@ public override void Parse(ScreenOSCommand command)
ConversionIncidentType = ConversionIncidentType.ManualActionRequired;
ConversionIncidentMessage = string.Format("ScreenOS address object with complex wildcard mask {0} is not supported. Using subnet 1.1.1.0/255.255.255.0", commandParam);
}
- else if(string.IsNullOrEmpty(commandParam) || IsInQuotation(commandParam))
+ else if (string.IsNullOrEmpty(commandParam) || IsInQuotation(commandParam))
{
Domain = command.GetParam(4);
AddressType = AddressTypeEnum.Domain;
@@ -358,7 +358,7 @@ public override void Parse(ScreenOSCommand command)
if (IsInQuotation(commandParam))
{
Comment = commandParam;
- }
+ }
}
}
@@ -396,7 +396,7 @@ public ScreenOSCommand_GroupAddress()
public override void Parse(ScreenOSCommand command)
{
base.Parse(command);
-
+
// Check if base parse marked the command as interesting
if (NotAnInterestingCommand)
{
@@ -432,7 +432,7 @@ public enum TimeOutUnitsEnum { Minutes, TenSeconds };
private readonly int _maxTimeout = 2160;
private string _serviceName = "";
-
+
public int TimeOut { get; set; }
public TimeOutUnitsEnum TimeOutUnits { get; set; }
public bool IsSessionCacheEnabled { get; set; }
@@ -465,7 +465,7 @@ public ScreenOSCommand_Service()
public override void Parse(ScreenOSCommand command)
{
base.Parse(command);
-
+
// Check if base parse marked the command as interesting
if (NotAnInterestingCommand)
{
@@ -529,10 +529,10 @@ public override void Parse(ScreenOSCommand command)
if (commandString == "session-cache")
{
- ConversionIncidentMessage = commandString ;
+ ConversionIncidentMessage = commandString;
IsSessionCacheEnabled = true;
commandString = command.GetParam(++index);
-
+
}
if (commandString == "timeout")
@@ -598,7 +598,7 @@ public string ServiceObjectName
get { return _serviceObjectName.Trim('"'); }
set { _serviceObjectName = value; }
}
-
+
public ScreenOSCommand_GroupService()
{
KnownCommand = true;
@@ -674,7 +674,7 @@ public override void Parse(ScreenOSCommand command)
ObjectName = command.GetParam(2);
IpAddressFirst = command.GetParam(3);
IpAddressLast = command.GetParam(4);
-
+
if (!NetworkUtils.IsValidIpv4(IpAddressFirst) ||
!NetworkUtils.IsValidIpv4(IpAddressLast) ||
NetworkUtils.Ip2Number(IpAddressLast) < NetworkUtils.Ip2Number(IpAddressFirst))
@@ -690,8 +690,8 @@ public class ScreenOSCommand_Zone : ScreenOSCommand
private string _zoneName = "";
public static string[] PredefinedZones = { "Trust", "Untrust", "DMZ" };
- public static string[] SpecialPredefinedZones = { "MGT" , "Null" , "Untrust-Tun", "V1-Null", "V1-Trust", "V1-Untrust" , "V1-DMZ" };
- public static string[] UnsupportedPredefinedZones = { "HA", "VLAN"};
+ public static string[] SpecialPredefinedZones = { "MGT", "Null", "Untrust-Tun", "V1-Null", "V1-Trust", "V1-Untrust", "V1-DMZ" };
+ public static string[] UnsupportedPredefinedZones = { "HA", "VLAN" };
public static string Global = "Global";
public bool IsPredefinedZones { get; set; }
@@ -731,7 +731,7 @@ public override void Parse(ScreenOSCommand command)
string commandParam = command.GetParam(2);
if (IsInQuotation(commandParam))
{
- if(PredefinedZones.Contains(commandParam.Trim('"')))
+ if (PredefinedZones.Contains(commandParam.Trim('"')))
{
IsPredefinedZones = true;
}
@@ -758,7 +758,7 @@ public override void Parse(ScreenOSCommand command)
}
}
else if (commandParam == "id")
- {
+ {
// New definition of zone
int zoneId = 0;
if (int.TryParse(command.GetParam(3), out zoneId))
@@ -814,7 +814,7 @@ public enum InterfaceObjectTypeEnum { NA, Ip, Zone, Nat, Dip, Mip, Vip };
private string _zone = "";
- public string InterfaceName { get; set; }
+ public string InterfaceName { get; set; }
public string IP { get; set; }
public string Mask { get; set; }
public bool IsSecondery { get; set; }
@@ -874,7 +874,7 @@ public override void Parse(ScreenOSCommand command)
case "tag":
InterfaceObjectType = InterfaceObjectTypeEnum.Zone;
- index+=3;
+ index += 3;
break;
case "nat":
@@ -955,9 +955,9 @@ public bool CheckIfInterfaceIsGateway(string gateway)
}
if (InterfaceObjectType == InterfaceObjectTypeEnum.Ip &&
- NetworkUtils.GetNetwork(IP,Mask) == NetworkUtils.GetNetwork(gateway, Mask))
+ NetworkUtils.GetNetwork(IP, Mask) == NetworkUtils.GetNetwork(gateway, Mask))
{
- return true;
+ return true;
}
// Check inside children
@@ -985,8 +985,8 @@ public class ScreenOSCommand_Route : ScreenOSCommand
public string Interface { get; set; }
public string Gateway { get; set; }
public string Description { get; set; }
- public int Metric { get; set; }
- public bool IsPermanent { get; set; }
+ public int Metric { get; set; }
+ public bool IsPermanent { get; set; }
public bool DefaultRoute
{
@@ -1070,7 +1070,7 @@ public override void Parse(ScreenOSCommand command)
public class ScreenOSCommand_Policy : ScreenOSCommand
{
- public enum ActoinEnum { Na, Permit, Reject, Deny};
+ public enum ActoinEnum { Na, Permit, Reject, Deny };
public enum PolicyNatTypeEnum { Na, Policy, Vip, Mip, Dip, PolicyBaseDest, PolicyBaseSrcDest };
public int PolicyId { get; set; }
@@ -1267,7 +1267,7 @@ public override void Parse(ScreenOSCommand command)
}
public static PolicyNatTypeEnum GetDestNatType(string destObjName)
- {
+ {
if (destObjName.Trim('"') == "Any" || destObjName.Trim('"').Length < 4)
{
return PolicyNatTypeEnum.Policy;
@@ -1343,7 +1343,7 @@ private PolicyNatTypeEnum ParseNatPart(ScreenOSCommand command, ref int baseInde
}
}
- public class ScreenOsCommand_InterfceNatDIP: ScreenOSCommand
+ public class ScreenOsCommand_InterfceNatDIP : ScreenOSCommand
{
private readonly int _baseIndex = 3;
private bool _isPATEnabled;
@@ -1384,18 +1384,18 @@ public ScreenOsCommand_InterfceNatDIP()
public override void Parse(ScreenOSCommand command)
{
int paramIndex = command.GetParamPosition("dip");
-
+
if (paramIndex < _baseIndex)
{
NotAnInterestingCommand = true;
return;
}
-
+
if (paramIndex != _baseIndex)
{
ConversionIncidentType = ConversionIncidentType.Informative;
List notSupportedParams = command.GetParams(3, paramIndex - 3);
- ConversionIncidentMessage = string.Join(" ", notSupportedParams.ToArray()) + ", " ;
+ ConversionIncidentMessage = string.Join(" ", notSupportedParams.ToArray()) + ", ";
}
// Get Dip Id
@@ -1466,7 +1466,7 @@ public ScreenOsCommand_GroupNatDIP()
public override void Parse(ScreenOSCommand command)
{
- int paramIndex = _baseIndex;
+ int paramIndex = _baseIndex;
// Get group Dip Id
string commandParam = command.GetParam(paramIndex);
@@ -1475,7 +1475,7 @@ public override void Parse(ScreenOSCommand command)
{
GroupDipId = tempInt;
}
- else
+ else
{
NotAnInterestingCommand = true;
return;
@@ -1569,7 +1569,7 @@ public override void Parse(ScreenOSCommand command)
else
{
ConversionIncidentType = ConversionIncidentType.ManualActionRequired;
- ConversionIncidentMessage = "ScreenOS interface object with MIP instruction, option " + commandParam + " is not supported. Ignoring command";
+ ConversionIncidentMessage = "ScreenOS interface object with MIP instruction, option " + commandParam + " is not supported. Ignoring command";
return;
}
@@ -1616,7 +1616,7 @@ public VipInfo()
public string Vip { get; set; }
public bool ShuoldUseInterfcaeIp { get; set; }
- public VipInfo VipData { get; set; }
+ public VipInfo VipData { get; set; }
public ScreenOsCommand_InterfceNatVIP()
{
diff --git a/NetScreenMigration/ScreenOSConverter.cs b/NetScreenMigration/ScreenOSConverter.cs
index 34866212..5b8a8faf 100644
--- a/NetScreenMigration/ScreenOSConverter.cs
+++ b/NetScreenMigration/ScreenOSConverter.cs
@@ -689,11 +689,12 @@ private List PolicySimplifiedList
#pragma warning disable CS0108 // 'ScreenOSConverter._outputFormat' hides inherited member 'VendorConverter._outputFormat'. Use the new keyword if hiding was intended.
private string _outputFormat { get; set; }
#pragma warning restore CS0108 // 'ScreenOSConverter._outputFormat' hides inherited member 'VendorConverter._outputFormat'. Use the new keyword if hiding was intended.
- private string OutputFormat {
- get
- {
- return _outputFormat;
- }
+ private string OutputFormat
+ {
+ get
+ {
+ return _outputFormat;
+ }
set
{
_outputFormat = value;
@@ -1777,7 +1778,7 @@ private CheckPointObject GetCheckPointServiceObjByName(string serviceName)
return null;
}
}
-
+
string objName = ScreenOS2CheckPointServicesNameDic[serviceName];
return _cpObjects.GetObject(objName);
}
@@ -1904,7 +1905,7 @@ private CheckPointObject GetSrcObjectFromPolicyForNAT(PolicyCommandSimplifier po
foreach (string src in policy.SrcAddr)
{
- srcGroup.Members.Add(GetSrcObjectByNameFromPolicy(src, policy,true).Name);
+ srcGroup.Members.Add(GetSrcObjectByNameFromPolicy(src, policy, true).Name);
}
AddCheckPointObject(srcGroup);
@@ -1971,7 +1972,7 @@ private CheckPointObject GetDstObjectFromPolicyForNAT(PolicyCommandSimplifier po
foreach (string dst in policy.DstAddr)
{
- dstGroup.Members.Add(GetDstObjectByNameFromPolicy(dst, policy,true).Name);
+ dstGroup.Members.Add(GetDstObjectByNameFromPolicy(dst, policy, true).Name);
}
AddCheckPointObject(dstGroup);
@@ -1980,7 +1981,7 @@ private CheckPointObject GetDstObjectFromPolicyForNAT(PolicyCommandSimplifier po
}
else
{
- dstOrig = GetDstObjectByNameFromPolicy(policy.DstAddr.First(), policy,true);
+ dstOrig = GetDstObjectByNameFromPolicy(policy.DstAddr.First(), policy, true);
}
return dstOrig;
@@ -2300,7 +2301,7 @@ private bool IsZoneAvailable(string zoneName, ScreenOSCommand command)
CheckPointObject cpZone = _cpObjects.GetObject(zoneName);
if (zoneName != ScreenOSCommand_Zone.Global && cpZone == null)
{
- if(ScreenOSCommand_Zone.SpecialPredefinedZones.Contains(zoneName))
+ if (ScreenOSCommand_Zone.SpecialPredefinedZones.Contains(zoneName))
{
/* Create predefined special zone*/
cpZone = new CheckPoint_Zone();
@@ -2384,7 +2385,7 @@ private void Add_AddressAndGroupAddress()
cpNetwork.ConvertedCommandId = address.Id;
cpNetwork.Comments = address.Comment;
ApplyConversionIncidentOnCheckPointObject(cpNetwork, address);
- inMultipleZones = IsNetworkObjectContainedInMultipleZones(cpNetwork, address);
+ inMultipleZones = IsNetworkObjectContainedInMultipleZones(cpNetwork, address);
if (!inMultipleZones)
{
CheckObjectNameValidity(cpNetwork, address, false);
@@ -2496,7 +2497,7 @@ private void Add_InterfacesAndRoutes()
{
continue;
}
-
+
/* Create check point Network group for interface */
CheckPoint_NetworkGroup netGroup = new CheckPoint_NetworkGroup();
netGroup.Name = ObjectNameGenerator.InterfaceName(ifc.InterfaceObjName);
@@ -2561,7 +2562,7 @@ private void Add_InterfacesAndRoutes()
}
}
- ApplyConversionIncidentOnCheckPointObject(netGroup,ifc);
+ ApplyConversionIncidentOnCheckPointObject(netGroup, ifc);
CheckObjectNameValidity(netGroup, ifc);
AddCheckPointObject(netGroup);
}
@@ -3203,7 +3204,7 @@ private void MarkNatRulesNotIntersting()
}
private void Add_Mip_Nat()
- {
+ {
foreach (ScreenOSCommand_Policy natPolicy in ScreenOSPolicyCommands)
{
if (natPolicy.PolicyNatType == ScreenOSCommand_Policy.PolicyNatTypeEnum.Mip
@@ -3492,8 +3493,8 @@ private void Add_Dip_Nat()
List cpDipTranslatedObj;
List isPATEnabled;
List isEnabled;
- string comment ="";
-
+ string comment = "";
+
if (!Prepare_ObjectsForDipNat(simpleDipPolicy, out cpDipOriginalObj, out cpDipTranslatedObj, out isEnabled, out isPATEnabled, out comment))
{
continue;
@@ -3533,7 +3534,7 @@ private void Add_PolicyBasedDestNat()
CheckPointObject destIpTranslated = null;
CheckPointObject destPortTranslated = null;
- if (!Prepare_ObjectsForPolicyBasedDestNat( simplePolicy, out destIpTranslated, out destPortTranslated))
+ if (!Prepare_ObjectsForPolicyBasedDestNat(simplePolicy, out destIpTranslated, out destPortTranslated))
{
continue;
}
@@ -3697,13 +3698,13 @@ private void Add_InterfaceBasedLegacyNat()
foreach (string ifcGroup in zoneTrustNetGroup.Members)
{
CheckPointObject ifcGroupObj = _cpObjects.GetObject(ifcGroup);
- if(ifcGroupObj.Tag == "NAT")
+ if (ifcGroupObj.Tag == "NAT")
{
interfacesWithNAT.Add(ifcGroupObj);
}
}
- /* If no interface with NAT attached to Trust zone, exit function*/
+ /* If no interface with NAT attached to Trust zone, exit function*/
if (interfacesWithNAT.Count == 0)
{
return;
@@ -3714,7 +3715,7 @@ private void Add_InterfaceBasedLegacyNat()
{
srcObj = interfacesWithNAT.First();
}
- else if(zoneTrustNetGroup.Members.Count == interfacesWithNAT.Count)
+ else if (zoneTrustNetGroup.Members.Count == interfacesWithNAT.Count)
{
srcObj = zoneTrustNetGroup;
}
@@ -3801,7 +3802,7 @@ private void Add_InterfaceBasedLegacyNat()
}
}
- private bool Prepare_ObjectsForPolicyBasedDestNat(PolicyCommandSimplifier simplePolicy, out CheckPointObject destIpTranslated,out CheckPointObject destPortTranslated)
+ private bool Prepare_ObjectsForPolicyBasedDestNat(PolicyCommandSimplifier simplePolicy, out CheckPointObject destIpTranslated, out CheckPointObject destPortTranslated)
{
destIpTranslated = null;
destPortTranslated = null;
@@ -3939,7 +3940,7 @@ private bool Prepare_ObjectsForDipNat(PolicyCommandSimplifier simplePolicy, out
cpDipOriginalObj.Add(cpDipOriginalObjTemp);
isEnabled.Add(false);
isPATEnabled.Add(true);
-
+
interfaceWithHostObject++;
}
}
@@ -3950,7 +3951,7 @@ private bool Prepare_ObjectsForDipNat(PolicyCommandSimplifier simplePolicy, out
comments = "ScreenOS NAT policy object does not contain any intefaces with hosts.";
}
else if (interfaceWithHostObject > 1)
- {
+ {
string errorTitle = string.Format("ScreenOS NAT policy object does not contain dip-id. NAT rules will be created as much as the number of attached interfaces to destination zone with host IP. NAT rules will be in a disabled mode");
string errorDescription = string.Format("Policy DIP object details: {0}.", natPolicy.Text);
_conversionIncidents.Add(new ConversionIncident(natPolicy.Id, errorTitle, errorDescription, ConversionIncidentType.ManualActionRequired));
@@ -3961,7 +3962,7 @@ private bool Prepare_ObjectsForDipNat(PolicyCommandSimplifier simplePolicy, out
comments = "ScreenOS NAT policy object does not contain dip-id. One NAT rule will be created according to attached interface to destination zone with host IP.";
if (isEnabled.Count > 0)
isEnabled[isEnabled.IndexOf(isEnabled.Last())] = simplePolicy.IsEnabled;
- }
+ }
}
/* Create Objects for Dip*/
else if (GetDipObjByDipId(dipId, out ifc))
@@ -4067,14 +4068,14 @@ private void Add_NatPolicy2RegularPolicy()
/* Layer not found, create new layer*/
if (!isFound)
- {
+ {
/* Find first global in parent layer*/
int firstGlobal = 0;
foreach (CheckPoint_Rule layer in _cpPackages[0].ParentLayer.Rules)
{
if (layer.Tag == "global")
{
- break;
+ break;
}
firstGlobal++;
}
@@ -4103,7 +4104,7 @@ private void Add_NatPolicy2RegularPolicy()
cpNewRule.Source.Add(cpSrcObject);
cpNewRule.Destination.Add(cpDstObject);
cpNewRule.Action = CheckPoint_Rule.ActionType.SubPolicy;
- cpNewRule.SubPolicyName = ObjectNameGenerator.SubPolicyByZonesName(cpSrcObject.Name,cpDstObject.Name);
+ cpNewRule.SubPolicyName = ObjectNameGenerator.SubPolicyByZonesName(cpSrcObject.Name, cpDstObject.Name);
cpNewRule.Layer = _cpPackages[0].NameOfAccessLayer;
cpNewRule.Tag = "inter";
_cpPackages[0].ParentLayer.Rules.Insert(firstGlobal, cpNewRule);
@@ -4113,14 +4114,14 @@ private void Add_NatPolicy2RegularPolicy()
cpLayer.Name = cpRule.Layer;
cpLayer.Rules.Add(cpRule);
/* Copy global and clean up rules to new layer*/
- for (int index = firstGlobal + 1; index < _cpPackages[0].ParentLayer.Rules.Count;++index)
+ for (int index = firstGlobal + 1; index < _cpPackages[0].ParentLayer.Rules.Count; ++index)
{
cpLayer.Rules.Add(_cpPackages[0].ParentLayer.Rules[index].Clone());
cpLayer.Rules.Last().Layer = cpRule.Layer;
}
cpLayer.Rules.Last().Name = "Sub-Policy Cleanup rule";
- _cpPackages[0].SubPolicies.Insert(firstGlobal,cpLayer);
+ _cpPackages[0].SubPolicies.Insert(firstGlobal, cpLayer);
validatePackage(_cpPackages[0]);
}
}
@@ -4263,10 +4264,10 @@ public override Dictionary Convert(bool convertNat = false)
}
RaiseConversionProgress(20, "Converting objects ...");
_cpObjects.Initialize(); // must be first!!!
-
+
foreach (CheckPointObject cpObject in _cpObjects.GetPredefinedObjects())
{
- _objectNameGenerator.AddAppearanceCount(cpObject.Name,true);
+ _objectNameGenerator.AddAppearanceCount(cpObject.Name, true);
}
UploadPredefinedServices();
@@ -4762,7 +4763,7 @@ public override void ExportConfigurationAsHtml()
foreach (ScreenOSCommand command in ScreenOSAllCommands)
{
string lineStyle = "";
- string indentation = "";
+ string indentation = "";
if (!command.KnownCommand)
{
@@ -5121,7 +5122,7 @@ public override void ExportPolicyPackagesAsHtml()
{
sbCurRuleNumberColumnTag.Append(HtmlDisabledImageTag);
}
- sbCurRuleNumberColumnTag.Append("");
+ sbCurRuleNumberColumnTag.Append("");
file.WriteLine(sbCurRuleNumberColumnTag.ToString());
file.WriteLine(" " + ruleEntry.Value.Name + " | ");
diff --git a/NetScreenMigration/ScreenOSKnownServices.cs b/NetScreenMigration/ScreenOSKnownServices.cs
index 76b736c9..57343385 100644
--- a/NetScreenMigration/ScreenOSKnownServices.cs
+++ b/NetScreenMigration/ScreenOSKnownServices.cs
@@ -173,7 +173,7 @@ public static bool IsKnownPredefinedServiceNameInGroup(string serviceName)
{
foreach (KeyValuePair> pair in _screenOSPredefinedServicesGroup)
{
- if (pair.Value.Contains (serviceName))
+ if (pair.Value.Contains(serviceName))
{
return true;
}
@@ -187,7 +187,7 @@ public static bool IsKnownPredefinedServiceGroupName(string serviceGroupName)
}
/* ScreenOS Predefined service groups map to CP groups*/
- public static bool IsKnownPredefinedServiceGroupInCp(string screenOsGroupName,out string cpGroupName)
+ public static bool IsKnownPredefinedServiceGroupInCp(string screenOsGroupName, out string cpGroupName)
{
cpGroupName = "";
if (_screenOSPredefinedServicesGroupToCpGroup.ContainsKey(screenOsGroupName))
diff --git a/NetScreenMigration/ScreenOSParser.cs b/NetScreenMigration/ScreenOSParser.cs
index f03835c3..5b2e0ec3 100644
--- a/NetScreenMigration/ScreenOSParser.cs
+++ b/NetScreenMigration/ScreenOSParser.cs
@@ -165,7 +165,7 @@ private ScreenOSCommand FindCommand(ScreenOSCommand command)
if (relevantCommands.Contains(command.ObjectWord))
{
- if(command.ObjectWord == "vsys-id")
+ if (command.ObjectWord == "vsys-id")
{
_numOfVsysInConfiguration++;
}
@@ -205,7 +205,7 @@ private void ParseInterfacesTopology()
continue;
}
- if ((!string.IsNullOrEmpty(ifc.InterfaceName) && route.Interface == ifc.InterfaceObjName)
+ if ((!string.IsNullOrEmpty(ifc.InterfaceName) && route.Interface == ifc.InterfaceObjName)
|| ifc.CheckIfInterfaceIsGateway(route.Network))
{
ifc.Topology.Add(new ScreenOSCommand_Interface.Subnet(route.Network, route.Mask, route));
@@ -249,7 +249,7 @@ private void HandleDuplicatedAddressName()
else
{
_addressNamesOverZonesLookup.Add(addressName, new List { zoneName });
- }
+ }
}
}
@@ -329,7 +329,7 @@ public static IList AggregateCommands(this IEnumerable AggregateService(this IEnumerable AggregateGroupService(this IEnumerable source, ScreenOSCommand_GroupService groupServiceObj)
{
- IEnumerable> groups = source.GroupBy( i => i.GroupName );
+ IEnumerable> groups = source.GroupBy(i => i.GroupName);
return groups.FirstOrDefault(g => g.Key.Equals(groupServiceObj.GroupName)).ToList();
}
diff --git a/NetScreenMigration/ScreenOSPredefinedGroupServiceCPMap.csv b/NetScreenMigration/ScreenOSPredefinedGroupServiceCPMap.csv
index 9c69a288..ad035a85 100644
--- a/NetScreenMigration/ScreenOSPredefinedGroupServiceCPMap.csv
+++ b/NetScreenMigration/ScreenOSPredefinedGroupServiceCPMap.csv
@@ -1,4 +1,4 @@
DISCARD,discard
ECHO,echo
GNUTELLA,GNUtella
-NTP,ntp
\ No newline at end of file
+NTP,ntp
diff --git a/NetScreenMigration/ScreenOSPredefinedServiceGroups.csv b/NetScreenMigration/ScreenOSPredefinedServiceGroups.csv
index 1f169ff8..d1385392 100644
--- a/NetScreenMigration/ScreenOSPredefinedServiceGroups.csv
+++ b/NetScreenMigration/ScreenOSPredefinedServiceGroups.csv
@@ -3,4 +3,4 @@ MGCP,MGCP-CA,MGCP-UA
MS-AD,MS-AD-BR,MS-AD-DRSUAPI,MS-AD-DSROLE,MS-AD-DSSETUP
MS-EXCHANGE,MS-EXCHANGE-DATABASE,MS-EXCHANGE-DIRECTORY,MS-EXCHANGE-INFO-STORE,MS-EXCHANGE-MTA,MS-EXCHANGE-STORE,MS-EXCHANGE-SYSATD
MS-IIS,MS-IIS-COM,MS-IIS-IMAP4,MS-IIS-INETINFO,MS-IIS-NNTP,MS-IIS-POP3,MS-IIS-SMTP
-VOIP,H.323,MGCP-CA,MGCP-UA,SCCP,SIP
\ No newline at end of file
+VOIP,H.323,MGCP-CA,MGCP-UA,SCCP,SIP
diff --git a/NetScreenMigration/ScreenOSPredefinedServices.csv b/NetScreenMigration/ScreenOSPredefinedServices.csv
index 134ed992..2ae41796 100644
--- a/NetScreenMigration/ScreenOSPredefinedServices.csv
+++ b/NetScreenMigration/ScreenOSPredefinedServices.csv
@@ -110,7 +110,7 @@ MS-ISMSERV,MS-RPC,68dcd486-669e-11d1-ab0c-00c04fc2dcd2
MS-ISMSERV,MS-RPC,130ceefb-e466-11d1-b78b-00c04fa32883
MS-MESSENGER,MS-RPC,17fdd703-1827-4e34-79d4-24a55c53bb37
MS-MESSENGER,MS-RPC,5a7b91f8-ff00-11d0-a9b2-00c04fb6e6fc
-MS-MQQM,MS-RPC,fdb3a030-065f-11d1-bb9b-00a024ea5525
+MS-MQQM,MS-RPC,fdb3a030-065f-11d1-bb9b-00a024ea5525
MS-MQQM,MS-RPC,76d12b80-3467-11d3-91ff-0090272f9ea3
MS-MQQM,MS-RPC,1088a980-eae5-11d0-8d9b-00a02453c337
MS-MQQM,MS-RPC,5b5b3580-b0e0-11d1-b92d-0060081e87f0
diff --git a/NetScreenMigration/ScreenOSServiceObjects.cs b/NetScreenMigration/ScreenOSServiceObjects.cs
index 80c587a7..46b0aa36 100644
--- a/NetScreenMigration/ScreenOSServiceObjects.cs
+++ b/NetScreenMigration/ScreenOSServiceObjects.cs
@@ -209,7 +209,7 @@ public string DstPort
}
public override int Parse(ScreenOSCommand command, int baseParamIndex)
- {
+ {
base.Parse(command, baseParamIndex);
/* Get Ip protocol id if exist*/
@@ -246,7 +246,7 @@ public class ServiceProtocolObject_Udp : ServiceProtocolObject_Ip
public override int Parse(ScreenOSCommand command, int baseParamIndex)
{
- int index = base.Parse(command, baseParamIndex);
+ int index = base.Parse(command, baseParamIndex);
ProtocolType = ProtocolTypeEnum.Udp;
if (SrcPort != "any")
@@ -323,7 +323,7 @@ public override int Parse(ScreenOSCommand command, int baseParamIndex)
{
IcmpType = byte.Parse(command.GetParam(baseParamIndex + 1));
}
-
+
/* Code*/
if (command.GetParam(baseParamIndex + 2) == "code")
{
@@ -376,7 +376,7 @@ public override int Parse(ScreenOSCommand command, int baseParamIndex)
return baseParamIndex + 2;
}
- public override string ToCheckPointPortInfo(){ return Name().ToUpper() + "_" + Uuid;}
+ public override string ToCheckPointPortInfo() { return Name().ToUpper() + "_" + Uuid; }
}
public class ServiceProtocolObject_SunRPC : ServiceProtocolObject
@@ -408,7 +408,7 @@ public string Program
}
set
{
- string []programValue = value.Split('-');
+ string[] programValue = value.Split('-');
ProgramStart = programValue[0];
if (programValue.Length == 1)
{
@@ -445,7 +445,7 @@ public override int Parse(ScreenOSCommand command, int baseParamIndex)
ProgramEnd = _maxProgram.ToString();
}
- if(ProgramStart != ProgramEnd)
+ if (ProgramStart != ProgramEnd)
{
ConversionIncidentMessage = "ScreenOS SUN-RPC service object with program range is not supported in Check Point. Using only first program number in range";
}
diff --git a/PaloAltoMigration/PA_Apps_CP.csv b/PaloAltoMigration/PA_Apps_CP.csv
index 8ab1e3c0..205ca6aa 100644
--- a/PaloAltoMigration/PA_Apps_CP.csv
+++ b/PaloAltoMigration/PA_Apps_CP.csv
@@ -39,7 +39,7 @@ adobe-meeting-desktop-sharing;Adobe Connect-meeting-screen sharing;
adobe-meeting-uploading;Adobe Connect-meeting-file sharing;
adobe-meeting-file-transfer;Adobe Connect-meeting-file sharing;
adobe-meeting-remote-control;Adobe Connect-meeting-remote control;
-adobe-connectnow;;replacement of adobe connect
+adobe-connectnow;;replacement of adobe connect
adobe-connectnow-base;;
adobe-connectnow-file-transfer;;
adobe-connectnow-remote-control;;
@@ -2857,4 +2857,4 @@ zumodrive;ZumoDrive;
zwiki-editing;;
zynga-games;Zynga Games;
unknown-tcp;Unknown Traffic;
-unknown-udp;Unknown Traffic;
\ No newline at end of file
+unknown-udp;Unknown Traffic;
diff --git a/PaloAltoMigration/PA_Config.cs b/PaloAltoMigration/PA_Config.cs
index 6bf5f34b..ddb11af1 100644
--- a/PaloAltoMigration/PA_Config.cs
+++ b/PaloAltoMigration/PA_Config.cs
@@ -428,7 +428,7 @@ public class PA_NatRuleEntry : PA_EntryExt
public PA_DestinationTranslation DestinationTranslation { get; set; }
[XmlElement("dynamic-destination-translation")]
- public PA_DynamicDestinationTranslation DynamicDestinationTranslation { get;set;}
+ public PA_DynamicDestinationTranslation DynamicDestinationTranslation { get; set; }
[XmlElement("disabled")]
public string Disabled { get; set; }
diff --git a/PaloAltoMigration/PaloAltoConverter.cs b/PaloAltoMigration/PaloAltoConverter.cs
index ab757421..c80e008d 100644
--- a/PaloAltoMigration/PaloAltoConverter.cs
+++ b/PaloAltoMigration/PaloAltoConverter.cs
@@ -270,7 +270,7 @@ protected string RuleItemsList2Html_pa(List ruleItems, List" + subRule.Name + "");
file.WriteLine(" " + RuleItemsList2Html(subRule.Source, subRule.SourceNegated, CheckPointObject.Any, ref ruleConversionIncidentType) + " | ");
file.WriteLine(" " + RuleItemsList2Html(subRule.Destination, subRule.DestinationNegated, CheckPointObject.Any, ref ruleConversionIncidentType) + " | ");
-/* */ file.WriteLine(" " + RuleItemsList2Html_pa(subRule.Service, subRuleAppsList, false, CheckPointObject.Any, ref ruleConversionIncidentType) + " | ");
+ /* */
+ file.WriteLine(" " + RuleItemsList2Html_pa(subRule.Service, subRuleAppsList, false, CheckPointObject.Any, ref ruleConversionIncidentType) + " | ");
file.WriteLine(" " + subRule.Action.ToString() + " | ");
file.WriteLine(" " + RuleItemsList2Html(subRule.Time, false, CheckPointObject.Any, ref ruleConversionIncidentType) + " | ");
file.WriteLine(" " + subRule.Track.ToString() + " | ");
@@ -984,7 +985,7 @@ public override float Analyze()
}
RaiseConversionProgress(70, "Optimizing Firewall rulebase ...");
-
+
if (IsConsoleRunning)
{
Progress.SetProgress(100);
@@ -1094,7 +1095,7 @@ public void AnalyzePaVsysEntry(string targetFolderNew, string targetFileNameNew,
//if non-optimized convert method is used then all objects are added
- NewPaloAnalizStatistic._Package = Add_Optimized_Package();
+ NewPaloAnalizStatistic._Package = Add_Optimized_Package();
ExportManagmentReport(true);
@@ -1432,16 +1433,16 @@ public override Dictionary Convert(bool convertNat)
}
if (paConfig.Devices != null)
{
- if(paConfig.Devices.DevicesEntry != null && paConfig.Devices.DevicesEntry.Name.Equals(LOCAL_DEVICE_ENTRY_NAME)) //we parse PA config from PA
+ if (paConfig.Devices.DevicesEntry != null && paConfig.Devices.DevicesEntry.Name.Equals(LOCAL_DEVICE_ENTRY_NAME)) //we parse PA config from PA
{
- if(paConfig.Devices.DevicesEntry.Vsys != null &&
- paConfig.Devices.DevicesEntry.Vsys.VsysEntries != null &&
+ if (paConfig.Devices.DevicesEntry.Vsys != null &&
+ paConfig.Devices.DevicesEntry.Vsys.VsysEntries != null &&
paConfig.Devices.DevicesEntry.Vsys.VsysEntries.Count > 0)
{
if (paConfig.Devices.DevicesEntry.Vsys.VsysEntries.Count == 1)
{
ConvertPaVsysEntry(targetFolderMain, targetFileNameMain, paConfig.Devices.DevicesEntry.Vsys.VsysEntries[0],
- s_TagEntries,
+ s_TagEntries,
s_cpAddressesDict,
s_cpNetGroupsDict,
s_cpServicesDict,
@@ -1460,7 +1461,7 @@ public override Dictionary Convert(bool convertNat)
string targetFolderVsys = targetFolderMain + "\\" + paVsysName;
System.IO.Directory.CreateDirectory(targetFolderVsys);
ConvertPaVsysEntry(targetFolderVsys, paVsysName, paVsysEntry,
- s_TagEntries,
+ s_TagEntries,
s_cpAddressesDict,
s_cpNetGroupsDict,
s_cpServicesDict,
@@ -1528,13 +1529,13 @@ public override Dictionary Convert(bool convertNat)
}
public void ConvertPaVsysEntry(string targetFolderNew, string targetFileNameNew, PA_VsysEntry paVsysEntry,
- List s_TagEntries,
+ List s_TagEntries,
Dictionary s_cpAddressesDict,
Dictionary s_cpNetGroupsDict,
Dictionary s_cpServicesDict,
Dictionary s_paServicesTypesDict,
Dictionary s_cpServicesGroupsDict,
- List s_paAppFiltersList,
+ List s_paAppFiltersList,
Dictionary s_cpAppGroupsDict,
Dictionary> s_cpSchedulesDict)
{
@@ -1580,8 +1581,8 @@ public void ConvertPaVsysEntry(string targetFolderNew, string targetFileNameNew,
List paAppFiltersList = GetPAApplicationsFilters(paVsysEntry, s_paAppFiltersList);
- Dictionary cpAppGroupsDict =
- ConvertApplicationsGroups(new List(paVsysEntry.ApplicationGroupsEntries), appsMatchList, s_cpAppGroupsDict, paAppFiltersList, cpServicesGroupsDict);
+ Dictionary cpAppGroupsDict =
+ ConvertApplicationsGroups(new List(paVsysEntry.ApplicationGroupsEntries), appsMatchList, s_cpAppGroupsDict, paAppFiltersList, cpServicesGroupsDict);
Dictionary> cpSchedulesDict = null;
if (s_cpSchedulesDict != null)
@@ -1747,12 +1748,12 @@ public string InspectObjectName(string objName, string objType)
}
objNameNew = GetSafeName(objName);
- if(!objNameNew.Equals(objName))
+ if (!objNameNew.Equals(objName))
{
_warningsList.Add(objName + " " + objType.Trim() + " was renamed to " + objNameNew);
objName = objNameNew;
}
-
+
if (!_objectsNamesSet.Add(objName.ToLower()))
{
objNameNew = objName + "_" + _numPostfix++;
@@ -1799,9 +1800,9 @@ public Dictionary ConvertAddresses(PA_Objects paObject
else
cpAddressesDict = new Dictionary();
- if(paObjects.AddressEntries != null)
+ if (paObjects.AddressEntries != null)
{
- foreach(PA_AddressEntry paAddressEntry in paObjects.AddressEntries)
+ foreach (PA_AddressEntry paAddressEntry in paObjects.AddressEntries)
{
if (!string.IsNullOrWhiteSpace(paAddressEntry.IpNetmask))
{
@@ -1873,7 +1874,7 @@ public Dictionary ConvertAddresses(PA_Objects paObject
}
else
{
- cpDomain = (CheckPoint_Domain) (new List(cpAddressesDict.Values))[index];
+ cpDomain = (CheckPoint_Domain)(new List(cpAddressesDict.Values))[index];
}
cpAddressesDict[paAddressEntry.Name] = cpDomain;
}
@@ -1890,7 +1891,7 @@ public Dictionary ConvertAddressesGroups(PA_Obj
Dictionary cpAddressesGroupsDict = null;
if (s_cpNetGroupsDict != null)
cpAddressesGroupsDict = new Dictionary(s_cpNetGroupsDict);
- else
+ else
cpAddressesGroupsDict = new Dictionary();
@@ -1913,7 +1914,7 @@ public Dictionary ConvertAddressesGroups(PA_Obj
Dictionary> tagsToMembersDict = GetDictTagsToNames(paObjects, s_TagEntries, cpAddressesList, cpNetGrpList);
- if(paObjects.AddressGroupEntries != null)
+ if (paObjects.AddressGroupEntries != null)
{
foreach (PA_AddressGroupEntry paAddressGroupEntry in paObjects.AddressGroupEntries)
{
@@ -1926,11 +1927,11 @@ public Dictionary ConvertAddressesGroups(PA_Obj
{
cpNetGroup.Members = paAddressGroupEntry.StaticMembers;
}
- else if(paAddressGroupEntry.Dynamic != null && !string.IsNullOrWhiteSpace(paAddressGroupEntry.Dynamic.Filter))
+ else if (paAddressGroupEntry.Dynamic != null && !string.IsNullOrWhiteSpace(paAddressGroupEntry.Dynamic.Filter))
{
string adjustedFilter = paAddressGroupEntry.Dynamic.Filter.Trim('\'').Trim('"').Trim();
- if(tagsToMembersDict.ContainsKey(adjustedFilter))
+ if (tagsToMembersDict.ContainsKey(adjustedFilter))
{
cpNetGroup.Members = tagsToMembersDict[adjustedFilter];
}
@@ -1941,7 +1942,7 @@ public Dictionary ConvertAddressesGroups(PA_Obj
}
}
- if(cpNetGroup != null)
+ if (cpNetGroup != null)
{
cpAddressesGroupsDict[paAddressGroupEntry.Name] = cpNetGroup;
}
@@ -1951,7 +1952,7 @@ public Dictionary ConvertAddressesGroups(PA_Obj
return cpAddressesGroupsDict;
}
- public Dictionary> GetDictTagsToNames(PA_Objects paObjects, List s_TagEntries,
+ public Dictionary> GetDictTagsToNames(PA_Objects paObjects, List s_TagEntries,
List cpAddressesList, List cpNetGrpList)
{
Dictionary> tagsToNamesDict = new Dictionary>();
@@ -1997,12 +1998,12 @@ public Dictionary> GetDictTagsToNames(PA_Objects paObjects,
return tagsToNamesDict;
}
- public Dictionary ConvertAddressesGroupsWithInspection(PA_Objects paVsysEntry,
+ public Dictionary ConvertAddressesGroupsWithInspection(PA_Objects paVsysEntry,
Dictionary cpAddressesDict,
- Dictionary s_cpNetGroupsDict,
+ Dictionary s_cpNetGroupsDict,
List s_TagEntries)
{
- Dictionary cpNetGroupsList =
+ Dictionary cpNetGroupsList =
ConvertAddressesGroups(paVsysEntry, s_TagEntries, (new List(cpAddressesDict.Values)), s_cpNetGroupsDict);
Dictionary cpNetGroupsResult = InspectAddressGroups(cpAddressesDict, cpNetGroupsList, null);
@@ -2010,7 +2011,7 @@ public Dictionary ConvertAddressesGroupsWithIns
return cpNetGroupsResult;
}
- public Dictionary InspectAddressGroups(Dictionary cpAddressesNamesDict,
+ public Dictionary InspectAddressGroups(Dictionary cpAddressesNamesDict,
Dictionary cpNetGroupsCheck,
Dictionary cpNetGroupsTemp)
{
@@ -2086,7 +2087,7 @@ public List ConvertSchedules(PA_Objects paObjects)
{
for (int i = 0; i < paScheduleEntry.Type.Recurring.MembersDaily.Count; i += 3)
{
- List timesList =
+ List timesList =
paScheduleEntry.Type.Recurring.MembersDaily.GetRange(i, Math.Min(3, paScheduleEntry.Type.Recurring.MembersDaily.Count - i));
CheckPoint_Time cpTime = new CheckPoint_Time();
@@ -2328,7 +2329,7 @@ public CheckPoint_Time InspectCpScheduleName(CheckPoint_Time cpTime)
cpTimeName = cpTimeName.Substring(0, 5) + "_t" + _timeCutterCounter++;
}
- if(!_timesNamesSet.Add(cpTimeName))
+ if (!_timesNamesSet.Add(cpTimeName))
{
cpTimeName = cpTimeName.Substring(0, 5) + "_t" + _timeCutterCounter++;
}
@@ -2375,7 +2376,7 @@ public Dictionary GetServicesTypes(PA_Objects paObjects, Diction
return paServicesTypesDict;
}
- public Dictionary ConvertServices(PA_Objects paObjects, Dictionary s_cpServicesDict)
+ public Dictionary ConvertServices(PA_Objects paObjects, Dictionary s_cpServicesDict)
{
Dictionary cpServicesDict = null;
if (s_cpServicesDict != null)
@@ -2385,7 +2386,7 @@ public Dictionary ConvertServices(PA_Objects paObjects
GetPredefinedServices().ForEach(x => cpServicesDict[x.Name] = InspectService(x));
- if(paObjects.ServiceEntries != null)
+ if (paObjects.ServiceEntries != null)
{
foreach (PA_ServiceEntry paServiceEntry in paObjects.ServiceEntries)
{
@@ -2394,7 +2395,7 @@ public Dictionary ConvertServices(PA_Objects paObjects
if (paServiceEntry.Protocol.ServiceTcp != null && paServiceEntry.Protocol.ServiceTcp.Port != null)
{
string srvName = paServiceEntry.Name;
- if(!char.IsLetter(paServiceEntry.Name[0]))
+ if (!char.IsLetter(paServiceEntry.Name[0]))
{
srvName = SERVICE_TYPE_TCP + "_" + paServiceEntry.Name;
_warningsList.Add(paServiceEntry.Name + " service (TCP) was renamed to " + srvName);
@@ -2402,7 +2403,7 @@ public Dictionary ConvertServices(PA_Objects paObjects
string[] ports = paServiceEntry.Protocol.ServiceTcp.Port.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
string[] sourcePorts = new string[] { "" };
- if(paServiceEntry.Protocol.ServiceTcp.SourcePort != null)
+ if (paServiceEntry.Protocol.ServiceTcp.SourcePort != null)
{
sourcePorts = paServiceEntry.Protocol.ServiceTcp.SourcePort.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
}
@@ -2578,7 +2579,7 @@ public CheckPointObject InspectService(CheckPointObject cpService)
cpServiceRet = cpUdpService;
}
}
- else if(cpService.GetType() == typeof(CheckPoint_ServiceGroup))
+ else if (cpService.GetType() == typeof(CheckPoint_ServiceGroup))
{
cpServiceRet = cpService;
}
@@ -2598,9 +2599,9 @@ public Dictionary ConvertServicesGroups(PA_Obje
else
cpServicesGroupsDict = new Dictionary();
- if(paObjects.ServiceGroupEntries != null)
+ if (paObjects.ServiceGroupEntries != null)
{
- foreach(PA_ServiceGroupEntry paServiceGroupEntry in paObjects.ServiceGroupEntries)
+ foreach (PA_ServiceGroupEntry paServiceGroupEntry in paObjects.ServiceGroupEntries)
{
CheckPoint_ServiceGroup cpServiceGroup = new CheckPoint_ServiceGroup();
cpServiceGroup.Name = InspectObjectName(paServiceGroupEntry.Name, CP_OBJECT_TYPE_NAME_SERVICE_GROUP);
@@ -2626,11 +2627,11 @@ public Dictionary ConvertServicesGroupsWithInsp
return cpServicesGroupsResult;
}
- public void InspectServicesGroups(Dictionary cpServicesDict,
- Dictionary cpServicesGroupsCheck,
+ public void InspectServicesGroups(Dictionary cpServicesDict,
+ Dictionary cpServicesGroupsCheck,
Dictionary cpServicesGroupsResult)
{
- while(cpServicesGroupsCheck.Count > 0)
+ while (cpServicesGroupsCheck.Count > 0)
{
string paSrvGroupName = new List(cpServicesGroupsCheck.Keys)[0];
CheckPoint_ServiceGroup cpSrvGroupCheck = cpServicesGroupsCheck[paSrvGroupName];
@@ -2641,7 +2642,7 @@ public void InspectServicesGroups(Dictionary cpService
}
}
- public bool InspectServicesGroup(string paSrvGroupName,
+ public bool InspectServicesGroup(string paSrvGroupName,
CheckPoint_ServiceGroup cpServicesGroup,
Dictionary cpServicesDict,
Dictionary cpServicesGroupsCheck,
@@ -2664,14 +2665,14 @@ public bool InspectServicesGroup(string paSrvGroupName,
}
//group member is Services Group and converted already
- if(cpServicesGroupsResult.ContainsKey(member))
+ if (cpServicesGroupsResult.ContainsKey(member))
{
cpServicesGroupNew.Members.Add(cpServicesGroupsResult[member].Name);
continue;
}
//group member is Services Group and not converted yet
- if(cpServicesGroupsCheck.ContainsKey(member))
+ if (cpServicesGroupsCheck.ContainsKey(member))
{
CheckPoint_ServiceGroup cpSrvGroupNew = cpServicesGroupsCheck[member];
cpServicesGroupsCheck.Remove(member);
@@ -2751,7 +2752,7 @@ public Dictionary ConvertApplicationsGroups
foreach (string matchedValue in matchedValues)
{
if (!matchedValue.Trim().Equals(""))
- {
+ {
cpServiceGroup.Members.Add(matchedValue.Trim());
}
}
@@ -2803,9 +2804,9 @@ public List GetPAApplicationsFilters(PA_Objects paObjects, List
else
paAppFiltersList = new List();
- if(paObjects.ApplicationFiltersEntries != null)
+ if (paObjects.ApplicationFiltersEntries != null)
{
- foreach(PA_ApplicationFilterEntry paAppFilterEntry in paObjects.ApplicationFiltersEntries)
+ foreach (PA_ApplicationFilterEntry paAppFilterEntry in paObjects.ApplicationFiltersEntries)
{
paAppFiltersList.Add(paAppFilterEntry.Name);
}
@@ -2822,11 +2823,11 @@ public void ConvertSecurityPolicy(PA_VsysEntry paVsysEntry,
Dictionary cpZonesDict,
Dictionary cpAddressesDict,
Dictionary cpNetGroupsDict,
- Dictionary cpServicesDict,
+ Dictionary cpServicesDict,
Dictionary cpServicesGroupsDict,
List appsMatchList,
Dictionary cpAppGroupsDict,
- List paAppFiltersList,
+ List paAppFiltersList,
Dictionary> cpSchedulesDict,
Dictionary cpAccessRolesDict)
{
@@ -2924,9 +2925,9 @@ public void ConvertSecurityPolicy(PA_VsysEntry paVsysEntry,
if (isPolicyPlain && !paSecurityRuleEntry.FromList.Contains(PA_ANY_VALUE)
&& !(ConvertUserConf && paSecurityRuleEntry.SourceUserList != null && !paSecurityRuleEntry.SourceUserList.Contains(PA_ANY_VALUE)))
{
- paSecurityRuleEntry.FromList.ForEach(fromObj =>
+ paSecurityRuleEntry.FromList.ForEach(fromObj =>
{
- if(cpZonesDict.ContainsKey(fromObj))
+ if (cpZonesDict.ContainsKey(fromObj))
{
CheckPoint_Zone cpZone = cpZonesDict[fromObj];
cpRuleSourceList.Add(cpZone);
@@ -3153,7 +3154,7 @@ public void ConvertSecurityPolicy(PA_VsysEntry paVsysEntry,
}
}
- if(paSecurityRuleEntry.SourceList != null && !paSecurityRuleEntry.SourceList.Contains(PA_ANY_VALUE))
+ if (paSecurityRuleEntry.SourceList != null && !paSecurityRuleEntry.SourceList.Contains(PA_ANY_VALUE))
{
cpRuleSourceList.ForEach(x => cpAccessRole.Networks.Add(x.Name));
cpRuleSourceList.Clear();
@@ -3200,8 +3201,8 @@ public void ConvertSecurityPolicy(PA_VsysEntry paVsysEntry,
cpRuleNegateDestination,
cpAddressesDict,
cpNetGroupsDict,
- cpServicesDict,
- cpServicesGroupsDict,
+ cpServicesDict,
+ cpServicesGroupsDict,
cpAccessRolesList,
cpAppGroupsDict);
cpRule.Layer = cpPackage.ParentLayer.Name;
@@ -3307,7 +3308,7 @@ public void ConvertSecurityPolicy(PA_VsysEntry paVsysEntry,
}
}
- cpPackage.ParentLayer.Rules.ForEach(x =>
+ cpPackage.ParentLayer.Rules.ForEach(x =>
{
if (cpGroupRuleAppFiltering.ContainsKey(x.Name) && cpGroupRuleAppFiltering[x.Name])
x.ConversionComments = "Applications and URL filtering is enabled for layer.";
@@ -3339,7 +3340,7 @@ public void ConvertSecurityPolicy(PA_VsysEntry paVsysEntry,
AddCheckPointObject(cpPackage);
}
- private CheckPoint_RuleWithApplication CreateCpRule(PA_SecurityRuleEntry paSecurityRuleEntry,
+ private CheckPoint_RuleWithApplication CreateCpRule(PA_SecurityRuleEntry paSecurityRuleEntry,
List cpRuleSourceList,
List cpRuleDestinationList,
List cpRuleServiceList,
@@ -3352,8 +3353,8 @@ private CheckPoint_RuleWithApplication CreateCpRule(PA_SecurityRuleEntry paSecur
bool cpRuleNegateDestination,
Dictionary cpAddressesDict,
Dictionary cpNetGroupsDict,
- Dictionary cpServicesDict,
- Dictionary cpSrvGroupsDict,
+ Dictionary cpServicesDict,
+ Dictionary cpSrvGroupsDict,
List cpAccessRolesList,
Dictionary cpAppGroupsDict)
{
@@ -3397,7 +3398,7 @@ private CheckPoint_RuleWithApplication CreateCpRule(PA_SecurityRuleEntry paSecur
});
cpRule.Service.ForEach(x =>
{
- if(x.GetType() == typeof(CheckPoint_ServiceGroup))
+ if (x.GetType() == typeof(CheckPoint_ServiceGroup))
{
AddCpServiceGroup((CheckPoint_ServiceGroup)x, cpServicesDict, cpSrvGroupsDict);
}
@@ -3416,7 +3417,7 @@ private CheckPoint_RuleWithApplication CreateCpRule(PA_SecurityRuleEntry paSecur
}
cpRule.Application.ForEach(x =>
{
- if(x.GetType() == typeof(CheckPoint_ApplicationGroup))
+ if (x.GetType() == typeof(CheckPoint_ApplicationGroup))
{
AddCpApplicationGroup((CheckPoint_ApplicationGroup)x, cpAppGroupsDict);
}
@@ -3445,7 +3446,7 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
if (paVsysEntry.Rulebase != null && paVsysEntry.Rulebase.Nat != null && paVsysEntry.Rulebase.Nat.RulesList != null)
{
- foreach(PA_NatRuleEntry paNatRuleEntry in paVsysEntry.Rulebase.Nat.RulesList)
+ foreach (PA_NatRuleEntry paNatRuleEntry in paVsysEntry.Rulebase.Nat.RulesList)
{
List cpSourceTranslationList = new List();
bool isSourceTranslationExists = true;
@@ -3462,15 +3463,15 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
#region converting source translation to list; checking if NAT Rule Method should be Static
if (paNatRuleEntry.SourceTranslation != null)
{
- if(paNatRuleEntry.SourceTranslation.StaticIp != null)
+ if (paNatRuleEntry.SourceTranslation.StaticIp != null)
{
- if(!string.IsNullOrWhiteSpace(paNatRuleEntry.SourceTranslation.StaticIp.TranslatedAddress))
+ if (!string.IsNullOrWhiteSpace(paNatRuleEntry.SourceTranslation.StaticIp.TranslatedAddress))
{
- if(cpAddressesDict.ContainsKey(paNatRuleEntry.SourceTranslation.StaticIp.TranslatedAddress))
+ if (cpAddressesDict.ContainsKey(paNatRuleEntry.SourceTranslation.StaticIp.TranslatedAddress))
{
cpSourceTranslationList.Add(cpAddressesDict[paNatRuleEntry.SourceTranslation.StaticIp.TranslatedAddress]);
isNatRuleStatic = true;
- if(!string.IsNullOrWhiteSpace(paNatRuleEntry.SourceTranslation.StaticIp.IsBiDirectional)
+ if (!string.IsNullOrWhiteSpace(paNatRuleEntry.SourceTranslation.StaticIp.IsBiDirectional)
&& paNatRuleEntry.SourceTranslation.StaticIp.IsBiDirectional.ToLower().Equals("yes"))
{
isNatRuleBiDirectional = true;
@@ -3478,26 +3479,26 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
}
}
}
- else if(paNatRuleEntry.SourceTranslation.DynamicIp != null)
+ else if (paNatRuleEntry.SourceTranslation.DynamicIp != null)
{
- if(paNatRuleEntry.SourceTranslation.DynamicIp.TranslatedAddresses != null)
+ if (paNatRuleEntry.SourceTranslation.DynamicIp.TranslatedAddresses != null)
{
- foreach(string translatedAddress in paNatRuleEntry.SourceTranslation.DynamicIp.TranslatedAddresses)
+ foreach (string translatedAddress in paNatRuleEntry.SourceTranslation.DynamicIp.TranslatedAddresses)
{
if (cpAddressesDict.ContainsKey(translatedAddress))
{
cpSourceTranslationList.Add(cpAddressesDict[translatedAddress]);
}
- else if(cpNetGroupsDict.ContainsKey(translatedAddress))
+ else if (cpNetGroupsDict.ContainsKey(translatedAddress))
{
cpSourceTranslationList.Add(cpNetGroupsDict[translatedAddress]);
}
}
}
}
- else if(paNatRuleEntry.SourceTranslation.DynamicIpAndPort != null)
+ else if (paNatRuleEntry.SourceTranslation.DynamicIpAndPort != null)
{
- if(paNatRuleEntry.SourceTranslation.DynamicIpAndPort.TranslatedAddresses != null &&
+ if (paNatRuleEntry.SourceTranslation.DynamicIpAndPort.TranslatedAddresses != null &&
paNatRuleEntry.SourceTranslation.DynamicIpAndPort.TranslatedAddresses.Count > 0)
{
foreach (string translatedAddress in paNatRuleEntry.SourceTranslation.DynamicIpAndPort.TranslatedAddresses)
@@ -3525,7 +3526,7 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
cpHostNew.Name = "Host_" + ipAddress;
cpHostNew.IpAddress = ipAddress;
- cpAddressesDict[translatedAddress] = cpHostNew;
+ cpAddressesDict[translatedAddress] = cpHostNew;
cpSourceTranslationList.Add(cpHostNew);
_warningsList.Add(cpHostNew.Name + " host object is created for NAT rule.");
}
@@ -3540,7 +3541,7 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
cpNetworkNew.Name = "Net_" + ipAddress;
cpNetworkNew.Subnet = ipAddress;
cpNetworkNew.Netmask = ipNetwork.Netmask.ToString();
- cpAddressesDict[translatedAddress] = cpNetworkNew;
+ cpAddressesDict[translatedAddress] = cpNetworkNew;
cpSourceTranslationList.Add(cpNetworkNew);
_warningsList.Add(cpNetworkNew.Name + " network object is created for NAT rule.");
}
@@ -3548,12 +3549,12 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
}
}
}
- else if(paNatRuleEntry.SourceTranslation.DynamicIpAndPort.InterfaceAddress != null)
+ else if (paNatRuleEntry.SourceTranslation.DynamicIpAndPort.InterfaceAddress != null)
{
string intfAddrIP = paNatRuleEntry.SourceTranslation.DynamicIpAndPort.InterfaceAddress.Ip;
- if(!string.IsNullOrWhiteSpace(intfAddrIP))
+ if (!string.IsNullOrWhiteSpace(intfAddrIP))
{
- if(cpAddressesDict.ContainsKey(intfAddrIP))
+ if (cpAddressesDict.ContainsKey(intfAddrIP))
{
cpSourceTranslationList.Add(cpAddressesDict[intfAddrIP]);
}
@@ -3580,7 +3581,7 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
}
}
- if(cpSourceTranslationList.Count == 0)
+ if (cpSourceTranslationList.Count == 0)
{
isSourceTranslationExists = false;
// createing Dummy Object because we need to have at least 1 element in cpSourceTranslationList for creating NAT rule
@@ -3588,7 +3589,7 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
}
#endregion
- if(paNatRuleEntry.DestinationTranslation == null)
+ if (paNatRuleEntry.DestinationTranslation == null)
{
isDestinationTranslationNone = true;
}
@@ -3753,7 +3754,7 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
if (isSourceTranslationExists)
{
cpNatRule.TranslatedSource = cpSourceTranslation;
- if(isNatRuleStatic)
+ if (isNatRuleStatic)
{
cpNatRule.Method = CheckPoint_NAT_Rule.NatMethod.Static;
}
@@ -3926,22 +3927,22 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
cpNatRule.TranslatedDestination = cpNetGroupsDict[paNatRuleEntry.DynamicDestinationTranslation.TranslatedAddress];
}
- if(!string.IsNullOrWhiteSpace(paNatRuleEntry.DynamicDestinationTranslation.TranslatedPort))
+ if (!string.IsNullOrWhiteSpace(paNatRuleEntry.DynamicDestinationTranslation.TranslatedPort))
{
- if(!string.IsNullOrWhiteSpace(paNatRuleEntry.Service))
+ if (!string.IsNullOrWhiteSpace(paNatRuleEntry.Service))
{
if (cpServicesDict.ContainsKey(paNatRuleEntry.Service))
{
CheckPointObject cpService = cpServicesDict[paNatRuleEntry.Service];
- if(cpService.GetType() == typeof(CheckPoint_TcpService))
+ if (cpService.GetType() == typeof(CheckPoint_TcpService))
{
cpNatRule.TranslatedService = CreateNatServiceTcpFromDynDest(paNatRuleEntry);
}
- else if(cpService.GetType() == typeof(CheckPoint_UdpService))
+ else if (cpService.GetType() == typeof(CheckPoint_UdpService))
{
cpNatRule.TranslatedService = CreateNatServiceUdpFromDynDest(paNatRuleEntry);
}
- else if(cpService.GetType() == typeof(CheckPoint_PredifinedObject) && paServicesTypesDict.ContainsKey(paNatRuleEntry.Service))
+ else if (cpService.GetType() == typeof(CheckPoint_PredifinedObject) && paServicesTypesDict.ContainsKey(paNatRuleEntry.Service))
{
string servicesType = paServicesTypesDict[paNatRuleEntry.Service];
if (servicesType.Trim().ToUpper().Equals("TCP"))
@@ -4022,12 +4023,12 @@ public void ConvertNatPolicy(PA_VsysEntry paVsysEntry,
if (messagesE.Count == 0)
{
- if(!(cpNatRule.Source is CheckPoint_Domain) &&
+ if (!(cpNatRule.Source is CheckPoint_Domain) &&
!(cpNatRule.Destination is CheckPoint_Domain) &&
!(cpNatRule.TranslatedSource is CheckPoint_Domain) &&
!(cpNatRule.TranslatedDestination is CheckPoint_Domain))
{
- if(isNatRuleBiDirectional && isDestinationTranslationNone)
+ if (isNatRuleBiDirectional && isDestinationTranslationNone)
{
//TRANS DEST == NONE
// orig source <- orig destin
@@ -4149,9 +4150,9 @@ public CheckPointObject CreateNatServiceUdpFromDynDest(PA_NatRuleEntry paNatRule
}
public void GetServicesTypesFromServicesGroup(
- CheckPoint_ServiceGroup cpSrvGroup,
- List cpServicesGroups,
- List cpServices,
+ CheckPoint_ServiceGroup cpSrvGroup,
+ List cpServicesGroups,
+ List cpServices,
out bool isTcpSrv, out bool isUdpSrv)
{
isTcpSrv = false;
@@ -4160,7 +4161,7 @@ public void GetServicesTypesFromServicesGroup(
foreach (string cpSrvMember in cpSrvGroup.Members)
{
CheckPointObject cpSrv = cpServices.Find(x => x.Name.Equals(cpSrvMember));
- if(cpSrv != null)
+ if (cpSrv != null)
{
if (cpSrv.GetType() == typeof(CheckPoint_TcpService))
isTcpSrv = true;
@@ -4171,7 +4172,7 @@ public void GetServicesTypesFromServicesGroup(
}
CheckPoint_ServiceGroup cpSrvGrp = cpServicesGroups.Find(x => x.Name.Equals(cpSrvMember));
- if(cpSrvGrp != null)
+ if (cpSrvGrp != null)
{
GetServicesTypesFromServicesGroup(cpSrvGrp, cpServicesGroups, cpServices, out isTcpSrv, out isUdpSrv);
}
@@ -4179,9 +4180,9 @@ public void GetServicesTypesFromServicesGroup(
}
public void GetServicesGroupsFromServiceGroup(
- CheckPoint_ServiceGroup cpSrvGroup,
- List cpServicesGroups,
- List cpServices,
+ CheckPoint_ServiceGroup cpSrvGroup,
+ List cpServicesGroups,
+ List cpServices,
List cpSrvGrpMembersTcp,
List cpSrvGrpMembersUdp)
{
@@ -4201,11 +4202,11 @@ public void GetServicesGroupsFromServiceGroup(
else if (cpSrv.GetType() == typeof(CheckPoint_PredifinedObject) && cpPredefServicesTypes.ContainsKey(cpSrv.Name))
{
string srvType = cpPredefServicesTypes[cpSrv.Name].ToLower();
- if(srvType.Equals(SERVICE_TYPE_TCP.ToLower()))
+ if (srvType.Equals(SERVICE_TYPE_TCP.ToLower()))
{
cpSrvGrpMembersTcp.Add(cpSrv);
}
- else if(srvType.Equals(SERVICE_TYPE_UDP.ToLower()))
+ else if (srvType.Equals(SERVICE_TYPE_UDP.ToLower()))
{
cpSrvGrpMembersUdp.Add(cpSrv);
}
@@ -4225,12 +4226,12 @@ public void GetServicesGroupsFromServiceGroup(
#region Utility methods
- public void AddCpApplicationGroup(CheckPoint_ApplicationGroup cpAppGrp,
+ public void AddCpApplicationGroup(CheckPoint_ApplicationGroup cpAppGrp,
Dictionary cpAppGroupsDict)
{
- foreach(string member in cpAppGrp.Members)
+ foreach (string member in cpAppGrp.Members)
{
- if(cpAppGroupsDict.ContainsKey(member))
+ if (cpAppGroupsDict.ContainsKey(member))
{
AddCpApplicationGroup(cpAppGroupsDict[member], cpAppGroupsDict);
}
@@ -4238,17 +4239,17 @@ public void AddCpApplicationGroup(CheckPoint_ApplicationGroup cpAppGrp,
AddCheckPointObject(cpAppGrp);
}
- public void AddCpNetworkGroup(CheckPoint_NetworkGroup cpNetGroup,
- Dictionary cpAddressesDict,
+ public void AddCpNetworkGroup(CheckPoint_NetworkGroup cpNetGroup,
+ Dictionary cpAddressesDict,
Dictionary cpNetGroupsDict)
{
- foreach(string member in cpNetGroup.Members)
+ foreach (string member in cpNetGroup.Members)
{
- if(cpAddressesDict.ContainsKey(member))
+ if (cpAddressesDict.ContainsKey(member))
{
AddCheckPointObject(cpAddressesDict[member]);
}
- else if(cpNetGroupsDict.ContainsKey(member))
+ else if (cpNetGroupsDict.ContainsKey(member))
{
AddCpNetworkGroup(cpNetGroupsDict[member], cpAddressesDict, cpNetGroupsDict);
AddCheckPointObject(cpNetGroupsDict[member]);
@@ -4282,7 +4283,7 @@ public void AddCpServiceGroup(CheckPoint_ServiceGroup cpSrvGroup,
}
}
if (!infiniteRecursion)
- AddCpServiceGroup(cpSrvGroupsDict[member], cpServicesDict, cpSrvGroupsDict);
+ AddCpServiceGroup(cpSrvGroupsDict[member], cpServicesDict, cpSrvGroupsDict);
AddCheckPointObject(cpSrvGroupsDict[member]);
}
}
diff --git a/PaloAltoMigration/PaloAltoMigration.csproj b/PaloAltoMigration/PaloAltoMigration.csproj
index 509bb17b..58dc29d2 100644
--- a/PaloAltoMigration/PaloAltoMigration.csproj
+++ b/PaloAltoMigration/PaloAltoMigration.csproj
@@ -78,11 +78,11 @@
-
-
\ No newline at end of file
+
diff --git a/PaloAltoMigration/PanoramaAnalizStatistic.cs b/PaloAltoMigration/PanoramaAnalizStatistic.cs
index e6278da1..2c32a44b 100644
--- a/PaloAltoMigration/PanoramaAnalizStatistic.cs
+++ b/PaloAltoMigration/PanoramaAnalizStatistic.cs
@@ -140,4 +140,4 @@ public override void CalculateServices(List _cpTcpService
_unusedServicesObjectsCount = vs.Count();
}
}
-}
\ No newline at end of file
+}
diff --git a/PaloAltoMigration/PanoramaConverter.cs b/PaloAltoMigration/PanoramaConverter.cs
index d94c12d7..065bec08 100644
--- a/PaloAltoMigration/PanoramaConverter.cs
+++ b/PaloAltoMigration/PanoramaConverter.cs
@@ -1062,7 +1062,7 @@ public Dictionary> getZones(Panorama_Config paConfig)
List templatesList = new List();
foreach (string template in paTemplateStackEntry.StackTemplatesMembers)
{
- templatesList.Add(template);
+ templatesList.Add(template);
}
foreach (PA_DevicesTemplateStackEntry device in paTemplateStackEntry.DevicesEntries)
{
@@ -1245,7 +1245,7 @@ public override float Analyze()
List devicesGroupList = new List();
devicesGroupList.AddRange(FWGroup_List);
- Dictionary s_cpNetGroupsDict_Global = new Dictionary();//to avoid duplication of device groups
+ Dictionary s_cpNetGroupsDict_Global = new Dictionary();//to avoid duplication of device groups
s_cpNetGroupsDict_Global = s_cpNetGroupsDict_Global.Concat(s_cpNetGroupsDict.Where(x => !s_cpNetGroupsDict_Global.ContainsKey(x.Key))).ToDictionary(x => x.Key, x => x.Value);
foreach (CheckPoint_NetworkGroup FWGroup in FWGroup_List)
@@ -1278,7 +1278,7 @@ public override float Analyze()
devicesGroupList,
_devicesUIDDict
);
- s_cpNetGroupsDict.Clear();//to avoid duplication of device groups
+ s_cpNetGroupsDict.Clear();//to avoid duplication of device groups
s_cpNetGroupsDict = s_cpNetGroupsDict.Concat(s_cpNetGroupsDict_Global.Where(x => !s_cpNetGroupsDict.ContainsKey(x.Key))).ToDictionary(x => x.Key, x => x.Value);
}
@@ -1470,7 +1470,7 @@ Dictionary _devicesUIDDict
}
public override Dictionary Convert(bool convertNat)
- {
+ {
string targetFileNameMain = _vendorFileName;
string targetFolderMain = _targetFolder;
@@ -1489,7 +1489,7 @@ public override Dictionary Convert(bool convertNat)
Dictionary _devicesUIDDict = GetDevicesUIDdict(_paParser._ArchiveName);
if (paConfig != null)
- {
+ {
List s_TagEntries = new List();
Dictionary s_cpAddressesDict = null;
Dictionary s_cpNetGroupsDict = null;
@@ -1500,7 +1500,7 @@ public override Dictionary Convert(bool convertNat)
Dictionary s_cpAppGroupsDict = null;
Dictionary> s_cpSchedulesDict = null;
PA_PreRulebase s_preRulebase = null;
- PA_PostRulebase s_postRulebase = null;
+ PA_PostRulebase s_postRulebase = null;
if (paConfig.Shared != null)
{
@@ -1536,7 +1536,7 @@ public override Dictionary Convert(bool convertNat)
});
s_preRulebase = paConfig.Shared.PreRulebase;
- s_postRulebase = paConfig.Shared.PostRulebase;
+ s_postRulebase = paConfig.Shared.PostRulebase;
}
if (paConfig.Devices != null)
{
@@ -1595,13 +1595,13 @@ public override Dictionary Convert(bool convertNat)
List devicesGroupList = new List();
devicesGroupList.AddRange(FWGroup_List);
- Dictionary s_cpNetGroupsDict_Global = new Dictionary();//to avoid duplication of device groups
+ Dictionary s_cpNetGroupsDict_Global = new Dictionary();//to avoid duplication of device groups
s_cpNetGroupsDict_Global = s_cpNetGroupsDict_Global.Concat(s_cpNetGroupsDict.Where(x => !s_cpNetGroupsDict_Global.ContainsKey(x.Key))).ToDictionary(x => x.Key, x => x.Value);
foreach (CheckPoint_NetworkGroup FWGroup in FWGroup_List)
{
if (s_cpNetGroupsDict != null)
- {
+ {
if (!s_cpNetGroupsDict.ContainsKey(FWGroup.Name))
s_cpNetGroupsDict.Add(FWGroup.Name, FWGroup);
}
@@ -1628,7 +1628,7 @@ public override Dictionary Convert(bool convertNat)
devicesGroupList,
_devicesUIDDict
);
- s_cpNetGroupsDict.Clear();//to avoid duplication of device groups
+ s_cpNetGroupsDict.Clear();//to avoid duplication of device groups
s_cpNetGroupsDict = s_cpNetGroupsDict.Concat(s_cpNetGroupsDict_Global.Where(x => !s_cpNetGroupsDict.ContainsKey(x.Key))).ToDictionary(x => x.Key, x => x.Value);
}
@@ -1689,7 +1689,7 @@ public override Dictionary Convert(bool convertNat)
///
/// Creates network group object for panorama device group
- ///
+ ///
public List getPanoramaDeviceGroup(PA_DeviceGroupEntry deviceGroupEntry, Dictionary _devicesUIDDict)
{
List devices = deviceGroupEntry.DevicesGroupDevicesEntries;
@@ -1703,11 +1703,11 @@ public List getPanoramaDeviceGroup(PA_DeviceGroupEntry
string deviceName = null;
if (_devicesUIDDict.ContainsKey(deviceEntry.Name))
{
- deviceName = _devicesUIDDict[deviceEntry.Name];
+ deviceName = _devicesUIDDict[deviceEntry.Name];
}
FWGroup = new CheckPoint_NetworkGroup();
- FWGroup.Name = "FW_" + deviceName;
+ FWGroup.Name = "FW_" + deviceName;
FWGroup.IsPanoramaDeviceGroup = true;
foreach (PA_TagEntry tagEntry in tags)
{
@@ -1773,7 +1773,7 @@ Dictionary _devicesUIDDict
Dictionary cpAddressesDict = ConvertAddresses(paDeviceGroupEntry, s_cpAddressesDict);
- Dictionary cpNetGroupsDict = ConvertAddressesGroupsWithInspection(paDeviceGroupEntry, cpAddressesDict, s_cpNetGroupsDict, s_TagEntries);
+ Dictionary cpNetGroupsDict = ConvertAddressesGroupsWithInspection(paDeviceGroupEntry, cpAddressesDict, s_cpNetGroupsDict, s_TagEntries);
Dictionary cpServicesDict = ConvertServices(paDeviceGroupEntry, s_cpServicesDict);
@@ -1845,7 +1845,7 @@ Dictionary _devicesUIDDict
AddCheckPointObject(x);
}
});
-
+
(new List(cpServicesGroupsDict.Values)).ForEach(x => AddCheckPointObject(x));
(new List(cpAppGroupsDict.Values)).ForEach(x => AddCheckPointObject(x));
(new List>(cpSchedulesDict.Values)).ForEach(x => x.ForEach(y => AddCheckPointObject(y)));
@@ -1879,7 +1879,7 @@ Dictionary _devicesUIDDict
_warningsConvertedPackage += _warningsList.Count;
_errorsConvertedPackage += _errorsList.Count;
- if(CreateManagnetReport) ExportManagmentReport();
+ if (CreateManagnetReport) ExportManagmentReport();
if (!_isOverMaxLengthPackageName)
{
@@ -2009,7 +2009,7 @@ public Dictionary ConvertZones(List zoneE
#region Convert Addresses and Addresses Groups
public Dictionary ConvertAddresses(PA_Objects paObjects, Dictionary s_cpAddressesDict)
- {
+ {
Dictionary cpAddressesDict = null;
if (s_cpAddressesDict != null)
cpAddressesDict = new Dictionary(s_cpAddressesDict);
@@ -2082,16 +2082,16 @@ public Dictionary ConvertAddresses(PA_Objects paObject
CheckPoint_Domain cpDomain = null;
if (index == -1)
{
- cpDomain = new CheckPoint_Domain();
- cpDomain.Name = "." + paAddressEntry.Fqdn;
+ cpDomain = new CheckPoint_Domain();
+ cpDomain.Name = "." + paAddressEntry.Fqdn;
cpDomain.Comments = paAddressEntry.Description;
- cpDomain.Tags = paAddressEntry.TagMembers;
+ cpDomain.Tags = paAddressEntry.TagMembers;
}
else
{
cpDomain = (CheckPoint_Domain)(new List(cpAddressesDict.Values))[index];
}
- cpAddressesDict[paAddressEntry.Name] = cpDomain;
+ cpAddressesDict[paAddressEntry.Name] = cpDomain;
}
}
}
@@ -2123,7 +2123,7 @@ Dictionary s_cpNetGroupsDict
cpNetGroup.Name = paAddressGroupEntry.Name;
cpNetGroup.Comments = paAddressGroupEntry.Description;
cpNetGroup.Tags = paAddressGroupEntry.TagMembers;
- cpNetGrpList.Add(cpNetGroup);
+ cpNetGrpList.Add(cpNetGroup);
}
}
@@ -2134,9 +2134,9 @@ Dictionary s_cpNetGroupsDict
foreach (PA_AddressGroupEntry paAddressGroupEntry in paObjects.AddressGroupEntries)
{
CheckPoint_NetworkGroup cpNetGroup = new CheckPoint_NetworkGroup();
-
+
cpNetGroup.Name = InspectObjectName(GetSafeName(paAddressGroupEntry.Name), CP_OBJECT_TYPE_NAME_ADDRESS_GROUP);
-
+
cpNetGroup.Comments = paAddressGroupEntry.Description;
cpNetGroup.Tags = paAddressGroupEntry.TagMembers;
@@ -2203,9 +2203,9 @@ public Dictionary> GetDictTagsToNames(PA_Objects paObjects,
if (cpNetGrpList != null)
{
foreach (CheckPoint_NetworkGroup cpAddressGroupEntry in cpNetGrpList)
- {
+ {
if (cpAddressGroupEntry.Tags.Contains(paTagEntry.Name))
- {
+ {
namesList.Add(cpAddressGroupEntry.Name);
}
}
@@ -2227,7 +2227,7 @@ List s_TagEntries
if (s_cpNetGroupsDict == null)
{
- return cpNetGroupsDict;//don't inspect address groups from shared section because they will be inspected further while device-group processing
+ return cpNetGroupsDict;//don't inspect address groups from shared section because they will be inspected further while device-group processing
}
else
{
@@ -2242,7 +2242,7 @@ List s_TagEntries
public Dictionary InspectAddressGroups(Dictionary cpAddressesNamesDict,
Dictionary cpNetGroupsCheck,
Dictionary