xref: /netbsd-src/external/bsd/file/dist/magic/magdir/ber (revision dc958920d95b669c2a61806f127b489440aee7e5)
1ae9cfef6Schristos
2ae9cfef6Schristos#------------------------------------------------------------------------------
3*dc958920Schristos# $File: ber,v 1.2 2019/04/19 00:42:27 christos Exp $
4ae9cfef6Schristos# ber:  file(1) magic for several BER formats used in the mobile
5ae9cfef6Schristos# telecommunications industry (Georg Sauthoff)
6ae9cfef6Schristos
7ae9cfef6Schristos# The file formats are standardized by the GSMA (GSM association).
8ae9cfef6Schristos# They are specified via ASN.1 schemas and some prose. Basic encoding
9ae9cfef6Schristos# rules (BER) is the used encoding. The formats are used for exchanging
10ae9cfef6Schristos# call data records (CDRs) between mobile operators and associated
11ae9cfef6Schristos# parties for roaming clearing purposes and fraud detection.
12ae9cfef6Schristos
13ae9cfef6Schristos# The magic file covers:
14ae9cfef6Schristos
15ae9cfef6Schristos# - TAP files (TD.57) - CDR batches and notifications
16ae9cfef6Schristos# - RAP files (TD.32) - return batches and acknowledgements
17ae9cfef6Schristos# - NRT files (TD.35) - CDR batches for 'near real time' processing
18ae9cfef6Schristos
19ae9cfef6Schristos#
20ae9cfef6Schristos# TAP 3 Files
21ae9cfef6Schristos# TAP -> Transferred Account Procedure
22*dc958920Schristos# cf. https://www.gsma.com/newsroom/wp-content/uploads/TD.57-v32.31.pdf
23ae9cfef6Schristos# TransferBatch short tag
24ae9cfef6Schristos0	byte	0x61
25ae9cfef6Schristos# BatchControlInfo short tag
26ae9cfef6Schristos>&1	search/b5	\x64
27ae9cfef6Schristos# Sender long tag #TAP 3.x (BER encoded)
28ae9cfef6Schristos>>&1	search/b8	\x5f\x81\x44
29ae9cfef6Schristos# <SpecificationVersionNumber>3</><ReleaseVersionNumber> block
30ae9cfef6Schristos>>>&64	search/b64	\x5f\x81\x49\x01\x03\x5f\x81\x3d\x01
31ae9cfef6Schristos>>>>&0	byte	x	TAP 3.%d Batch (TD.57, Transferred Account)
32ae9cfef6Schristos
33ae9cfef6Schristos# Notification short tag
34ae9cfef6Schristos0	byte	0x62
35ae9cfef6Schristos# Sender long tag
36ae9cfef6Schristos>2	search/b8	\x5f\x81\x44
37ae9cfef6Schristos# <SpecificationVersionNumber>3</><ReleaseVersionNumber> block
38ae9cfef6Schristos>>&64	search/b64	\x5f\x81\x49\x01\x03\x5f\x81\x3d\x01
39ae9cfef6Schristos>>>&0	byte	x	TAP 3.%d Notification (TD.57, Transferred Account)
40ae9cfef6Schristos
41ae9cfef6Schristos
42ae9cfef6Schristos# NRT Files
43ae9cfef6Schristos# NRT a.k.a. NRTRDE
44ae9cfef6Schristos0	byte	0x61
45ae9cfef6Schristos# <SpecificationVersionNumber>2</><ReleaseVersionNumber> block
46ae9cfef6Schristos>&1	search/b8 \x5f\x29\x01\x02\x5f\x25\x01
47ae9cfef6Schristos>>&0	byte	x	NRT 2.%d (TD.35, Near Real Time Roaming Data Exchange)
48ae9cfef6Schristos
49ae9cfef6Schristos# RAP Files
50*dc958920Schristos# cf. https://www.gsma.com/newsroom/wp-content/uploads/TD.32-v6.11.pdf
51ae9cfef6Schristos# Long ReturnBatch tag
52ae9cfef6Schristos0	string	\x7f\x84\x16
53ae9cfef6Schristos# Long RapBatchControlInfo tag
54ae9cfef6Schristos>&1	search/b8	\x7f\x84\x19
55ae9cfef6Schristos# <SpecificationVersionNumber>3</><ReleaseVersionNumber> block
56ae9cfef6Schristos>>&64	search/b64	\x5f\x81\x49\x01\x03\x5f\x81\x3d\x01
57ae9cfef6Schristos# <RapSpecificationVersionNumber>1</><RapReleaseVersionNumber> block
58ae9cfef6Schristos>>>&1	string/b	\x5f\x84\x20\x01\x01\x5f\x84\x1f\x01
59ae9cfef6Schristos>>>>&0	byte	x	RAP 1.%d Batch (TD.32, Returned Account Procedure),
60ae9cfef6Schristos>>>&0	byte	x	TAP 3.%d
61ae9cfef6Schristos
62ae9cfef6Schristos# Long Acknowledgement tag
63ae9cfef6Schristos0	string \x7f\x84\x17
64ae9cfef6Schristos# Long Sender tag
65ae9cfef6Schristos>&1	search/b5	\x5f\x81\x44	RAP Acknowledgement (TD.32, Returned Account Procedure)
66