ASN.1

£可爱£侵袭症+ 提交于 2019-12-06 12:52:39

 简介:

原文:

https://www.itu.int/dms_pub/itu-t/oth/0B/04/T0B040000492C01PDFC.pdf

 

ASN.1是一种能够以独立于语言、平台和编码的形式,对计算机间交流的信息内容 进行定义的符号,并将这一定义称为“用于通信的抽象语法”。 如将它与“有效语法”的ABNF或“有效文件”的XSD概念进行比较,后一种概念 完全侧重于数据的有效编码,不关心任何可能附加给这类编码的意义,即没有任何 必要的语义联系。

ASN.1定义可方便地映射至C、C++、C#或Java数据结构等格式,用于应用编码, 并通过以XML或TLV(类型-长度-价值)或极紧密排列的编码格式提供表示形式编 解码的存储库而得到支持。 ASN.1广泛用于需要有效(低带宽、低交易成本)计算机通信的行业部门以及需要 高速信息编解码的部门(例如,生物计量信息和电话交换的传送)。

 

 

例子:

3GPP RANAP V6.2.0.asn

 

-- FILE: @(#)RANAP-PDU-Descriptions.asn13.2  04/09/14

 

-- 3GPP TS 25.413 V6.2.0 (2004-06)

-- 9.3.2Elementary Procedure Definitions

-- **************************************************************

--

-- Elementary Procedure definitions

--

-- **************************************************************

 

RANAP-PDU-Descriptions  {

itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)

umts-Access (20) modules (3) ranap (0) version1 (1) ranap-PDU-Descriptions (0)}

 

DEFINITIONS AUTOMATIC TAGS ::=

 

BEGIN

 

-- **************************************************************

--

-- IE parameter types from other modules.

--

-- **************************************************************

 

IMPORTS

Criticality,

ProcedureCode

FROM RANAP-CommonDataTypes

 

Iu-ReleaseCommand,

Iu-ReleaseComplete,

RelocationCommand,

RelocationPreparationFailure,

RelocationRequired,

RelocationRequest,

RelocationRequestAcknowledge,

RelocationFailure,

RelocationCancel,

RelocationCancelAcknowledge,

SRNS-ContextRequest,

SRNS-ContextResponse,

SecurityModeCommand,

SecurityModeComplete,

SecurityModeReject,

DataVolumeReportRequest,

DataVolumeReport,

Reset,

ResetAcknowledge,

RAB-ReleaseRequest,

Iu-ReleaseRequest,

RelocationDetect,

RelocationComplete,

Paging,

CommonID,

CN-InvokeTrace,

CN-DeactivateTrace,

LocationReportingControl,

LocationReport,

InitialUE-Message,

DirectTransfer,

Overload,

ErrorIndication,

SRNS-DataForwardCommand,

ForwardSRNS-Context,

RAB-AssignmentRequest,

RAB-AssignmentResponse,

RAB-ModifyRequest,

PrivateMessage,

ResetResource,

ResetResourceAcknowledge,

RANAP-RelocationInformation,

LocationRelatedDataRequest,

LocationRelatedDataResponse,

LocationRelatedDataFailure,

InformationTransferIndication,

InformationTransferConfirmation,

InformationTransferFailure,

UESpecificInformationIndication,

DirectInformationTransfer,

UplinkInformationTransferIndication,

UplinkInformationTransferConfirmation,

UplinkInformationTransferFailure

FROM RANAP-PDU-Contents

 

id-LocationRelatedData,

id-CN-DeactivateTrace,

id-CN-InvokeTrace,

id-CommonID,

id-DataVolumeReport,

id-DirectTransfer,

id-ErrorIndication,

id-ForwardSRNS-Context,

id-InformationTransfer,

id-InitialUE-Message,

id-Iu-Release,

id-Iu-ReleaseRequest,

id-LocationReport,

id-LocationReportingControl,

id-OverloadControl,

id-Paging,

id-privateMessage,

id-RAB-Assignment,

id-RAB-ReleaseRequest,

id-RAB-ModifyRequest,

id-RANAP-Relocation,

id-RelocationCancel,

id-RelocationComplete,

id-RelocationDetect,

id-RelocationPreparation,

id-RelocationResourceAllocation,

id-Reset,

id-SRNS-ContextTransfer,

id-SRNS-DataForward,

id-SecurityModeControl,

id-ResetResource,

id-UESpecificInformation,

id-DirectInformationTransfer,

id-UplinkInformationTransfer

FROM RANAP-Constants;

 

-- **************************************************************

--

-- Interface Elementary Procedure Class

--

-- **************************************************************

 

RANAP-ELEMENTARY-PROCEDURE ::= CLASS {

&InitiatingMessage,

&SuccessfulOutcomeOPTIONAL,

&UnsuccessfulOutcomeOPTIONAL,

&OutcomeOPTIONAL,

&procedureCodeProcedureCode UNIQUE,

&criticalityCriticality DEFAULT ignore

}

WITH SYNTAX {

INITIATING MESSAGE&InitiatingMessage

[SUCCESSFUL OUTCOME&SuccessfulOutcome]

[UNSUCCESSFUL OUTCOME&UnsuccessfulOutcome]

[OUTCOME&Outcome]

PROCEDURE CODE&procedureCode

[CRITICALITY&criticality]

}

 

-- **************************************************************

--

-- Interface PDU Definition

--

-- **************************************************************

 

RANAP-PDU ::= CHOICE {

initiatingMessageInitiatingMessage,

successfulOutcomeSuccessfulOutcome,

unsuccessfulOutcomeUnsuccessfulOutcome,

outcomeOutcome,

...

}

 

InitiatingMessage ::= SEQUENCE {

procedureCodeRANAP-ELEMENTARY-PROCEDURE.&procedureCode({RANAP-ELEMENTARY-PROCEDURES}),

criticalityRANAP-ELEMENTARY-PROCEDURE.&criticality({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode}),

valueRANAP-ELEMENTARY-PROCEDURE.&InitiatingMessage({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode})

}

 

SuccessfulOutcome ::= SEQUENCE {

procedureCodeRANAP-ELEMENTARY-PROCEDURE.&procedureCode({RANAP-ELEMENTARY-PROCEDURES}),

criticalityRANAP-ELEMENTARY-PROCEDURE.&criticality({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode}),

valueRANAP-ELEMENTARY-PROCEDURE.&SuccessfulOutcome({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode})

}

 

UnsuccessfulOutcome ::= SEQUENCE {

procedureCodeRANAP-ELEMENTARY-PROCEDURE.&procedureCode({RANAP-ELEMENTARY-PROCEDURES}),

criticalityRANAP-ELEMENTARY-PROCEDURE.&criticality({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode}),

valueRANAP-ELEMENTARY-PROCEDURE.&UnsuccessfulOutcome({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode})

}

 

Outcome ::= SEQUENCE {

procedureCodeRANAP-ELEMENTARY-PROCEDURE.&procedureCode({RANAP-ELEMENTARY-PROCEDURES}),

criticalityRANAP-ELEMENTARY-PROCEDURE.&criticality({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode}),

valueRANAP-ELEMENTARY-PROCEDURE.&Outcome({RANAP-ELEMENTARY-PROCEDURES}{@procedureCode})

}


应用方式:

http://harmony.apache.org/subcomponents/classlibrary/asn1_framework.html#Overview

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!