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,156 @@
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
+ # genuine only
21
+ PR_CALIBRATE,
22
+ PR_UAT_STATUS,
23
+ PR_UAT_TIME,
24
+
25
+ )
26
+
27
+
28
+ # region All Ports
29
+
30
+ class PrsTPLD:
31
+ """L23 port's TPLD traffic statistics."""
32
+
33
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, tpld_idx: int) -> None:
34
+ self.traffic = PR_TPLDTRAFFIC(conn, module_id, port_id, tpld_idx)
35
+ """L23 port's statistics of traffic with TPLD.
36
+ Representation of PR_TPLDTRAFFIC
37
+ """
38
+
39
+ self.errors = PR_TPLDERRORS(conn, module_id, port_id, tpld_idx)
40
+ """L23 port's error statistics of traffic with TPLD.
41
+ Representation of PR_TPLDERRORS
42
+ """
43
+
44
+ self.latency = PR_TPLDLATENCY(conn, module_id, port_id, tpld_idx)
45
+ """L23 port's latency statistics of traffic with TPLD.
46
+ Representation of PR_TPLDLATENCY
47
+ """
48
+
49
+ self.jitter = PR_TPLDJITTER(conn, module_id, port_id, tpld_idx)
50
+ """L23 port's jitter statistics of traffic with TPLD.
51
+ Representation of PR_TPLDJITTER
52
+ """
53
+
54
+
55
+ class PortReceptionStatistics:
56
+ """Port RX statistics"""
57
+
58
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
59
+ self.__conn = conn
60
+ self.__module_id = module_id
61
+ self.__port_id = port_id
62
+
63
+ self.__tpld_ids = PR_TPLDS(conn, module_id, port_id)
64
+
65
+ self.total = PR_TOTAL(conn, module_id, port_id)
66
+ """L23 port's total traffic statistics.
67
+ Representation of PR_TOTAL
68
+ """
69
+
70
+ self.no_tpld = PR_NOTPLD(conn, module_id, port_id)
71
+ """L23 port's statistics of traffic without TPLD.
72
+ Representation of PR_NOTPLD
73
+ """
74
+
75
+ self.extra = PR_EXTRA(conn, module_id, port_id)
76
+ """L23 port's extra traffic statistics.
77
+ Representation of PR_EXTRA
78
+ """
79
+ self.pfc_stats = PR_PFCSTATS(conn, module_id, port_id)
80
+ """L23 port's statistics of received PFC packets.
81
+ Representation of PR_PFCSTATS
82
+ """
83
+ self.clear = PR_CLEAR(conn, module_id, port_id)
84
+ """Clear all RX statistics on the L23 port.
85
+ Representation of PR_CLEAR
86
+ """
87
+
88
+ def obtain_filter_statistics(self, filter: int) -> "PR_FILTER":
89
+ """Obtain L23 port filtered traffic statistics.
90
+
91
+ :param filter: index of the filter
92
+ :type filter: int
93
+ :return: filtered traffic statistics
94
+ :rtype: PR_FILTER
95
+ """
96
+
97
+ return PR_FILTER(
98
+ self.__conn,
99
+ self.__module_id,
100
+ self.__port_id,
101
+ filter
102
+ )
103
+
104
+ def access_tpld(self, tpld_id: int) -> "PrsTPLD":
105
+ """Access a certain TPLD value on a L23 port.
106
+
107
+ :param tpld_id: TPLD value.
108
+ :type tpld_id: int
109
+ :return: L23 port's TPLD traffic statistics
110
+ :rtype: PrsTPLD
111
+ """
112
+ return PrsTPLD(self.__conn, self.__module_id, self.__port_id, tpld_id)
113
+
114
+ async def obtain_available_tplds(self) -> Dict[int, "PrsTPLD"]:
115
+ #TODO: need to check use case if this is enough, otherwise to extend by give possibility manually specify indices
116
+ tplds = await self.__tpld_ids.get()
117
+ return {
118
+ idx:
119
+ PrsTPLD(self.__conn, self.__module_id, self.__port_id, idx)
120
+ for idx in tplds.test_payload_identifiers
121
+ }
122
+
123
+
124
+ # endregion
125
+
126
+ # region Genuine Ports
127
+ class GPrsUat():
128
+ """L23 port UAT info."""
129
+
130
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
131
+ self.status = PR_UAT_STATUS(conn, module_id, port_id)
132
+ """L23 port UAT status.
133
+ Representation of PR_UAT_STATUS
134
+ """
135
+
136
+ self.time = PR_UAT_TIME(conn, module_id, port_id)
137
+ """L23 port number of unavailable seconds.
138
+ Representation of PR_UAT_TIME
139
+ """
140
+
141
+
142
+ class GenuinePortReceptionStatistics(PortReceptionStatistics):
143
+ """L23 port RX statistics."""
144
+
145
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
146
+ super().__init__(conn, module_id, port_id)
147
+ self.calibrate = PR_CALIBRATE(conn, module_id, port_id)
148
+ """L23 port calibration of latency for received packets.
149
+ Representation of PR_CALIBRATE
150
+ """
151
+
152
+ self.uat = GPrsUat(conn, module_id, port_id)
153
+ """L23 port UAT info.
154
+ """
155
+
156
+ # 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,59 @@
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_v2.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
+ )
15
+
16
+
17
+ class PortTransmissionStatistics:
18
+ """L23 port TX statistics"""
19
+
20
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
21
+ self.__conn = conn
22
+ self.__module_id = module_id
23
+ self.__port_id = port_id
24
+ self.total = PT_TOTAL(conn, module_id, port_id)
25
+ """All TX statistics on the L23 port.
26
+ Representation of PT_TOTAL
27
+ """
28
+
29
+ self.extra = PT_EXTRA(conn, module_id, port_id)
30
+ """Extra TX statistics on the L23 port.
31
+ Representation of PT_EXTRA
32
+ """
33
+
34
+ self.no_tpld = PT_NOTPLD(conn, module_id, port_id)
35
+ """TX statistics of packets without TPLD on the L23 port.
36
+ Representation of PT_NOTPLD
37
+ """
38
+
39
+ self.clear = PT_CLEAR(conn, module_id, port_id)
40
+ """Clear TX statistics on the L23 port.
41
+ Representation of PT_CLEAR
42
+ """
43
+
44
+ def obtain_from_stream(self, stream: Union[int, "GenuineStreamIdx"]) -> "PT_STREAM":
45
+ """Obtain statistics of packets of a specific stream on a L23 port.
46
+
47
+ :param stream: stream object
48
+ :type stream: Union[int, "GenuineStreamIdx"]
49
+ :return: statistics of packets of a specific stream on a L23 port
50
+ :rtype: PT_STREAM
51
+ """
52
+
53
+ stream_idx = stream if isinstance(stream, int) else stream.kind.index_id
54
+ return PT_STREAM(
55
+ self.__conn,
56
+ self.__module_id,
57
+ self.__port_id,
58
+ stream_idx
59
+ )
@@ -0,0 +1,15 @@
1
+ from typing import NoReturn, TypeVar
2
+ from xoa_driver.internals.commands.enums import FilterType
3
+
4
+ T = TypeVar("T")
5
+
6
+
7
+ def prevent_set(inst: T, filter_type: FilterType = FilterType.WORKING) -> T:
8
+ METHOD_NAME = "set"
9
+
10
+ def _set(*args, **kwargs) -> NoReturn:
11
+ raise Exception(f"Method {METHOD_NAME} is not allowed")
12
+
13
+ if filter_type is FilterType.WORKING and hasattr(inst, METHOD_NAME):
14
+ setattr(inst, METHOD_NAME, _set)
15
+ return inst
@@ -0,0 +1,340 @@
1
+ from typing import (
2
+ Dict,
3
+ Tuple,
4
+ Type,
5
+ TypeVar,
6
+ TYPE_CHECKING
7
+ )
8
+ if TYPE_CHECKING:
9
+ from xoa_driver.internals.core import interfaces as itf
10
+ from xoa_driver.internals.commands.enums import (
11
+ FilterType,
12
+ FilterVlanType,
13
+ ProtocolOption,
14
+ FilterMode,
15
+ )
16
+ from xoa_driver.internals.commands import (
17
+ PEF_ETHSETTINGS,
18
+ PEF_ETHSRCADDR,
19
+ PEF_ETHDESTADDR,
20
+ PEF_L2PUSE,
21
+ PEF_VLANSETTINGS,
22
+ PEF_VLANTAG,
23
+ PEF_VLANPCP,
24
+ PEF_MPLSSETTINGS,
25
+ PEF_MPLSLABEL,
26
+ PEF_MPLSTOC,
27
+ PEF_L3USE,
28
+ PEF_IPV4SETTINGS,
29
+ PEF_IPV4SRCADDR,
30
+ PEF_IPV4DESTADDR,
31
+ PEF_IPV4DSCP,
32
+ PEF_IPV6SETTINGS,
33
+ PEF_IPV6SRCADDR,
34
+ PEF_IPV6DESTADDR,
35
+ PEF_IPV6TC,
36
+ PEF_UDPSETTINGS,
37
+ PEF_UDPSRCPORT,
38
+ PEF_UDPDESTPORT,
39
+ PEF_TCPSETTINGS,
40
+ PEF_TCPSRCPORT,
41
+ PEF_TCPDESTPORT,
42
+ PEF_ANYSETTINGS,
43
+ PEF_ANYCONFIG,
44
+ PEF_TPLDSETTINGS,
45
+ PEF_TPLDCONFIG,
46
+ # PEF_ISSHADOWDIRTY, #TODO: need to implement
47
+ # PEF_CANCEL, #TODO: need to implement
48
+ PEF_VALUE,
49
+ PEF_MASK,
50
+ PEF_PROTOCOL,
51
+ PEF_MODE,
52
+ )
53
+ from ._utils import prevent_set
54
+
55
+
56
+ class FEthernet:
57
+ """Filter for Ethernet field."""
58
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
59
+ self.settings = prevent_set(PEF_ETHSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
60
+ """Filter action on Ethernet field.
61
+ Representation of PEF_ETHSETTINGS
62
+ """
63
+ self.src_address = prevent_set(PEF_ETHSRCADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
64
+ """Ethernet source address settings for the filter.
65
+ Representation of PEF_ETHSRCADDR
66
+ """
67
+ self.dest_address = prevent_set(PEF_ETHDESTADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
68
+ """Ethernet destination address settings for the filter.
69
+ Representation of PEF_ETHDESTADDR
70
+ """
71
+
72
+
73
+ class FPerVlanType:
74
+ """Filter for VLAN tag."""
75
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType, vlan_type: FilterVlanType) -> None:
76
+ self.tag = prevent_set(PEF_VLANTAG(conn, module_id, port_id, flow_index, filter_type, vlan_type), filter_type)
77
+ """VLAN tag setting for the filter.
78
+ Representation of PEF_VLANTAG
79
+ """
80
+ self.pcp = prevent_set(PEF_VLANPCP(conn, module_id, port_id, flow_index, filter_type, vlan_type), filter_type)
81
+ """VLAN PCP setting for the filter.
82
+ Representation of PEF_VLANPCP
83
+ """
84
+
85
+
86
+ class FVlan:
87
+ """Filter for VLAN field."""
88
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
89
+ self.settings = prevent_set(PEF_VLANSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
90
+ """Filter action on VLAN field.
91
+ Representation of PEF_VLANSETTINGS
92
+ """
93
+
94
+ self.inner = FPerVlanType(conn, module_id, port_id, flow_index, filter_type, FilterVlanType.INNER)
95
+ """Filter for inner VLAN tag."""
96
+
97
+ self.outer = FPerVlanType(conn, module_id, port_id, flow_index, filter_type, FilterVlanType.OUTER)
98
+ """Filter for outer VLAN tag."""
99
+
100
+
101
+ class FUdp:
102
+ """Filer for UDP field."""
103
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
104
+ self.settings = prevent_set(PEF_UDPSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
105
+ """Filter action on UDP field.
106
+ Representation of PEF_UDPSETTINGS
107
+ """
108
+ self.src_port = prevent_set(PEF_UDPSRCPORT(conn, module_id, port_id, flow_index, filter_type), filter_type)
109
+ """UDP source port settings for the filter.
110
+ Representation of PEF_UDPSRCPORT
111
+ """
112
+ self.dest_port = prevent_set(PEF_UDPDESTPORT(conn, module_id, port_id, flow_index, filter_type), filter_type)
113
+ """UDP destination port settings for the filter.
114
+ Representation of PEF_UDPDESTPORT
115
+ """
116
+
117
+
118
+ class FTcp:
119
+ """Filter for TCP."""
120
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
121
+ self.settings = prevent_set(PEF_TCPSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
122
+ """Filter action on TCP field.
123
+ Representation of PEF_TCPSETTINGS
124
+ """
125
+ self.src_port = prevent_set(PEF_TCPSRCPORT(conn, module_id, port_id, flow_index, filter_type), filter_type)
126
+ """TCP source port settings for the filter.
127
+ Representation of PEF_TCPSRCPORT
128
+ """
129
+ self.dest_port = prevent_set(PEF_TCPDESTPORT(conn, module_id, port_id, flow_index, filter_type), filter_type)
130
+ """TCP destination port settings for the filter.
131
+ Representation of PEF_TCPDESTPORT
132
+ """
133
+
134
+
135
+ class FIPv4:
136
+ """Filter for IPv4 field."""
137
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
138
+ self.settings = prevent_set(PEF_IPV4SETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
139
+ """Filter action on IPv4 field.
140
+ Representation of PEF_IPV4SETTINGS
141
+ """
142
+ self.src_address = prevent_set(PEF_IPV4SRCADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
143
+ """IPv4 source address settings for the filter.
144
+ Representation of PEF_IPV4SRCADDR
145
+ """
146
+ self.dest_address = prevent_set(PEF_IPV4DESTADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
147
+ """IPv4 destination address settings for the filter.
148
+ Representation of PEF_IPV4DESTADDR
149
+ """
150
+ self.dscp = prevent_set(PEF_IPV4DSCP(conn, module_id, port_id, flow_index, filter_type), filter_type)
151
+ """IPv4 DSCP/TOS settings for the filter.
152
+ Representation of PEF_IPV4DSCP
153
+ """
154
+
155
+
156
+ class FIPv6:
157
+ """Filter for IPv6 field."""
158
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
159
+ self.settings = prevent_set(PEF_IPV6SETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
160
+ """Filter action on IPv6 field.
161
+ Representation of PEF_IPV6SETTINGS
162
+ """
163
+ self.src_address = prevent_set(PEF_IPV6SRCADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
164
+ """IPv6 source address settings for the filter.
165
+ Representation of PEF_IPV6SRCADDR
166
+ """
167
+ self.dest_address = prevent_set(PEF_IPV6DESTADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
168
+ """IPv6 destination address settings for the filter.
169
+ Representation of PEF_IPV6DESTADDR
170
+ """
171
+ self.traffic_class = prevent_set(PEF_IPV6TC(conn, module_id, port_id, flow_index, filter_type), filter_type)
172
+ """IPv6 traffic class settings for the filter.
173
+ Representation of PEF_IPV6TC
174
+ """
175
+
176
+
177
+ class FIp:
178
+ """Filter for IP field."""
179
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
180
+ self.v4 = FIPv4(conn, module_id, port_id, flow_index, filter_type)
181
+ """Filter for IPv4 field."""
182
+
183
+ self.v6 = FIPv6(conn, module_id, port_id, flow_index, filter_type)
184
+ """Filter for IPv6 field."""
185
+
186
+
187
+ class FMpls:
188
+ """Filter for MPLS field."""
189
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
190
+ self.settings = prevent_set(PEF_MPLSSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
191
+ """Filter action on MPLS field.
192
+ Representation of PEF_MPLSSETTINGS
193
+ """
194
+ self.label = prevent_set(PEF_MPLSLABEL(conn, module_id, port_id, flow_index, filter_type), filter_type)
195
+ """MPLS label settings for the filter.
196
+ Representation of PEF_MPLSLABEL
197
+ """
198
+ self.toc = prevent_set(PEF_MPLSTOC(conn, module_id, port_id, flow_index, filter_type), filter_type)
199
+ """"MPLS TOC settings for the filter.
200
+ Representation of PEF_MPLSTOC
201
+ """
202
+
203
+
204
+ class FTpld:
205
+ """Filter for Xena TPLD field."""
206
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
207
+ self.settings = prevent_set(PEF_TPLDSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
208
+ """Filter action on Xena TPLD field.
209
+ Representation of PEF_TPLDSETTINGS
210
+ """
211
+
212
+ self.test_payload_filters_config = tuple(
213
+ prevent_set(PEF_TPLDCONFIG(conn, module_id, port_id, flow_index, filter_type, test_payload_filter_index), filter_type)
214
+ for test_payload_filter_index in range(16) # range need to put to the constants place
215
+ )
216
+ """TPLD filter configurations.
217
+ Representation of PEF_TPLDCONFIG
218
+ """
219
+
220
+
221
+ class FAny:
222
+ """Filter for any field."""
223
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
224
+ self.settings = prevent_set(PEF_ANYSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
225
+ """Filter action on any field.
226
+ Representation of PEF_ANYSETTINGS
227
+ """
228
+ self.config = prevent_set(PEF_ANYCONFIG(conn, module_id, port_id, flow_index, filter_type), filter_type)
229
+ """Any field's filter configurations.
230
+ Representation of PEF_ANYCONFIG
231
+ """
232
+
233
+
234
+ class ModeBasic:
235
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
236
+ self.l2plus_use = prevent_set(PEF_L2PUSE(conn, module_id, port_id, flow_index, filter_type), filter_type)
237
+ """L2 protocol to use.
238
+ Representation of PEF_L2PUSE
239
+ """
240
+ self.l3_use = prevent_set(PEF_L3USE(conn, module_id, port_id, flow_index, filter_type), filter_type)
241
+ """L3 protocol to use.
242
+ Representation of PEF_L3USE
243
+ """
244
+ self.any = FAny(conn, module_id, port_id, flow_index, filter_type)
245
+ """Filter for any field."""
246
+
247
+ self.tpld = FTpld(conn, module_id, port_id, flow_index, filter_type)
248
+ """Filter for Xena TPLD field."""
249
+
250
+ self.mpls = FMpls(conn, module_id, port_id, flow_index, filter_type)
251
+ """Filter for MPLS field."""
252
+
253
+ self.ip = FIp(conn, module_id, port_id, flow_index, filter_type)
254
+ """Filter for IP field."""
255
+
256
+ self.tcp = FTcp(conn, module_id, port_id, flow_index, filter_type)
257
+ """Filter for TCP field."""
258
+
259
+ self.udp = FUdp(conn, module_id, port_id, flow_index, filter_type)
260
+ """Filter for UDP field."""
261
+
262
+ self.vlan = FVlan(conn, module_id, port_id, flow_index, filter_type)
263
+ """Filter for VLAN field."""
264
+
265
+ self.ethernet = FEthernet(conn, module_id, port_id, flow_index, filter_type)
266
+ """Filter for Ethernet field."""
267
+
268
+
269
+ class ProtocolSegment:
270
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType, protocol_segment_index: int, segment_type: ProtocolOption) -> None: # noqa: E501
271
+ self.segment_type = segment_type
272
+
273
+ self.value = prevent_set(PEF_VALUE(conn, module_id, port_id, flow_index, filter_type, protocol_segment_index), filter_type)
274
+ """Value bytes match for the filter.
275
+ Representation of PEF_VALUE
276
+ """
277
+ self.mask = prevent_set(PEF_MASK(conn, module_id, port_id, flow_index, filter_type, protocol_segment_index), filter_type)
278
+ """Mask byte value.
279
+ Representation of PEF_MASK
280
+ """
281
+
282
+
283
+ class ModeExtended:
284
+ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
285
+ self._conn = conn
286
+ self._module_id = module_id
287
+ self._port_id = port_id
288
+ self._flow_index = flow_index
289
+ self._filter_type = filter_type
290
+
291
+ # self.protocol = prevent_set(PEF_PROTOCOL(conn, module_id, port_id, flow_index, filter_type))
292
+ # """Protocol segments match for the filter.
293
+ # Representation of PEF_PROTOCOL
294
+ # """
295
+
296
+ async def get_protocol_segments(self) -> Tuple[ProtocolSegment, ...]:
297
+ segments_raw = (
298
+ await PEF_PROTOCOL(
299
+ self._conn,
300
+ self._module_id,
301
+ self._port_id,
302
+ self._flow_index,
303
+ self._filter_type
304
+ ).get()
305
+ ).segment_list
306
+ return tuple(
307
+ ProtocolSegment(
308
+ self._conn,
309
+ self._module_id,
310
+ self._port_id,
311
+ self._flow_index,
312
+ self._filter_type,
313
+ idx + 1, # TODO: need to discuss with Leo
314
+ ProtocolOption(segment_type)
315
+ )
316
+ for idx, segment_type in enumerate(segments_raw)
317
+ )
318
+
319
+
320
+ T = TypeVar("T")
321
+
322
+
323
+ async def get_mode(conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType, mode_types: Dict[FilterMode, Type[T]]) -> T:
324
+ mode_raw = (
325
+ await PEF_MODE(
326
+ conn,
327
+ module_id,
328
+ port_id,
329
+ flow_index,
330
+ filter_type,
331
+ ).get()
332
+ ).mode
333
+ mode_type = mode_types[FilterMode(mode_raw)]
334
+ return mode_type(
335
+ conn,
336
+ module_id,
337
+ port_id,
338
+ flow_index,
339
+ filter_type,
340
+ )