#######################################################################################
#######################################################################################
#NIDD_VER: TNL17_1701_003_00
#######################################################################################
#######################################################################################
#GF17
#Migration from GF17 to SBTS17
#11.01.2017/I. Harangus

# v0.1 30.12.2016 Ioan Harangus: first draft for new CUTool
# v0.2 01.03.2017 Ioan Harangus: second draft after validation with scfValidation, based on SBTSD17_NIDD_1701_005_00
# v0.3 10.04.2017 Ioan Harangus: pronto 232350: BBMOD removal
# v0.4 10.04.2017 Ioan Harangus: pronto 232735: CABINET-1 correction, was done before...
# v0.5 20.04.2017 Ioan Harangus: pronto 233281: DSCP2PCPMAP correction, TRIGGER removal, 
# v0.6 21.04.2017 Ioan Harangus: pronto 234396: FRLI, P3ML ids correction.
# v0.7 21.04.2017 Ioan Harangus: pronto 234396: FRLI, P3ML ids correction after NIDD updates
# v0.8 16.05.2017 Ioan Harangus: pronto 243370: bundleSB, FRLI 
# v0.9 20.05.2017 L.Preuss: pronto 243370: timeSlotSequence creation corrected
# v0.10 25.05.2017 Ioan Harangus: pronto PR245897: [SBTS17][RP001420][GSM] Wrong connectorLabel value after conversion
# v0.11 14.09.2017 Ioan Harangus: pronto PR278333: [SBTS17A][RP001738][GSM] MRBTS/TNLSVC/TNL/ETHSVC/ETHIF-/VLANIF.VlanId is created twice after conversion
# v0.12 20.09.2017 Ioan Harangus: pronto PR278333: [SBTS17A][RP001738][GSM] MRBTS/TNLSVC/TNL/ETHSVC/ETHIF-/VLANIF.VlanId is created twice after conversion
# v0.13 25.10.2017 Ioan Harangus: PR2288965 interfaceDN issue
#######################################################################################

#######################################################################################
#######################################################################################
# define global constants
define "operation" "create"

define "version" "TNL17_1701_003"
define "adaptation" "com.nokia.srbts.tnl"

#General version checking

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 "bcfId" 1042

define "mrbtsId" 1
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
    end

define "btsccDN" "BCF-" JOIN bcfId JOIN "/MRBTS-1/BTSSCC-" JOIN 1
define "btsccgDN" btsccDN JOIN "/BTSSCG-" JOIN 1
define "treneDN" btsccgDN JOIN "/TRENE-" JOIN 1

# from MNL MNL/MNLENT/SYNC/CLOCK/SYNCE
define "mrbtsRoot" "MRBTS-" JOIN mrbtsId
define "mnlDn" mrbtsRoot JOIN "/MNL-1"
define "mnlentDn" mnlDn JOIN "/MNLENT-1"
define "syncDn" mnlentDn JOIN "/SYNC-1"
define "clockDn" syncDn JOIN "/CLOCK-1"
define "synceDn" clockDn JOIN "/SYNCE-1"
define "modDn" "MRBTS-" JOIN mrbtsId JOIN "/EQM-1/APEQM-1/CABINET-1"

#######################################################################################

if ( objects_count "MRBTS" ) == 0 add_object mrbtsRoot

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

if ( objects_count "TNLSVC" ) == 0 add_object tnlsvcDN

if ( objects_count "TNLSVC/TNL" ) == 0 
	begin
		add_object tnlDN
	end
	
if ( objects_count "TNLSVC/TNL/ETHSVC" ) == 0 add_object ethsvcDN

#######################################################################################

for_objects "TNLSVC/TNL"
	begin
		define "ipnoDn" tnlDN JOIN "/IPNO-1"
		add_object ipnoDn					
		
		add_param ipnoDn "arpCacheValidity" "30"
		add_param ipnoDn "icmpDscp" "10"
		add_param ipnoDn "icmpResponseEnabled"	"true"
		add_param ipnoDn "ipReassemblyTimeout"	"1000"
		
		define "iprtDn" ipnoDn JOIN "/IPRT-1"
		add_object iprtDn
	end


for_objects "MRBTS/TNLSVC/TNL/ETHSVC"
	begin 
		define "l2swiDn" ethsvcDN JOIN "/L2SWI-1"
		add_object l2swiDn					
		
		add_param l2swiDn "l2SwitchingEnabled" "false"
		add_param l2swiDn "l2QoSEnabled" "false"
		add_param l2swiDn "vlanAwarenessEnabled" "false"		
	end

for_objects "BCF/MRBTS/BTSSCC/BTSSCG/UNIT" 
	begin
		if ( param_exist $current_dist_name "platformInterfaceSettings" )						
				begin
					define "unitDN" $current_dist_name
					for_list unitDN "platformInterfaceSettings"
						begin
							if ( 1 == get_param unitDN ( "platformInterfaceSettings." JOIN $current_index JOIN ".interfaceType" ) )
							&& ( 8 < get_param unitDN ( "platformInterfaceSettings." JOIN $current_index JOIN ".interfaceID" ) )
								begin
									define "interfaceIDValue" get_param unitDN ( "platformInterfaceSettings." JOIN $current_index JOIN ".interfaceID" )
									
									define "ppttDn" tnlDN JOIN "/PPTT-" JOIN ( interfaceIDValue - 8 )
#									if 11 > interfaceIDValue
#										begin
									add_object ppttDn										
									add_param ppttDn "interface" "FTIF_IF" JOIN ( interfaceIDValue - 8 )
#										end
									
									if ( "No" == get_param unitDN ( "platformInterfaceSettings." JOIN $current_index JOIN ".interfaceInUse" ) ) add_param ppttDn "administrativeState" "locked"
									if ( "Yes" == get_param unitDN ( "platformInterfaceSettings." JOIN $current_index JOIN ".interfaceInUse" ) ) add_param ppttDn "administrativeState" "unlocked"
									if ( "0" == get_param unitDN ( "platformInterfaceSettings." JOIN $current_index JOIN ".interfaceCRCUsage" ) ) add_param ppttDn "pdhLineType" "PDH_LINE_TYPE_DOUBLE_FRAME_G704"
									else add_param ppttDn "pdhLineType" "PDH_LINE_TYPE_MULTI_FRAME_G704"
								end
						end
				end	
	end

#ETHIF-1 internal
# for IBRGPRT

define "SBTS_IBRGPRT" l2swiDn JOIN "/IBRGPRT-1"
add_object SBTS_IBRGPRT	

define "SBTS_ETHIF" ethsvcDN JOIN "/ETHIF-1"
add_object SBTS_ETHIF
add_param SBTS_ETHIF "linkSelectorDN" ethsvcDN JOIN "/L2SWI-1/IBRGPRT-1"
if ( ( param_exist treneDN "trsMode" ) && "PAoPSN" == ( get_param treneDN "trsMode" ) )
	begin
		# change from 201 to 1 , 2001, 2002 out of range
		# mPlane
		#pronto PR278333:
		define "pabtrsDn" btsccgDN JOIN "/PABTRS-1"
		#add_object SBTS_ETHIF JOIN "/VLANIF-2001"			
		if ( 4095 != get_param pabtrsDn "mPlaneVlanId" )  
			begin
				add_object SBTS_ETHIF JOIN "/VLANIF-2001"			
			
				add_param SBTS_ETHIF JOIN "/VLANIF-2001" "vlanId" get_param pabtrsDn "mPlaneVlanId"
			end
		# cPlane
# PR278333 HAI
		if ( param_exist pabtrsDn "cPlaneVlanId" ) && ( param_exist pabtrsDn "mPlaneVlanId" )
			if ( get_param pabtrsDn "cPlaneVlanId" ) != ( get_param pabtrsDn "mPlaneVlanId" )
				begin
					define "cPlaneVlanId" get_param pabtrsDn "cPlaneVlanId"
					define "mPlaneVlanId" get_param pabtrsDn "mPlaneVlanId"

					
					
					if ( 4095 != cPlaneVlanId ) 
						begin
							add_object SBTS_ETHIF JOIN "/VLANIF-2002"
							add_param SBTS_ETHIF JOIN "/VLANIF-2002" "vlanId" get_param pabtrsDn "cPlaneVlanId"
						end
				end								
		
	end

	
# from ETHPRT:
for_objects "MRBTS/BTSSCC/BTSSCG/ETHPRT"
	begin
		define "ethprtDN" $current_dist_name
		for_list ethprtDN "portInterfaceSettings" 
			begin
				# portID portInUse portType
				if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portInUse" ) )
					&& ( "RJ45" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portType" ) )
					&& ( 1 == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portID" ) )
						begin
							define "ethlkDn" ethsvcDN JOIN "/ETHLK-101"
							add_object ethlkDn 
							add_param ethlkDn "administrativeState" "unlocked"							

							add_param ethlkDn "modDN" modDn JOIN "/SMOD-1"
							add_param ethlkDn "l2IngressRate" 1000000
							

							
							define "ethifDn" ethsvcDN JOIN "/ETHIF-101"
							add_object ethifDn
							
													
							define "brgprtDn" l2swiDn JOIN "/BRGPRT-101"
							add_param ethifDn "linkSelectorDN" brgprtDn
							
							add_object brgprtDn					
							
							add_param brgprtDn "ethlkDN" ethlkDn
							add_param brgprtDn "l2BurstSize" 0
							add_param brgprtDn "acceptableFrameTypes" "ADMIT_ALL"
							add_param brgprtDn "l2ShaperRate" 1000000
							add_param brgprtDn "portDefaultVlanId" 1
							add_param brgprtDn "flushFdbOnLos" "false"
							
# connectorLabel ethlkId
							add_param ethlkDn "connectorLabel" "EIF1"	
							#add_param ethlkDn "portMode" "FSMF_EIF1_RJ45"	
# portClockSelectionMode							
							if ( "Manual Master" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL MASTER"								
							if ( "Manual Slave" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL SLAVE"
							if ( ( "Automatic" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) || 
								( "Manual Single Port" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) ||
								( "Manual Multiport" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) )
								add_param ethlkDn "clockMode" "AUTODETECT"						
# speedAndDuplex		
							add_param ethlkDn "speedAndDuplex" "AUTODETECT"
							if ( "false" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) ) add_param ethlkDn "speedAndDuplex" "100MBIT_FULL" 
							if ( "true" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) )	add_param ethlkDn "speedAndDuplex" "AUTODETECT"

							# synceDn fill ethlkDN
#							add_param synceDn "ethlkDN" ethlkDn
						end
				if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portInUse" ) )
					&& ( "SFP" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portType" ) )
					&& ( 3 == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portID" ) )
						begin
							define "ethlkDn" ethsvcDN JOIN "/ETHLK-102"
							add_object ethlkDn					
							add_param ethlkDn "administrativeState" "unlocked"
							
							add_param ethlkDn "modDN" modDn JOIN "/SMOD-1"
							
							define "ethifDn" ethsvcDN JOIN "/ETHIF-102"
							add_object ethifDn	

							define "brgprtDn" l2swiDn JOIN "/BRGPRT-102"
							add_object brgprtDn					
							add_param ethifDn "linkSelectorDN" brgprtDn
							add_param brgprtDn "ethlkDN" ethlkDn
							add_param ethlkDn "l2IngressRate" 1000000
							
							add_param brgprtDn "l2BurstSize" 0
							add_param brgprtDn "acceptableFrameTypes" "ADMIT_ALL"
							add_param brgprtDn "l2ShaperRate" 1000000
							add_param brgprtDn "portDefaultVlanId" 1
							add_param brgprtDn "flushFdbOnLos" "false"
							
							#add_param ethlkDn "connectorLabel" "FSMF_EIF2_SFP"	
							add_param ethlkDn "connectorLabel" "EIF2"	
# portClockSelectionMode							
							if ( "Manual Master" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL MASTER"								
							if ( "Manual Slave" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL SLAVE"
							if ( ( "Automatic" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) || 
								( "Manual Single Port" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) ||
								( "Manual Multiport" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) )
								add_param ethlkDn "clockMode" "AUTODETECT"	
# speedAndDuplex		
							add_param ethlkDn "speedAndDuplex" "AUTODETECT"
							if ( "false" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) ) add_param ethlkDn "speedAndDuplex" "100MBIT_FULL" 
							if ( "true" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) )	add_param ethlkDn "speedAndDuplex" "AUTODETECT"

							# synceDn fill ethlkDN
# 							add_param synceDn "ethlkDN" ethlkDn
						end
				if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portInUse" ) )
					&& ( "SFP" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portType" ) )
					&& ( 5 == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portID" ) )
						begin
							define "ethlkDn" ethsvcDN JOIN "/ETHLK-111"
							add_object ethlkDn	
							add_param ethlkDn "administrativeState" "unlocked"
# create TRMOD
							add_param ethlkDn "modDN" modDn JOIN "/TRMOD-1"								
							add_param ethlkDn "l2IngressRate" 1000000
							
							define "ethifDn" ethsvcDN JOIN "/ETHIF-111"
							add_object ethifDn					
							
							define "brgprtDn" l2swiDn JOIN "/BRGPRT-111"
							add_object brgprtDn					
							add_param ethifDn "linkSelectorDN" brgprtDn
							add_param brgprtDn "ethlkDN" ethlkDn
							
							add_param brgprtDn "l2BurstSize" 0
							add_param brgprtDn "acceptableFrameTypes" "ADMIT_ALL"
							add_param brgprtDn "l2ShaperRate" 1000000
							add_param brgprtDn "portDefaultVlanId" 1
							add_param brgprtDn "flushFdbOnLos" "false"
							
							#add_param ethlkDn "connectorLabel" "FTIF_EIF1_SFP"
							add_param ethlkDn "connectorLabel" "EIF1"
# portClockSelectionMode							
							if ( "Manual Master" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL MASTER"								
							if ( "Manual Slave" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL SLAVE"
							if ( ( "Automatic" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) || 
								( "Manual Single Port" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) ||
								( "Manual Multiport" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) )
								add_param ethlkDn "clockMode" "AUTODETECT"	
# speedAndDuplex		
							add_param ethlkDn "speedAndDuplex" "AUTODETECT"
							if ( "false" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) ) add_param ethlkDn "speedAndDuplex" "100MBIT_FULL" 
							if ( "true" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) )	add_param ethlkDn "speedAndDuplex" "AUTODETECT"
							# synceDn fill ethlkDN
#							add_param synceDn "ethlkDN" ethlkDn								
						end
				if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portInUse" ) )
					&& ( "SFP" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portType" ) )
					&& ( 6 == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portID" ) )
						begin
							define "ethlkDn" ethsvcDN JOIN "/ETHLK-112"
							add_object ethlkDn					
							add_param ethlkDn "administrativeState" "unlocked"
# create TRMOD
							add_param ethlkDn "modDN" modDn JOIN "/TRMOD-1"												
							add_param ethlkDn "l2IngressRate" 1000000
							
							define "ethifDn" ethsvcDN JOIN "/ETHIF-112"
							add_object ethifDn					
							
							define "brgprtDn" l2swiDn JOIN "/BRGPRT-112"
							add_object brgprtDn					
							
							add_param ethifDn "linkSelectorDN" brgprtDn
							add_param brgprtDn "ethlkDN" ethlkDn
							
							add_param brgprtDn "l2BurstSize" 0
							add_param brgprtDn "acceptableFrameTypes" "ADMIT_ALL"
							add_param brgprtDn "l2ShaperRate" 1000000
							add_param brgprtDn "portDefaultVlanId" 1
							add_param brgprtDn "flushFdbOnLos" "false"		
							#add_param ethlkDn "connectorLabel" "FTIF_EIF2_SFP"
							add_param ethlkDn "connectorLabel" "EIF2"
# portClockSelectionMode							
							if ( "Manual Master" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL MASTER"								
							if ( "Manual Slave" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL SLAVE"
							if ( ( "Automatic" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) || 
								( "Manual Single Port" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) ||
								( "Manual Multiport" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) )
								add_param ethlkDn "clockMode" "AUTODETECT"		
# speedAndDuplex		
							add_param ethlkDn "speedAndDuplex" "AUTODETECT"
							if ( "false" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) ) add_param ethlkDn "speedAndDuplex" "100MBIT_FULL" 
							if ( "true" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) )	add_param ethlkDn "speedAndDuplex" "AUTODETECT"	
							# synceDn fill ethlkDN
#							add_param synceDn "ethlkDN" ethlkDn								
						end
				if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portInUse" ) )
					&& ( "RJ45" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portType" ) )
					&& ( 5 == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portID" ) )
						begin
						#Change to 4 as 13 is out of range
							define "ethlkDn" ethsvcDN JOIN "/ETHLK-113"
							add_object ethlkDn				
							add_param ethlkDn "administrativeState" "unlocked"
# create TRMOD							
							add_param ethlkDn "modDN" modDn JOIN "/TRMOD-1"																					
							add_param ethlkDn "l2IngressRate" 1000000
						#Change to 4 as 13 is out of range	
							define "ethifDn" ethsvcDN JOIN "/ETHIF-113"
							add_object ethifDn
						#Change to 4 as 13 is out of range
							define "brgprtDn" l2swiDn JOIN "/BRGPRT-113"
							add_object brgprtDn					
							
							add_param ethifDn "linkSelectorDN" brgprtDn
							add_param brgprtDn "ethlkDN" ethlkDn
							add_param brgprtDn "l2BurstSize" 0
							add_param brgprtDn "acceptableFrameTypes" "ADMIT_ALL"
							add_param brgprtDn "l2ShaperRate" 1000000
							add_param brgprtDn "portDefaultVlanId" 1
							add_param brgprtDn "flushFdbOnLos" "false"							
							#add_param ethlkDn "connectorLabel" "FTIF_EIF3_RJ45"
							add_param ethlkDn "connectorLabel" "EIF3"
# portClockSelectionMode							
							if ( "Manual Master" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL MASTER"								
							if ( "Manual Slave" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL SLAVE"
							if ( ( "Automatic" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) || 
								( "Manual Single Port" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) ||
								( "Manual Multiport" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) )
								add_param ethlkDn "clockMode" "AUTODETECT"			
# speedAndDuplex		
							add_param ethlkDn "speedAndDuplex" "AUTODETECT"
							if ( "false" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) ) add_param ethlkDn "speedAndDuplex" "100MBIT_FULL" 
							if ( "true" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) )	add_param ethlkDn "speedAndDuplex" "AUTODETECT"	
							# synceDn fill ethlkDN
#							add_param synceDn "ethlkDN" ethlkDn								
						end
				if ( "Yes" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portInUse" ) )
					&& ( "RJ45" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portType" ) )
					&& ( 6 == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portID" ) )
						begin
						#Change to 5 as 14 is out of range
							define "ethlkDn" ethsvcDN JOIN "/ETHLK-114"
							add_object ethlkDn					
							add_param ethlkDn "administrativeState" "unlocked"
# create TRMOD
							add_param ethlkDn "modDN" modDn JOIN "/TRMOD-1"	
							add_param ethlkDn "l2IngressRate" 1000000
#Change to 5 as 14 is out of range
							define "ethifDn" ethsvcDN JOIN "/ETHIF-114"
							add_object ethifDn	
#Change to 5 as 14 is out of range							
							define "brgprtDn" l2swiDn JOIN "/BRGPRT-114"
							add_object brgprtDn					
							
							add_param ethifDn "linkSelectorDN" brgprtDn							
							add_param brgprtDn "ethlkDN" ethlkDn							
							add_param brgprtDn "l2BurstSize" 0
							add_param brgprtDn "acceptableFrameTypes" "ADMIT_ALL"
							add_param brgprtDn "l2ShaperRate" 1000000
							add_param brgprtDn "portDefaultVlanId" 1
							add_param brgprtDn "flushFdbOnLos" "false"							
							#add_param ethlkDn "connectorLabel" "FTIF_EIF4_RJ45"
							add_param ethlkDn "connectorLabel" "EIF4"
# portClockSelectionMode							
							if ( "Manual Master" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL MASTER"								
							if ( "Manual Slave" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) )
								add_param ethlkDn "clockMode" "MANUAL SLAVE"
							if ( ( "Automatic" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) || 
								( "Manual Single Port" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) ||
								( "Manual Multiport" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".portClockSelectionMode" ) ) )
								add_param ethlkDn "clockMode" "AUTODETECT"			
# speedAndDuplex		
							add_param ethlkDn "speedAndDuplex" "AUTODETECT"
							if ( "false" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) ) add_param ethlkDn "speedAndDuplex" "100MBIT_FULL" 
							if ( "true" == get_param ethprtDN ( "portInterfaceSettings." JOIN $current_index JOIN ".ethernetAutoNegEnabled" ) )	add_param ethlkDn "speedAndDuplex" "AUTODETECT"
							# synceDn fill ethlkDN
#							add_param synceDn "ethlkDN" ethlkDn								
						end
			end
	end

#####L2SWI/IBRGPRT#####
#	 	define "SBTS_IBRGPRT" l2swiDn JOIN "/IBRGPRT-1"
#		add_object SBTS_IBRGPRT
	
	
# from PABTRS:	
for_objects "BCF/MRBTS/BTSSCC/BTSSCG/PABTRS"
	begin
		define "iprtDn" tnlDN JOIN "/IPNO-1/IPRT-1"
		define "pabtrsDn" $current_dist_name
		if ( ( param_exist treneDN "trsMode" ) && "PAoPSN" == ( get_param treneDN "trsMode" )   )
			begin
					#change from 201, which is out of range
				define "ipifDn1" ipnoDn JOIN "/IPIF-201"
				add_object ipifDn1									
				
					
				define "modDNValue" get_param ethlkDn "modDN"
				define	"modDNValue" replace modDNValue "(.*(TRMOD).*)" "$2" flags "g"
				if ( modDNValue == "TRMOD" && ( objects_count "VLANIF-2001"  ) == 0 ) add_param ipifDn1 "interfaceDN" ethsvcDN JOIN "/ETHIF-114"
				else add_param  ipifDn1 "interfaceDN" SBTS_ETHIF JOIN "/VLANIF-2001"
						
				# for_objects "MRBTS/BTSSCC/BTSSCG/ETHPRT"
#ipMtu for IPIF-201			
								for_list ethprtDN "portInterfaceSettings" 
									begin								
										if ( ( get_param  ethprtDN "portInterfaceSettings." JOIN $current_index JOIN ".portRole" ) == "Backhaul" )
											begin
												add_param ipifDn1 "ipMtu" get_param ethprtDN "ethernetMtuSize" 
											end
									end
					#change from 202, which is out of range

				#creation of the child of IPIF1 IPADDRESSV4-1				
				define "ipaddressv4Dn1" ipifDn1 JOIN "/IPADDRESSV4-1"
				add_object ipaddressv4Dn1					
				add_param ipaddressv4Dn1 "localIpAddr" get_param pabtrsDn "mPlaneLocalIpAddress"
				add_param ipaddressv4Dn1 "localIpPrefixLength" get_param pabtrsDn "mPlaneSubnetMask"
				add_param ipaddressv4Dn1 "ipAddressAllocationMethod" "MANUAL"
				add_param clockDn JOIN "/TOP-1" "sPlaneIpAddressDN" ipaddressv4Dn1
					
					
#pronto PR278333:		
				if ( param_exist pabtrsDn "cPlaneVlanId" ) && ( param_exist pabtrsDn "mPlaneVlanId" ) 
					begin
						define "cPlaneVlanId" get_param pabtrsDn "cPlaneVlanId"
						define "mPlaneVlanId" get_param pabtrsDn "mPlaneVlanId"
						if ( mPlaneVlanId != cPlaneVlanId )					
							begin
								define "ipifDn2" ipnoDn JOIN "/IPIF-202"
								add_object ipifDn2
								define "modDNValue" get_param ethlkDn "modDN"
								define	"modDNValue" replace modDNValue "(.*(TRMOD).*)" "$2" flags "g"
								if ( modDNValue == "TRMOD" && ( objects_count "VLANIF-2001"  ) == 0 ) add_param ipifDn2 "interfaceDN" ethsvcDN JOIN "/ETHIF-114"
								else add_param  ipifDn2 "interfaceDN" SBTS_ETHIF JOIN "/VLANIF-2002"													
								#ipMtu for IPIF-202
								for_list ethprtDN "portInterfaceSettings" 
									begin								
										if ( ( get_param  ethprtDN "portInterfaceSettings." JOIN $current_index JOIN ".portRole" ) == "Backhaul" )
											begin
												add_param ipifDn2 "ipMtu" get_param ethprtDN "ethernetMtuSize" 
											end
									end
																				
								#creation of the child of IPIF2 IPADDRESSV4-1
								define "ipaddressv4Dn2" ipifDn2 JOIN "/IPADDRESSV4-1"
								add_object ipaddressv4Dn2					
								add_param ipaddressv4Dn2 "localIpAddr" "0.0.0.0"
								add_param ipaddressv4Dn2 "localIpPrefixLength" 32
								add_param ipaddressv4Dn2 "ipAddressAllocationMethod" "MANUAL"
							end
					end
			end
		if ( ( param_exist treneDN "trsMode" ) && "PAoTDM" == ( get_param treneDN "trsMode" ) )
			begin
			# change to 201 PR234396
				define "ipifDn1" ipnoDn JOIN "/IPIF-201"
				add_object ipifDn1									
				
				define "ipaddressv4Dn1" ipifDn1 JOIN "/IPADDRESSV4-1"
				add_object ipaddressv4Dn1					
				
				add_param ipaddressv4Dn1 "localIpAddr" get_param pabtrsDn "mPlaneLocalIpAddress"
				add_param ipaddressv4Dn1 "localIpPrefixLength" get_param pabtrsDn "mPlaneSubnetMask"
				add_param ipaddressv4Dn1 "ipAddressAllocationMethod" "MANUAL"
			end
		
		if ( param_exist $current_dist_name "cuPlaneGatewayIpAddress" ) && ( param_exist $current_dist_name "mPlaneGatewayIpAddress" )
			begin
				if ( get_param $current_dist_name "cuPlaneGatewayIpAddress" ) == ( get_param $current_dist_name "mPlaneGatewayIpAddress" )
					begin
						add_list iprtDn "staticRoutes"
						add_complex_param iprtDn "staticRoutes.0"
						add_param iprtDn "staticRoutes.0.destIpAddr" "0.0.0.0"
						add_param iprtDn "staticRoutes.0.destinationIpPrefixLength" 0						
						add_param iprtDn "staticRoutes.0.gateway" get_param $current_dist_name "cuPlaneGatewayIpAddress"
					end
				else
					begin						
						add_list iprtDn "staticRoutes"
						add_complex_param iprtDn "staticRoutes.0"
						add_param iprtDn "staticRoutes.0.destIpAddr" get_param $current_dist_name "mPlaneRemoteIpAddress"
						add_param iprtDn "staticRoutes.0.destinationIpPrefixLength" 0						
						add_param iprtDn "staticRoutes.0.gateway" get_param $current_dist_name "mPlaneGatewayIpAddress"
						
						add_complex_param iprtDn "staticRoutes.1"
						add_param iprtDn "staticRoutes.1.destIpAddr" "0.0.0.0"
						add_param iprtDn "staticRoutes.1.destinationIpPrefixLength" 0						
						add_param iprtDn "staticRoutes.1.gateway" get_param $current_dist_name "cuPlaneGatewayIpAddress"
					end			
					
			end
		if ( param_exist $current_dist_name "mlpppAllocations" )			
			begin
				define "p3LpDN_index" 0
				define "conversionfrliId" 0
				for_list pabtrsDn "mlpppAllocations"
					begin 
					# change to 1, 12001 out of range
						if not ( conversionfrliId ==  get_param pabtrsDn ( "mlpppAllocations." JOIN $current_index JOIN ".bundleSB" ) )
							begin
								define "conversionfrliId" get_param pabtrsDn ( "mlpppAllocations." JOIN $current_index JOIN ".bundleSB" )
								define "localCounter" 1
							end
						# pronto PR 234396 frliId = "bundleSB" JOIN "00" JOIN $current_index + 1; same for p3lp
						
						
						define "frliIdValue" conversionfrliId JOIN "00" JOIN localCounter						
						
						define "localCounter" localCounter + 1
						
						define "frliDn" tnlDN JOIN "/FRLI-" JOIN frliIdValue
						add_object frliDn
						
						define "p3lpDn" tnlDN JOIN "/P3LP-" JOIN ( frliIdValue )
						add_object p3lpDn	
						
						if "false" == get_param pabtrsDn "tdmHcPPPEnabled" add_param p3lpDn "acfcTarget" "NOT_IN_USE"
						else add_param p3lpDn "acfcTarget" "IN_USE"
						
						add_param p3lpDn "lcpEchoEnabled" "true"
						add_param p3lpDn "lcpEchoInterval" 20
						
						add_param p3lpDn "localMruTarget" 1500						
						add_param p3lpDn "magicNumberUsage" "IN_USE"						
						add_param p3lpDn "frliDN" frliDn
						
						if "false" == get_param pabtrsDn "tdmHcPPPEnabled" add_param p3lpDn "pfcTarget" "NOT_IN_USE"
						if "true" == get_param pabtrsDn "tdmHcPPPEnabled" add_param p3lpDn "pfcTarget" "IN_USE"
						
						#ppttDn ok
						# define "bundleSBValue" get_param pabtrsDn ( "mlpppAllocations." JOIN $current_index JOIN ".bundleSB" )
						define "hdlcSBValue" get_param pabtrsDn ( "mlpppAllocations." JOIN $current_index JOIN ".hdlcSB" )
						define "ppttId" hdlcSBValue - 8
						
						add_param frliDn "ppttDN" tnlDN JOIN "/PPTT-" JOIN ppttId												
# P3SL
						if ( 11 == conversionfrliId ) 
							if ( "PPP" == get_param pabtrsDn "pppMode" )
								begin
									#define "p3LpDNValue" p3lpDn									
									define "p3slDn" tnlDN JOIN "/P3SL-" JOIN conversionfrliId
									if 0 == objects_count p3slDn add_object p3slDn
									add_param p3slDn "administrativeState" "unlocked"
									add_param p3slDn "p3LpDN" p3lpDn
									
									add_param ipifDn1 "interfaceDN" p3slDn
# ipmtu																		
									add_param ipifDn1 "ipMtu" get_param pabtrsDn "tdmPktSize" 									
									if "false" == get_param pabtrsDn "tdmHcUDPIPEnabled" add_param p3slDn "ipHeaderCompressionUsage" "NOT_IN_USE"
									if "true" == get_param pabtrsDn "tdmHcUDPIPEnabled" add_param p3slDn "ipHeaderCompressionUsage" "IN_USE"									
								end

						define "hdlcLinkBandwithValue" get_param pabtrsDn ( "mlpppAllocations." JOIN $current_index JOIN ".hdlcLinkBandwith" )
						define "hdlcStartTslValue" get_param pabtrsDn ( "mlpppAllocations." JOIN $current_index JOIN ".hdlcStartTsl" )							
#P3ML	
						if 11 == conversionfrliId 
							if "PPP" != get_param pabtrsDn "pppMode"
									begin										
										define "p3mlDn" tnlDN JOIN "/P3ML-" JOIN conversionfrliId
										if 0 == objects_count p3mlDn add_object p3mlDn								
										
										add_param ipifDn1 "interfaceDN" p3mlDn
										add_param ipifDn1 "ipMtu" get_param pabtrsDn "tdmPktSize" 
										
										add_param p3mlDn "multiClassTarget" "MC0"										
										add_param p3mlDn "administrativeState" "unlocked"										
										# pronto PR234396
										if not param_exist p3mlDn "p3LpDN" add_list p3mlDn "p3LpDN"										
										add_param p3mlDn "p3LpDN." JOIN p3LpDN_index p3lpDn
										define "p3LpDN_index" p3LpDN_index + 1										
										
										add_param p3mlDn "endPointDiscriminatorUsageEnabled" "false"									
										add_param p3mlDn "shortSeqNbrFormatUsageEnabled" "false"										
										add_param p3mlDn "ipcpEncapsulation" "WITH_MLPPP_HEADERS"
										add_param p3mlDn "mpFragmentSize" "FRAGMENT_SIZE_AUTOMATIC"
																				
										if "false" == get_param pabtrsDn "tdmHcUDPIPEnabled" add_param p3mlDn "ipHeaderCompressionUsage" "NOT_IN_USE"
										if "true" == get_param pabtrsDn "tdmHcUDPIPEnabled" add_param p3mlDn "ipHeaderCompressionUsage" "IN_USE"
										
										if "ML" != get_param pabtrsDn "pppMode"
											begin
												add_param p3mlDn "multiClassTarget" "MC0"
											end
										if "MC2" == get_param pabtrsDn "pppMode" 
											begin
												define "DSCP2MC2MAP" p3mlDn JOIN "/DSCP2MC2MAP-" JOIN 1
												if 0 == objects_count DSCP2MC2MAP add_object DSCP2MC2MAP												
												
																# set default values
												add_param DSCP2MC2MAP "mc2ForDscp00" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp01" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp10" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp11" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp12" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp13" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp14" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp15" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp16" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp17" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp18" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp19" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp02" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp20" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp21" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp22" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp23" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp24" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp25" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp26" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp27" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp28" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp29" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp03" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp30" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp31" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp32" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp33" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp34" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp35" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp36" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp37" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp38" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp39" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp04" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp40" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp41" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp42" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp43" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp44" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp45" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp46" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp47" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp48" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp49" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp05" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp50" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp51" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp52" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp53" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp54" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp55" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp56" "MCMP_CLASS_1"
												add_param DSCP2MC2MAP "mc2ForDscp57" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp58" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp59" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp06" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp60" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp61" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp62" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp63" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp07" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp08" "MCMP_CLASS_2"
												add_param DSCP2MC2MAP "mc2ForDscp09" "MCMP_CLASS_2"

												add_param p3mlDn "multiClassTarget" "MC2"
												add_param p3mlDn "localMrruTarget" 1500
											end
										if "MC4" == get_param pabtrsDn "pppMode" 
											begin
												define "DSCP2MC4MAP" p3mlDn JOIN "/DSCP2MC4MAP-" JOIN 1
												if 0 == objects_count DSCP2MC4MAP add_object DSCP2MC4MAP

												# set default values
												add_param DSCP2MC4MAP "mc4ForDscp00" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp01" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp10" "MCMP_CLASS_3"
												add_param DSCP2MC4MAP "mc4ForDscp11" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp12" "MCMP_CLASS_3"
												add_param DSCP2MC4MAP "mc4ForDscp13" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp14" "MCMP_CLASS_3"
												add_param DSCP2MC4MAP "mc4ForDscp15" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp16" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp17" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp18" "MCMP_CLASS_3"
												add_param DSCP2MC4MAP "mc4ForDscp19" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp02" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp20" "MCMP_CLASS_3"
												add_param DSCP2MC4MAP "mc4ForDscp21" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp22" "MCMP_CLASS_3"
												add_param DSCP2MC4MAP "mc4ForDscp23" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp24" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp25" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp26" "MCMP_CLASS_2"
												add_param DSCP2MC4MAP "mc4ForDscp27" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp28" "MCMP_CLASS_2"
												add_param DSCP2MC4MAP "mc4ForDscp29" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp03" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp30" "MCMP_CLASS_2"
												add_param DSCP2MC4MAP "mc4ForDscp31" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp32" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp33" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp34" "MCMP_CLASS_1"
												add_param DSCP2MC4MAP "mc4ForDscp35" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp36" "MCMP_CLASS_1"
												add_param DSCP2MC4MAP "mc4ForDscp37" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp38" "MCMP_CLASS_1"
												add_param DSCP2MC4MAP "mc4ForDscp39" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp04" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp40" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp41" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp42" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp43" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp44" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp45" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp46" "MCMP_CLASS_1"
												add_param DSCP2MC4MAP "mc4ForDscp47" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp48" "MCMP_CLASS_1"
												add_param DSCP2MC4MAP "mc4ForDscp49" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp05" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp50" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp51" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp52" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp53" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp54" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp55" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp56" "MCMP_CLASS_1"
												add_param DSCP2MC4MAP "mc4ForDscp57" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp58" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp59" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp06" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp60" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp61" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp62" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp63" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp07" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp08" "MCMP_CLASS_4"
												add_param DSCP2MC4MAP "mc4ForDscp09" "MCMP_CLASS_4"
												
												add_param p3mlDn "multiClassTarget" "MC4"
												add_param p3mlDn "localMrruTarget" 1500
											end								
									end
						#define "hdlcStartTslValue" hdlcStartTslValue + 1
						
						add_list frliDn "timeSlotSequence"
						 
						for_range 0 ( hdlcLinkBandwithValue - hdlcStartTslValue + 1 )
							begin
							# list of TS timeSlotSequence
								add_param frliDn "timeSlotSequence." JOIN $current_index "TS" JOIN ( $current_index + hdlcStartTslValue )
							end
					end
			end
	end
	
for_objects "MNL/MNLENT/MPLANENW"
	begin
		define "mplanewDn" $current_dist_name
		for_objects "BCF/MRBTS/BTSSCC/BTSSCG/PABTRS"
			begin
				define "pabtrsDn" $current_dist_name
				for_objects "MRBTS/TNLSVC/TNL/IPNO/IPIF/IPADDRESSV4"
					if ( get_param pabtrsDn "mPlaneLocalIpAddress" ) == ( get_param $current_dist_name "localIpAddr" )
						add_param mplanewDn "mPlaneIpAddressDN" $current_dist_name
			end 
	end

for_objects "MNL/MNLENT/SYNC/CLOCK/TOP"
	begin
		define "topDn" $current_dist_name
		for_objects "MRBTS/TNLSVC/TNL/IPNO/IPIF/IPADDRESSV4"
			if ( 202 == $current_IPIF ) add_param topDn "sPlaneIpAddressDN" $current_dist_name		
	end
	
for_objects "TNLSVC/TNL/IPNO"
	begin
		define "qosDn" ipnoDn JOIN "/QOS-1"
		add_object qosDn							
		add_param qosDn "arpPcp" "7"			
	end		
#######################################################################################
# operation, version, adaptation setup	
	
define "tnlsvcDn" "MRBTS-" JOIN mrbtsId JOIN "/TNLSVC-1"
for_branch tnlsvcDn
	begin
		set_operation $current_dist_name operation
		set_version $current_dist_name version
		set_adaptation $current_dist_name adaptation
	end
