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

📄 megaco_ber_bin_drv_media_gateway_control_prev3c.erl

📁 OTP是开放电信平台的简称
💻 ERL
📖 第 1 页 / 共 5 页
字号:
case Tlv3 of[] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowedend,   {'TimeNotation', Term1, Term2}.%%================================%%  H221NonStandard%%================================'enc_H221NonStandard'(Val) ->    'enc_H221NonStandard'(Val, [<<48>>]).'enc_H221NonStandard'(Val, TagIn) ->{_,Cindex1, Cindex2, Cindex3, Cindex4} = Val,%%-------------------------------------------------%% attribute t35CountryCode1(1) with type INTEGER%%-------------------------------------------------   {EncBytes1,EncLen1} = ?RT_BER:encode_integer([], Cindex1, [<<128>>]),%%-------------------------------------------------%% attribute t35CountryCode2(2) with type INTEGER%%-------------------------------------------------   {EncBytes2,EncLen2} = ?RT_BER:encode_integer([], Cindex2, [<<129>>]),%%-------------------------------------------------%% attribute t35Extension(3) with type INTEGER%%-------------------------------------------------   {EncBytes3,EncLen3} = ?RT_BER:encode_integer([], Cindex3, [<<130>>]),%%-------------------------------------------------%% attribute manufacturerCode(4) with type INTEGER%%-------------------------------------------------   {EncBytes4,EncLen4} = ?RT_BER:encode_integer([], Cindex4, [<<131>>]),   BytesSoFar = [EncBytes1, EncBytes2, EncBytes3, EncBytes4],LenSoFar = EncLen1 + EncLen2 + EncLen3 + EncLen4,?RT_BER:encode_tags(TagIn, BytesSoFar, LenSoFar).'dec_H221NonStandard'(Tlv) ->   'dec_H221NonStandard'(Tlv, [16]).'dec_H221NonStandard'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), %%-------------------------------------------------%% attribute t35CountryCode1(1) with type INTEGER%%-------------------------------------------------[V1|Tlv2] = Tlv1, Term1 = ?RT_BER:decode_integer(V1,{0,255},[131072]),%%-------------------------------------------------%% attribute t35CountryCode2(2) with type INTEGER%%-------------------------------------------------[V2|Tlv3] = Tlv2, Term2 = ?RT_BER:decode_integer(V2,{0,255},[131073]),%%-------------------------------------------------%% attribute t35Extension(3) with type INTEGER%%-------------------------------------------------[V3|Tlv4] = Tlv3, Term3 = ?RT_BER:decode_integer(V3,{0,255},[131074]),%%-------------------------------------------------%% attribute manufacturerCode(4) with type INTEGER%%-------------------------------------------------[V4|Tlv5] = Tlv4, Term4 = ?RT_BER:decode_integer(V4,{0,65535},[131075]),case Tlv5 of [] -> true; _ -> true end, % ... extra fields skipped   {'H221NonStandard', Term1, Term2, Term3, Term4}.%%================================%%  NonStandardIdentifier%%================================'enc_NonStandardIdentifier'(Val) ->    'enc_NonStandardIdentifier'(Val, []).'enc_NonStandardIdentifier'({'NonStandardIdentifier',Val}, TagIn) ->   'enc_NonStandardIdentifier'(Val, TagIn);'enc_NonStandardIdentifier'(Val, TagIn) ->   {EncBytes,EncLen} = case element(1,Val) of      object ->         ?RT_BER:encode_object_identifier(element(2,Val), [<<128>>]);      h221NonStandard ->         'enc_H221NonStandard'(element(2,Val), [<<161>>]);      experimental ->         ?RT_BER:encode_restricted_string([], element(2,Val), 22, [<<130>>]);      Else ->          exit({error,{asn1,{invalid_choice_type,Else}}})   end,?RT_BER:encode_tags(TagIn, EncBytes, EncLen).'dec_NonStandardIdentifier'(Tlv) ->   'dec_NonStandardIdentifier'(Tlv, []).'dec_NonStandardIdentifier'(Tlv, TagIn) ->Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), case (case Tlv1 of [CtempTlv1] -> CtempTlv1; _ -> Tlv1 end) of%% 'object'    {131072, V1} ->         {object, ?RT_BER:decode_object_identifier(V1,[])};%% 'h221NonStandard'    {131073, V1} ->         {h221NonStandard, 'dec_H221NonStandard'(V1, [])};%% 'experimental'    {131074, V1} ->         {experimental, ?RT_BER:decode_restricted_string(V1,8,22,[])};      Else ->          {asn1_ExtAlt, ?RT_BER:encode(Else)}   end.%%================================%%  NonStandardData%%================================'enc_NonStandardData'(Val) ->    'enc_NonStandardData'(Val, [<<48>>]).'enc_NonStandardData'(Val, TagIn) ->{_,Cindex1, Cindex2} = Val,%%-------------------------------------------------%% attribute nonStandardIdentifier(1)   External megaco_ber_bin_drv_media_gateway_control_prev3c:NonStandardIdentifier%%-------------------------------------------------   {EncBytes1,EncLen1} = 'enc_NonStandardIdentifier'(Cindex1, [<<160>>]),%%-------------------------------------------------%% attribute data(2) with type OCTET STRING%%-------------------------------------------------   {EncBytes2,EncLen2} = ?RT_BER:encode_octet_string([], Cindex2, [<<129>>]),   BytesSoFar = [EncBytes1, EncBytes2],LenSoFar = EncLen1 + EncLen2,?RT_BER:encode_tags(TagIn, BytesSoFar, LenSoFar).'dec_NonStandardData'(Tlv) ->   'dec_NonStandardData'(Tlv, [16]).'dec_NonStandardData'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), %%-------------------------------------------------%% attribute nonStandardIdentifier(1)   External megaco_ber_bin_drv_media_gateway_control_prev3c:NonStandardIdentifier%%-------------------------------------------------[V1|Tlv2] = Tlv1, Term1 = 'dec_NonStandardIdentifier'(V1, [131072]),%%-------------------------------------------------%% attribute data(2) with type OCTET STRING%%-------------------------------------------------[V2|Tlv3] = Tlv2, Term2 = ?RT_BER:decode_octet_string(V2,[],[131073]),case Tlv3 of[] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowedend,   {'NonStandardData', Term1, Term2}.%%================================%%  StatisticsParameter%%================================'enc_StatisticsParameter'(Val) ->    'enc_StatisticsParameter'(Val, [<<48>>]).'enc_StatisticsParameter'(Val, TagIn) ->{_,Cindex1, Cindex2} = Val,%%-------------------------------------------------%% attribute statName(1) with type OCTET STRING%%-------------------------------------------------   {EncBytes1,EncLen1} = ?RT_BER:encode_octet_string([], Cindex1, [<<128>>]),%%-------------------------------------------------%% attribute statValue(2)   External megaco_ber_bin_drv_media_gateway_control_prev3c:Value OPTIONAL%%-------------------------------------------------   {EncBytes2,EncLen2} =  case Cindex2 of         asn1_NOVALUE -> {<<>>,0};         _ ->            'enc_Value'(Cindex2, [<<161>>])       end,   BytesSoFar = [EncBytes1, EncBytes2],LenSoFar = EncLen1 + EncLen2,?RT_BER:encode_tags(TagIn, BytesSoFar, LenSoFar).'dec_StatisticsParameter'(Tlv) ->   'dec_StatisticsParameter'(Tlv, [16]).'dec_StatisticsParameter'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), %%-------------------------------------------------%% attribute statName(1) with type OCTET STRING%%-------------------------------------------------[V1|Tlv2] = Tlv1, Term1 = ?RT_BER:decode_octet_string(V1,4,[131072]),%%-------------------------------------------------%% attribute statValue(2)   External megaco_ber_bin_drv_media_gateway_control_prev3c:Value OPTIONAL%%-------------------------------------------------{Term2,Tlv3} = case Tlv2 of[{131073,V2}|TempTlv3] ->    {'dec_Value'(V2, []), TempTlv3};    _ ->        { asn1_NOVALUE, Tlv2}end,case Tlv3 of[] -> true;_ -> exit({error,{asn1, {unexpected,Tlv3}}}) % extra fields not allowedend,   {'StatisticsParameter', Term1, Term2}.%%================================%%  StatisticsDescriptor%%================================'enc_StatisticsDescriptor'(Val) ->    'enc_StatisticsDescriptor'(Val, [<<48>>]).'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, EncBytes, EncLen).'enc_StatisticsDescriptor_components'([], AccBytes, AccLen) ->    {lists:reverse(AccBytes),AccLen};'enc_StatisticsDescriptor_components'([H|T],AccBytes, AccLen) ->   {EncBytes,EncLen} = 'enc_StatisticsParameter'(H, [<<48>>]),   'enc_StatisticsDescriptor_components'(T,[EncBytes|AccBytes], AccLen + EncLen).'dec_StatisticsDescriptor'(Tlv) ->   'dec_StatisticsDescriptor'(Tlv, [16]).'dec_StatisticsDescriptor'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), ['dec_StatisticsParameter'(V1, [16]) || V1 <- Tlv1].%%================================%%  PackagesItem%%================================'enc_PackagesItem'(Val) ->    'enc_PackagesItem'(Val, [<<48>>]).'enc_PackagesItem'(Val, TagIn) ->{_,Cindex1, Cindex2} = Val,%%-------------------------------------------------%% attribute packageName(1) with type OCTET STRING%%-------------------------------------------------   {EncBytes1,EncLen1} = ?RT_BER:encode_octet_string([], Cindex1, [<<128>>]),%%-------------------------------------------------%% attribute packageVersion(2) with type INTEGER%%-------------------------------------------------   {EncBytes2,EncLen2} = ?RT_BER:encode_integer([], Cindex2, [<<129>>]),   BytesSoFar = [EncBytes1, EncBytes2],LenSoFar = EncLen1 + EncLen2,?RT_BER:encode_tags(TagIn, BytesSoFar, LenSoFar).'dec_PackagesItem'(Tlv) ->   'dec_PackagesItem'(Tlv, [16]).'dec_PackagesItem'(Tlv, TagIn) ->   %%-------------------------------------------------   %% decode tag and length    %%-------------------------------------------------Tlv1 = ?RT_BER:match_tags(Tlv,TagIn), %%-------------------------------------------------%% attribute packageName(1) with type OCTET STRING%%-------------------------------------------------[V1|Tlv2] = Tlv1, Term1 = ?RT_BER:decode_octet_string(V1,2,[131072]),%%-------------------------------------------------%% attribute packageVersion(2) with type INTEGER%%-------------------------------------------------[V2|Tlv3] = Tlv2, Term2 = ?RT_BER:decode_integer(V2,{0,99},[131073]),case Tlv3 of [] -> true; _ -> true end, % ... extra fields skipped   {'PackagesItem', Term1, Term2}.%%================================%%  PackagesDescriptor%%================================'enc_PackagesDescriptor'(Val) ->    'enc_PackagesDescriptor'(Val, [<<48>>]).'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, EncBytes, EncLen).'enc_PackagesDescriptor_components'([], AccBytes, AccLen) ->    {lists:reverse(AccBytes),AccLen};'enc_PackagesDescriptor_components'([H|T],AccBytes, AccLen) ->

⌨️ 快捷键说明

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