⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 megaco_per_media_gateway_control_prev3b.erl

📁 OTP是开放电信平台的简称
💻 ERL
📖 第 1 页 / 共 5 页
字号:
'dec_NonStandardData'(Bytes,_) ->%%  attribute number 1 with type NonStandardIdentifier{Term1,Bytes1} = 'dec_NonStandardIdentifier'(Bytes,telltype),%% attribute number 2 with type OCTET STRING{Term2,Bytes2} = ?RT_PER:decode_octet_string(Bytes1,[]),{{'NonStandardData',Term1,Term2},Bytes2}.'enc_StatisticsParameter'(Val) ->{Val1,Opt} = ?RT_PER:fixoptionals([3],1,Val),[Opt,%% attribute number 1 with type OCTET STRING?RT_PER:encode_octet_string([{'SizeConstraint',4}],?RT_PER:cindex(2,Val1,statName)),case ?RT_PER:cindex(3,Val1,statValue) ofasn1_NOVALUE -> [];Tmpval1 ->%% attribute number 2 with type Externaltypereference961megaco_per_media_gateway_control_prev3bValue'enc_Value'(Tmpval1)end].'dec_StatisticsParameter'(Bytes,_) ->{Opt,Bytes1} = ?RT_PER:getoptionals2(Bytes,1), %% attribute number 1 with type OCTET STRING{Term1,Bytes2} = ?RT_PER:decode_octet_string(Bytes1,[{'SizeConstraint',4}]),%%  attribute number 2 with type Value{Term2,Bytes3} = case Opt band (1 bsl 0) of_Opt1 when _Opt1 > 0 ->'dec_Value'(Bytes2,telltype);0 ->{asn1_NOVALUE,Bytes2}end,{{'StatisticsParameter',Term1,Term2},Bytes3}.'enc_StatisticsDescriptor'({'StatisticsDescriptor',Val}) ->'enc_StatisticsDescriptor'(Val);'enc_StatisticsDescriptor'(Val) ->[   ?RT_PER:encode_length(undefined,length(Val)),   'enc_StatisticsDescriptor_components'(Val, [])].'enc_StatisticsDescriptor_components'([], Acc) -> lists:reverse(Acc);'enc_StatisticsDescriptor_components'([H|T], Acc) ->'enc_StatisticsDescriptor_components'(T, ['enc_StatisticsParameter'(H) | Acc]).'dec_StatisticsDescriptor'(Bytes,_) ->{Num,Bytes1} = ?RT_PER:decode_length(Bytes,undefined),'dec_StatisticsDescriptor_components'(Num, Bytes1, telltype, []).'dec_StatisticsDescriptor_components'(0, Bytes, _, Acc) ->   {lists:reverse(Acc), Bytes};'dec_StatisticsDescriptor_components'(Num, Bytes, _, Acc) ->   {Term,Remain} = 'dec_StatisticsParameter'(Bytes,telltype),   'dec_StatisticsDescriptor_components'(Num-1, Remain, telltype, [Term|Acc]).'enc_PackagesItem'(Val) ->Val1 = ?RT_PER:list_to_record('PackagesItem', Val),[?RT_PER:setext(false), %% attribute number 1 with type OCTET STRING?RT_PER:encode_octet_string([{'SizeConstraint',2}],?RT_PER:cindex(2,Val1,packageName)),%% attribute number 2 with type INTEGER?RT_PER:encode_integer([{'ValueRange',{0,99}}],?RT_PER:cindex(3,Val1,packageVersion))].'dec_PackagesItem'(Bytes,_) ->{Ext,Bytes1} = ?RT_PER:getext(Bytes),%% attribute number 1 with type OCTET STRING{Term1,Bytes2} = ?RT_PER:decode_octet_string(Bytes1,[{'SizeConstraint',2}]),%% attribute number 2 with type INTEGER{Term2,Bytes3} = ?RT_PER:decode_integer(Bytes2,[{'ValueRange',{0,99}}]),{Extensions,Bytes4} = ?RT_PER:getextension(Ext,Bytes3),Bytes5= ?RT_PER:skipextensions(Bytes4,1,Extensions),{{'PackagesItem',Term1,Term2},Bytes5}.'enc_PackagesDescriptor'({'PackagesDescriptor',Val}) ->'enc_PackagesDescriptor'(Val);'enc_PackagesDescriptor'(Val) ->[   ?RT_PER:encode_length(undefined,length(Val)),   'enc_PackagesDescriptor_components'(Val, [])].'enc_PackagesDescriptor_components'([], Acc) -> lists:reverse(Acc);'enc_PackagesDescriptor_components'([H|T], Acc) ->'enc_PackagesDescriptor_components'(T, ['enc_PackagesItem'(H) | Acc]).'dec_PackagesDescriptor'(Bytes,_) ->{Num,Bytes1} = ?RT_PER:decode_length(Bytes,undefined),'dec_PackagesDescriptor_components'(Num, Bytes1, telltype, []).'dec_PackagesDescriptor_components'(0, Bytes, _, Acc) ->   {lists:reverse(Acc), Bytes};'dec_PackagesDescriptor_components'(Num, Bytes, _, Acc) ->   {Term,Remain} = 'dec_PackagesItem'(Bytes,telltype),   'dec_PackagesDescriptor_components'(Num-1, Remain, telltype, [Term|Acc]).'enc_ServiceChangeProfile'(Val) ->Val1 = ?RT_PER:list_to_record('ServiceChangeProfile', Val),[%% attribute number 1 with type IA5String?RT_PER:encode_IA5String([{'SizeConstraint',{1,67}}],?RT_PER:cindex(2,Val1,profileName))].'dec_ServiceChangeProfile'(Bytes,_) ->%% attribute number 1 with type IA5String{Term1,Bytes1} = ?RT_PER:decode_IA5String(Bytes,[{'SizeConstraint',{1,67}}]),{{'ServiceChangeProfile',Term1},Bytes1}.'enc_ServiceChangeMethod'({'ServiceChangeMethod',Val}) ->'enc_ServiceChangeMethod'(Val);'enc_ServiceChangeMethod'(Val) ->case (case Val of {_,_}->element(2,Val);_->Val end) of'failover' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 0)];'forced' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 1)];'graceful' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 2)];'restart' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 3)];'disconnected' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 4)];'handOff' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 5)];{asn1_enum,EnumV} when integer(EnumV), EnumV > 5 -> [{bit,1},?RT_PER:encode_small_number(EnumV)];EnumVal -> exit({error,{asn1, {enumerated_not_in_range, EnumVal}}})end.'dec_ServiceChangeMethod'(Bytes,_) ->?RT_PER:decode_enumerated(Bytes,[{'ValueRange',{0,5}}],{{failover,forced,graceful,restart,disconnected,handOff},{}}).'enc_ServiceChangeResParm'(Val) ->{Val1,Opt} = ?RT_PER:fixoptionals([2,3,4,5,6],5,Val),[?RT_PER:setext(false), Opt,case ?RT_PER:cindex(2,Val1,serviceChangeMgcId) ofasn1_NOVALUE -> [];Tmpval1 ->%% attribute number 1 with type Externaltypereference922megaco_per_media_gateway_control_prev3bMId'enc_MId'(Tmpval1)end,case ?RT_PER:cindex(3,Val1,serviceChangeAddress) ofasn1_NOVALUE -> [];Tmpval2 ->%% attribute number 2 with type Externaltypereference923megaco_per_media_gateway_control_prev3bServiceChangeAddress'enc_ServiceChangeAddress'(Tmpval2)end,case ?RT_PER:cindex(4,Val1,serviceChangeVersion) ofasn1_NOVALUE -> [];Tmpval3 ->%% attribute number 3 with type INTEGER?RT_PER:encode_integer([{'ValueRange',{0,99}}],Tmpval3)end,case ?RT_PER:cindex(5,Val1,serviceChangeProfile) ofasn1_NOVALUE -> [];Tmpval4 ->%% attribute number 4 with type Externaltypereference925megaco_per_media_gateway_control_prev3bServiceChangeProfile'enc_ServiceChangeProfile'(Tmpval4)end,case ?RT_PER:cindex(6,Val1,timestamp) ofasn1_NOVALUE -> [];Tmpval5 ->%% attribute number 5 with type Externaltypereference926megaco_per_media_gateway_control_prev3bTimeNotation'enc_TimeNotation'(Tmpval5)end].'dec_ServiceChangeResParm'(Bytes,_) ->{Ext,Bytes1} = ?RT_PER:getext(Bytes),{Opt,Bytes2} = ?RT_PER:getoptionals2(Bytes1,5), %%  attribute number 1 with type MId{Term1,Bytes3} = case Opt band (1 bsl 4) of_Opt1 when _Opt1 > 0 ->'dec_MId'(Bytes2,telltype);0 ->{asn1_NOVALUE,Bytes2}end,%%  attribute number 2 with type ServiceChangeAddress{Term2,Bytes4} = case Opt band (1 bsl 3) of_Opt2 when _Opt2 > 0 ->'dec_ServiceChangeAddress'(Bytes3,telltype);0 ->{asn1_NOVALUE,Bytes3}end,%% attribute number 3 with type INTEGER{Term3,Bytes5} = case Opt band (1 bsl 2) of_Opt3 when _Opt3 > 0 ->?RT_PER:decode_integer(Bytes4,[{'ValueRange',{0,99}}]);0 ->{asn1_NOVALUE,Bytes4}end,%%  attribute number 4 with type ServiceChangeProfile{Term4,Bytes6} = case Opt band (1 bsl 1) of_Opt4 when _Opt4 > 0 ->'dec_ServiceChangeProfile'(Bytes5,telltype);0 ->{asn1_NOVALUE,Bytes5}end,%%  attribute number 5 with type TimeNotation{Term5,Bytes7} = case Opt band (1 bsl 0) of_Opt5 when _Opt5 > 0 ->'dec_TimeNotation'(Bytes6,telltype);0 ->{asn1_NOVALUE,Bytes6}end,{Extensions,Bytes8} = ?RT_PER:getextension(Ext,Bytes7),Bytes9= ?RT_PER:skipextensions(Bytes8,1,Extensions),{{'ServiceChangeResParm',Term1,Term2,Term3,Term4,Term5},Bytes9}.'enc_ServiceChangeAddress'({'ServiceChangeAddress',Val}) ->'enc_ServiceChangeAddress'(Val);'enc_ServiceChangeAddress'(Val) ->[?RT_PER:set_choice(element(1,Val),{[portNumber,ip4Address,ip6Address,domainName,deviceName,mtpAddress],[]}, {6,0}),case element(1,Val) ofportNumber ->?RT_PER:encode_integer([{'ValueRange',{0,65535}}],element(2,Val));ip4Address ->'enc_IP4Address'(element(2,Val));ip6Address ->'enc_IP6Address'(element(2,Val));domainName ->'enc_DomainName'(element(2,Val));deviceName ->?RT_PER:encode_IA5String([{'SizeConstraint',{1,64}}],element(2,Val));mtpAddress ->?RT_PER:encode_octet_string([{'SizeConstraint',{2,4}}],element(2,Val))end].'dec_ServiceChangeAddress'(Bytes,_) ->{Ext,Bytes1} = ?RT_PER:getbit(Bytes),{Choice,Bytes2} = ?RT_PER:getchoice(Bytes1,6,Ext ),{Cname,{Val,NewBytes}} = case Choice + Ext*6 of0 -> {portNumber,?RT_PER:decode_integer(Bytes2,[{'ValueRange',{0,65535}}])};1 -> {ip4Address,'dec_IP4Address'(Bytes2,telltype)};2 -> {ip6Address,'dec_IP6Address'(Bytes2,telltype)};3 -> {domainName,'dec_DomainName'(Bytes2,telltype)};4 -> {deviceName,?RT_PER:decode_IA5String(Bytes2,[{'SizeConstraint',{1,64}}])};5 -> {mtpAddress,?RT_PER:decode_octet_string(Bytes2,[{'SizeConstraint',{2,4}}])};_ -> {asn1_ExtAlt,      fun() ->           {XTerm,XBytes} = ?RT_PER:decode_open_type(Bytes2,[]),          {binary_to_list(XTerm),XBytes}      end()}end,{{Cname,Val},NewBytes}.'enc_ServiceChangeParm'(Val) ->{Val1,Opt} = ?RT_PER:fixoptionals([3,4,5,7,8,9,10],7,Val),Extensions = ?RT_PER:fixextensions({ext,10,2}, Val1),[?RT_PER:setext(Extensions =/= []), Opt,%% attribute number 1 with type ENUMERATEDcase (case ?RT_PER:cindex(2,Val1,serviceChangeMethod) of {_,_}->element(2,?RT_PER:cindex(2,Val1,serviceChangeMethod));_->?RT_PER:cindex(2,Val1,serviceChangeMethod) end) of'failover' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 0)];'forced' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 1)];'graceful' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 2)];'restart' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 3)];'disconnected' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 4)];'handOff' -> [{bit,0},?RT_PER:encode_integer([{'ValueRange',{0,5}}], 5)];{asn1_enum,EnumV} when integer(EnumV), EnumV > 5 -> [{bit,1},?RT_PER:encode_small_number(EnumV)];EnumVal -> exit({error,{asn1, {enumerated_not_in_range, EnumVal}}})end,case ?RT_PER:cindex(3,Val1,serviceChangeAddress) ofasn1_NOVALUE -> [];Tmpval1 ->%% attribute number 2 with type Externaltypereference885megaco_per_media_gateway_control_prev3bServiceChangeAddress'enc_ServiceChangeAddress'(Tmpval1)end,case ?RT_PER:cindex(4,Val1,serviceChangeVersion) ofasn1_NOVALUE -> [];Tmpval2 ->%% attribute number 3 with type INTEGER?RT_PER:encode_integer([{'ValueRange',{0,99}}],Tmpval2)end,case ?RT_PER:cindex(5,Val1,serviceChangeProfile) ofasn1_NOVALUE -> [];Tmpval3 ->%% attribute number 4 with type Externaltypereference887megaco_per_media_gateway_control_prev3bServiceChangeProfile'enc_ServiceChangeProfile'(Tmpval3)end,%% attribute number 5 with type Externaltypereference888megaco_per_media_gateway_control_prev3bValue'enc_Value'(?RT_PER:cindex(6,Val1,serviceChangeReason)),case ?RT_PER:cindex(7,Val1,serviceChangeDelay) ofasn1_NOVALUE -> [];Tmpval4 ->%% attribute number 6 with type INTEGER?RT_PER:encode_integer([{'ValueRange',{0,4294967295}}],Tmpval4)end,case ?RT_PER:cindex(8,Val1,serviceChangeMgcId) ofasn1_NOVALUE -> [];Tmpval5 ->%% attribute number 7 with type Externaltypereference901megaco_per_media_gateway_control_prev3bMId'enc_MId'(Tmpval5)end,case ?RT_PER:cindex(9,Val1,timeStamp) ofasn1_NOVALUE -> [];Tmpval6 ->%% attribute number 8 with type Externaltypereference902megaco_per_media_gateway_control_prev3bTimeNotation'enc_TimeNotation'(Tmpval6)end,case ?RT_PER:cindex(10,Val1,nonStandardData) ofasn1_NOVALUE -> [];Tmpval7 ->%% attribute number 9 with type Externaltypereference903megaco_per_media_gateway_control_prev3bNonStandardData'enc_NonStandardData'(Tmpval7)end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -