#######################################################################################
#######################################################################################
#NIDD_VER: TNL17_1610_001_00
#TNL: TNL_TNL17_1610_001
#Migration from SBTS16.10 to SBTS17
#22.11.2016/ v0.1 /first draft /John Villangca
#
#######################################################################################

#######################################################################################
#######################################################################################
#If SCF version == 16.10 proceed with migration, else abort this ruleset

for_objects "SBTS"
	define "sbtsRoot" $current_dist_name

if ( objects_count "SBTS" ) == 0 abort_file
	
if not ( get_version sbtsRoot ) == "SBTS16.10" 
	begin
		abort_file
	end
#######################################################################################

for_objects "SBTS"
begin
	define "SBTS" $current_dist_name
end
for_objects "MRBTS"
begin
	define "MRBTS" $current_dist_name
end

define "TNLSVC" MRBTS JOIN "/TNLSVC-1"
define "TNL_NEW" TNLSVC JOIN "/TNL-1"
define "ETHSVC_NEW" TNL_NEW JOIN "/ETHSVC-1"

add_object TNLSVC
add_object TNL_NEW

set_operation TNLSVC "create"
set_operation TNL_NEW "create"

set_version TNLSVC "TNL17_1610_001"
set_version TNL_NEW "TNL17_1610_001"

if ( 1 == ( objects_count "SBTS/TNL/ETHSVC" ) )
	begin
		add_object ETHSVC_NEW
		set_operation ETHSVC_NEW "create"
		set_version ETHSVC_NEW "TNL17_1610_001"
	end

#temporary addition of actIpV4BasedPktAbTrs - it is added to MRBTS/MNL/MNLENT/FEATCADM/FEATGADM and removed from MRBTS in SCFD08-MNL-020_000.txt
for_objects "SBTS/TNL"
    begin
        if ( param_exist $current_dist_name "actIpV4BasedPktAbTrs" )
            begin
                define "actIpV4BasedPktAbTrs" get_param $current_dist_name "actIpV4BasedPktAbTrs"
                add_param MRBTS "actIpV4BasedPktAbTrs" actIpV4BasedPktAbTrs
            end
    end

#####ETHIF#####
define "ETHIF_COUNT" 1
for_objects "SBTS/TNL/ETHSVC/ETHIF"
	begin
		define "ETHIF" ETHSVC_NEW JOIN "/ETHIF-" JOIN ETHIF_COUNT
		copy_object $current_dist_name ETHIF
		add_param ETHIF "oldDistname" $current_dist_name

		define "ETHIF_COUNT" ETHIF_COUNT + 1

		#####VLANIF#####
		define "VLANIF_COUNT" 1
		for_objects $current_dist_name JOIN "/VLANIF"
			begin
				define "VLANIF" ETHIF JOIN "/VLANIF-" JOIN VLANIF_COUNT
				copy_object $current_dist_name VLANIF
				add_param VLANIF "oldDistname" $current_dist_name

				define "VLANIF_COUNT" VLANIF_COUNT + 1
			end
		#####VLANIF#####

	end
#####ETHIF#####

#####ETHLK#####
define "ETHLK_COUNT" 1
for_objects "SBTS/TNL/ETHSVC/ETHLK"
	begin
		define "ETHLK" ETHSVC_NEW JOIN "/ETHLK-" JOIN ETHLK_COUNT
		copy_object $current_dist_name ETHLK
		add_param ETHLK "oldDistname" $current_dist_name

		define "ETHLK_COUNT" ETHLK_COUNT + 1

		#mandatory params which are optional in sbts16.10
		if ( not param_exist ETHLK "administrativeState" ) add_param ETHLK "administrativeState" "unlocked"
		if ( not param_exist ETHLK "clockMode" ) add_param ETHLK "clockMode" "AUTODETECT"
		if ( not param_exist ETHLK "l2IngressRate" ) add_param ETHLK "l2IngressRate" "1000000"

		define "oldValue" get_param $current_dist_name "connectorLabel"
		define "connectorLabel" replace oldValue ".*\_(.*)\_.*" "$1" flags "g"
		define "mod" replace oldValue "(.*)\_.*\_.*" "$1" flags "g"
		add_param ETHLK "connectorLabel" connectorLabel
		if ( mod == "FSMF" ) add_param ETHLK "modDN" MRBTS JOIN "/EQM-1/APEQM-1/CABINET-1/SMOD-1"
		if ( mod == "FTIF" ) add_param ETHLK "modDN" MRBTS JOIN "/EQM-1/APEQM-1/CABINET-1/SMOD-1/TRMOD-1"
	end	
#####ETHLK#####

#####L2SWI#####
define "L2SWI_COUNT" 1
for_objects "SBTS/TNL/ETHSVC/L2SWI"
	begin
		define "L2SWI_OLD" $current_dist_name
		define "L2SWI_NEW" ETHSVC_NEW JOIN "/L2SWI-" JOIN L2SWI_COUNT
		copy_object L2SWI_OLD L2SWI_NEW
		add_param L2SWI_NEW "oldDistname" L2SWI_OLD

		define "L2SWI_COUNT" L2SWI_COUNT + 1

		#mandatory params which are optional in sbts16.10
		if ( not param_exist L2SWI_NEW "l2QoSEnabled" ) add_param L2SWI_NEW "l2QoSEnabled" "false"
		if ( not param_exist L2SWI_NEW "l2SwitchingEnabled" ) add_param L2SWI_NEW "l2SwitchingEnabled" "false"
		if ( not param_exist L2SWI_NEW "vlanAwarenessEnabled" ) add_param L2SWI_NEW "vlanAwarenessEnabled" "false"

		# L2SWI/DSCPTOQMAP
		if ( param_exist L2SWI_OLD "dscpToQueueMap" )
			begin
				define "DSCPTOQMAP" L2SWI_NEW JOIN "/DSCPTOQMAP-1"
				add_object DSCPTOQMAP
				set_operation DSCPTOQMAP "create"
				del_param L2SWI_NEW "dscpToQueueMap"

				# set default values
				add_param DSCPTOQMAP "queueForDscp0" "BE"
				add_param DSCPTOQMAP "queueForDscp1" "BE"
				add_param DSCPTOQMAP "queueForDscp10" "AF1"
				add_param DSCPTOQMAP "queueForDscp11" "BE"
				add_param DSCPTOQMAP "queueForDscp12" "AF1"
				add_param DSCPTOQMAP "queueForDscp13" "BE"
				add_param DSCPTOQMAP "queueForDscp14" "AF1"
				add_param DSCPTOQMAP "queueForDscp15" "BE"
				add_param DSCPTOQMAP "queueForDscp16" "BE"
				add_param DSCPTOQMAP "queueForDscp17" "BE"
				add_param DSCPTOQMAP "queueForDscp18" "AF2"
				add_param DSCPTOQMAP "queueForDscp19" "BE"
				add_param DSCPTOQMAP "queueForDscp2" "BE"
				add_param DSCPTOQMAP "queueForDscp20" "AF2"
				add_param DSCPTOQMAP "queueForDscp21" "BE"
				add_param DSCPTOQMAP "queueForDscp22" "AF2"
				add_param DSCPTOQMAP "queueForDscp23" "BE"
				add_param DSCPTOQMAP "queueForDscp24" "BE"
				add_param DSCPTOQMAP "queueForDscp25" "BE"
				add_param DSCPTOQMAP "queueForDscp26" "AF3"
				add_param DSCPTOQMAP "queueForDscp27" "BE"
				add_param DSCPTOQMAP "queueForDscp28" "AF3"
				add_param DSCPTOQMAP "queueForDscp29" "BE"
				add_param DSCPTOQMAP "queueForDscp3" "BE"
				add_param DSCPTOQMAP "queueForDscp30" "AF3"
				add_param DSCPTOQMAP "queueForDscp31" "BE"
				add_param DSCPTOQMAP "queueForDscp32" "BE"
				add_param DSCPTOQMAP "queueForDscp33" "BE"
				add_param DSCPTOQMAP "queueForDscp34" "AF4"
				add_param DSCPTOQMAP "queueForDscp35" "BE"
				add_param DSCPTOQMAP "queueForDscp36" "AF4"
				add_param DSCPTOQMAP "queueForDscp37" "BE"
				add_param DSCPTOQMAP "queueForDscp38" "AF4"
				add_param DSCPTOQMAP "queueForDscp39" "BE"
				add_param DSCPTOQMAP "queueForDscp4" "BE"
				add_param DSCPTOQMAP "queueForDscp40" "BE"
				add_param DSCPTOQMAP "queueForDscp41" "BE"
				add_param DSCPTOQMAP "queueForDscp42" "BE"
				add_param DSCPTOQMAP "queueForDscp43" "BE"
				add_param DSCPTOQMAP "queueForDscp44" "BE"
				add_param DSCPTOQMAP "queueForDscp45" "BE"
				add_param DSCPTOQMAP "queueForDscp46" "EF"
				add_param DSCPTOQMAP "queueForDscp47" "BE"
				add_param DSCPTOQMAP "queueForDscp48" "EF"
				add_param DSCPTOQMAP "queueForDscp49" "BE"
				add_param DSCPTOQMAP "queueForDscp5" "BE"
				add_param DSCPTOQMAP "queueForDscp50" "BE"
				add_param DSCPTOQMAP "queueForDscp51" "BE"
				add_param DSCPTOQMAP "queueForDscp52" "BE"
				add_param DSCPTOQMAP "queueForDscp53" "BE"
				add_param DSCPTOQMAP "queueForDscp54" "BE"
				add_param DSCPTOQMAP "queueForDscp55" "BE"
				add_param DSCPTOQMAP "queueForDscp56" "EF"
				add_param DSCPTOQMAP "queueForDscp57" "BE"
				add_param DSCPTOQMAP "queueForDscp58" "BE"
				add_param DSCPTOQMAP "queueForDscp59" "BE"
				add_param DSCPTOQMAP "queueForDscp6" "BE"
				add_param DSCPTOQMAP "queueForDscp60" "BE"
				add_param DSCPTOQMAP "queueForDscp61" "BE"
				add_param DSCPTOQMAP "queueForDscp62" "BE"
				add_param DSCPTOQMAP "queueForDscp63" "BE"
				add_param DSCPTOQMAP "queueForDscp7" "BE"
				add_param DSCPTOQMAP "queueForDscp8" "BE"
				add_param DSCPTOQMAP "queueForDscp9" "BE"
				
                for_range 0 63
                    begin
                        define "dscpIter" $current_index

                        for_list L2SWI_OLD "dscpToQueueMap"
                            begin
                                if ( param_exist L2SWI_OLD "dscpToQueueMap." JOIN $current_index JOIN ".dscp" )
                                    begin
                                        define "dscp" get_param L2SWI_OLD "dscpToQueueMap." JOIN $current_index JOIN ".dscp"

                                        if ( dscp ) == dscpIter
                                            begin
                                                if ( param_exist L2SWI_OLD "dscpToQueueMap." JOIN $current_index JOIN ".queue" )
                                                    begin
                                                        define "val" get_param L2SWI_OLD "dscpToQueueMap." JOIN $current_index JOIN ".queue"
                                                        add_param DSCPTOQMAP "queueForDscp" JOIN dscpIter val
                                                    end
                                            end
                                    end
                            end
                    end
        end

		# L2SWI/PCP2QMAP
		if ( param_exist L2SWI_OLD "pcpToQueueMap" )
			begin
				define "PCP2QMAP" L2SWI_NEW JOIN "/PCP2QMAP-1"
				add_object PCP2QMAP
				set_operation PCP2QMAP "create"
				del_param L2SWI_NEW "pcpToQueueMap"

				# set default values
				add_param PCP2QMAP "queueForPcp0" "BE"
				add_param PCP2QMAP "queueForPcp1" "AF1"
				add_param PCP2QMAP "queueForPcp2" "AF2"
				add_param PCP2QMAP "queueForPcp3" "AF3"
				add_param PCP2QMAP "queueForPcp4" "AF4"
				add_param PCP2QMAP "queueForPcp5" "EF"
				add_param PCP2QMAP "queueForPcp6" "EF"
				add_param PCP2QMAP "queueForPcp7" "EF"
				
				for_range 0 7
					begin
						define "pcpIter" $current_index
						for_list L2SWI_OLD "pcpToQueueMap"
							begin
								if ( get_param L2SWI_OLD "pcpToQueueMap." JOIN $current_index JOIN ".pcp" ) == pcpIter
									begin
										define "val" get_param L2SWI_OLD "pcpToQueueMap." JOIN $current_index JOIN ".queue"
										add_param PCP2QMAP "queueForPcp" JOIN pcpIter val
									end
							end
					end
			end

		#####BRGPRT#####
		define "BRGPRT_COUNT" 1
		for_objects L2SWI_OLD JOIN "/BRGPRT"
			begin
				define "BRGPRT_OLD" $current_dist_name
				define "BRGPRT_NEW" L2SWI_NEW JOIN "/BRGPRT-" JOIN BRGPRT_COUNT
				copy_object BRGPRT_OLD BRGPRT_NEW
				add_param BRGPRT_NEW "oldDistname" BRGPRT_OLD

				define "BRGPRT_COUNT" BRGPRT_COUNT + 1

				#mandatory params which are optional in sbts16.10
				if ( not param_exist BRGPRT_NEW "acceptableFrameTypes" ) add_param BRGPRT_NEW "acceptableFrameTypes" "ADMIT_ALL"
				if ( not param_exist BRGPRT_NEW "flushFdbOnLos" ) add_param BRGPRT_NEW "flushFdbOnLos" "false"
				if ( not param_exist BRGPRT_NEW "l2BurstSize" ) add_param BRGPRT_NEW "l2BurstSize" "4000"
				if ( not param_exist BRGPRT_NEW "l2ShaperRate" ) add_param BRGPRT_NEW "l2ShaperRate" "1000000"
				if ( not param_exist BRGPRT_NEW "portDefaultVlanId" ) add_param BRGPRT_NEW "portDefaultVlanId" "1"

				#delete params not in 17
				if ( param_exist BRGPRT_NEW "bridgePortStatisticsInterval" ) del_param BRGPRT_NEW "bridgePortStatisticsInterval"
			end
		#####BRGPRT#####

		#####IBRGPRT#####
		define "IBRGPRT_COUNT" 1
		for_objects L2SWI_OLD JOIN "/IBRGPRT"
			begin
				define "IBRGPRT_OLD" $current_dist_name
				define "IBRGPRT_NEW" L2SWI_NEW JOIN "/IBRGPRT-" JOIN IBRGPRT_COUNT
				copy_object IBRGPRT_OLD IBRGPRT_NEW
				add_param IBRGPRT_NEW "oldDistname" IBRGPRT_OLD

				define "IBRGPRT_COUNT" IBRGPRT_COUNT + 1
			end
		#####IBRGPRT#####

	end	
#####L2SWI#####

#####FRLI#####
define "FRLI_COUNT" 1
for_objects "SBTS/TNL/FRLI"
	begin
		define "FRLI_OLD" $current_dist_name
		define "FRLI_NEW" TNL_NEW JOIN "/FRLI-" JOIN FRLI_COUNT
		copy_object FRLI_OLD FRLI_NEW
		add_param FRLI_NEW "oldDistname" FRLI_OLD

		define "FRLI_COUNT" FRLI_COUNT + 1

		#mandatory params which are optional in sbts16.10
		if ( not param_exist FRLI_NEW "timeSlotSequence" )
			begin
				add_list FRLI_NEW "timeSlotSequence"
				add_param FRLI_NEW "timeSlotSequence.0" "TS_ALL"
			end
	end
#####FRLI#####

#####IPNO#####
define "IPNO_COUNT" 1
for_objects "SBTS/TNL/IPNO"
	begin
		define "IPNO_OLD" $current_dist_name
		define "IPNO_NEW" TNL_NEW JOIN "/IPNO-" JOIN IPNO_COUNT
		copy_object IPNO_OLD IPNO_NEW
		add_param IPNO_NEW "oldDistname" IPNO_OLD

		define "IPNO_COUNT" IPNO_COUNT + 1

		#mandatory params which are optional in sbts16.10
		if ( not param_exist IPNO_NEW "arpCacheValidity" ) add_param IPNO_NEW "arpCacheValidity" "30"
		if ( not param_exist IPNO_NEW "icmpDscp" ) add_param IPNO_NEW "icmpDscp" "10"
		if ( not param_exist IPNO_NEW "icmpResponseEnabled" ) add_param IPNO_NEW "icmpResponseEnabled" "true"
		if ( not param_exist IPNO_NEW "ipReassemblyTimeout" ) add_param IPNO_NEW "ipReassemblyTimeout" "1000"

		#delete params not in 17
		if ( param_exist IPNO_NEW "arpPreventPeriod" ) del_param IPNO_NEW "arpPreventPeriod"
		if ( param_exist IPNO_NEW "ipFragmentationAlgorithm" ) del_param IPNO_NEW "ipFragmentationAlgorithm"
		if ( param_exist IPNO_NEW "ipMtu" ) del_param IPNO_NEW "ipMtu"
		if ( param_exist IPNO_NEW "ipRerouteHoldUpTime" ) del_param IPNO_NEW "ipRerouteHoldUpTime"

		#####IPIF#####
		define "IPIF_COUNT" 1
		for_objects IPNO_OLD JOIN "/IPIF"
			begin
				define "IPIF_OLD" $current_dist_name
				define "IPIF_NEW" IPNO_NEW JOIN "/IPIF-" JOIN IPIF_COUNT
				copy_object IPIF_OLD IPIF_NEW
				add_param IPIF_NEW "oldDistname" IPIF_OLD

				define "IPIF_COUNT" IPIF_COUNT + 1

				define "IPIF_OLD" $current_dist_name
				define "IPADDRESSV4_COUNTER" 1
				define "IPADDRESSV6_COUNTER" 1

				# set to 'PPP' if P3SL/P3ML, otherwise 'MANUAL'
				define "ipAddressAllocationMethod" "MANUAL"

				if ( param_exist IPIF_OLD "interfacePtr" )
					begin
						define "tempInterface" get_param IPIF_OLD "interfacePtr"
						define "tempInterface" replace tempInterface "(.*)-(.*)" "$1"
						if ( ( tempInterface == "P3ML" ) || ( tempInterface == "P3SL" ) ) define "ipAddressAllocationMethod" "PPP"
					end
					



				for_list IPIF_OLD "ipAddrList"
					begin
						define "IPADDR" get_param IPIF_OLD "ipAddrList." JOIN $current_index JOIN ".localIpAddr"
						define "IP_PREFIX_LENGTH" get_param IPIF_OLD "ipAddrList." JOIN $current_index JOIN ".localIpPrefixLength"
						define "IPADDR_FORMAT" replace IPADDR "(([A-Z,a-z,0-9])+\.)+([A-Z,a-z,0-9])+" "v4" flags "g"
						define "IPADDR_FORMAT" replace IPADDR_FORMAT "(([A-Z,a-z,0-9])+\:)+([A-Z,a-z,0-9])+" "v6" flags "g"


						if IPADDR_FORMAT == "v4"
							begin
								define "IPIFADDRESSV4_MO" IPIF_NEW JOIN "/IPADDRESSV4-" JOIN IPADDRESSV4_COUNTER
								add_object IPIFADDRESSV4_MO
								set_operation IPIFADDRESSV4_MO "create"
								add_param IPIFADDRESSV4_MO "localIpAddr" IPADDR
								add_param IPIFADDRESSV4_MO "localIpPrefixLength" IP_PREFIX_LENGTH
								add_param IPIFADDRESSV4_MO "ipAddressAllocationMethod" ipAddressAllocationMethod
								define "IPADDRESSV4_COUNTER" IPADDRESSV4_COUNTER + 1
							end
						
						if IPADDR_FORMAT == "v6"
							begin
								define "IPIFADDRESSV6_MO" IPIF_NEW JOIN "/IPADDRESSV6-" JOIN IPADDRESSV6_COUNTER
								add_object IPIFADDRESSV6_MO
								set_operation IPIFADDRESSV6_MO "create"
								add_param IPIFADDRESSV6_MO "localIpAddr" IPADDR
								add_param IPIFADDRESSV6_MO "localIpPrefixLength" IP_PREFIX_LENGTH
								add_param IPIFADDRESSV6_MO "ipAddressAllocationMethod" ipAddressAllocationMethod
								define "IPADDRESSV6_COUNTER" IPADDRESSV6_COUNTER + 1
							end
					end

				if ( param_exist IPIF_NEW "ipAddrList" ) del_param IPIF_NEW "ipAddrList"
			end
		#####IPIF#####

		#####IPRT#####
		define "IPRT_COUNT" 1
		for_objects IPNO_OLD JOIN "/IPRT"
			begin
				define "IPRT_OLD" $current_dist_name
				define "IPRT_NEW" IPNO_NEW JOIN "/IPRT-" JOIN IPRT_COUNT
				copy_object IPRT_OLD IPRT_NEW
				add_param IPRT_NEW "oldDistname" IPRT_OLD

				define "IPRT_COUNT" IPRT_COUNT + 1

				#delete params not in 17
				for_list IPRT_NEW "staticRoutes"
					begin
					    define "preFixLenValue" "32"
                        if ( param_exist IPRT_NEW "staticRoutes." JOIN $current_index JOIN ".destinationIpPrefixLength" )
                    	    define "preFixLenValue" get_param IPRT_NEW "staticRoutes." JOIN $current_index JOIN ".destinationIpPrefixLength"
                        if ( ( not param_exist IPRT_NEW "staticRoutes." JOIN $current_index JOIN ".destIpAddr" ) && ( preFixLenValue == "0" ) )
                            add_param IPRT_NEW "staticRoutes." JOIN $current_index JOIN ".destIpAddr" "0.0.0.0"
						if ( param_exist IPRT_NEW "staticRoutes." JOIN $current_index JOIN ".bfdId" ) del_param IPRT_NEW "staticRoutes." JOIN $current_index JOIN ".bfdId"
						if ( param_exist IPRT_NEW "staticRoutes." JOIN $current_index JOIN ".netmask" ) del_param IPRT_NEW "staticRoutes." JOIN $current_index JOIN ".netmask"
					    if not ( param_exist IPRT_NEW "staticRoutes." JOIN $current_index JOIN ".destIpAddr" )
                            del_param IPRT_NEW "staticRoutes." JOIN $current_index
					    if not ( param_exist IPRT_NEW "staticRoutes." JOIN $current_index JOIN ".gateway" )
                            del_param IPRT_NEW "staticRoutes." JOIN $current_index
					end
			end
		#####IPRT#####

		#####IPRTV6#####
		define "IPRTV6_COUNT" 1
		for_objects IPNO_OLD JOIN "/IPRTV6"
			begin
				define "IPRTV6_OLD" $current_dist_name
				define "IPRTV6_NEW" IPNO_NEW JOIN "/IPRTV6-" JOIN IPRTV6_COUNT
				copy_object IPRTV6_OLD IPRTV6_NEW
				add_param IPRTV6_NEW "oldDistname" IPRTV6_OLD

				define "IPRTV6_COUNT" IPRTV6_COUNT + 1

				#delete params not in 17
				for_list IPRTV6_NEW "staticIpv6Routes"
					begin
						if ( param_exist IPRTV6_NEW "staticIpv6Routes." JOIN $current_index JOIN ".bfdId" ) del_param IPRTV6_NEW "staticIpv6Routes." JOIN $current_index JOIN ".bfdId"
					end
			end
		#####IPRTV6#####

		#####MCAPP#####
		define "MCAPP_COUNT" 1
		for_objects IPNO_OLD JOIN "/MCAPP"
			begin
				define "MCAPP_OLD" $current_dist_name
				define "MCAPP_NEW" IPNO_NEW JOIN "/MCAPP-" JOIN MCAPP_COUNT
				copy_object MCAPP_OLD MCAPP_NEW
				add_param MCAPP_NEW "oldDistname" MCAPP_OLD

				define "MCAPP_COUNT" MCAPP_COUNT + 1
			end
		#####MCAPP#####

		#####QOS#####
		define "QOS_COUNT" 1
		for_objects IPNO_OLD JOIN "/QOS"
			begin
				define "QOS_OLD" $current_dist_name
				define "QOS_NEW" IPNO_NEW JOIN "/QOS-" JOIN QOS_COUNT
				copy_object QOS_OLD QOS_NEW
				add_param QOS_NEW "oldDistname" QOS_OLD

				define "QOS_COUNT" QOS_COUNT + 1

				#mandatory params which are optional in sbts16.10
				if ( not param_exist QOS_NEW "arpPcp" ) add_param QOS_NEW "arpPcp" "7"

				#delete params not in 17
				if ( param_exist QOS_NEW "enableQueueCounters" ) del_param QOS_NEW "enableQueueCounters"

				# QOS/DSCP2PCPMAP and QOS/DSCP2QMAP

				if ( param_exist QOS_OLD "dscpMap" )
					begin
						define "DSCP2PCPMAP" QOS_NEW JOIN "/DSCP2PCPMAP-1"
						define "DSCP2QMAP" QOS_NEW JOIN "/DSCP2QMAP-1"
						add_object DSCP2PCPMAP
						set_operation DSCP2PCPMAP "create"
						add_object DSCP2QMAP
						set_operation DSCP2QMAP "create"
						del_param QOS_NEW "dscpMap"

						# set default values
						add_param DSCP2PCPMAP "vLanPrioForDscp0" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp1" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp2" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp3" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp4" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp5" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp6" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp7" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp8" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp9" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp10" "1"
						add_param DSCP2PCPMAP "vLanPrioForDscp11" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp12" "1"
						add_param DSCP2PCPMAP "vLanPrioForDscp13" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp14" "1"
						add_param DSCP2PCPMAP "vLanPrioForDscp15" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp16" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp17" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp18" "2"
						add_param DSCP2PCPMAP "vLanPrioForDscp19" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp20" "2"
						add_param DSCP2PCPMAP "vLanPrioForDscp21" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp22" "2"
						add_param DSCP2PCPMAP "vLanPrioForDscp23" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp24" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp25" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp26" "3"
						add_param DSCP2PCPMAP "vLanPrioForDscp27" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp28" "3"
						add_param DSCP2PCPMAP "vLanPrioForDscp29" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp30" "3"
						add_param DSCP2PCPMAP "vLanPrioForDscp31" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp32" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp33" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp34" "4"
						add_param DSCP2PCPMAP "vLanPrioForDscp35" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp36" "4"
						add_param DSCP2PCPMAP "vLanPrioForDscp37" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp38" "4"
						add_param DSCP2PCPMAP "vLanPrioForDscp39" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp40" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp41" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp42" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp43" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp44" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp45" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp46" "5"
						add_param DSCP2PCPMAP "vLanPrioForDscp47" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp48" "6"
						add_param DSCP2PCPMAP "vLanPrioForDscp49" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp50" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp51" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp52" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp53" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp54" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp55" "7"
						add_param DSCP2PCPMAP "vLanPrioForDscp56" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp57" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp58" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp59" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp60" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp61" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp62" "0"
						add_param DSCP2PCPMAP "vLanPrioForDscp63" "0"
						
						add_param DSCP2QMAP "queueForDscp0" "BE"
						add_param DSCP2QMAP "queueForDscp1" "BE"
						add_param DSCP2QMAP "queueForDscp10" "AF1"
						add_param DSCP2QMAP "queueForDscp11" "BE"
						add_param DSCP2QMAP "queueForDscp12" "AF1"
						add_param DSCP2QMAP "queueForDscp13" "BE"
						add_param DSCP2QMAP "queueForDscp14" "AF1"
						add_param DSCP2QMAP "queueForDscp15" "BE"
						add_param DSCP2QMAP "queueForDscp16" "BE"
						add_param DSCP2QMAP "queueForDscp17" "BE"
						add_param DSCP2QMAP "queueForDscp18" "AF2"
						add_param DSCP2QMAP "queueForDscp19" "BE"
						add_param DSCP2QMAP "queueForDscp2" "BE"
						add_param DSCP2QMAP "queueForDscp20" "AF2"
						add_param DSCP2QMAP "queueForDscp21" "BE"
						add_param DSCP2QMAP "queueForDscp22" "AF2"
						add_param DSCP2QMAP "queueForDscp23" "BE"
						add_param DSCP2QMAP "queueForDscp24" "BE"
						add_param DSCP2QMAP "queueForDscp25" "BE"
						add_param DSCP2QMAP "queueForDscp26" "AF3"
						add_param DSCP2QMAP "queueForDscp27" "BE"
						add_param DSCP2QMAP "queueForDscp28" "AF3"
						add_param DSCP2QMAP "queueForDscp29" "BE"
						add_param DSCP2QMAP "queueForDscp3" "BE"
						add_param DSCP2QMAP "queueForDscp30" "AF3"
						add_param DSCP2QMAP "queueForDscp31" "BE"
						add_param DSCP2QMAP "queueForDscp32" "BE"
						add_param DSCP2QMAP "queueForDscp33" "BE"
						add_param DSCP2QMAP "queueForDscp34" "AF4"
						add_param DSCP2QMAP "queueForDscp35" "BE"
						add_param DSCP2QMAP "queueForDscp36" "AF4"
						add_param DSCP2QMAP "queueForDscp37" "BE"
						add_param DSCP2QMAP "queueForDscp38" "AF4"
						add_param DSCP2QMAP "queueForDscp39" "BE"
						add_param DSCP2QMAP "queueForDscp4" "BE"
						add_param DSCP2QMAP "queueForDscp40" "BE"
						add_param DSCP2QMAP "queueForDscp41" "BE"
						add_param DSCP2QMAP "queueForDscp42" "BE"
						add_param DSCP2QMAP "queueForDscp43" "BE"
						add_param DSCP2QMAP "queueForDscp44" "BE"
						add_param DSCP2QMAP "queueForDscp45" "BE"
						add_param DSCP2QMAP "queueForDscp46" "EF1"
						add_param DSCP2QMAP "queueForDscp47" "BE"
						add_param DSCP2QMAP "queueForDscp48" "EF2"
						add_param DSCP2QMAP "queueForDscp49" "BE"
						add_param DSCP2QMAP "queueForDscp5" "BE"
						add_param DSCP2QMAP "queueForDscp50" "BE"
						add_param DSCP2QMAP "queueForDscp51" "BE"
						add_param DSCP2QMAP "queueForDscp52" "BE"
						add_param DSCP2QMAP "queueForDscp53" "BE"
						add_param DSCP2QMAP "queueForDscp54" "BE"
						add_param DSCP2QMAP "queueForDscp55" "BE"
						add_param DSCP2QMAP "queueForDscp56" "EF3"
						add_param DSCP2QMAP "queueForDscp57" "BE"
						add_param DSCP2QMAP "queueForDscp58" "BE"
						add_param DSCP2QMAP "queueForDscp59" "BE"
						add_param DSCP2QMAP "queueForDscp6" "BE"
						add_param DSCP2QMAP "queueForDscp60" "BE"
						add_param DSCP2QMAP "queueForDscp61" "BE"
						add_param DSCP2QMAP "queueForDscp62" "BE"
						add_param DSCP2QMAP "queueForDscp63" "BE"
						add_param DSCP2QMAP "queueForDscp7" "BE"
						add_param DSCP2QMAP "queueForDscp8" "BE"
						add_param DSCP2QMAP "queueForDscp9" "BE"

						for_range 0 64
							begin
								define "dscpIter" $current_index
								for_list QOS_OLD "dscpMap"
									begin
										if ( get_param QOS_OLD "dscpMap." JOIN $current_index JOIN ".dscp" ) == dscpIter
											begin
												define "val" get_param QOS_OLD "dscpMap." JOIN $current_index JOIN ".vlanPrio"
												add_param DSCP2PCPMAP "vLanPrioForDscp" JOIN dscpIter val
												define "val" get_param QOS_OLD "dscpMap." JOIN $current_index JOIN ".queue"
												add_param DSCP2QMAP "queueForDscp" JOIN dscpIter val
											end
									end
							end
					end
					


					#####FLOWCL#####
					define "FLOWCL_COUNT" 1
					for_objects QOS_OLD JOIN "/FLOWCL"
						begin
							define "FLOWCL_OLD" $current_dist_name
							define "FLOWCL_NEW" QOS_NEW JOIN "/FLOWCL-" JOIN FLOWCL_COUNT
							copy_object FLOWCL_OLD FLOWCL_NEW
							add_param FLOWCL_NEW "oldDistname" FLOWCL_OLD

							define "FLOWCL_COUNT" FLOWCL_COUNT + 1

							#mandatory params which are optional in sbts16.10
							for_list FLOWCL_NEW "ruleSet"
								begin
									define "itemPrefix" "ruleSet." JOIN $current_index JOIN "."
									if ( not param_exist FLOWCL_NEW itemPrefix JOIN "srcSubnetPrefixLength" ) add_param FLOWCL_NEW itemPrefix JOIN "srcSubnetPrefixLength" "0"
								end
						end
					#####FLOWCL#####

					#####FSTSCH#####
					define "FSTSCH_COUNT" 1
					for_objects QOS_OLD JOIN "/FSTSCH"
						begin
							define "FSTSCH_OLD" $current_dist_name
							define "FSTSCH_NEW" QOS_NEW JOIN "/FSTSCH-" JOIN FSTSCH_COUNT
							copy_object FSTSCH_OLD FSTSCH_NEW
							add_param FSTSCH_NEW "oldDistname" FSTSCH_OLD

							define "FSTSCH_COUNT" FSTSCH_COUNT + 1

							#mandatory params which are optional in sbts16.10
							if ( not param_exist FSTSCH_NEW "sbs" ) add_param FSTSCH_NEW "sbs" "4000"
							if ( not param_exist FSTSCH_NEW "scdschWfqWeight" ) add_param FSTSCH_NEW "scdschWfqWeight" "1000"
							if ( not param_exist FSTSCH_NEW "sir" ) add_param FSTSCH_NEW "sir" "1000000"
							if ( not param_exist FSTSCH_NEW "spShapingRate" ) add_param FSTSCH_NEW "spShapingRate" "1000000"
							for_list FSTSCH_NEW "wfqWeightList"
								begin
									define "itemPrefix" "wfqWeightList." JOIN $current_index JOIN "."
									if ( not param_exist FSTSCH_NEW itemPrefix JOIN "weightAF1" )	add_param FSTSCH_NEW itemPrefix JOIN "weightAF1" "10"
									if ( not param_exist FSTSCH_NEW itemPrefix JOIN "weightAF2" ) add_param FSTSCH_NEW itemPrefix JOIN "weightAF2" "100"
									if ( not param_exist FSTSCH_NEW itemPrefix JOIN "weightAF3" ) add_param FSTSCH_NEW itemPrefix JOIN "weightAF3" "1000"
									if ( not param_exist FSTSCH_NEW itemPrefix JOIN "weightAF4" ) add_param FSTSCH_NEW itemPrefix JOIN "weightAF4" "10000"
									if ( not param_exist FSTSCH_NEW itemPrefix JOIN "weightBE" ) add_param FSTSCH_NEW itemPrefix JOIN "weightBE" "1"
								end
						end
					#####FSTSCH#####

			end
		#####QOS#####

		#####RTPOL#####
		define "RTPOL_COUNT" 1
		for_objects IPNO_OLD JOIN "/RTPOL"
			begin
				define "RTPOL_OLD" $current_dist_name
				define "RTPOL_NEW" IPNO_NEW JOIN "/RTPOL-" JOIN RTPOL_COUNT
				copy_object RTPOL_OLD RTPOL_NEW
				add_param RTPOL_NEW "oldDistname" RTPOL_OLD

				define "RTPOL_COUNT" RTPOL_COUNT + 1
			end
		#####RTPOL#####

	end
#####IPNO#####

#####IPAPP#####
define "IPAPP_COUNT" 1
for_objects "SBTS/TNL/IPAPP"
	begin
		define "IPAPP_OLD" $current_dist_name
		define "IPAPP_NEW" TNL_NEW JOIN "/IPAPP-" JOIN IPAPP_COUNT
		copy_object IPAPP_OLD IPAPP_NEW
		add_param IPAPP_NEW "oldDistname" IPAPP_OLD

		define "IPAPP_COUNT" IPAPP_COUNT + 1

		#####BFD#####
		define "BFD_COUNT" 1
		for_objects IPAPP_OLD JOIN "/BFD"
			begin
				define "BFD_OLD" $current_dist_name
				define "BFD_NEW" IPAPP_NEW JOIN "/BFD-" JOIN BFD_COUNT
				copy_object BFD_OLD BFD_NEW
				add_param BFD_NEW "oldDistname" BFD_OLD

				define "BFD_COUNT" BFD_COUNT + 1

				#mandatory params which are optional in sbts16.10
				if ( not param_exist BFD_NEW "bfdActivation" ) add_param BFD_NEW "bfdActivation" "false"
				if ( not param_exist BFD_NEW "bfdAdminUp" ) add_param BFD_NEW "bfdAdminUp" "true"
				if ( not param_exist BFD_NEW "bfdDetectMult" ) add_param BFD_NEW "bfdDetectMult" "3"
				if ( not param_exist BFD_NEW "bfdDscp" ) add_param BFD_NEW "bfdDscp" "48"
				if ( not param_exist BFD_NEW "bfdType" ) add_param BFD_NEW "bfdType" "singleHopBFD"
				define "val" get_param BFD_NEW "bfdType"
				if ( not param_exist BFD_NEW "bfdSrcUdpPort" )
					begin
						if ( val == "singleHopBFD" ) add_param BFD_NEW "bfdSrcUdpPort" "3784"
						if ( val == "multiHopBFD" ) add_param BFD_NEW "bfdSrcUdpPort" "4784"
					end
				if ( not param_exist BFD_NEW "desMinTxInt" ) add_param BFD_NEW "desMinTxInt" "500"
				if ( not param_exist BFD_NEW "reqMinRxInt" ) add_param BFD_NEW "reqMinRxInt" "500"

				# Get distName of matching IPADDRESSV4/V6
				define "MO_DISTNAME" BFD_NEW
				define "OLD_PARAM" "bfdSrcIpAddr"
				define "NEW_PARAM" "bfdSrcIpAddrDN"
				
				if ( param_exist MO_DISTNAME OLD_PARAM )
					begin
						define "targetIpAddr" get_param MO_DISTNAME OLD_PARAM
						for_objects "IPADDRESSV4"
							begin
								define "currentIpAddr" get_param $current_dist_name "localIpAddr"
								if ( currentIpAddr == targetIpAddr ) add_param MO_DISTNAME NEW_PARAM $current_dist_name
							end

						for_objects "IPADDRESSV6"
							begin
								define "currentIpAddr" get_param $current_dist_name "localIpAddr"
								if ( currentIpAddr == targetIpAddr ) add_param MO_DISTNAME NEW_PARAM $current_dist_name
							end
						del_param MO_DISTNAME OLD_PARAM
					end
			end
		#####BFD#####

		#####BFDGRP#####
		define "BFDGRP_COUNT" 1
		for_objects IPAPP_OLD JOIN "/BFDGRP"
			begin
				define "BFDGRP_OLD" $current_dist_name
				define "BFDGRP_NEW" IPAPP_NEW JOIN "/BFDGRP-" JOIN BFDGRP_COUNT
				copy_object BFDGRP_OLD BFDGRP_NEW
				add_param BFDGRP_NEW "oldDistname" BFDGRP_OLD

				if ( param_exist BFDGRP_NEW "bfdIdList" )
					begin
						copy_list BFDGRP_NEW "bfdIdList" BFDGRP_NEW "bfdDN"
						del_param BFDGRP_NEW "bfdIdList"
					end

				define "BFDGRP_COUNT" BFDGRP_COUNT + 1
			end
		#####BFDGRP#####

		#####IPSECC#####
		define "IPSECC_COUNT" 1
		for_objects IPAPP_OLD JOIN "/IPSECC"
			begin
				define "IPSECC_OLD" $current_dist_name
				define "IPSECC_NEW" IPAPP_NEW JOIN "/IPSECC-" JOIN IPSECC_COUNT
				copy_object IPSECC_OLD IPSECC_NEW
				add_param IPSECC_NEW "oldDistname" IPSECC_OLD

				define "IPSECC_COUNT" IPSECC_COUNT + 1

				#mandatory params which are optional in sbts16.10
				if ( not param_exist IPSECC_NEW "ikeDscp" ) add_param IPSECC_NEW "ikeDscp" "46"
				if ( not param_exist IPSECC_NEW "ipFragmentationAlgorithm" ) add_param IPSECC_NEW "ipFragmentationAlgorithm" "Pre-fragmentation"
				if ( not param_exist IPSECC_NEW "ipSecEnabled" ) add_param IPSECC_NEW "ipSecEnabled" "false"

				#delete params not in 17
				if ( param_exist IPSECC_NEW "ipSecEmBypassState" ) del_param IPSECC_NEW "ipSecEmBypassState"

				#####IKEP#####
				define "IKEP_COUNT" 1
				for_objects IPSECC_OLD JOIN "/IKEP"
					begin
						define "IKEP_OLD" $current_dist_name
						define "IKEP_NEW" IPSECC_NEW JOIN "/IKEP-" JOIN IKEP_COUNT
						copy_object IKEP_OLD IKEP_NEW
						add_param IKEP_NEW "oldDistname" IKEP_OLD

						define "IKEP_COUNT" IKEP_COUNT + 1

						#mandatory params which are optional in sbts16.10
						if ( not param_exist IKEP_NEW "connectionEstablishmentMode" ) add_param IKEP_NEW "connectionEstablishmentMode" "INITIATOR_AND_RESPONDER"
						if ( not param_exist IKEP_NEW "dpdDelay" ) add_param IKEP_NEW "dpdDelay" "10"
						if ( not param_exist IKEP_NEW "ikeDiffHellGrp" ) add_param IKEP_NEW "ikeDiffHellGrp" "DH2"
						if ( not param_exist IKEP_NEW "ikeEncryptionMethod" ) add_param IKEP_NEW "ikeEncryptionMethod" "ENC_AES_128_CBC_OR_3DES_192_CBC"
						if ( not param_exist IKEP_NEW "ikeMaxLifeTime" ) add_param IKEP_NEW "ikeMaxLifeTime" "86400"
						if ( not param_exist IKEP_NEW "ipsecPerfForwSecEnabled" ) add_param IKEP_NEW "ipsecPerfForwSecEnabled" "false"

						# Get distName of matching IPADDRESSV4/V6
						define "MO_DISTNAME" IKEP_NEW
						define "OLD_PARAM" "localTunnelEndpoint"
						define "NEW_PARAM" "localTunnelEndpointDN"
						
						if ( param_exist MO_DISTNAME OLD_PARAM )
							begin
								define "targetIpAddr" get_param MO_DISTNAME OLD_PARAM
								for_objects "IPADDRESSV4"
									begin
										define "currentIpAddr" get_param $current_dist_name "localIpAddr"
										if ( currentIpAddr == targetIpAddr ) add_param MO_DISTNAME NEW_PARAM $current_dist_name
									end

								for_objects "IPADDRESSV6"
									begin
										define "currentIpAddr" get_param $current_dist_name "localIpAddr"
										if ( currentIpAddr == targetIpAddr ) add_param MO_DISTNAME NEW_PARAM $current_dist_name
									end
								del_param MO_DISTNAME OLD_PARAM
							end
					end
				#####IKEP#####

				#####IKEPROTGRP#####
				define "IKEPROTGRP_COUNT" 1
				for_objects IPSECC_OLD JOIN "/IKEPROTGRP"
					begin
						define "IKEPROTGRP_OLD" $current_dist_name
						define "IKEPROTGRP_NEW" IPSECC_NEW JOIN "/IKEPROTGRP-" JOIN IKEPROTGRP_COUNT
						copy_object IKEPROTGRP_OLD IKEPROTGRP_NEW
						add_param IKEPROTGRP_NEW "oldDistname" IKEPROTGRP_OLD

						define "IKEPROTGRP_COUNT" IKEPROTGRP_COUNT + 1

						#mandatory params which are optional in sbts16.10
						if ( not param_exist IKEPROTGRP_NEW "switchBackMode" ) add_param IKEPROTGRP_NEW "switchBackMode" "AUTO"
						if ( not param_exist IKEPROTGRP_NEW "switchTimeMax" ) add_param IKEPROTGRP_NEW "switchTimeMax" "300"
						if ( not param_exist IKEPROTGRP_NEW "switchTimeMin" ) add_param IKEPROTGRP_NEW "switchTimeMin" "300"

						#value set by system
						if ( param_exist IKEPROTGRP_NEW "ikeProtState" ) del_param IKEPROTGRP_NEW "ikeProtState"

						#rename
						if ( param_exist IKEPROTGRP_NEW "ikepList" )
							begin
								copy_list IKEPROTGRP_NEW "ikepList" IKEPROTGRP_NEW "ikePList"
								del_param IKEPROTGRP_NEW "ikepList"
							end

						#####IKEPSWITCHREQ#####
						if ( param_exist IKEPROTGRP_NEW "switchRequest" )
							begin
								define "IKEPSWITCHREQ" IKEPROTGRP_NEW JOIN "/IKEPSWITCHREQ-1"
								add_object IKEPSWITCHREQ
								set_operation IKEPSWITCHREQ "create"
								
								define "val" get_param IKEPROTGRP_NEW "switchRequest"
								add_param IKEPSWITCHREQ "switchRequest" val
								del_param IKEPROTGRP_NEW "switchRequest"
							end
						#####IKEPSWITCHREQ#####
						
					end
				#####IKEPROTGRP#####

				#####IPSECP#####
				define "IPSECP_COUNT" 1
				for_objects IPSECC_OLD JOIN "/IPSECP"
					begin
						define "IPSECP_OLD" $current_dist_name
						define "IPSECP_NEW" IPSECC_NEW JOIN "/IPSECP-" JOIN IPSECP_COUNT
						copy_object IPSECP_OLD IPSECP_NEW
						add_param IPSECP_NEW "oldDistname" IPSECP_OLD

						define "IPSECP_COUNT" IPSECP_COUNT + 1

						#mandatory params which are optional in sbts16.10
						if ( not param_exist IPSECP_NEW "antiReplayEnabled" ) add_param IPSECP_NEW "antiReplayEnabled" "true"
						if ( not param_exist IPSECP_NEW "encryptionMethod" ) add_param IPSECP_NEW "encryptionMethod" "ENC_AES_128_CBC_OR_3DES_192_CBC"
						if ( not param_exist IPSECP_NEW "extendedSequenceNumberMode" ) add_param IPSECP_NEW "extendedSequenceNumberMode" "NORMAL_SEQUENCE"
						if ( not param_exist IPSECP_NEW "pfsDiffHellGrp" ) add_param IPSECP_NEW "pfsDiffHellGrp" "Priority list: 1st DH14, 2nd DH2"
						if ( not param_exist IPSECP_NEW "saMaxLifeTime" ) add_param IPSECP_NEW "saMaxLifeTime" "86400"
					end
				#####IPSECP#####
				
				#####SECPOL#####
				define "SECPOL_COUNT" 1
				for_objects IPSECC_OLD JOIN "/SECPOL"
					begin
						define "SECPOL_OLD" $current_dist_name
						define "SECPOL_NEW" IPSECC_NEW JOIN "/SECPOL-" JOIN SECPOL_COUNT
						copy_object SECPOL_OLD SECPOL_NEW
						add_param SECPOL_NEW "oldDistname" SECPOL_OLD

						define "SECPOL_COUNT" SECPOL_COUNT + 1

						#mandatory params which are optional in sbts16.10
						if ( not param_exist SECPOL_NEW "ipSecAction" ) add_param SECPOL_NEW "ipSecAction" "PROTECT"
						for_list SECPOL_NEW "trafficSelectorList"
							begin
								define "itemPrefix" "trafficSelectorList." JOIN $current_index JOIN "."
								if ( not param_exist SECPOL_NEW itemPrefix JOIN "localIpPrefixLength" )	add_param SECPOL_NEW itemPrefix JOIN "localIpPrefixLength" "0"
								if ( not param_exist SECPOL_NEW itemPrefix JOIN "protocol" ) add_param SECPOL_NEW itemPrefix JOIN "protocol" "-1"
								if ( not param_exist SECPOL_NEW itemPrefix JOIN "remoteIpPort" ) add_param SECPOL_NEW itemPrefix JOIN "remoteIpPort" "-1"
								if ( not param_exist SECPOL_NEW itemPrefix JOIN "remoteIpPrefixLength" ) add_param SECPOL_NEW itemPrefix JOIN "remoteIpPrefixLength" "-1"
							end
					end
				#####SECPOL#####

			end
		#####IPSECC#####

		#####TWAMP#####
		define "TWAMP_COUNT" 1
		for_objects IPAPP_OLD JOIN "/TWAMP"
			begin
				define "TWAMP_OLD" $current_dist_name
				define "TWAMP_NEW" IPAPP_NEW JOIN "/TWAMP-" JOIN TWAMP_COUNT
				copy_object TWAMP_OLD TWAMP_NEW
				add_param TWAMP_NEW "oldDistname" TWAMP_OLD

				define "TWAMP_COUNT" TWAMP_COUNT + 1

				#mandatory params which are optional in sbts16.10
				if ( not param_exist TWAMP_NEW "administrativeState" ) add_param TWAMP_NEW "administrativeState" "locked"
				if ( not param_exist TWAMP_NEW "destPort" ) add_param TWAMP_NEW "destPort" "5018"
				if ( not param_exist TWAMP_NEW "messageSize" ) add_param TWAMP_NEW "messageSize" "100"
				if ( not param_exist TWAMP_NEW "plrAlarmThreshold" ) add_param TWAMP_NEW "plrAlarmThreshold" "100"
				if ( not param_exist TWAMP_NEW "rttAlarmThreshold" ) add_param TWAMP_NEW "rttAlarmThreshold" "1000000"
				if ( not param_exist TWAMP_NEW "twampDscp" ) add_param TWAMP_NEW "twampDscp" "34"

				# Get distName of matching IPADDRESSV4/V6
				define "MO_DISTNAME" TWAMP_NEW
				define "OLD_PARAM" "sourceIpAddress"
				define "NEW_PARAM" "sourceIpAddressDN"
				
				if ( param_exist MO_DISTNAME OLD_PARAM )
					begin
						define "targetIpAddr" get_param MO_DISTNAME OLD_PARAM
						for_objects "IPADDRESSV4"
							begin
								define "currentIpAddr" get_param $current_dist_name "localIpAddr"
								if ( currentIpAddr == targetIpAddr ) add_param MO_DISTNAME NEW_PARAM $current_dist_name
							end

						for_objects "IPADDRESSV6"
							begin
								define "currentIpAddr" get_param $current_dist_name "localIpAddr"
								if ( currentIpAddr == targetIpAddr ) add_param MO_DISTNAME NEW_PARAM $current_dist_name
							end
						del_param MO_DISTNAME OLD_PARAM
					end
			end
		#####TWAMP#####

	end
