telcoladder 0.2.0__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. {telcoladder-0.2.0/telcoladder.egg-info → telcoladder-0.4.0}/PKG-INFO +92 -24
  2. {telcoladder-0.2.0 → telcoladder-0.4.0}/README.md +91 -23
  3. {telcoladder-0.2.0 → telcoladder-0.4.0}/pyproject.toml +1 -1
  4. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/__init__.py +1 -1
  5. telcoladder-0.4.0/telcoladder/activity.py +88 -0
  6. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/__init__.py +67 -6
  7. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/diameter.py +34 -1
  8. telcoladder-0.4.0/telcoladder/adapters/enum.py +112 -0
  9. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/gtpv2.py +39 -6
  10. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/nas5gs.py +19 -0
  11. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/naseps.py +21 -4
  12. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/s1ap.py +4 -1
  13. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/sbi.py +348 -2
  14. telcoladder-0.4.0/telcoladder/adapters/sgsap.py +120 -0
  15. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/sip.py +75 -17
  16. telcoladder-0.4.0/telcoladder/anonymize.py +2234 -0
  17. telcoladder-0.4.0/telcoladder/behavior.py +320 -0
  18. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/callflow.py +82 -8
  19. telcoladder-0.4.0/telcoladder/calls.py +467 -0
  20. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/cli.py +90 -0
  21. telcoladder-0.4.0/telcoladder/connections.py +70 -0
  22. telcoladder-0.4.0/telcoladder/correlate.py +194 -0
  23. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/coverage.py +216 -120
  24. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/diameterflows.py +2 -0
  25. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/extract.py +26 -1
  26. telcoladder-0.4.0/telcoladder/hpack_huffman.py +108 -0
  27. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/identities.py +6 -5
  28. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/identity.py +172 -0
  29. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/interfaces.py +23 -1
  30. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/ipsec.py +5 -2
  31. telcoladder-0.4.0/telcoladder/lanes.py +178 -0
  32. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/lifecycle.py +94 -8
  33. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/mcp.py +1 -1
  34. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/model.py +120 -6
  35. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/nf.py +165 -20
  36. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/overview.py +48 -1
  37. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/packets.py +3 -1
  38. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/pipeline.py +207 -41
  39. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/probe.py +201 -12
  40. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/procedures.py +501 -50
  41. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/session.py +43 -4
  42. telcoladder-0.4.0/telcoladder/static/app.css +1 -0
  43. telcoladder-0.4.0/telcoladder/static/app.js +288 -0
  44. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/summary.py +50 -8
  45. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/translations/zh_tw.py +124 -8
  46. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/tshark.py +35 -0
  47. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/viewer.py +117 -6
  48. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/web.py +75 -20
  49. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/wireview.py +7 -1
  50. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/xdr.py +51 -9
  51. {telcoladder-0.2.0 → telcoladder-0.4.0/telcoladder.egg-info}/PKG-INFO +92 -24
  52. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder.egg-info/SOURCES.txt +34 -0
  53. telcoladder-0.4.0/tests/test_4g_nas_completeness.py +124 -0
  54. telcoladder-0.4.0/tests/test_4g_s_tmsi_and_transactions.py +192 -0
  55. telcoladder-0.4.0/tests/test_4g_scenarios.py +141 -0
  56. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_adapter_diameter.py +105 -21
  57. telcoladder-0.4.0/tests/test_adapter_sgsap.py +124 -0
  58. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_adapter_sip.py +3 -2
  59. telcoladder-0.4.0/tests/test_anonymize.py +476 -0
  60. telcoladder-0.4.0/tests/test_behavior.py +343 -0
  61. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_callflow_api.py +16 -0
  62. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_correlate_nf.py +10 -3
  63. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_coverage.py +24 -21
  64. telcoladder-0.4.0/tests/test_coverage_pieces.py +146 -0
  65. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_diameter_flow.py +2 -1
  66. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_diameter_redirect.py +4 -3
  67. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_diameter_roles.py +39 -2
  68. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_e2e_correlation.py +5 -1
  69. telcoladder-0.4.0/tests/test_embedded_supi.py +130 -0
  70. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_flow_handle.py +6 -3
  71. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_identities.py +20 -5
  72. telcoladder-0.4.0/tests/test_initiator_side.py +126 -0
  73. telcoladder-0.4.0/tests/test_lanes.py +210 -0
  74. telcoladder-0.4.0/tests/test_load_progress.py +96 -0
  75. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_n26_handover.py +8 -5
  76. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_nf_ladder.py +1 -0
  77. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_no_real_subscriber_data.py +6 -0
  78. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_overview.py +24 -5
  79. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_plugins.py +2 -2
  80. telcoladder-0.4.0/tests/test_procedure_labels.py +153 -0
  81. telcoladder-0.4.0/tests/test_procedure_taxonomy.py +155 -0
  82. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_procedures.py +151 -5
  83. telcoladder-0.4.0/tests/test_quoted_tunnels.py +281 -0
  84. telcoladder-0.4.0/tests/test_radio_connections.py +139 -0
  85. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_release_attribution.py +16 -9
  86. telcoladder-0.4.0/tests/test_rrc_containers.py +110 -0
  87. telcoladder-0.4.0/tests/test_sbi_consumer_roles.py +138 -0
  88. telcoladder-0.4.0/tests/test_sbi_late_body.py +238 -0
  89. telcoladder-0.4.0/tests/test_sbi_n1n2_sender.py +113 -0
  90. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_sbi_n2_bridge.py +23 -8
  91. telcoladder-0.4.0/tests/test_sbi_provider_roles.py +34 -0
  92. telcoladder-0.4.0/tests/test_session_activity.py +140 -0
  93. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_sip_calls.py +12 -5
  94. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_summary.py +37 -5
  95. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_timers.py +12 -5
  96. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_tshark_prefs.py +41 -0
  97. telcoladder-0.4.0/tests/test_ue_role.py +159 -0
  98. telcoladder-0.4.0/tests/test_ui_readability.py +112 -0
  99. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_viewer_session.py +48 -7
  100. telcoladder-0.4.0/tests/test_volte_e2e_call.py +180 -0
  101. telcoladder-0.4.0/tests/test_volte_e2e_decoding.py +179 -0
  102. telcoladder-0.4.0/tests/test_volte_e2e_identity.py +199 -0
  103. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_web_assets.py +8 -1
  104. telcoladder-0.2.0/telcoladder/calls.py +0 -312
  105. telcoladder-0.2.0/telcoladder/correlate.py +0 -98
  106. telcoladder-0.2.0/telcoladder/static/app.css +0 -1
  107. telcoladder-0.2.0/telcoladder/static/app.js +0 -271
  108. {telcoladder-0.2.0 → telcoladder-0.4.0}/LICENSE +0 -0
  109. {telcoladder-0.2.0 → telcoladder-0.4.0}/NOTICE +0 -0
  110. {telcoladder-0.2.0 → telcoladder-0.4.0}/setup.cfg +0 -0
  111. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/__main__.py +0 -0
  112. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/carrier.py +0 -0
  113. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/gtp.py +0 -0
  114. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/megaco.py +0 -0
  115. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/ngap.py +0 -0
  116. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/adapters/pfcp.py +0 -0
  117. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/causes.py +0 -0
  118. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/chrome.py +0 -0
  119. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/diameter_3gpp.yaml +0 -0
  120. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/diameter_base.yaml +0 -0
  121. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/gtpv2.yaml +0 -0
  122. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/megaco_error.yaml +0 -0
  123. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/nas_5gmm.yaml +0 -0
  124. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/nas_5gsm.yaml +0 -0
  125. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/nas_eps_emm.yaml +0 -0
  126. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/nas_eps_esm.yaml +0 -0
  127. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/ngap_misc.yaml +0 -0
  128. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/ngap_nas.yaml +0 -0
  129. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/ngap_protocol.yaml +0 -0
  130. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/ngap_radioNetwork.yaml +0 -0
  131. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/ngap_transport.yaml +0 -0
  132. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/pfcp.yaml +0 -0
  133. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/q850.yaml +0 -0
  134. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/s1ap_misc.yaml +0 -0
  135. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/s1ap_nas.yaml +0 -0
  136. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/s1ap_protocol.yaml +0 -0
  137. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/s1ap_radioNetwork.yaml +0 -0
  138. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/s1ap_transport.yaml +0 -0
  139. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/causes/sip_status.yaml +0 -0
  140. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/data/decode-as.yaml +0 -0
  141. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/decode.py +0 -0
  142. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/decodeas.py +0 -0
  143. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/endpoints.py +0 -0
  144. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/flowtable.py +0 -0
  145. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/framebytes.py +0 -0
  146. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/i18n.py +0 -0
  147. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/nettrace.py +0 -0
  148. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/pdusession.py +0 -0
  149. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/plugins.py +0 -0
  150. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/prefilter.py +0 -0
  151. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/render_mermaid.py +0 -0
  152. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/slicer.py +0 -0
  153. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/static/theme.js +0 -0
  154. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/timers.py +0 -0
  155. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder/translations/__init__.py +0 -0
  156. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder.egg-info/dependency_links.txt +0 -0
  157. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder.egg-info/entry_points.txt +0 -0
  158. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder.egg-info/requires.txt +0 -0
  159. {telcoladder-0.2.0 → telcoladder-0.4.0}/telcoladder.egg-info/top_level.txt +0 -0
  160. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_4g_identity_model.py +0 -0
  161. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_adapter_gtpv2.py +0 -0
  162. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_adapter_megaco.py +0 -0
  163. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_adapter_naseps.py +0 -0
  164. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_adapter_s1ap.py +0 -0
  165. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_adapters.py +0 -0
  166. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_archmap.py +0 -0
  167. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_batch.py +0 -0
  168. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_blast_radius.py +0 -0
  169. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_calls.py +0 -0
  170. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_carrier_polymorphism.py +0 -0
  171. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_causes.py +0 -0
  172. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_cli_encoding.py +0 -0
  173. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_cli_help.py +0 -0
  174. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_cli_summarize.py +0 -0
  175. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_decode.py +0 -0
  176. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_decodeas.py +0 -0
  177. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_docs_support_table.py +0 -0
  178. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_extract.py +0 -0
  179. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_failure_scenarios.py +0 -0
  180. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_filter_composition.py +0 -0
  181. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_flows_api.py +0 -0
  182. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_flowtable.py +0 -0
  183. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_frame_filter.py +0 -0
  184. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_frame_time.py +0 -0
  185. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_framebytes.py +0 -0
  186. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_gtp_adapter.py +0 -0
  187. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_i18n.py +0 -0
  188. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_identifier_reuse.py +0 -0
  189. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_index_race.py +0 -0
  190. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_ip_fragments.py +0 -0
  191. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_ipsec.py +0 -0
  192. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_mcp.py +0 -0
  193. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_message_abs_ts.py +0 -0
  194. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_min_python.py +0 -0
  195. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_nettrace.py +0 -0
  196. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_packaging.py +0 -0
  197. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_packets.py +0 -0
  198. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_pdusession.py +0 -0
  199. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_pfcp_correlation.py +0 -0
  200. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_prefilter.py +0 -0
  201. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_probe.py +0 -0
  202. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_python_baseline.py +0 -0
  203. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_render_mermaid.py +0 -0
  204. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_sequence_rules.py +0 -0
  205. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_session_decode_params.py +0 -0
  206. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_tmsi_identity.py +0 -0
  207. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_tshark.py +0 -0
  208. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_user_dlt.py +0 -0
  209. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_validation_gate.py +0 -0
  210. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_web.py +0 -0
  211. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_web_i18n.py +0 -0
  212. {telcoladder-0.2.0 → telcoladder-0.4.0}/tests/test_wireview.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: telcoladder
3
- Version: 0.2.0
3
+ Version: 0.4.0
4
4
  Summary: Turn telecom signalling captures into Mermaid sequence diagrams — 5G core, 4G/EPC and IMS on one timeline.
5
5
  Author: gollumw
6
6
  License: PolyForm-Noncommercial-1.0.0
@@ -99,7 +99,7 @@ cell cites the frame it came from.
99
99
  | Generation | Protocols | Cause explanations |
100
100
  |---|---|---|
101
101
  | **5G core** | NGAP, NAS-5GS, HTTP/2 SBI, PFCP, GTP-U | 206 |
102
- | **4G / EPC** | S1AP, NAS-EPS, GTPv2-C (S11, S5/S8, N26) | 236 |
102
+ | **4G / EPC** | S1AP, NAS-EPS, GTPv2-C (S11, S5/S8, N26), SGsAP (SGs) | 236 |
103
103
  | **IMS** | SIP (calls, KPIs), Diameter, H.248/MEGACO | 333 |
104
104
 
105
105
  Every cause code is resolved through a hand-verified table to the specification
@@ -120,9 +120,14 @@ rather than shown as an IP, with the evidence for that name on hover.
120
120
  | A bare cause number and a trip to the spec | 775 causes with the specification named, plain language and field root causes; clauses where a person checked them |
121
121
  | RAN and core blaming each other for a dropped context | Every UE context release marked **requested by the RAN** or **ordered by the core** — a wire fact, not an opinion |
122
122
  | A procedure that stalls for no visible reason | The gap named when it matches a NAS timer's default (T3560, T3460 …), and failures counted by TAC, cell, DNN and core element |
123
+ | VoLTE Gm signalling hidden inside IPsec ESP | NULL-encrypted ESP is detected and decoded, so the SIP and SDP inside join the subscriber's ladder. ESP that is really encrypted stays unreadable and is counted, not guessed |
124
+ | A B2BUA (an AS, or an SBC that keeps the charging ID) changes the Call-ID, so one call shows up as unrelated dialogs | Legs that share a charging ID (ICID) and overlap in time are one call, end to end — H.248, HSS, charging and ENUM attached only where evidence ties them to that call |
123
125
  | Customer captures that must never leave the building | A command on your machine: no network listener beyond `127.0.0.1`, no telemetry, no cloud, no model |
124
126
 
125
- ## Thirty seconds, four ways in
127
+ ## Quickstart: five ways in
128
+
129
+ > **Windows without Python?** Skip `pip` and jump to
130
+ > [4. Windows, no install](#windows-no-install) — the only prerequisite is Wireshark.
126
131
 
127
132
  ```bash
128
133
  # 1. CLI — one page of deterministic facts, Markdown or JSON
@@ -136,11 +141,33 @@ telcoladder serve # http://127.0.0.1:3005
136
141
  claude mcp add telcoladder -- telcoladder mcp
137
142
  ```
138
143
 
139
- **4. Windows, no install.** Download `TelcoLadder-Windows-x64.zip` from the
140
- [Releases](https://github.com/gollumw/TelcoLadder/releases) page — a standalone
141
- executable in a portable zip, built by CI from the tagged source. Unzip,
142
- run `check-environment.cmd`, and use `telcoladder.exe` from that folder. It
143
- needs Wireshark 4.0 or newer on the machine, nothing else.
144
+ <a id="windows-no-install"></a>
145
+ **4. Windows, no install.** A standalone executable in a portable zip, built by
146
+ CI from the tagged source. Nothing is installed and no registry key is written;
147
+ it needs Wireshark 4.0 or newer on the machine, nothing else.
148
+
149
+ 1. **Download and unzip.** Get `TelcoLadder-Windows-x64.zip` (about 10 MB) from
150
+ the [Releases](https://github.com/gollumw/TelcoLadder/releases) page.
151
+ 2. **Double-click `check-environment.cmd`.** It finds `tshark.exe` in
152
+ Wireshark's default install location under Program Files — or wherever
153
+ `TELCOLADDER_TSHARK` points — and checks the dissectors.
154
+ 3. **Run it from that folder.**
155
+ ```bat
156
+ telcoladder.exe summarize capture.pcapng
157
+ telcoladder.exe serve
158
+ ```
159
+ `serve` listens on `http://127.0.0.1:3005`: open it in your browser, drop a
160
+ capture (up to 1 GB), or paste a path for anything larger.
161
+
162
+ **5. Hand a capture to someone else.** `telcoladder anonymize in.pcap out.pcap`
163
+ rewrites subscriber identities, addresses, hostnames, PLMN and cell identifiers
164
+ into keyed pseudonyms of the *same length* — TBCD, ASCII, JSON and HPACK-Huffman
165
+ alike — recomputes every checksum, then re-reads its own output and refuses to
166
+ keep it if any original value is still visible. The output walks the same
167
+ pipeline to the same procedures, roles and failures; only the names differ.
168
+ Same key, same pseudonyms across captures; the key is printed once and never
169
+ written down. Compressed HTTP/2 bodies cannot be rewritten in place and are
170
+ refused unless `--blank-opaque-bodies`.
144
171
 
145
172
  Requires Python 3.11+ and `tshark` (Wireshark 4.0 or newer) for the `pip`
146
173
  route. Neither the macOS nor the Windows installer puts `tshark` on your `PATH`;
@@ -211,11 +238,20 @@ Each of these is a fixture in `tests/fixtures/` you can run yourself.
211
238
  the scopes described above. On a production trace with TLS on SBI and
212
239
  ECIES-protected SUCIs the N2 side still forms its own per-UE flow; what
213
240
  could not be read is counted and reported, not silently dropped.
214
- - **Splits a subscriber's traffic into procedures** — registration, attach,
215
- PDU session, service request, deregistration, context release, handover,
216
- IMS registration and call — each with outcome, cause, first failure,
217
- duration, and where applicable the initiator, the matched timer, or the
218
- handover preparation and execution times.
241
+ - **Splits a subscriber's traffic into scenarios** — registration, attach,
242
+ PDU session, service request (UE- or network-triggered), dedicated bearer
243
+ setup, modification and release, deregistration, handover
244
+ (including one that was **cancelled**, which is not a failure), idle
245
+ mobility, IMS registration and call — each with outcome, cause, first
246
+ failure, duration, and where applicable the initiator, the matched timer, or
247
+ the handover preparation and execution times. **The axis is what the
248
+ subscriber was doing, not which protocol carried it**: the S6a exchange
249
+ inside an attach is part of that attach, the context release that ends a
250
+ scenario is part of that scenario (its initiator and cause travel with it,
251
+ and the xDR still lists the release as a row of its own), and an HSS answer of "unknown user"
252
+ is that attach's failure. A Diameter exchange that belongs to no scenario
253
+ stands on its own as an HSS-initiated one — under 4G for S6a/Gx and under IMS
254
+ for Cx/Sh, which the Application-Id decides.
219
255
  - **Reads Diameter through the DRA**: S6a/S6d, Cx/Dx, Sh, Rx, Gx, SWx and S6b,
220
256
  roles from who initiates which command, a request seen on both sides of a
221
257
  relay shown as one transaction with two hops, a relayed failure counted once.
@@ -273,24 +309,56 @@ diagram, Mermaid as the output, and a verified explanation of what went wrong.
273
309
  - **A fully transparent SCP** that sends no `3gpp-Sbi-Target-apiRoot` is
274
310
  indistinguishable from the endpoint and falls back to an unlabelled IP. The
275
311
  correct failure direction, and a real gap.
276
- - **Diameter covers seven interfaces** with roles and curated causes; the rest
277
- decode and show their Application-Id with no role inference. The fixture is
278
- written from RFC 6733, not captured: no SCTP, no reassembly, invented timing.
279
- - **SIP proxies are not yet told apart** (`Via` is recorded, Mw and ISC are
280
- unlabelled); H.248 gets neutral `MGC` / `MGW` roles and no reference point,
312
+ - **Diameter covers seven interfaces** with roles and curated causes (S6a/S6d,
313
+ Cx/Dx, Sh, Rx, Gx, SWx, S6b); the rest — Rf included — decode and show their
314
+ Application-Id with no role inference. Every Diameter fixture is written from
315
+ RFC 6733, not captured: TCP only, no SCTP, invented timing.
316
+ - **Four behavior rules have no capture behind them.** S10 inter-MME handover,
317
+ the Xn/X2 path switch, CS fallback and the Cx authentication delay inside a
318
+ call are written from message names and covered only by synthetic tests; how
319
+ they read a real capture is unmeasured. The chain shown before a failure is the
320
+ order of messages within one segment, not proven causation.
321
+ - **SIP alone does not name the core proxies.** The UE and the P-CSCF come from
322
+ Gm itself — the security-agreement headers, or which address holds IPsec
323
+ associations with several peers, falling back to a `Contact` that carries a
324
+ subscriber identity; an I-CSCF, S-CSCF or AS is named only when its Cx or Sh
325
+ exchange is in the same capture. Gm is the only SIP
326
+ reference point labelled — Mw and ISC are not, because no capture here has
327
+ verified them. H.248 gets neutral `MGC` / `MGW` roles and no reference point,
281
328
  because the protocol alone cannot say whether it is Iq, Mn or Mp.
282
- - **Only 7 of the 21 cause tables cite a clause.** The other 14 name the
329
+ - **Calls and numbers join only on evidence.** B2BUA legs become one call only
330
+ when they share a charging ID (ICID) and overlap in time — a B2BUA or SBC
331
+ that replaces the ICID leaves separate rows. A number joins HSS, charging and
332
+ ENUM records only in international form; a local-form number is never
333
+ completed with a guessed country code. VoLTE, VoNR and VoWiFi are shown only
334
+ where `P-Access-Network-Info` declares them; without that header the access
335
+ is reported as not declared.
336
+ - **Only 9 of the 21 cause tables cite a clause.** The other 12 name the
283
337
  specification and stop. An absent clause is better than a wrong one.
284
338
  - **The 4G, IMS and handover fixtures are written byte by byte** with `tshark`
285
339
  as the oracle: exact about the protocol, silent about any real deployment.
286
- Each `scenario.md` lists what its fixture cannot prove. There is no EPS → 5GS
287
- handover fixture yet, and no UE radio capability parsing.
340
+ Each `scenario.md` lists what its fixture cannot prove. UE radio capability
341
+ is not parsed: the NR and LTE RRC containers are skipped during extraction
342
+ because dissecting them is slow, and stay readable in the per-frame decode
343
+ tree.
288
344
  - **NAS after Security Mode Command is encrypted** and its content is
289
- invisible; the packets still appear as their NGAP carrier. GTP-U joins the
290
- subscriber but carries no throughput or loss KPIs; there is no RTP adapter;
291
- ISUP and CAMEL are recognised but not read.
345
+ invisible; the packets still appear as their NGAP carrier. The same holds for
346
+ IPsec ESP on Gm: only NULL-encrypted ESP is read, and encrypted ESP is counted
347
+ as unreadable. GTP-U joins the subscriber but carries no throughput or loss
348
+ KPIs; there is no RTP adapter; ISUP and CAMEL are recognised but not read.
349
+ - **Joins through a tunnel an SBI message quotes are inferences.** They bind by
350
+ direction, inside a time window, never across a release, and never where they
351
+ would give one flow two SUPIs; the summary counts each one. What remains: a
352
+ stale forwarded quote that arrives after its tunnel was released, where the UPF
353
+ reused that exact TEID within 10 s for a UE whose flow shows no SUPI, could
354
+ still be joined. On a single capture point that order violates the protocol.
292
355
  - **Mermaid gets slow with very large flows.** Use `--max-messages`; truncation
293
356
  is always stated inside the diagram.
357
+ - **`anonymize` proves absence only for what tshark can name.** Identities it
358
+ never decoded stay where they are; TLS payloads are opaque; gzip bodies and
359
+ bodies reassembled across DATA frames are refused rather than guessed at;
360
+ IPv6 text and binary forms, and TAC text and binary forms, are pseudonymised
361
+ independently. The report lists every one of these.
294
362
 
295
363
  ## How it is verified
296
364
 
@@ -67,7 +67,7 @@ cell cites the frame it came from.
67
67
  | Generation | Protocols | Cause explanations |
68
68
  |---|---|---|
69
69
  | **5G core** | NGAP, NAS-5GS, HTTP/2 SBI, PFCP, GTP-U | 206 |
70
- | **4G / EPC** | S1AP, NAS-EPS, GTPv2-C (S11, S5/S8, N26) | 236 |
70
+ | **4G / EPC** | S1AP, NAS-EPS, GTPv2-C (S11, S5/S8, N26), SGsAP (SGs) | 236 |
71
71
  | **IMS** | SIP (calls, KPIs), Diameter, H.248/MEGACO | 333 |
72
72
 
73
73
  Every cause code is resolved through a hand-verified table to the specification
@@ -88,9 +88,14 @@ rather than shown as an IP, with the evidence for that name on hover.
88
88
  | A bare cause number and a trip to the spec | 775 causes with the specification named, plain language and field root causes; clauses where a person checked them |
89
89
  | RAN and core blaming each other for a dropped context | Every UE context release marked **requested by the RAN** or **ordered by the core** — a wire fact, not an opinion |
90
90
  | A procedure that stalls for no visible reason | The gap named when it matches a NAS timer's default (T3560, T3460 …), and failures counted by TAC, cell, DNN and core element |
91
+ | VoLTE Gm signalling hidden inside IPsec ESP | NULL-encrypted ESP is detected and decoded, so the SIP and SDP inside join the subscriber's ladder. ESP that is really encrypted stays unreadable and is counted, not guessed |
92
+ | A B2BUA (an AS, or an SBC that keeps the charging ID) changes the Call-ID, so one call shows up as unrelated dialogs | Legs that share a charging ID (ICID) and overlap in time are one call, end to end — H.248, HSS, charging and ENUM attached only where evidence ties them to that call |
91
93
  | Customer captures that must never leave the building | A command on your machine: no network listener beyond `127.0.0.1`, no telemetry, no cloud, no model |
92
94
 
93
- ## Thirty seconds, four ways in
95
+ ## Quickstart: five ways in
96
+
97
+ > **Windows without Python?** Skip `pip` and jump to
98
+ > [4. Windows, no install](#windows-no-install) — the only prerequisite is Wireshark.
94
99
 
95
100
  ```bash
96
101
  # 1. CLI — one page of deterministic facts, Markdown or JSON
@@ -104,11 +109,33 @@ telcoladder serve # http://127.0.0.1:3005
104
109
  claude mcp add telcoladder -- telcoladder mcp
105
110
  ```
106
111
 
107
- **4. Windows, no install.** Download `TelcoLadder-Windows-x64.zip` from the
108
- [Releases](https://github.com/gollumw/TelcoLadder/releases) page — a standalone
109
- executable in a portable zip, built by CI from the tagged source. Unzip,
110
- run `check-environment.cmd`, and use `telcoladder.exe` from that folder. It
111
- needs Wireshark 4.0 or newer on the machine, nothing else.
112
+ <a id="windows-no-install"></a>
113
+ **4. Windows, no install.** A standalone executable in a portable zip, built by
114
+ CI from the tagged source. Nothing is installed and no registry key is written;
115
+ it needs Wireshark 4.0 or newer on the machine, nothing else.
116
+
117
+ 1. **Download and unzip.** Get `TelcoLadder-Windows-x64.zip` (about 10 MB) from
118
+ the [Releases](https://github.com/gollumw/TelcoLadder/releases) page.
119
+ 2. **Double-click `check-environment.cmd`.** It finds `tshark.exe` in
120
+ Wireshark's default install location under Program Files — or wherever
121
+ `TELCOLADDER_TSHARK` points — and checks the dissectors.
122
+ 3. **Run it from that folder.**
123
+ ```bat
124
+ telcoladder.exe summarize capture.pcapng
125
+ telcoladder.exe serve
126
+ ```
127
+ `serve` listens on `http://127.0.0.1:3005`: open it in your browser, drop a
128
+ capture (up to 1 GB), or paste a path for anything larger.
129
+
130
+ **5. Hand a capture to someone else.** `telcoladder anonymize in.pcap out.pcap`
131
+ rewrites subscriber identities, addresses, hostnames, PLMN and cell identifiers
132
+ into keyed pseudonyms of the *same length* — TBCD, ASCII, JSON and HPACK-Huffman
133
+ alike — recomputes every checksum, then re-reads its own output and refuses to
134
+ keep it if any original value is still visible. The output walks the same
135
+ pipeline to the same procedures, roles and failures; only the names differ.
136
+ Same key, same pseudonyms across captures; the key is printed once and never
137
+ written down. Compressed HTTP/2 bodies cannot be rewritten in place and are
138
+ refused unless `--blank-opaque-bodies`.
112
139
 
113
140
  Requires Python 3.11+ and `tshark` (Wireshark 4.0 or newer) for the `pip`
114
141
  route. Neither the macOS nor the Windows installer puts `tshark` on your `PATH`;
@@ -179,11 +206,20 @@ Each of these is a fixture in `tests/fixtures/` you can run yourself.
179
206
  the scopes described above. On a production trace with TLS on SBI and
180
207
  ECIES-protected SUCIs the N2 side still forms its own per-UE flow; what
181
208
  could not be read is counted and reported, not silently dropped.
182
- - **Splits a subscriber's traffic into procedures** — registration, attach,
183
- PDU session, service request, deregistration, context release, handover,
184
- IMS registration and call — each with outcome, cause, first failure,
185
- duration, and where applicable the initiator, the matched timer, or the
186
- handover preparation and execution times.
209
+ - **Splits a subscriber's traffic into scenarios** — registration, attach,
210
+ PDU session, service request (UE- or network-triggered), dedicated bearer
211
+ setup, modification and release, deregistration, handover
212
+ (including one that was **cancelled**, which is not a failure), idle
213
+ mobility, IMS registration and call — each with outcome, cause, first
214
+ failure, duration, and where applicable the initiator, the matched timer, or
215
+ the handover preparation and execution times. **The axis is what the
216
+ subscriber was doing, not which protocol carried it**: the S6a exchange
217
+ inside an attach is part of that attach, the context release that ends a
218
+ scenario is part of that scenario (its initiator and cause travel with it,
219
+ and the xDR still lists the release as a row of its own), and an HSS answer of "unknown user"
220
+ is that attach's failure. A Diameter exchange that belongs to no scenario
221
+ stands on its own as an HSS-initiated one — under 4G for S6a/Gx and under IMS
222
+ for Cx/Sh, which the Application-Id decides.
187
223
  - **Reads Diameter through the DRA**: S6a/S6d, Cx/Dx, Sh, Rx, Gx, SWx and S6b,
188
224
  roles from who initiates which command, a request seen on both sides of a
189
225
  relay shown as one transaction with two hops, a relayed failure counted once.
@@ -241,24 +277,56 @@ diagram, Mermaid as the output, and a verified explanation of what went wrong.
241
277
  - **A fully transparent SCP** that sends no `3gpp-Sbi-Target-apiRoot` is
242
278
  indistinguishable from the endpoint and falls back to an unlabelled IP. The
243
279
  correct failure direction, and a real gap.
244
- - **Diameter covers seven interfaces** with roles and curated causes; the rest
245
- decode and show their Application-Id with no role inference. The fixture is
246
- written from RFC 6733, not captured: no SCTP, no reassembly, invented timing.
247
- - **SIP proxies are not yet told apart** (`Via` is recorded, Mw and ISC are
248
- unlabelled); H.248 gets neutral `MGC` / `MGW` roles and no reference point,
280
+ - **Diameter covers seven interfaces** with roles and curated causes (S6a/S6d,
281
+ Cx/Dx, Sh, Rx, Gx, SWx, S6b); the rest — Rf included — decode and show their
282
+ Application-Id with no role inference. Every Diameter fixture is written from
283
+ RFC 6733, not captured: TCP only, no SCTP, invented timing.
284
+ - **Four behavior rules have no capture behind them.** S10 inter-MME handover,
285
+ the Xn/X2 path switch, CS fallback and the Cx authentication delay inside a
286
+ call are written from message names and covered only by synthetic tests; how
287
+ they read a real capture is unmeasured. The chain shown before a failure is the
288
+ order of messages within one segment, not proven causation.
289
+ - **SIP alone does not name the core proxies.** The UE and the P-CSCF come from
290
+ Gm itself — the security-agreement headers, or which address holds IPsec
291
+ associations with several peers, falling back to a `Contact` that carries a
292
+ subscriber identity; an I-CSCF, S-CSCF or AS is named only when its Cx or Sh
293
+ exchange is in the same capture. Gm is the only SIP
294
+ reference point labelled — Mw and ISC are not, because no capture here has
295
+ verified them. H.248 gets neutral `MGC` / `MGW` roles and no reference point,
249
296
  because the protocol alone cannot say whether it is Iq, Mn or Mp.
250
- - **Only 7 of the 21 cause tables cite a clause.** The other 14 name the
297
+ - **Calls and numbers join only on evidence.** B2BUA legs become one call only
298
+ when they share a charging ID (ICID) and overlap in time — a B2BUA or SBC
299
+ that replaces the ICID leaves separate rows. A number joins HSS, charging and
300
+ ENUM records only in international form; a local-form number is never
301
+ completed with a guessed country code. VoLTE, VoNR and VoWiFi are shown only
302
+ where `P-Access-Network-Info` declares them; without that header the access
303
+ is reported as not declared.
304
+ - **Only 9 of the 21 cause tables cite a clause.** The other 12 name the
251
305
  specification and stop. An absent clause is better than a wrong one.
252
306
  - **The 4G, IMS and handover fixtures are written byte by byte** with `tshark`
253
307
  as the oracle: exact about the protocol, silent about any real deployment.
254
- Each `scenario.md` lists what its fixture cannot prove. There is no EPS → 5GS
255
- handover fixture yet, and no UE radio capability parsing.
308
+ Each `scenario.md` lists what its fixture cannot prove. UE radio capability
309
+ is not parsed: the NR and LTE RRC containers are skipped during extraction
310
+ because dissecting them is slow, and stay readable in the per-frame decode
311
+ tree.
256
312
  - **NAS after Security Mode Command is encrypted** and its content is
257
- invisible; the packets still appear as their NGAP carrier. GTP-U joins the
258
- subscriber but carries no throughput or loss KPIs; there is no RTP adapter;
259
- ISUP and CAMEL are recognised but not read.
313
+ invisible; the packets still appear as their NGAP carrier. The same holds for
314
+ IPsec ESP on Gm: only NULL-encrypted ESP is read, and encrypted ESP is counted
315
+ as unreadable. GTP-U joins the subscriber but carries no throughput or loss
316
+ KPIs; there is no RTP adapter; ISUP and CAMEL are recognised but not read.
317
+ - **Joins through a tunnel an SBI message quotes are inferences.** They bind by
318
+ direction, inside a time window, never across a release, and never where they
319
+ would give one flow two SUPIs; the summary counts each one. What remains: a
320
+ stale forwarded quote that arrives after its tunnel was released, where the UPF
321
+ reused that exact TEID within 10 s for a UE whose flow shows no SUPI, could
322
+ still be joined. On a single capture point that order violates the protocol.
260
323
  - **Mermaid gets slow with very large flows.** Use `--max-messages`; truncation
261
324
  is always stated inside the diagram.
325
+ - **`anonymize` proves absence only for what tshark can name.** Identities it
326
+ never decoded stay where they are; TLS payloads are opaque; gzip bodies and
327
+ bodies reassembled across DATA frames are refused rather than guessed at;
328
+ IPv6 text and binary forms, and TAC text and binary forms, are pseudonymised
329
+ independently. The report lists every one of these.
262
330
 
263
331
  ## How it is verified
264
332
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "telcoladder"
3
- version = "0.2.0"
3
+ version = "0.4.0"
4
4
  description = "Turn telecom signalling captures into Mermaid sequence diagrams — 5G core, 4G/EPC and IMS on one timeline."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -5,4 +5,4 @@ Phase 2 主攻 IMS(SIP / Diameter / GTP)—— 協定以 adapter 形式插
5
5
  核心資料模型 (`telcoladder.model`) 已預留跨協定的身分關聯欄位。
6
6
  """
7
7
 
8
- __version__ = "0.2.0"
8
+ __version__ = "0.4.0"
@@ -0,0 +1,88 @@
1
+ """一個訂戶在這份擷取檔裡做了什麼:打電話、只有 IMS 註冊與查詢、或一般 session。
2
+
3
+ 總覽「偵測到的會話」依此分組(使用者裁定 2026-09-14)。原本抽屜只按身分列,15 個訂戶攤成
4
+ 一排,看不出哪些是電話觸發的。
5
+
6
+ **每一類都從引擎已有的事實讀,不從協定名稱猜場景:**
7
+
8
+ * `call` —— 這個訂戶的某條流程是一通電話的一腿(`calls.build`),或它的 MSISDN 就是某通
9
+ 電話主叫/被叫的國際號碼。後者讓被叫那一側(號碼鍵的 HSS/計費流程)也歸進來。
10
+ * `ims` —— 沒有通話,但有 IMS 世代的程序段(SIP 註冊、Cx/Sh)或 SIP 訊息。
11
+ * `session` —— 其餘有訂戶身分的(4G/5G 附著、PDU/承載、行動管理)。
12
+ * `flows` —— 沒有訂戶鍵的那一桶(節點維護等),不是一個人。
13
+
14
+ **接取(VoLTE/VoNR/VoWiFi)只看線路宣告**(`P-Access-Network-Info`)。沒宣告就是空的,
15
+ 不從 GTP 的 RAT、ePDG 位址之類的線索推 —— 使用者裁定 2026-09-14。
16
+ """
17
+
18
+ from __future__ import annotations
19
+
20
+ from dataclasses import dataclass
21
+
22
+ from telcoladder import calls as callsmod
23
+ from telcoladder.flowtable import FlowTable
24
+ from telcoladder.model import IdKind
25
+ from telcoladder.calls import ACCESS_KINDS, access_kind
26
+ from telcoladder.pipeline import Analysis
27
+ from telcoladder.procedures import capture_end, segment_flow
28
+
29
+ #: 分組的固定詞彙與畫面上的順序。電話排最前 —— 那是這個需求的起點。
30
+ ACTIVITIES: tuple[str, ...] = ("call", "ims", "session", "flows")
31
+
32
+
33
+ @dataclass(frozen=True, slots=True)
34
+ class Activity:
35
+ kind: str
36
+ """`ACTIVITIES` 之一。"""
37
+ access: tuple[str, ...]
38
+ """這個訂戶自己送出的 SIP 請求宣告過的接取,依 `ACCESS_KINDS` 排序。沒宣告是空的。"""
39
+ calls: tuple[str, ...] = ()
40
+ """它參與的通話把手(`c:N`,與 `/calls` 同一組)。抽屜把電話掛在訂戶底下靠這個 ——
41
+ 瀏覽器不必從標籤字串猜號碼。"""
42
+
43
+
44
+ def classify(analysis: Analysis, table: FlowTable) -> list[Activity]:
45
+ """與 `table.subscribers` 逐一對齊。"""
46
+ end = capture_end(analysis)
47
+ call_list = callsmod.build(analysis)
48
+ numbers_of = {
49
+ call.handle: {n for n in (callsmod.caller_number(call), callsmod.callee_number(call)) if n}
50
+ for call in call_list
51
+ }
52
+ out: list[Activity] = []
53
+ for sub in table.subscribers:
54
+ flows = [analysis.flows[row.flow_id] for row in sub.sessions]
55
+ # **只看請求。** SIP 流程以 `From` 歸戶,所以主叫那條流程裡也有被叫的回應 —— 回應帶的是
56
+ # 被叫自己的接取。算進來的話,LTE 上的主叫會同時被標成 VoWiFi(實測 volte-e2e-call)。
57
+ declared = {
58
+ kind
59
+ for flow in flows
60
+ for msg in flow.messages
61
+ if msg.protocol == "sip" and not msg.label[:1].isdigit()
62
+ and (kind := access_kind(msg.detail.get("access-type")))
63
+ }
64
+ access = tuple(k for k in ACCESS_KINDS if k in declared)
65
+ if not sub.grouped:
66
+ out.append(Activity("flows", access))
67
+ continue
68
+ flow_ids = {row.flow_id for row in sub.sessions}
69
+ numbers = {
70
+ value.lstrip("+")
71
+ for flow in flows
72
+ for kind, value in flow.identity_keys
73
+ if kind is IdKind.MSISDN
74
+ }
75
+ joined = tuple(
76
+ call.handle for call in call_list
77
+ if flow_ids.intersection(call.flow_ids) or numbers & numbers_of[call.handle]
78
+ )
79
+ if joined:
80
+ out.append(Activity("call", access, joined))
81
+ continue
82
+ ims = any(
83
+ p.family == "ims"
84
+ for flow in flows
85
+ for p in segment_flow(flow, capture_end=end)[0]
86
+ ) or any(msg.protocol == "sip" for flow in flows for msg in flow.messages)
87
+ out.append(Activity("ims" if ims else "session", access))
88
+ return out
@@ -21,6 +21,7 @@
21
21
  | `CARRIER_LAYER` | 它的區塊在 tshark 輸出裡叫什麼層;**預設等於 `NAME`** |
22
22
  | `carrier_keys(block, frame)` | 從**載體區塊**推出的身分鍵,回 `frozenset[IdKey]` |
23
23
  | `blind_spots(frame)` | 這一格裡**我看得到卻讀不出來**的東西,見下 |
24
+ | `continuations(frame)` | 這一格裡**屬於更早某則訊息**的內容(HTTP/2 的 body 比標頭晚一格到),見 `attach_continuations()` |
24
25
 
25
26
  `CARRIER_LAYER` 存在是因為 **adapter 的名字與 tshark 的層名是兩回事**:
26
27
  `sbi.NAME` 是 `"sbi"`(會出現在 `Message.protocol` 上),但它的區塊在 `-T ek`
@@ -80,6 +81,7 @@ filter 是「把這個協定的封包留下來」,前提是 tshark **已經認
80
81
 
81
82
  from __future__ import annotations
82
83
 
84
+ from bisect import bisect_left
83
85
  from collections.abc import Iterable
84
86
  from functools import cache
85
87
  from typing import Protocol
@@ -93,6 +95,7 @@ from telcoladder.model import (
93
95
  BLIND_ECIES_PROTECTED_SUCI,
94
96
  BLIND_UNDECODED_STREAM,
95
97
  BlindSpot,
98
+ Continuation,
96
99
  IdKey,
97
100
  Message,
98
101
  )
@@ -121,18 +124,22 @@ class Adapter(Protocol):
121
124
  #: 選用。這一格裡「看得到協定層、但讀不出內容」的東西。見 `blind_spots()`。
122
125
  def blind_spots(self, frame: Frame) -> Iterable[BlindSpot]: ...
123
126
 
124
- #: 選用。**這段裸位元組是不是你的協定?** 只在擷取檔的 link type 是
125
- #: USER n(tshark 一個 dissector 都不掛)時才會被問到,見 `sniff_payload()`。
127
+ #: 選用。這一格裡屬於更早某則訊息的內容(標頭與 body 分兩格送)。見 `attach_continuations()`。
128
+ def continuations(self, frame: Frame) -> Iterable[Continuation]: ...
129
+
130
+ #: 選用。**這段裸位元組是不是你的協定?** 兩種情況會被問到(見 `sniff_payload()`):
131
+ #: 擷取檔的 link type 是 USER n(tshark 一個 dissector 都不掛);以及 `probe` 在
132
+ #: TCP 埠上看載荷的開頭 —— 那時拿到的可能只是一則訊息的第一個區段。
126
133
  def sniff(self, payload: bytes) -> bool: ...
127
134
 
128
135
 
129
136
  from telcoladder.adapters import ( # noqa: E402
130
- diameter, gtp, gtpv2, megaco, nas5gs, naseps, ngap, pfcp, s1ap, sbi, sip,
137
+ diameter, enum, gtp, gtpv2, megaco, nas5gs, naseps, ngap, pfcp, s1ap, sbi, sgsap, sip,
131
138
  )
132
139
 
133
140
  #: 不經外掛機制、永遠都在的那些。
134
141
  BUILTIN_ADAPTERS: tuple[Adapter, ...] = (
135
- ngap, s1ap, nas5gs, naseps, sip, megaco, sbi, diameter, pfcp, gtpv2, gtp,
142
+ ngap, s1ap, nas5gs, naseps, sip, megaco, sbi, diameter, sgsap, pfcp, gtpv2, gtp, enum,
136
143
  ) # type: ignore[assignment]
137
144
 
138
145
  _REQUIRED_ATTRS = ("NAME", "ORDER", "DISPLAY_FILTER", "DISSECTORS", "parse")
@@ -221,7 +228,7 @@ def protocol_filters(present: "set[str] | frozenset[str]") -> list[dict[str, str
221
228
  外掛加進來的協定不必為了好看而改核心程式碼。
222
229
  """
223
230
  labels = {"ngap": "NGAP / NAS", "nas-5gs": "NGAP / NAS", "sbi": "SBI",
224
- "pfcp": "PFCP", "gtp": "GTP-U", "diameter": "Diameter"}
231
+ "pfcp": "PFCP", "gtp": "GTP-U", "diameter": "Diameter", "sgsap": "SGsAP"}
225
232
  out: list[dict[str, str]] = []
226
233
  seen: set[str] = set()
227
234
  for adapter in adapters():
@@ -307,10 +314,64 @@ def blind_spots(frame: Frame) -> list[BlindSpot]:
307
314
  return out
308
315
 
309
316
 
317
+ def continuations(frame: Frame) -> list[Continuation]:
318
+ """問過每一個 adapter:這一格裡有沒有**屬於更早某則訊息**的內容?
319
+
320
+ 與 `blind_spots()` 同形:`pipeline` 逐格問,不指名任何 adapter。收齊之後由
321
+ `attach_continuations()` 一次接回去 —— 主人一定在前面的格裡,但得等全部訊息
322
+ 都建好了才找得到它。
323
+ """
324
+ out: list[Continuation] = []
325
+ for adapter in adapters():
326
+ hook = getattr(adapter, "continuations", None)
327
+ if hook is None:
328
+ continue
329
+ out.extend(hook(frame))
330
+ return out
331
+
332
+
333
+ def attach_continuations(messages: list[Message], pending: list[Continuation]) -> int:
334
+ """把每一段晚到的內容交給它的主人,回傳接上了幾段。
335
+
336
+ 主人是**時間上最近的前一則**同協定、帶著同一把鍵、來自同一個端點的訊息:
337
+
338
+ * 「同一個端點」就是方向 —— 請求的 body 與請求同方向,回應的 body 與回應同方向,
339
+ 同一條 stream 上的兩則訊息靠它分開。
340
+ * 「最近的前一則」處理先後 —— 鍵本身(SBI 的 stream 鍵)已經帶著連線,而同一條
341
+ 連線內 HTTP/2 從不重用 stream 編號。
342
+
343
+ 找不到主人(標頭在擷取起點之前、或標頭解不開)就略過:那段內容沒有地方掛,
344
+ 而**編一個主人比不接更糟** —— 那會把內容說的事實安到別人頭上。
345
+ """
346
+ if not pending:
347
+ return 0
348
+ wanted = {(c.protocol, c.key, c.src.key, c.src.port) for c in pending}
349
+ owners: dict[tuple, list[Message]] = {}
350
+ for msg in messages:
351
+ for key in msg.identity_keys:
352
+ slot = (msg.protocol, key, msg.src.key, msg.src.port)
353
+ if slot in wanted:
354
+ owners.setdefault(slot, []).append(msg)
355
+ frames: dict[tuple, list[int]] = {}
356
+ for slot, found in owners.items():
357
+ found.sort(key=lambda m: m.frame)
358
+ frames[slot] = [m.frame for m in found]
359
+ attached = 0
360
+ for cont in sorted(pending, key=lambda c: c.frame):
361
+ slot = (cont.protocol, cont.key, cont.src.key, cont.src.port)
362
+ at = bisect_left(frames.get(slot, []), cont.frame) - 1
363
+ if at < 0:
364
+ continue
365
+ cont.apply(owners[slot][at])
366
+ attached += 1
367
+ return attached
368
+
369
+
310
370
  def sniff_payload(payload: bytes) -> "Adapter | None":
311
371
  """問過每一個 adapter:這段裸位元組是不是你的協定?
312
372
 
313
- **只用在 USER DLT 的擷取檔上**(`probe.inspect()`):網元匯出的裸協定
373
+ **兩個呼叫端**(都在 `probe.inspect()`):USER DLT 的擷取檔,以及 TCP 埠上
374
+ 每條連線的前幾格載荷。前者是網元匯出的裸協定
314
375
  沒有任何鏈路/IP/傳輸層,tshark 對它一個 dissector 都不掛,每格都是
315
376
  `user_dlt` 底下一片 `data`。要它解,得先知道載荷是什麼 —— 而知道的
316
377
  是 adapter,不是核心(核心不認得任何一個協定的標頭形狀)。
@@ -68,7 +68,9 @@ from typing import Any
68
68
 
69
69
  from telcoladder.extract import Frame, first
70
70
  from telcoladder.extract import to_int as _to_int
71
- from telcoladder.identity import globally_unique, imsi_from_ims_identity
71
+ from telcoladder.identity import (
72
+ e164_digits, globally_unique, imsi_from_ims_identity, international_msisdn, msisdn_from_tbcd,
73
+ )
72
74
  from telcoladder.model import (
73
75
  ENDPOINT_DST_KEY,
74
76
  ENDPOINT_SRC_KEY,
@@ -323,10 +325,36 @@ def _identity_keys(block: dict[str, Any]) -> set[IdKey]:
323
325
  for impu in _as_list(block.get("diameter_diameter_Public-Identity")):
324
326
  if impu:
325
327
  keys.add(globally_unique(IdKind.IMPU, str(impu).strip()))
328
+ # `sip:+…@` 或 `tel:+…` 形式的公開身分就是號碼。**只收國際形式**(見
329
+ # `identity.international_msisdn`)—— 本地形式要補國碼,這裡不猜。
330
+ number = international_msisdn(str(impu))
331
+ if number:
332
+ keys.add(globally_unique(IdKind.MSISDN, number))
333
+
334
+ # **同一個門號的 Diameter 併成一條**(2026-09-13)。真實樣本上被叫號碼的 Cx 路由查詢
335
+ # 與三段 Sh 查詢各自只有 Session-Id,於是切成四條流程,沒有一條說得出「這是誰」。
336
+ #
337
+ # Sh 的 `User-Identity` 裡是 TBCD 的 `MSISDN`(國際形式)。
338
+ for raw in _as_list(block.get("diameter_diameter_MSISDN")):
339
+ number = msisdn_from_tbcd(raw)
340
+ if number:
341
+ keys.add(globally_unique(IdKind.MSISDN, number))
342
+ # Rf/Gy 的 `Subscription-Id`:型別與資料是位置對位置的陣列,**只收型別 0(END_USER_E164)**。
343
+ # 型別 1 是 IMSI、2 是 SIP URI —— 同一個欄位裝著不同的號碼空間,不看型別就會把 IMSI 當門號。
344
+ kinds = _as_list(block.get("diameter_diameter_Subscription-Id-Type"))
345
+ for kind, data in zip(kinds, _as_list(block.get("diameter_diameter_Subscription-Id-Data"))):
346
+ if _to_int(kind) == _SUBSCRIPTION_ID_E164:
347
+ number = e164_digits(data)
348
+ if number:
349
+ keys.add(globally_unique(IdKind.MSISDN, number))
326
350
 
327
351
  return keys
328
352
 
329
353
 
354
+ #: `Subscription-Id-Type` 的 END_USER_E164(RFC 4006 §8.47)。
355
+ _SUBSCRIPTION_ID_E164 = 0
356
+
357
+
330
358
  def _as_list(value: Any) -> list[Any]:
331
359
  if value is None:
332
360
  return []
@@ -386,6 +414,11 @@ def parse(frame: Frame) -> list[Message]:
386
414
  session = first(block.get("diameter_diameter_Session-Id"))
387
415
  if session:
388
416
  detail["session-id"] = str(session)
417
+ icid = first(block.get("diameter_diameter_IMS-Charging-Identifier"))
418
+ if icid:
419
+ # Rf 的 ICID —— 與 SIP `P-Charging-Vector` 的 `icid-value` 是同一個值。
420
+ # **只當屬性**,理由見 `adapters/sip.py` 同名那段。
421
+ detail["icid"] = str(icid).strip()
389
422
 
390
423
  origin_host = str(first(block.get("diameter_diameter_Origin-Host")) or "").strip()
391
424
  destination_host = str(first(block.get("diameter_diameter_Destination-Host")) or "").strip()