# GF17 to SBTS17 migration: MNL product

#NIDD_VER: MNL17_1701_004_00
# History
# v0.1 27.12.2016 Ioan Harangus: first draft for new CUTool
# v0.2 10.04.2017 Ioan Harangus: pronto 232831, 232781, 232761: PMCADM, PMMNL removal, same ANTL for all LCELCs,
# v0.3 11.04.2017 Ioan Harangus: pronto 233191, 233966: SYNC not migrated, FMCADM
# v0.4 18.04.2017 Ioan Harangus: pronto 234634: MPLANENW, optionals not needed to be created
# v0.5 02.05.2017 Ioan Harangus: TOPP not exist in GF16 to be deleted
# v0.6 02.05.2017 Ioan Harangus: PR233191: TOP/TOPF added again, ethlkDN coded for SYNCE case
# v0.7 14.05.2017 Ioan Harangus: PRxxxxx: PDH priorities implementation
# v0.8 14.05.2017 Ioan Harangus: PRxxxxx: SYNCE priorities implementation
# v0.9 25.05.2017 Ioan Harangus: PR245914: SYNCE class is not created, some parameters have wrong values under SYNC class
# v0.10 25.10.2017 Ioan Harangus: PR2288965 ETHLK wrong corrected to 1xy

# define global constants
define "operation" "create"
define "version" "MNL17_1701_004"
define "adaptation" "com.nokia.srbts.mnl"

# abort rule-set in case of unexpected SCF version

if ( objects_count "BCF/MRBTS/BTSSCC/BTSSCG/BTSNE" ) == 0 abort_file

for_objects "BCF/MRBTS/BTSSCC/BTSSCG/BTSNE"
	begin
		if not ( get_version $current_dist_name ) == "GF17"
			abort_file
		define "bcfId" $current_BCF
	end

define "mrbtsId" 1
define "oamPeerIpAddress" "0.0.0.0"	

for_objects "BCF/MRBTS/BTSSCC/BTSSCG/BTSNE"
    begin
        if ( param_exist $current_dist_name "installationNotes" )
            begin
                define "value" get_param $current_dist_name "installationNotes"
                define "tempValue" replace value "(\D+)" "" flags "g"
                if ( tempValue ) != "" && ( tempValue >= 0 ) && ( tempValue <= 1048575 )
                    begin
                        define "mrbtsId" tempValue
                    end
            end

       if ( param_exist $current_dist_name "installationPerson" )     
           begin
                define "valueIp" get_param $current_dist_name "installationPerson"
                define "valueIpTemp" replace valueIp "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" "" flags "g"
                if ( valueIpTemp ) == ""
                    begin
                        define "oamPeerIpAddress" valueIp
                    end
           end
    end

define "mrbtsDN" "BCF-" JOIN bcfId JOIN "/MRBTS-1"
define "mrbtsRoot" "MRBTS-" JOIN mrbtsId
define "eqmDn" mrbtsRoot JOIN "/EQM-1"

define "btsccDN" mrbtsDN JOIN "/BTSSCC-1"
define "btsccgDN" btsccDN JOIN "/BTSSCG-1"
define "treneDN" btsccgDN JOIN "/TRENE-1"

define "tnlsvcDN" mrbtsRoot JOIN "/TNLSVC-1"
define "tnlDN" tnlsvcDN JOIN "/TNL-1"

define "smodDn" mrbtsRoot JOIN "/EQM-1/APEQM-1/CABINET-1/SMOD-1"

define "tnlsvcDN" mrbtsRoot JOIN "/TNLSVC-" JOIN 1
define "tnlDN" tnlsvcDN JOIN "/TNL-" JOIN 1
define "ethsvcDN" tnlDN JOIN "/ETHSVC-1"

define "ethlkDN" ethsvcDN JOIN "/ETHLK-AA"

# MNL MOI

define "mnlDn" mrbtsRoot JOIN "/MNL-1"
define "mnlentDn" mnlDn JOIN "/MNLENT-1"
if ( objects_count "TNLSVC" ) == 0 add_object mnlDn

# MNLENT MOI
#SYNCE has all params not used
for_objects "MRBTS/MNL"
	begin
		set_version $current_dist_name version		
		add_object mnlentDn
		
		define "amgrDn" $current_dist_name JOIN "/AMGR-1"
		add_object amgrDn

		add_param amgrDn "checkCnumPasswdExpiry" "false"		
		
		define "luacDn" amgrDn JOIN "/LUAC-1"
		add_object luacDn		
		
		add_param mnlDn "cmSyncCheckPeriod" 15
		add_param mnlDn "validatePlanAgainstDetectedHW" "false"
	end

for_objects "MRBTS/MNL/AMGR/LUAC"
	begin
		add_param luacDn "btsFailedLoginCountingPeriod" 5		
		add_param luacDn "btsSessionLoginDelay" 1		
		add_param luacDn "localPasswdExpiryPeriod" 0		
		add_param luacDn "localPasswdWarningPeriod" 0	
		add_param luacDn "btsMaxFailedLoginAttempts" 5	
		add_param luacDn "btsAccountLockoutDuration" 15			
	end

# TRBLCADM MOI
for_objects "MNL/MNLENT"
	begin				
	# CELLMAPPING, LCELC implemented in EQM file	
		define "featcadmDn" $current_dist_name JOIN "/FEATCADM-1"
		add_object featcadmDn

		define "mplanenwDn" $current_dist_name JOIN "/MPLANENW-1"
		add_object mplanenwDn

		define "certhDn" $current_dist_name JOIN "/CERTH-1"
		add_object certhDn
		
# PMCADM null for gsm		

		define "secadmDn" $current_dist_name JOIN "/SECADM-1"
		add_object secadmDn
		
		define "fmcadmDn" $current_dist_name JOIN "/FMCADM-1"
		add_object fmcadmDn	

		define "bbadmDn" $current_dist_name JOIN "/BBADM-1"
		add_object bbadmDn
		
		define "capadmDn" $current_dist_name JOIN "/CAPADM-1"
		add_object capadmDn
		
		define "capcfgDn" capadmDn JOIN "/CAPCFG-1"
		add_object capcfgDn
	end	
	
#TRBLCADM null for gsm	not mandatory 	

# CAPLIM N/A in GSM migration rules
# LCELC created in EQM
	
#CERTH skip for GSM Migration
for_objects "MNL/MNLENT/CERTH"
	begin
		add_param $current_dist_name "cmpCrlSrcIpAddressDN" ""
		add_object $current_dist_name JOIN "/CMP-1"
		add_object $current_dist_name JOIN "/CRLH-1"
		
		add_param $current_dist_name JOIN "/CMP-1" "caCertificateUpdateTime" 90
		add_param $current_dist_name JOIN "/CMP-1" "neCertificateUpdateTime" 30
		
		add_param $current_dist_name JOIN "/CRLH-1" "usageEnabled" "Enabled"
		add_param $current_dist_name JOIN "/CRLH-1" "updatePeriod" 24
		add_param $current_dist_name JOIN "/CRLH-1" "distributionPointSource" "Certificate_extension"
	end

#DNS skip for GSM Migration

for_objects "MNL/MNLENT/MPLANENW"
	begin			
		add_param mplanenwDn "oamPeerIpAddress" oamPeerIpAddress
		add_param mplanenwDn "tlsRenegotiationInterval" 0		
	end

# PMMNL not mandatory
	
for_objects "MRBTS/BTSSCC/BTSSCG/SYNC"
	begin
		define "bcf_syncDn" $current_dist_name
		define "syncDn" mnlentDn JOIN "/SYNC-" JOIN $current_SYNC
		copy_object bcf_syncDn syncDn
		
		define "timeDn" syncDn JOIN "/TIME-1"
		add_object timeDn		
		
		define "clockDn" syncDn JOIN "/CLOCK-1"
		add_object clockDn	

		define "ntpDn" clockDn JOIN "/NTP-1"
		add_object ntpDn
		
# clock 
		add_param clockDn "holdOverModeUsed" "false"			
		# outputConfiguration2M048 copy from MRBTS/BTSSCC/BTSSCG/SYNC  twoMHzClockOutput
		if ( param_exist ( bcf_syncDn ) "twoMHzClockOutput" )
			if ( "Enabled" == ( get_param bcf_syncDn "twoMHzClockOutput" ) ) add_param clockDn "outputConfiguration2M048" "EnabledWithBtsInputReference"		
			else add_param clockDn "outputConfiguration2M048" "Disabled"
		
# smodDn filled in EQM		
# end clock
		
		add_param syncDn "btsSyncMode" "FreqSync"
		add_param syncDn "manualFrameTimingAdjustment" 0	
		
		define "counterPdh" 0
		define "counterSynce" 0
		define "topfId" 0
		define "tempPdhSyncInputListindex" 0
		define "tempSynceSyncInputListindex" 0

		define "syncIndex" 0

		if ( param_exist bcf_syncDn "syncSources" )
			begin
			# for pdh build a list with first 2 priorities 
				for_list bcf_syncDn "syncSources"
					begin
						if ( 1 == get_param bcf_syncDn ( "syncSources." JOIN $current_index JOIN ".syncType" ) )
							begin
								define "interfaceValue" ( get_param bcf_syncDn "syncSources." JOIN $current_index JOIN ".interface" )
								define "interfaceValue" interfaceValue - 8
								if tempPdhSyncInputListindex < 2
									begin
										if not ( param_exist clockDn "tempPdhSyncInputList" ) add_list clockDn "tempPdhSyncInputList"
										
										add_complex_param clockDn "tempPdhSyncInputList." JOIN tempPdhSyncInputListindex										
										add_param clockDn "tempPdhSyncInputList." JOIN tempPdhSyncInputListindex JOIN ".interface" interfaceValue
										#if ( param_exist bcf_syncDn ( "syncSources." JOIN $current_index JOIN ".priorityID" ) ) 
										add_param clockDn "tempPdhSyncInputList." JOIN tempPdhSyncInputListindex JOIN ".syncInputPrio" get_param bcf_syncDn "syncSources." JOIN $current_index JOIN ".priorityID"	
									end
								else
									begin
										define "priorityID" get_param bcf_syncDn "syncSources." JOIN $current_index JOIN ".priorityID"
										define "priorityID" convert_to_int priorityID 10
										define "syncInputPrio" get_param clockDn "tempPdhSyncInputList." JOIN 0 JOIN ".syncInputPrio"
										define "syncInputPrio" convert_to_int syncInputPrio 10
										if ( priorityID ) < ( syncInputPrio ) 
											begin
												add_complex_param clockDn "tempPdhSyncInputList." JOIN 0
												add_param clockDn "tempPdhSyncInputList." JOIN 0 JOIN ".syncInputPrio" get_param bcf_syncDn "syncSources." JOIN $current_index JOIN ".priorityID"												
												add_param clockDn "tempPdhSyncInputList." JOIN 0 JOIN ".interface" interfaceValue												
											end
										else
											begin
												if ( priorityID ) < ( get_param clockDn "tempPdhSyncInputList." JOIN 1 JOIN ".syncInputPrio" ) 
													begin
														add_complex_param clockDn "tempPdhSyncInputList." JOIN 1
														add_param clockDn "tempPdhSyncInputList." JOIN 1 JOIN ".syncInputPrio" get_param bcf_syncDn "syncSources." JOIN $current_index JOIN ".priorityID"		
														add_param clockDn "tempPdhSyncInputList." JOIN 1 JOIN ".interface" interfaceValue												
														
													end
											end
									end
									define "tempPdhSyncInputListindex" tempPdhSyncInputListindex + 1
							end
					end

			# for SYNCE build a list with first 2 priorities 
				for_list bcf_syncDn "syncSources"
					begin
						if ( 5 == get_param bcf_syncDn ( "syncSources." JOIN $current_index JOIN ".syncType" ) ) && ( param_exist bcf_syncDn ( "syncSources." JOIN $current_index JOIN ".interface" ) )
							begin								
								if tempSynceSyncInputListindex < 2
									begin
										if not ( param_exist clockDn "tempSynceSyncInputList" ) add_list clockDn "tempSynceSyncInputList"
										
										add_complex_param clockDn "tempSynceSyncInputList." JOIN tempSynceSyncInputListindex 
										add_param clockDn "tempSynceSyncInputList." JOIN tempSynceSyncInputListindex JOIN ".syncInputPrio" get_param bcf_syncDn "syncSources." JOIN $current_index JOIN ".priorityID"	
									end
								else
									begin
										define "priorityID" get_param bcf_syncDn "syncSources." JOIN $current_index JOIN ".priorityID"
										define "priorityID" convert_to_int priorityID 10
										define "syncInputPrio" get_param clockDn "tempSynceSyncInputList." JOIN 0 JOIN ".syncInputPrio"
										define "syncInputPrio" convert_to_int syncInputPrio 10
										if ( priorityID ) < ( syncInputPrio ) 
											begin
												add_complex_param clockDn "tempSynceSyncInputList." JOIN 0
												add_param clockDn "tempSynceSyncInputList." JOIN 0 JOIN ".syncInputPrio" get_param bcf_syncDn "syncSources." JOIN $current_index JOIN ".priorityID"												
												#add_param clockDn "tempSynceSyncInputList." JOIN 0 JOIN ".interface" interfaceValue												
											end
										else
											begin
												if ( priorityID ) < ( get_param clockDn "tempSynceSyncInputList." JOIN 1 JOIN ".syncInputPrio" ) 
													begin
														add_complex_param clockDn "tempSynceSyncInputList." JOIN 1
														add_param clockDn "tempSynceSyncInputList." JOIN 1 JOIN ".syncInputPrio" get_param bcf_syncDn "syncSources." JOIN $current_index JOIN ".priorityID"																
													end
											end
									end
									define "tempSynceSyncInputListindex" tempSynceSyncInputListindex + 1
							end
					end
								
				define "finalIndex" 0
				for_list bcf_syncDn "syncSources"
					begin 
# SYNC rule from GF16
						define "syncSourcesIndex" $current_index
						define "syncInputListPrefix" "syncInputList." JOIN syncIndex	
# SYNCE ok

# GNSSE 					
						if ( 2 == get_param bcf_syncDn ( "syncSources." JOIN syncSourcesIndex JOIN ".syncType" ) )
							begin
								define "gnsseDn" clockDn JOIN "/GNSSE-1"								
								add_object gnsseDn 
								add_param gnsseDn "actGnssOutputLnaPowerSupply" "true"
								add_param gnsseDn "gnssControlMode" "GPS-GLONASS"

								# copy MRBTS/BTSSCC/BTSSCG/GPS/gpsTotalAntennaLineDelay								
								if ( param_exist btsccgDN JOIN "/GPS-1" "gnssLineDelay" ) add_param gnsseDn "gnssLineDelay" get_param  btsccgDN JOIN "/GPS-1"  "gpsTotalAntennaLineDelay"
																
								add_param gnsseDn "gnssReceiverHoldoverMode" "false"								
								add_param gnsseDn "locationMode" "automatic"																
								if not ( param_exist clockDn "syncInputList" ) add_list clockDn "syncInputList"
								add_complex_param clockDn syncInputListPrefix
								add_param clockDn syncInputListPrefix JOIN ".syncInputType" "1pps/ToD from external GNSS receiver"
								if ( param_exist bcf_syncDn ( "syncSources." JOIN syncSourcesIndex JOIN ".priorityID" ) ) add_param clockDn syncInputListPrefix JOIN ".syncInputPrio" get_param bcf_syncDn "syncSources." JOIN syncSourcesIndex JOIN ".priorityID"								
								define "syncIndex" syncIndex + 1
							end							

						define "finalIndex" syncIndex
					end	
# PDH
					if param_exist clockDn "tempPdhSyncInputList"
						begin																 
							for_list clockDn "tempPdhSyncInputList"
								begin
									define "pdhIndex" $current_index + 1
									add_object clockDn JOIN "/PDH-" JOIN pdhIndex
									if not ( param_exist clockDn "syncInputList" ) add_list clockDn "syncInputList"
									add_complex_param clockDn "syncInputList." JOIN finalIndex							
									add_param clockDn "syncInputList." JOIN finalIndex JOIN ".syncInputType" "PDH-" JOIN pdhIndex		
									
									define "ppttDn" tnlDN JOIN "/PPTT-" JOIN get_param clockDn "tempPdhSyncInputList." JOIN $current_index JOIN ".interface"
									add_param clockDn JOIN "/PDH-" JOIN pdhIndex "ppttDN" ppttDn
									add_param clockDn "syncInputList." JOIN finalIndex JOIN ".syncInputPrio" get_param clockDn "tempPdhSyncInputList." JOIN $current_index JOIN ".interface"
									define "finalIndex" finalIndex + 1
								end										
						end