#####IPAPP#####

#####P3LP#####
define "P3LP_COUNT" 1
for_objects "SBTS/TNL/P3LP"
	begin
		define "P3LP_OLD" $current_dist_name
		define "P3LP_NEW" TNL_NEW JOIN "/P3LP-" JOIN P3LP_COUNT
		copy_object P3LP_OLD P3LP_NEW
		add_param P3LP_NEW "oldDistname" P3LP_OLD

		define "P3LP_COUNT" P3LP_COUNT + 1

		#mandatory params which are optional in sbts16.10
		if ( not param_exist P3LP_NEW "acfcTarget" ) add_param P3LP_NEW "acfcTarget" "IN_USE"
		if ( not param_exist P3LP_NEW "lcpEchoEnabled" ) add_param P3LP_NEW "lcpEchoEnabled" "true"
		if ( not param_exist P3LP_NEW "localMruTarget" ) add_param P3LP_NEW "localMruTarget" "1500"
		if ( not param_exist P3LP_NEW "magicNumberUsage" ) add_param P3LP_NEW "magicNumberUsage" "IN_USE"
		if ( not param_exist P3LP_NEW "pfcTarget" ) add_param P3LP_NEW "pfcTarget" "IN_USE"

		#delete params not in 17
		if ( param_exist P3LP_NEW "acFieldCompressionOn" ) del_param P3LP_NEW "acFieldCompressionOn"
		if ( param_exist P3LP_NEW "lcpEcho" ) del_param P3LP_NEW "lcpEcho"
		if ( param_exist P3LP_NEW "lcpEchoFailure" ) del_param P3LP_NEW "lcpEchoFailure"
		if ( param_exist P3LP_NEW "lcpMaxConfigure" ) del_param P3LP_NEW "lcpMaxConfigure"
		if ( param_exist P3LP_NEW "lcpMaxFailure" ) del_param P3LP_NEW "lcpMaxFailure"
		if ( param_exist P3LP_NEW "lcpMaxTerminate" ) del_param P3LP_NEW "lcpMaxTerminate"
		if ( param_exist P3LP_NEW "lcpRestartTimer" ) del_param P3LP_NEW "lcpRestartTimer"
		if ( param_exist P3LP_NEW "localMruresult" ) del_param P3LP_NEW "localMruresult"
		if ( param_exist P3LP_NEW "magicNumberOn" ) del_param P3LP_NEW "magicNumberOn"
		if ( param_exist P3LP_NEW "mruSize" ) del_param P3LP_NEW "mruSize"
		if ( param_exist P3LP_NEW "protocolFieldCompressionOn" ) del_param P3LP_NEW "protocolFieldCompressionOn"
	end
#####P3LP#####

#####P3ML#####
define "P3ML_COUNT" 1
for_objects "SBTS/TNL/P3ML"
	begin
		define "P3ML_OLD" $current_dist_name
		define "P3ML_NEW" TNL_NEW JOIN "/P3ML-" JOIN P3ML_COUNT
		copy_object P3ML_OLD P3ML_NEW
		add_param P3ML_NEW "oldDistname" P3ML_OLD

		define "P3ML_COUNT" P3ML_COUNT + 1

		#mandatory params which are optional in sbts16.10
		if ( not param_exist P3ML_NEW "administrativeState" ) add_param P3ML_NEW "administrativeState" "locked"
		if ( not param_exist P3ML_NEW "endPointDiscriminatorUsageEnabled" ) add_param P3ML_NEW "endPointDiscriminatorUsageEnabled" "false"
		if ( not param_exist P3ML_NEW "ipcpEncapsulation" ) add_param P3ML_NEW "ipcpEncapsulation" "WITH_MLPPP_HEADERS"
		if ( not param_exist P3ML_NEW "ipHeaderCompressionUsage" ) add_param P3ML_NEW "ipHeaderCompressionUsage" "NOT_IN_USE"
		if ( not param_exist P3ML_NEW "mpFragmentSize" ) add_param P3ML_NEW "mpFragmentSize" "FRAGMENT_SIZE_AUTOMATIC"
		if ( not param_exist P3ML_NEW "multiClassTarget" ) add_param P3ML_NEW "multiClassTarget" "MC0"
		if ( not param_exist P3ML_NEW "shortSeqNbrFormatUsageEnabled" ) add_param P3ML_NEW "shortSeqNbrFormatUsageEnabled" "false"

		#delete params not in 17
		if ( param_exist P3ML_NEW "dscpMC2Mapping" ) del_param P3ML_NEW "dscpMC2Mapping"
		if ( param_exist P3ML_NEW "dscpMC4Mapping" ) del_param P3ML_NEW "dscpMC4Mapping"
		if ( param_exist P3ML_NEW "endPointDiscriminatorUsage" ) del_param P3ML_NEW "endPointDiscriminatorUsage"
		if ( param_exist P3ML_NEW "fMaxPeriodLocalTarget" ) del_param P3ML_NEW "fMaxPeriodLocalTarget"
		if ( param_exist P3ML_NEW "fMaxTimeLocalTarget" ) del_param P3ML_NEW "fMaxTimeLocalTarget"
		if ( param_exist P3ML_NEW "maxHeaderLocalTarget" ) del_param P3ML_NEW "maxHeaderLocalTarget"
		if ( param_exist P3ML_NEW "nonTcpSpaceLocalTarget" ) del_param P3ML_NEW "nonTcpSpaceLocalTarget"
		if ( param_exist P3ML_NEW "remoteIpAddr" ) del_param P3ML_NEW "remoteIpAddr"
		if ( param_exist P3ML_NEW "shortSeqNbrFormatusage" ) del_param P3ML_NEW "shortSeqNbrFormatusage"

		# P3ML/DSCP2MC2MAP
		if ( param_exist P3ML_OLD "dscpToMcmpClass2Map" )
			begin
				define "DSCP2MC2MAP" P3ML_NEW JOIN "/DSCP2MC2MAP-1"
				add_object DSCP2MC2MAP
				set_operation DSCP2MC2MAP "create"
				del_param P3ML_NEW "dscpToMcmpClass2Map"

				# set default values
				add_param DSCP2MC2MAP "mc2ForDscp0" "MCMP_CLASS_2"
				add_param DSCP2MC2MAP "mc2ForDscp1" "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 "mc2ForDscp2" "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 "mc2ForDscp3" "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 "mc2ForDscp4" "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 "mc2ForDscp5" "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 "mc2ForDscp6" "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 "mc2ForDscp7" "MCMP_CLASS_2"
				add_param DSCP2MC2MAP "mc2ForDscp8" "MCMP_CLASS_2"
				add_param DSCP2MC2MAP "mc2ForDscp9" "MCMP_CLASS_2"
				
				for_range 0 63
					begin
						define "dscpIter" $current_index
						for_list P3ML_OLD "dscpToMcmpClass2Map"
							begin
								if ( get_param P3ML_OLD "dscpToMcmpClass2Map." JOIN $current_index JOIN ".dscp" ) == dscpIter
									begin
										define "val" get_param P3ML_OLD "dscpToMcmpClass2Map." JOIN $current_index JOIN ".mcmpClass"
										add_param DSCP2MC2MAP "mc2ForDscp" JOIN dscpIter val
									end
							end
					end
			end

		# P3ML/DSCP2MC4MAP
		if ( param_exist P3ML_OLD "dscpToMcmpClass4Map" )
			begin
				define "DSCP2MC4MAP" P3ML_NEW JOIN "/DSCP2MC4MAP-1"
				add_object DSCP2MC4MAP
				set_operation DSCP2MC4MAP "create"

				del_param P3ML_NEW "dscpToMcmpClass4Map"

				# set default values
				add_param DSCP2MC4MAP "mc4ForDscp0" "MCMP_CLASS_4"
				add_param DSCP2MC4MAP "mc4ForDscp1" "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 "mc4ForDscp2" "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 "mc4ForDscp3" "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 "mc4ForDscp4" "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 "mc4ForDscp5" "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 "mc4ForDscp6" "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 "mc4ForDscp7" "MCMP_CLASS_4"
				add_param DSCP2MC4MAP "mc4ForDscp8" "MCMP_CLASS_4"
				add_param DSCP2MC4MAP "mc4ForDscp9" "MCMP_CLASS_4"
				
				for_range 0 63
					begin
						define "dscpIter" $current_index
						for_list P3ML_OLD "dscpToMcmpClass4Map"
							begin
								if ( get_param P3ML_OLD "dscpToMcmpClass4Map." JOIN $current_index JOIN ".dscp" ) == dscpIter
									begin
										define "val" get_param P3ML_OLD "dscpToMcmpClass4Map." JOIN $current_index JOIN ".mcmpClass"
										add_param DSCP2MC4MAP "mc4ForDscp" JOIN dscpIter val
									end
							end
					end
			end

	end
