Hi
I would like to decode a binary file. The structure of this file is ASN.1 BER. But I want to do this using perl modules.
What modules do I need ? and if somebody has any examples based on perl, I will appreciate.
The idea is understand how to use the perl modules to do this.
This is piece of a ASN.1 structure of Nokia file, used to decode a binary file. I wanto to do the same but using perl.
Thanks malpa.
/*****************************************************************
*
* Title: ASN.1 GPRS definion
* Author: Tuomo Ala-Ranta
* Version: 2.2.1
*
******************************************************************/
asn_block{
---3GPP TS 32.298 V7.4.x
NSNGPRSDefinition
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
------------------------------------------------------------------------------
--
-- GPRS RECORDS
--
------------------------------------------------------------------------------
GPRSRecord ::= CHOICE
--
-- Record values 20..27 are GPRS specific
-- Record value 70 is FBC specific
-- Record values 76..77 are GPRS and MBMS specific
{
sgsnPDPRecord [20] SGSNPDPRecord,
ggsnPDPRecord [21] GGSNPDPRecord,
sgsnMMRecord [22] SGSNMMRecord
}
GGSNPDPRecord ::= [PRIVATE 1] SET --- G-CDR
{
recordType [0] RecordType,
networkInitiation [1] NetworkInitiatedPDPContext OPTIONAL,
servedIMSI [3] IMSI,
ggsnAddress [4] GSNAddress,
chargingID [5] ChargingID,
sgsnAddress [6] SEQUENCE OF GSNAddress,
accessPointNameNI [7] AccessPointNameNI OPTIONAL,
pdpType [8] PDPType OPTIONAL,
servedPDPAddress [9] PDPAddress OPTIONAL,
dynamicAddressFlag [11] DynamicAddressFlag OPTIONAL,
listOfTrafficVolumes [12] SEQUENCE OF ChangeOfCharConditionG OPTIONAL,
recordOpeningTime [13] TimeStamp,
duration [14] CallDuration,
causeForRecClosing [15] CauseForRecClosing,
recordSequenceNumber [17] bigint OPTIONAL,
nodeID [18] NodeID OPTIONAL,
recordExtensions [19] ManagementExtensionsG OPTIONAL , --AddressString OPTIONAL,
localSequenceNumber [20] LocalSequenceNumber OPTIONAL,
apnSelectionMode [21] APNSelectionMode OPTIONAL,
servedMSISDN [22] MSISDN OPTIONAL,
chargingCharacteristics [23] ChargingCharacteristics,
servedIMEISV [29] IMEI OPTIONAL
}
SGSNMMRecord ::= [PRIVATE 1] SET --- M-CDR
{
recordType [0] RecordType,
servedIMSI [1] IMSI,
servedIMEI [2] IMEI OPTIONAL,
sgsnAddress [3] GSNAddress OPTIONAL,
msNetworkCapability [4] MSNetworkCapability OPTIONAL,
routingArea [5] RoutingAreaCode OPTIONAL,
locationAreaCode [6] LocationAreaCode OPTIONAL,
cellIdentifier [7] CellId OPTIONAL,
changeLocation [8] SEQUENCE OF ChangeLocation OPTIONAL,
recordOpeningTime [9] TimeStamp,
duration [10] CallDuration OPTIONAL,
sgsnChange [11] SGSNChange OPTIONAL,
causeForRecClosing [12] CauseForRecClosing,
diagnostics [13] Diagnostics OPTIONAL,
recordSequenceNumber [14] bigint OPTIONAL,
nodeID [15] NodeID OPTIONAL,
recordExtensions [16] ManagementExtensionsMM OPTIONAL,
localSequenceNumber [17] LocalSequenceNumber OPTIONAL,
servedMSISDN [18] MSISDN OPTIONAL,
chargingCharacteristics [19] ChargingCharacteristics,
cAMELInformationMM [20] CAMELInformationMM OPTIONAL,
systemType [21] SystemType OPTIONAL,
chChSelectionMode [22] ChChSelectionMode OPTIONAL
}
SGSNPDPRecord ::= [PRIVATE 1] SET --- S-CDR
{
recordType [0] RecordType,
networkInitiation [1] NetworkInitiatedPDPContext OPTIONAL,
servedIMSI [3] IMSI,
servedIMEI [4] IMEI OPTIONAL,
sgsnAddress [5] GSNAddress OPTIONAL,
msNetworkCapability [6] MSNetworkCapability OPTIONAL,
routingArea [7] RoutingAreaCode OPTIONAL,
locationAreaCode [8] LocationAreaCode OPTIONAL,
cellIdentifier [9] CellId OPTIONAL,
chargingID [10] ChargingID,
ggsnAddressUsed [11] GSNAddress,
accessPointNameNI [12] AccessPointNameNI OPTIONAL,
pdpType [13] PDPType OPTIONAL,
servedPDPAddress [14] PDPAddress OPTIONAL,
listOfTrafficVolumes [15] SEQUENCE OF ChangeOfCharConditionS OPTIONAL,
recordOpeningTime [16] TimeStamp,
duration [17] CallDuration,
sgsnChange [18] SGSNChange OPTIONAL,
causeForRecClosing [19] CauseForRecClosing,
diagnostics [20] Diagnostics OPTIONAL,
recordSequenceNumber [21] bigint OPTIONAL,
nodeID [22] NodeID OPTIONAL,
recordExtensions [23] ManagementExtensionsS OPTIONAL,
localSequenceNumber [24] LocalSequenceNumber OPTIONAL,
apnSelectionMode [25] APNSelectionMode OPTIONAL,
accessPointNameOI [26] AccessPointNameOI OPTIONAL,
servedMSISDN [27] MSISDN OPTIONAL,
chargingCharacteristics [28] ChargingCharacteristics,
systemType [29] SystemType OPTIONAL,
cAMELInformationPDP [30] CAMELInformationPDP OPTIONAL,
rNCUnsentDownlinkVolume [31] DataVolumeGPRS OPTIONAL,
chChSelectionMode [32] ChChSelectionMode OPTIONAL,
dynamicAddressFlag [33] DynamicAddressFlag OPTIONAL
}
------------------------------------------------------------------------------
--
-- GPRS DATA TYPES
--
------------------------------------------------------------------------------
I would like to decode a binary file. The structure of this file is ASN.1 BER. But I want to do this using perl modules.
What modules do I need ? and if somebody has any examples based on perl, I will appreciate.
The idea is understand how to use the perl modules to do this.
This is piece of a ASN.1 structure of Nokia file, used to decode a binary file. I wanto to do the same but using perl.
Thanks malpa.
/*****************************************************************
*
* Title: ASN.1 GPRS definion
* Author: Tuomo Ala-Ranta
* Version: 2.2.1
*
******************************************************************/
asn_block{
---3GPP TS 32.298 V7.4.x
NSNGPRSDefinition
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
------------------------------------------------------------------------------
--
-- GPRS RECORDS
--
------------------------------------------------------------------------------
GPRSRecord ::= CHOICE
--
-- Record values 20..27 are GPRS specific
-- Record value 70 is FBC specific
-- Record values 76..77 are GPRS and MBMS specific
{
sgsnPDPRecord [20] SGSNPDPRecord,
ggsnPDPRecord [21] GGSNPDPRecord,
sgsnMMRecord [22] SGSNMMRecord
}
GGSNPDPRecord ::= [PRIVATE 1] SET --- G-CDR
{
recordType [0] RecordType,
networkInitiation [1] NetworkInitiatedPDPContext OPTIONAL,
servedIMSI [3] IMSI,
ggsnAddress [4] GSNAddress,
chargingID [5] ChargingID,
sgsnAddress [6] SEQUENCE OF GSNAddress,
accessPointNameNI [7] AccessPointNameNI OPTIONAL,
pdpType [8] PDPType OPTIONAL,
servedPDPAddress [9] PDPAddress OPTIONAL,
dynamicAddressFlag [11] DynamicAddressFlag OPTIONAL,
listOfTrafficVolumes [12] SEQUENCE OF ChangeOfCharConditionG OPTIONAL,
recordOpeningTime [13] TimeStamp,
duration [14] CallDuration,
causeForRecClosing [15] CauseForRecClosing,
recordSequenceNumber [17] bigint OPTIONAL,
nodeID [18] NodeID OPTIONAL,
recordExtensions [19] ManagementExtensionsG OPTIONAL , --AddressString OPTIONAL,
localSequenceNumber [20] LocalSequenceNumber OPTIONAL,
apnSelectionMode [21] APNSelectionMode OPTIONAL,
servedMSISDN [22] MSISDN OPTIONAL,
chargingCharacteristics [23] ChargingCharacteristics,
servedIMEISV [29] IMEI OPTIONAL
}
SGSNMMRecord ::= [PRIVATE 1] SET --- M-CDR
{
recordType [0] RecordType,
servedIMSI [1] IMSI,
servedIMEI [2] IMEI OPTIONAL,
sgsnAddress [3] GSNAddress OPTIONAL,
msNetworkCapability [4] MSNetworkCapability OPTIONAL,
routingArea [5] RoutingAreaCode OPTIONAL,
locationAreaCode [6] LocationAreaCode OPTIONAL,
cellIdentifier [7] CellId OPTIONAL,
changeLocation [8] SEQUENCE OF ChangeLocation OPTIONAL,
recordOpeningTime [9] TimeStamp,
duration [10] CallDuration OPTIONAL,
sgsnChange [11] SGSNChange OPTIONAL,
causeForRecClosing [12] CauseForRecClosing,
diagnostics [13] Diagnostics OPTIONAL,
recordSequenceNumber [14] bigint OPTIONAL,
nodeID [15] NodeID OPTIONAL,
recordExtensions [16] ManagementExtensionsMM OPTIONAL,
localSequenceNumber [17] LocalSequenceNumber OPTIONAL,
servedMSISDN [18] MSISDN OPTIONAL,
chargingCharacteristics [19] ChargingCharacteristics,
cAMELInformationMM [20] CAMELInformationMM OPTIONAL,
systemType [21] SystemType OPTIONAL,
chChSelectionMode [22] ChChSelectionMode OPTIONAL
}
SGSNPDPRecord ::= [PRIVATE 1] SET --- S-CDR
{
recordType [0] RecordType,
networkInitiation [1] NetworkInitiatedPDPContext OPTIONAL,
servedIMSI [3] IMSI,
servedIMEI [4] IMEI OPTIONAL,
sgsnAddress [5] GSNAddress OPTIONAL,
msNetworkCapability [6] MSNetworkCapability OPTIONAL,
routingArea [7] RoutingAreaCode OPTIONAL,
locationAreaCode [8] LocationAreaCode OPTIONAL,
cellIdentifier [9] CellId OPTIONAL,
chargingID [10] ChargingID,
ggsnAddressUsed [11] GSNAddress,
accessPointNameNI [12] AccessPointNameNI OPTIONAL,
pdpType [13] PDPType OPTIONAL,
servedPDPAddress [14] PDPAddress OPTIONAL,
listOfTrafficVolumes [15] SEQUENCE OF ChangeOfCharConditionS OPTIONAL,
recordOpeningTime [16] TimeStamp,
duration [17] CallDuration,
sgsnChange [18] SGSNChange OPTIONAL,
causeForRecClosing [19] CauseForRecClosing,
diagnostics [20] Diagnostics OPTIONAL,
recordSequenceNumber [21] bigint OPTIONAL,
nodeID [22] NodeID OPTIONAL,
recordExtensions [23] ManagementExtensionsS OPTIONAL,
localSequenceNumber [24] LocalSequenceNumber OPTIONAL,
apnSelectionMode [25] APNSelectionMode OPTIONAL,
accessPointNameOI [26] AccessPointNameOI OPTIONAL,
servedMSISDN [27] MSISDN OPTIONAL,
chargingCharacteristics [28] ChargingCharacteristics,
systemType [29] SystemType OPTIONAL,
cAMELInformationPDP [30] CAMELInformationPDP OPTIONAL,
rNCUnsentDownlinkVolume [31] DataVolumeGPRS OPTIONAL,
chChSelectionMode [32] ChChSelectionMode OPTIONAL,
dynamicAddressFlag [33] DynamicAddressFlag OPTIONAL
}
------------------------------------------------------------------------------
--
-- GPRS DATA TYPES
--
------------------------------------------------------------------------------