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