ASN.1


 簡介:

原文:

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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM