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,174 @@
|
|
|
1
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
2
|
+
from xoa_driver.internals.commands import (
|
|
3
|
+
P4_ETH_TX_COUNTERS,
|
|
4
|
+
P4_ETH_RX_COUNTERS,
|
|
5
|
+
P4_PORT_TX_COUNTERS,
|
|
6
|
+
P4_PORT_RX_COUNTERS,
|
|
7
|
+
P4_PORT_COUNTERS,
|
|
8
|
+
P4_IPV4_RX_COUNTERS,
|
|
9
|
+
P4_IPV4_TX_COUNTERS,
|
|
10
|
+
P4_IPV4_COUNTERS,
|
|
11
|
+
P4_IPV6_RX_COUNTERS,
|
|
12
|
+
P4_IPV6_TX_COUNTERS,
|
|
13
|
+
P4_IPV6_COUNTERS,
|
|
14
|
+
P4_ARP_RX_COUNTERS,
|
|
15
|
+
P4_ARP_TX_COUNTERS,
|
|
16
|
+
P4_ARP_COUNTERS,
|
|
17
|
+
P4_NDP_RX_COUNTERS,
|
|
18
|
+
P4_NDP_TX_COUNTERS,
|
|
19
|
+
P4_NDP_COUNTERS,
|
|
20
|
+
P4_ICMP_RX_COUNTERS,
|
|
21
|
+
P4_ICMP_TX_COUNTERS,
|
|
22
|
+
P4_ICMP_COUNTERS,
|
|
23
|
+
P4_TCP_RX_COUNTERS,
|
|
24
|
+
P4_TCP_TX_COUNTERS,
|
|
25
|
+
P4_TCP_COUNTERS,
|
|
26
|
+
P4_UDP_RX_COUNTERS,
|
|
27
|
+
P4_UDP_TX_COUNTERS,
|
|
28
|
+
P4_UDP_COUNTERS,
|
|
29
|
+
P4_CLEAR_COUNTERS,
|
|
30
|
+
P4_ETH_COUNTERS,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class PCountersIPv4:
|
|
35
|
+
"""IPV4 statistics"""
|
|
36
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
37
|
+
self.rx = P4_IPV4_RX_COUNTERS(conn, module_id, port_id)
|
|
38
|
+
"""
|
|
39
|
+
:type: P4_IPV4_RX_COUNTERS"""
|
|
40
|
+
self.tx = P4_IPV4_TX_COUNTERS(conn, module_id, port_id)
|
|
41
|
+
"""
|
|
42
|
+
:type: P4_IPV4_TX_COUNTERS"""
|
|
43
|
+
self.total = P4_IPV4_COUNTERS(conn, module_id, port_id)
|
|
44
|
+
"""
|
|
45
|
+
:type: P4_IPV4_COUNTERS"""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class PCountersIPv6:
|
|
49
|
+
"""IPV6 statistics"""
|
|
50
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
51
|
+
self.rx = P4_IPV6_RX_COUNTERS(conn, module_id, port_id)
|
|
52
|
+
"""
|
|
53
|
+
:type: P4_IPV6_RX_COUNTERS"""
|
|
54
|
+
self.tx = P4_IPV6_TX_COUNTERS(conn, module_id, port_id)
|
|
55
|
+
"""
|
|
56
|
+
:type: P4_IPV6_TX_COUNTERS"""
|
|
57
|
+
self.total = P4_IPV6_COUNTERS(conn, module_id, port_id)
|
|
58
|
+
"""
|
|
59
|
+
:type: P4_IPV6_COUNTERS"""
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class PCountersICMP:
|
|
63
|
+
"""ICMP statistics"""
|
|
64
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
65
|
+
self.rx = P4_ICMP_RX_COUNTERS(conn, module_id, port_id)
|
|
66
|
+
"""
|
|
67
|
+
:type: P4_ICMP_RX_COUNTERS"""
|
|
68
|
+
self.tx = P4_ICMP_TX_COUNTERS(conn, module_id, port_id)
|
|
69
|
+
"""
|
|
70
|
+
:type: P4_ICMP_TX_COUNTERS"""
|
|
71
|
+
self.total = P4_ICMP_COUNTERS(conn, module_id, port_id)
|
|
72
|
+
"""
|
|
73
|
+
:type: P4_ICMP_COUNTERS"""
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class PCountersTCP:
|
|
77
|
+
"""ICMP statistics"""
|
|
78
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
79
|
+
self.rx = P4_TCP_RX_COUNTERS(conn, module_id, port_id)
|
|
80
|
+
"""
|
|
81
|
+
:type: P4_TCP_RX_COUNTERS"""
|
|
82
|
+
self.tx = P4_TCP_TX_COUNTERS(conn, module_id, port_id)
|
|
83
|
+
"""
|
|
84
|
+
:type: P4_TCP_TX_COUNTERS"""
|
|
85
|
+
self.total = P4_TCP_COUNTERS(conn, module_id, port_id)
|
|
86
|
+
"""
|
|
87
|
+
:type: P4_TCP_COUNTERS"""
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class PCountersUDP:
|
|
91
|
+
"""ICMP statistics"""
|
|
92
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
93
|
+
self.rx = P4_UDP_RX_COUNTERS(conn, module_id, port_id)
|
|
94
|
+
"""
|
|
95
|
+
:type: P4_UDP_RX_COUNTERS"""
|
|
96
|
+
self.tx = P4_UDP_TX_COUNTERS(conn, module_id, port_id)
|
|
97
|
+
"""
|
|
98
|
+
:type: P4_UDP_TX_COUNTERS"""
|
|
99
|
+
self.total = P4_UDP_COUNTERS(conn, module_id, port_id)
|
|
100
|
+
"""
|
|
101
|
+
:type: P4_UDP_COUNTERS"""
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class PCountersETH:
|
|
105
|
+
"""ICMP statistics"""
|
|
106
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
107
|
+
self.rx = P4_ETH_RX_COUNTERS(conn, module_id, port_id)
|
|
108
|
+
"""
|
|
109
|
+
:type: P4_ETH_RX_COUNTERS"""
|
|
110
|
+
self.tx = P4_ETH_TX_COUNTERS(conn, module_id, port_id)
|
|
111
|
+
"""
|
|
112
|
+
:type: P4_ETH_TX_COUNTERS"""
|
|
113
|
+
self.total = P4_ETH_COUNTERS(conn, module_id, port_id)
|
|
114
|
+
"""
|
|
115
|
+
:type: P4_ETH_COUNTERS"""
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class PCountersARP:
|
|
119
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
120
|
+
self.rx = P4_ARP_RX_COUNTERS(conn, module_id, port_id)
|
|
121
|
+
"""
|
|
122
|
+
:type: P4_ARP_RX_COUNTERS"""
|
|
123
|
+
self.tx = P4_ARP_TX_COUNTERS(conn, module_id, port_id)
|
|
124
|
+
"""
|
|
125
|
+
:type: P4_ARP_TX_COUNTERS"""
|
|
126
|
+
self.total = P4_ARP_COUNTERS(conn, module_id, port_id)
|
|
127
|
+
"""
|
|
128
|
+
:type: P4_ARP_COUNTERS"""
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class PCountersNDP:
|
|
132
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
133
|
+
self.rx = P4_NDP_RX_COUNTERS(conn, module_id, port_id)
|
|
134
|
+
"""
|
|
135
|
+
:type: P4_NDP_RX_COUNTERS"""
|
|
136
|
+
self.tx = P4_NDP_TX_COUNTERS(conn, module_id, port_id)
|
|
137
|
+
"""
|
|
138
|
+
:type: P4_NDP_TX_COUNTERS"""
|
|
139
|
+
self.total = P4_NDP_COUNTERS(conn, module_id, port_id)
|
|
140
|
+
"""
|
|
141
|
+
:type: P4_NDP_COUNTERS"""
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class PCounters:
|
|
145
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
146
|
+
self.clear = P4_CLEAR_COUNTERS(conn, module_id, port_id)
|
|
147
|
+
"""
|
|
148
|
+
:type: P4_CLEAR_COUNTERS"""
|
|
149
|
+
self.total_tx = P4_PORT_TX_COUNTERS(conn, module_id, port_id)
|
|
150
|
+
"""
|
|
151
|
+
:type: P4_PORT_TX_COUNTERS"""
|
|
152
|
+
self.total_rx = P4_PORT_RX_COUNTERS(conn, module_id, port_id)
|
|
153
|
+
"""
|
|
154
|
+
:type: P4_PORT_RX_COUNTERS"""
|
|
155
|
+
self.total = P4_PORT_COUNTERS(conn, module_id, port_id)
|
|
156
|
+
"""
|
|
157
|
+
:type: P4_PORT_COUNTERS"""
|
|
158
|
+
|
|
159
|
+
self.ipv4 = PCountersIPv4(conn, module_id, port_id)
|
|
160
|
+
"""L47 port IPv4 counters."""
|
|
161
|
+
self.ipv6 = PCountersIPv6(conn, module_id, port_id)
|
|
162
|
+
"""L47 port IPv6 counters."""
|
|
163
|
+
self.icmp = PCountersICMP(conn, module_id, port_id)
|
|
164
|
+
"""L47 port ICMP counters."""
|
|
165
|
+
self.tcp = PCountersTCP(conn, module_id, port_id)
|
|
166
|
+
"""L47 port TCP counters."""
|
|
167
|
+
self.udp = PCountersUDP(conn, module_id, port_id)
|
|
168
|
+
"""L47 port UDP counters."""
|
|
169
|
+
self.eth = PCountersETH(conn, module_id, port_id)
|
|
170
|
+
"""L47 port Ethernet counters."""
|
|
171
|
+
self.arp = PCountersARP(conn, module_id, port_id)
|
|
172
|
+
"""L47 port ARP counters."""
|
|
173
|
+
self.ndp = PCountersNDP(conn, module_id, port_id)
|
|
174
|
+
"""L47 port NDP counters."""
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
3
|
+
from typing_extensions import Self
|
|
4
|
+
|
|
5
|
+
from xoa_driver.internals.commands import (
|
|
6
|
+
P4_TRAFFIC,
|
|
7
|
+
P4_STATE,
|
|
8
|
+
P4_CAPABILITIES,
|
|
9
|
+
P4_STATE_STATUS,
|
|
10
|
+
P4_VLAN_OFFLOAD,
|
|
11
|
+
P4_ARP_CONFIG,
|
|
12
|
+
P4_NDP_CONFIG,
|
|
13
|
+
P4_CAPTURE,
|
|
14
|
+
P4_CAPTURE_GET_FIRST,
|
|
15
|
+
P4_CAPTURE_GET_NEXT,
|
|
16
|
+
P4_TX_PACKET_SIZE,
|
|
17
|
+
P4_RX_PACKET_SIZE,
|
|
18
|
+
P4_TX_MTU,
|
|
19
|
+
P4_RX_MTU,
|
|
20
|
+
P4_CLEAR,
|
|
21
|
+
P4_SPEEDSELECTION,
|
|
22
|
+
P4_MAX_PACKET_RATE,
|
|
23
|
+
P4_PCI_INFO,
|
|
24
|
+
P4_FW_VER,
|
|
25
|
+
P4_DEV_NAME,
|
|
26
|
+
P4_PORT_TYPE,
|
|
27
|
+
P4_LICENSE_INFO,
|
|
28
|
+
P4_APTITUDES,
|
|
29
|
+
)
|
|
30
|
+
if TYPE_CHECKING:
|
|
31
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
32
|
+
|
|
33
|
+
from xoa_driver.internals.hli_v1.ports import base_port
|
|
34
|
+
from xoa_driver.internals.state_storage import ports_state
|
|
35
|
+
from xoa_driver.internals.utils import attributes as utils
|
|
36
|
+
from xoa_driver.internals.utils.indices import index_manager as im
|
|
37
|
+
from xoa_driver.internals.hli_v1.indices.connection_group.cg import ConnectionGroupIdx
|
|
38
|
+
|
|
39
|
+
from .counters import PCounters
|
|
40
|
+
from .packet_engine import PacketEngine
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class PCapture:
|
|
44
|
+
"""Packet capture
|
|
45
|
+
"""
|
|
46
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
47
|
+
self.start = P4_CAPTURE(conn, module_id, port_id)
|
|
48
|
+
"""Control L47 packet capture.
|
|
49
|
+
|
|
50
|
+
:type: P4_CAPTURE
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
self.get_first_frame = P4_CAPTURE_GET_FIRST(conn, module_id, port_id)
|
|
54
|
+
"""Get the first captured packet.
|
|
55
|
+
|
|
56
|
+
:type: P4_CAPTURE_GET_FIRST
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
self.get_next_frame = P4_CAPTURE_GET_NEXT(conn, module_id, port_id)
|
|
60
|
+
"""Get the next captured packet.
|
|
61
|
+
|
|
62
|
+
:type: P4_CAPTURE_GET_NEXT
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class PortL47(base_port.BasePort["ports_state.PortL47LocalState"]):
|
|
67
|
+
"""L47 Port"""
|
|
68
|
+
|
|
69
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
70
|
+
super().__init__(conn, module_id, port_id)
|
|
71
|
+
|
|
72
|
+
self._local_states = ports_state.PortL47LocalState()
|
|
73
|
+
|
|
74
|
+
self.traffic = P4_TRAFFIC(self._conn, module_id, port_id)
|
|
75
|
+
"""
|
|
76
|
+
Control L47 traffic.
|
|
77
|
+
|
|
78
|
+
:type: P4_TRAFFIC
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
self.clear = P4_CLEAR(self._conn, module_id, port_id)
|
|
82
|
+
"""
|
|
83
|
+
Clear all the connection groups on the port and set the port state to OFF.
|
|
84
|
+
|
|
85
|
+
:type: P4_CLEAR
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
self.state = P4_STATE(self._conn, module_id, port_id)
|
|
89
|
+
"""
|
|
90
|
+
:type: P4_STATE
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
self.type = P4_PORT_TYPE(self._conn, module_id, port_id)
|
|
94
|
+
"""
|
|
95
|
+
:type: P4_PORT_TYPE
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
self.aptitudes = P4_APTITUDES(self._conn, module_id, port_id)
|
|
99
|
+
"""
|
|
100
|
+
:type: P4_APTITUDES
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
self.last_state_status = P4_STATE_STATUS(self._conn, module_id, port_id)
|
|
104
|
+
"""
|
|
105
|
+
:type: P4_STATE_STATUS
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
self.nic_name = P4_DEV_NAME(self._conn, module_id, port_id)
|
|
109
|
+
"""
|
|
110
|
+
:type: P4_DEV_NAME
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
self.nic_firmware_version = P4_FW_VER(self._conn, module_id, port_id)
|
|
114
|
+
"""
|
|
115
|
+
:type: P4_FW_VER
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
self.vlan_offload = P4_VLAN_OFFLOAD(self._conn, module_id, port_id)
|
|
119
|
+
"""
|
|
120
|
+
:type: P4_VLAN_OFFLOAD
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
self.max_packet_rate = P4_MAX_PACKET_RATE(self._conn, module_id, port_id)
|
|
124
|
+
"""
|
|
125
|
+
:type: P4_MAX_PACKET_RATE
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
self.capabilities = P4_CAPABILITIES(self._conn, module_id, port_id)
|
|
129
|
+
"""
|
|
130
|
+
:type: P4_CAPABILITIES
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
self.speed_selection = P4_SPEEDSELECTION(self._conn, module_id, port_id)
|
|
134
|
+
"""
|
|
135
|
+
:type: P4_SPEEDSELECTION
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
# region Not sure if this commands must be at this level
|
|
139
|
+
self.tx_packet_size = P4_TX_PACKET_SIZE(self._conn, module_id, port_id)
|
|
140
|
+
"""
|
|
141
|
+
:type: P4_TX_PACKET_SIZE
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
self.rx_packet_size = P4_RX_PACKET_SIZE(self._conn, module_id, port_id)
|
|
145
|
+
"""
|
|
146
|
+
:type: P4_RX_PACKET_SIZE
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
self.tx_mtu = P4_TX_MTU(self._conn, module_id, port_id)
|
|
150
|
+
"""
|
|
151
|
+
:type: P4_TX_MTU
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
self.rx_mtu = P4_RX_MTU(self._conn, module_id, port_id)
|
|
155
|
+
"""
|
|
156
|
+
:type: P4_RX_MTU
|
|
157
|
+
"""
|
|
158
|
+
# endregion
|
|
159
|
+
|
|
160
|
+
self.pci_info = P4_PCI_INFO(self._conn, module_id, port_id)
|
|
161
|
+
"""
|
|
162
|
+
:type: P4_PCI_INFO
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
self.license_info = P4_LICENSE_INFO(self._conn, module_id, port_id)
|
|
166
|
+
"""
|
|
167
|
+
:type: P4_LICENSE_INFO
|
|
168
|
+
"""
|
|
169
|
+
|
|
170
|
+
self.arp_config = P4_ARP_CONFIG(self._conn, module_id, port_id)
|
|
171
|
+
"""
|
|
172
|
+
:type: P4_ARP_CONFIG
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
self.ndp_config = P4_NDP_CONFIG(self._conn, module_id, port_id)
|
|
176
|
+
"""
|
|
177
|
+
:type: P4_NDP_CONFIG
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
self.capture = PCapture(self._conn, module_id, port_id)
|
|
181
|
+
"""L47 packet capture
|
|
182
|
+
|
|
183
|
+
:type: PCapture
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
self.counters = PCounters(self._conn, module_id, port_id)
|
|
187
|
+
"""L47 counters
|
|
188
|
+
|
|
189
|
+
:type: PCounters
|
|
190
|
+
"""
|
|
191
|
+
|
|
192
|
+
self.packet_engine = PacketEngine(self._conn, module_id, port_id)
|
|
193
|
+
"""L47 packet engine.
|
|
194
|
+
|
|
195
|
+
:type: ~xoa_driver.internals.hli_v1.ports.port_l47.packet_engine.PacketEngine
|
|
196
|
+
"""
|
|
197
|
+
|
|
198
|
+
self.connection_groups: "im.IndexManager[ConnectionGroupIdx]" = im.IndexManager(
|
|
199
|
+
self._conn,
|
|
200
|
+
ConnectionGroupIdx,
|
|
201
|
+
module_id,
|
|
202
|
+
port_id
|
|
203
|
+
)
|
|
204
|
+
"""L47 connection group index manager.
|
|
205
|
+
|
|
206
|
+
:type: IndexManager
|
|
207
|
+
"""
|
|
208
|
+
|
|
209
|
+
@property
|
|
210
|
+
def info(self) -> ports_state.PortL47LocalState:
|
|
211
|
+
return self._local_states
|
|
212
|
+
|
|
213
|
+
async def _setup(self) -> Self:
|
|
214
|
+
await self._local_states.initiate(self)
|
|
215
|
+
self._local_states.register_subscriptions(self)
|
|
216
|
+
return self
|
|
217
|
+
|
|
218
|
+
on_capabilities_change = functools.partialmethod(utils.on_event, P4_CAPABILITIES)
|
|
219
|
+
"""Register a callback to the event that the L47 port's capabilities change."""
|
|
220
|
+
|
|
221
|
+
on_speed_selection_change = functools.partialmethod(utils.on_event, P4_SPEEDSELECTION)
|
|
222
|
+
"""Register a callback to the event that the L47 port's speed mode changes."""
|
|
223
|
+
|
|
224
|
+
on_state_change = functools.partialmethod(utils.on_event, P4_STATE)
|
|
225
|
+
"""Register a callback to the event that the L47 port's state changes."""
|
|
226
|
+
|
|
227
|
+
on_license_info_change = functools.partialmethod(utils.on_event, P4_LICENSE_INFO)
|
|
228
|
+
"""Register a callback to the event that the L47 port's license information changes."""
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
2
|
+
from xoa_driver.internals.commands import (
|
|
3
|
+
P4E_ASSIGN,
|
|
4
|
+
P4E_AVAILABLE,
|
|
5
|
+
P4E_ALLOCATE,
|
|
6
|
+
P4E_ALLOCATION_INFO,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PacketEngine:
|
|
11
|
+
"""L47 port's packet engine."""
|
|
12
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
13
|
+
self.assign = P4E_ASSIGN(conn, module_id, port_id)
|
|
14
|
+
"""
|
|
15
|
+
:type: P4E_ASSIGN
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
self.available = P4E_AVAILABLE(conn, module_id, port_id)
|
|
19
|
+
"""
|
|
20
|
+
:type: P4E_AVAILABLE
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
self.allocate = P4E_ALLOCATE(conn, module_id, port_id)
|
|
24
|
+
"""
|
|
25
|
+
:type: P4E_ALLOCATE
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
self.allocation_info = P4E_ALLOCATION_INFO(conn, module_id, port_id)
|
|
29
|
+
"""
|
|
30
|
+
:type: P4E_ALLOCATION_INFO
|
|
31
|
+
"""
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from functools import partial
|
|
2
|
+
from xoa_driver.internals.utils.rev_tool import RegisterModule
|
|
3
|
+
|
|
4
|
+
VALKYRIE_MODULES = {}
|
|
5
|
+
CHIMERA_MODULES = {}
|
|
6
|
+
VULCAN_MODULES = {}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
register_valkyrie_module = partial(RegisterModule, modules_store=VALKYRIE_MODULES)
|
|
10
|
+
register_chimera_module = partial(RegisterModule, modules_store=CHIMERA_MODULES)
|
|
11
|
+
register_vulcan_module = partial(RegisterModule, modules_store=VULCAN_MODULES)
|
|
File without changes
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import (
|
|
3
|
+
TypeVar,
|
|
4
|
+
Awaitable,
|
|
5
|
+
Generic,
|
|
6
|
+
Callable,
|
|
7
|
+
Generator,
|
|
8
|
+
Any
|
|
9
|
+
)
|
|
10
|
+
from abc import (
|
|
11
|
+
ABC,
|
|
12
|
+
abstractmethod,
|
|
13
|
+
)
|
|
14
|
+
import functools
|
|
15
|
+
from xoa_driver.internals.commands import enums
|
|
16
|
+
from xoa_driver.internals.commands import (
|
|
17
|
+
C_RESERVATION,
|
|
18
|
+
C_DOWN,
|
|
19
|
+
C_PASSWORD,
|
|
20
|
+
C_TIME,
|
|
21
|
+
C_CAPABILITIES,
|
|
22
|
+
C_DEBUGLOGS,
|
|
23
|
+
C_NAME,
|
|
24
|
+
C_MODEL,
|
|
25
|
+
C_COMMENT,
|
|
26
|
+
C_VERSIONNO,
|
|
27
|
+
C_SERIALNO,
|
|
28
|
+
C_RESERVEDBY,
|
|
29
|
+
C_FLASH,
|
|
30
|
+
C_MODEL_NAME,
|
|
31
|
+
C_MODEL_NUMBER,
|
|
32
|
+
)
|
|
33
|
+
from xoa_driver.internals.core.funcs import establish_connection
|
|
34
|
+
from xoa_driver.internals.core.transporter.handler import TransportationHandler
|
|
35
|
+
from xoa_driver.internals.core.transporter.logger import CustomLogger
|
|
36
|
+
from xoa_driver.internals.utils import session
|
|
37
|
+
from xoa_driver.internals.state_storage import testers_state
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
T = TypeVar('T', bound="BaseTester")
|
|
41
|
+
TesterStateStorage = TypeVar('TesterStateStorage', bound="testers_state.TesterLocalState")
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# min version = 83.2
|
|
45
|
+
class BaseTester(ABC, Generic[TesterStateStorage]):
|
|
46
|
+
"""
|
|
47
|
+
Basic Tester class.
|
|
48
|
+
|
|
49
|
+
:param host: tester's address/hostname
|
|
50
|
+
:type host: str
|
|
51
|
+
:param username: username of the user
|
|
52
|
+
:type username: str
|
|
53
|
+
:param password: login password of the tester, defaults to "xena"
|
|
54
|
+
:type password: str, optional
|
|
55
|
+
:param port: the port number for connection establishment, default to 22606
|
|
56
|
+
:type port: int, optional
|
|
57
|
+
:param enable_logging: `True` if debug log output from the tester is needed, and `False` otherwise
|
|
58
|
+
:type enable_logging: bool
|
|
59
|
+
:param custom_logger: `None` allow to specify logger with custom configurations
|
|
60
|
+
:type enable_logging: CustomLogger | None
|
|
61
|
+
:param session_timeout: `130` Session timeout in seconds
|
|
62
|
+
:type session_timeout: int
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
def __init__(self, host: str, username: str, password: str = "xena", port: int = 22606, *, enable_logging: bool = False, custom_logger: CustomLogger | None = None, session_timeout: int = 130) -> None:
|
|
66
|
+
self.__host = host
|
|
67
|
+
self.__port = port
|
|
68
|
+
self._conn = TransportationHandler(
|
|
69
|
+
enable_logging=enable_logging,
|
|
70
|
+
custom_logger=custom_logger
|
|
71
|
+
)
|
|
72
|
+
self.session = session.TesterSession(
|
|
73
|
+
self._conn,
|
|
74
|
+
username,
|
|
75
|
+
password=password,
|
|
76
|
+
timeout_seconds=session_timeout,
|
|
77
|
+
keepalive=True,
|
|
78
|
+
)
|
|
79
|
+
"""
|
|
80
|
+
Current management session
|
|
81
|
+
|
|
82
|
+
:type: TesterSession
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
self.name = C_NAME(self._conn)
|
|
86
|
+
"""
|
|
87
|
+
Get and set the name of the tester
|
|
88
|
+
|
|
89
|
+
:type: C_NAME
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
self.comment = C_COMMENT(self._conn)
|
|
93
|
+
"""Description of the tester.
|
|
94
|
+
|
|
95
|
+
:type: C_COMMENT
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
self.model = C_MODEL(self._conn)
|
|
99
|
+
"""Specifies tester's model.
|
|
100
|
+
|
|
101
|
+
:type: C_MODEL
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
self.model_name = C_MODEL_NAME(self._conn)
|
|
105
|
+
"""Specifies tester's model name.
|
|
106
|
+
|
|
107
|
+
:type: C_MODEL_NAME
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
self.model_number = C_MODEL_NUMBER(self._conn)
|
|
111
|
+
"""Specifies tester's model number.
|
|
112
|
+
|
|
113
|
+
:type: C_MODEL_NUMBER
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
self.version_no = C_VERSIONNO(self._conn)
|
|
117
|
+
"""Tester's version number.
|
|
118
|
+
|
|
119
|
+
:type: C_VERSIONNO
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
self.serial_no = C_SERIALNO(self._conn)
|
|
123
|
+
"""Tester's serial number.
|
|
124
|
+
|
|
125
|
+
:type: C_SERIALNO
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
self.reservation = C_RESERVATION(self._conn)
|
|
129
|
+
"""Tester's reservation operation.
|
|
130
|
+
|
|
131
|
+
:type: C_RESERVATION
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
self.reserved_by = C_RESERVEDBY(self._conn)
|
|
135
|
+
"""Tester's reservation status.
|
|
136
|
+
|
|
137
|
+
:type: C_RESERVEDBY
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
self.down = C_DOWN(self._conn)
|
|
141
|
+
"""Shutdown/reboot the tester.
|
|
142
|
+
|
|
143
|
+
:type: C_DOWN
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
self.password = C_PASSWORD(self._conn)
|
|
147
|
+
"""Specifies tester's password.
|
|
148
|
+
|
|
149
|
+
:type: C_PASSWORD
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
self.time = C_TIME(self._conn)
|
|
153
|
+
"""Tester's time in seconds.
|
|
154
|
+
|
|
155
|
+
:type: C_TIME
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
self.capabilities = C_CAPABILITIES(self._conn)
|
|
159
|
+
"""Tester's capabilities.
|
|
160
|
+
|
|
161
|
+
:type: C_CAPABILITIES
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
self.debug_log = C_DEBUGLOGS(self._conn)
|
|
165
|
+
"""Tester's debug log.
|
|
166
|
+
|
|
167
|
+
:type: C_DEBUGLOGS
|
|
168
|
+
"""
|
|
169
|
+
|
|
170
|
+
self.flash = C_FLASH(self._conn)
|
|
171
|
+
"""Specifies tester's flash LEDs status.
|
|
172
|
+
|
|
173
|
+
:type: C_FLASH
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
async def __aenter__(self: Awaitable[T]) -> T:
|
|
177
|
+
return await self
|
|
178
|
+
|
|
179
|
+
async def __aexit__(self, type, value, traceback) -> None:
|
|
180
|
+
await self.session.logoff()
|
|
181
|
+
|
|
182
|
+
def __await__(self: T) -> Generator[Any, None, T]:
|
|
183
|
+
if self.session.is_online:
|
|
184
|
+
async def skip():
|
|
185
|
+
return self
|
|
186
|
+
return skip().__await__()
|
|
187
|
+
return self._setup().__await__()
|
|
188
|
+
|
|
189
|
+
async def _setup(self: T) -> T:
|
|
190
|
+
await establish_connection(self._conn, self.__host, self.__port)
|
|
191
|
+
await self.session.logon()
|
|
192
|
+
return self
|
|
193
|
+
|
|
194
|
+
def __is_reservation(self, reserved_status: enums.ReservedStatus) -> bool:
|
|
195
|
+
return self.info.reservation == reserved_status
|
|
196
|
+
|
|
197
|
+
is_released = functools.partialmethod(__is_reservation, enums.ReservedStatus.RELEASED)
|
|
198
|
+
"""Validate if the tester is released.
|
|
199
|
+
|
|
200
|
+
:return: whether the tester is released.
|
|
201
|
+
:rtype: bool
|
|
202
|
+
"""
|
|
203
|
+
|
|
204
|
+
is_reserved_by_me = functools.partialmethod(__is_reservation, enums.ReservedStatus.RESERVED_BY_YOU)
|
|
205
|
+
"""Validate if the tester is reserved by your connection under the username used when logging in.
|
|
206
|
+
|
|
207
|
+
:return: whether the tester is reserved by your connection under the username used when logging in.
|
|
208
|
+
:rtype: bool
|
|
209
|
+
"""
|
|
210
|
+
|
|
211
|
+
@property
|
|
212
|
+
@abstractmethod
|
|
213
|
+
def info(self) -> TesterStateStorage:
|
|
214
|
+
"""
|
|
215
|
+
Tester's local information.
|
|
216
|
+
|
|
217
|
+
:type: TesterStateStorage
|
|
218
|
+
"""
|
|
219
|
+
|
|
220
|
+
raise NotImplementedError()
|
|
221
|
+
|
|
222
|
+
# region Events
|
|
223
|
+
|
|
224
|
+
# We are not supporting Subscription on Connection made, coz Connection is happens at Awaiting of instance
|
|
225
|
+
# but subscription only registered after instance is already created, means already connected,
|
|
226
|
+
# means On_connected event will never b called, it's can be tweaked, but then Creating process of tester instance
|
|
227
|
+
# will be less intuitive, and in one case subscription will work while in another not.
|
|
228
|
+
|
|
229
|
+
def on_disconnected(self, callback: "Callable") -> None:
|
|
230
|
+
"""
|
|
231
|
+
Register a callback function that will be called at the time when connection will be closed.
|
|
232
|
+
|
|
233
|
+
:param callback: the callback function that can be called when the event happens.
|
|
234
|
+
:type callback: Callable
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
self._conn.on_disconnected(callback)
|
|
238
|
+
|
|
239
|
+
def on_reservation_change(self, callback: "Callable") -> None:
|
|
240
|
+
"""
|
|
241
|
+
Register an callback function that will be called when tester's reservation status is changed.
|
|
242
|
+
|
|
243
|
+
:param callback: the callback function that can be called when the event happens.
|
|
244
|
+
:type callback: Callable
|
|
245
|
+
"""
|
|
246
|
+
|
|
247
|
+
self._conn.subscribe(C_RESERVATION, callback)
|
|
248
|
+
|
|
249
|
+
def on_reserved_by_change(self, callback: "Callable") -> None:
|
|
250
|
+
"""
|
|
251
|
+
Register an callback function that will be called when tester's owner is changed.
|
|
252
|
+
|
|
253
|
+
:param callback: the callback function that can be called when the event happens.
|
|
254
|
+
:type callback: Callable
|
|
255
|
+
"""
|
|
256
|
+
|
|
257
|
+
self._conn.subscribe(C_RESERVEDBY, callback)
|
|
258
|
+
|
|
259
|
+
# endregion
|