📄 megaco_text_gen_prev3c.hrl
字号:
%% segmentationNumber = SegNo,%% segmentationComplete = SegCompl }, State) -> [ ?ReplyToken, ?EQUAL, enc_TransactionId(Tid, State), ?LBRKT_INDENT(State), enc_immAckRequired(Req, State), enc_TransactionReply_transactionResult(Res, ?INC_INDENT(State)), ?RBRKT_INDENT(State) ];enc_TransactionReply(Bin, _State) when binary(Bin) -> [Bin].enc_immAckRequired(Val, _State) -> case Val of asn1_NOVALUE -> []; 'NULL' -> [?ImmAckRequiredToken, ?COMMA_INDENT(?INC_INDENT(_State))] end.enc_TransactionReply_transactionResult({'TransactionReply_transactionResult', Val}, State) -> enc_TransactionReply_transactionResult(Val, State);enc_TransactionReply_transactionResult({Tag, Val}, State) -> case Tag of transactionError -> enc_ErrorDescriptor(Val, State); actionReplies -> enc_TransactionReply_transactionResult_actionReplies(Val, State); _ -> error({invalid_TransactionReply_transactionResult_tag, Tag}) end.enc_TransactionReply_transactionResult_actionReplies({'TransactionReply_transactionResult_actionReplies',Val}, State) -> enc_TransactionReply_transactionResult_actionReplies(Val, State);enc_TransactionReply_transactionResult_actionReplies([Mand], State) -> [enc_ActionReply(Mand, State)];enc_TransactionReply_transactionResult_actionReplies([Mand | Opt], State) -> [enc_ActionReply(Mand, State), [[?COMMA_INDENT(State), enc_ActionReply(Val, State)] || Val <- Opt]].enc_ErrorDescriptor(#'ErrorDescriptor'{errorText = asn1_NOVALUE, errorCode = Code}, State) -> [ ?ErrorToken, ?EQUAL, enc_ErrorCode(Code, State), ?LBRKT, ?RBRKT ];enc_ErrorDescriptor(#'ErrorDescriptor'{errorText = Text, errorCode = Code}, State) -> [ ?ErrorToken, ?EQUAL, enc_ErrorCode(Code, State), ?LBRKT, enc_ErrorText(Text, State), ?RBRKT ].enc_ErrorCode({'ErrorCode',Val}, State)-> enc_ErrorCode(Val, State);enc_ErrorCode(Val, State) -> enc_DIGIT(Val, State, 0, 999).enc_ErrorText({'ErrorText',Val}, State) -> enc_ErrorText(Val, State);enc_ErrorText(Val, State) -> enc_QUOTED_STRING(Val, State).enc_ContextID({'ContextID',Val}, State) -> enc_ContextID(Val, State);enc_ContextID(Val, State) -> case Val of ?megaco_all_context_id -> $*; ?megaco_null_context_id -> $-; ?megaco_choose_context_id -> $$; Int when integer(Int) -> enc_UINT32(Int, State) end.enc_ActionRequest(Bin, _State) when is_binary(Bin) -> [Bin]; %% Already encoded...enc_ActionRequest(#'ActionRequest'{contextId = CID, contextRequest = asn1_NOVALUE, contextAttrAuditReq = asn1_NOVALUE, commandRequests = CmdReqs}, State) -> [ ?CtxToken, ?EQUAL, enc_ContextID(CID, State), ?LBRKT_INDENT(State), enc_list([{CmdReqs, fun enc_CommandRequest/2}], ?INC_INDENT(State)), ?RBRKT_INDENT(State) ];enc_ActionRequest(#'ActionRequest'{contextId = CID, contextRequest = CtxReq, contextAttrAuditReq = asn1_NOVALUE, commandRequests = CmdReqs}, State) -> [ ?CtxToken, ?EQUAL, enc_ContextID(CID, State), ?LBRKT_INDENT(State), enc_list([{[CtxReq], fun enc_ContextRequest/2}, {CmdReqs, fun enc_CommandRequest/2}], ?INC_INDENT(State)), ?RBRKT_INDENT(State) ];enc_ActionRequest(#'ActionRequest'{contextId = CID, contextRequest = CtxReq, contextAttrAuditReq = CtxAAR, commandRequests = CmdReqs}, State) -> [ ?CtxToken, ?EQUAL, enc_ContextID(CID, State), ?LBRKT_INDENT(State), enc_list([{[CtxReq], fun enc_ContextRequest/2}, {[CtxAAR], fun enc_ContextAttrAuditRequest/2}, {CmdReqs, fun enc_CommandRequest/2}], ?INC_INDENT(State)), ?RBRKT_INDENT(State) ].%% OTP-5085enc_ActionReply(#'ActionReply'{contextId = Id, errorDescriptor = asn1_NOVALUE, contextReply = asn1_NOVALUE, commandReply = []}, State) ->%% d("enc_ActionReply -> entry with"%% "~n Id: ~p", [Id]), [ ?CtxToken, ?EQUAL, enc_ContextID(Id, State) ];enc_ActionReply(#'ActionReply'{contextId = Id, errorDescriptor = ED, contextReply = CtxRep, commandReply = CmdRep}, State) ->%% d("enc_ActionReply -> entry with"%% "~n Id: ~p"%% "~n ED: ~p"%% "~n CtxRep: ~p"%% "~n CmdRep: ~p", [Id, ED, CtxRep, CmdRep]), [ ?CtxToken, ?EQUAL, enc_ContextID(Id, State), ?LBRKT_INDENT(State), do_enc_ActionReply(ED, CtxRep, CmdRep, State), ?RBRKT_INDENT(State) ].do_enc_ActionReply(asn1_NOVALUE, CtxRep, [], State) when CtxRep =/= asn1_NOVALUE -> [ enc_ContextRequest(CtxRep, ?INC_INDENT(State)) ];do_enc_ActionReply(asn1_NOVALUE, CtxRep, CmdRep, State) when CtxRep =/= asn1_NOVALUE, CmdRep =/= [] -> [ enc_ContextRequest(CtxRep, ?INC_INDENT(State)), ?COMMA_INDENT(?INC_INDENT(State)), enc_list([{CmdRep, fun enc_CommandReply/2}], ?INC_INDENT(State)) ];do_enc_ActionReply(asn1_NOVALUE, asn1_NOVALUE, CmdRep, State) when CmdRep =/= [] -> [ enc_list([{CmdRep, fun enc_CommandReply/2}], ?INC_INDENT(State)) ];do_enc_ActionReply(ED, CtxRep, [], State) when ED =/= asn1_NOVALUE, CtxRep =/= asn1_NOVALUE -> [ enc_ContextRequest(CtxRep, ?INC_INDENT(State)), ?COMMA_INDENT(?INC_INDENT(State)), enc_list([{[ED], fun enc_ErrorDescriptor/2}], % Indention cosmetics ?INC_INDENT(State)) ];do_enc_ActionReply(ED, asn1_NOVALUE, CmdRep, State) when ED =/= asn1_NOVALUE, CmdRep =/= [] -> [ enc_list([{CmdRep, fun enc_CommandReply/2}, {[ED], fun enc_ErrorDescriptor/2}], % Indention cosmetics ?INC_INDENT(State)) ];do_enc_ActionReply(ED, CtxRep, CmdRep, State) when ED =/= asn1_NOVALUE, CtxRep =/= asn1_NOVALUE, CmdRep =/= [] -> [ enc_ContextRequest(CtxRep, ?INC_INDENT(State)), ?COMMA_INDENT(?INC_INDENT(State)), enc_list([{CmdRep, fun enc_CommandReply/2}, {[ED], fun enc_ErrorDescriptor/2}], % Indention cosmetics ?INC_INDENT(State)) ];do_enc_ActionReply(ED, asn1_NOVALUE, [], State) when ED =/= asn1_NOVALUE -> [ enc_ErrorDescriptor(ED, ?INC_INDENT(State)) ].enc_ContextRequest_priority(asn1_NOVALUE, _State) -> {[], dummy};enc_ContextRequest_priority(Val, _State) -> {[Val], fun(X,S) -> [?PriorityToken,?EQUAL,enc_UINT16(X, S)] end}.enc_ContextRequest_emergency(asn1_NOVALUE, _State) -> {[], dummy};enc_ContextRequest_emergency(true, _State) -> {[?EmergencyToken], fun(Elem, _) -> Elem end};enc_ContextRequest_emergency(false, _State) -> {[?EmergencyOffToken], fun(Elem, _) -> Elem end}.enc_ContextRequest_topologyReq(asn1_NOVALUE, _State) -> {[], dummy};enc_ContextRequest_topologyReq({'ContextRequest_topologyReq', asn1_NOVALUE}, _State) -> {[], dummy};enc_ContextRequest_topologyReq({'ContextRequest_topologyReq', List}, _State) -> {List, fun enc_TopologyRequest/2};enc_ContextRequest_topologyReq(List, _State) -> {[List], fun enc_TopologyRequest/2}.enc_ContextRequest_iepscallind(asn1_NOVALUE, _State) -> {[], dummy};enc_ContextRequest_iepscallind(Bool, _State) -> {[Bool], fun enc_iepsValue/2}.enc_ContextRequest_contextProp(asn1_NOVALUE, _State) -> {[], dummy};enc_ContextRequest_contextProp([], _State) -> {[], dummy};enc_ContextRequest_contextProp(Props, _State) -> {[Props], fun(Elem, S) -> enc_contextAttrDescriptor(Elem, contextProps, S) end}.enc_ContextRequest_contextList(asn1_NOVALUE, _State) -> {[], dummy};enc_ContextRequest_contextList([], _State) -> {[], dummy};enc_ContextRequest_contextList(Props, _State) -> {[Props], fun(Elem, S) -> enc_contextAttrDescriptor(Elem, contextList, S) end}.enc_contextAttrDescriptor([Mand|Opt], contextProps, State) -> [ ?ContextAttrToken, ?LBRKT_INDENT(State), [enc_PropertyParm(Mand, State) | [[?COMMA_INDENT(State), enc_PropertyParm(Val, State)] || Val <- Opt]], ?RBRKT_INDENT(State) ];enc_contextAttrDescriptor(CtxIdList, contextList, State) -> [ ?ContextAttrToken, ?LBRKT_INDENT(State), enc_contextIdList(CtxIdList, ?INC_INDENT(State)), ?RBRKT_INDENT(State) ].enc_contextIdList([Mand|Opt], State) -> State2 = ?INC_INDENT(State), [ ?ContextListToken, ?EQUAL, ?LBRKT_INDENT(State), [enc_ContextID(Mand, State2) | [[?COMMA_INDENT(State2), enc_ContextID(Val, State2)] || Val <- Opt]], ?RBRKT_INDENT(State) ].enc_ContextRequest(asn1_NOVALUE, _State) -> [];enc_ContextRequest(#'ContextRequest'{priority = asn1_NOVALUE, emergency = asn1_NOVALUE, topologyReq = asn1_NOVALUE, iepscallind = asn1_NOVALUE, contextProp = asn1_NOVALUE, contextList = asn1_NOVALUE}, _State) -> [];enc_ContextRequest(#'ContextRequest'{priority = asn1_NOVALUE, emergency = asn1_NOVALUE, topologyReq = [], iepscallind = asn1_NOVALUE, contextProp = [], contextList = []}, _State) -> [];enc_ContextRequest(#'ContextRequest'{priority = Prio, emergency = Em, topologyReq = TR, iepscallind = Ieps, contextProp = CP, contextList = CL}, State) -> [ enc_list([enc_ContextRequest_priority(Prio, State), enc_ContextRequest_emergency(Em, State), enc_ContextRequest_topologyReq(TR, State), enc_ContextRequest_iepscallind(Ieps, State), enc_ContextRequest_contextProp(CP, State), enc_ContextRequest_contextList(CL, State)], State) ].%% -- contextAudit --%% contextAudit = ContextAuditToken LBRKT %% (contextAuditProperties *(COMMA contextAuditProperties)) /%% indAudcontextAttrDesscriptor %% RBRKT%% contextAuditProperties = %% (TopologyToken / EmergencyToken / PriorityToken /%% IEPSToken / pkgdName / contextAuditSelect)%% contextAuditSelect = %% priority / emergencyValue / iepsValue /%% contextAttrDescriptor / auditSelectLogic%% indAudcontextAttrDesscriptor = %% ContextAttrToken LBRKT %% (contextAuditProperties *(COMMA contextAuditProperties)) %% RBRKT%% %% This could actually either be %% a) a list of contextAuditProperties: %% contextAuditProperties *(COMMA contextAuditProperties)%% b) a indAudcontextAttrDescriptor%% But since b) actually has the same content as a) with %% the extra ContextAttrToken, there does not seem to be any %% reason for using it.enc_ContextAttrAuditRequest(asn1_NOVALUE, _State) -> [];enc_ContextAttrAuditRequest( #'ContextAttrAuditRequest'{topology = asn1_NOVALUE, emergency = asn1_NOVALUE, priority = asn1_NOVALUE, iepscallind = asn1_NOVALUE, contextPropAud = asn1_NOVALUE, selectpriority = asn1_NOVALUE, selectemergency = asn1_NOVALUE, selectiepscallind = asn1_NOVALUE, selectLogic = asn1_NOVALUE}, _State) -> [];enc_ContextAttrAuditRequest( #'ContextAttrAuditRequest'{topology = asn1_NOVALUE, emergency = asn1_NOVALUE, priority = asn1_NOVALUE, iepscallind = asn1_NOVALUE, contextPropAud = [], selectpriority = asn1_NOVALUE, selectemergency = asn1_NOVALUE, selectiepscallind = asn1_NOVALUE, selectLogic = asn1_NOVALUE}, _State) -> [];enc_ContextAttrAuditRequest( #'ContextAttrAuditRequest'{topology = Top, emergency = Em, priority = Prio, iepscallind = Ieps, contextPropAud = CPA, selectpriority = SPrio, selectemergency = SEm, selectiepscallind = SIeps, selectLogic = SL}, State) -> [ ?ContextAuditToken, ?LBRKT_INDENT(State), enc_list([{[Top], fun('NULL', _) -> ?TopologyToken end}, {[Em], fun('NULL', _) -> ?EmergencyToken end}, {[Prio], fun('NULL', _) -> ?PriorityToken end}, {[Ieps], fun('NULL', _) -> ?IEPSToken end}, {CPA, fun enc_IndAudPropertyParm/2}, enc_ContextAttrAuditRequest_selectpriority(SPrio, State), enc_ContextAttrAuditRequest_selectemergency(SEm, State), enc_ContextAttrAuditRequest_selectiepscallind(SIeps, State), enc_ContextAttrAuditRequest_selectLogic(SL, State)], ?INC_INDENT(State)), ?RBRKT_INDENT(State) ].enc_ContextAttrAuditRequest_selectpriority(asn1_NOVALUE, _State) -> {[], dummy};enc_ContextAttrAuditRequest_selectpriority(SPrio, _State) -> {[SPrio], fun(X,S) -> [?PriorityToken,?EQUAL,enc_UINT16(X, S)] end}.enc_ContextAttrAuditRequest_selectemergency(asn1_NOVALUE, _State) -> {[], dummy}; enc_ContextAttrAuditRequest_selectemergency(SEm, _State) -> {[SEm], fun(X,S) -> enc_emergencyValue(X, S) end}. enc_ContextAttrAuditRequest_selectiepscallind(asn1_NOVALUE, _State) -> {[], dummy}; enc_ContextAttrAuditRequest_selectiepscallind(SEm, _State) -> {[SEm], fun(X,S) -> enc_iepsValue(X, S) end}. enc_ContextAttrAuditRequest_selectLogic(asn1_NOVALUE, _State) -> {[], dummy};enc_ContextAttrAuditRequest_selectLogic({andAUDITSelect, 'NULL'}, _State) -> {[], dummy}; % This is default so, there is no reason to add itenc_ContextAttrAuditRequest_selectLogic({orAUDITSelect, 'NULL'}, _State) -> {[?OrAUDITselectToken], fun(Elem, _) -> Elem end}.enc_emergencyValue(true, _) -> [?EmergencyValueToken,?EQUAL,?EmergencyToken];enc_emergencyValue(_, _) -> [?EmergencyValueToken,?EQUAL,?EmergencyOffToken]. %% enc_IndAudContextAttrDescriptor(%% #'ContextAttrAuditRequest'{topology = Top,%% emergency = Em,%% priority = Prio,%% iepscallind = Ieps,%% contextPropAud = CPA,%% selectpriority = SelPrio,%% selectemergency = SelEm,%% selectiepscallind = SelIeps,%% selectLogic = SelLog}, State) ->%% [%% ?ContextAttrToken,%% ?LBRKT_INDENT(State),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -