tdl-xoa-driver 1.0.0b1__py3-none-any.whl

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 (325) hide show
  1. tdl_xoa_driver-1.0.0b1.dist-info/LICENSE +202 -0
  2. tdl_xoa_driver-1.0.0b1.dist-info/METADATA +177 -0
  3. tdl_xoa_driver-1.0.0b1.dist-info/RECORD +325 -0
  4. tdl_xoa_driver-1.0.0b1.dist-info/WHEEL +5 -0
  5. tdl_xoa_driver-1.0.0b1.dist-info/top_level.txt +1 -0
  6. xoa_driver/__init__.py +2 -0
  7. xoa_driver/enums.py +399 -0
  8. xoa_driver/exceptions.py +77 -0
  9. xoa_driver/functions/__init__.py +0 -0
  10. xoa_driver/functions/anlt.py +744 -0
  11. xoa_driver/functions/anlt_ll_debug.py +429 -0
  12. xoa_driver/functions/cli.py +581 -0
  13. xoa_driver/functions/exceptions.py +72 -0
  14. xoa_driver/functions/headers.py +608 -0
  15. xoa_driver/functions/mgmt.py +515 -0
  16. xoa_driver/functions/tools.py +256 -0
  17. xoa_driver/hlfuncs.py +18 -0
  18. xoa_driver/internals/__init__.py +0 -0
  19. xoa_driver/internals/commands/__init__.py +31 -0
  20. xoa_driver/internals/commands/c_commands.py +2041 -0
  21. xoa_driver/internals/commands/enums.py +3289 -0
  22. xoa_driver/internals/commands/m4_commands.py +700 -0
  23. xoa_driver/internals/commands/m4e_commands.py +107 -0
  24. xoa_driver/internals/commands/m_commands.py +1875 -0
  25. xoa_driver/internals/commands/p4_commands.py +2221 -0
  26. xoa_driver/internals/commands/p4e_commands.py +160 -0
  27. xoa_driver/internals/commands/p4g_commands.py +7253 -0
  28. xoa_driver/internals/commands/p_commands.py +6000 -0
  29. xoa_driver/internals/commands/pc_commands.py +335 -0
  30. xoa_driver/internals/commands/pd_commands.py +355 -0
  31. xoa_driver/internals/commands/pe_commands.py +1018 -0
  32. xoa_driver/internals/commands/pec_commands.py +265 -0
  33. xoa_driver/internals/commands/ped_commands.py +1034 -0
  34. xoa_driver/internals/commands/pef_commands.py +2216 -0
  35. xoa_driver/internals/commands/pf_commands.py +379 -0
  36. xoa_driver/internals/commands/pl1_commands.py +1588 -0
  37. xoa_driver/internals/commands/pl_commands.py +178 -0
  38. xoa_driver/internals/commands/pm_commands.py +256 -0
  39. xoa_driver/internals/commands/pp_commands.py +2341 -0
  40. xoa_driver/internals/commands/pr_commands.py +812 -0
  41. xoa_driver/internals/commands/ps_commands.py +2311 -0
  42. xoa_driver/internals/commands/pt_commands.py +370 -0
  43. xoa_driver/internals/commands/px_commands.py +303 -0
  44. xoa_driver/internals/commands/subtypes.py +86 -0
  45. xoa_driver/internals/core/__init__.py +0 -0
  46. xoa_driver/internals/core/builders.py +39 -0
  47. xoa_driver/internals/core/exceptions.py +69 -0
  48. xoa_driver/internals/core/funcs.py +81 -0
  49. xoa_driver/internals/core/funcs.pyi +1072 -0
  50. xoa_driver/internals/core/interfaces.py +47 -0
  51. xoa_driver/internals/core/token.py +44 -0
  52. xoa_driver/internals/core/transporter/__init__.py +0 -0
  53. xoa_driver/internals/core/transporter/_processor.py +83 -0
  54. xoa_driver/internals/core/transporter/_publisher.py +101 -0
  55. xoa_driver/internals/core/transporter/_request_id_counter.py +28 -0
  56. xoa_driver/internals/core/transporter/_stream.py +99 -0
  57. xoa_driver/internals/core/transporter/_typings.py +43 -0
  58. xoa_driver/internals/core/transporter/exceptions.py +44 -0
  59. xoa_driver/internals/core/transporter/handler.py +127 -0
  60. xoa_driver/internals/core/transporter/logger/__init__.py +10 -0
  61. xoa_driver/internals/core/transporter/logger/__logger.py +94 -0
  62. xoa_driver/internals/core/transporter/logger/__state_off.py +32 -0
  63. xoa_driver/internals/core/transporter/logger/__state_on_default.py +70 -0
  64. xoa_driver/internals/core/transporter/logger/__state_on_loguru.py +51 -0
  65. xoa_driver/internals/core/transporter/logger/__state_on_user.py +48 -0
  66. xoa_driver/internals/core/transporter/protocol/__init__.py +0 -0
  67. xoa_driver/internals/core/transporter/protocol/_constants.py +77 -0
  68. xoa_driver/internals/core/transporter/protocol/_utils.py +59 -0
  69. xoa_driver/internals/core/transporter/protocol/exceptions.py +271 -0
  70. xoa_driver/internals/core/transporter/protocol/payload/__init__.py +70 -0
  71. xoa_driver/internals/core/transporter/protocol/payload/base_struct.py +283 -0
  72. xoa_driver/internals/core/transporter/protocol/payload/descriptor.py +119 -0
  73. xoa_driver/internals/core/transporter/protocol/payload/exceptions.py +20 -0
  74. xoa_driver/internals/core/transporter/protocol/payload/field.py +296 -0
  75. xoa_driver/internals/core/transporter/protocol/payload/types.py +173 -0
  76. xoa_driver/internals/core/transporter/protocol/payload/utils.py +53 -0
  77. xoa_driver/internals/core/transporter/protocol/struct_header.py +123 -0
  78. xoa_driver/internals/core/transporter/protocol/struct_request.py +65 -0
  79. xoa_driver/internals/core/transporter/protocol/struct_response.py +89 -0
  80. xoa_driver/internals/core/transporter/registry.py +43 -0
  81. xoa_driver/internals/exceptions/__init__.py +9 -0
  82. xoa_driver/internals/exceptions/modules.py +13 -0
  83. xoa_driver/internals/exceptions/testers.py +21 -0
  84. xoa_driver/internals/hli_v1/__init__.py +0 -0
  85. xoa_driver/internals/hli_v1/indices/__init__.py +0 -0
  86. xoa_driver/internals/hli_v1/indices/base_index.py +39 -0
  87. xoa_driver/internals/hli_v1/indices/connection_group/__init__.py +0 -0
  88. xoa_driver/internals/hli_v1/indices/connection_group/cg.py +186 -0
  89. xoa_driver/internals/hli_v1/indices/connection_group/histogram.py +78 -0
  90. xoa_driver/internals/hli_v1/indices/connection_group/l2.py +94 -0
  91. xoa_driver/internals/hli_v1/indices/connection_group/l3.py +130 -0
  92. xoa_driver/internals/hli_v1/indices/connection_group/raw.py +200 -0
  93. xoa_driver/internals/hli_v1/indices/connection_group/replay.py +109 -0
  94. xoa_driver/internals/hli_v1/indices/connection_group/tcp.py +314 -0
  95. xoa_driver/internals/hli_v1/indices/connection_group/tls.py +198 -0
  96. xoa_driver/internals/hli_v1/indices/connection_group/udp.py +133 -0
  97. xoa_driver/internals/hli_v1/indices/connection_group/user_state.py +28 -0
  98. xoa_driver/internals/hli_v1/indices/filter/__init__.py +0 -0
  99. xoa_driver/internals/hli_v1/indices/filter/base_filter.py +65 -0
  100. xoa_driver/internals/hli_v1/indices/filter/genuine_filter.py +20 -0
  101. xoa_driver/internals/hli_v1/indices/length_term.py +49 -0
  102. xoa_driver/internals/hli_v1/indices/macsecscs/__init__.py +0 -0
  103. xoa_driver/internals/hli_v1/indices/macsecscs/base_macsecsc.py +224 -0
  104. xoa_driver/internals/hli_v1/indices/macsecscs/genuine_macsecsc.py +72 -0
  105. xoa_driver/internals/hli_v1/indices/match_term.py +64 -0
  106. xoa_driver/internals/hli_v1/indices/port_dataset.py +72 -0
  107. xoa_driver/internals/hli_v1/indices/streams/__init__.py +0 -0
  108. xoa_driver/internals/hli_v1/indices/streams/base_stream.py +405 -0
  109. xoa_driver/internals/hli_v1/indices/streams/genuine_stream.py +64 -0
  110. xoa_driver/internals/hli_v1/modules/__init__.py +0 -0
  111. xoa_driver/internals/hli_v1/modules/__interfaces.py +21 -0
  112. xoa_driver/internals/hli_v1/modules/base_module.py +138 -0
  113. xoa_driver/internals/hli_v1/modules/module_chimera.py +366 -0
  114. xoa_driver/internals/hli_v1/modules/module_l23ve.py +73 -0
  115. xoa_driver/internals/hli_v1/modules/module_l47.py +397 -0
  116. xoa_driver/internals/hli_v1/modules/module_l47ve.py +9 -0
  117. xoa_driver/internals/hli_v1/modules/modules_l23/__init__.py +0 -0
  118. xoa_driver/internals/hli_v1/modules/modules_l23/family_combi.py +83 -0
  119. xoa_driver/internals/hli_v1/modules/modules_l23/family_d.py +75 -0
  120. xoa_driver/internals/hli_v1/modules/modules_l23/family_e.py +85 -0
  121. xoa_driver/internals/hli_v1/modules/modules_l23/family_f.py +145 -0
  122. xoa_driver/internals/hli_v1/modules/modules_l23/family_g.py +84 -0
  123. xoa_driver/internals/hli_v1/modules/modules_l23/family_h.py +40 -0
  124. xoa_driver/internals/hli_v1/modules/modules_l23/family_i.py +25 -0
  125. xoa_driver/internals/hli_v1/modules/modules_l23/family_j.py +25 -0
  126. xoa_driver/internals/hli_v1/modules/modules_l23/family_k.py +39 -0
  127. xoa_driver/internals/hli_v1/modules/modules_l23/family_l.py +55 -0
  128. xoa_driver/internals/hli_v1/modules/modules_l23/family_l1.py +800 -0
  129. xoa_driver/internals/hli_v1/modules/modules_l23/family_m.py +25 -0
  130. xoa_driver/internals/hli_v1/modules/modules_l23/family_n.py +40 -0
  131. xoa_driver/internals/hli_v1/modules/modules_l23/module_l23_base.py +383 -0
  132. xoa_driver/internals/hli_v1/ports/__init__.py +0 -0
  133. xoa_driver/internals/hli_v1/ports/base_port.py +125 -0
  134. xoa_driver/internals/hli_v1/ports/port_l23/__init__.py +0 -0
  135. xoa_driver/internals/hli_v1/ports/port_l23/bases/__init__.py +0 -0
  136. xoa_driver/internals/hli_v1/ports/port_l23/bases/port_capture.py +70 -0
  137. xoa_driver/internals/hli_v1/ports/port_l23/bases/port_l23.py +527 -0
  138. xoa_driver/internals/hli_v1/ports/port_l23/bases/port_l23_genuine.py +229 -0
  139. xoa_driver/internals/hli_v1/ports/port_l23/bases/port_reception_statistics.py +231 -0
  140. xoa_driver/internals/hli_v1/ports/port_l23/bases/port_transceiver.py +117 -0
  141. xoa_driver/internals/hli_v1/ports/port_l23/bases/port_transmission_statistics.py +131 -0
  142. xoa_driver/internals/hli_v1/ports/port_l23/chimera/__init__.py +0 -0
  143. xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/__init__.py +0 -0
  144. xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/_utils.py +15 -0
  145. xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/general.py +396 -0
  146. xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/shadow.py +104 -0
  147. xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/working.py +36 -0
  148. xoa_driver/internals/hli_v1/ports/port_l23/chimera/pe_custom_distribution.py +125 -0
  149. xoa_driver/internals/hli_v1/ports/port_l23/chimera/pe_distribution.py +174 -0
  150. xoa_driver/internals/hli_v1/ports/port_l23/chimera/port_chimera.py +119 -0
  151. xoa_driver/internals/hli_v1/ports/port_l23/chimera/port_emulation.py +244 -0
  152. xoa_driver/internals/hli_v1/ports/port_l23/chimera/reception_statistics.py +24 -0
  153. xoa_driver/internals/hli_v1/ports/port_l23/chimera/transmission_statistics.py +24 -0
  154. xoa_driver/internals/hli_v1/ports/port_l23/family_combi.py +37 -0
  155. xoa_driver/internals/hli_v1/ports/port_l23/family_d.py +51 -0
  156. xoa_driver/internals/hli_v1/ports/port_l23/family_e.py +107 -0
  157. xoa_driver/internals/hli_v1/ports/port_l23/family_f.py +151 -0
  158. xoa_driver/internals/hli_v1/ports/port_l23/family_g.py +77 -0
  159. xoa_driver/internals/hli_v1/ports/port_l23/family_h.py +67 -0
  160. xoa_driver/internals/hli_v1/ports/port_l23/family_i.py +84 -0
  161. xoa_driver/internals/hli_v1/ports/port_l23/family_j.py +68 -0
  162. xoa_driver/internals/hli_v1/ports/port_l23/family_k.py +73 -0
  163. xoa_driver/internals/hli_v1/ports/port_l23/family_l.py +82 -0
  164. xoa_driver/internals/hli_v1/ports/port_l23/family_l1.py +166 -0
  165. xoa_driver/internals/hli_v1/ports/port_l23/family_m.py +29 -0
  166. xoa_driver/internals/hli_v1/ports/port_l23/fault_jkl.py +24 -0
  167. xoa_driver/internals/hli_v1/ports/port_l23/freya_l1.py +722 -0
  168. xoa_driver/internals/hli_v1/ports/port_l23/pcs_pma_ghijkl.py +369 -0
  169. xoa_driver/internals/hli_v1/ports/port_l23/pcs_pma_ijkl_chimera.py +60 -0
  170. xoa_driver/internals/hli_v1/ports/port_l23/pcs_pma_l.py +78 -0
  171. xoa_driver/internals/hli_v1/ports/port_l23/port_l23ve.py +101 -0
  172. xoa_driver/internals/hli_v1/ports/port_l47/__init__.py +0 -0
  173. xoa_driver/internals/hli_v1/ports/port_l47/counters.py +174 -0
  174. xoa_driver/internals/hli_v1/ports/port_l47/main.py +228 -0
  175. xoa_driver/internals/hli_v1/ports/port_l47/packet_engine.py +31 -0
  176. xoa_driver/internals/hli_v1/revisions.py +11 -0
  177. xoa_driver/internals/hli_v1/testers/__init__.py +0 -0
  178. xoa_driver/internals/hli_v1/testers/_base_tester.py +259 -0
  179. xoa_driver/internals/hli_v1/testers/genuine/__init__.py +0 -0
  180. xoa_driver/internals/hli_v1/testers/genuine/l_23/__init__.py +0 -0
  181. xoa_driver/internals/hli_v1/testers/genuine/l_23/health.py +16 -0
  182. xoa_driver/internals/hli_v1/testers/genuine/l_23/rest_api.py +38 -0
  183. xoa_driver/internals/hli_v1/testers/genuine/l_23/time_keeper.py +57 -0
  184. xoa_driver/internals/hli_v1/testers/genuine/l_23/upload_file.py +29 -0
  185. xoa_driver/internals/hli_v1/testers/genuine/management_interface.py +42 -0
  186. xoa_driver/internals/hli_v1/testers/l23_tester.py +196 -0
  187. xoa_driver/internals/hli_v1/testers/l23ve_tester.py +114 -0
  188. xoa_driver/internals/hli_v1/testers/l47_tester.py +106 -0
  189. xoa_driver/internals/hli_v1/testers/l47ve_tester.py +54 -0
  190. xoa_driver/internals/hli_v2/__init__.py +0 -0
  191. xoa_driver/internals/hli_v2/indices/__init__.py +0 -0
  192. xoa_driver/internals/hli_v2/indices/base_index.py +39 -0
  193. xoa_driver/internals/hli_v2/indices/connection_group/__init__.py +0 -0
  194. xoa_driver/internals/hli_v2/indices/connection_group/cg.py +115 -0
  195. xoa_driver/internals/hli_v2/indices/connection_group/histogram.py +59 -0
  196. xoa_driver/internals/hli_v2/indices/connection_group/l2.py +71 -0
  197. xoa_driver/internals/hli_v2/indices/connection_group/l3.py +96 -0
  198. xoa_driver/internals/hli_v2/indices/connection_group/raw.py +148 -0
  199. xoa_driver/internals/hli_v2/indices/connection_group/replay.py +89 -0
  200. xoa_driver/internals/hli_v2/indices/connection_group/tcp.py +261 -0
  201. xoa_driver/internals/hli_v2/indices/connection_group/tls.py +166 -0
  202. xoa_driver/internals/hli_v2/indices/connection_group/udp.py +112 -0
  203. xoa_driver/internals/hli_v2/indices/connection_group/user_state.py +25 -0
  204. xoa_driver/internals/hli_v2/indices/filter/__init__.py +0 -0
  205. xoa_driver/internals/hli_v2/indices/filter/base_filter.py +50 -0
  206. xoa_driver/internals/hli_v2/indices/filter/genuine_filter.py +17 -0
  207. xoa_driver/internals/hli_v2/indices/length_term.py +44 -0
  208. xoa_driver/internals/hli_v2/indices/match_term.py +49 -0
  209. xoa_driver/internals/hli_v2/indices/port_dataset.py +53 -0
  210. xoa_driver/internals/hli_v2/indices/streams/__init__.py +0 -0
  211. xoa_driver/internals/hli_v2/indices/streams/base_stream.py +234 -0
  212. xoa_driver/internals/hli_v2/indices/streams/genuine_stream.py +32 -0
  213. xoa_driver/internals/hli_v2/modules/__init__.py +0 -0
  214. xoa_driver/internals/hli_v2/modules/__interfaces.py +21 -0
  215. xoa_driver/internals/hli_v2/modules/base_module.py +125 -0
  216. xoa_driver/internals/hli_v2/modules/module_chimera.py +358 -0
  217. xoa_driver/internals/hli_v2/modules/module_l23ve.py +58 -0
  218. xoa_driver/internals/hli_v2/modules/module_l47.py +230 -0
  219. xoa_driver/internals/hli_v2/modules/module_l47ve.py +8 -0
  220. xoa_driver/internals/hli_v2/modules/modules_l23/__init__.py +0 -0
  221. xoa_driver/internals/hli_v2/modules/modules_l23/family_combi.py +73 -0
  222. xoa_driver/internals/hli_v2/modules/modules_l23/family_d.py +75 -0
  223. xoa_driver/internals/hli_v2/modules/modules_l23/family_e.py +85 -0
  224. xoa_driver/internals/hli_v2/modules/modules_l23/family_f.py +144 -0
  225. xoa_driver/internals/hli_v2/modules/modules_l23/family_g.py +84 -0
  226. xoa_driver/internals/hli_v2/modules/modules_l23/family_h.py +40 -0
  227. xoa_driver/internals/hli_v2/modules/modules_l23/family_i.py +25 -0
  228. xoa_driver/internals/hli_v2/modules/modules_l23/family_j.py +25 -0
  229. xoa_driver/internals/hli_v2/modules/modules_l23/family_k.py +39 -0
  230. xoa_driver/internals/hli_v2/modules/modules_l23/family_l.py +55 -0
  231. xoa_driver/internals/hli_v2/modules/modules_l23/family_l1.py +797 -0
  232. xoa_driver/internals/hli_v2/modules/modules_l23/family_m.py +25 -0
  233. xoa_driver/internals/hli_v2/modules/modules_l23/family_n.py +40 -0
  234. xoa_driver/internals/hli_v2/modules/modules_l23/module_l23_base.py +339 -0
  235. xoa_driver/internals/hli_v2/ports/__init__.py +0 -0
  236. xoa_driver/internals/hli_v2/ports/base_port.py +105 -0
  237. xoa_driver/internals/hli_v2/ports/port_l23/__init__.py +0 -0
  238. xoa_driver/internals/hli_v2/ports/port_l23/bases/__init__.py +0 -0
  239. xoa_driver/internals/hli_v2/ports/port_l23/bases/port_capture.py +64 -0
  240. xoa_driver/internals/hli_v2/ports/port_l23/bases/port_l23.py +441 -0
  241. xoa_driver/internals/hli_v2/ports/port_l23/bases/port_l23_genuine.py +172 -0
  242. xoa_driver/internals/hli_v2/ports/port_l23/bases/port_reception_statistics.py +156 -0
  243. xoa_driver/internals/hli_v2/ports/port_l23/bases/port_transceiver.py +117 -0
  244. xoa_driver/internals/hli_v2/ports/port_l23/bases/port_transmission_statistics.py +59 -0
  245. xoa_driver/internals/hli_v2/ports/port_l23/chimera/__init__.py +0 -0
  246. xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/__init__.py +0 -0
  247. xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/_utils.py +15 -0
  248. xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/general.py +340 -0
  249. xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/shadow.py +99 -0
  250. xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/working.py +36 -0
  251. xoa_driver/internals/hli_v2/ports/port_l23/chimera/pe_custom_distribution.py +116 -0
  252. xoa_driver/internals/hli_v2/ports/port_l23/chimera/pe_distribution.py +102 -0
  253. xoa_driver/internals/hli_v2/ports/port_l23/chimera/port_chimera.py +113 -0
  254. xoa_driver/internals/hli_v2/ports/port_l23/chimera/port_emulation.py +420 -0
  255. xoa_driver/internals/hli_v2/ports/port_l23/chimera/reception_statistics.py +22 -0
  256. xoa_driver/internals/hli_v2/ports/port_l23/chimera/transmission_statistics.py +22 -0
  257. xoa_driver/internals/hli_v2/ports/port_l23/family_combi.py +36 -0
  258. xoa_driver/internals/hli_v2/ports/port_l23/family_d.py +49 -0
  259. xoa_driver/internals/hli_v2/ports/port_l23/family_e.py +96 -0
  260. xoa_driver/internals/hli_v2/ports/port_l23/family_f.py +144 -0
  261. xoa_driver/internals/hli_v2/ports/port_l23/family_g.py +77 -0
  262. xoa_driver/internals/hli_v2/ports/port_l23/family_h.py +60 -0
  263. xoa_driver/internals/hli_v2/ports/port_l23/family_i.py +66 -0
  264. xoa_driver/internals/hli_v2/ports/port_l23/family_j.py +53 -0
  265. xoa_driver/internals/hli_v2/ports/port_l23/family_k.py +58 -0
  266. xoa_driver/internals/hli_v2/ports/port_l23/family_l.py +67 -0
  267. xoa_driver/internals/hli_v2/ports/port_l23/family_l1.py +149 -0
  268. xoa_driver/internals/hli_v2/ports/port_l23/family_m.py +28 -0
  269. xoa_driver/internals/hli_v2/ports/port_l23/fault_jkl.py +22 -0
  270. xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_ghijkl.py +342 -0
  271. xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_ijkl_chimera.py +50 -0
  272. xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_l.py +65 -0
  273. xoa_driver/internals/hli_v2/ports/port_l23/port_l23ve.py +81 -0
  274. xoa_driver/internals/hli_v2/ports/port_l47/__init__.py +0 -0
  275. xoa_driver/internals/hli_v2/ports/port_l47/counters.py +146 -0
  276. xoa_driver/internals/hli_v2/ports/port_l47/main.py +137 -0
  277. xoa_driver/internals/hli_v2/ports/port_l47/packet_engine.py +20 -0
  278. xoa_driver/internals/hli_v2/revisions.py +11 -0
  279. xoa_driver/internals/hli_v2/testers/__init__.py +0 -0
  280. xoa_driver/internals/hli_v2/testers/_base_tester.py +207 -0
  281. xoa_driver/internals/hli_v2/testers/genuine/__init__.py +0 -0
  282. xoa_driver/internals/hli_v2/testers/genuine/l_23/__init__.py +0 -0
  283. xoa_driver/internals/hli_v2/testers/genuine/l_23/health.py +16 -0
  284. xoa_driver/internals/hli_v2/testers/genuine/l_23/rest_api.py +34 -0
  285. xoa_driver/internals/hli_v2/testers/genuine/l_23/time_keeper.py +50 -0
  286. xoa_driver/internals/hli_v2/testers/genuine/l_23/upload_file.py +26 -0
  287. xoa_driver/internals/hli_v2/testers/genuine/management_interface.py +38 -0
  288. xoa_driver/internals/hli_v2/testers/l23_tester.py +159 -0
  289. xoa_driver/internals/hli_v2/testers/l23ve_tester.py +98 -0
  290. xoa_driver/internals/hli_v2/testers/l47_tester.py +95 -0
  291. xoa_driver/internals/hli_v2/testers/l47ve_tester.py +50 -0
  292. xoa_driver/internals/state_storage/__init__.py +0 -0
  293. xoa_driver/internals/state_storage/_speed_detector.py +121 -0
  294. xoa_driver/internals/state_storage/modules_state.py +128 -0
  295. xoa_driver/internals/state_storage/ports_state.py +154 -0
  296. xoa_driver/internals/state_storage/testers_state.py +104 -0
  297. xoa_driver/internals/utils/__init__.py +0 -0
  298. xoa_driver/internals/utils/attributes.py +33 -0
  299. xoa_driver/internals/utils/cap_id.py +63 -0
  300. xoa_driver/internals/utils/con_traffic_light.py +88 -0
  301. xoa_driver/internals/utils/indices/__init__.py +0 -0
  302. xoa_driver/internals/utils/indices/_interfaces.py +26 -0
  303. xoa_driver/internals/utils/indices/header_modifier_manager.py +56 -0
  304. xoa_driver/internals/utils/indices/index_manager.py +95 -0
  305. xoa_driver/internals/utils/indices/observer.py +17 -0
  306. xoa_driver/internals/utils/kind.py +19 -0
  307. xoa_driver/internals/utils/managers/__init__.py +0 -0
  308. xoa_driver/internals/utils/managers/abc.py +44 -0
  309. xoa_driver/internals/utils/managers/exceptions.py +22 -0
  310. xoa_driver/internals/utils/managers/modules_manager.py +118 -0
  311. xoa_driver/internals/utils/managers/ports_manager.py +116 -0
  312. xoa_driver/internals/utils/rev_tool.py +21 -0
  313. xoa_driver/internals/utils/session.py +117 -0
  314. xoa_driver/internals/warn.py +32 -0
  315. xoa_driver/lli.py +15 -0
  316. xoa_driver/misc.py +57 -0
  317. xoa_driver/modules.py +448 -0
  318. xoa_driver/ports.py +332 -0
  319. xoa_driver/testers.py +37 -0
  320. xoa_driver/utils.py +12 -0
  321. xoa_driver/v2/__init__.py +11 -0
  322. xoa_driver/v2/misc.py +77 -0
  323. xoa_driver/v2/modules.py +308 -0
  324. xoa_driver/v2/ports.py +232 -0
  325. xoa_driver/v2/testers.py +24 -0
