@@ -1848,26 +1848,59 @@ private void Add_InterfacesAndRoutes()
18481848
18491849 foreach ( Cisco_Interface . Subnet subnet in ciscoInterface . Topology )
18501850 {
1851- // Note, that a subnet can be a host in Cisco, but we want to always convert to network in CP!!!
1852- string networkName = ( new CiscoNetwork ( ciscoInterface . Id , subnet . Network , subnet . Netmask ) ) . AutoGeneratedNetworkName ( ) ;
1853- if ( networkName . Contains ( AutoGeneratedNameWithError ) )
1851+
1852+
1853+ // Note, that a subnet can be a host in Cisco, but we want to always convert to network in CP!!!
1854+ string networkName = ( new CiscoNetwork ( ciscoInterface . Id , subnet . Network , subnet . Netmask ) ) . AutoGeneratedNetworkName ( ) ;
1855+ if ( networkName . Contains ( AutoGeneratedNameWithError ) )
1856+ {
1857+ ciscoInterface . ConversionIncidentType = ConversionIncidentType . ManualActionRequired ;
1858+ ciscoInterface . ConversionIncidentMessage = "Unrecognized topology details." ;
1859+
1860+
1861+ ciscoCommandIdWithIncident = ciscoInterface . Id ;
1862+ }
1863+ if ( subnet . Netmask == "255.255.255.255" )
18541864 {
1855- ciscoInterface . ConversionIncidentType = ConversionIncidentType . ManualActionRequired ;
1856- ciscoInterface . ConversionIncidentMessage = "Unrecognized topology details: " + subnet . Network + " " + subnet . Netmask + "." ;
18571865
1858- ciscoCommandIdWithIncident = ciscoInterface . Id ;
1859- }
1866+ //string errorDesc = ciscoCommand.Name() + " details: " + ciscoObject + ".";
1867+ string conversionIncidentMessage = "Unrecognized topology details: " + subnet . Network + " " + subnet . Netmask + "." ;
1868+ _conversionIncidents . Add ( new ConversionIncident ( subnet . LineId ,
1869+ conversionIncidentMessage ,
1870+ "cannot create network objects" ,
1871+ ConversionIncidentType . ManualActionRequired ) ) ;
1872+ string networkErrorName = ( new CiscoNetwork ( subnet . LineId , subnet . Network , subnet . Netmask ) ) . AutoGeneratedNetworkName ( ) ;
1873+ foreach ( CiscoCommand ciscoCommand in CiscoAllCommands )
1874+ {
1875+ if ( ciscoCommand . Id == subnet . LineId )
1876+ {
1877+ ciscoCommand . ConversionIncidentMessage = conversionIncidentMessage ;
1878+ ciscoCommand . ConversionIncidentType = ConversionIncidentType . ManualActionRequired ;
1879+ }
1880+ }
18601881
1861- var cpNetwork = new CheckPoint_Network ( ) ;
1862- cpNetwork . Name = networkName ;
1863- cpNetwork . Name = cpNetwork . SafeName ( ) ;
1864- cpNetwork . Subnet = subnet . Network ;
1865- cpNetwork . Netmask = subnet . Netmask ;
1866- AddCheckPointObject ( cpNetwork ) ;
1882+ var cpNetworkError = new CheckPoint_Network ( ) ;
1883+ cpNetworkError . Name = networkErrorName ;
1884+ cpNetworkError . Name = cpNetworkError . SafeName ( ) ;
1885+ cpNetworkError . Subnet = subnet . Network ;
1886+ cpNetworkError . Netmask = subnet . Netmask ;
1887+ AddCheckPointObject ( cpNetworkError ) ;
1888+ //continue;
1889+ } else
1890+ {
18671891
1868- cpNetworkGroup . Members . Add ( cpNetwork . Name ) ;
1869- }
1892+ var cpNetwork = new CheckPoint_Network ( ) ;
1893+ cpNetwork . Name = networkName ;
1894+ cpNetwork . Name = cpNetwork . SafeName ( ) ;
1895+ cpNetwork . Subnet = subnet . Network ;
1896+ cpNetwork . Netmask = subnet . Netmask ;
1897+ AddCheckPointObject ( cpNetwork ) ;
1898+
1899+ cpNetworkGroup . Members . Add ( cpNetwork . Name ) ;
1900+ }
18701901
1902+
1903+ }
18711904 ApplyConversionIncidentOnCheckPointObject ( cpNetworkGroup , ciscoInterface ) ;
18721905 AddCheckPointObject ( cpNetworkGroup ) ;
18731906
0 commit comments