ber 2.3 KB

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