📄 megaco_ber_media_gateway_control_prev3b.erl
字号:
'dec_NonStandardData'(Bytes, OptOrMand) -> 'dec_NonStandardData'(Bytes, OptOrMand, []).'dec_NonStandardData'(Bytes, OptOrMand, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- {{_,Len},Bytes1,Rb1} = ?RT_BER:check_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], Bytes, OptOrMand), {Bytes2,RemBytes} = ?RT_BER:split_list(Bytes1,Len),%%-------------------------------------------------%% attribute number 1 External megaco_ber_media_gateway_control_prev3b:NonStandardIdentifier%%------------------------------------------------- {Term1,Bytes3,Rb2} = 'dec_NonStandardIdentifier'(Bytes2, mandatory, [{tag,128,0,'EXPLICIT',32}]),%%-------------------------------------------------%% attribute number 2 with type OCTET STRING%%------------------------------------------------- {Term2,Bytes4,Rb3} = ?RT_BER:decode_octet_string(Bytes3,[],[{tag,128,1,'IMPLICIT',0}], no_length, mandatory), {Bytes5,Rb4} = ?RT_BER:restbytes2(RemBytes, Bytes4,noext), {{'NonStandardData', Term1, Term2}, Bytes5, Rb1+Rb2+Rb3+Rb4}.%%================================%% StatisticsParameter%%================================'enc_StatisticsParameter'(Val, TagIn) ->%%-------------------------------------------------%% attribute number 1 with type OCTET STRING%%------------------------------------------------- {EncBytes1,EncLen1} = ?RT_BER:encode_octet_string([], ?RT_BER:cindex(2,Val,statName), [{tag,128,0,'IMPLICIT',0}]),%%-------------------------------------------------%% attribute number 2 External megaco_ber_media_gateway_control_prev3b:Value OPTIONAL%%------------------------------------------------- {EncBytes2,EncLen2} = case ?RT_BER:cindex(3,Val,statValue) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_Value'(?RT_BER:cindex(3,Val,statValue), [{tag,128,1,'IMPLICIT',0}]) end, BytesSoFar = [EncBytes1, EncBytes2], LenSoFar = EncLen1 + EncLen2, ?RT_BER:encode_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], BytesSoFar, LenSoFar).'dec_StatisticsParameter'(Bytes, OptOrMand) -> 'dec_StatisticsParameter'(Bytes, OptOrMand, []).'dec_StatisticsParameter'(Bytes, OptOrMand, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- {{_,Len},Bytes1,Rb1} = ?RT_BER:check_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], Bytes, OptOrMand), {Bytes2,RemBytes} = ?RT_BER:split_list(Bytes1,Len),%%-------------------------------------------------%% attribute number 1 with type OCTET STRING%%------------------------------------------------- {Term1,Bytes3,Rb2} = ?RT_BER:decode_octet_string(Bytes2,4,[{tag,128,0,'IMPLICIT',0}], no_length, mandatory),%%-------------------------------------------------%% attribute number 2 External megaco_ber_media_gateway_control_prev3b:Value OPTIONAL%%------------------------------------------------- {Term2,Bytes4,Rb3} = case Bytes3 of<<2:2,_:1,1:5,_/binary>> ->'dec_Value'(Bytes3, opt_or_default, [{tag,128,1,'IMPLICIT',0}]);_ ->{ asn1_NOVALUE, Bytes3, 0 }end, {Bytes5,Rb4} = ?RT_BER:restbytes2(RemBytes, Bytes4,noext), {{'StatisticsParameter', Term1, Term2}, Bytes5, Rb1+Rb2+Rb3+Rb4}.%%================================%% StatisticsDescriptor%%================================'enc_StatisticsDescriptor'({'StatisticsDescriptor',Val}, TagIn) -> 'enc_StatisticsDescriptor'(Val, TagIn);'enc_StatisticsDescriptor'(Val, TagIn) -> {EncBytes,EncLen} = 'enc_StatisticsDescriptor_components'(Val,[],0), ?RT_BER:encode_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], EncBytes, EncLen).'enc_StatisticsDescriptor_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen};'enc_StatisticsDescriptor_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'enc_StatisticsParameter'(H, []), 'enc_StatisticsDescriptor_components'(T,[EncBytes|AccBytes], AccLen + EncLen).'dec_StatisticsDescriptor'(Bytes, OptOrMand) -> 'dec_StatisticsDescriptor'(Bytes, OptOrMand, []).'dec_StatisticsDescriptor'(Bytes, OptOrMand, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- {{_,Len},Bytes1,Rb1} = ?RT_BER:check_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], Bytes, OptOrMand), ?RT_BER:decode_components(Rb1, Len, Bytes1, fun 'dec_StatisticsParameter'/3, [], []).%%================================%% PackagesItem%%================================'enc_PackagesItem'(Val, TagIn) ->%%-------------------------------------------------%% attribute number 1 with type OCTET STRING%%------------------------------------------------- {EncBytes1,EncLen1} = ?RT_BER:encode_octet_string([], ?RT_BER:cindex(2,Val,packageName), [{tag,128,0,'IMPLICIT',0}]),%%-------------------------------------------------%% attribute number 2 with type INTEGER%%------------------------------------------------- {EncBytes2,EncLen2} = ?RT_BER:encode_integer([], ?RT_BER:cindex(3,Val,packageVersion), [{tag,128,1,'IMPLICIT',0}]), BytesSoFar = [EncBytes1, EncBytes2], LenSoFar = EncLen1 + EncLen2, ?RT_BER:encode_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], BytesSoFar, LenSoFar).'dec_PackagesItem'(Bytes, OptOrMand) -> 'dec_PackagesItem'(Bytes, OptOrMand, []).'dec_PackagesItem'(Bytes, OptOrMand, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- {{_,Len},Bytes1,Rb1} = ?RT_BER:check_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], Bytes, OptOrMand), {Bytes2,RemBytes} = ?RT_BER:split_list(Bytes1,Len),%%-------------------------------------------------%% attribute number 1 with type OCTET STRING%%------------------------------------------------- {Term1,Bytes3,Rb2} = ?RT_BER:decode_octet_string(Bytes2,2,[{tag,128,0,'IMPLICIT',0}], no_length, mandatory),%%-------------------------------------------------%% attribute number 2 with type INTEGER%%------------------------------------------------- {Term2,Bytes4,Rb3} = ?RT_BER:decode_integer(Bytes3,{0,99},[{tag,128,1,'IMPLICIT',0}], mandatory), {Bytes5,Rb4} = ?RT_BER:restbytes2(RemBytes, Bytes4,ext), {{'PackagesItem', Term1, Term2}, Bytes5, Rb1+Rb2+Rb3+Rb4}.%%================================%% PackagesDescriptor%%================================'enc_PackagesDescriptor'({'PackagesDescriptor',Val}, TagIn) -> 'enc_PackagesDescriptor'(Val, TagIn);'enc_PackagesDescriptor'(Val, TagIn) -> {EncBytes,EncLen} = 'enc_PackagesDescriptor_components'(Val,[],0), ?RT_BER:encode_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], EncBytes, EncLen).'enc_PackagesDescriptor_components'([], AccBytes, AccLen) -> {lists:reverse(AccBytes),AccLen};'enc_PackagesDescriptor_components'([H|T],AccBytes, AccLen) -> {EncBytes,EncLen} = 'enc_PackagesItem'(H, []), 'enc_PackagesDescriptor_components'(T,[EncBytes|AccBytes], AccLen + EncLen).'dec_PackagesDescriptor'(Bytes, OptOrMand) -> 'dec_PackagesDescriptor'(Bytes, OptOrMand, []).'dec_PackagesDescriptor'(Bytes, OptOrMand, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- {{_,Len},Bytes1,Rb1} = ?RT_BER:check_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], Bytes, OptOrMand), ?RT_BER:decode_components(Rb1, Len, Bytes1, fun 'dec_PackagesItem'/3, [], []).%%================================%% ServiceChangeProfile%%================================'enc_ServiceChangeProfile'(Val, TagIn) ->%%-------------------------------------------------%% attribute number 1 with type IA5String%%------------------------------------------------- {EncBytes1,EncLen1} = ?RT_BER:encode_restricted_string([], ?RT_BER:cindex(2,Val,profileName), 22, [{tag,128,0,'IMPLICIT',0}]), BytesSoFar = [EncBytes1], LenSoFar = EncLen1, ?RT_BER:encode_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], BytesSoFar, LenSoFar).'dec_ServiceChangeProfile'(Bytes, OptOrMand) -> 'dec_ServiceChangeProfile'(Bytes, OptOrMand, []).'dec_ServiceChangeProfile'(Bytes, OptOrMand, TagIn) -> %%------------------------------------------------- %% decode tag and length %%------------------------------------------------- {{_,Len},Bytes1,Rb1} = ?RT_BER:check_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], Bytes, OptOrMand), {Bytes2,RemBytes} = ?RT_BER:split_list(Bytes1,Len),%%-------------------------------------------------%% attribute number 1 with type IA5String%%------------------------------------------------- {Term1,Bytes3,Rb2} = ?RT_BER:decode_restricted_string(Bytes2,{1,67},22,[{tag,128,0,'IMPLICIT',0}], no_length, mandatory), {Bytes4,Rb3} = ?RT_BER:restbytes2(RemBytes, Bytes3,noext), {{'ServiceChangeProfile', Term1}, Bytes4, Rb1+Rb2+Rb3}.%%================================%% ServiceChangeMethod%%================================'enc_ServiceChangeMethod'({'ServiceChangeMethod',Val}, TagIn) -> 'enc_ServiceChangeMethod'(Val, TagIn);'enc_ServiceChangeMethod'(Val, TagIn) ->case (case Val of {asn1_enum,_}->Val;{_,_}->element(2,Val);_->Val end) offailover -> ?RT_BER:encode_enumerated(0,TagIn ++ []);forced -> ?RT_BER:encode_enumerated(1,TagIn ++ []);graceful -> ?RT_BER:encode_enumerated(2,TagIn ++ []);restart -> ?RT_BER:encode_enumerated(3,TagIn ++ []);disconnected -> ?RT_BER:encode_enumerated(4,TagIn ++ []);handOff -> ?RT_BER:encode_enumerated(5,TagIn ++ []);{asn1_enum,Enumval1} -> ?RT_BER:encode_enumerated(Enumval1,TagIn ++ []);Enumval2 -> exit({error,{asn1, {enumerated_not_in_range,Enumval2}}})end.'dec_ServiceChangeMethod'(Bytes, OptOrMand) -> 'dec_ServiceChangeMethod'(Bytes, OptOrMand, []).'dec_ServiceChangeMethod'(Bytes, OptOrMand, TagIn) ->?RT_BER:decode_enumerated(Bytes,[],{[{failover,0},{forced,1},{graceful,2},{restart,3},{disconnected,4},{handOff,5}],[]},TagIn++[], OptOrMand).%%================================%% ServiceChangeResParm%%================================'enc_ServiceChangeResParm'(Val, TagIn) ->%%-------------------------------------------------%% attribute number 1 External megaco_ber_media_gateway_control_prev3b:MId OPTIONAL%%------------------------------------------------- {EncBytes1,EncLen1} = case ?RT_BER:cindex(2,Val,serviceChangeMgcId) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_MId'(?RT_BER:cindex(2,Val,serviceChangeMgcId), [{tag,128,0,'EXPLICIT',32}]) end,%%-------------------------------------------------%% attribute number 2 External megaco_ber_media_gateway_control_prev3b:ServiceChangeAddress OPTIONAL%%------------------------------------------------- {EncBytes2,EncLen2} = case ?RT_BER:cindex(3,Val,serviceChangeAddress) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_ServiceChangeAddress'(?RT_BER:cindex(3,Val,serviceChangeAddress), [{tag,128,1,'EXPLICIT',32}]) end,%%-------------------------------------------------%% attribute number 3 with type INTEGER OPTIONAL%%------------------------------------------------- {EncBytes3,EncLen3} = case ?RT_BER:cindex(4,Val,serviceChangeVersion) of asn1_NOVALUE -> {<<>>,0}; _ -> ?RT_BER:encode_integer([], ?RT_BER:cindex(4,Val,serviceChangeVersion), [{tag,128,2,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 4 External megaco_ber_media_gateway_control_prev3b:ServiceChangeProfile OPTIONAL%%------------------------------------------------- {EncBytes4,EncLen4} = case ?RT_BER:cindex(5,Val,serviceChangeProfile) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_ServiceChangeProfile'(?RT_BER:cindex(5,Val,serviceChangeProfile), [{tag,128,3,'IMPLICIT',0}]) end,%%-------------------------------------------------%% attribute number 5 External megaco_ber_media_gateway_control_prev3b:TimeNotation OPTIONAL%%------------------------------------------------- {EncBytes5,EncLen5} = case ?RT_BER:cindex(6,Val,timestamp) of asn1_NOVALUE -> {<<>>,0}; _ -> 'enc_TimeNotation'(?RT_BER:cindex(6,Val,timestamp), [{tag,128,4,'IMPLICIT',0}]) end, BytesSoFar = [EncBytes1, EncBytes2, EncBytes3, EncBytes4, EncBytes5], LenSoFar = EncLen1 + EncLen2 + EncLen3 + EncLen4 + EncLen5, ?RT_BER:encode_tags(TagIn ++ [{tag,0,16,'IMPLICIT',32}], BytesSoFar, LenSoFar).'dec_ServiceChangeResParm'(Bytes, OptOrMand) -> 'dec_ServiceChangeResParm'(Bytes, OptOrMand, []).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -