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,25 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
from xoa_driver.v2 import ports
|
|
3
|
+
from xoa_driver.internals.hli_v2 import revisions
|
|
4
|
+
from xoa_driver.internals.utils.managers import ports_manager as pm
|
|
5
|
+
|
|
6
|
+
if typing.TYPE_CHECKING:
|
|
7
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
8
|
+
from .. import __interfaces as m_itf
|
|
9
|
+
|
|
10
|
+
from .module_l23_base import ModuleL23
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@typing.final
|
|
14
|
+
@revisions.register_valkyrie_module(rev="Odin-1G-3S-6P-T1-RJ45")
|
|
15
|
+
class MOdin1G3S6PT1RJ45(ModuleL23):
|
|
16
|
+
"""Test module Odin-1G-3S-6P-T1-RJ45"""
|
|
17
|
+
def __init__(self, conn: "itf.IConnection", init_data: "m_itf.ModuleInitData") -> None:
|
|
18
|
+
super().__init__(conn, init_data)
|
|
19
|
+
self.ports: pm.PortsManager[ports.POdin1G3S6PT1RJ45] = pm.PortsManager(
|
|
20
|
+
conn=conn,
|
|
21
|
+
ports_type=ports.POdin1G3S6PT1RJ45,
|
|
22
|
+
module_id=self.module_id,
|
|
23
|
+
ports_count=self.ports_count
|
|
24
|
+
)
|
|
25
|
+
"""Port index manager of Odin-1G-3S-6P-T1-RJ45"""
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
from xoa_driver.v2 import ports
|
|
3
|
+
from xoa_driver.internals.hli_v2 import revisions
|
|
4
|
+
from xoa_driver.internals.utils.managers import ports_manager as pm
|
|
5
|
+
|
|
6
|
+
if typing.TYPE_CHECKING:
|
|
7
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
8
|
+
from .. import __interfaces as m_itf
|
|
9
|
+
|
|
10
|
+
from .module_l23_base import ModuleL23
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@typing.final
|
|
14
|
+
@revisions.register_valkyrie_module(rev="Odin-40G-2S-2P")
|
|
15
|
+
class MOdin40G2S2P(ModuleL23):
|
|
16
|
+
"""Test module Odin-40G-2S-2P"""
|
|
17
|
+
def __init__(self, conn: "itf.IConnection", init_data: "m_itf.ModuleInitData") -> None:
|
|
18
|
+
super().__init__(conn, init_data)
|
|
19
|
+
self.ports: pm.PortsManager[ports.POdin40G2S2P] = pm.PortsManager(
|
|
20
|
+
conn=conn,
|
|
21
|
+
ports_type=ports.POdin40G2S2P,
|
|
22
|
+
module_id=self.module_id,
|
|
23
|
+
ports_count=self.ports_count
|
|
24
|
+
)
|
|
25
|
+
"""Port index manager of Odin-40G-2S-2P"""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@typing.final
|
|
29
|
+
@revisions.register_valkyrie_module(rev="Odin-40G-2S-2P-B")
|
|
30
|
+
class MOdin40G2S2PB(ModuleL23):
|
|
31
|
+
"""Test module Odin-40G-2S-2P-B"""
|
|
32
|
+
def __init__(self, conn: "itf.IConnection", init_data: "m_itf.ModuleInitData") -> None:
|
|
33
|
+
super().__init__(conn, init_data)
|
|
34
|
+
self.ports: pm.PortsManager[ports.POdin40G2S2PB] = pm.PortsManager(
|
|
35
|
+
conn=conn,
|
|
36
|
+
ports_type=ports.POdin40G2S2PB,
|
|
37
|
+
module_id=self.module_id,
|
|
38
|
+
ports_count=self.ports_count
|
|
39
|
+
)
|
|
40
|
+
"""Port index manager of Odin-40G-2S-2P-B"""
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import asyncio
|
|
3
|
+
import functools
|
|
4
|
+
import typing
|
|
5
|
+
from typing_extensions import Self
|
|
6
|
+
from xoa_driver.internals.commands import (
|
|
7
|
+
M_MEDIA,
|
|
8
|
+
M_STATUS,
|
|
9
|
+
M_UPGRADE,
|
|
10
|
+
M_UPGRADEPROGRESS,
|
|
11
|
+
M_TIMESYNC,
|
|
12
|
+
M_CFPTYPE,
|
|
13
|
+
M_CFPCONFIGEXT,
|
|
14
|
+
M_COMMENT,
|
|
15
|
+
# M_TIMEADJUSTMENT,
|
|
16
|
+
M_CAPABILITIES,
|
|
17
|
+
M_MEDIASUPPORT,
|
|
18
|
+
M_FPGAREIMAGE,
|
|
19
|
+
M_MULTIUSER,
|
|
20
|
+
M_CLOCKPPB,
|
|
21
|
+
M_SMAINPUT,
|
|
22
|
+
M_SMAOUTPUT,
|
|
23
|
+
M_SMASTATUS,
|
|
24
|
+
M_NAME,
|
|
25
|
+
M_REVISION,
|
|
26
|
+
M_CLOCKSYNCSTATUS,
|
|
27
|
+
M_TXCLOCKSOURCE_NEW,
|
|
28
|
+
M_TXCLOCKSTATUS_NEW,
|
|
29
|
+
M_TXCLOCKFILTER_NEW,
|
|
30
|
+
M_UPGRADEPAR,
|
|
31
|
+
M_VERSIONSTR,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
from xoa_driver.internals.utils import attributes as utils
|
|
35
|
+
from xoa_driver.internals.utils.managers import ports_manager as pm
|
|
36
|
+
from xoa_driver.internals.state_storage import modules_state
|
|
37
|
+
from xoa_driver.enums import MediaConfigurationType
|
|
38
|
+
from xoa_driver.internals.core.token import Token
|
|
39
|
+
from .. import base_module as bm
|
|
40
|
+
from .. import __interfaces as m_itf
|
|
41
|
+
|
|
42
|
+
if typing.TYPE_CHECKING:
|
|
43
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
44
|
+
from xoa_driver.internals.hli_v2.modules.module_chimera import ModuleChimera
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class TXClock:
|
|
48
|
+
"""Advanced timing clock"""
|
|
49
|
+
|
|
50
|
+
def __init__(self, conn: "itf.IConnection", module_id: int) -> None:
|
|
51
|
+
self.source = M_TXCLOCKSOURCE_NEW(conn, module_id)
|
|
52
|
+
"""The source that drives the TX clock rate of the ports on the test module.
|
|
53
|
+
Representation of M_TXCLOCKSOURCE_NEW
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
self.status = M_TXCLOCKSTATUS_NEW(conn, module_id)
|
|
57
|
+
"""TX clock status of the test module.
|
|
58
|
+
Representation of M_TXCLOCKSTATUS_NEW
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
self.filter = M_TXCLOCKFILTER_NEW(conn, module_id)
|
|
62
|
+
"""Loop bandwidth on the TX clock filter of the test module.
|
|
63
|
+
Representation of M_TXCLOCKFILTER_NEW
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class SMA:
|
|
68
|
+
"""SMA connector"""
|
|
69
|
+
|
|
70
|
+
def __init__(self, conn: "itf.IConnection", module_id: int) -> None:
|
|
71
|
+
self.input = M_SMAINPUT(conn, module_id)
|
|
72
|
+
"""SMA input of the test module.
|
|
73
|
+
Representation of M_SMAINPUT
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
self.output = M_SMAOUTPUT(conn, module_id)
|
|
77
|
+
"""SMA output of the test module.
|
|
78
|
+
Representation of M_SMAOUTPUT
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
self.status = M_SMASTATUS(conn, module_id)
|
|
82
|
+
"""SMA input status of the test module.
|
|
83
|
+
Representation of M_SMASTATUS
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class AdvancedTiming:
|
|
88
|
+
"""Advanced Timing config and control"""
|
|
89
|
+
|
|
90
|
+
def __init__(self, conn: "itf.IConnection", module_id: int) -> None:
|
|
91
|
+
self.clock_tx = TXClock(conn, module_id)
|
|
92
|
+
"""Advanced timing clock config and status
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
self.sma = SMA(conn, module_id)
|
|
96
|
+
"""SMA connector
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class ExtendedToken:
|
|
101
|
+
def __init__(
|
|
102
|
+
self, token: Token, module: typing.Union["ModuleL23", "ModuleChimera"]
|
|
103
|
+
) -> None:
|
|
104
|
+
self.__token = token
|
|
105
|
+
self.__module = module
|
|
106
|
+
|
|
107
|
+
def __await__(self):
|
|
108
|
+
return self.__ask_then().__await__()
|
|
109
|
+
|
|
110
|
+
async def __ask_then(self):
|
|
111
|
+
r = await self.__token
|
|
112
|
+
p_counts = (await self.__module.port_count.get()).port_count
|
|
113
|
+
if self.__module.ports is not None:
|
|
114
|
+
changed = self.__module.ports.reinit(p_counts)
|
|
115
|
+
if changed:
|
|
116
|
+
await self.__module.ports.fill()
|
|
117
|
+
return r
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class MediaModule:
|
|
121
|
+
def __init__(self, conn: "itf.IConnection", module: typing.Union["ModuleL23", "ModuleChimera"]) -> None:
|
|
122
|
+
self.__media = M_MEDIA(conn, module.module_id)
|
|
123
|
+
self.__module = module
|
|
124
|
+
|
|
125
|
+
def get(self) -> Token:
|
|
126
|
+
return self.__media.get()
|
|
127
|
+
|
|
128
|
+
def set(self, media_config: MediaConfigurationType) -> ExtendedToken:
|
|
129
|
+
return ExtendedToken(self.__media.set(media_config), self.__module)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class CfpModule:
|
|
133
|
+
def __init__(self, conn: "itf.IConnection", module: typing.Union["ModuleL23", "ModuleChimera"]) -> None:
|
|
134
|
+
self.__cfpconfigext = M_CFPCONFIGEXT(conn, module.module_id)
|
|
135
|
+
self.__module = module
|
|
136
|
+
|
|
137
|
+
def get(self) -> Token:
|
|
138
|
+
return self.__cfpconfigext.get()
|
|
139
|
+
|
|
140
|
+
def set(self, portspeed_list: typing.List[int]) -> ExtendedToken:
|
|
141
|
+
return ExtendedToken(self.__cfpconfigext.set(portspeed_list), self.__module)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class CFP:
|
|
145
|
+
"""Test module CFP"""
|
|
146
|
+
|
|
147
|
+
def __init__(self, conn: "itf.IConnection", module: typing.Union["ModuleChimera", "ModuleL23"]) -> None:
|
|
148
|
+
self.type = M_CFPTYPE(conn, module.module_id)
|
|
149
|
+
"""The transceiver's CFP type currently inserted.
|
|
150
|
+
Representation of M_CFPTYPE
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
self.config = CfpModule(conn, module)
|
|
154
|
+
"""The CFP configuration of the test module.
|
|
155
|
+
Representation of M_CFPCONFIGEXT
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class MTiming:
|
|
160
|
+
"""Test module timing and clock configuration"""
|
|
161
|
+
|
|
162
|
+
def __init__(self, conn: "itf.IConnection", module_id: int) -> None:
|
|
163
|
+
self.source = M_TIMESYNC(conn, module_id)
|
|
164
|
+
"""Timing source of the test module.
|
|
165
|
+
Representation of M_TIMESYNC
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
self.clock_local_adjust = M_CLOCKPPB(conn, module_id)
|
|
169
|
+
"""Time adjustment controlling of the local clock of the test module, which drives the TX rate of the test ports.
|
|
170
|
+
Representation of M_CLOCKPPB
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
self.clock_sync_status = M_CLOCKSYNCSTATUS(conn, module_id)
|
|
174
|
+
"""Test module's clock sync status.
|
|
175
|
+
Representation of M_CLOCKSYNCSTATUS
|
|
176
|
+
"""
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class MUpgrade:
|
|
180
|
+
"""Test module upgrade"""
|
|
181
|
+
|
|
182
|
+
def __init__(self, conn: "itf.IConnection", module_id: int) -> None:
|
|
183
|
+
self.start = M_UPGRADE(conn, module_id)
|
|
184
|
+
"""Start the upgrade progress of the test module.
|
|
185
|
+
Representation of M_UPGRADE
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
self.progress = M_UPGRADEPROGRESS(conn, module_id)
|
|
189
|
+
"""Upgrade progress status of the test module.
|
|
190
|
+
Representation of M_UPGRADEPROGRESS
|
|
191
|
+
"""
|
|
192
|
+
|
|
193
|
+
self.reload_image = M_FPGAREIMAGE(conn, module_id)
|
|
194
|
+
"""Reload the FPGA image of the test module.
|
|
195
|
+
Representation of M_FPGAREIMAGE
|
|
196
|
+
"""
|
|
197
|
+
self.start_parallel = M_UPGRADEPAR(conn, module_id)
|
|
198
|
+
"""
|
|
199
|
+
Start the parallel upgrade progress of the test module.
|
|
200
|
+
|
|
201
|
+
:type: M_UPGRADEPAR
|
|
202
|
+
"""
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
class ModuleL23(bm.BaseModule["modules_state.ModuleL23LocalState"]):
|
|
206
|
+
"""
|
|
207
|
+
Representation of a L23 test module on a physical tester.
|
|
208
|
+
"""
|
|
209
|
+
|
|
210
|
+
def __init__(self, conn: "itf.IConnection", init_data: "m_itf.ModuleInitData") -> None:
|
|
211
|
+
super().__init__(conn, init_data)
|
|
212
|
+
|
|
213
|
+
self._local_states = modules_state.ModuleL23LocalState()
|
|
214
|
+
|
|
215
|
+
self.name = M_NAME(conn, self.module_id)
|
|
216
|
+
"""Test module's name.
|
|
217
|
+
Representation of M_NAME
|
|
218
|
+
"""
|
|
219
|
+
|
|
220
|
+
self.comment = M_COMMENT(conn, self.module_id)
|
|
221
|
+
"""Test module's description.
|
|
222
|
+
Representation of M_COMMENT
|
|
223
|
+
"""
|
|
224
|
+
|
|
225
|
+
self.status = M_STATUS(conn, self.module_id)
|
|
226
|
+
"""Test module's status.
|
|
227
|
+
Representation of M_STATUS
|
|
228
|
+
"""
|
|
229
|
+
|
|
230
|
+
self.media = MediaModule(conn, self)
|
|
231
|
+
"""Test module's media configuration.
|
|
232
|
+
Representation of MediaModule
|
|
233
|
+
"""
|
|
234
|
+
|
|
235
|
+
self.available_speeds = M_MEDIASUPPORT(conn, self.module_id)
|
|
236
|
+
"""Test module's available speeds.
|
|
237
|
+
Representation of M_MEDIASUPPORT
|
|
238
|
+
"""
|
|
239
|
+
|
|
240
|
+
self.revision = M_REVISION(conn, self.module_id)
|
|
241
|
+
"""Test module's model P/N name.
|
|
242
|
+
Representation of M_REVISION
|
|
243
|
+
"""
|
|
244
|
+
|
|
245
|
+
self.version_str = M_VERSIONSTR(conn, self.module_id)
|
|
246
|
+
"""Module version number in the new format
|
|
247
|
+
|
|
248
|
+
:type: M_VERSIONSTR
|
|
249
|
+
"""
|
|
250
|
+
|
|
251
|
+
self.multiuser = M_MULTIUSER(conn, self.module_id)
|
|
252
|
+
"""If multiple users are allowed to control the same test module.
|
|
253
|
+
Representation of M_MULTIUSER
|
|
254
|
+
"""
|
|
255
|
+
|
|
256
|
+
self.capabilities = M_CAPABILITIES(conn, self.module_id)
|
|
257
|
+
"""Test module's capabilities.
|
|
258
|
+
Representation of M_CAPABILITIES
|
|
259
|
+
"""
|
|
260
|
+
|
|
261
|
+
self.timing = MTiming(conn, self.module_id)
|
|
262
|
+
"""Test module's timing configuration."""
|
|
263
|
+
|
|
264
|
+
self.advanced_timing = AdvancedTiming(conn, self.module_id)
|
|
265
|
+
"""Test module's advanced timing ."""
|
|
266
|
+
|
|
267
|
+
self.cfp = CFP(conn, self)
|
|
268
|
+
"""Test module's CFP """
|
|
269
|
+
|
|
270
|
+
self.upgrade = MUpgrade(conn, self.module_id)
|
|
271
|
+
"""Test module's upgrade.
|
|
272
|
+
|
|
273
|
+
:type: MUpgrade
|
|
274
|
+
"""
|
|
275
|
+
|
|
276
|
+
self.ports: typing.Optional[pm.PortsManager] = None
|
|
277
|
+
"""L23 port index manager of the test module."""
|
|
278
|
+
|
|
279
|
+
@property
|
|
280
|
+
def info(self) -> modules_state.ModuleL23LocalState:
|
|
281
|
+
return self._local_states
|
|
282
|
+
|
|
283
|
+
async def _setup(self) -> Self:
|
|
284
|
+
if self.ports is None:
|
|
285
|
+
raise NotImplementedError("Ports manager type are not defined.") # Maybe can be better solution then this...
|
|
286
|
+
await asyncio.gather(
|
|
287
|
+
self._local_states.initiate(self),
|
|
288
|
+
self.ports.fill()
|
|
289
|
+
)
|
|
290
|
+
self._local_states.register_subscriptions(self)
|
|
291
|
+
return self
|
|
292
|
+
|
|
293
|
+
on_cfp_type_change = functools.partialmethod(utils.on_event, M_CFPTYPE)
|
|
294
|
+
"""Register a callback to the event that the module's CFP type changes."""
|
|
295
|
+
|
|
296
|
+
on_cfp_config_change = functools.partialmethod(utils.on_event, M_CFPCONFIGEXT)
|
|
297
|
+
"""Register a callback to the event that the module's CFP configuration changes."""
|
|
298
|
+
|
|
299
|
+
on_status_change = functools.partialmethod(utils.on_event, M_STATUS)
|
|
300
|
+
"""Register a callback to the event that the module's status changes."""
|
|
301
|
+
|
|
302
|
+
on_revision_change = functools.partialmethod(utils.on_event, M_REVISION)
|
|
303
|
+
"""Register a callback to the event that the module's model type changes."""
|
|
304
|
+
|
|
305
|
+
on_name_change = functools.partialmethod(utils.on_event, M_NAME)
|
|
306
|
+
"""Register a callback to the event that the module's name changes."""
|
|
307
|
+
|
|
308
|
+
on_adv_timing_clock_tx_status_change = functools.partialmethod(utils.on_event, M_TXCLOCKSTATUS_NEW)
|
|
309
|
+
"""Register a callback to the event that the module's TX clock status changes."""
|
|
310
|
+
|
|
311
|
+
on_adv_timing_clock_tx_source_change = functools.partialmethod(utils.on_event, M_TXCLOCKSOURCE_NEW)
|
|
312
|
+
"""Register a callback to the event that the module's clock that drives the port TX rates changes."""
|
|
313
|
+
|
|
314
|
+
on_adv_timing_clock_tx_filter_change = functools.partialmethod(utils.on_event, M_TXCLOCKFILTER_NEW)
|
|
315
|
+
"""Register a callback to the event that the module's loop bandwidth on the TX clock filter changes."""
|
|
316
|
+
|
|
317
|
+
on_adv_timing_sma_status_change = functools.partialmethod(utils.on_event, M_SMASTATUS)
|
|
318
|
+
"""Register a callback to the event that the module's SMA status changes."""
|
|
319
|
+
|
|
320
|
+
on_adv_timing_sma_input_change = functools.partialmethod(utils.on_event, M_SMAINPUT)
|
|
321
|
+
"""Register a callback to the event that the module's SMA input function changes."""
|
|
322
|
+
|
|
323
|
+
on_adv_timing_sma_output_change = functools.partialmethod(utils.on_event, M_SMAOUTPUT)
|
|
324
|
+
"""Register a callback to the event that the module's SMA output function changes."""
|
|
325
|
+
|
|
326
|
+
on_media_support_change = functools.partialmethod(utils.on_event, M_MEDIASUPPORT)
|
|
327
|
+
"""Register a callback to the event that the module's supported media changes."""
|
|
328
|
+
|
|
329
|
+
on_media_change = functools.partialmethod(utils.on_event, M_MEDIA)
|
|
330
|
+
"""Register a callback to the event that the module's media and available speeds change."""
|
|
331
|
+
|
|
332
|
+
on_comment_change = functools.partialmethod(utils.on_event, M_COMMENT)
|
|
333
|
+
"""Register a callback to the event that the module's description changes."""
|
|
334
|
+
|
|
335
|
+
on_timing_source_change = functools.partialmethod(utils.on_event, M_TIMESYNC)
|
|
336
|
+
"""Register a callback to the event that the module's timesync mode changes."""
|
|
337
|
+
|
|
338
|
+
on_timing_clock_local_adjust_change = functools.partialmethod(utils.on_event, M_CLOCKPPB)
|
|
339
|
+
"""Register a callback to the event that the module's clock adjustment ppb changes."""
|
|
File without changes
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
from typing_extensions import Self
|
|
3
|
+
from abc import (
|
|
4
|
+
ABC,
|
|
5
|
+
abstractmethod,
|
|
6
|
+
)
|
|
7
|
+
from typing import (
|
|
8
|
+
TYPE_CHECKING,
|
|
9
|
+
TypeVar,
|
|
10
|
+
Generic,
|
|
11
|
+
)
|
|
12
|
+
from xoa_driver.internals.commands import enums
|
|
13
|
+
from xoa_driver.internals.commands import (
|
|
14
|
+
P_RESERVATION,
|
|
15
|
+
P_RESERVEDBY,
|
|
16
|
+
P_RESET,
|
|
17
|
+
P_COMMENT,
|
|
18
|
+
P_INTERFACE,
|
|
19
|
+
P_RECEIVESYNC,
|
|
20
|
+
)
|
|
21
|
+
from xoa_driver.internals.state_storage import ports_state
|
|
22
|
+
from xoa_driver.internals.utils import attributes as utils
|
|
23
|
+
from xoa_driver.internals.utils import kind
|
|
24
|
+
|
|
25
|
+
if TYPE_CHECKING:
|
|
26
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
PortStateStorage = TypeVar('PortStateStorage', bound="ports_state.PortLocalState")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class BasePort(ABC, Generic[PortStateStorage]):
|
|
33
|
+
"""Layout which is relevant to all ports."""
|
|
34
|
+
|
|
35
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
36
|
+
self._conn = conn
|
|
37
|
+
self.kind = kind.PortKind(module_id, port_id)
|
|
38
|
+
self.sync_status = P_RECEIVESYNC(conn, module_id, port_id)
|
|
39
|
+
"""Port sync status.
|
|
40
|
+
Representation of P_RECEIVESYNC
|
|
41
|
+
"""
|
|
42
|
+
self.interface = P_INTERFACE(conn, module_id, port_id)
|
|
43
|
+
"""Physical interface type of the port.
|
|
44
|
+
Representation of P_INTERFACE
|
|
45
|
+
"""
|
|
46
|
+
self.reservation = P_RESERVATION(self._conn, *self.kind)
|
|
47
|
+
"""Port reservation action.
|
|
48
|
+
Representation of P_RESERVATION
|
|
49
|
+
"""
|
|
50
|
+
self.reserved_by = P_RESERVEDBY(self._conn, *self.kind)
|
|
51
|
+
"""Port reservation status.
|
|
52
|
+
Representation of P_RESERVEDBY
|
|
53
|
+
"""
|
|
54
|
+
self.reset = P_RESET(self._conn, *self.kind)
|
|
55
|
+
"""Port reset action.
|
|
56
|
+
Representation of P_RESET
|
|
57
|
+
"""
|
|
58
|
+
self.comment = P_COMMENT(self._conn, *self.kind)
|
|
59
|
+
"""Port description.
|
|
60
|
+
Representation of P_COMMENT
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
def __await__(self):
|
|
64
|
+
return self._setup().__await__()
|
|
65
|
+
|
|
66
|
+
@abstractmethod
|
|
67
|
+
async def _setup(self) -> Self:
|
|
68
|
+
return self
|
|
69
|
+
|
|
70
|
+
def _check_identity(self, request) -> bool:
|
|
71
|
+
validators = (
|
|
72
|
+
self.kind.module_id == request.header.module_index,
|
|
73
|
+
self.kind.port_id == request.header.port_index
|
|
74
|
+
)
|
|
75
|
+
return all(validators)
|
|
76
|
+
|
|
77
|
+
def __is_reservation(self, reserved_status: enums.ReservedStatus) -> bool:
|
|
78
|
+
return self.info.reservation == reserved_status
|
|
79
|
+
|
|
80
|
+
is_released = functools.partialmethod(__is_reservation, enums.ReservedStatus.RELEASED)
|
|
81
|
+
"""Check if port is released"""
|
|
82
|
+
|
|
83
|
+
is_reserved_by_me = functools.partialmethod(__is_reservation, enums.ReservedStatus.RESERVED_BY_YOU)
|
|
84
|
+
"""Check if port is released by me"""
|
|
85
|
+
|
|
86
|
+
is_reserved_by_others = functools.partialmethod(__is_reservation, enums.ReservedStatus.RESERVED_BY_OTHER)
|
|
87
|
+
"""Check if port is released by others"""
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
@abstractmethod
|
|
91
|
+
def info(self) -> PortStateStorage:
|
|
92
|
+
"""Module info"""
|
|
93
|
+
raise NotImplementedError()
|
|
94
|
+
|
|
95
|
+
on_reservation_change = functools.partialmethod(utils.on_event, P_RESERVATION)
|
|
96
|
+
"""Register a callback to the event that the port's reservation status changes."""
|
|
97
|
+
|
|
98
|
+
on_receive_sync_change = functools.partialmethod(utils.on_event, P_RECEIVESYNC)
|
|
99
|
+
"""Register a callback to the event that the port's SYNC status changes."""
|
|
100
|
+
|
|
101
|
+
on_reserved_by_change = functools.partialmethod(utils.on_event, P_RESERVEDBY)
|
|
102
|
+
"""Register a callback to the event that the port's reservation ownership changes."""
|
|
103
|
+
|
|
104
|
+
on_interface_change = functools.partialmethod(utils.on_event, P_INTERFACE)
|
|
105
|
+
"""Register a callback to the event that the port's physical interface type changes."""
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from typing import (
|
|
2
|
+
TYPE_CHECKING,
|
|
3
|
+
List,
|
|
4
|
+
)
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
7
|
+
from xoa_driver.internals.commands import (
|
|
8
|
+
P_CAPTURE,
|
|
9
|
+
PC_TRIGGER,
|
|
10
|
+
PC_KEEP,
|
|
11
|
+
PC_STATS,
|
|
12
|
+
PC_EXTRA,
|
|
13
|
+
PC_PACKET,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ObtainCaptured:
|
|
18
|
+
"""Obtain info of captured packets.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, capture_pkt_idx: int) -> None:
|
|
22
|
+
self.extra = PC_EXTRA(conn, module_id, port_id, capture_pkt_idx)
|
|
23
|
+
"""Obtains extra information about a captured packet on a L23 port.
|
|
24
|
+
Representation of PC_EXTRA
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
self.packet = PC_PACKET(conn, module_id, port_id, capture_pkt_idx)
|
|
28
|
+
"""Obtains raw bytes of a captured packet on a L23 port.
|
|
29
|
+
Representation of PC_PACKET
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class PortCapture:
|
|
34
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
35
|
+
self.__conn = conn
|
|
36
|
+
self.__module_id = module_id
|
|
37
|
+
self.__port_id = port_id
|
|
38
|
+
self.state = P_CAPTURE(conn, module_id, port_id)
|
|
39
|
+
"""L23 port traffic capture.
|
|
40
|
+
Representation of P_CAPTURE
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
self.trigger = PC_TRIGGER(conn, module_id, port_id)
|
|
44
|
+
"""L23 port packet capture triggering criteria.
|
|
45
|
+
Representation of PC_TRIGGER
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
self.keep = PC_KEEP(conn, module_id, port_id)
|
|
49
|
+
"""Keeping captured packets on a L23 port.
|
|
50
|
+
Representation of PC_KEEP
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
self.stats = PC_STATS(conn, module_id, port_id)
|
|
54
|
+
"""L23 port's number of packets in the capture buffer.
|
|
55
|
+
Representation of PC_STATS
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
async def obtain_captured(self) -> List[ObtainCaptured]:
|
|
59
|
+
# TODO: check better title for this operation
|
|
60
|
+
stats = await self.stats.get()
|
|
61
|
+
return [
|
|
62
|
+
ObtainCaptured(self.__conn, self.__module_id, self.__port_id, idx)
|
|
63
|
+
for idx in range(stats.packets)
|
|
64
|
+
]
|