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

📄 megaco_per_bin_drv_media_gateway_control_v2.erl

📁 OTP是开放电信平台的简称
💻 ERL
📖 第 1 页 / 共 5 页
字号:
[Opt,%% attribute number 1 with type OCTET STRING  begin    case length(element(2,Val1)) of      Tmpval1 when Tmpval1 == 4 -> [2,20,Tmpval1,element(2,Val1)];      _ -> exit({error,{value_out_of_bounds,element(2,Val1)}})    end  end,case element(3,Val1) ofasn1_NOVALUE -> [];Tmpval2 ->%% attribute number 2 with type Externaltypereference931megaco_per_bin_drv_media_gateway_control_v2Value'enc_Value'(Tmpval2)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,4,false),%%  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  begin    [Tmpval1,Tmpval2] = element(2,Val1),    [[10,8,Tmpval1],[10,8,Tmpval2]]  end,%% attribute number 2 with type INTEGER  %%INTEGER with effective constraint: [{'ValueRange',{0,99},100,{bits,7}}]  begin  Tmpval3=element(3,Val1),  case Tmpval3 of    Tmpval4 when Tmpval4=<99,Tmpval4>=0 ->      [10,7,Tmpval4- 0];    Tmpval4 ->      exit({error,{value_out_of_bounds,Tmpval4}})  end  end].'dec_PackagesItem'(Bytes,_) ->{Ext,Bytes1} = ?RT_PER:getext(Bytes),%% attribute number 1 with type OCTET STRING{Term1,Bytes2} =   ?RT_PER:decode_octet_string(Bytes1,2,false),%% attribute number 2 with type INTEGER{Term2,Bytes3} =   begin    {Tmpterm1,Tmpremain1}=?RT_PER:getbits(Bytes2,7),    {Tmpterm1+0,Tmpremain1}  end,{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_known_multiplier_string('IA5String',{1,67},8,{0,127,notab},element(2,Val1))].'dec_ServiceChangeProfile'(Bytes,_) ->%% attribute number 1 with type IA5String{Term1,Bytes1} = ?RT_PER:decode_known_multiplier_string('IA5String',{1,67},8,{0,127,notab},Bytes),{{'ServiceChangeProfile',Term1},Bytes1}.'enc_ServiceChangeMethod'({'ServiceChangeMethod',Val}) ->'enc_ServiceChangeMethod'(Val);'enc_ServiceChangeMethod'(Val) ->case (case Val of {_,_}->element(2,Val);_->Val end) of'failover' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 0)];'forced' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 1)];'graceful' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 2)];'restart' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 3)];'disconnected' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 4)];'handOff' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 5)];{asn1_enum,EnumV} when integer(EnumV), EnumV > 5 -> [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 element(2,Val1) ofasn1_NOVALUE -> [];Tmpval1 ->%% attribute number 1 with type Externaltypereference892megaco_per_bin_drv_media_gateway_control_v2MId'enc_MId'(Tmpval1)end,case element(3,Val1) ofasn1_NOVALUE -> [];Tmpval2 ->%% attribute number 2 with type Externaltypereference893megaco_per_bin_drv_media_gateway_control_v2ServiceChangeAddress'enc_ServiceChangeAddress'(Tmpval2)end,case element(4,Val1) ofasn1_NOVALUE -> [];Tmpval3 ->%% attribute number 3 with type INTEGER  %%INTEGER with effective constraint: [{'ValueRange',{0,99},100,{bits,7}}]  begin  case Tmpval3 of    Tmpval4 when Tmpval4=<99,Tmpval4>=0 ->      [10,7,Tmpval4- 0];    Tmpval4 ->      exit({error,{value_out_of_bounds,Tmpval4}})  end  endend,case element(5,Val1) ofasn1_NOVALUE -> [];Tmpval5 ->%% attribute number 4 with type Externaltypereference895megaco_per_bin_drv_media_gateway_control_v2ServiceChangeProfile'enc_ServiceChangeProfile'(Tmpval5)end,case element(6,Val1) ofasn1_NOVALUE -> [];Tmpval6 ->%% attribute number 5 with type Externaltypereference896megaco_per_bin_drv_media_gateway_control_v2TimeNotation'enc_TimeNotation'(Tmpval6)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 ->  begin    {Tmpterm1,Tmpremain1}=?RT_PER:getbits(Bytes4,7),    {Tmpterm1+0,Tmpremain1}  end;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 ->  %%INTEGER with effective constraint: [{'ValueRange',{0,65535},65536,{octets,2}}] case element(2,Val) of     Tmpval1 when Tmpval1=<65535,Tmpval1>=0 ->      [20,2,<<(Tmpval1- 0):16>>];    Tmpval1 ->      exit({error,{value_out_of_bounds,Tmpval1}})  end;ip4Address ->'enc_IP4Address'(element(2,Val));ip6Address ->'enc_IP6Address'(element(2,Val));domainName ->'enc_DomainName'(element(2,Val));deviceName ->?RT_PER:encode_known_multiplier_string('IA5String',{1,64},8,{0,127,notab},element(2,Val));mtpAddress ->  ?RT_PER:encode_octet_string({2,4},false,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,  begin    {Tmpterm1,Tmpremain1}=?RT_PER:getoctets(Bytes2,2),    {Tmpterm1+0,Tmpremain1}  end};1 -> {ip4Address,'dec_IP4Address'(Bytes2,telltype)};2 -> {ip6Address,'dec_IP6Address'(Bytes2,telltype)};3 -> {domainName,'dec_DomainName'(Bytes2,telltype)};4 -> {deviceName,?RT_PER:decode_known_multiplier_string('IA5String',{1,64},8,{0,127,notab},Bytes2)};5 -> {mtpAddress,  ?RT_PER:decode_octet_string(Bytes2,{2,4},false)};_ -> {asn1_ExtAlt, ?RT_PER:decode_open_type(Bytes2,[])}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,1}, Val1),[?RT_PER:setext(Extensions =/= []), Opt,%% attribute number 1 with type ENUMERATEDcase (case element(2,Val1) of {_,_}->element(2,element(2,Val1));_->element(2,Val1) end) of'failover' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 0)];'forced' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 1)];'graceful' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 2)];'restart' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 3)];'disconnected' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 4)];'handOff' -> [0,?RT_PER:encode_integer([{'ValueRange',{0,5}}], 5)];{asn1_enum,EnumV} when integer(EnumV), EnumV > 5 -> [1,?RT_PER:encode_small_number(EnumV)];EnumVal -> exit({error,{asn1, {enumerated_not_in_range, EnumVal}}})end,case element(3,Val1) ofasn1_NOVALUE -> [];Tmpval1 ->%% attribute number 2 with type Externaltypereference856megaco_per_bin_drv_media_gateway_control_v2ServiceChangeAddress'enc_ServiceChangeAddress'(Tmpval1)end,case element(4,Val1) ofasn1_NOVALUE -> [];Tmpval2 ->%% attribute number 3 with type INTEGER  %%INTEGER with effective constraint: [{'ValueRange',{0,99},100,{bits,7}}]  begin  case Tmpval2 of    Tmpval3 when Tmpval3=<99,Tmpval3>=0 ->      [10,7,Tmpval3- 0];    Tmpval3 ->      exit({error,{value_out_of_bounds,Tmpval3}})  end  endend,case element(5,Val1) ofasn1_NOVALUE -> [];Tmpval4 ->%% attribute number 4 with type Externaltypereference858megaco_per_bin_drv_media_gateway_control_v2ServiceChangeProfile'enc_ServiceChangeProfile'(Tmpval4)end,%% attribute number 5 with type Externaltypereference859megaco_per_bin_drv_media_gateway_control_v2Value'enc_Value'(element(6,Val1)),case element(7,Val1) ofasn1_NOVALUE -> [];Tmpval5 ->%% attribute number 6 with type INTEGER  %%INTEGER with effective constraint: [{'ValueRange',{0,4294967295}}]  ?RT_PER:encode_integer([{'ValueRange',{0,4294967295}}],Tmpval5)end,case element(8,Val1) ofasn1_NOVALUE -> [];Tmpval6 ->%% attribute number 7 with type Externaltypereference872megaco_per_bin_drv_media_gateway_control_v2MId'enc_MId'(Tmpval6)end,

⌨️ 快捷键说明

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