#####P3ML#####

#####P3SL#####
define "P3SL_COUNT" 1
for_objects "SBTS/TNL/P3SL"
	begin
		define "P3SL_OLD" $current_dist_name
		define "P3SL_NEW" TNL_NEW JOIN "/P3SL-" JOIN P3SL_COUNT
		copy_object P3SL_OLD P3SL_NEW
		add_param P3SL_NEW "oldDistname" P3SL_OLD

		define "P3SL_COUNT" P3SL_COUNT + 1

		#mandatory params which are optional in sbts16.10
		add_param P3SL_NEW "administrativeState" "locked"

		#delete params not in 17
		if ( param_exist P3SL_NEW "fMaxPeriodLocalTarget" ) del_param P3SL_NEW "fMaxPeriodLocalTarget"
		if ( param_exist P3SL_NEW "fMaxTimeLocalTarget" ) del_param P3SL_NEW "fMaxTimeLocalTarget"
		if ( param_exist P3SL_NEW "interfaces" ) del_param P3SL_NEW "interfaces"
		if ( param_exist P3SL_NEW "ipHeaderCompression" ) del_param P3SL_NEW "ipHeaderCompression"
		if ( param_exist P3SL_NEW "maxHeaderLocalTarget" ) del_param P3SL_NEW "maxHeaderLocalTarget"
		if ( param_exist P3SL_NEW "nonTcpSpaceLocalTarget" ) del_param P3SL_NEW "nonTcpSpaceLocalTarget"
		if ( param_exist P3SL_NEW "nonTcpSpacePeerTarget" ) del_param P3SL_NEW "nonTcpSpacePeerTarget"
		if ( param_exist P3SL_NEW "remoteIpAddr" ) del_param P3SL_NEW "remoteIpAddr"
	end
#####P3SL#####

#####PMTNL#####
define "PM" SBTS JOIN "/MGMNT-1/PM-1"
define "PMTNL" TNL_NEW JOIN "/PMTNL-1"
add_object PMTNL
set_operation PMTNL "create"

if ( param_exist PM "bridgePortStatisticsInterval" ) add_param PMTNL "bridgePortStatisticsInterval" get_param PM "bridgePortStatisticsInterval"
if ( param_exist PM "ethernetInterfaceStatisticsInterval" ) add_param PMTNL "ethernetInterfaceStatisticsInterval" get_param PM "ethernetInterfaceStatisticsInterval"
if ( param_exist PM "ethernetLinkInterval" ) add_param PMTNL "ethernetLinkInterval" get_param PM "ethernetLinkInterval"
if ( param_exist PM "firstLevelSchedulerStatisticsInterval" ) add_param PMTNL "firstLevelSchedulerStatisticsInterval" get_param PM "firstLevelSchedulerStatisticsInterval"
if ( param_exist PM "ipFilteringInterval" ) add_param PMTNL "ipFilteringInterval" get_param PM "ipFilteringInterval"
if ( param_exist PM "ipInterfaceStatisticsInterval" ) add_param PMTNL "ipInterfaceStatisticsInterval" get_param PM "ipInterfaceStatisticsInterval"
if ( param_exist PM "ipNodeStatisticsInterval" ) add_param PMTNL "ipNodeStatisticsInterval" get_param PM "ipNodeStatisticsInterval"
if ( param_exist PM "ipPerHopBehaviourStatisticsInterval" ) add_param PMTNL "ipPerHopBehaviourStatisticsInterval" get_param PM "ipPerHopBehaviourStatisticsInterval"
if ( param_exist PM "ipSecSaStatisticsInterval" ) add_param PMTNL "ipSecSaStatisticsInterval" get_param PM "ipSecSaStatisticsInterval"
if ( param_exist PM "ipSecStatisticsInterval" ) add_param PMTNL "ipSecStatisticsInterval" get_param PM "ipSecStatisticsInterval"
#if ( param_exist PM "ipV4InterfaceStatisticsInterval" ) add_param PMTNL "ipV4InterfaceStatisticsInterval" get_param PM "ipV4InterfaceStatisticsInterval"
#if ( param_exist PM "ipV6InterfaceStatisticsInterval" ) add_param PMTNL "ipV6InterfaceStatisticsInterval" get_param PM "ipV6InterfaceStatisticsInterval"
if ( param_exist PM "pdhInterfaceStatisticsInterval" ) add_param PMTNL "pdhInterfaceStatisticsInterval" get_param PM "pdhInterfaceStatisticsInterval"
if ( param_exist PM "pppLinkStatisticsInterval" ) add_param PMTNL "pppLinkStatisticsInterval" get_param PM "pppLinkStatisticsInterval"
if ( param_exist PM "pppMultiLinkStatisticsInterval" ) add_param PMTNL "pppMultiLinkStatisticsInterval" get_param PM "pppMultiLinkStatisticsInterval"
if ( param_exist PM "pppSingleLinkStatisticsInterval" ) add_param PMTNL "pppSingleLinkStatisticsInterval" get_param PM "pppSingleLinkStatisticsInterval"
if ( param_exist PM "sctpStatisticsInterval" ) add_param PMTNL "sctpStatisticsInterval" get_param PM "sctpStatisticsInterval"
if ( param_exist PM "secondLevelSchedulerStatisticsInterval" ) add_param PMTNL "secondLevelSchedulerStatisticsInterval" get_param PM "secondLevelSchedulerStatisticsInterval"
if ( param_exist PM "tcpUdpStatisticsInterval" ) add_param PMTNL "tcpUdpStatisticsInterval" get_param PM "tcpUdpStatisticsInterval"
if ( param_exist PM "twampStatisticsInterval" ) add_param PMTNL "twampStatisticsInterval" get_param PM "twampStatisticsInterval"
if ( param_exist PM "vlanStatisticsInterval" ) add_param PMTNL "vlanStatisticsInterval" get_param PM "vlanStatisticsInterval"
#####PMTNL#####

#####PPTT#####
define "PPTT_COUNT" 1
for_objects "SBTS/TNL/PPTT"
	begin
		define "PPTT_OLD" $current_dist_name
		define "PPTT_NEW" TNL_NEW JOIN "/PPTT-" JOIN PPTT_COUNT
		copy_object PPTT_OLD PPTT_NEW
		add_param PPTT_NEW "oldDistname" PPTT_OLD

		define "PPTT_COUNT" PPTT_COUNT + 1

		#mandatory params which are optional in sbts16.10
		if ( not param_exist PPTT_NEW "administrativeState" ) add_param PPTT_NEW "administrativeState" "unlocked"
		if ( not param_exist PPTT_NEW "pdhLineType" ) add_param PPTT_NEW "pdhLineType" "PDH_LINE_TYPE_MULTI_FRAME_G704"
	end
#####PPTT#####

#####TRIGGER#####
define "TRIGGER_COUNT" 1
for_objects "SBTS/TNL/TRIGGER"
	begin
		define "TRIGGER_OLD" $current_dist_name
		define "TRIGGER_NEW" TNL_NEW JOIN "/TRIGGER-" JOIN TRIGGER_COUNT
		copy_object TRIGGER_OLD TRIGGER_NEW
		add_param TRIGGER_NEW "oldDistname" TRIGGER_OLD

		define "TRIGGER_COUNT" TRIGGER_COUNT + 1

		#mandatory params which are optional in sbts16.10
		if ( not param_exist TRIGGER_NEW "false2TrueDelay" ) add_param TRIGGER_NEW "false2TrueDelay" "0"
		if ( not param_exist TRIGGER_NEW "logic" ) add_param TRIGGER_NEW "logic" "OR"
		if ( not param_exist TRIGGER_NEW "true2FalseDelay" ) add_param TRIGGER_NEW "true2FalseDelay" "0"
	end
#####TRIGGER#####

# delete SBTS MOs
for_objects "SBTS/TNL/ETHSVC" del_object $current_dist_name
for_objects "SBTS/TNL/ETHSVC/ETHIF" del_object $current_dist_name
for_objects "SBTS/TNL/ETHSVC/ETHIF/VLANIF" del_object $current_dist_name
for_objects "SBTS/TNL/ETHSVC/ETHLK" del_object $current_dist_name
for_objects "SBTS/TNL/ETHSVC/L2SWI" del_object $current_dist_name
for_objects "SBTS/TNL/ETHSVC/L2SWI/BRGPRT" del_object $current_dist_name
for_objects "SBTS/TNL/ETHSVC/L2SWI/IBRGPRT" del_object $current_dist_name
for_objects "SBTS/TNL/FRLI" del_object $current_dist_name
for_objects "SBTS/TNL/IPAPP" del_object $current_dist_name
for_objects "SBTS/TNL/IPAPP/BFD" del_object $current_dist_name
for_objects "SBTS/TNL/IPAPP/BFDGRP" del_object $current_dist_name
for_objects "SBTS/TNL/IPAPP/IPSECC" del_object $current_dist_name
for_objects "SBTS/TNL/IPAPP/IPSECC/IKEP" del_object $current_dist_name
for_objects "SBTS/TNL/IPAPP/IPSECC/IKEPROTGRP" del_object $current_dist_name
for_objects "SBTS/TNL/IPAPP/IPSECC/IPSECP" del_object $current_dist_name
for_objects "SBTS/TNL/IPAPP/IPSECC/SECPOL" del_object $current_dist_name
for_objects "SBTS/TNL/IPAPP/TWAMP" del_object $current_dist_name
for_objects "SBTS/TNL/IPNO" del_object $current_dist_name
for_objects "SBTS/TNL/IPNO/IPIF" del_object $current_dist_name
for_objects "SBTS/TNL/IPNO/IPRT" del_object $current_dist_name
for_objects "SBTS/TNL/IPNO/IPRTV6" del_object $current_dist_name
for_objects "SBTS/TNL/IPNO/MCAPP" del_object $current_dist_name
for_objects "SBTS/TNL/IPNO/QOS" del_object $current_dist_name
for_objects "SBTS/TNL/IPNO/QOS/FLOWCL" del_object $current_dist_name
for_objects "SBTS/TNL/IPNO/QOS/FSTSCH" del_object $current_dist_name
for_objects "SBTS/TNL/IPNO/RTPOL" del_object $current_dist_name
for_objects "SBTS/TNL/P3LP" del_object $current_dist_name
for_objects "SBTS/TNL/P3ML" del_object $current_dist_name
for_objects "SBTS/TNL/P3SL" del_object $current_dist_name
for_objects "SBTS/TNL/PPTT" del_object $current_dist_name
for_objects "SBTS/TNL/TRIGGER" del_object $current_dist_name
	
# add values for new "distname parameters"
define "MO" "ETHIF"
define "OLD_PARAM" "linkSelector"
define "NEW_PARAM" "linkSelectorDN"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name
		define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM

		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			define "MO_REF" "BRGPRT"
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE" replace MO_REF_OLD_INSTANCE "(.*\/)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			define "MO_REF" "IBRGPRT"
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE" replace MO_REF_OLD_INSTANCE "(.*\/)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end
	end

define "MO" "BRGPRT"
define "OLD_PARAM" "ethlkId"
define "NEW_PARAM" "ethlkDN"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name
		define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM

		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			define "MO_REF" "ETHLK"
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			# del_param MO_DISTNAME OLD_PARAM
		end
	end

define "MO" "FRLI"
define "OLD_PARAM" "ppttId"
define "NEW_PARAM" "ppttDN"
define "MO_REF" "PPTT"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end
	end

define "MO" "SECPOL"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

		define "OLD_PARAM" "ikepRef"
		define "NEW_PARAM" "ikePDN"
		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
			define "MO_REF" "IKEP"
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE" replace MO_REF_OLD_INSTANCE "(.*\/)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			define "MO_REF" "IKEPROTGRP"
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE" replace MO_REF_OLD_INSTANCE "(.*\/)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end
		
		define "OLD_PARAM" "ipsecpId"
		define "NEW_PARAM" "ipSecPDN"
		define "MO_REF" "IPSECP"
		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end
		
		define "OLD_PARAM" "triggerId"
		define "NEW_PARAM" "triggerDN"
		define "MO_REF" "TRIGGER"
		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
			# if value is empty in sbts16.10, make value empty for sbts17
			add_param MO_DISTNAME NEW_PARAM ""
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end

	end

define "MO" "IPIF"
define "OLD_PARAM" "interfacePtr"
define "NEW_PARAM" "interfaceDN"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
			
			# if value is empty in sbts16.10, make value "virtual" for sbts17
			add_param MO_DISTNAME NEW_PARAM "virtual"

			define "MO_REF" "ETHIF"
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE" replace MO_REF_OLD_INSTANCE "(.*\/)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			define "MO_REF" "P3ML"
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE" replace MO_REF_OLD_INSTANCE "(.*\/)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			define "MO_REF" "P3SL"
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE" replace MO_REF_OLD_INSTANCE "(.*\/)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			# special case since value is ETHIF-x/VLANIF-y
			define "MO_REF" "VLANIF"
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE" replace MO_REF_OLD_INSTANCE ".*ETHSVC-1\/" "" flags "g"
					
#					add_param MO_DISTNAME "vlanz" MO_REF_OLD_INSTANCE
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end
	end

define "MO" "MCAPP"
define "OLD_PARAM" "ipIfId"
define "NEW_PARAM" "ipIfDN"
define "MO_REF" "IPIF"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name
		define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM

		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end
	end

define "MO" "FLOWCL"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

		define "OLD_PARAM" "defaultFstschId"
		define "NEW_PARAM" "defaultFstSchDN"
		define "MO_REF" "FSTSCH"
		define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end

		define "OLD_PARAM" "ipIfIdList"
		define "NEW_PARAM" "ipIfDN"
		define "MO_REF" "IPIF"
		define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end

		define "LIST_NAME" "ruleSet"
		define "OLD_LIST_PARAM" "fstSchId"
		define "NEW_LIST_PARAM" "fstSchDN"
		define "MO_REF" "FSTSCH"
		for_list MO_DISTNAME LIST_NAME
			begin
				define "OLD_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN OLD_LIST_PARAM
				if ( param_exist MO_DISTNAME OLD_PARAM )
				begin
					define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
							
							define "NEW_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN NEW_LIST_PARAM
							if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					del_param MO_DISTNAME OLD_PARAM
				end
			end
	end

define "MO" "P3LP"
define "OLD_PARAM" "frliId"
define "NEW_PARAM" "frliDN"
define "MO_REF" "FRLI"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name
		define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM

		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end
	end

define "MO" "P3ML"
define "OLD_SCALAR_LIST" "p3LpId"
define "NEW_SCALAR_LIST" "p3LpDN"
define "MO_REF" "P3LP"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name
		add_list MO_DISTNAME NEW_SCALAR_LIST

		for_list MO_DISTNAME OLD_SCALAR_LIST
			begin
				define "PARAM_TO_SEARCH" $current_value
				for_objects MO_REF
					begin
						define "MO_REF_DISTNAME" $current_dist_name
						define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
						define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
						
						if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_SCALAR_LIST JOIN "." JOIN $current_index MO_REF_DISTNAME
					end

			end
		del_param MO_DISTNAME OLD_SCALAR_LIST
	end

define "MO" "P3SL"
define "OLD_PARAM" "p3LpId"
define "NEW_PARAM" "p3LpDN"
define "MO_REF" "P3LP"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name
		define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM

		if ( param_exist MO_DISTNAME OLD_PARAM )
		begin
			for_objects MO_REF
				begin
					define "MO_REF_DISTNAME" $current_dist_name
					define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
					define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
					
					if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
				end

			del_param MO_DISTNAME OLD_PARAM
		end
	end
	
define "MO" "IKEPROTGRP"
define "LIST_NAME" "ikePList"
define "OLD_LIST_PARAM" "ikepId"
define "NEW_LIST_PARAM" "ikePDN"
define "MO_REF" "IKEP"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

		for_list MO_DISTNAME LIST_NAME
			begin
				define "OLD_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN OLD_LIST_PARAM
				if ( param_exist MO_DISTNAME OLD_PARAM )
				begin
					define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
							
							define "NEW_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN NEW_LIST_PARAM
							if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					del_param MO_DISTNAME OLD_PARAM
				end
			end
	end
	
define "MO" "IPRT"
define "LIST_NAME" "staticRoutes"
define "OLD_LIST_PARAM" "triggerId"
define "NEW_LIST_PARAM" "triggerDN"
define "MO_REF" "TRIGGER"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

		for_list MO_DISTNAME LIST_NAME
			begin
				define "OLD_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN OLD_LIST_PARAM
				if ( param_exist MO_DISTNAME OLD_PARAM )
				begin
					define "NEW_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN NEW_LIST_PARAM
					# if value is empty in sbts16.10, make value empty for sbts17
					add_param MO_DISTNAME NEW_PARAM ""

					define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					del_param MO_DISTNAME OLD_PARAM
				end
			end
	end
	
define "MO" "IPRTV6"
define "LIST_NAME" "staticIpv6Routes"
define "OLD_LIST_PARAM" "triggerId"
define "NEW_LIST_PARAM" "triggerDN"
define "MO_REF" "TRIGGER"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

		for_list MO_DISTNAME LIST_NAME
			begin
				define "OLD_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN OLD_LIST_PARAM
				if ( param_exist MO_DISTNAME OLD_PARAM )
				begin
					define "NEW_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN NEW_LIST_PARAM
					# if value is empty in sbts16.10, make value empty for sbts17
					add_param MO_DISTNAME NEW_PARAM ""

					define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					del_param MO_DISTNAME OLD_PARAM
				end
			end
	end
	
define "MO" "RTPOL"
define "LIST_NAME" "routingPolicies"
define "OLD_LIST_PARAM" "routingTablePtr"
define "NEW_LIST_PARAM" "routingTableDN"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

		for_list MO_DISTNAME LIST_NAME
			begin
				define "OLD_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN OLD_LIST_PARAM

				if ( param_exist MO_DISTNAME OLD_PARAM )
				begin
					define "NEW_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN NEW_LIST_PARAM
					define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM

					define "MO_REF" "IPRT"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD_INSTANCE" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD_INSTANCE" replace MO_REF_OLD_INSTANCE "(.*\/)+" "" flags "g"
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IPRTV6"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD_INSTANCE" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD_INSTANCE" replace MO_REF_OLD_INSTANCE "(.*\/)+" "" flags "g"
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					del_param MO_DISTNAME OLD_PARAM
				end
			end
	end
	
define "MO" "BFDGRP"
define "SCALAR_LIST_NAME" "bfdDN"
define "MO_REF" "BFD"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

		for_list MO_DISTNAME SCALAR_LIST_NAME
			begin
				define "PARAM_TO_SEARCH" $current_value
				for_objects MO_REF
					begin
						define "MO_REF_DISTNAME" $current_dist_name
						define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
						define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
						
						if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID ) add_param MO_DISTNAME SCALAR_LIST_NAME JOIN "." JOIN $current_index MO_REF_DISTNAME
					end
			end
	end
	
define "MO" "FSTSCH"
define "SCALAR_LIST_NAME" "ipIfIdList"
define "MO_REF" "IPIF"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

        if not ( param_exist MO_DISTNAME "ipIfDN" )
            begin
                add_list MO_DISTNAME "ipIfDN"
            end

		for_list MO_DISTNAME SCALAR_LIST_NAME
			begin
				define "PARAM_TO_SEARCH" $current_value
				for_objects MO_REF
					begin
						define "MO_REF_DISTNAME" $current_dist_name
						define "MO_REF_OLD_INSTANCE_ID" get_param MO_REF_DISTNAME "oldDistname"
						define "MO_REF_OLD_INSTANCE_ID" replace MO_REF_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
						
						if ( PARAM_TO_SEARCH == MO_REF_OLD_INSTANCE_ID )
                            begin
                                add_param MO_DISTNAME "ipIfDN." JOIN $current_index MO_REF_DISTNAME
                            end
					end
			end
        del_param MO_DISTNAME SCALAR_LIST_NAME
	end
	
define "MO" "TRIGGER"
define "LIST_NAME" "itemList"
define "OLD_LIST_PARAM" "itemPointer"
define "NEW_LIST_PARAM" "itemDN"
for_objects MO
	begin
		define "MO_DISTNAME" $current_dist_name

		for_list MO_DISTNAME LIST_NAME
			begin
				define "OLD_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN OLD_LIST_PARAM
				if ( param_exist MO_DISTNAME OLD_PARAM )
				begin
					define "NEW_PARAM" LIST_NAME JOIN "." JOIN $current_index JOIN "." JOIN NEW_LIST_PARAM
					define "PARAM_TO_SEARCH" get_param MO_DISTNAME OLD_PARAM
					
					define "MO_REF" "ETHIF"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "VLANIF"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "ETHIF"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "ETHLK"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "L2SWI"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "BRGPRT"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IBRGPRT"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "FRLI"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IPAPP"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "BFD"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "BFDGRP"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IPSECC"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IKEP"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IKEPROTGRP"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IPSECP"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "SECPOL"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "TWAMP"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IPNO"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IPIF"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IPRT"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "IPRTV6"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "MCAPP"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "MCGROUP"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "QOS"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "FLOWCL"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "FSTSCH"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "RTPOL"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "P3LP"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "P3ML"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "P3SL"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					define "MO_REF" "PPTT"
					for_objects MO_REF
						begin
							define "MO_REF_DISTNAME" $current_dist_name
							define "MO_REF_OLD" get_param MO_REF_DISTNAME "oldDistname"
							define "MO_REF_OLD" replace MO_REF_OLD ".*TNL-1\/" "" flags "g"
							define "MO_REF_OLD" "TNL-1/" JOIN MO_REF_OLD
							
							if ( PARAM_TO_SEARCH == MO_REF_OLD ) add_param MO_DISTNAME NEW_PARAM MO_REF_DISTNAME
						end

					del_param MO_DISTNAME OLD_PARAM
				end
			end
	end

# replace ETHLK reference in SBTS/SYNC/SYNCE
for_objects "SBTS/SYNC/SYNCE"
	begin
		define "synceDn" $current_dist_name

		if ( param_exist synceDn "ethlkId" )
			begin
				define "ethlkId" get_param synceDn "ethlkId"

				for_objects "MRBTS/TNLSVC/TNL/ETHSVC/ETHLK"
					begin
						define "ethlkDn" $current_dist_name
						define "ETHLK_OLD_INSTANCE_ID" get_param ethlkDn "oldDistname"
						define "ETHLK_OLD_INSTANCE_ID" replace ETHLK_OLD_INSTANCE_ID "(.*\-)+" "" flags "g"
						
						if ( ethlkId == ETHLK_OLD_INSTANCE_ID ) add_param synceDn "ethlkId" $current_ETHLK
					end
			end
	end


#PR294785 fix: to disable GSM TDM fallback feature any SECPOL MO with defined triggerDN (pointing to an existitng TRIGGER MO) should be removed.
for_objects "MRBTS/TNLSVC/TNL/IPAPP/IPSECC/SECPOL"
	begin
		if ( param_exist $current_dist_name "triggerDN" )
			begin
				define "triggDN" get_param $current_dist_name "triggerDN"
				if ( param_exist triggDN "false2TrueDelay" ) del_object $current_dist_name
			end
	end	
	
for_objects "IPRT"
    begin
        define "iprtDn" $current_dist_name
            for_list iprtDn "staticRoutes"
                begin
                    del_param iprtDn "staticRoutes." JOIN $current_index JOIN ".triggerId"
                end
    end

# set operation and version to all
# delete temporary parameter oldDistname
	
for_objects "ETHIF"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "VLANIF"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "ETHLK"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "L2SWI"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "BRGPRT"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IBRGPRT"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "DSCPTOQMAP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "PCP2QMAP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "FRLI"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IPAPP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "BFD"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "BFDGRP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IPSECC"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IKEP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IKEPROTGRP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IKEPSWITCHREQ"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IPSECP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "SECPOL"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "TWAMP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IPNO"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IPIF"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IPADDRESSV4"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IPADDRESSV6"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IPRT"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "IPRTV6"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "MCAPP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "QOS"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "DSCP2PCPMAP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "DSCP2QMAP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "FLOWCL"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "FSTSCH"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "RTPOL"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "P3LP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "P3ML"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "DSCP2MC2MAP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "DSCP2MC4MAP"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "P3SL"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "PMTNL"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "PPTT"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end
		
for_objects "TRIGGER"
	begin
		set_operation $current_dist_name "create"
		set_version $current_dist_name "TNL17_1610_001"
		del_param $current_dist_name "oldDistname"
		set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	end

for_objects "MRBTS/TNLSVC" set_adaptation $current_dist_name "com.nokia.srbts.tnl"
for_objects "MRBTS/TNLSVC/TNL" set_adaptation $current_dist_name "com.nokia.srbts.tnl"
for_objects "MRBTS/TNLSVC/TNL/ETHSVC" set_adaptation $current_dist_name "com.nokia.srbts.tnl"
	

