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.
- tdl_xoa_driver-1.0.0.dist-info/LICENSE +202 -0
- tdl_xoa_driver-1.0.0.dist-info/METADATA +177 -0
- tdl_xoa_driver-1.0.0.dist-info/RECORD +325 -0
- tdl_xoa_driver-1.0.0.dist-info/WHEEL +5 -0
- tdl_xoa_driver-1.0.0.dist-info/top_level.txt +1 -0
- xoa_driver/__init__.py +2 -0
- xoa_driver/enums.py +399 -0
- xoa_driver/exceptions.py +77 -0
- xoa_driver/functions/__init__.py +0 -0
- xoa_driver/functions/anlt.py +744 -0
- xoa_driver/functions/anlt_ll_debug.py +429 -0
- xoa_driver/functions/cli.py +581 -0
- xoa_driver/functions/exceptions.py +72 -0
- xoa_driver/functions/headers.py +608 -0
- xoa_driver/functions/mgmt.py +515 -0
- xoa_driver/functions/tools.py +256 -0
- xoa_driver/hlfuncs.py +18 -0
- xoa_driver/internals/__init__.py +0 -0
- xoa_driver/internals/commands/__init__.py +31 -0
- xoa_driver/internals/commands/c_commands.py +2041 -0
- xoa_driver/internals/commands/enums.py +3289 -0
- xoa_driver/internals/commands/m4_commands.py +700 -0
- xoa_driver/internals/commands/m4e_commands.py +107 -0
- xoa_driver/internals/commands/m_commands.py +1875 -0
- xoa_driver/internals/commands/p4_commands.py +2221 -0
- xoa_driver/internals/commands/p4e_commands.py +160 -0
- xoa_driver/internals/commands/p4g_commands.py +7253 -0
- xoa_driver/internals/commands/p_commands.py +6000 -0
- xoa_driver/internals/commands/pc_commands.py +335 -0
- xoa_driver/internals/commands/pd_commands.py +355 -0
- xoa_driver/internals/commands/pe_commands.py +1018 -0
- xoa_driver/internals/commands/pec_commands.py +265 -0
- xoa_driver/internals/commands/ped_commands.py +1034 -0
- xoa_driver/internals/commands/pef_commands.py +2216 -0
- xoa_driver/internals/commands/pf_commands.py +379 -0
- xoa_driver/internals/commands/pl1_commands.py +1588 -0
- xoa_driver/internals/commands/pl_commands.py +178 -0
- xoa_driver/internals/commands/pm_commands.py +256 -0
- xoa_driver/internals/commands/pp_commands.py +2341 -0
- xoa_driver/internals/commands/pr_commands.py +812 -0
- xoa_driver/internals/commands/ps_commands.py +2311 -0
- xoa_driver/internals/commands/pt_commands.py +370 -0
- xoa_driver/internals/commands/px_commands.py +303 -0
- xoa_driver/internals/commands/subtypes.py +86 -0
- xoa_driver/internals/core/__init__.py +0 -0
- xoa_driver/internals/core/builders.py +39 -0
- xoa_driver/internals/core/exceptions.py +69 -0
- xoa_driver/internals/core/funcs.py +81 -0
- xoa_driver/internals/core/funcs.pyi +1072 -0
- xoa_driver/internals/core/interfaces.py +47 -0
- xoa_driver/internals/core/token.py +44 -0
- xoa_driver/internals/core/transporter/__init__.py +0 -0
- xoa_driver/internals/core/transporter/_processor.py +83 -0
- xoa_driver/internals/core/transporter/_publisher.py +101 -0
- xoa_driver/internals/core/transporter/_request_id_counter.py +28 -0
- xoa_driver/internals/core/transporter/_stream.py +99 -0
- xoa_driver/internals/core/transporter/_typings.py +43 -0
- xoa_driver/internals/core/transporter/exceptions.py +44 -0
- xoa_driver/internals/core/transporter/handler.py +127 -0
- xoa_driver/internals/core/transporter/logger/__init__.py +10 -0
- xoa_driver/internals/core/transporter/logger/__logger.py +94 -0
- xoa_driver/internals/core/transporter/logger/__state_off.py +32 -0
- xoa_driver/internals/core/transporter/logger/__state_on_default.py +70 -0
- xoa_driver/internals/core/transporter/logger/__state_on_loguru.py +51 -0
- xoa_driver/internals/core/transporter/logger/__state_on_user.py +48 -0
- xoa_driver/internals/core/transporter/protocol/__init__.py +0 -0
- xoa_driver/internals/core/transporter/protocol/_constants.py +77 -0
- xoa_driver/internals/core/transporter/protocol/_utils.py +59 -0
- xoa_driver/internals/core/transporter/protocol/exceptions.py +271 -0
- xoa_driver/internals/core/transporter/protocol/payload/__init__.py +70 -0
- xoa_driver/internals/core/transporter/protocol/payload/base_struct.py +283 -0
- xoa_driver/internals/core/transporter/protocol/payload/descriptor.py +119 -0
- xoa_driver/internals/core/transporter/protocol/payload/exceptions.py +20 -0
- xoa_driver/internals/core/transporter/protocol/payload/field.py +296 -0
- xoa_driver/internals/core/transporter/protocol/payload/types.py +173 -0
- xoa_driver/internals/core/transporter/protocol/payload/utils.py +53 -0
- xoa_driver/internals/core/transporter/protocol/struct_header.py +123 -0
- xoa_driver/internals/core/transporter/protocol/struct_request.py +65 -0
- xoa_driver/internals/core/transporter/protocol/struct_response.py +89 -0
- xoa_driver/internals/core/transporter/registry.py +43 -0
- xoa_driver/internals/exceptions/__init__.py +9 -0
- xoa_driver/internals/exceptions/modules.py +13 -0
- xoa_driver/internals/exceptions/testers.py +21 -0
- xoa_driver/internals/hli_v1/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/base_index.py +39 -0
- xoa_driver/internals/hli_v1/indices/connection_group/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/connection_group/cg.py +186 -0
- xoa_driver/internals/hli_v1/indices/connection_group/histogram.py +78 -0
- xoa_driver/internals/hli_v1/indices/connection_group/l2.py +94 -0
- xoa_driver/internals/hli_v1/indices/connection_group/l3.py +130 -0
- xoa_driver/internals/hli_v1/indices/connection_group/raw.py +200 -0
- xoa_driver/internals/hli_v1/indices/connection_group/replay.py +109 -0
- xoa_driver/internals/hli_v1/indices/connection_group/tcp.py +314 -0
- xoa_driver/internals/hli_v1/indices/connection_group/tls.py +198 -0
- xoa_driver/internals/hli_v1/indices/connection_group/udp.py +133 -0
- xoa_driver/internals/hli_v1/indices/connection_group/user_state.py +28 -0
- xoa_driver/internals/hli_v1/indices/filter/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/filter/base_filter.py +65 -0
- xoa_driver/internals/hli_v1/indices/filter/genuine_filter.py +20 -0
- xoa_driver/internals/hli_v1/indices/length_term.py +49 -0
- xoa_driver/internals/hli_v1/indices/macsecscs/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/macsecscs/base_macsecsc.py +224 -0
- xoa_driver/internals/hli_v1/indices/macsecscs/genuine_macsecsc.py +72 -0
- xoa_driver/internals/hli_v1/indices/match_term.py +64 -0
- xoa_driver/internals/hli_v1/indices/port_dataset.py +72 -0
- xoa_driver/internals/hli_v1/indices/streams/__init__.py +0 -0
- xoa_driver/internals/hli_v1/indices/streams/base_stream.py +405 -0
- xoa_driver/internals/hli_v1/indices/streams/genuine_stream.py +64 -0
- xoa_driver/internals/hli_v1/modules/__init__.py +0 -0
- xoa_driver/internals/hli_v1/modules/__interfaces.py +21 -0
- xoa_driver/internals/hli_v1/modules/base_module.py +138 -0
- xoa_driver/internals/hli_v1/modules/module_chimera.py +366 -0
- xoa_driver/internals/hli_v1/modules/module_l23ve.py +73 -0
- xoa_driver/internals/hli_v1/modules/module_l47.py +397 -0
- xoa_driver/internals/hli_v1/modules/module_l47ve.py +9 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/__init__.py +0 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_combi.py +83 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_d.py +75 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_e.py +85 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_f.py +145 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_g.py +84 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_h.py +40 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_i.py +25 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_j.py +25 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_k.py +39 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_l.py +55 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_l1.py +800 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_m.py +25 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/family_n.py +40 -0
- xoa_driver/internals/hli_v1/modules/modules_l23/module_l23_base.py +383 -0
- xoa_driver/internals/hli_v1/ports/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/base_port.py +125 -0
- xoa_driver/internals/hli_v1/ports/port_l23/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_capture.py +70 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_l23.py +527 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_l23_genuine.py +229 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_reception_statistics.py +231 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_transceiver.py +117 -0
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_transmission_statistics.py +131 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/_utils.py +15 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/general.py +396 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/shadow.py +104 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/filter_definition/working.py +36 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/pe_custom_distribution.py +125 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/pe_distribution.py +174 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/port_chimera.py +119 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/port_emulation.py +244 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/reception_statistics.py +24 -0
- xoa_driver/internals/hli_v1/ports/port_l23/chimera/transmission_statistics.py +24 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_combi.py +37 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_d.py +51 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_e.py +107 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_f.py +151 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_g.py +77 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_h.py +67 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_i.py +84 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_j.py +68 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_k.py +73 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_l.py +82 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_l1.py +166 -0
- xoa_driver/internals/hli_v1/ports/port_l23/family_m.py +29 -0
- xoa_driver/internals/hli_v1/ports/port_l23/fault_jkl.py +24 -0
- xoa_driver/internals/hli_v1/ports/port_l23/freya_l1.py +722 -0
- xoa_driver/internals/hli_v1/ports/port_l23/pcs_pma_ghijkl.py +369 -0
- xoa_driver/internals/hli_v1/ports/port_l23/pcs_pma_ijkl_chimera.py +60 -0
- xoa_driver/internals/hli_v1/ports/port_l23/pcs_pma_l.py +78 -0
- xoa_driver/internals/hli_v1/ports/port_l23/port_l23ve.py +101 -0
- xoa_driver/internals/hli_v1/ports/port_l47/__init__.py +0 -0
- xoa_driver/internals/hli_v1/ports/port_l47/counters.py +174 -0
- xoa_driver/internals/hli_v1/ports/port_l47/main.py +228 -0
- xoa_driver/internals/hli_v1/ports/port_l47/packet_engine.py +31 -0
- xoa_driver/internals/hli_v1/revisions.py +11 -0
- xoa_driver/internals/hli_v1/testers/__init__.py +0 -0
- xoa_driver/internals/hli_v1/testers/_base_tester.py +259 -0
- xoa_driver/internals/hli_v1/testers/genuine/__init__.py +0 -0
- xoa_driver/internals/hli_v1/testers/genuine/l_23/__init__.py +0 -0
- xoa_driver/internals/hli_v1/testers/genuine/l_23/health.py +16 -0
- xoa_driver/internals/hli_v1/testers/genuine/l_23/rest_api.py +38 -0
- xoa_driver/internals/hli_v1/testers/genuine/l_23/time_keeper.py +57 -0
- xoa_driver/internals/hli_v1/testers/genuine/l_23/upload_file.py +29 -0
- xoa_driver/internals/hli_v1/testers/genuine/management_interface.py +42 -0
- xoa_driver/internals/hli_v1/testers/l23_tester.py +196 -0
- xoa_driver/internals/hli_v1/testers/l23ve_tester.py +114 -0
- xoa_driver/internals/hli_v1/testers/l47_tester.py +106 -0
- xoa_driver/internals/hli_v1/testers/l47ve_tester.py +54 -0
- xoa_driver/internals/hli_v2/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/base_index.py +39 -0
- xoa_driver/internals/hli_v2/indices/connection_group/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/connection_group/cg.py +115 -0
- xoa_driver/internals/hli_v2/indices/connection_group/histogram.py +59 -0
- xoa_driver/internals/hli_v2/indices/connection_group/l2.py +71 -0
- xoa_driver/internals/hli_v2/indices/connection_group/l3.py +96 -0
- xoa_driver/internals/hli_v2/indices/connection_group/raw.py +148 -0
- xoa_driver/internals/hli_v2/indices/connection_group/replay.py +89 -0
- xoa_driver/internals/hli_v2/indices/connection_group/tcp.py +261 -0
- xoa_driver/internals/hli_v2/indices/connection_group/tls.py +166 -0
- xoa_driver/internals/hli_v2/indices/connection_group/udp.py +112 -0
- xoa_driver/internals/hli_v2/indices/connection_group/user_state.py +25 -0
- xoa_driver/internals/hli_v2/indices/filter/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/filter/base_filter.py +50 -0
- xoa_driver/internals/hli_v2/indices/filter/genuine_filter.py +17 -0
- xoa_driver/internals/hli_v2/indices/length_term.py +44 -0
- xoa_driver/internals/hli_v2/indices/match_term.py +49 -0
- xoa_driver/internals/hli_v2/indices/port_dataset.py +53 -0
- xoa_driver/internals/hli_v2/indices/streams/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/streams/base_stream.py +234 -0
- xoa_driver/internals/hli_v2/indices/streams/genuine_stream.py +32 -0
- xoa_driver/internals/hli_v2/modules/__init__.py +0 -0
- xoa_driver/internals/hli_v2/modules/__interfaces.py +21 -0
- xoa_driver/internals/hli_v2/modules/base_module.py +125 -0
- xoa_driver/internals/hli_v2/modules/module_chimera.py +358 -0
- xoa_driver/internals/hli_v2/modules/module_l23ve.py +58 -0
- xoa_driver/internals/hli_v2/modules/module_l47.py +230 -0
- xoa_driver/internals/hli_v2/modules/module_l47ve.py +8 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/__init__.py +0 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_combi.py +73 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_d.py +75 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_e.py +85 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_f.py +144 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_g.py +84 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_h.py +40 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_i.py +25 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_j.py +25 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_k.py +39 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_l.py +55 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_l1.py +797 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_m.py +25 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_n.py +40 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/module_l23_base.py +339 -0
- xoa_driver/internals/hli_v2/ports/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/base_port.py +105 -0
- xoa_driver/internals/hli_v2/ports/port_l23/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_capture.py +64 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_l23.py +441 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_l23_genuine.py +172 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_reception_statistics.py +156 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_transceiver.py +117 -0
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_transmission_statistics.py +59 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/_utils.py +15 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/general.py +340 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/shadow.py +99 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/working.py +36 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/pe_custom_distribution.py +116 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/pe_distribution.py +102 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/port_chimera.py +113 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/port_emulation.py +420 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/reception_statistics.py +22 -0
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/transmission_statistics.py +22 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_combi.py +36 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_d.py +49 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_e.py +96 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_f.py +144 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_g.py +77 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_h.py +60 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_i.py +66 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_j.py +53 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_k.py +58 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_l.py +67 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_l1.py +149 -0
- xoa_driver/internals/hli_v2/ports/port_l23/family_m.py +28 -0
- xoa_driver/internals/hli_v2/ports/port_l23/fault_jkl.py +22 -0
- xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_ghijkl.py +342 -0
- xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_ijkl_chimera.py +50 -0
- xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_l.py +65 -0
- xoa_driver/internals/hli_v2/ports/port_l23/port_l23ve.py +81 -0
- xoa_driver/internals/hli_v2/ports/port_l47/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l47/counters.py +146 -0
- xoa_driver/internals/hli_v2/ports/port_l47/main.py +137 -0
- xoa_driver/internals/hli_v2/ports/port_l47/packet_engine.py +20 -0
- xoa_driver/internals/hli_v2/revisions.py +11 -0
- xoa_driver/internals/hli_v2/testers/__init__.py +0 -0
- xoa_driver/internals/hli_v2/testers/_base_tester.py +207 -0
- xoa_driver/internals/hli_v2/testers/genuine/__init__.py +0 -0
- xoa_driver/internals/hli_v2/testers/genuine/l_23/__init__.py +0 -0
- xoa_driver/internals/hli_v2/testers/genuine/l_23/health.py +16 -0
- xoa_driver/internals/hli_v2/testers/genuine/l_23/rest_api.py +34 -0
- xoa_driver/internals/hli_v2/testers/genuine/l_23/time_keeper.py +50 -0
- xoa_driver/internals/hli_v2/testers/genuine/l_23/upload_file.py +26 -0
- xoa_driver/internals/hli_v2/testers/genuine/management_interface.py +38 -0
- xoa_driver/internals/hli_v2/testers/l23_tester.py +159 -0
- xoa_driver/internals/hli_v2/testers/l23ve_tester.py +98 -0
- xoa_driver/internals/hli_v2/testers/l47_tester.py +95 -0
- xoa_driver/internals/hli_v2/testers/l47ve_tester.py +50 -0
- xoa_driver/internals/state_storage/__init__.py +0 -0
- xoa_driver/internals/state_storage/_speed_detector.py +121 -0
- xoa_driver/internals/state_storage/modules_state.py +128 -0
- xoa_driver/internals/state_storage/ports_state.py +154 -0
- xoa_driver/internals/state_storage/testers_state.py +104 -0
- xoa_driver/internals/utils/__init__.py +0 -0
- xoa_driver/internals/utils/attributes.py +33 -0
- xoa_driver/internals/utils/cap_id.py +63 -0
- xoa_driver/internals/utils/con_traffic_light.py +88 -0
- xoa_driver/internals/utils/indices/__init__.py +0 -0
- xoa_driver/internals/utils/indices/_interfaces.py +26 -0
- xoa_driver/internals/utils/indices/header_modifier_manager.py +56 -0
- xoa_driver/internals/utils/indices/index_manager.py +95 -0
- xoa_driver/internals/utils/indices/observer.py +17 -0
- xoa_driver/internals/utils/kind.py +19 -0
- xoa_driver/internals/utils/managers/__init__.py +0 -0
- xoa_driver/internals/utils/managers/abc.py +44 -0
- xoa_driver/internals/utils/managers/exceptions.py +22 -0
- xoa_driver/internals/utils/managers/modules_manager.py +118 -0
- xoa_driver/internals/utils/managers/ports_manager.py +116 -0
- xoa_driver/internals/utils/rev_tool.py +21 -0
- xoa_driver/internals/utils/session.py +117 -0
- xoa_driver/internals/warn.py +32 -0
- xoa_driver/lli.py +15 -0
- xoa_driver/misc.py +57 -0
- xoa_driver/modules.py +448 -0
- xoa_driver/ports.py +332 -0
- xoa_driver/testers.py +37 -0
- xoa_driver/utils.py +12 -0
- xoa_driver/v2/__init__.py +11 -0
- xoa_driver/v2/misc.py +77 -0
- xoa_driver/v2/modules.py +308 -0
- xoa_driver/v2/ports.py +232 -0
- xoa_driver/v2/testers.py +24 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
from typing import (
|
|
2
|
+
List,
|
|
3
|
+
Type,
|
|
4
|
+
TypeVar,
|
|
5
|
+
TYPE_CHECKING,
|
|
6
|
+
)
|
|
7
|
+
from xoa_driver.internals.commands import (
|
|
8
|
+
PS_INDICES,
|
|
9
|
+
PS_CREATE,
|
|
10
|
+
PS_DELETE,
|
|
11
|
+
PS_ENABLE,
|
|
12
|
+
PS_PACKETLIMIT,
|
|
13
|
+
PS_COMMENT,
|
|
14
|
+
PS_TPLDID,
|
|
15
|
+
PS_ARPREQUEST,
|
|
16
|
+
PS_PINGREQUEST,
|
|
17
|
+
PS_MODIFIEREXTRANGE,
|
|
18
|
+
PS_MODIFIERRANGE,
|
|
19
|
+
PS_RATEFRACTION,
|
|
20
|
+
PS_RATEPPS,
|
|
21
|
+
PS_RATEL2BPS,
|
|
22
|
+
PS_BURST,
|
|
23
|
+
PS_PACKETHEADER,
|
|
24
|
+
PS_HEADERPROTOCOL,
|
|
25
|
+
PS_MODIFIERCOUNT,
|
|
26
|
+
PS_MODIFIER,
|
|
27
|
+
PS_PACKETLENGTH,
|
|
28
|
+
PS_PAYLOAD,
|
|
29
|
+
PS_IPV4GATEWAY,
|
|
30
|
+
PS_IPV6GATEWAY,
|
|
31
|
+
PS_BURSTGAP,
|
|
32
|
+
PS_INJECTSEQERR,
|
|
33
|
+
PS_INJECTMISERR,
|
|
34
|
+
PS_INJECTPLDERR,
|
|
35
|
+
PS_INJECTTPLDERR,
|
|
36
|
+
PS_MODIFIEREXT,
|
|
37
|
+
PS_MODIFIEREXTCOUNT,
|
|
38
|
+
PS_CDFOFFSET,
|
|
39
|
+
PS_CDFCOUNT,
|
|
40
|
+
PS_CDFDATA,
|
|
41
|
+
PS_EXTPAYLOAD,
|
|
42
|
+
PS_PFCPRIORITY,
|
|
43
|
+
PS_AUTOADJUST,
|
|
44
|
+
PS_OPTIONS,
|
|
45
|
+
PS_MODIFIER_ENDIAN,
|
|
46
|
+
)
|
|
47
|
+
if TYPE_CHECKING:
|
|
48
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
49
|
+
from xoa_driver.internals.utils import kind
|
|
50
|
+
from xoa_driver.internals.utils.indices import observer as idx_obs
|
|
51
|
+
from xoa_driver.internals.utils.indices import header_modifier_manager as hmm
|
|
52
|
+
from ..base_index import BaseIndex
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class SRate:
|
|
56
|
+
"""L23 Stream Rate Configuration"""
|
|
57
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
58
|
+
self.fraction = PS_RATEFRACTION(conn, module_id, port_id, stream_idx)
|
|
59
|
+
"""Configure stream's rate by percentage
|
|
60
|
+
|
|
61
|
+
:type: PS_RATEFRACTION
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
self.pps = PS_RATEPPS(conn, module_id, port_id, stream_idx)
|
|
65
|
+
"""Configure stream's rate by pps
|
|
66
|
+
|
|
67
|
+
:type: PS_RATEPPS
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
self.l2bps = PS_RATEL2BPS(conn, module_id, port_id, stream_idx)
|
|
71
|
+
"""Configure stream's rate by L2 bps
|
|
72
|
+
|
|
73
|
+
:type: PS_RATEL2BPS
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class HModifierExtended:
|
|
78
|
+
"""L23 Extended Modifier Configuration"""
|
|
79
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int, modifier_idx: int) -> None:
|
|
80
|
+
self.specification = PS_MODIFIEREXT(conn, module_id, port_id, stream_idx, modifier_idx)
|
|
81
|
+
"""32-bit modifier position, action, repetition
|
|
82
|
+
|
|
83
|
+
:type: PS_MODIFIEREXT
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
self.range = PS_MODIFIEREXTRANGE(conn, module_id, port_id, stream_idx, modifier_idx)
|
|
87
|
+
"""32-bit modifier's range
|
|
88
|
+
|
|
89
|
+
:type: PS_MODIFIEREXTRANGE
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class HModifier:
|
|
94
|
+
"""L23 Modifier Configuration"""
|
|
95
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int, modifier_idx: int) -> None:
|
|
96
|
+
self.specification = PS_MODIFIER(conn, module_id, port_id, stream_idx, modifier_idx)
|
|
97
|
+
"""16/24-bit modifier position, action, repetition
|
|
98
|
+
|
|
99
|
+
:type: PS_MODIFIEREXTRANGE
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
self.range = PS_MODIFIERRANGE(conn, module_id, port_id, stream_idx, modifier_idx)
|
|
103
|
+
"""16/24-bit modifier's range
|
|
104
|
+
|
|
105
|
+
:type: PS_MODIFIERRANGE
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
self.endian = PS_MODIFIER_ENDIAN(conn, module_id, port_id, stream_idx, modifier_idx)
|
|
109
|
+
"""16/24-bit modifier's endianness
|
|
110
|
+
|
|
111
|
+
:type: PS_MODIFIER_ENDIAN
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class SCustomDataField:
|
|
116
|
+
"""L23 Custom Data Field Configuration"""
|
|
117
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
118
|
+
self.__conn = conn
|
|
119
|
+
self.__module_id = module_id
|
|
120
|
+
self.__port_id = port_id
|
|
121
|
+
self.__stream_idx = stream_idx
|
|
122
|
+
|
|
123
|
+
self.offset = PS_CDFOFFSET(conn, module_id, port_id, stream_idx)
|
|
124
|
+
"""Custom Data Field offset
|
|
125
|
+
|
|
126
|
+
:type: PS_CDFOFFSET
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
self.count = PS_CDFCOUNT(conn, module_id, port_id, stream_idx)
|
|
130
|
+
"""Number of Custom Data Fields
|
|
131
|
+
|
|
132
|
+
:type: PS_CDFCOUNT
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
def data(self, cdf_index: int) -> "PS_CDFDATA":
|
|
136
|
+
"""Custom Data Field data
|
|
137
|
+
|
|
138
|
+
:rtype: PS_CDFDATA
|
|
139
|
+
"""
|
|
140
|
+
return PS_CDFDATA(self.__conn, self.__module_id, self.__port_id, self.__stream_idx, cdf_index)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class SInjectError:
|
|
144
|
+
"""L23 Error Injection Configuration"""
|
|
145
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
146
|
+
self.sequence = PS_INJECTSEQERR(conn, module_id, port_id, stream_idx)
|
|
147
|
+
"""Inject sequence error
|
|
148
|
+
|
|
149
|
+
:type: PS_INJECTSEQERR
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
self.misorder = PS_INJECTMISERR(conn, module_id, port_id, stream_idx)
|
|
153
|
+
"""Inject misorder error
|
|
154
|
+
|
|
155
|
+
:type: PS_INJECTMISERR
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
self.payload_integrity = PS_INJECTPLDERR(conn, module_id, port_id, stream_idx)
|
|
159
|
+
"""Inject payload integrity error
|
|
160
|
+
|
|
161
|
+
:type: PS_INJECTPLDERR
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
self.test_payload = PS_INJECTTPLDERR(conn, module_id, port_id, stream_idx)
|
|
165
|
+
"""Inject TPLD error
|
|
166
|
+
|
|
167
|
+
:type: PS_INJECTTPLDERR
|
|
168
|
+
"""
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class SRequest:
|
|
172
|
+
"""L23 Request Configuration"""
|
|
173
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
174
|
+
self.arp = PS_ARPREQUEST(conn, module_id, port_id, stream_idx)
|
|
175
|
+
"""Generates an outgoing ARP request on the test port.
|
|
176
|
+
|
|
177
|
+
:type: PS_ARPREQUEST
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
self.ping = PS_PINGREQUEST(conn, module_id, port_id, stream_idx)
|
|
181
|
+
"""Generates an outgoing ping request using the ICMP protocol on the test port.
|
|
182
|
+
|
|
183
|
+
:type: PS_PINGREQUEST
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class SPayload:
|
|
188
|
+
"""L23 Payload Configuration"""
|
|
189
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
190
|
+
self.content = PS_PAYLOAD(conn, module_id, port_id, stream_idx)
|
|
191
|
+
"""The payload content of the packets transmitted for a stream.
|
|
192
|
+
|
|
193
|
+
:type: PS_PAYLOAD
|
|
194
|
+
"""
|
|
195
|
+
|
|
196
|
+
self.extended = PS_EXTPAYLOAD(conn, module_id, port_id, stream_idx)
|
|
197
|
+
"""Controls the extended payload.
|
|
198
|
+
|
|
199
|
+
:type: PS_EXTPAYLOAD
|
|
200
|
+
"""
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class SGateway:
|
|
204
|
+
"""L23 Gateway Configuration"""
|
|
205
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
206
|
+
self.ipv4 = PS_IPV4GATEWAY(conn, module_id, port_id, stream_idx)
|
|
207
|
+
"""IPv4 gateway configuration specified for a stream.
|
|
208
|
+
|
|
209
|
+
:type: PS_IPV4GATEWAY
|
|
210
|
+
"""
|
|
211
|
+
|
|
212
|
+
self.ipv6 = PS_IPV6GATEWAY(conn, module_id, port_id, stream_idx)
|
|
213
|
+
"""IPv6 gateway configuration specified for a stream.
|
|
214
|
+
|
|
215
|
+
:type: PS_IPV6GATEWAY
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
class SPHeader:
|
|
220
|
+
"""L23 Stream Header Configuration"""
|
|
221
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
222
|
+
self.data = PS_PACKETHEADER(conn, module_id, port_id, stream_idx)
|
|
223
|
+
"""Configure stream's packet header values
|
|
224
|
+
|
|
225
|
+
:type: PS_PACKETHEADER
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
self.protocol = PS_HEADERPROTOCOL(conn, module_id, port_id, stream_idx)
|
|
229
|
+
"""Configure stream's packet header protocols
|
|
230
|
+
|
|
231
|
+
:type: PS_HEADERPROTOCOL
|
|
232
|
+
"""
|
|
233
|
+
|
|
234
|
+
self.modifiers: "hmm.ModifiersManager[HModifier]" = hmm.ModifiersManager(
|
|
235
|
+
conn,
|
|
236
|
+
(module_id, port_id, stream_idx),
|
|
237
|
+
PS_MODIFIERCOUNT,
|
|
238
|
+
HModifier
|
|
239
|
+
)
|
|
240
|
+
"""L23 stream 16-bit modifier index manager
|
|
241
|
+
|
|
242
|
+
:type: ModifiersManager
|
|
243
|
+
"""
|
|
244
|
+
|
|
245
|
+
self.modifiers_extended: "hmm.ModifiersManager[HModifierExtended]" = hmm.ModifiersManager(
|
|
246
|
+
conn,
|
|
247
|
+
(module_id, port_id, stream_idx),
|
|
248
|
+
PS_MODIFIEREXTCOUNT,
|
|
249
|
+
HModifierExtended
|
|
250
|
+
)
|
|
251
|
+
"""L23 stream 32-bit modifier index manager
|
|
252
|
+
|
|
253
|
+
:type: ModifiersManager
|
|
254
|
+
"""
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
class SPacket:
|
|
258
|
+
"""L23 Packet Configuration"""
|
|
259
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
260
|
+
self.limit = PS_PACKETLIMIT(conn, module_id, port_id, stream_idx)
|
|
261
|
+
"""Limit number of packets to be transmitted on a stream.
|
|
262
|
+
|
|
263
|
+
:type: PS_PACKETLIMIT
|
|
264
|
+
"""
|
|
265
|
+
|
|
266
|
+
self.length = PS_PACKETLENGTH(conn, module_id, port_id, stream_idx)
|
|
267
|
+
"""Packet length of the stream.
|
|
268
|
+
|
|
269
|
+
:type: PS_PACKETLENGTH
|
|
270
|
+
"""
|
|
271
|
+
|
|
272
|
+
self.header = SPHeader(conn, module_id, port_id, stream_idx)
|
|
273
|
+
"""Packet header config
|
|
274
|
+
|
|
275
|
+
:type: SPHeader
|
|
276
|
+
"""
|
|
277
|
+
|
|
278
|
+
self.auto_adjust = PS_AUTOADJUST(conn, module_id, port_id, stream_idx)
|
|
279
|
+
"""Auto adjust the packet length distribution of the stream.
|
|
280
|
+
|
|
281
|
+
:type: PS_AUTOADJUST
|
|
282
|
+
"""
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
class SBurst:
|
|
286
|
+
"""L23 Stream Burst Configuration"""
|
|
287
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
288
|
+
self.burstiness = PS_BURST(conn, module_id, port_id, stream_idx)
|
|
289
|
+
"""Burstiness config of the stream.
|
|
290
|
+
|
|
291
|
+
:type: PS_BURST
|
|
292
|
+
"""
|
|
293
|
+
|
|
294
|
+
self.gap = PS_BURSTGAP(conn, module_id, port_id, stream_idx)
|
|
295
|
+
"""Burst gap config of the stream.
|
|
296
|
+
|
|
297
|
+
:type: PS_BURSTGAP
|
|
298
|
+
"""
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
BS = TypeVar("BS")
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class BaseStreamIdx(BaseIndex):
|
|
305
|
+
"""Base L23 Stream Index Manager"""
|
|
306
|
+
def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
|
|
307
|
+
super().__init__(conn, kind, observer)
|
|
308
|
+
|
|
309
|
+
self.comment = PS_COMMENT(conn, *kind)
|
|
310
|
+
"""Stream's description.
|
|
311
|
+
|
|
312
|
+
:type: PS_COMMENT
|
|
313
|
+
"""
|
|
314
|
+
|
|
315
|
+
self.enable = PS_ENABLE(conn, *kind)
|
|
316
|
+
"""Enable, suppress, or disable the stream.
|
|
317
|
+
|
|
318
|
+
:type: PS_ENABLE
|
|
319
|
+
"""
|
|
320
|
+
|
|
321
|
+
self.tpld_id = PS_TPLDID(conn, *kind)
|
|
322
|
+
"""Stream's TPLD value.
|
|
323
|
+
|
|
324
|
+
:type: PS_TPLDID
|
|
325
|
+
"""
|
|
326
|
+
|
|
327
|
+
self.priority_flow = PS_PFCPRIORITY(conn, *kind)
|
|
328
|
+
"""Stream's PFC priority config
|
|
329
|
+
|
|
330
|
+
:type: PS_PFCPRIORITY
|
|
331
|
+
"""
|
|
332
|
+
|
|
333
|
+
self.payload = SPayload(conn, *kind)
|
|
334
|
+
"""L23 stream payload config
|
|
335
|
+
|
|
336
|
+
:type: SPayload
|
|
337
|
+
"""
|
|
338
|
+
|
|
339
|
+
self.request = SRequest(conn, *kind)
|
|
340
|
+
"""L23 stream request config
|
|
341
|
+
|
|
342
|
+
:type: SRequest
|
|
343
|
+
"""
|
|
344
|
+
|
|
345
|
+
self.packet = SPacket(conn, *kind)
|
|
346
|
+
"""L23 stream packet config
|
|
347
|
+
|
|
348
|
+
:type: SPacket
|
|
349
|
+
"""
|
|
350
|
+
|
|
351
|
+
self.burst = SBurst(conn, *kind)
|
|
352
|
+
"""L23 stream burst config
|
|
353
|
+
|
|
354
|
+
:type: SBurst
|
|
355
|
+
"""
|
|
356
|
+
|
|
357
|
+
self.gateway = SGateway(conn, *kind)
|
|
358
|
+
"""L23 stream gateway config
|
|
359
|
+
|
|
360
|
+
:type: SGateway
|
|
361
|
+
"""
|
|
362
|
+
|
|
363
|
+
self.inject_err = SInjectError(conn, *kind)
|
|
364
|
+
"""L23 stream error injections config
|
|
365
|
+
|
|
366
|
+
:type: SInjectError
|
|
367
|
+
"""
|
|
368
|
+
|
|
369
|
+
self.cdf = SCustomDataField(conn, *kind)
|
|
370
|
+
"""L23 stream custom data field config
|
|
371
|
+
|
|
372
|
+
:type: SCustomDataField
|
|
373
|
+
"""
|
|
374
|
+
|
|
375
|
+
self.rate = SRate(conn, *kind)
|
|
376
|
+
"""L23 stream rate config
|
|
377
|
+
|
|
378
|
+
:type: SRate
|
|
379
|
+
"""
|
|
380
|
+
|
|
381
|
+
self.options = PS_OPTIONS(conn, *kind)
|
|
382
|
+
"""L23 stream options
|
|
383
|
+
|
|
384
|
+
:type: PS_OPTIONS
|
|
385
|
+
"""
|
|
386
|
+
|
|
387
|
+
async def delete(self):
|
|
388
|
+
"""Delete the stream
|
|
389
|
+
|
|
390
|
+
:type: PS_DELETE
|
|
391
|
+
"""
|
|
392
|
+
|
|
393
|
+
await PS_DELETE(self._conn, *self.kind).set()
|
|
394
|
+
self._observer.notify(idx_obs.IndexEvents.DEL, self)
|
|
395
|
+
|
|
396
|
+
@classmethod
|
|
397
|
+
async def _fetch(cls, conn: "itf.IConnection", module_id: int, port_id: int) -> List[int]:
|
|
398
|
+
resp = await PS_INDICES(conn, module_id, port_id).get()
|
|
399
|
+
return list(resp.stream_indices)
|
|
400
|
+
|
|
401
|
+
@classmethod
|
|
402
|
+
async def _new(cls: Type[BS], conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> BS:
|
|
403
|
+
await PS_CREATE(conn, *kind).set()
|
|
404
|
+
return cls(conn, kind, observer)
|
|
405
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING
|
|
2
|
+
from xoa_driver.internals.commands import (
|
|
3
|
+
PS_INSERTFCS,
|
|
4
|
+
PS_INJECTFCSERR,
|
|
5
|
+
PS_MACSEC_ENABLE,
|
|
6
|
+
PS_MACSEC_ASSIGN,
|
|
7
|
+
)
|
|
8
|
+
from .base_stream import (
|
|
9
|
+
BaseStreamIdx,
|
|
10
|
+
SInjectError
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
15
|
+
from xoa_driver.internals.utils import kind
|
|
16
|
+
from xoa_driver.internals.utils.indices import observer as idx_obs
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class GSInjectError(SInjectError):
|
|
20
|
+
"""Error Injection configuration"""
|
|
21
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
22
|
+
super().__init__(conn, module_id, port_id, stream_idx)
|
|
23
|
+
self.frame_checksum = PS_INJECTFCSERR(conn, module_id, port_id, stream_idx)
|
|
24
|
+
"""Inject FCS error
|
|
25
|
+
|
|
26
|
+
:type: PS_INJECTFCSERR
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
class SMacSec:
|
|
30
|
+
"""MACSec configuration"""
|
|
31
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, stream_idx: int) -> None:
|
|
32
|
+
self.enable = PS_MACSEC_ENABLE(conn, module_id, port_id, stream_idx)
|
|
33
|
+
"""Enable MACSec
|
|
34
|
+
|
|
35
|
+
:type: PS_MACSEC_ENABLE
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
self.assign = PS_MACSEC_ASSIGN(conn, module_id, port_id, stream_idx)
|
|
39
|
+
"""Assign MACSec
|
|
40
|
+
|
|
41
|
+
:type: PS_MACSEC_ASSIGN
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
class GenuineStreamIdx(BaseStreamIdx):
|
|
45
|
+
"""Genuine L23 Stream Index Manager"""
|
|
46
|
+
def __init__(self, conn: "itf.IConnection", kind: "kind.IndicesKind", observer: "idx_obs.IndicesObserver") -> None:
|
|
47
|
+
super().__init__(conn, kind, observer)
|
|
48
|
+
self.insert_packets_checksum = PS_INSERTFCS(conn, *kind)
|
|
49
|
+
"""Whether a valid frame checksum is added to the packets of a stream.
|
|
50
|
+
|
|
51
|
+
:type: PS_INSERTFCS
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
self.inject_err = GSInjectError(conn, *kind)
|
|
55
|
+
"""Error injection configuration
|
|
56
|
+
|
|
57
|
+
:type: GSInjectError
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
self.macsec = SMacSec(conn, *kind)
|
|
61
|
+
"""MACSec configuration
|
|
62
|
+
|
|
63
|
+
:type: SMacSec
|
|
64
|
+
"""
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
|
|
3
|
+
if typing.TYPE_CHECKING:
|
|
4
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ModuleInitData(typing.Protocol):
|
|
8
|
+
module_id: int
|
|
9
|
+
ports_count: int
|
|
10
|
+
revision: str
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class IPort(typing.Protocol):
|
|
14
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
15
|
+
...
|
|
16
|
+
|
|
17
|
+
# def __await__(self):
|
|
18
|
+
# ...
|
|
19
|
+
|
|
20
|
+
# async def _setup(self):
|
|
21
|
+
# ...
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
|
|
2
|
+
import functools
|
|
3
|
+
from typing import (
|
|
4
|
+
TYPE_CHECKING,
|
|
5
|
+
TypeVar,
|
|
6
|
+
Generic
|
|
7
|
+
)
|
|
8
|
+
from abc import (
|
|
9
|
+
ABC,
|
|
10
|
+
abstractmethod,
|
|
11
|
+
)
|
|
12
|
+
from typing_extensions import Self
|
|
13
|
+
from xoa_driver.internals.commands import enums
|
|
14
|
+
from xoa_driver.internals.commands import (
|
|
15
|
+
M_MODEL,
|
|
16
|
+
M_PORTCOUNT,
|
|
17
|
+
M_RESERVATION,
|
|
18
|
+
M_RESERVEDBY,
|
|
19
|
+
M_SERIALNO,
|
|
20
|
+
M_VERSIONNO,
|
|
21
|
+
M_MODEL_NAME,
|
|
22
|
+
)
|
|
23
|
+
from xoa_driver.internals.utils import attributes as utils
|
|
24
|
+
|
|
25
|
+
if TYPE_CHECKING:
|
|
26
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
27
|
+
from . import __interfaces as m_itf
|
|
28
|
+
from xoa_driver.internals.state_storage import modules_state
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
T = TypeVar('T', bound="modules_state.ModuleLocalState")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class BaseModule(ABC, Generic[T]):
|
|
35
|
+
"""Basic Module class.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
def __init__(self, conn: "itf.IConnection", init_data: "m_itf.ModuleInitData") -> None:
|
|
39
|
+
self._conn = conn
|
|
40
|
+
self.module_id = init_data.module_id
|
|
41
|
+
self.ports_count = init_data.ports_count
|
|
42
|
+
self.reservation = M_RESERVATION(self._conn, self.module_id)
|
|
43
|
+
"""Test module's reservation action.
|
|
44
|
+
|
|
45
|
+
:type: M_RESERVATION
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
self.reserved_by = M_RESERVEDBY(self._conn, self.module_id)
|
|
49
|
+
"""Test module's reservation status.
|
|
50
|
+
|
|
51
|
+
:type: M_RESERVEDBY
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
self.model = M_MODEL(self._conn, self.module_id)
|
|
55
|
+
"""Test module's model.
|
|
56
|
+
|
|
57
|
+
:type: M_MODEL
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
self.model_name = M_MODEL_NAME(self._conn, self.module_id)
|
|
61
|
+
"""Test module's model name.
|
|
62
|
+
|
|
63
|
+
:type: M_MODEL_NAME
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
self.serial_number = M_SERIALNO(self._conn, self.module_id)
|
|
67
|
+
"""Test module's serial number.
|
|
68
|
+
|
|
69
|
+
:type: M_SERIALNO
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
self.version_number = M_VERSIONNO(self._conn, self.module_id)
|
|
73
|
+
"""Test module's version number.
|
|
74
|
+
|
|
75
|
+
:type: M_VERSIONNO
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
self.port_count = M_PORTCOUNT(self._conn, self.module_id)
|
|
79
|
+
"""Max port count of the test module.
|
|
80
|
+
|
|
81
|
+
:type: M_PORTCOUNT
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
@abstractmethod
|
|
86
|
+
def info(self) -> T:
|
|
87
|
+
"""
|
|
88
|
+
Module local info.
|
|
89
|
+
"""
|
|
90
|
+
raise NotImplementedError()
|
|
91
|
+
|
|
92
|
+
def __await__(self):
|
|
93
|
+
return self._setup().__await__()
|
|
94
|
+
|
|
95
|
+
@abstractmethod
|
|
96
|
+
async def _setup(self) -> Self:
|
|
97
|
+
raise NotImplementedError()
|
|
98
|
+
|
|
99
|
+
def _check_identity(self, request) -> bool:
|
|
100
|
+
return self.module_id == request.header.module_index
|
|
101
|
+
|
|
102
|
+
def __is_reservation(self, reserved_status: enums.ReservedStatus) -> bool:
|
|
103
|
+
return self.info.reservation == reserved_status
|
|
104
|
+
|
|
105
|
+
is_released = functools.partialmethod(__is_reservation, enums.ReservedStatus.RELEASED)
|
|
106
|
+
"""
|
|
107
|
+
Validate if the module is released.
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
is_reserved_by_me = functools.partialmethod(__is_reservation, enums.ReservedStatus.RESERVED_BY_YOU)
|
|
111
|
+
"""
|
|
112
|
+
Validate if the module is reserved by me.
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
on_reservation_change = functools.partialmethod(utils.on_event, M_RESERVATION)
|
|
116
|
+
"""
|
|
117
|
+
Register a callback to the event that the module's reservation status changes.
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
on_reserved_by_change = functools.partialmethod(utils.on_event, M_RESERVEDBY)
|
|
121
|
+
"""
|
|
122
|
+
Register a callback to the event that the module's ownership status changes.
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
on_model_change = functools.partialmethod(utils.on_event, M_MODEL)
|
|
126
|
+
"""
|
|
127
|
+
Register a callback to the event that the module's legacy model changes.
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
on_serial_number_change = functools.partialmethod(utils.on_event, M_SERIALNO)
|
|
131
|
+
"""
|
|
132
|
+
Register a callback to the event that the module's serial number status changes.
|
|
133
|
+
"""
|
|
134
|
+
|
|
135
|
+
on_version_number_change = functools.partialmethod(utils.on_event, M_VERSIONNO)
|
|
136
|
+
"""
|
|
137
|
+
Register a callback to the event that the module's version number status changes.
|
|
138
|
+
"""
|