@@ -0,0 +1,229 @@
1
+ import functools
2
+ from typing import TYPE_CHECKING
3
+ if TYPE_CHECKING:
4
+ from xoa_driver.internals.core import interfaces as itf
5
+ from xoa_driver.internals.commands import (
6
+ P_FLASH,
7
+ P_SPEEDSELECTION,
8
+ P_SPEEDS_SUPPORTED,
9
+ P_UAT_MODE,
10
+ P_UAT_FLR,
11
+ P_STATUS,
12
+ P_TCVRSTATUS,
13
+ P_LOADMODE,
14
+ PP_FECMODE,
15
+ P_MACSEC_RX_ENABLE
16
+ )
17
+ from xoa_driver.internals.utils import attributes as utils
18
+ from xoa_driver.internals.utils.indices import index_manager as idx_mgr
19
+ from xoa_driver.internals.hli_v1.indices.streams.genuine_stream import GenuineStreamIdx
20
+ from xoa_driver.internals.hli_v1.indices.filter.genuine_filter import GenuineFilterIdx
21
+ from xoa_driver.internals.hli_v1.indices.port_dataset import PortDatasetIdx
22
+ from xoa_driver.internals.state_storage import ports_state
23
+ from xoa_driver.internals.hli_v1.indices.macsecscs.genuine_macsecsc import GenuineMacSecTxScIdx, GenuineMacSecRxScIdx
24
+
25
+ from .port_l23 import (
26
+ BasePortL23,
27
+ Speed,
28
+ # TxConfiguration,
29
+ )
30
+
31
+ from .port_transceiver import PortTransceiver
32
+ from .port_reception_statistics import GenuinePortReceptionStatistics
33
+ from .port_transmission_statistics import GenuinePortTransmissionStatistics
34
+
35
+ StreamIndices = idx_mgr.IndexManager[GenuineStreamIdx]
36
+ FilterIndices = idx_mgr.IndexManager[GenuineFilterIdx]
37
+ PortDatasetIndices = idx_mgr.IndexManager[PortDatasetIdx]
38
+ MacSecTxScIndices = idx_mgr.IndexManager[GenuineMacSecTxScIdx]
39
+ MacSecRxScIndices = idx_mgr.IndexManager[GenuineMacSecRxScIdx]
40
+
41
+ class SpeedMode:
42
+ """L23 port's speed mode"""
43
+
44
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
45
+ self.selection = P_SPEEDSELECTION(conn, module_id, port_id)
46
+ """L23 port speed mode selection.
47
+
48
+ :type: P_SPEEDSELECTION
49
+ """
50
+
51
+ self.supported = P_SPEEDS_SUPPORTED(conn, module_id, port_id)
52
+ """L23 port's supported speed modes.
53
+
54
+ :type: P_SPEEDS_SUPPORTED
55
+ """
56
+
57
+
58
+ class GenuineSpeed(Speed):
59
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
60
+ super().__init__(conn, module_id, port_id)
61
+ self.mode = SpeedMode(conn, module_id, port_id)
62
+ """L23 port's speed mode."""
63
+
64
+
65
+ class UnAvailableTime:
66
+ """UnAvailable Time"""
67
+
68
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
69
+ self.mode = P_UAT_MODE(conn, module_id, port_id)
70
+ """L23 port's Unavailable Time mode.
71
+
72
+ :type: P_UAT_MODE
73
+ """
74
+
75
+ self.frame_loss_ratio = P_UAT_FLR(conn, module_id, port_id)
76
+ """L23 port's Frame Loss Ratio for UAT.
77
+
78
+ :type: P_UAT_FLR
79
+ """
80
+
81
+
82
+ class PortStatistics:
83
+ """L23 port statistics"""
84
+
85
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
86
+ self.rx = GenuinePortReceptionStatistics(conn, module_id, port_id)
87
+ """L23 port's RX statistics."""
88
+
89
+ self.tx = GenuinePortTransmissionStatistics(conn, module_id, port_id)
90
+ """L23 port's TX statistics."""
91
+
92
+
93
+ class BasePortL23Genuine(BasePortL23):
94
+ """L23 port basic configuration."""
95
+
96
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
97
+ super().__init__(conn, module_id, port_id)
98
+
99
+ self._local_states = ports_state.PortL23GenuineLocalState()
100
+
101
+ self.flash = P_FLASH(conn, module_id, port_id)
102
+ """L23 port flashes.
103
+
104
+ :type: P_FLASH
105
+ """
106
+
107
+ self.status = P_STATUS(conn, module_id, port_id)
108
+ """L23 port's received optical signal level'.
109
+
110
+ :type: P_STATUS
111
+ """
112
+
113
+ self.config_load_mode = P_LOADMODE(conn, module_id, port_id)
114
+ """Chimera Port loading mode.
115
+
116
+ :type: P_LOADMODE
117
+ """
118
+
119
+ self.tcvr_status = P_TCVRSTATUS(conn, module_id, port_id)
120
+ """L23 port transceiver status information.
121
+
122
+ :type: P_TCVRSTATUS
123
+ """
124
+
125
+ self.fec_mode = PP_FECMODE(conn, module_id, port_id)
126
+ """L23 port FEC mode.
127
+
128
+ :type: PP_FECMODE
129
+ """
130
+
131
+ self.speed = GenuineSpeed(conn, module_id, port_id)
132
+ """L23 port speed configuration.
133
+
134
+ :type: GenuineSpeed
135
+ """
136
+
137
+ self.uat = UnAvailableTime(conn, module_id, port_id)
138
+ """L23 port UnAvailable Time configuration.
139
+
140
+ :type: UnAvailableTime
141
+ """
142
+
143
+ self.transceiver = PortTransceiver(conn, module_id, port_id)
144
+ """L23 port transceiver configuration.
145
+
146
+ :type: PortTransceiver
147
+ """
148
+
149
+ self.statistics = PortStatistics(conn, module_id, port_id)
150
+ """L23 port statistics.
151
+
152
+ :type: PortStatistics
153
+ """
154
+
155
+ self.macsec_rx = P_MACSEC_RX_ENABLE(conn, module_id, port_id)
156
+ """L23 port MACSec RX enable.
157
+
158
+ :type: P_MACSEC_RX_ENABLE
159
+ """
160
+
161
+ self.streams: StreamIndices = idx_mgr.IndexManager(
162
+ conn,
163
+ GenuineStreamIdx,
164
+ module_id,
165
+ port_id
166
+ )
167
+ """L23 port stream index manager.
168
+
169
+ :type: StreamIndices
170
+ """
171
+
172
+ self.filters: FilterIndices = idx_mgr.IndexManager(
173
+ conn,
174
+ GenuineFilterIdx,
175
+ module_id,
176
+ port_id
177
+ )
178
+ """L23 port filter index manager.
179
+
180
+ :type: FilterIndices
181
+ """
182
+
183
+ self.datasets: PortDatasetIndices = idx_mgr.IndexManager(
184
+ conn,
185
+ PortDatasetIdx,
186
+ module_id,
187
+ port_id
188
+ )
189
+ """L23 port histogram index manager.
190
+
191
+ :type: PortDatasetIndices
192
+ """
193
+
194
+ self.macsec_txscs: MacSecTxScIndices = idx_mgr.IndexManager(
195
+ conn,
196
+ GenuineMacSecTxScIdx,
197
+ module_id,
198
+ port_id
199
+ )
200
+ """L23 port MACSec TX SC index manager.
201
+
202
+ :type: MacSecTxScIndices
203
+ """
204
+
205
+ self.macsec_rxscs: MacSecRxScIndices = idx_mgr.IndexManager(
206
+ conn,
207
+ GenuineMacSecRxScIdx,
208
+ module_id,
209
+ port_id
210
+ )
211
+ """L23 port MACSec RX SC index manager.
212
+
213
+ :type: MacSecRxScIndices
214
+ """
215
+
216
+ @property
217
+ def info(self) -> ports_state.PortL23GenuineLocalState:
218
+ return self._local_states
219
+
220
+ async def _setup(self):
221
+ await self._local_states.initiate(self)
222
+ self._local_states.register_subscriptions(self)
223
+ return self
224
+
225
+ on_speed_selection_change = functools.partialmethod(utils.on_event, P_SPEEDSELECTION)
226
+ """Register a callback to the event that the port's speed mode changes."""
227
+
228
+ on_macsec_rx_enable_change = functools.partialmethod(utils.on_event, P_MACSEC_RX_ENABLE)
229
+ """Register a callback to the event that the port MACsec RX enable status changes."""
@@ -0,0 +1,231 @@
1
+ from typing import (
2
+ TYPE_CHECKING,
3
+ Dict,
4
+ )
5
+ if TYPE_CHECKING:
6
+ from xoa_driver.internals.core import interfaces as itf
7
+
8
+ from xoa_driver.internals.commands import (
9
+ PR_TPLDJITTER,
10
+ PR_TOTAL,
11
+ PR_NOTPLD,
12
+ PR_EXTRA,
13
+ PR_TPLDS,
14
+ PR_TPLDTRAFFIC,
15
+ PR_TPLDERRORS,
16
+ PR_TPLDLATENCY,
17
+ PR_FILTER,
18
+ PR_CLEAR,
19
+ PR_PFCSTATS,
20
+ PR_TOTALEXT,
21
+ PR_NOTPLDEXT,
22
+ PR_TPLDTRAFFICEXT,
23
+ PR_FILTEREXT,
24
+ # genuine only
25
+ PR_CALIBRATE,
26
+ PR_UAT_STATUS,
27
+ PR_UAT_TIME,
28
+ P_MACSEC_RX_STATS,
29
+ P_MACSEC_RX_CLEAR
30
+
31
+ )
32
+
33
+
34
+ # region All Ports
35
+
36
+ class PrsTPLD:
37
+ """L23 port's TPLD traffic statistics."""
38
+
39
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, tpld_idx: int) -> None:
40
+ self.traffic = PR_TPLDTRAFFIC(conn, module_id, port_id, tpld_idx)
41
+ """L23 port's statistics of traffic with TPLD.
42
+
43
+ :type: PR_TPLDTRAFFIC
44
+ """
45
+
46
+ self.traffic_ext = PR_TPLDTRAFFICEXT(conn, module_id, port_id, tpld_idx)
47
+ """L23 port's statistics of traffic with TPLD. (extended)
48
+
49
+ :type: PR_TPLDTRAFFICEXT
50
+ """
51
+
52
+ self.errors = PR_TPLDERRORS(conn, module_id, port_id, tpld_idx)
53
+ """L23 port's error statistics of traffic with TPLD.
54
+
55
+ :type: PR_TPLDERRORS
56
+ """
57
+
58
+ self.latency = PR_TPLDLATENCY(conn, module_id, port_id, tpld_idx)
59
+ """L23 port's latency statistics of traffic with TPLD.
60
+
61
+ :type: PR_TPLDLATENCY
62
+ """
63
+
64
+ self.jitter = PR_TPLDJITTER(conn, module_id, port_id, tpld_idx)
65
+ """L23 port's jitter statistics of traffic with TPLD.
66
+
67
+ :type: PR_TPLDJITTER
68
+ """
69
+
70
+
71
+ class PortReceptionStatistics:
72
+ """Port RX statistics"""
73
+
74
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
75
+ self.__conn = conn
76
+ self.__module_id = module_id
77
+ self.__port_id = port_id
78
+
79
+ self.__tpld_ids = PR_TPLDS(conn, module_id, port_id)
80
+
81
+ self.total = PR_TOTAL(conn, module_id, port_id)
82
+ """L23 port's total traffic statistics.
83
+
84
+ :type: PR_TOTAL
85
+ """
86
+
87
+ self.total_ext = PR_TOTALEXT(conn, module_id, port_id)
88
+ """L23 port's total traffic statistics. (extended)
89
+
90
+ :type: PR_TOTALEXT
91
+ """
92
+
93
+ self.no_tpld = PR_NOTPLD(conn, module_id, port_id)
94
+ """L23 port's statistics of traffic without TPLD.
95
+
96
+ :type: PR_NOTPLD
97
+ """
98
+
99
+ self.no_tpld_ext = PR_NOTPLDEXT(conn, module_id, port_id)
100
+ """L23 port's statistics of traffic without TPLD. (extended)
101
+
102
+ :type: PR_NOTPLDEXT
103
+ """
104
+
105
+ self.extra = PR_EXTRA(conn, module_id, port_id)
106
+ """L23 port's extra traffic statistics.
107
+
108
+ :type: PR_EXTRA
109
+ """
110
+ self.pfc_stats = PR_PFCSTATS(conn, module_id, port_id)
111
+ """L23 port's statistics of received PFC packets.
112
+
113
+ :type: PR_PFCSTATS
114
+ """
115
+ self.clear = PR_CLEAR(conn, module_id, port_id)
116
+ """Clear all RX statistics on the L23 port.
117
+
118
+ :type: PR_CLEAR
119
+ """
120
+
121
+ def obtain_filter_statistics(self, filter: int) -> "PR_FILTER":
122
+ """Obtain L23 port filtered traffic statistics.
123
+
124
+ :param filter: index of the filter
125
+ :type filter: int
126
+ :return: filtered traffic statistics
127
+ :rtype: PR_FILTER
128
+ """
129
+
130
+ return PR_FILTER(
131
+ self.__conn,
132
+ self.__module_id,
133
+ self.__port_id,
134
+ filter
135
+ )
136
+
137
+ def obtain_filter_statistics_ext(self, filter: int) -> "PR_FILTEREXT":
138
+ """Obtain L23 port filtered traffic statistics. (extended)
139
+
140
+ :param filter: index of the filter
141
+ :type filter: int
142
+ :return: filtered traffic statistics
143
+ :rtype: PR_FILTEREXT
144
+ """
145
+
146
+ return PR_FILTEREXT(
147
+ self.__conn,
148
+ self.__module_id,
149
+ self.__port_id,
150
+ filter
151
+ )
152
+
153
+ def access_tpld(self, tpld_id: int) -> "PrsTPLD":
154
+ """Access a certain TPLD value on a L23 port.
155
+
156
+ :param tpld_id: TPLD value.
157
+ :type tpld_id: int
158
+ :return: L23 port's TPLD traffic statistics
159
+ :rtype: PrsTPLD
160
+ """
161
+ return PrsTPLD(self.__conn, self.__module_id, self.__port_id, tpld_id)
162
+
163
+ async def obtain_available_tplds(self) -> Dict[int, "PrsTPLD"]:
164
+ #TODO: need to check use case if this is enough, otherwise to extend by give possibility manually specify indices
165
+ tplds = await self.__tpld_ids.get()
166
+ return {
167
+ idx:
168
+ PrsTPLD(self.__conn, self.__module_id, self.__port_id, idx)
169
+ for idx in tplds.test_payload_identifiers
170
+ }
171
+
172
+
173
+ # endregion
174
+
175
+ # region Genuine Ports
176
+ class GPrsUat():
177
+ """L23 port UAT info."""
178
+
179
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
180
+ self.status = PR_UAT_STATUS(conn, module_id, port_id)
181
+ """L23 port UAT status.
182
+
183
+ :type: PR_UAT_STATUS
184
+ """
185
+
186
+ self.time = PR_UAT_TIME(conn, module_id, port_id)
187
+ """L23 port number of unavailable seconds.
188
+
189
+ :type: PR_UAT_TIME
190
+ """
191
+
192
+
193
+ class MACSecRxStats:
194
+ """MACSec RX SC Statistics"""
195
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
196
+
197
+ self.total = P_MACSEC_RX_STATS(conn, module_id, port_id)
198
+ """Port's total MACsec RX statistics
199
+
200
+ :type: P_MACSEC_RX_STATS
201
+ """
202
+
203
+ self.clear = P_MACSEC_RX_CLEAR(conn, module_id, port_id)
204
+ """Clear Port's MACsec RX statistics
205
+
206
+ :type: P_MACSEC_RX_CLEAR
207
+ """
208
+
209
+
210
+ class GenuinePortReceptionStatistics(PortReceptionStatistics):
211
+ """L23 port RX statistics."""
212
+
213
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
214
+ super().__init__(conn, module_id, port_id)
215
+ self.calibrate = PR_CALIBRATE(conn, module_id, port_id)
216
+ """L23 port calibration of latency for received packets.
217
+
218
+ :type: PR_CALIBRATE
219
+ """
220
+
221
+ self.uat = GPrsUat(conn, module_id, port_id)
222
+ """L23 port UAT info.
223
+
224
+ :type: GPrsUat
225
+ """
226
+
227
+ self.macsec = MACSecRxStats(conn, module_id, port_id)
228
+ """L23 port's MACsec RX statistics.
229
+ """
230
+
231
+ # endregion
@@ -0,0 +1,117 @@
1
+ from typing import TYPE_CHECKING
2
+ if TYPE_CHECKING:
3
+ from xoa_driver.internals.core import interfaces as itf
4
+ from xoa_driver.internals.commands import (
5
+ PX_RW,
6
+ PX_MII,
7
+ PX_TEMPERATURE,
8
+ PX_RW_SEQ,
9
+ PX_I2C_CONFIG,
10
+ PX_RW_SEQ_BANK,
11
+ )
12
+
13
+
14
+ class PortTransceiver:
15
+ """L23 port transceiver."""
16
+
17
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
18
+ self.__conn = conn
19
+ self.__module_id = module_id
20
+ self.__port_id = port_id
21
+
22
+ self.i2c_config = PX_I2C_CONFIG(conn, module_id, port_id)
23
+ """Access speed on a transceiver.
24
+ :type: PX_I2C_CONFIG
25
+ """
26
+
27
+ def access_temperature(self):
28
+ """Transceiver temperature in Celsius.
29
+
30
+ :return: Transceiver temperature integral and decimal parts
31
+ :rtype: PX_TEMPERATURE
32
+ """
33
+
34
+ return PX_TEMPERATURE(
35
+ self.__conn,
36
+ self.__module_id,
37
+ self.__port_id,
38
+ )
39
+
40
+ def access_rw(self, page_address: int, register_address: int) -> "PX_RW":
41
+ """Access to register interface by the transceiver.
42
+
43
+ :param page_address: page address
44
+ :type page_address: int
45
+ :param register_address: register address
46
+ :type register_address: int
47
+ :return: transceiver register values
48
+ :rtype: PX_RW
49
+ """
50
+
51
+ return PX_RW(
52
+ self.__conn,
53
+ self.__module_id,
54
+ self.__port_id,
55
+ page_address,
56
+ register_address
57
+ )
58
+
59
+ def access_mii(self, register_address: int) -> "PX_MII":
60
+ """Access to the register interface supported by the media-independent interface (MII) transceiver.
61
+
62
+ :param register_address: register address
63
+ :type register_address: int
64
+ :return: register values
65
+ :rtype: PX_MII
66
+ """
67
+ return PX_MII(
68
+ self.__conn,
69
+ self.__module_id,
70
+ self.__port_id,
71
+ register_address
72
+ )
73
+
74
+ def access_rw_seq(self, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ":
75
+ """Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
76
+
77
+ :param page_address: page address (0-255)
78
+ :type page_address: int
79
+ :param register_address: register address (0-255)
80
+ :type register_address: int
81
+ :param byte_count: the number of bytes to read/write
82
+ :type byte_count: int
83
+ :return: transceiver register values
84
+ :rtype: PX_RW_SEQ
85
+ """
86
+ return PX_RW_SEQ(
87
+ self.__conn,
88
+ self.__module_id,
89
+ self.__port_id,
90
+ page_address,
91
+ register_address,
92
+ byte_count
93
+ )
94
+
95
+ def access_rw_seq_bank(self, bank_address: int, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ_BANK":
96
+ """Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
97
+
98
+ :param bank_address: bank address (0-255)
99
+ :type bank_address: int
100
+ :param page_address: page address (0-255)
101
+ :type page_address: int
102
+ :param register_address: register address (0-255)
103
+ :type register_address: int
104
+ :param byte_count: the number of bytes to read/write
105
+ :type byte_count: int
106
+ :return: transceiver register values
107
+ :rtype: PX_RW_SEQ_BANK
108
+ """
109
+ return PX_RW_SEQ_BANK(
110
+ self.__conn,
111
+ self.__module_id,
112
+ self.__port_id,
113
+ bank_address,
114
+ page_address,
115
+ register_address,
116
+ byte_count
117
+ )
@@ -0,0 +1,131 @@
1
+ from typing import (
2
+ TYPE_CHECKING,
3
+ Union,
4
+ )
5
+ if TYPE_CHECKING:
6
+ from xoa_driver.internals.core import interfaces as itf
7
+ from xoa_driver.internals.hli_v1.indices.streams.genuine_stream import GenuineStreamIdx
8
+ from xoa_driver.internals.commands import (
9
+ PT_TOTAL,
10
+ PT_NOTPLD,
11
+ PT_STREAM,
12
+ PT_CLEAR,
13
+ PT_EXTRA,
14
+ PT_TOTALEXT,
15
+ PT_NOTPLDEXT,
16
+ PT_STREAMEXT,
17
+ P_MACSEC_TX_STATS,
18
+ P_MACSEC_TX_CLEAR,
19
+ )
20
+
21
+ # region All Ports
22
+
23
+ class PortTransmissionStatistics:
24
+ """L23 port TX statistics"""
25
+
26
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
27
+ self.__conn = conn
28
+ self.__module_id = module_id
29
+ self.__port_id = port_id
30
+ self.total = PT_TOTAL(conn, module_id, port_id)
31
+ """All TX statistics on the L23 port.
32
+
33
+ :type: PT_TOTAL
34
+ """
35
+
36
+ self.total_ext = PT_TOTALEXT(conn, module_id, port_id)
37
+ """All TX statistics on the L23 port. (extended)
38
+
39
+ :type: PT_TOTALEXT
40
+ """
41
+
42
+ self.extra = PT_EXTRA(conn, module_id, port_id)
43
+ """Extra TX statistics on the L23 port.
44
+
45
+ :type: PT_EXTRA
46
+ """
47
+
48
+ self.no_tpld = PT_NOTPLD(conn, module_id, port_id)
49
+ """TX statistics of packets without TPLD on the L23 port.
50
+
51
+ :type: PT_NOTPLD
52
+ """
53
+
54
+ self.no_tpld_ext = PT_NOTPLDEXT(conn, module_id, port_id)
55
+ """TX statistics of packets without TPLD on the L23 port. (extended)
56
+
57
+ :type: PT_NOTPLDEXT
58
+ """
59
+
60
+ self.clear = PT_CLEAR(conn, module_id, port_id)
61
+ """Clear TX statistics on the L23 port.
62
+
63
+ :type: PT_CLEAR
64
+ """
65
+
66
+ def obtain_from_stream(self, stream: Union[int, "GenuineStreamIdx"]) -> "PT_STREAM":
67
+ """Obtain statistics of packets of a specific stream on a L23 port.
68
+
69
+ :param stream: stream object
70
+ :type stream: Union[int, "GenuineStreamIdx"]
71
+ :return: statistics of packets of a specific stream on a L23 port
72
+ :rtype: PT_STREAM
73
+ """
74
+
75
+ stream_idx = stream if isinstance(stream, int) else stream.kind.index_id
76
+ return PT_STREAM(
77
+ self.__conn,
78
+ self.__module_id,
79
+ self.__port_id,
80
+ stream_idx
81
+ )
82
+
83
+ def obtain_from_stream_ext(self, stream: Union[int, "GenuineStreamIdx"]) -> "PT_STREAMEXT":
84
+ """Obtain statistics of packets of a specific stream on a L23 port. (extended)
85
+
86
+ :param stream: stream object
87
+ :type stream: Union[int, "GenuineStreamIdx"]
88
+ :return: statistics of packets of a specific stream on a L23 port
89
+ :rtype: PT_STREAMEXT
90
+ """
91
+
92
+ stream_idx = stream if isinstance(stream, int) else stream.kind.index_id
93
+ return PT_STREAMEXT(
94
+ self.__conn,
95
+ self.__module_id,
96
+ self.__port_id,
97
+ stream_idx
98
+ )
99
+
100
+ # endregion
101
+
102
+ # region Genuine Ports
103
+
104
+ class MACSecTxStats:
105
+ """MACSec TX SC Statistics"""
106
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
107
+
108
+ self.total = P_MACSEC_TX_STATS(conn, module_id, port_id)
109
+ """Port's total MACsec TX statistics
110
+
111
+ :type: P_MACSEC_TX_STATS
112
+ """
113
+
114
+ self.clear = P_MACSEC_TX_CLEAR(conn, module_id, port_id)
115
+ """Clear Port's MACsec TX statistics
116
+
117
+ :type: P_MACSEC_TX_CLEAR
118
+ """
119
+
120
+
121
+ class GenuinePortTransmissionStatistics(PortTransmissionStatistics):
122
+ """L23 port RX statistics."""
123
+
124
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
125
+ super().__init__(conn, module_id, port_id)
126
+
127
+ self.macsec = MACSecTxStats(conn, module_id, port_id)
128
+ """L23 port's MACsec TX statistics.
129
+ """
130
+
131
+ # endregion