# SYNCE
					if param_exist clockDn "tempSynceSyncInputList"
						begin																 
							for_list clockDn "tempSynceSyncInputList"
								begin
									define "synceIndex" $current_index + 1
									define "synceDn" clockDn JOIN "/SYNCE-" JOIN synceIndex
									add_object synceDn
									if not ( param_exist clockDn "syncInputList" ) add_list clockDn "syncInputList"
									add_complex_param clockDn "syncInputList." JOIN finalIndex							
									add_param clockDn "syncInputList." JOIN finalIndex JOIN ".syncInputType" "SYNCE-" JOIN synceIndex		
																		
									add_param clockDn "syncInputList." JOIN finalIndex JOIN ".syncInputPrio" get_param clockDn "tempSynceSyncInputList." JOIN $current_index JOIN ".syncInputPrio"
									
									if ( param_exist bcf_syncDn "ssmRTO" ) add_param synceDn "ssmTimeout" get_param bcf_syncDn "ssmRTO"
									# Copy value of ssmEnabled defined in SYNC/ssmEnabled confluence
									if ( param_exist bcf_syncDn "ssmEnabled" ) add_param synceDn "ssmEnabled" get_param bcf_syncDn "ssmEnabled"									
																		

									
									define "finalIndex" finalIndex + 1
								end
																		
						end
					for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/SYNCE"
						begin
									for_objects "MRBTS/BTSSCC/BTSSCG/ETHPRT"
										begin
											define "ethprtDN" $current_dist_name
											for_list ethprtDN "portInterfaceSettings" 
												begin
													# portID portInUse portType
													define "portInterfaceSettingsIndex" $current_index
													if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portInUse" ) )
														&& ( "RJ45" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portType" ) )
														&& ( 1 == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portID" ) )
															begin
																define "ethlkDN" ethsvcDN JOIN "/ETHLK-101"
																if not ( param_exist synceDn "ethlkDN" ) add_param synceDn "ethlkDN" ethlkDN 
															end
													if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portInUse" ) )
														&& ( "SFP" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portType" ) )
														&& ( 3 == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portID" ) )
															begin
																define "ethlkDN" ethsvcDN JOIN "/ETHLK-102"
																if not ( param_exist synceDn "ethlkDN" ) add_param synceDn "ethlkDN" ethlkDN
															end
													if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portInUse" ) )
														&& ( "SFP" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portType" ) )
														&& ( 5 == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portID" ) )
															begin
																define "ethlkDN" ethsvcDN JOIN "/ETHLK-111"
																if not ( param_exist synceDn "ethlkDN" ) add_param synceDn "ethlkDN" ethlkDN
															end
													if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portInUse" ) )
														&& ( "SFP" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portType" ) )
														&& ( 6 == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portID" ) )
															begin
																define "ethlkDN" ethsvcDN JOIN "/ETHLK-112"
																if not ( param_exist synceDn "ethlkDN" ) add_param synceDn "ethlkDN" ethlkDN
															end
													if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portInUse" ) )
														&& ( "RJ45" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portType" ) )
														&& ( 5 == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portID" ) )
															begin
																define "ethlkDN" ethsvcDN JOIN "/ETHLK-113"
																if not ( param_exist synceDn "ethlkDN" ) add_param synceDn "ethlkDN" ethlkDN
															end
													if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portInUse" ) )
														&& ( "RJ45" == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portType" ) )
														&& ( 6 == get_param ethprtDN ( "portInterfaceSettings." JOIN portInterfaceSettingsIndex JOIN ".portID" ) )
															begin
																define "ethlkDN" ethsvcDN JOIN "/ETHLK-114"
																if not ( param_exist synceDn "ethlkDN" ) add_param synceDn "ethlkDN" ethlkDN
															end
													
												end															
										end							
						end
# TOPF						
					if ( param_exist bcf_syncDn "unicastMasterIpAddress" )
						begin							
							define "topDn" clockDn JOIN "/TOP-1"
							add_object topDn
							
							add_param topDn "sPlaneDscp" "46"
							
							define "topfDn" clockDn JOIN "/TOP-1/TOPF-1"
							add_object topfDn							
							add_list topfDn "acceptedClockClass"
							define "sPlaneIpAddressDNValue" tnlDN JOIN "/IPNO-1/IPIF-201/IPADDRESSV4-1"
							add_param clockDn JOIN "/TOP-1" "sPlaneIpAddressDN" sPlaneIpAddressDNValue
							
							if ( param_exist bcf_syncDn "ieeeTelecomProfile" ) 
								begin
									add_param topfDn "ieeeTelecomProfile" get_param bcf_syncDn "ieeeTelecomProfile"
									add_param topDn "topDomainNumber" 0
								end
							else add_param topDn "topDomainNumber" 4
							add_param topfDn "announceRequestMode" "ANNOUNCE_ALL"
							
                            if ( param_exist bcf_syncDn "acceptedClockQuality" )
                                begin
                                    if ( param_exist bcf_syncDn "acceptedClockQuality.0" )
                                        add_param topfDn "acceptedClockClass.0" get_param bcf_syncDn "acceptedClockQuality.0"

                                    if ( param_exist bcf_syncDn "acceptedClockQuality.1" )
                                        add_param topfDn "acceptedClockClass.1" get_param bcf_syncDn "acceptedClockQuality.1"

                                    if ( param_exist bcf_syncDn "acceptedClockQuality.2" )
                                        add_param topfDn "acceptedClockClass.2" get_param bcf_syncDn "acceptedClockQuality.2"

                                    if ( param_exist bcf_syncDn "acceptedClockQuality.3" )
                                        add_param topfDn "acceptedClockClass.3" get_param bcf_syncDn "acceptedClockQuality.3"
                                end
							else 
								begin
									add_param topfDn "acceptedClockClass.0" "6"
									add_param topfDn "acceptedClockClass.1" "7"
									add_param topfDn "acceptedClockClass.2" "13"	
									add_param topfDn "acceptedClockClass.3" "14"						
								end

							if ( param_exist bcf_syncDn "unicastMasterIpAddress" )
								begin
									if ( param_exist bcf_syncDn "syncMsgRate" )
										begin
											if ( 32 == get_param bcf_syncDn "syncMsgRate" )
												add_param topfDn "syncMessageRate" "RATE_32"
											if ( 38 == get_param bcf_syncDn "syncMsgRate" )
												add_param topfDn "syncMessageRate" "RATE_8"
											else add_param topfDn "syncMessageRate" "RATE_16"
										end
									if not ( param_exist topfDn "topMasterList" ) add_list topfDn "topMasterList"
									add_complex_param topfDn "topMasterList.0"
									# confluence : Copy value from SYNC/unicastMasterIpAddress
									add_param topfDn "topMasterList.0.masterIpAddr" get_param bcf_syncDn "unicastMasterIpAddress"	
									add_param topfDn "topMasterList.0.priority_1" 128
									add_param topfDn "topMasterList.0.priority_2" 128
								end
							if not ( param_exist clockDn "syncInputList" ) add_list clockDn "syncInputList"
							add_complex_param clockDn "syncInputList." JOIN finalIndex							
							add_param clockDn "syncInputList." JOIN finalIndex JOIN ".syncInputType" "TOPF"
							define "topfPrio" 1
							 for_list clockDn "syncInputList"
								begin
							#		if ( param_exist clockDn "tempSynceSyncInputList." JOIN $current_index JOIN ".syncInputPrio" ) define "syncEprio" get_param clockDn "tempSynceSyncInputList." JOIN $current_index JOIN ".syncInputPrio"
								define 	"tempSyncPrio" 0
								if ( param_exist clockDn "syncInputList." JOIN $current_index JOIN ".syncInputPrio" ) define "tempSyncPrio"  convert_to_int get_param clockDn "syncInputList." JOIN $current_index JOIN ".syncInputPrio" 10
								
								if ( tempSyncPrio > 0 ) 
									begin
										define "tempSyncPrio" tempSyncPrio + 1
										add_param clockDn "syncInputList." JOIN $current_index JOIN ".syncInputPrio" tempSyncPrio
									end
								
								
								#if ( ( get_param clockDn "syncInputList." JOIN $current_index JOIN ".syncInputType" ) == "SYNCE-1" ) add_param clockDn "syncInputList." JOIN $current_index JOIN  ".syncInputPrio" 2
							 	end
							## if ( syncEprio == 1 ) define "topfPrio" 2
							if ( param_exist bcf_syncDn ( "syncSources." JOIN syncSourcesIndex JOIN ".priorityID" ) ) add_param clockDn "syncInputList." JOIN finalIndex JOIN ".syncInputPrio" topfPrio
						end
			end	

		del_param clockDn "tempSynceSyncInputList"
		del_param clockDn "tempPdhSyncInputList"
		
		del_param syncDn "acceptedClockQuality"
		del_param syncDn "annouceMsgRate"
		del_param syncDn "ieeeTelecomProfile"
		del_param syncDn "ssmEnabled"
		del_param syncDn "ssmRTO"
		del_param syncDn "syncMsgInterval"
		del_param syncDn "syncMsgRate"
		del_param syncDn "syncSources"
		del_param syncDn "topDomainNumber"
		del_param syncDn "topEnabled"
		del_param syncDn "topMonitoringEnabled"
		del_param syncDn "twoMHzClockOutput"
		del_param syncDn "unicastMasterIpAddress"
		del_param syncDn "unicastTransmissionTime"	
	end
	
for_objects "MNL/MNLENT/SYNC/TIME"
	begin			
		if ( param_exist $current_dist_name "timeZone" ) add_param timeDn "timeZone" get_param $current_dist_name "timeZone"
		else add_param timeDn "timeZone" "(GMT-11) Etc/GMT+11"
	end	
	
for_objects "BCF/MRBTS/MHA"
	begin
		if ( param_exist $current_dist_name "connection" ) && ( "Shared" == get_param $current_dist_name "connection" )
			begin
				for_objects "MNL"
					begin
						define "notesDn" $current_dist_name JOIN "/NOTES-1"
						add_object notesDn
					end
				for_objects "MNL/NOTES"
					begin
						define "noteDn" $current_dist_name JOIN "/NOTE-1"
						add_object noteDn						
					end
				
				for_objects "MNL/NOTES/NOTE"
					begin
						#"describedObjDN"  optional
						if not ( param_exist $current_dist_name "attribute" )
							begin
								add_list noteDn "attribute"
								add_complex_param noteDn "attribute.0"
								add_param noteDn "attribute.0.attribName" "Nokia"
								add_param noteDn "attribute.0.attribValue" 0
							end		
					end
			end
	end
# 
for_objects "MNL/MNLENT/SECADM"
	begin
		add_param $current_dist_name "passwdHistoryLength" 0
		add_param $current_dist_name "actServiceAccountSsh" "false"
		add_param $current_dist_name "actServicePortState" "false"
		add_param $current_dist_name "ethernetPortSecurityEnabled" "true"
		add_param $current_dist_name "sshClientAliveTimer" 45
		add_param $current_dist_name "sshSessionLoginDelayTimer" 10		 
	end
# 
for_objects "MNL/MNLENT/FEATCADM"
	begin
		add_param featcadmDn "actAldSwUpdate" "false"
		add_param featcadmDn "actDtPim" "false"
		add_param featcadmDn "actMhaAutoConfig" "false"	
		add_param featcadmDn "actPimTesting" "false"	
		add_param featcadmDn "actPowerMeter" "false"	
		add_param featcadmDn "actRemoteRfDiag" "false"		
		add_param featcadmDn "actRfiTesting" "false"	
		add_param featcadmDn "actRxMonitoring" "true"	
		add_param featcadmDn "actTransportConfigFallback" "false"		
		add_param featcadmDn "rfSharingEnabled" "false"	
	end
# 	
for_objects "MNL/MNLENT/FMCADM"
	begin			
		add_param fmcadmDn "actForceAutoReset" "false"
		add_param fmcadmDn "actCategoryAlarms" "false"
		add_param fmcadmDn "actForceUnitAutoReset" "false"
		add_param fmcadmDn "actForceAutoReset" "false"
	end

for_objects "MRBTS"
begin
	define "MRBTS" $current_dist_name
end
	
for_objects "BCF/MRBTS/BTSSCC/BTSSCG/PABTRS"
	begin
		add_param MRBTS "actIpV4BasedPktAbTrs" "true"
	end

# operation, version, adaptation setup		
define "mnlDn" "MRBTS-" JOIN mrbtsId JOIN "/MNL-1"
for_branch mnlDn
	begin
		set_operation $current_dist_name operation
		set_version $current_dist_name version
		set_adaptation $current_dist_name adaptation		
	end
