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,2311 @@
1
+ from __future__ import annotations
2
+ from dataclasses import dataclass
3
+ import ipaddress
4
+ import typing
5
+ import functools
6
+
7
+ from xoa_driver.internals.core.builders import (
8
+ build_get_request,
9
+ build_set_request
10
+ )
11
+ from xoa_driver.internals.core import interfaces
12
+ from xoa_driver.internals.core.token import Token
13
+ from xoa_driver.internals.core.transporter.registry import register_command
14
+ from xoa_driver.internals.core.transporter.protocol.payload import (
15
+ field,
16
+ RequestBodyStruct,
17
+ ResponseBodyStruct,
18
+ XmpByte,
19
+ XmpHex,
20
+ XmpInt,
21
+ XmpIPv4Address,
22
+ XmpIPv6Address,
23
+ XmpLong,
24
+ XmpMacAddress,
25
+ XmpSequence,
26
+ XmpStr,
27
+ Hex,
28
+ )
29
+ from .enums import (
30
+ OnOff,
31
+ OnOffWithSuppress,
32
+ ProtocolOption,
33
+ ModifierAction,
34
+ LengthType,
35
+ PayloadType,
36
+ PFCMode,
37
+ StreamOption,
38
+ ModifierEndianness,
39
+ )
40
+
41
+
42
+ @register_command
43
+ @dataclass
44
+ class PS_INDICES:
45
+ """
46
+ The full list of which streams are defined for a port. These are the sub-index
47
+ values that are used for the parameters defining the traffic patterns
48
+ transmitted for the port. Setting the value of this command creates a new
49
+ empty stream for each value that is not already in use, and deletes each stream
50
+ that is not mentioned in the list. The same can be accomplished one-stream-at-a-
51
+ time using the :class:`PS_CREATE` and :class:`PS_DELETE` commands.
52
+ """
53
+
54
+ code: typing.ClassVar[int] = 150
55
+ pushed: typing.ClassVar[bool] = True
56
+
57
+ _connection: 'interfaces.IConnection'
58
+ _module: int
59
+ _port: int
60
+
61
+ class GetDataAttr(ResponseBodyStruct):
62
+ stream_indices: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
63
+ """list of integers, the sub-indices of streams on the port."""
64
+
65
+ class SetDataAttr(RequestBodyStruct):
66
+ stream_indices: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
67
+ """list of integers, the sub-indices of streams on the port."""
68
+
69
+ def get(self) -> Token[GetDataAttr]:
70
+ """Get the full list of which streams are defined for a port.
71
+
72
+ :return: the sub-indices of streams on the port
73
+ :rtype: PS_INDICES.GetDataAttr
74
+ """
75
+
76
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port))
77
+
78
+ def set(self, stream_indices: typing.List[int]) -> Token[None]:
79
+ """Creates a new empty stream for each value that is not already in use, and deletes each stream that is not mentioned in the list.
80
+
81
+ :param stream_indices: the sub-indices of streams on the port
82
+ :type stream_indices: typing.List[int]
83
+ """
84
+
85
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, stream_indices=stream_indices))
86
+
87
+
88
+ @register_command
89
+ @dataclass
90
+ class PS_CREATE:
91
+ """
92
+ Creates an empty stream definition with the specified sub-index value.
93
+ """
94
+
95
+ code: typing.ClassVar[int] = 151
96
+ pushed: typing.ClassVar[bool] = False
97
+
98
+ _connection: 'interfaces.IConnection'
99
+ _module: int
100
+ _port: int
101
+ _stream_xindex: int
102
+
103
+ class SetDataAttr(RequestBodyStruct):
104
+ pass
105
+
106
+ def set(self) -> Token[None]:
107
+ """Creates an empty stream definition with the specified sub-index value.
108
+ """
109
+
110
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
111
+
112
+
113
+ @register_command
114
+ @dataclass
115
+ class PS_DELETE:
116
+ """
117
+ Deletes the stream definition with the specified sub-index value.
118
+ """
119
+
120
+ code: typing.ClassVar[int] = 152
121
+ pushed: typing.ClassVar[bool] = False
122
+
123
+ _connection: 'interfaces.IConnection'
124
+ _module: int
125
+ _port: int
126
+ _stream_xindex: int
127
+
128
+ class SetDataAttr(RequestBodyStruct):
129
+ pass
130
+
131
+ def set(self) -> Token[None]:
132
+ """Deletes the stream definition with the specified sub-index value.
133
+ """
134
+
135
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
136
+
137
+
138
+ @register_command
139
+ @dataclass
140
+ class PS_ENABLE:
141
+ """
142
+ This property determines if a stream contributes outgoing packets for a port.
143
+ The value can be toggled between ON and SUPPRESS while traffic is enabled at the
144
+ port level. Streams in the OFF state cannot be set to any other value while
145
+ traffic is enabled. The sum of the rates of all enabled or suppressed streams
146
+ must not exceed the effective port rate.
147
+ """
148
+
149
+ code: typing.ClassVar[int] = 153
150
+ pushed: typing.ClassVar[bool] = True
151
+
152
+ _connection: 'interfaces.IConnection'
153
+ _module: int
154
+ _port: int
155
+ _stream_xindex: int
156
+
157
+ class GetDataAttr(ResponseBodyStruct):
158
+ state: OnOffWithSuppress = field(XmpByte())
159
+ """coded byte, specifying a stream state."""
160
+
161
+ class SetDataAttr(RequestBodyStruct):
162
+ state: OnOffWithSuppress = field(XmpByte())
163
+ """coded byte, specifying a stream state."""
164
+
165
+ def get(self) -> Token[GetDataAttr]:
166
+ """Get the stream status.
167
+
168
+ :return: status of the stream
169
+ :rtype: PS_ENABLE.GetDataAttr
170
+ """
171
+
172
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
173
+
174
+ def set(self, state: OnOffWithSuppress) -> Token[None]:
175
+ """Set the stream status. The value can be toggled between ON and SUPPRESS while traffic is enabled at the
176
+ port level. Streams in the OFF state cannot be set to any other value while
177
+ traffic is enabled. The sum of the rates of all enabled or suppressed streams
178
+ must not exceed the effective port rate.
179
+
180
+ :param state: a stream state
181
+ :type state: OnOffWithSuppress
182
+ """
183
+
184
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], state=state))
185
+
186
+ set_off = functools.partialmethod(set, OnOffWithSuppress.OFF)
187
+ """Set the stream status to OFF.
188
+ """
189
+
190
+ set_on = functools.partialmethod(set, OnOffWithSuppress.ON)
191
+ """Set the stream status to ON.
192
+ """
193
+
194
+ set_suppress = functools.partialmethod(set, OnOffWithSuppress.SUPPRESS)
195
+ """Set the stream status to SUPPRESS.
196
+ """
197
+
198
+
199
+ @register_command
200
+ @dataclass
201
+ class PS_PACKETLIMIT:
202
+ """
203
+ Based on different port transmission mode, the meaning of this API is different.
204
+ When Port TX Mode is set to NORMAL, STRICT UNIFORM or BURST: The number of
205
+ packets that will be transmitted when traffic is started on a port. A value of 0
206
+ or -1 makes the stream transmit continuously. When Port TX Mode is set to
207
+ SEQUENTIAL: The number of sequential packets sent before switching to the next
208
+ stream. The minimum value is 1. The port will transmit continuously until the
209
+ user stops the traffic.
210
+ """
211
+
212
+ code: typing.ClassVar[int] = 154
213
+ pushed: typing.ClassVar[bool] = True
214
+
215
+ _connection: 'interfaces.IConnection'
216
+ _module: int
217
+ _port: int
218
+ _stream_xindex: int
219
+
220
+ class GetDataAttr(ResponseBodyStruct):
221
+ packet_count: int = field(XmpInt())
222
+ """integer, the number of packets that the port will send. When Port TX Mode is set to NORMAL, STRICT UNIFORM or BURST: 0 or -1 (disable packet limitation).
223
+ When Port TX Mode is set to SEQUENTIAL: 1 or larger (minimum value since the port transmits at least 1 packet per stream per round).
224
+ """
225
+
226
+ class SetDataAttr(RequestBodyStruct):
227
+ packet_count: int = field(XmpInt())
228
+ """integer, the number of packets that the port will send. When Port TX Mode is set to NORMAL, STRICT UNIFORM or BURST: 0 or -1 (disable packet limitation).
229
+ When Port TX Mode is set to SEQUENTIAL: 1 or larger (minimum value since the port transmits at least 1 packet per stream per round).
230
+ """
231
+
232
+ def get(self) -> Token[GetDataAttr]:
233
+ """If Port TX Mode is NORMAL, STRICT UNIFORM or BURST: get the number of packets that will be transmitted when traffic is started on a port.
234
+ If Port TX Mode is SEQUENTIAL: get the number of sequential packets sent before switching to the next stream.
235
+
236
+ :return: the number of packets
237
+ :rtype: PS_PACKETLIMIT.GetDataAttr
238
+ """
239
+
240
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
241
+
242
+ def set(self, packet_count: int) -> Token[None]:
243
+ """If Port TX Mode is NORMAL, STRICT UNIFORM or BURST: set the number of packets that will be transmitted when traffic is started on a port,
244
+ 0 or -1 (disable packet limitation).
245
+ If Port TX Mode is SEQUENTIAL: set the number of sequential packets sent before switching to the next stream,
246
+ 1 or larger (minimum value since the port transmits at least 1 packet per stream per round).
247
+
248
+ :param packet_count: the number of packets
249
+ :type packet_count: int
250
+ """
251
+
252
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], packet_count=packet_count))
253
+
254
+
255
+ @register_command
256
+ @dataclass
257
+ class PS_COMMENT:
258
+ """
259
+ The description of a stream.
260
+ """
261
+
262
+ code: typing.ClassVar[int] = 155
263
+ pushed: typing.ClassVar[bool] = True
264
+
265
+ _connection: 'interfaces.IConnection'
266
+ _module: int
267
+ _port: int
268
+ _stream_xindex: int
269
+
270
+ class GetDataAttr(ResponseBodyStruct):
271
+ comment: str = field(XmpStr())
272
+ """string, specifying the description of the stream."""
273
+
274
+ class SetDataAttr(RequestBodyStruct):
275
+ comment: str = field(XmpStr())
276
+ """string, specifying the description of the stream."""
277
+
278
+ def get(self) -> Token[GetDataAttr]:
279
+ """Get the description of a stream.
280
+
281
+ :return: the description of the stream
282
+ :rtype: PS_COMMENT.GetDataAttr
283
+ """
284
+
285
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
286
+
287
+ def set(self, comment: str) -> Token[None]:
288
+ """Set the description of a stream.
289
+
290
+ :param comment: the description of the stream
291
+ :type comment: str
292
+ """
293
+
294
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], comment=comment))
295
+
296
+
297
+ @register_command
298
+ @dataclass
299
+ class PS_TPLDID:
300
+ """
301
+ The identifier of the test payloads inserted into packets transmitted for a
302
+ stream. A value of -1 disables test payloads for the stream. Test payloads are
303
+ inserted at the end of each packet, and contains time-stamp and sequence-number
304
+ information. This allows the receiving port to provide error-checking and
305
+ latency measurements, in addition to the basic counts and rate measurements
306
+ provided for all traffic. The test payload identifier furthermore allows the
307
+ receiving port to distinguish multiple different streams, which may originate
308
+ from multiple different chassis. Since test payloads are an inter-port and
309
+ inter-chassis mechanism, the test payload identifier assignments should be
310
+ planned globally across all the chassis and ports of the testbed.
311
+ """
312
+
313
+ code: typing.ClassVar[int] = 157
314
+ pushed: typing.ClassVar[bool] = True
315
+
316
+ _connection: 'interfaces.IConnection'
317
+ _module: int
318
+ _port: int
319
+ _stream_xindex: int
320
+
321
+ class GetDataAttr(ResponseBodyStruct):
322
+ test_payload_identifier: int = field(XmpInt())
323
+ """integer, the test payload identifier value. -1 = disable test payloads."""
324
+
325
+ class SetDataAttr(RequestBodyStruct):
326
+ test_payload_identifier: int = field(XmpInt())
327
+ """integer, the test payload identifier value. -1 = disable test payloads."""
328
+
329
+ def get(self) -> Token[GetDataAttr]:
330
+ """Get the identifier of the test payloads inserted into packets transmitted for a stream.
331
+
332
+ :return: the test payload identifier value. -1 = disable test payloads.
333
+ :rtype: PS_TPLDID.GetDataAttr
334
+ """
335
+
336
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
337
+
338
+ def set(self, test_payload_identifier: int) -> Token[None]:
339
+ """Set the identifier of the test payloads inserted into packets transmitted for a stream.
340
+ A value of -1 disables test payloads for the stream. Test payloads are
341
+ inserted at the end of each packet, and contains time-stamp and sequence-number
342
+ information.
343
+
344
+ :param test_payload_identifier: the test payload identifier value. -1 = disable test payloads
345
+ :type test_payload_identifier: int
346
+ """
347
+
348
+ return Token(
349
+ self._connection,
350
+ build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], test_payload_identifier=test_payload_identifier)
351
+ )
352
+
353
+
354
+ @register_command
355
+ @dataclass
356
+ class PS_INSERTFCS:
357
+ """
358
+ Whether a valid frame checksum is added to the packets of a stream.
359
+ """
360
+
361
+ code: typing.ClassVar[int] = 158
362
+ pushed: typing.ClassVar[bool] = True
363
+
364
+ _connection: 'interfaces.IConnection'
365
+ _module: int
366
+ _port: int
367
+ _stream_xindex: int
368
+
369
+ class GetDataAttr(ResponseBodyStruct):
370
+ on_off: OnOff = field(XmpByte())
371
+ """coded byte, whether frame checksums are inserted."""
372
+
373
+ class SetDataAttr(RequestBodyStruct):
374
+ on_off: OnOff = field(XmpByte())
375
+ """coded byte, whether frame checksums are inserted."""
376
+
377
+ def get(self) -> Token[GetDataAttr]:
378
+ """Get whether a valid frame checksum is added to the packets of a stream.
379
+
380
+ :return: whether frame checksums are inserted
381
+ :rtype: PS_INSERTFCS.GetDataAttr
382
+ """
383
+
384
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
385
+
386
+ def set(self, on_off: OnOff) -> Token[None]:
387
+ """Set whether a valid frame checksum is added to the packets of a stream.
388
+
389
+ :param on_off: whether frame checksums are inserted
390
+ :type on_off: OnOff
391
+ """
392
+
393
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], on_off=on_off))
394
+
395
+ set_off = functools.partialmethod(set, OnOff.OFF)
396
+ """Disable a valid frame checksum to be added to the packets of a stream.
397
+ """
398
+
399
+ set_on = functools.partialmethod(set, OnOff.ON)
400
+ """Enable a valid frame checksum to be added to the packets of a stream.
401
+ """
402
+
403
+
404
+ @register_command
405
+ @dataclass
406
+ class PS_AUTOADJUST:
407
+ """
408
+ .. versionadded:: v2.0
409
+
410
+ Executing PS_AUTOADJUST will adjust the packet length distribution (:class:`PS_PACKETLENGTH`) of the stream:
411
+
412
+ (1) Set the type of packet length distribution (:class:`PS_PACKETLENGTH` ``<length_type>``) to ``FIXED``.
413
+
414
+ (2) Set the lower limit on the packet length (:class:`PS_PACKETLENGTH` ``<min_val>``) to exactly fit the specified protocol headers,
415
+ TPLD and FCS (but never set to less than 64).
416
+
417
+ (3) Set the payload type of packets transmitted for the stream (:class:`PS_PAYLOAD` ``<payload_type>``) to ``PATTERN``.
418
+
419
+ (4) If necessary, also set the maximum number of header content bytes (`P_MAXHEADERLENGTH <p_maxheaderlength_label>` ``<max_header_length>``)
420
+ that can be freely specified for each generated stream of the port to a higher value, if needed to accommodate the header size of the stream
421
+ (implicitly given by the `PS_PACKETHEADER` command).
422
+
423
+ (5) If the needed maximum header length (`P_MAXHEADERLENGTH <p_maxheaderlength_label>` ``<max_header_length>``)
424
+ is not possible with the actual number of active streams for the port, the command will fail with :`<BADVALUE>`.
425
+ """
426
+
427
+ code: typing.ClassVar[int] = 159
428
+ pushed: typing.ClassVar[bool] = False
429
+
430
+ _connection: 'interfaces.IConnection'
431
+ _module: int
432
+ _port: int
433
+ _stream_xindex: int
434
+
435
+ class SetDataAttr(RequestBodyStruct):
436
+ pass
437
+
438
+ def set(self) -> Token[None]:
439
+ """Adjust the packet length distribution of a stream.
440
+ """
441
+
442
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
443
+
444
+
445
+ @register_command
446
+ @dataclass
447
+ class PS_ARPREQUEST:
448
+ """
449
+ Generates an outgoing ARP request on the test port. The packet header for the
450
+ stream must contain an IP protocol segment, and the destination IP address is
451
+ used in the ARP request. If there is a gateway IP address specified for the port
452
+ and it is on a different subnet than the destination IP address in the packet
453
+ header, then the gateway IP address is used instead. The framing of the ARP
454
+ request matches the packet header, including any VLAN protocol segments. This
455
+ command does not generate an immediate result, but waits until an ARP
456
+ reply is received on the test port. If no reply is received within 500
457
+ milliseconds, it returns.
458
+ """
459
+
460
+ code: typing.ClassVar[int] = 161
461
+ pushed: typing.ClassVar[bool] = False
462
+
463
+ _connection: 'interfaces.IConnection'
464
+ _module: int
465
+ _port: int
466
+ _stream_xindex: int
467
+
468
+ class GetDataAttr(ResponseBodyStruct):
469
+ mac_address: Hex = field(XmpMacAddress())
470
+ """six hex bytes, specifying the six bytes of the MAC address."""
471
+
472
+ def get(self) -> Token[GetDataAttr]:
473
+ """Generates an outgoing ARP request on the test port. The packet header for the
474
+ stream must contain an IP protocol segment, and the destination IP address is
475
+ used in the ARP request. If there is a gateway IP address specified for the port
476
+ and it is on a different subnet than the destination IP address in the packet
477
+ header, then the gateway IP address is used instead. The framing of the ARP
478
+ request matches the packet header, including any VLAN protocol segments. This
479
+ command does not generate an immediate result, but waits until an ARP
480
+ reply is received on the test port. If no reply is received within 500
481
+ milliseconds, it returns.
482
+
483
+ :return: the MAC address of the peer port
484
+ :rtype: PS_ARPREQUEST.GetDataAttr
485
+ """
486
+
487
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
488
+
489
+
490
+ @register_command
491
+ @dataclass
492
+ class PS_PINGREQUEST:
493
+ """
494
+ Generates an outgoing ping request using the ICMP protocol on the test port. The
495
+ packet header for the stream must contain an IP protocol segment, with valid
496
+ source and destination IP addresses. The framing of the ping request matches the
497
+ packet header, including any VLAN protocol segments, and the destination MAC
498
+ address must also be valid, possibly containing a value obtained with
499
+ PS_ARPREQUEST. This command does not generate an immediate result, but
500
+ waits until a ping reply is received on the test port.
501
+ """
502
+
503
+ code: typing.ClassVar[int] = 162
504
+ pushed: typing.ClassVar[bool] = False
505
+
506
+ _connection: 'interfaces.IConnection'
507
+ _module: int
508
+ _port: int
509
+ _stream_xindex: int
510
+
511
+ class GetDataAttr(ResponseBodyStruct):
512
+ delay: int = field(XmpInt())
513
+ """integer, the number of milliseconds for the ping reply to arrive."""
514
+ time_to_live: int = field(XmpByte())
515
+ """byte, the time-to-live value in the ping reply packet."""
516
+
517
+ def get(self) -> Token[GetDataAttr]:
518
+ """Generates an outgoing ping request using the ICMP protocol on the test port. The
519
+ packet header for the stream must contain an IP protocol segment, with valid
520
+ source and destination IP addresses. The framing of the ping request matches the
521
+ packet header, including any VLAN protocol segments, and the destination MAC
522
+ address must also be valid, possibly containing a value obtained with
523
+ PS_ARPREQUEST. This command does not generate an immediate result, but
524
+ waits until a ping reply is received on the test port.
525
+
526
+ :return: the number of milliseconds for the ping reply to arrive, and the time-to-live value in the ping reply packet.
527
+ :rtype: PS_PINGREQUEST.GetDataAttr
528
+ """
529
+
530
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
531
+
532
+
533
+ @register_command
534
+ @dataclass
535
+ class PS_MODIFIEREXTRANGE:
536
+ """
537
+ Range specification for an extended packet modifier for a stream header,
538
+ specifying which values the modifier should take on. This applies only to
539
+ incrementing and decrementing modifiers; random modifiers always produce every
540
+ possible bit pattern. The range is specified as a three values: mix, step, and
541
+ max, where max must be equal to min plus a multiple of step. Note that when
542
+ "decrement" is specified in PS_MODIFIEREXT as the action, the value sequence
543
+ will begin with the max value instead of the min value and decrement from there:
544
+ {max, max-1, max-2, ...., min, max, max-1...}.
545
+ """
546
+
547
+ code: typing.ClassVar[int] = 167
548
+ pushed: typing.ClassVar[bool] = True
549
+
550
+ _connection: 'interfaces.IConnection'
551
+ _module: int
552
+ _port: int
553
+ _stream_xindex: int
554
+ _modifier_xindex: int
555
+
556
+ class GetDataAttr(ResponseBodyStruct):
557
+ min_val: int = field(XmpInt())
558
+ """integer, the minimum modifier value."""
559
+ step: int = field(XmpInt())
560
+ """integer, the increment between modifier values."""
561
+ max_val: int = field(XmpInt())
562
+ """integer, the maximum modifier value."""
563
+
564
+ class SetDataAttr(RequestBodyStruct):
565
+ min_val: int = field(XmpInt())
566
+ """integer, the minimum modifier value."""
567
+ step: int = field(XmpInt())
568
+ """integer, the increment between modifier values."""
569
+ max_val: int = field(XmpInt())
570
+ """integer, the maximum modifier value."""
571
+
572
+ def get(self) -> Token[GetDataAttr]:
573
+ """Get the range specification for an extended packet modifier for a stream header,
574
+ specifying which values the modifier should take on.
575
+
576
+ :return: the minimum modifier value, the increment between modifier values, the maximum modifier value.
577
+ :rtype: PS_MODIFIEREXTRANGE.GetDataAttr
578
+ """
579
+
580
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex, self._modifier_xindex]))
581
+
582
+ def set(self, min_val: int, step: int, max_val: int) -> Token[None]:
583
+ """Set the range specification for an extended packet modifier for a stream header,
584
+ specifying which values the modifier should take on. This applies only to
585
+ incrementing and decrementing modifiers; random modifiers always produce every
586
+ possible bit pattern. The range is specified as a three values: mix, step, and
587
+ max, where max must be equal to min plus a multiple of step. Note that when
588
+ "decrement" is specified in PS_MODIFIEREXT as the action, the value sequence
589
+ will begin with the max value instead of the min value and decrement from there:
590
+ {max, max-1, max-2, ...., min, max, max-1...}.
591
+
592
+ :param min_val: the minimum modifier value
593
+ :type min_val: int
594
+ :param step: the increment between modifier values
595
+ :type step: int
596
+ :param max_val: the maximum modifier value
597
+ :type max_val: int
598
+ """
599
+
600
+ return Token(
601
+ self._connection,
602
+ build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex, self._modifier_xindex], min_val=min_val, step=step, max_val=max_val)
603
+ )
604
+
605
+
606
+ @register_command
607
+ @dataclass
608
+ class PS_MODIFIERRANGE:
609
+ """
610
+ Range specification for a packet modifier for a stream header, specifying which
611
+ values the modifier should take on. This applies only to incrementing and
612
+ decrementing modifiers; random modifiers always produce every possible bit
613
+ pattern. The range is specified as three values: mix, step, and max, where max
614
+ must be equal to min plus a multiple of step. Note that when "decrement" is
615
+ specified in PS_MODIFIER as the action, the value sequence will begin with the
616
+ max value instead of the min value and decrement from there: {max, max-1, max-2,
617
+ ...., min, max, max-1...}.
618
+ """
619
+
620
+ code: typing.ClassVar[int] = 168
621
+ pushed: typing.ClassVar[bool] = True
622
+
623
+ _connection: 'interfaces.IConnection'
624
+ _module: int
625
+ _port: int
626
+ _stream_xindex: int
627
+ _modifier_xindex: int
628
+
629
+ class GetDataAttr(ResponseBodyStruct):
630
+ min_val: int = field(XmpInt())
631
+ """integer, the minimum modifier value."""
632
+ step: int = field(XmpInt())
633
+ """integer, the increment between modifier values."""
634
+ max_val: int = field(XmpInt())
635
+ """integer, the maximum modifier value."""
636
+
637
+ class SetDataAttr(RequestBodyStruct):
638
+ min_val: int = field(XmpInt())
639
+ """integer, the minimum modifier value."""
640
+ step: int = field(XmpInt())
641
+ """integer, the increment between modifier values."""
642
+ max_val: int = field(XmpInt())
643
+ """integer, the maximum modifier value."""
644
+
645
+ def get(self) -> Token[GetDataAttr]:
646
+ """Get the range specification for a packet modifier for a stream header, specifying which values the modifier should take on.
647
+
648
+ :return: the minimum modifier value, the increment between modifier values, the maximum modifier value.
649
+ :rtype: PS_MODIFIERRANGE.GetDataAttr
650
+ """
651
+
652
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex, self._modifier_xindex]))
653
+
654
+ def set(self, min_val: int, step: int, max_val: int) -> Token[None]:
655
+ """Set the range specification for a packet modifier for a stream header, specifying which
656
+ values the modifier should take on. This applies only to incrementing and
657
+ decrementing modifiers; random modifiers always produce every possible bit
658
+ pattern. The range is specified as three values: mix, step, and max, where max
659
+ must be equal to min plus a multiple of step. Note that when "decrement" is
660
+ specified in PS_MODIFIER as the action, the value sequence will begin with the
661
+ max value instead of the min value and decrement from there: {max, max-1, max-2,
662
+ ...., min, max, max-1...}.
663
+
664
+ :param min_val: the minimum modifier value
665
+ :type min_val: int
666
+ :param step: the increment between modifier values
667
+ :type step: int
668
+ :param max_val: the maximum modifier value
669
+ :type max_val: int
670
+ """
671
+
672
+ return Token(
673
+ self._connection,
674
+ build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex, self._modifier_xindex], min_val=min_val, step=step, max_val=max_val)
675
+ )
676
+
677
+
678
+ @register_command
679
+ @dataclass
680
+ class PS_RATEFRACTION:
681
+ """
682
+ The rate of the traffic transmitted for a stream expressed in millionths of the
683
+ effective rate for the port. The bandwidth consumption includes the inter-frame
684
+ gap and is independent of the length of the packets generated for the stream.
685
+ The sum of the bandwidth consumption for all the enabled streams must not exceed
686
+ the effective rate for the port. Setting this command also instructs the
687
+ Manager to attempt to keep the rate-percentage unchanged in case it has to cap
688
+ stream rates. Get value is only valid if the rate was last set using this
689
+ command.
690
+ """
691
+
692
+ code: typing.ClassVar[int] = 169
693
+ pushed: typing.ClassVar[bool] = True
694
+
695
+ _connection: 'interfaces.IConnection'
696
+ _module: int
697
+ _port: int
698
+ _stream_xindex: int
699
+
700
+ class GetDataAttr(ResponseBodyStruct):
701
+ stream_rate_ppm: int = field(XmpInt())
702
+ """integer, stream rate expressed as a ppm value between 0 and 1,000,000."""
703
+
704
+ class SetDataAttr(RequestBodyStruct):
705
+ stream_rate_ppm: int = field(XmpInt())
706
+ """integer, stream rate expressed as a ppm value between 0 and 1,000,000."""
707
+
708
+ def get(self) -> Token[GetDataAttr]:
709
+ """Get the rate of the traffic transmitted for a stream expressed in millionths of the
710
+ effective rate for the port. Get value is only valid if the rate was last set using this
711
+ command.
712
+
713
+ :return: stream rate expressed as a ppm value between 0 and 1,000,000
714
+ :rtype: PS_RATEFRACTION.GetDataAttr
715
+ """
716
+
717
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
718
+
719
+ def set(self, stream_rate_ppm: int) -> Token[None]:
720
+ """Set the rate of the traffic transmitted for a stream expressed in millionths of the
721
+ effective rate for the port. The bandwidth consumption includes the inter-frame
722
+ gap and is independent of the length of the packets generated for the stream.
723
+ The sum of the bandwidth consumption for all the enabled streams must not exceed
724
+ the effective rate for the port. Setting this command also instructs the
725
+ Manager to attempt to keep the rate-percentage unchanged in case it has to cap
726
+ stream rates.
727
+
728
+ :param stream_rate_ppm: stream rate expressed as a ppm value between 0 and 1,000,000.
729
+ :type stream_rate_ppm: int
730
+ """
731
+
732
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], stream_rate_ppm=stream_rate_ppm))
733
+
734
+
735
+ @register_command
736
+ @dataclass
737
+ class PS_RATEPPS:
738
+ """
739
+ The rate of the traffic transmitted for a stream expressed in packets per
740
+ second. The bandwidth consumption is heavily dependent on the length of the
741
+ packets generated for the stream, and also on the inter-frame gap for the port.
742
+ The sum of the bandwidth consumption for all the enabled streams must not exceed
743
+ the effective rate for the port. Setting this command also instructs the
744
+ Manager to attempt to keep the packets-per-second unchanged in case it has to
745
+ cap stream rates. Get value is only valid if the rate was the last set using
746
+ this command.
747
+ """
748
+
749
+ code: typing.ClassVar[int] = 170
750
+ pushed: typing.ClassVar[bool] = False
751
+
752
+ _connection: 'interfaces.IConnection'
753
+ _module: int
754
+ _port: int
755
+ _stream_xindex: int
756
+
757
+ class GetDataAttr(ResponseBodyStruct):
758
+ stream_rate_pps: int = field(XmpInt())
759
+ """integer, stream rate expressed in packets per second."""
760
+
761
+ class SetDataAttr(RequestBodyStruct):
762
+ stream_rate_pps: int = field(XmpInt())
763
+ """integer, stream rate expressed in packets per second."""
764
+
765
+ def get(self) -> Token[GetDataAttr]:
766
+ """Get The rate of the traffic transmitted for a stream expressed in packets per
767
+ second. Get value is only valid if the rate was the last set using
768
+ this command.
769
+
770
+ :return: stream rate expressed in packets per second
771
+ :rtype: PS_RATEPPS.GetDataAttr
772
+ """
773
+
774
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
775
+
776
+ def set(self, stream_rate_pps: int) -> Token[None]:
777
+ """Set The rate of the traffic transmitted for a stream expressed in packets per
778
+ second. The bandwidth consumption is heavily dependent on the length of the
779
+ packets generated for the stream, and also on the inter-frame gap for the port.
780
+ The sum of the bandwidth consumption for all the enabled streams must not exceed
781
+ the effective rate for the port. Setting this command also instructs the
782
+ Manager to attempt to keep the packets-per-second unchanged in case it has to
783
+ cap stream rates.
784
+
785
+ :param stream_rate_pps: stream rate expressed in packets per second
786
+ :type stream_rate_pps: int
787
+ """
788
+
789
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], stream_rate_pps=stream_rate_pps))
790
+
791
+
792
+ @register_command
793
+ @dataclass
794
+ class PS_RATEL2BPS:
795
+ """
796
+ The rate of the traffic transmitted for a stream, expressed in units of bits-
797
+ per-second at layer-2, thus including the Ethernet header but excluding the
798
+ inter-frame gap. The bandwidth consumption is somewhat dependent on the length
799
+ of the packets generated for the stream, and also on the inter-frame gap for the
800
+ port. The sum of the bandwidth consumption for all the enabled streams must not
801
+ exceed the effective rate for the port. Setting this command also instructs
802
+ the Manager to attempt to keep the layer-2 bps rate unchanged in case it has to
803
+ cap stream rates. Get value is only valid if the rate was the last set using
804
+ this command.
805
+ """
806
+
807
+ code: typing.ClassVar[int] = 171
808
+ pushed: typing.ClassVar[bool] = False
809
+
810
+ _connection: 'interfaces.IConnection'
811
+ _module: int
812
+ _port: int
813
+ _stream_xindex: int
814
+
815
+ class GetDataAttr(ResponseBodyStruct):
816
+ l2_bps: int = field(XmpLong())
817
+ """long integer, stream rate expressed in bits per second."""
818
+
819
+ class SetDataAttr(RequestBodyStruct):
820
+ l2_bps: int = field(XmpLong())
821
+ """long integer, stream rate expressed in bits per second."""
822
+
823
+ def get(self) -> Token[GetDataAttr]:
824
+ """Get the rate of the traffic transmitted for a stream, expressed in units of bits-
825
+ per-second at layer-2, thus including the Ethernet header but excluding the
826
+ inter-frame gap. Get value is only valid if the rate was the last set using
827
+ this command.
828
+
829
+ :return: stream rate expressed in bits per second
830
+ :rtype: PS_RATEL2BPS.GetDataAttr
831
+ """
832
+
833
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
834
+
835
+ def set(self, l2_bps: int) -> Token[None]:
836
+ """Set the rate of the traffic transmitted for a stream, expressed in units of bits-
837
+ per-second at layer-2, thus including the Ethernet header but excluding the
838
+ inter-frame gap. The bandwidth consumption is somewhat dependent on the length
839
+ of the packets generated for the stream, and also on the inter-frame gap for the
840
+ port. The sum of the bandwidth consumption for all the enabled streams must not
841
+ exceed the effective rate for the port. Setting this command also instructs
842
+ the Manager to attempt to keep the layer-2 bps rate unchanged in case it has to
843
+ cap stream rates.
844
+
845
+ :param l2_bps: stream rate expressed in bits per second
846
+ :type l2_bps: int
847
+ """
848
+
849
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], l2_bps=l2_bps))
850
+
851
+
852
+ @register_command
853
+ @dataclass
854
+ class PS_BURST:
855
+ """
856
+ The burstiness of the traffic transmitted for a stream, expressed in terms of
857
+ the number of packets in each burst, and how densely they are packed together.
858
+ The burstiness does not affect the bandwidth consumed by the stream, only the
859
+ spacing between the packets. A density value of 100 means that the packets are
860
+ packed tightly together, only spaced by the minimum inter-frame gap. A value of
861
+ 0 means even, non-bursty, spacing. The exact spacing achieved depends on the
862
+ other enabled streams of the port.
863
+ """
864
+
865
+ code: typing.ClassVar[int] = 174
866
+ pushed: typing.ClassVar[bool] = True
867
+
868
+ _connection: 'interfaces.IConnection'
869
+ _module: int
870
+ _port: int
871
+ _stream_xindex: int
872
+
873
+ class GetDataAttr(ResponseBodyStruct):
874
+ size: int = field(XmpInt())
875
+ """integer, the number of packets lumped together in a burst."""
876
+ density: int = field(XmpInt())
877
+ """integer, the percentage of the available spacing that is inserted between bursts."""
878
+
879
+ class SetDataAttr(RequestBodyStruct):
880
+ size: int = field(XmpInt())
881
+ """integer, the number of packets lumped together in a burst."""
882
+ density: int = field(XmpInt())
883
+ """integer, the percentage of the available spacing that is inserted between bursts."""
884
+
885
+ def get(self) -> Token[GetDataAttr]:
886
+ """Get the burstiness of the traffic transmitted for a stream, expressed in terms of
887
+ the number of packets in each burst, and how densely they are packed together.
888
+
889
+ :return: the number of packets lumped together in a burst, and the percentage of the available spacing that is inserted between bursts
890
+ :rtype: ~PS_BURST.GetDataAttr
891
+ """
892
+
893
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
894
+
895
+ def set(self, size: int, density: int) -> Token[None]:
896
+ """Set the burstiness of the traffic transmitted for a stream, expressed in terms of
897
+ the number of packets in each burst, and how densely they are packed together.
898
+ The burstiness does not affect the bandwidth consumed by the stream, only the
899
+ spacing between the packets. A density value of 100 means that the packets are
900
+ packed tightly together, only spaced by the minimum inter-frame gap. A value of
901
+ 0 means even, non-bursty, spacing. The exact spacing achieved depends on the
902
+ other enabled streams of the port.
903
+
904
+ :param size: the number of packets lumped together in a burst
905
+ :type size: int
906
+ :param density: the percentage of the available spacing that is inserted between bursts
907
+ :type density: int
908
+ """
909
+
910
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], size=size, density=density))
911
+
912
+
913
+ @register_command
914
+ @dataclass
915
+ class PS_PACKETHEADER:
916
+ """
917
+ The first portion of the packet bytes that are transmitted for a stream. This
918
+ starts with the 14 bytes of the Ethernet header, followed by any contained
919
+ protocol segments. All packets transmitted for the stream start with this fixed
920
+ header. Individual byte positions of the packet header may be varied on a
921
+ packet-to-packet basis using modifiers. The full packet comprises the header,
922
+ the payload, an optional test payload, and the frame checksum. The header data
923
+ is specified as raw bytes, since the script environment does not know the field-
924
+ by-field layout of the various protocol segments.
925
+ """
926
+
927
+ code: typing.ClassVar[int] = 175
928
+ pushed: typing.ClassVar[bool] = True
929
+
930
+ _connection: 'interfaces.IConnection'
931
+ _module: int
932
+ _port: int
933
+ _stream_xindex: int
934
+
935
+ class GetDataAttr(ResponseBodyStruct):
936
+ hex_data: Hex = field(XmpHex())
937
+ """list of hex bytes, the raw bytes comprising the packet header."""
938
+
939
+ class SetDataAttr(RequestBodyStruct):
940
+ hex_data: Hex = field(XmpHex())
941
+ """list of hex bytes, the raw bytes comprising the packet header."""
942
+
943
+ def get(self) -> Token[GetDataAttr]:
944
+ """Get the packet header of a stream. This
945
+ starts with the 14 bytes of the Ethernet header, followed by any contained
946
+ protocol segments. All packets transmitted for the stream start with this fixed
947
+ header. Individual byte positions of the packet header may be varied on a
948
+ packet-to-packet basis using modifiers. The full packet comprises the header,
949
+ the payload, an optional test payload, and the frame checksum. The header data
950
+ is specified as raw bytes, since the script environment does not know the field-
951
+ by-field layout of the various protocol segments.
952
+
953
+ :return: the raw bytes comprising the packet header
954
+ :rtype: PS_PACKETHEADER.GetDataAttr
955
+ """
956
+
957
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
958
+
959
+ def set(self, hex_data: Hex) -> Token[None]:
960
+ """Set the packet header of a stream. This
961
+ starts with the 14 bytes of the Ethernet header, followed by any contained
962
+ protocol segments. All packets transmitted for the stream start with this fixed
963
+ header. Individual byte positions of the packet header may be varied on a
964
+ packet-to-packet basis using modifiers. The full packet comprises the header,
965
+ the payload, an optional test payload, and the frame checksum. The header data
966
+ is specified as raw bytes, since the script environment does not know the field-
967
+ by-field layout of the various protocol segments.
968
+
969
+ :param hex_data: the raw bytes comprising the packet header
970
+ :type hex_data: Hex
971
+ """
972
+
973
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], hex_data=hex_data))
974
+
975
+
976
+ @register_command
977
+ @dataclass
978
+ class PS_HEADERPROTOCOL:
979
+ """
980
+ This command will inform the Xena tester how to interpret the packet header
981
+ byte sequence specified with PS_PACKETHEADER. This is mainly for information
982
+ purposes, and the stream will transmit the packet header bytes even if no
983
+ protocol segments are specified. The Xena tester however support calculation of
984
+ certain field values in hardware, such as the IP, TCP and UDP length and
985
+ checksum fields. This allow the use of hardware modifiers for these protocol
986
+ segments. In order for this function to work the Xena tester needs to know the
987
+ type of each segment that precedes the segment where the hardware calculation is
988
+ to be performed.
989
+ """
990
+
991
+ code: typing.ClassVar[int] = 176
992
+ pushed: typing.ClassVar[bool] = True
993
+
994
+ _connection: 'interfaces.IConnection'
995
+ _module: int
996
+ _port: int
997
+ _stream_xindex: int
998
+
999
+ class GetDataAttr(ResponseBodyStruct):
1000
+ segments: typing.List[ProtocolOption] = field(XmpSequence(types_chunk=[XmpByte()]))
1001
+ """list of coded bytes, a number specifying a built-in protocol segment."""
1002
+
1003
+ class SetDataAttr(RequestBodyStruct):
1004
+ segments: typing.List[ProtocolOption] = field(XmpSequence(types_chunk=[XmpByte()]))
1005
+ """list of coded bytes, a number specifying a built-in protocol segment."""
1006
+
1007
+ def get(self) -> Token[GetDataAttr]:
1008
+ """Get the packet header segments in protocol names.
1009
+
1010
+ :return: a number specifying a built-in protocol segment
1011
+ :rtype: PS_HEADERPROTOCOL.GetDataAttr
1012
+ """
1013
+
1014
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1015
+
1016
+ def set(self, segments: typing.List[ProtocolOption]) -> Token[None]:
1017
+ """Inform the Xena tester how to interpret the packet header
1018
+ byte sequence specified with PS_PACKETHEADER. This is mainly for information
1019
+ purposes, and the stream will transmit the packet header bytes even if no
1020
+ protocol segments are specified. The Xena tester however support calculation of
1021
+ certain field values in hardware, such as the IP, TCP and UDP length and
1022
+ checksum fields. This allow the use of hardware modifiers for these protocol
1023
+ segments. In order for this function to work the Xena tester needs to know the
1024
+ type of each segment that precedes the segment where the hardware calculation is
1025
+ to be performed.
1026
+
1027
+ :param segments: a number specifying a built-in protocol segment
1028
+ :type segments: typing.List[ProtocolOption]
1029
+ """
1030
+
1031
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], segments=segments))
1032
+
1033
+
1034
+ @register_command
1035
+ @dataclass
1036
+ class PS_MODIFIERCOUNT:
1037
+ """
1038
+ The number of standard 16-bit modifiers active on the packet header of a stream.
1039
+ Each modifier is specified using PS_MODIFIER.
1040
+ """
1041
+
1042
+ code: typing.ClassVar[int] = 177
1043
+ pushed: typing.ClassVar[bool] = True
1044
+
1045
+ _connection: 'interfaces.IConnection'
1046
+ _module: int
1047
+ _port: int
1048
+ _stream_xindex: int
1049
+
1050
+ class GetDataAttr(ResponseBodyStruct):
1051
+ modifier_count: int = field(XmpInt())
1052
+ """integer, the number of modifiers for the stream."""
1053
+
1054
+ class SetDataAttr(RequestBodyStruct):
1055
+ modifier_count: int = field(XmpInt())
1056
+ """integer, the number of modifiers for the stream."""
1057
+
1058
+ def get(self) -> Token[GetDataAttr]:
1059
+ """Get the number of standard 16-bit modifiers active on the packet header of a stream.
1060
+ Each modifier is specified using PS_MODIFIER.
1061
+
1062
+ :return: the number of modifiers for the stream
1063
+ :rtype: PS_MODIFIERCOUNT.GetDataAttr
1064
+ """
1065
+
1066
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1067
+
1068
+ def set(self, modifier_count: int) -> Token[None]:
1069
+ """Set the number of standard 16-bit modifiers active on the packet header of a stream.
1070
+ Each modifier is specified using PS_MODIFIER.
1071
+
1072
+ :param modifier_count: the number of modifiers for the stream
1073
+ :type modifier_count: int
1074
+ """
1075
+
1076
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], modifier_count=modifier_count))
1077
+
1078
+
1079
+ @register_command
1080
+ @dataclass
1081
+ class PS_MODIFIER:
1082
+ """
1083
+ A packet modifier for a stream header. The headers of each packet transmitted
1084
+ for the stream will be varied according to the modifier specification. This
1085
+ command requires two sub-indices, one for the stream and one for the modifier.
1086
+ A modifier is positioned at a fixed place in the header, selects a number of
1087
+ consecutive bits starting from that position, and applies an action to those
1088
+ bits in each packet. Packets can be repeated so that a certain number of
1089
+ identical packets are transmitted before applying the next modification.
1090
+ """
1091
+
1092
+ code: typing.ClassVar[int] = 178
1093
+ pushed: typing.ClassVar[bool] = True
1094
+
1095
+ _connection: 'interfaces.IConnection'
1096
+ _module: int
1097
+ _port: int
1098
+ _stream_xindex: int
1099
+ _modifier_xindex: int
1100
+
1101
+ class GetDataAttr(ResponseBodyStruct):
1102
+ position: int = field(XmpInt())
1103
+ """integer, the byte position from the start of the packet."""
1104
+ mask: Hex = field(XmpHex(size=4))
1105
+ """four hex bytes, the mask specifying which bits to affect."""
1106
+ action: ModifierAction = field(XmpInt())
1107
+ """coded integer, which action to perform on the affected bits."""
1108
+ repetition: int = field(XmpInt())
1109
+ """integer, how many times to repeat on each packet."""
1110
+
1111
+ class SetDataAttr(RequestBodyStruct):
1112
+ position: int = field(XmpInt())
1113
+ """integer, the byte position from the start of the packet."""
1114
+ mask: Hex = field(XmpHex(size=4))
1115
+ """four hex bytes, the mask specifying which bits to affect."""
1116
+ action: ModifierAction = field(XmpInt())
1117
+ """coded integer, which action to perform on the affected bits."""
1118
+ repetition: int = field(XmpInt())
1119
+ """integer, how many times to repeat on each packet."""
1120
+
1121
+ def get(self) -> Token[GetDataAttr]:
1122
+ """Get a packet modifier for a stream header. The headers of each packet transmitted
1123
+ for the stream will be varied according to the modifier specification. This
1124
+ command requires two sub-indices, one for the stream and one for the modifier.
1125
+ A modifier is positioned at a fixed place in the header, selects a number of
1126
+ consecutive bits starting from that position, and applies an action to those
1127
+ bits in each packet. Packets can be repeated so that a certain number of
1128
+ identical packets are transmitted before applying the next modification.
1129
+
1130
+ :return: the byte position from the start of the packet, the mask specifying which bits to affect, which action to perform on the affected bits,
1131
+ and how many times to repeat on each packet
1132
+ :rtype: PS_MODIFIER.GetDataAttr
1133
+ """
1134
+
1135
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex, self._modifier_xindex]))
1136
+
1137
+ def set(self, position: int, mask: Hex, action: ModifierAction, repetition: int) -> Token[None]:
1138
+ """Set a packet modifier for a stream header. The headers of each packet transmitted
1139
+ for the stream will be varied according to the modifier specification. This
1140
+ command requires two sub-indices, one for the stream and one for the modifier.
1141
+ A modifier is positioned at a fixed place in the header, selects a number of
1142
+ consecutive bits starting from that position, and applies an action to those
1143
+ bits in each packet. Packets can be repeated so that a certain number of
1144
+ identical packets are transmitted before applying the next modification.
1145
+
1146
+ :param position: the byte position from the start of the packet
1147
+ :type position: int
1148
+ :param mask: the mask specifying which bits to affect
1149
+ :type mask: str
1150
+ :param action: which action to perform on the affected bits
1151
+ :type action: ModifierAction
1152
+ :param repetition: how many times to repeat on each packet
1153
+ :type repetition: int
1154
+ """
1155
+
1156
+ return Token(
1157
+ self._connection,
1158
+ build_set_request(
1159
+ self,
1160
+ module=self._module,
1161
+ port=self._port,
1162
+ indices=[self._stream_xindex, self._modifier_xindex],
1163
+ position=position,
1164
+ mask=mask,
1165
+ action=action,
1166
+ repetition=repetition
1167
+ )
1168
+ )
1169
+
1170
+ set_inc = functools.partialmethod(set, action=ModifierAction.INC)
1171
+ """Set a packet modifier action to incrementing.
1172
+ """
1173
+
1174
+ set_dec = functools.partialmethod(set, action=ModifierAction.DEC)
1175
+ """Set a packet modifier action to decrementing.
1176
+ """
1177
+
1178
+ set_random = functools.partialmethod(set, action=ModifierAction.RANDOM)
1179
+ """Set a packet modifier action to random.
1180
+ """
1181
+
1182
+
1183
+ @register_command
1184
+ @dataclass
1185
+ class PS_PACKETLENGTH:
1186
+ """
1187
+ The length distribution of the packets transmitted for a stream. The length of
1188
+ the packets transmitted for a stream can be varied from packet to packet,
1189
+ according to a choice of distributions within a specified min...max range. The
1190
+ length of each packet is reflected in the size of the payload portion of the
1191
+ packet, whereas the header has constant length. Length variation complements,
1192
+ and is independent of, the content variation produced by header modifiers.
1193
+ """
1194
+
1195
+ code: typing.ClassVar[int] = 179
1196
+ pushed: typing.ClassVar[bool] = True
1197
+
1198
+ _connection: 'interfaces.IConnection'
1199
+ _module: int
1200
+ _port: int
1201
+ _stream_xindex: int
1202
+
1203
+ class GetDataAttr(ResponseBodyStruct):
1204
+ length_type: LengthType = field(XmpInt())
1205
+ """coded integer, the kind of distribution of packet length."""
1206
+ min_val: int = field(XmpInt())
1207
+ """integer, lower limit on the packet length."""
1208
+ max_val: int = field(XmpInt())
1209
+ """integer, upper limit on the packet length."""
1210
+
1211
+ class SetDataAttr(RequestBodyStruct):
1212
+ length_type: LengthType = field(XmpInt())
1213
+ """coded integer, the kind of distribution of packet length."""
1214
+ min_val: int = field(XmpInt())
1215
+ """integer, lower limit on the packet length."""
1216
+ max_val: int = field(XmpInt())
1217
+ """integer, upper limit on the packet length."""
1218
+
1219
+ def get(self) -> Token[GetDataAttr]:
1220
+ """Get the length distribution of the packets transmitted for a stream. The length of
1221
+ the packets transmitted for a stream can be varied from packet to packet,
1222
+ according to a choice of distributions within a specified min..max range. The
1223
+ length of each packet is reflected in the size of the payload portion of the
1224
+ packet, whereas the header has constant length. Length variation complements,
1225
+ and is independent of, the content variation produced by header modifiers.
1226
+
1227
+ :return: the kind of distribution of packet length, lower limit on the packet length, and upper limit on the packet length.
1228
+ :rtype: PS_PACKETLENGTH.GetDataAttr
1229
+ """
1230
+
1231
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1232
+
1233
+ def set(self, length_type: LengthType, min_val: int, max_val: int) -> Token[None]:
1234
+ """Set the length distribution of the packets transmitted for a stream. The length of
1235
+ the packets transmitted for a stream can be varied from packet to packet,
1236
+ according to a choice of distributions within a specified min..max range. The
1237
+ length of each packet is reflected in the size of the payload portion of the
1238
+ packet, whereas the header has constant length. Length variation complements,
1239
+ and is independent of, the content variation produced by header modifiers.
1240
+
1241
+ :param length_type: the kind of distribution of packet length
1242
+ :type length_type: LengthType
1243
+ :param min_val: lower limit on the packet length
1244
+ :type min_val: int
1245
+ :param max_val: upper limit on the packet length
1246
+ :type max_val: int
1247
+ """
1248
+
1249
+ return Token(
1250
+ self._connection,
1251
+ build_set_request(
1252
+ self,
1253
+ module=self._module,
1254
+ port=self._port,
1255
+ indices=[self._stream_xindex],
1256
+ length_type=length_type,
1257
+ min_val=min_val,
1258
+ max_val=max_val
1259
+ )
1260
+ )
1261
+
1262
+ set_fixed = functools.partialmethod(set, LengthType.FIXED)
1263
+ """Set the packet length distribution to Fixed.
1264
+ """
1265
+
1266
+ set_incrementing = functools.partialmethod(set, LengthType.INCREMENTING)
1267
+ """Set the packet length distribution to Incrementing. Length per packet: {min, min+1, min+2,
1268
+ ...., max-2, max-1, max...}.
1269
+ """
1270
+
1271
+ set_butterfly = functools.partialmethod(set, LengthType.BUTTERFLY)
1272
+ """Set the packet length distribution to Butterfly. Length per packet: {min, max, min+1, max-1, min+2, max-2,
1273
+ ...}.
1274
+ """
1275
+
1276
+ set_random = functools.partialmethod(set, LengthType.RANDOM)
1277
+ """Set the packet length distribution to Random.
1278
+ """
1279
+
1280
+ set_mix = functools.partialmethod(set, LengthType.MIX)
1281
+ """Set the packet length distribution to Mix.
1282
+ """
1283
+
1284
+
1285
+ @register_command
1286
+ @dataclass
1287
+ class PS_PAYLOAD:
1288
+ """
1289
+ The payload content of the packets transmitted for a stream. The payload portion
1290
+ of a packet starts after the header and continues up until the test payload or
1291
+ the frame checksum. The payload may vary in length and is filled with either an
1292
+ incrementing sequence of byte values or a repeated multi-byte pattern. Length
1293
+ variation complements and is independent of the content variation produced by
1294
+ header modifiers.
1295
+ """
1296
+
1297
+ code: typing.ClassVar[int] = 180
1298
+ pushed: typing.ClassVar[bool] = True
1299
+
1300
+ _connection: 'interfaces.IConnection'
1301
+ _module: int
1302
+ _port: int
1303
+ _stream_xindex: int
1304
+
1305
+ class GetDataAttr(ResponseBodyStruct):
1306
+ payload_type: PayloadType = field(XmpByte())
1307
+ """coded byte, the kind of payload content."""
1308
+ hex_data: Hex = field(XmpHex())
1309
+ """list of hex bytes, a pattern of bytes to be repeated. The maximum length of the pattern is 18 bytes. Only used if the type is set to PATTERN."""
1310
+
1311
+ class SetDataAttr(RequestBodyStruct):
1312
+ payload_type: PayloadType = field(XmpByte())
1313
+ """coded byte, the kind of payload content."""
1314
+ hex_data: Hex = field(XmpHex())
1315
+ """list of hex bytes, a pattern of bytes to be repeated. The maximum length of the pattern is 18 bytes. Only used if the type is set to PATTERN."""
1316
+
1317
+ def get(self) -> Token[GetDataAttr]:
1318
+ """Get the payload content of the packets transmitted for a stream. The payload portion
1319
+ of a packet starts after the header and continues up until the test payload or
1320
+ the frame checksum. The payload may vary in length and is filled with either an
1321
+ incrementing sequence of byte values or a repeated multi-byte pattern. Length
1322
+ variation complements and is independent of the content variation produced by
1323
+ header modifiers.
1324
+
1325
+ :return: the kind of payload content, and a pattern of bytes to be repeated.
1326
+ :rtype: PS_PAYLOAD.GetDataAttr
1327
+ """
1328
+
1329
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1330
+
1331
+ def set(self, payload_type: PayloadType, hex_data: Hex) -> Token[None]:
1332
+ """Set the payload content of the packets transmitted for a stream. The payload portion
1333
+ of a packet starts after the header and continues up until the test payload or
1334
+ the frame checksum. The payload may vary in length and is filled with either an
1335
+ incrementing sequence of byte values or a repeated multi-byte pattern. Length
1336
+ variation complements and is independent of the content variation produced by
1337
+ header modifiers.
1338
+
1339
+ :param payload_type: the kind of payload content
1340
+ :type payload_type: PayloadType
1341
+ :param hex_data: a pattern of bytes to be repeated. The maximum length of the pattern is 18 bytes. Only used if the type is set to PATTERN.
1342
+ :type hex_data: Hex
1343
+ """
1344
+
1345
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], payload_type=payload_type, hex_data=hex_data))
1346
+
1347
+ set_pattern = functools.partialmethod(set, PayloadType.PATTERN)
1348
+ """Set payload type to the custom pattern.
1349
+ """
1350
+
1351
+ set_inc_byte = functools.partialmethod(set, PayloadType.INC8)
1352
+ """Set payload type to Incrementing 0xFF (8-bit mode).
1353
+ """
1354
+
1355
+ set_prbs = functools.partialmethod(set, PayloadType.PRBS)
1356
+ """Set payload type to PRBS.
1357
+ """
1358
+
1359
+ set_random = functools.partialmethod(set, PayloadType.RANDOM)
1360
+ """Set payload type to Random.
1361
+ """
1362
+
1363
+ set_dec_byte = functools.partialmethod(set, PayloadType.DEC8)
1364
+ """Set payload type to Decrementing 0xFF (8-bit mode).
1365
+ """
1366
+
1367
+ set_inc_word = functools.partialmethod(set, PayloadType.INC16)
1368
+ """Set payload type to Incrementing 0xFFFF (16-bit mode).
1369
+ """
1370
+
1371
+ set_dec_word = functools.partialmethod(set, PayloadType.DEC16)
1372
+ """Set payload type to Decrementing 0xFFFF (16-bit mode).
1373
+ """
1374
+
1375
+
1376
+ @register_command
1377
+ @dataclass
1378
+ class PS_IPV4GATEWAY:
1379
+ """
1380
+ An IPv4 gateway configuration specified for a stream.
1381
+ """
1382
+
1383
+ code: typing.ClassVar[int] = 181
1384
+ pushed: typing.ClassVar[bool] = True
1385
+
1386
+ _connection: 'interfaces.IConnection'
1387
+ _module: int
1388
+ _port: int
1389
+ _stream_xindex: int
1390
+
1391
+ class GetDataAttr(ResponseBodyStruct):
1392
+ gateway: ipaddress.IPv4Address = field(XmpIPv4Address())
1393
+ """address, the IPv4 gateway address of the stream."""
1394
+
1395
+ class SetDataAttr(RequestBodyStruct):
1396
+ gateway: ipaddress.IPv4Address = field(XmpIPv4Address())
1397
+ """address, IPv4 gateway address of the stream."""
1398
+
1399
+ def get(self) -> Token[GetDataAttr]:
1400
+ """Get the IPv4 gateway address of a stream.
1401
+
1402
+ :return: the IPv4 gateway address of the stream
1403
+ :rtype: PS_IPV4GATEWAY.GetDataAttr
1404
+ """
1405
+
1406
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1407
+
1408
+ def set(self, gateway: ipaddress.IPv4Address) -> Token[None]:
1409
+ """Set the IPv4 gateway address of a stream.
1410
+
1411
+ :param gateway: the IPv4 gateway address of the stream
1412
+ :type gateway: Union[str, ipaddress.IPv4Address, int]
1413
+ """
1414
+
1415
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], gateway=gateway))
1416
+
1417
+
1418
+ @register_command
1419
+ @dataclass
1420
+ class PS_IPV6GATEWAY:
1421
+ """
1422
+ An IPv6 gateway configuration specified for a stream.
1423
+ """
1424
+
1425
+ code: typing.ClassVar[int] = 182
1426
+ pushed: typing.ClassVar[bool] = True
1427
+
1428
+ _connection: 'interfaces.IConnection'
1429
+ _module: int
1430
+ _port: int
1431
+ _stream_xindex: int
1432
+
1433
+ class GetDataAttr(ResponseBodyStruct):
1434
+ gateway: ipaddress.IPv6Address = field(XmpIPv6Address())
1435
+ """address, the IPv6 gateway address of the stream."""
1436
+
1437
+ class SetDataAttr(RequestBodyStruct):
1438
+ gateway: ipaddress.IPv6Address = field(XmpIPv6Address())
1439
+ """address, IPv6 gateway address of the stream."""
1440
+
1441
+ def get(self) -> Token[GetDataAttr]:
1442
+ """Get the IPv6 gateway address of a stream.
1443
+
1444
+ :return: the IPv6 gateway address of the stream
1445
+ :rtype: PS_IPV6GATEWAY.GetDataAttr
1446
+ """
1447
+
1448
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1449
+
1450
+ def set(self, gateway: ipaddress.IPv6Address) -> Token[None]:
1451
+ """Set the IPv6 gateway address of a stream.
1452
+
1453
+ :param gateway: the IPv6 gateway address of the stream
1454
+ :type gateway: Union[str, ipaddress.IPv6Address, int]
1455
+ """
1456
+
1457
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], gateway=gateway))
1458
+
1459
+
1460
+ @register_command
1461
+ @dataclass
1462
+ class PS_BURSTGAP:
1463
+ """
1464
+ When the port is in in Burst TX mode, this command defines the gap between packets in a burst
1465
+ (inter-packet gap) and the gap after a burst defined in one stream stops until a
1466
+ burst defined in the next stream starts (inter-burst gap).
1467
+ """
1468
+
1469
+ code: typing.ClassVar[int] = 183
1470
+ pushed: typing.ClassVar[bool] = True
1471
+
1472
+ _connection: 'interfaces.IConnection'
1473
+ _module: int
1474
+ _port: int
1475
+ _stream_xindex: int
1476
+
1477
+ class GetDataAttr(ResponseBodyStruct):
1478
+ inter_packet_gap: int = field(XmpInt())
1479
+ """integer, Burst Inter Packet Gap (in bytes)."""
1480
+ inter_burst_gap: int = field(XmpInt())
1481
+ """integer, Inter Burst Gap (in bytes)."""
1482
+
1483
+ class SetDataAttr(RequestBodyStruct):
1484
+ inter_packet_gap: int = field(XmpInt())
1485
+ """integer, Burst Inter Packet Gap (in bytes)."""
1486
+ inter_burst_gap: int = field(XmpInt())
1487
+ """integer, Inter Burst Gap (in bytes)."""
1488
+
1489
+ def get(self) -> Token[GetDataAttr]:
1490
+ """Get the gap between packets in a burst (inter-packet gap) and the gap after a burst defined in one stream stops until a
1491
+ burst defined in the next stream starts (inter-burst gap).
1492
+
1493
+ :return: the gap between packets in a burst
1494
+ :rtype: PS_BURSTGAP.GetDataAttr
1495
+ """
1496
+
1497
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1498
+
1499
+ def set(self, inter_packet_gap: int, inter_burst_gap: int) -> Token[None]:
1500
+ """Set the gap between packets in a burst (inter-packet gap) and the gap after a burst defined in one stream stops until a
1501
+ burst defined in the next stream starts (inter-burst gap).
1502
+
1503
+ :param inter_packet_gap: Burst Inter Packet Gap (in bytes).
1504
+ :type inter_packet_gap: int
1505
+ :param inter_burst_gap: Inter Burst Gap (in bytes).
1506
+ :type inter_burst_gap: int
1507
+ """
1508
+
1509
+ return Token(
1510
+ self._connection,
1511
+ build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], inter_packet_gap=inter_packet_gap, inter_burst_gap=inter_burst_gap)
1512
+ )
1513
+
1514
+
1515
+ @register_command
1516
+ @dataclass
1517
+ class PS_INJECTFCSERR:
1518
+ """
1519
+ Force a frame checksum error in one of the packets currently being transmitted
1520
+ from a stream. This can aid in analyzing the error-detection functionality of
1521
+ the system under test. Traffic must be on for the port, and the stream must be
1522
+ enabled.
1523
+ """
1524
+
1525
+ code: typing.ClassVar[int] = 185
1526
+ pushed: typing.ClassVar[bool] = False
1527
+
1528
+ _connection: 'interfaces.IConnection'
1529
+ _module: int
1530
+ _port: int
1531
+ _stream_xindex: int
1532
+
1533
+ class SetDataAttr(RequestBodyStruct):
1534
+ pass
1535
+
1536
+ def set(self) -> Token[None]:
1537
+ """Set a frame checksum error in one of the packets currently being transmitted
1538
+ from a stream. This can aid in analyzing the error-detection functionality of
1539
+ the system under test. Traffic must be on for the port, and the stream must be
1540
+ enabled.
1541
+ """
1542
+
1543
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1544
+
1545
+
1546
+ @register_command
1547
+ @dataclass
1548
+ class PS_INJECTSEQERR:
1549
+ """
1550
+ Force a sequence error by skipping a test payload sequence number in one of the
1551
+ packets currently being transmitted from a stream. This can aid in analyzing the
1552
+ error-detection functionality of the system under test. Traffic must be on for
1553
+ the port, and the stream must be enabled and include test payloads.
1554
+ """
1555
+
1556
+ code: typing.ClassVar[int] = 186
1557
+ pushed: typing.ClassVar[bool] = False
1558
+
1559
+ _connection: 'interfaces.IConnection'
1560
+ _module: int
1561
+ _port: int
1562
+ _stream_xindex: int
1563
+
1564
+ class SetDataAttr(RequestBodyStruct):
1565
+ pass
1566
+
1567
+ def set(self) -> Token[None]:
1568
+ """Set a sequence error by skipping a test payload sequence number in one of the
1569
+ packets currently being transmitted from a stream. This can aid in analyzing the
1570
+ error-detection functionality of the system under test. Traffic must be on for
1571
+ the port, and the stream must be enabled and include test payloads.
1572
+ """
1573
+
1574
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1575
+
1576
+
1577
+ @register_command
1578
+ @dataclass
1579
+ class PS_INJECTMISERR:
1580
+ """
1581
+ Force a misorder error by swapping the test payload sequence numbers in two of
1582
+ the packets currently being transmitted from a stream. This can aid in analyzing
1583
+ the error-detection functionality of the system under test. Traffic must be on
1584
+ for the port, and the stream must be enabled and include test payloads.
1585
+ """
1586
+
1587
+ code: typing.ClassVar[int] = 187
1588
+ pushed: typing.ClassVar[bool] = False
1589
+
1590
+ _connection: 'interfaces.IConnection'
1591
+ _module: int
1592
+ _port: int
1593
+ _stream_xindex: int
1594
+
1595
+ class SetDataAttr(RequestBodyStruct):
1596
+ pass
1597
+
1598
+ def set(self) -> Token[None]:
1599
+ """Set a misorder error by swapping the test payload sequence numbers in two of
1600
+ the packets currently being transmitted from a stream. This can aid in analyzing
1601
+ the error-detection functionality of the system under test. Traffic must be on
1602
+ for the port, and the stream must be enabled and include test payloads.
1603
+ """
1604
+
1605
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1606
+
1607
+
1608
+ @register_command
1609
+ @dataclass
1610
+ class PS_INJECTPLDERR:
1611
+ """
1612
+ Force a payload integrity error in one of the packets currently being
1613
+ transmitted from a stream. Payload integrity validation is only available for
1614
+ incrementing payloads, and the error is created by changing a byte from the
1615
+ incrementing sequence. The packet will have a correct frame checksum, but the
1616
+ receiving Xena chassis will detect the invalid payload based on information in
1617
+ the test payload. Traffic must be on for the port, and the stream must be
1618
+ enabled and include test payloads.
1619
+ """
1620
+
1621
+ code: typing.ClassVar[int] = 188
1622
+ pushed: typing.ClassVar[bool] = False
1623
+
1624
+ _connection: 'interfaces.IConnection'
1625
+ _module: int
1626
+ _port: int
1627
+ _stream_xindex: int
1628
+
1629
+ class SetDataAttr(RequestBodyStruct):
1630
+ pass
1631
+
1632
+ def set(self) -> Token[None]:
1633
+ """Set a payload integrity error in one of the packets currently being
1634
+ transmitted from a stream. Payload integrity validation is only available for
1635
+ incrementing payloads, and the error is created by changing a byte from the
1636
+ incrementing sequence. The packet will have a correct frame checksum, but the
1637
+ receiving Xena chassis will detect the invalid payload based on information in
1638
+ the test payload. Traffic must be on for the port, and the stream must be
1639
+ enabled and include test payloads.
1640
+ """
1641
+
1642
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1643
+
1644
+
1645
+ @register_command
1646
+ @dataclass
1647
+ class PS_INJECTTPLDERR:
1648
+ """
1649
+ Force a test payload error in one of the packets currently being transmitted
1650
+ from a stream. This means that the test payload will not be recognized at the
1651
+ receiving port, so it will be counted as a no-test-payload packet, and there
1652
+ will be a lost packet for the stream. Traffic must be on for the port, and the
1653
+ stream must be enabled and include test payloads.
1654
+ """
1655
+
1656
+ code: typing.ClassVar[int] = 189
1657
+ pushed: typing.ClassVar[bool] = False
1658
+
1659
+ _connection: 'interfaces.IConnection'
1660
+ _module: int
1661
+ _port: int
1662
+ _stream_xindex: int
1663
+
1664
+ class SetDataAttr(RequestBodyStruct):
1665
+ pass
1666
+
1667
+ def set(self) -> Token[None]:
1668
+ """Set a test payload error in one of the packets currently being transmitted
1669
+ from a stream. This means that the test payload will not be recognized at the
1670
+ receiving port, so it will be counted as a no-test-payload packet, and there
1671
+ will be a lost packet for the stream. Traffic must be on for the port, and the
1672
+ stream must be enabled and include test payloads.
1673
+ """
1674
+
1675
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1676
+
1677
+
1678
+ @register_command
1679
+ @dataclass
1680
+ class PS_MODIFIEREXT:
1681
+ """
1682
+ An extended packet modifier for a stream header. The headers of each packet
1683
+ transmitted for the stream will be varied according to the modifier
1684
+ specification. The modifier acts on 32 bits and takes up the space for two
1685
+ 16-bit modifiers to do this. This command requires two sub-indices, one for
1686
+ the stream and one for the modifier. A modifier is positioned at a fixed place
1687
+ in the header, selects a number of consecutive bits starting from that position,
1688
+ and applies an action to those bits in each packet. Packets can be repeated so
1689
+ that a certain number of identical packets are transmitted before applying the
1690
+ next modification.
1691
+ """
1692
+
1693
+ code: typing.ClassVar[int] = 190
1694
+ pushed: typing.ClassVar[bool] = True
1695
+
1696
+ _connection: 'interfaces.IConnection'
1697
+ _module: int
1698
+ _port: int
1699
+ _stream_xindex: int
1700
+ _modifier_xindex: int
1701
+
1702
+ class GetDataAttr(ResponseBodyStruct):
1703
+ position: int = field(XmpInt())
1704
+ """integer, the byte position from the start of the packet. Cannot be < 1!"""
1705
+ mask: Hex = field(XmpHex(size=4))
1706
+ """four hex bytes, the mask specifying which bits to affect."""
1707
+ action: ModifierAction = field(XmpInt())
1708
+ """coded integer, which action to perform on the affected bits."""
1709
+ repetition: int = field(XmpInt())
1710
+ """integer, how many times to repeat on each packet. Note: For now the only value supported is 1."""
1711
+
1712
+ class SetDataAttr(RequestBodyStruct):
1713
+ position: int = field(XmpInt())
1714
+ """integer, the byte position from the start of the packet. Cannot be < 1!"""
1715
+ mask: Hex = field(XmpHex(size=4))
1716
+ """four hex bytes, the mask specifying which bits to affect."""
1717
+ action: ModifierAction = field(XmpInt())
1718
+ """coded integer, which action to perform on the affected bits."""
1719
+ repetition: int = field(XmpInt())
1720
+ """integer, how many times to repeat on each packet. Note: For now the only value supported is 1."""
1721
+
1722
+ def get(self) -> Token[GetDataAttr]:
1723
+ """Get an extended packet modifier for a stream header. The headers of each packet
1724
+ transmitted for the stream will be varied according to the modifier
1725
+ specification. The modifier acts on 24 bits and takes up the space for two
1726
+ 16-bit modifiers to do this. This command requires two sub-indices, one for
1727
+ the stream and one for the modifier. A modifier is positioned at a fixed place
1728
+ in the header, selects a number of consecutive bits starting from that position,
1729
+ and applies an action to those bits in each packet. Packets can be repeated so
1730
+ that a certain number of identical packets are transmitted before applying the
1731
+ next modification.
1732
+
1733
+ :return: the byte position from the start of the packet. Cannot be < 1!,
1734
+ the mask specifying which bits to affect, which action to perform on the affected bits,
1735
+ and how many times to repeat on each packet. Note: For now the only value supported is 1.
1736
+ :rtype: PS_MODIFIEREXT.GetDataAttr
1737
+ """
1738
+
1739
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex, self._modifier_xindex]))
1740
+
1741
+ def set(self, position: int, mask: Hex, action: ModifierAction, repetition: int) -> Token[None]:
1742
+ """Set an extended packet modifier for a stream header. The headers of each packet
1743
+ transmitted for the stream will be varied according to the modifier
1744
+ specification. The modifier acts on 24 bits and takes up the space for two
1745
+ 16-bit modifiers to do this. This command requires two sub-indices, one for
1746
+ the stream and one for the modifier. A modifier is positioned at a fixed place
1747
+ in the header, selects a number of consecutive bits starting from that position,
1748
+ and applies an action to those bits in each packet. Packets can be repeated so
1749
+ that a certain number of identical packets are transmitted before applying the
1750
+ next modification.
1751
+
1752
+ :param position: the byte position from the start of the packet. Cannot be < 1!
1753
+ :type position: int
1754
+ :param mask: the mask specifying which bits to affect
1755
+ :type mask: str
1756
+ :param action: which action to perform on the affected bits,
1757
+ :type action: ModifierAction
1758
+ :param repetition: how many times to repeat on each packet. Note: For now the only value supported is 1.
1759
+ :type repetition: int
1760
+ """
1761
+
1762
+ return Token(
1763
+ self._connection,
1764
+ build_set_request(
1765
+ self,
1766
+ module=self._module,
1767
+ port=self._port,
1768
+ indices=[self._stream_xindex, self._modifier_xindex],
1769
+ position=position,
1770
+ mask=mask,
1771
+ action=action,
1772
+ repetition=repetition
1773
+ )
1774
+ )
1775
+
1776
+ set_inc = functools.partialmethod(set, action=ModifierAction.INC)
1777
+ """Set modifier action to Incrementing.
1778
+ """
1779
+
1780
+ set_dec = functools.partialmethod(set, action=ModifierAction.DEC)
1781
+ """Set modifier action to Decrementing.
1782
+ """
1783
+
1784
+ set_random = functools.partialmethod(set, action=ModifierAction.RANDOM)
1785
+ """Set modifier action to Random.
1786
+ """
1787
+
1788
+
1789
+ @register_command
1790
+ @dataclass
1791
+ class PS_MODIFIEREXTCOUNT:
1792
+ """
1793
+ The number of extended 24-bit modifiers active on the packet header of a stream.
1794
+ Each modifier is specified using PS_MODIFIEREXT.
1795
+ """
1796
+
1797
+ code: typing.ClassVar[int] = 191
1798
+ pushed: typing.ClassVar[bool] = True
1799
+
1800
+ _connection: 'interfaces.IConnection'
1801
+ _module: int
1802
+ _port: int
1803
+ _stream_xindex: int
1804
+
1805
+ class GetDataAttr(ResponseBodyStruct):
1806
+ ext_modifier_count: int = field(XmpInt())
1807
+ """integer, the number of extended 24-bit modifiers for the stream."""
1808
+
1809
+ class SetDataAttr(RequestBodyStruct):
1810
+ ext_modifier_count: int = field(XmpInt())
1811
+ """integer, the number of extended 24-bit modifiers for the stream."""
1812
+
1813
+ def get(self) -> Token[GetDataAttr]:
1814
+ """Get the number of extended 24-bit modifiers active on the packet header of a stream.
1815
+ Each modifier is specified using PS_MODIFIEREXT.
1816
+
1817
+ :return: the number of extended 24-bit modifiers for the stream
1818
+ :rtype: PS_MODIFIEREXTCOUNT.GetDataAttr
1819
+ """
1820
+
1821
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1822
+
1823
+ def set(self, ext_modifier_count: int) -> Token[None]:
1824
+ """Set the number of extended 24-bit modifiers active on the packet header of a stream.
1825
+ Each modifier is specified using PS_MODIFIEREXT.
1826
+
1827
+ :param ext_modifier_count: the number of extended 24-bit modifiers for the stream
1828
+ :type ext_modifier_count: int
1829
+ """
1830
+
1831
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], ext_modifier_count=ext_modifier_count))
1832
+
1833
+
1834
+ @register_command
1835
+ @dataclass
1836
+ class PS_CDFOFFSET:
1837
+ """
1838
+ This command is part of the Custom Data Field (CDF) feature. The CDF offset
1839
+ for the stream is the location in the stream data packets where the various CDF
1840
+ data will be inserted. All fields for a given stream uses the same offset
1841
+ value. The default value is zero (0) which means that the CDF data will be
1842
+ inserted at the very start of the packet, thus overwriting the packet protocol
1843
+ headers. If you want the CDF data to start immediately after the end of the
1844
+ packet protocol headers you will have to set the CDF field offset manually. The
1845
+ feature requires that the P_PAYLOADMODE command on the parent port has been
1846
+ set to CDF. This enables the feature for all streams on this port.
1847
+ """
1848
+
1849
+ code: typing.ClassVar[int] = 195
1850
+ pushed: typing.ClassVar[bool] = True
1851
+
1852
+ _connection: 'interfaces.IConnection'
1853
+ _module: int
1854
+ _port: int
1855
+ _stream_xindex: int
1856
+
1857
+ class GetDataAttr(ResponseBodyStruct):
1858
+ offset: int = field(XmpInt())
1859
+ """integer, the location where the CDF data will be inserted."""
1860
+
1861
+ class SetDataAttr(RequestBodyStruct):
1862
+ offset: int = field(XmpInt())
1863
+ """integer, the location where the CDF data will be inserted."""
1864
+
1865
+ def get(self) -> Token[GetDataAttr]:
1866
+ """Get the CDF offset for the stream. This command is part of the Custom Data Field (CDF) feature. The CDF offset
1867
+ for the stream is the location in the stream data packets where the various CDF
1868
+ data will be inserted. All fields for a given stream uses the same offset
1869
+ value. The default value is zero (0) which means that the CDF data will be
1870
+ inserted at the very start of the packet, thus overwriting the packet protocol
1871
+ headers. If you want the CDF data to start immediately after the end of the
1872
+ packet protocol headers you will have to set the CDF field offset manually. The
1873
+ feature requires that the P_PAYLOADMODE command on the parent port has been
1874
+ set to CDF. This enables the feature for all streams on this port.
1875
+
1876
+ :return: the location where the CDF data will be inserted
1877
+ :rtype: PS_CDFOFFSET.GetDataAttr
1878
+ """
1879
+
1880
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1881
+
1882
+ def set(self, offset: int) -> Token[None]:
1883
+ """Set the CDF offset for the stream. This command is part of the Custom Data Field (CDF) feature. The CDF offset
1884
+ for the stream is the location in the stream data packets where the various CDF
1885
+ data will be inserted. All fields for a given stream uses the same offset
1886
+ value. The default value is zero (0) which means that the CDF data will be
1887
+ inserted at the very start of the packet, thus overwriting the packet protocol
1888
+ headers. If you want the CDF data to start immediately after the end of the
1889
+ packet protocol headers you will have to set the CDF field offset manually. The
1890
+ feature requires that the P_PAYLOADMODE command on the parent port has been
1891
+ set to CDF. This enables the feature for all streams on this port.
1892
+
1893
+ :param offset: the location where the CDF data will be inserted
1894
+ :type offset: int
1895
+ """
1896
+
1897
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], offset=offset))
1898
+
1899
+
1900
+ @register_command
1901
+ @dataclass
1902
+ class PS_CDFCOUNT:
1903
+ """
1904
+ This command is part of the Custom Data Field (CDF) feature. It controls the
1905
+ number of custom data fields available for each stream. You can set a different number
1906
+ of fields for each stream. Changing the field count value to a larger value will
1907
+ leave all existing fields intact. Changing the field count value to a smaller
1908
+ value will remove all existing fields with an index larger than or equal to the
1909
+ new count. The feature requires that the P_PAYLOADMODE command on the parent
1910
+ port has been set to CDF. This enables the feature for all streams on this port.
1911
+ """
1912
+
1913
+ code: typing.ClassVar[int] = 196
1914
+ pushed: typing.ClassVar[bool] = True
1915
+
1916
+ _connection: 'interfaces.IConnection'
1917
+ _module: int
1918
+ _port: int
1919
+ _stream_xindex: int
1920
+
1921
+ class GetDataAttr(ResponseBodyStruct):
1922
+ cdf_count: int = field(XmpInt())
1923
+ """integer, the number of CDF data fields to allocate for the stream."""
1924
+
1925
+ class SetDataAttr(RequestBodyStruct):
1926
+ cdf_count: int = field(XmpInt())
1927
+ """integer, the number of CDF data fields to allocate for the stream."""
1928
+
1929
+ def get(self) -> Token[GetDataAttr]:
1930
+ """Get the number of custom data fields available for each stream. You can set a different number
1931
+ of fields for each stream. Changing the field count value to a larger value will
1932
+ leave all existing fields intact. Changing the field count value to a smaller
1933
+ value will remove all existing fields with an index larger than or equal to the
1934
+ new count. The feature requires that the P_PAYLOADMODE command on the parent
1935
+ port has been set to CDF. This enables the feature for all streams on this port.
1936
+
1937
+ :return: the number of CDF data fields to allocate for the stream
1938
+ :rtype: PS_CDFCOUNT.GetDataAttr
1939
+ """
1940
+
1941
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
1942
+
1943
+ def set(self, cdf_count: int) -> Token[None]:
1944
+ """Set the number of custom data fields available for each stream. You can set a different number
1945
+ of fields for each stream. Changing the field count value to a larger value will
1946
+ leave all existing fields intact. Changing the field count value to a smaller
1947
+ value will remove all existing fields with an index larger than or equal to the
1948
+ new count. The feature requires that the P_PAYLOADMODE command on the parent
1949
+ port has been set to CDF. This enables the feature for all streams on this port.
1950
+
1951
+
1952
+ :param cdf_count: the number of CDF data fields to allocate for the stream
1953
+ :type cdf_count: int
1954
+ """
1955
+
1956
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], cdf_count=cdf_count))
1957
+
1958
+
1959
+ @register_command
1960
+ @dataclass
1961
+ class PS_CDFDATA:
1962
+ """
1963
+ This command is part of the Custom Data Field (CDF) feature. It controls the
1964
+ actual field data for a single field. It is possible to define fields with
1965
+ different data lengths for each stream. If the length of a data field exceeds
1966
+ (packet length - CDF offset) defined for the stream the field data will be
1967
+ truncated when transmitted. The feature requires that the P_PAYLOADMODE
1968
+ command on the parent port has been set to CDF. This enables the feature for
1969
+ all streams on this port.
1970
+ """
1971
+
1972
+ code: typing.ClassVar[int] = 197
1973
+ pushed: typing.ClassVar[bool] = True
1974
+
1975
+ _connection: 'interfaces.IConnection'
1976
+ _module: int
1977
+ _port: int
1978
+ _stream_xindex: int
1979
+ _custom_data_field_xindex: int
1980
+
1981
+ class GetDataAttr(ResponseBodyStruct):
1982
+ hex_data: Hex = field(XmpHex())
1983
+ """list of hex bytes, the actual field data for a single field."""
1984
+
1985
+ class SetDataAttr(RequestBodyStruct):
1986
+ hex_data: Hex = field(XmpHex())
1987
+ """list of hex bytes, a pattern of bytes to be used."""
1988
+
1989
+ def get(self) -> Token[GetDataAttr]:
1990
+ """Get the actual field data for a single field. It is possible to define fields with
1991
+ different data lengths for each stream. If the length of a data field exceeds
1992
+ (packet length - CDF offset) defined for the stream the field data will be
1993
+ truncated when transmitted. The feature requires that the P_PAYLOADMODE
1994
+ command on the parent port has been set to CDF. This enables the feature for
1995
+ all streams on this port.
1996
+
1997
+ :return: the actual field data for a single field
1998
+ :rtype: PS_CDFDATA.GetDataAttr
1999
+ """
2000
+
2001
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex, self._custom_data_field_xindex]))
2002
+
2003
+ def set(self, hex_data: Hex) -> Token[None]:
2004
+ """Set the actual field data for a single field. It is possible to define fields with
2005
+ different data lengths for each stream. If the length of a data field exceeds
2006
+ (packet length - CDF offset) defined for the stream the field data will be
2007
+ truncated when transmitted. The feature requires that the P_PAYLOADMODE
2008
+ command on the parent port has been set to CDF. This enables the feature for
2009
+ all streams on this port.
2010
+
2011
+ :param hex_data: a pattern of bytes to be used
2012
+ :type hex_data: Hex
2013
+ """
2014
+
2015
+ return Token(
2016
+ self._connection,
2017
+ build_set_request(
2018
+ self,
2019
+ module=self._module,
2020
+ port=self._port,
2021
+ indices=[self._stream_xindex, self._custom_data_field_xindex],
2022
+ hex_data=hex_data
2023
+ )
2024
+ )
2025
+
2026
+
2027
+ @register_command
2028
+ @dataclass
2029
+ class PS_EXTPAYLOAD:
2030
+ """
2031
+ This command controls the extended payload feature. The PS_PAYLOAD command
2032
+ described above only allow the user to specify an 18-byte pattern (when
2033
+ PS_PAYLOAD is set to PATTERN). The PS_EXTPAYLOAD command allow the definition
2034
+ of a much larger (up to MTU) payload buffer for each stream. The extended
2035
+ payload will be inserted immediately after the end of the protocol segment area.
2036
+ The feature requires the P_PAYLOADMODE command on the parent port being set to
2037
+ EXTPL. This enables the feature for all streams on this port.
2038
+ """
2039
+
2040
+ code: typing.ClassVar[int] = 199
2041
+ pushed: typing.ClassVar[bool] = True
2042
+
2043
+ _connection: 'interfaces.IConnection'
2044
+ _module: int
2045
+ _port: int
2046
+ _stream_xindex: int
2047
+
2048
+ class GetDataAttr(ResponseBodyStruct):
2049
+ hex_data: Hex = field(XmpHex())
2050
+ """list of hex bytes, a pattern of bytes to be repeated."""
2051
+
2052
+ class SetDataAttr(RequestBodyStruct):
2053
+ hex_data: Hex = field(XmpHex())
2054
+ """list of hex bytes, a pattern of bytes to be repeated."""
2055
+
2056
+ def get(self) -> Token[GetDataAttr]:
2057
+ """Get the extended payload in bytes of a stream.
2058
+
2059
+ :return: the extended payload in bytes of a stream
2060
+ :rtype: PS_EXTPAYLOAD.GetDataAttr
2061
+ """
2062
+
2063
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
2064
+
2065
+ def set(self, hex_data: Hex) -> Token[None]:
2066
+ """Set the extended payload in bytes of a stream. The PS_EXTPAYLOAD command allow the definition
2067
+ of a much larger (up to MTU) payload buffer for each stream. The extended
2068
+ payload will be inserted immediately after the end of the protocol segment area.
2069
+ The feature requires the P_PAYLOADMODE command on the parent port being set to
2070
+ EXTPL. This enables the feature for all streams on this port.
2071
+
2072
+ :param hex_data: the extended payload in bytes of a stream
2073
+ :type hex_data: Hex
2074
+ """
2075
+
2076
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], hex_data=hex_data))
2077
+
2078
+
2079
+ @register_command
2080
+ @dataclass
2081
+ class PS_PFCPRIORITY:
2082
+ """
2083
+ Set and get the Priority Flow Control (PFC) Cos value of a stream.
2084
+ """
2085
+
2086
+ code: typing.ClassVar[int] = 219
2087
+ pushed: typing.ClassVar[bool] = True
2088
+
2089
+ _connection: 'interfaces.IConnection'
2090
+ _module: int
2091
+ _port: int
2092
+ _stream_xindex: int
2093
+
2094
+ class GetDataAttr(ResponseBodyStruct):
2095
+ cos: PFCMode = field(XmpByte())
2096
+ """coded byte, the Priority Flow Control (PFC) Cos value of a stream."""
2097
+
2098
+ class SetDataAttr(RequestBodyStruct):
2099
+ cos: PFCMode = field(XmpByte())
2100
+ """coded byte, the Priority Flow Control (PFC) Cos value of a stream."""
2101
+
2102
+ def get(self) -> Token[GetDataAttr]:
2103
+ """Get the the Priority Flow Control (PFC) Cos value of a stream.
2104
+
2105
+ :return: the Priority Flow Control (PFC) Cos value of a stream.
2106
+ :rtype: PS_PFCPRIORITY.GetDataAttr
2107
+ """
2108
+
2109
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
2110
+
2111
+ def set(self, cos: PFCMode) -> Token[None]:
2112
+ """Set the Priority Flow Control (PFC) Cos value of a stream.
2113
+
2114
+ :param cos: the Priority Flow Control (PFC) Cos value of a stream.
2115
+ :type cos: PFCMode
2116
+ """
2117
+
2118
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], cos=cos))
2119
+
2120
+
2121
+ @register_command
2122
+ @dataclass
2123
+ class PS_OPTIONS:
2124
+ """
2125
+ Define the set of active option flags for the stream. The set form sets the flags listed in <options>, and clears the flags not listed. To clear all flags, simply omit <options> in the command.
2126
+ """
2127
+
2128
+ code: typing.ClassVar[int] = 220
2129
+ pushed: typing.ClassVar[bool] = False
2130
+
2131
+ _connection: 'interfaces.IConnection'
2132
+ _module: int
2133
+ _port: int
2134
+ _stream_xindex: int
2135
+
2136
+ class GetDataAttr(ResponseBodyStruct):
2137
+ options: typing.List[StreamOption] = field(XmpSequence(types_chunk=[XmpByte()]))
2138
+ """coded byte, This flag affects the INC8/DEC8/INC16/DEC16 payload types (refer to the PS_PAYLOAD command): With the flag set, the first payload byte/word after the header will be 0 (INC8/INC16) or -1 (DEC8/DEC16). With the flag unset, the default is used: The first payload byte/word of the payload will be equal to <length of header> (INC8/INC16), or -<length of header> - 1 (DEC8/DEC16)."""
2139
+
2140
+ class SetDataAttr(RequestBodyStruct):
2141
+ options: typing.List[StreamOption] = field(XmpSequence(types_chunk=[XmpByte()]))
2142
+ """coded byte, This flag affects the INC8/DEC8/INC16/DEC16 payload types (refer to the PS_PAYLOAD command): With the flag set, the first payload byte/word after the header will be 0 (INC8/INC16) or -1 (DEC8/DEC16). With the flag unset, the default is used: The first payload byte/word of the payload will be equal to <length of header> (INC8/INC16), or -<length of header> - 1 (DEC8/DEC16)."""
2143
+
2144
+ def get(self) -> Token[GetDataAttr]:
2145
+ """Define the set of active “option flags” for the stream. The “set” form sets the flags listed in <options>, and clears the flags not listed. To clear all flags, simply omit <options> in the command.
2146
+
2147
+ :return: the option flags
2148
+ :rtype: PS_OPTION.GetDataAttr
2149
+ """
2150
+
2151
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
2152
+
2153
+ def set(self, options: typing.List[StreamOption]) -> Token[None]:
2154
+ """Define the set of active “option flags” for the stream. The “set” form sets the flags listed in <options>, and clears the flags not listed. To clear all flags, simply omit <options> in the command.
2155
+
2156
+ :param options: the option flags
2157
+ :type options: StreamOption
2158
+ """
2159
+
2160
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], options=options))
2161
+
2162
+ @register_command
2163
+ @dataclass
2164
+ class PS_MACSEC_ENABLE:
2165
+ """
2166
+ Enable or disable MACsec on the stream.
2167
+ """
2168
+
2169
+ code: typing.ClassVar[int] = 526
2170
+ pushed: typing.ClassVar[bool] = False
2171
+
2172
+ _connection: 'interfaces.IConnection'
2173
+ _module: int
2174
+ _port: int
2175
+ _stream_xindex: int
2176
+
2177
+ class GetDataAttr(ResponseBodyStruct):
2178
+ on_off: OnOff = field(XmpByte())
2179
+ """coded byte, whether MACSec is enabled on the stream."""
2180
+
2181
+ class SetDataAttr(RequestBodyStruct):
2182
+ on_off: OnOff = field(XmpByte())
2183
+ """coded byte, enable/disable MACSec on the stream."""
2184
+
2185
+ def get(self) -> Token[GetDataAttr]:
2186
+ """Get the stream's MACSec state.
2187
+
2188
+ :return: the stream's MACSec state
2189
+ :rtype: PS_MACSEC_ENABLE.GetDataAttr
2190
+ """
2191
+
2192
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
2193
+
2194
+ def set(self, on_off: OnOff) -> Token[None]:
2195
+ """Set the stream's MACSec state.
2196
+
2197
+ :param on_off: the stream's MACSec state
2198
+ :type on_off: OnOff
2199
+ """
2200
+
2201
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], on_off=on_off))
2202
+
2203
+ set_off = functools.partialmethod(set, OnOff.OFF)
2204
+ """Disable the stream's MACSec.
2205
+ """
2206
+
2207
+ set_on = functools.partialmethod(set, OnOff.ON)
2208
+ """Enable the stream's MACSec.
2209
+ """
2210
+
2211
+ @register_command
2212
+ @dataclass
2213
+ class PS_MACSEC_ASSIGN:
2214
+ """
2215
+ Assign a TX SC to a stream.
2216
+ """
2217
+
2218
+ code: typing.ClassVar[int] = 527
2219
+ pushed: typing.ClassVar[bool] = False
2220
+
2221
+ _connection: 'interfaces.IConnection'
2222
+ _module: int
2223
+ _port: int
2224
+ _stream_xindex: int
2225
+
2226
+ class GetDataAttr(ResponseBodyStruct):
2227
+ tx_sc_index: int = field(XmpInt())
2228
+ """integer, index of the TX SC of the port."""
2229
+
2230
+ class SetDataAttr(RequestBodyStruct):
2231
+ tx_sc_index: int = field(XmpInt())
2232
+ """integer, index of the TX SC of the port."""
2233
+
2234
+ def get(self) -> Token[GetDataAttr]:
2235
+ """Get the index of the TX SC of the port.
2236
+
2237
+ :return: index of the TX SC of the port.
2238
+ :rtype: PS_MACSEC_ASSIGN.GetDataAttr
2239
+ """
2240
+
2241
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex]))
2242
+
2243
+ def set(self, tx_sc_index: int) -> Token[None]:
2244
+ """Set the index of the TX SC of the port.
2245
+
2246
+ :param tx_sc_index: index of the TX SC of the port.
2247
+ :type tx_sc_index: integer
2248
+ """
2249
+
2250
+ return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._stream_xindex], tx_sc_index=tx_sc_index))
2251
+
2252
+
2253
+ @register_command
2254
+ @dataclass
2255
+ class PS_MODIFIER_ENDIAN:
2256
+ """
2257
+ Network byte order is Big Endian, where the MSB is assigned with the smallest address. Xena’s modifier (16-bit, 24-bit, or 32-bit) inc/dec mode is default to BIG, where inc/dec starts from the LSB (the largest address). The user can set the mode to LITTLE, where the modifier inc/dec starts from the MSB (the smallest address).
2258
+ """
2259
+
2260
+ code: typing.ClassVar[int] = 166
2261
+ pushed: typing.ClassVar[bool] = False
2262
+
2263
+ _connection: 'interfaces.IConnection'
2264
+ _module: int
2265
+ _port: int
2266
+ _stream_xindex: int
2267
+ _modifier_xindex: int
2268
+
2269
+ class GetDataAttr(ResponseBodyStruct):
2270
+ mode: ModifierEndianness = field(XmpByte())
2271
+ """byte, the start mode of the modifier. Default to BIG."""
2272
+
2273
+
2274
+ class SetDataAttr(RequestBodyStruct):
2275
+ mode: ModifierEndianness = field(XmpByte())
2276
+ """byte, the start mode of the modifier. Default to BIG."""
2277
+
2278
+ def get(self) -> Token[GetDataAttr]:
2279
+ """Get the modifier endianness.
2280
+
2281
+ :return: the modifier endianness.
2282
+ :rtype: PS_MODIFIER_ENDIAN.GetDataAttr
2283
+ """
2284
+
2285
+ return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._stream_xindex, self._modifier_xindex]))
2286
+
2287
+ def set(self, mode: ModifierEndianness) -> Token[None]:
2288
+ """Set the modifier endianness.
2289
+
2290
+ :param mode: the endianness of the modifier.
2291
+ :type mode: ModifierEndianness
2292
+ """
2293
+
2294
+ return Token(
2295
+ self._connection,
2296
+ build_set_request(
2297
+ self,
2298
+ module=self._module,
2299
+ port=self._port,
2300
+ indices=[self._stream_xindex, self._modifier_xindex],
2301
+ mode=mode
2302
+ )
2303
+ )
2304
+
2305
+ set_big_endian = functools.partialmethod(set, mode=ModifierEndianness.BIG)
2306
+ """Set a stream modifier endianness to Big Endian.
2307
+ """
2308
+
2309
+ set_little_endia = functools.partialmethod(set, mode=ModifierEndianness.LITTLE)
2310
+ """Set a stream modifier endianness to Little Endian.
2311
+ """