tdl-xoa-driver 1.0.0__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.0.dist-info/LICENSE +202 -0
  2. tdl_xoa_driver-1.0.0.dist-info/METADATA +177 -0
  3. tdl_xoa_driver-1.0.0.dist-info/RECORD +325 -0
  4. tdl_xoa_driver-1.0.0.dist-info/WHEEL +5 -0
  5. tdl_xoa_driver-1.0.0.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,65 @@
1
+ from typing import (
2
+ TYPE_CHECKING,
3
+ List,
4
+ Type,
5
+ TypeVar,
6
+ )
7
+ from xoa_driver.internals.commands import (
8
+ PF_INDICES,
9
+ PF_CREATE,
10
+ PF_DELETE,
11
+ PF_ENABLE,
12
+ PF_COMMENT,
13
+ PF_CONDITION,
14
+ )
15
+ if TYPE_CHECKING:
16
+ from xoa_driver.internals.core import interfaces as itf
17
+ from xoa_driver.internals.utils import kind
18
+ from xoa_driver.internals.utils.indices import observer as idx_obs
19
+ from ..base_index import BaseIndex
20
+
21
+
22
+ FT = TypeVar("FT")
23
+
24
+
25
+ class BaseFilterIdx(BaseIndex):
26
+ """Base L23 Filter Index Manager"""
27
+ def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
28
+ super().__init__(conn, kind, observer)
29
+
30
+ self.comment = PF_COMMENT(conn, *kind)
31
+ """Description of the filter.
32
+
33
+ :type: PF_COMMENT
34
+ """
35
+
36
+ self.enable = PF_ENABLE(conn, *kind)
37
+ """Enable or disable the filter.
38
+
39
+ :type: PF_ENABLE
40
+ """
41
+
42
+ self.condition = PF_CONDITION(conn, *kind)
43
+ """Filter condition configuration.
44
+
45
+ :type: PF_CONDITION
46
+ """
47
+
48
+ async def delete(self):
49
+ """Delete filter.
50
+
51
+ :type: PF_DELETE
52
+ """
53
+
54
+ await PF_DELETE(self._conn, *self.kind).set()
55
+ self._observer.notify(idx_obs.IndexEvents.DEL, self)
56
+
57
+ @classmethod
58
+ async def _fetch(cls, conn: "itf.IConnection", module_id: int, port_id: int) -> List[int]:
59
+ resp = await PF_INDICES(conn, module_id, port_id).get()
60
+ return list(resp.filter_xindices)
61
+
62
+ @classmethod
63
+ async def _new(cls: Type[FT], conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> FT:
64
+ await PF_CREATE(conn, *kind).set()
65
+ return cls(conn, kind, observer)
@@ -0,0 +1,20 @@
1
+ from typing import TYPE_CHECKING
2
+ from xoa_driver.internals.commands import PF_STRING
3
+
4
+ if TYPE_CHECKING:
5
+ from xoa_driver.internals.core import interfaces as itf
6
+ from xoa_driver.internals.utils import kind
7
+ from xoa_driver.internals.utils.indices import observer as idx_obs
8
+
9
+ from .base_filter import BaseFilterIdx
10
+
11
+
12
+ class GenuineFilterIdx(BaseFilterIdx):
13
+ """Genuine L23 Filter Index Manager"""
14
+ def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
15
+ super().__init__(conn, kind, observer)
16
+ self.string = PF_STRING(conn, *kind)
17
+ """String representation of the filter.
18
+
19
+ :type: PF_STRING
20
+ """
@@ -0,0 +1,49 @@
1
+ from typing import (
2
+ TYPE_CHECKING,
3
+ List,
4
+ TypeVar,
5
+ Type,
6
+ )
7
+ from xoa_driver.internals.commands import (
8
+ PL_INDICES,
9
+ PL_CREATE,
10
+ PL_DELETE,
11
+ PL_LENGTH,
12
+ )
13
+
14
+ if TYPE_CHECKING:
15
+ from xoa_driver.internals.core import interfaces as itf
16
+ from xoa_driver.internals.utils import kind
17
+ from xoa_driver.internals.utils.indices import observer as idx_obs
18
+ from .base_index import BaseIndex
19
+
20
+
21
+ LT = TypeVar("LT")
22
+
23
+
24
+ class LengthTermIdx(BaseIndex):
25
+ """L23 Length Term Index Manager"""
26
+ def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
27
+ super().__init__(conn, kind, observer)
28
+ self.length = PL_LENGTH(conn, *kind)
29
+ """Configure length term
30
+ :type: PL_LENGTH
31
+ """
32
+
33
+ async def delete(self):
34
+ await PL_DELETE(self._conn, *self.kind).set()
35
+ """Delete length term.
36
+ :type: PL_DELETE
37
+ """
38
+
39
+ self._observer.notify(idx_obs.IndexEvents.DEL, self)
40
+
41
+ @classmethod
42
+ async def _fetch(cls, conn: "itf.IConnection", module_id: int, port_id: int) -> List[int]:
43
+ resp = await PL_INDICES(conn, module_id, port_id).get()
44
+ return list(resp.length_term_xindices)
45
+
46
+ @classmethod
47
+ async def _new(cls: Type[LT], conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> LT:
48
+ await PL_CREATE(conn, *kind).set()
49
+ return cls(conn, kind, observer)
@@ -0,0 +1,224 @@
1
+ from typing import (
2
+ List,
3
+ Type,
4
+ TypeVar,
5
+ TYPE_CHECKING,
6
+ )
7
+ from xoa_driver.internals.commands import (
8
+ P_MACSEC_TXSC_INDICES,
9
+ P_MACSEC_TXSC_CREATE,
10
+ P_MACSEC_TXSC_DELETE,
11
+ P_MACSEC_TXSC_DESCR,
12
+ P_MACSEC_TXSC_SCI_MODE,
13
+ P_MACSEC_TXSC_SCI,
14
+ P_MACSEC_TXSC_CONF_OFFSET,
15
+ P_MACSEC_TXSC_CIPHERSUITE,
16
+ P_MACSEC_TXSC_STARTING_PN,
17
+ # P_MACSEC_TXSC_VLAN_MODE,
18
+ P_MACSEC_TXSC_REKEY_MODE,
19
+ P_MACSEC_TXSC_ENCRYPT,
20
+ P_MACSEC_RXSC_INDICES,
21
+ P_MACSEC_RXSC_CREATE,
22
+ P_MACSEC_RXSC_DELETE,
23
+ P_MACSEC_RXSC_DESCR,
24
+ P_MACSEC_RXSC_SCI,
25
+ P_MACSEC_RXSC_CONF_OFFSET,
26
+ P_MACSEC_RXSC_CIPHERSUITE,
27
+ P_MACSEC_RXSC_TPLDID,
28
+ P_MACSEC_RXSC_STARTING_PN,
29
+ P_MACSEC_TXSC_XPN_SSCI,
30
+ P_MACSEC_TXSC_XPN_SALT,
31
+ P_MACSEC_RXSC_XPN_SSCI,
32
+ P_MACSEC_RXSC_XPN_SALT,
33
+ )
34
+ if TYPE_CHECKING:
35
+ from xoa_driver.internals.core import interfaces as itf
36
+ from xoa_driver.internals.utils import kind
37
+ from xoa_driver.internals.utils.indices import observer as idx_obs
38
+ from xoa_driver.internals.utils.indices import header_modifier_manager as hmm
39
+ from ..base_index import BaseIndex
40
+
41
+
42
+ class MACSecTxScConfig:
43
+ """MACSec TX SC Configuration"""
44
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, txsc_idx: int) -> None:
45
+
46
+ self.description = P_MACSEC_TXSC_DESCR(conn, module_id, port_id, txsc_idx)
47
+ """Configure TX SC's description
48
+
49
+ :type: P_MACSEC_TXSC_DESCR
50
+ """
51
+
52
+ self.sci_mode = P_MACSEC_TXSC_SCI_MODE(conn, module_id, port_id, txsc_idx)
53
+ """Configure TX SC's SCI mode
54
+
55
+ :type: P_MACSEC_TXSC_SCI_MODE
56
+ """
57
+
58
+ self.sci = P_MACSEC_TXSC_SCI(conn, module_id, port_id, txsc_idx)
59
+ """Configure TX SC's SCI value
60
+
61
+ :type: P_MACSEC_TXSC_SCI
62
+ """
63
+
64
+ self.confidentiality_offset = P_MACSEC_TXSC_CONF_OFFSET(conn, module_id, port_id, txsc_idx)
65
+ """Configure TX SC's confidentiality offset
66
+
67
+ :type: P_MACSEC_TXSC_CONF_OFFSET
68
+ """
69
+
70
+ self.cipher_suite = P_MACSEC_TXSC_CIPHERSUITE(conn, module_id, port_id, txsc_idx)
71
+ """Configure TX SC's cipher suite
72
+
73
+ :type: P_MACSEC_TXSC_CIPHERSUITE
74
+ """
75
+
76
+ self.starting_pn = P_MACSEC_TXSC_STARTING_PN(conn, module_id, port_id, txsc_idx)
77
+ """Configure TX SC's starting PN
78
+
79
+ :type: P_MACSEC_TXSC_STARTING_PN
80
+ """
81
+
82
+ # self.vlan_mode = P_MACSEC_TXSC_VLAN_MODE(conn, module_id, port_id, txsc_idx)
83
+ # """Configure TX SC's VLAN mode
84
+
85
+ # :type: P_MACSEC_TXSC_VLAN_MODE
86
+ # """
87
+
88
+ self.rekey_mode = P_MACSEC_TXSC_REKEY_MODE(conn, module_id, port_id, txsc_idx)
89
+ """Configure TX SC's rekey mode
90
+
91
+ :type: P_MACSEC_TXSC_REKEY_MODE
92
+ """
93
+
94
+ self.encryption_mode = P_MACSEC_TXSC_ENCRYPT(conn, module_id, port_id, txsc_idx)
95
+ """Configure TX SC's encryption mode
96
+
97
+ :type: P_MACSEC_TXSC_ENCRYPT
98
+ """
99
+
100
+ self.xpn_ssci = P_MACSEC_TXSC_XPN_SSCI(conn, module_id, port_id, txsc_idx)
101
+ """Configure TX SC's XPN SSCI value
102
+
103
+ :type: P_MACSEC_TXSC_XPN_SSCI
104
+ """
105
+
106
+ self.xpn_salt = P_MACSEC_TXSC_XPN_SALT(conn, module_id, port_id, txsc_idx)
107
+ """Configure TX SC's XPN Salt value
108
+
109
+ :type: P_MACSEC_TXSC_XPN_SALT
110
+ """
111
+
112
+ class MACSecRxScConfig:
113
+ """MACSec RX SC Configuration"""
114
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, rxsc_idx: int) -> None:
115
+
116
+ self.description = P_MACSEC_RXSC_DESCR(conn, module_id, port_id, rxsc_idx)
117
+ """Configure RX SC's description
118
+
119
+ :type: P_MACSEC_RXSC_DESCR
120
+ """
121
+
122
+ self.sci = P_MACSEC_RXSC_SCI(conn, module_id, port_id, rxsc_idx)
123
+ """Configure RX SC's SCI value
124
+
125
+ :type: P_MACSEC_RXSC_SCI
126
+ """
127
+
128
+ self.confidentiality_offset = P_MACSEC_RXSC_CONF_OFFSET(conn, module_id, port_id, rxsc_idx)
129
+ """Configure RX SC's confidentiality offset
130
+
131
+ :type: P_MACSEC_RXSC_CONF_OFFSET
132
+ """
133
+
134
+ self.cipher_suite = P_MACSEC_RXSC_CIPHERSUITE(conn, module_id, port_id, rxsc_idx)
135
+ """Configure RX SC's cipher suite
136
+
137
+ :type: P_MACSEC_RXSC_CIPHERSUITE
138
+ """
139
+
140
+ self.starting_pn = P_MACSEC_RXSC_STARTING_PN(conn, module_id, port_id, rxsc_idx)
141
+ """Configure RX SC's firset expected PN"""
142
+
143
+ self.tpld_id = P_MACSEC_RXSC_TPLDID(conn, module_id, port_id, rxsc_idx)
144
+ """Configure RX SC's TPLD ID value
145
+
146
+ :type: P_MACSEC_RXSC_TPLDID
147
+ """
148
+
149
+ self.xpn_ssci = P_MACSEC_RXSC_XPN_SSCI(conn, module_id, port_id, rxsc_idx)
150
+ """Configure RX SC's XPN SSCI value
151
+
152
+ :type: P_MACSEC_RXSC_XPN_SSCI
153
+ """
154
+
155
+ self.xpn_salt = P_MACSEC_RXSC_XPN_SALT(conn, module_id, port_id, rxsc_idx)
156
+ """Configure RX SC's XPN Salt value
157
+
158
+ :type: P_MACSEC_RXSC_XPN_SALT
159
+ """
160
+
161
+
162
+ BS = TypeVar("BS")
163
+
164
+
165
+ class BaseMacSecTxScIdx(BaseIndex):
166
+ """Base MACSec TX SC Index Manager"""
167
+ def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
168
+ super().__init__(conn, kind, observer)
169
+
170
+ self.config = MACSecTxScConfig(conn, *kind)
171
+ """MACSec TX SC Configuration
172
+
173
+ :type: MACSecTxScConfig
174
+ """
175
+
176
+ async def delete(self):
177
+ """Delete the TX SC
178
+
179
+ :type: P_MACSEC_TXSC_DELETE
180
+ """
181
+
182
+ await P_MACSEC_TXSC_DELETE(self._conn, *self.kind).set()
183
+ self._observer.notify(idx_obs.IndexEvents.DEL, self)
184
+
185
+ @classmethod
186
+ async def _fetch(cls, conn: "itf.IConnection", module_id: int, port_id: int) -> List[int]:
187
+ resp = await P_MACSEC_TXSC_INDICES(conn, module_id, port_id).get()
188
+ return list(resp.txsc_indices)
189
+
190
+ @classmethod
191
+ async def _new(cls: Type[BS], conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> BS:
192
+ await P_MACSEC_TXSC_CREATE(conn, *kind).set()
193
+ return cls(conn, kind, observer)
194
+
195
+
196
+ class BaseMacSecRxScIdx(BaseIndex):
197
+ """Base MACSec RX SC Index Manager"""
198
+ def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
199
+ super().__init__(conn, kind, observer)
200
+
201
+ self.config = MACSecRxScConfig(conn, *kind)
202
+ """MACSec RX SC Configuration
203
+
204
+ :type: MACSecRxScConfig
205
+ """
206
+
207
+ async def delete(self):
208
+ """Delete the RX SC
209
+
210
+ :type: P_MACSEC_RXSC_DELETE
211
+ """
212
+
213
+ await P_MACSEC_RXSC_DELETE(self._conn, *self.kind).set()
214
+ self._observer.notify(idx_obs.IndexEvents.DEL, self)
215
+
216
+ @classmethod
217
+ async def _fetch(cls, conn: "itf.IConnection", module_id: int, port_id: int) -> List[int]:
218
+ resp = await P_MACSEC_RXSC_INDICES(conn, module_id, port_id).get()
219
+ return list(resp.rxsc_indices)
220
+
221
+ @classmethod
222
+ async def _new(cls: Type[BS], conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> BS:
223
+ await P_MACSEC_RXSC_CREATE(conn, *kind).set()
224
+ return cls(conn, kind, observer)
@@ -0,0 +1,72 @@
1
+ from typing import TYPE_CHECKING
2
+ from xoa_driver.internals.commands import (
3
+ P_MACSEC_TXSC_SAK_VALUE,
4
+ P_MACSEC_RXSC_SAK_VALUE,
5
+ P_MACSEC_TXSC_STATS,
6
+ P_MACSEC_RXSC_STATS,
7
+ )
8
+ from .base_macsecsc import (
9
+ BaseMacSecTxScIdx,
10
+ BaseMacSecRxScIdx
11
+ )
12
+
13
+ if TYPE_CHECKING:
14
+ from xoa_driver.internals.core import interfaces as itf
15
+ from xoa_driver.internals.utils import kind
16
+ from xoa_driver.internals.utils.indices import observer as idx_obs
17
+
18
+
19
+
20
+ class GenuineMacSecTxScIdx(BaseMacSecTxScIdx):
21
+ """Genuine MACSec TX SC Index Manager"""
22
+ def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
23
+ super().__init__(conn, kind, observer)
24
+
25
+ self.stats = P_MACSEC_TXSC_STATS(conn, *kind)
26
+ """Port's MACsec TX SC statistics
27
+
28
+ :type: P_MACSEC_TXSC_STATS
29
+ """
30
+
31
+ def access_sak_value(self, sak_index: int) -> "P_MACSEC_TXSC_SAK_VALUE":
32
+ """Access SAK value
33
+
34
+ :param sak_index: SAK key index
35
+ :type sak_index: int
36
+ :rtype: P_MACSEC_TXSC_SAK_VALUE
37
+ """
38
+
39
+ return P_MACSEC_TXSC_SAK_VALUE(
40
+ self._conn,
41
+ self.kind.module_id,
42
+ self.kind.port_id,
43
+ self.kind.index_id,
44
+ sak_index
45
+ )
46
+
47
+ class GenuineMacSecRxScIdx(BaseMacSecRxScIdx):
48
+ """Genuine MACSec RX SC Index Manager"""
49
+ def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
50
+ super().__init__(conn, kind, observer)
51
+
52
+ self.stats = P_MACSEC_RXSC_STATS(conn, *kind)
53
+ """Port's MACsec RX SC statistics
54
+
55
+ :type: P_MACSEC_RXSC_STATS
56
+ """
57
+
58
+ def access_sak_value(self, sak_index: int) -> "P_MACSEC_RXSC_SAK_VALUE":
59
+ """Access SAK value
60
+
61
+ :param sak_index: SAK key index
62
+ :type sak_index: int
63
+ :rtype: P_MACSEC_RXSC_SAK_VALUE
64
+ """
65
+
66
+ return P_MACSEC_RXSC_SAK_VALUE(
67
+ self._conn,
68
+ self.kind.module_id,
69
+ self.kind.port_id,
70
+ self.kind.index_id,
71
+ sak_index
72
+ )
@@ -0,0 +1,64 @@
1
+ from typing import (
2
+ List,
3
+ Type,
4
+ TypeVar,
5
+ TYPE_CHECKING,
6
+ )
7
+ from xoa_driver.internals.commands import (
8
+ PM_INDICES,
9
+ PM_CREATE,
10
+ PM_DELETE,
11
+ PM_PROTOCOL,
12
+ PM_POSITION,
13
+ PM_MATCH,
14
+ )
15
+ if TYPE_CHECKING:
16
+ from xoa_driver.internals.core import interfaces as itf
17
+ from xoa_driver.internals.utils import kind
18
+ from xoa_driver.internals.utils.indices import observer as idx_obs
19
+ from .base_index import BaseIndex
20
+
21
+ MT = TypeVar("MT")
22
+
23
+
24
+ class MatchTermIdx(BaseIndex):
25
+ """L23 Match Term Index Manager"""
26
+ def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
27
+ super().__init__(conn, kind, observer)
28
+
29
+ self.protocol = PM_PROTOCOL(conn, *kind)
30
+ """The protocol segments assumed on the packets received on the port.
31
+
32
+ :type: PM_PROTOCOL
33
+ """
34
+
35
+ self.position = PM_POSITION(conn, *kind)
36
+ """The position within each received packet where content matching begins for the port.
37
+
38
+ :type: PM_POSITION
39
+ """
40
+
41
+ self.match = PM_MATCH(conn, *kind)
42
+ """The value that must be found at the match term position for packets received on the port.
43
+
44
+ :type: PM_MATCH
45
+ """
46
+
47
+ async def delete(self):
48
+ await PM_DELETE(self._conn, *self.kind).set()
49
+ """Delete the match term.
50
+
51
+ :type: PM_DELETE
52
+ """
53
+
54
+ self._observer.notify(idx_obs.IndexEvents.DEL, self)
55
+
56
+ @classmethod
57
+ async def _fetch(cls, conn: "itf.IConnection", module_id: int, port_id: int) -> List[int]:
58
+ resp = await PM_INDICES(conn, module_id, port_id).get()
59
+ return list(resp.match_term_xindices)
60
+
61
+ @classmethod
62
+ async def _new(cls: Type[MT], conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> MT:
63
+ await PM_CREATE(conn, *kind).set()
64
+ return cls(conn, kind, observer)
@@ -0,0 +1,72 @@
1
+ from typing import (
2
+ TYPE_CHECKING,
3
+ List,
4
+ TypeVar,
5
+ Type,
6
+ )
7
+ from xoa_driver.internals.commands import (
8
+ PD_INDICES,
9
+ PD_CREATE,
10
+ PD_DELETE,
11
+ PD_ENABLE,
12
+ PD_SOURCE,
13
+ PD_RANGE,
14
+ PD_SAMPLES,
15
+ )
16
+
17
+ if TYPE_CHECKING:
18
+ from xoa_driver.internals.core import interfaces as itf
19
+ from xoa_driver.internals.utils import kind
20
+ from xoa_driver.internals.utils.indices import observer as idx_obs
21
+ from .base_index import BaseIndex
22
+
23
+
24
+ PD = TypeVar("PD")
25
+
26
+
27
+ class PortDatasetIdx(BaseIndex):
28
+ """L23 Histogram Index Manager"""
29
+ def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
30
+ super().__init__(conn, kind, observer)
31
+ self.enable = PD_ENABLE(conn, *kind)
32
+ """Enable histogram.
33
+
34
+ :type: PD_ENABLE
35
+ """
36
+
37
+ self.source = PD_SOURCE(conn, *kind)
38
+ """The source criteria specifying what is counted, and for which packets, by a histogram of a port.
39
+
40
+ :type: PD_SOURCE
41
+ """
42
+
43
+ self.range = PD_RANGE(conn, *kind)
44
+ """The bucket ranges used for classifying the packets counted by a histogram of a port.
45
+
46
+ :type: PD_RANGE
47
+ """
48
+
49
+ self.samples = PD_SAMPLES(conn, *kind)
50
+ """The current set of counts collected by a histogram for a port.
51
+
52
+ :type: PD_SAMPLES
53
+ """
54
+
55
+ async def delete(self):
56
+ await PD_DELETE(self._conn, *self.kind).set()
57
+ """Delete a histogram.
58
+
59
+ :type: PD_ENABLE
60
+ """
61
+
62
+ self._observer.notify(idx_obs.IndexEvents.DEL, self)
63
+
64
+ @classmethod
65
+ async def _fetch(cls, conn: "itf.IConnection", module_id: int, port_id: int) -> List[int]:
66
+ resp = await PD_INDICES(conn, module_id, port_id).get()
67
+ return list(resp.histogram_indices)
68
+
69
+ @classmethod
70
+ async def _new(cls: Type[PD], conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> PD:
71
+ await PD_CREATE(conn, *kind).set()
72
+ return cls(conn, kind, observer)