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,44 @@
|
|
|
1
|
+
from abc import (
|
|
2
|
+
ABC,
|
|
3
|
+
abstractmethod
|
|
4
|
+
)
|
|
5
|
+
from typing import (
|
|
6
|
+
Generic,
|
|
7
|
+
TypeVar,
|
|
8
|
+
Tuple,
|
|
9
|
+
)
|
|
10
|
+
from collections import OrderedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class AbcResourcesManager(ABC, Generic[T]):
|
|
17
|
+
"""Resource Base Manager
|
|
18
|
+
"""
|
|
19
|
+
__slots__ = ("_items", "_lock", )
|
|
20
|
+
|
|
21
|
+
def __init__(self) -> None:
|
|
22
|
+
self._items: OrderedDict[int, T] = OrderedDict()
|
|
23
|
+
self._lock: bool = False
|
|
24
|
+
|
|
25
|
+
def __len__(self) -> int:
|
|
26
|
+
return len(self._items)
|
|
27
|
+
|
|
28
|
+
def __iter__(self):
|
|
29
|
+
return iter(self._items.values())
|
|
30
|
+
|
|
31
|
+
def obtain(self, key: int) -> T:
|
|
32
|
+
"""Obtain a single resource.
|
|
33
|
+
"""
|
|
34
|
+
return self._items[key]
|
|
35
|
+
|
|
36
|
+
def obtain_multiple(self, *keys: int) -> Tuple[T, ...]:
|
|
37
|
+
"""Obtain multiple resources as a tuple of resources.
|
|
38
|
+
"""
|
|
39
|
+
return tuple(self._items[k] for k in keys)
|
|
40
|
+
|
|
41
|
+
@abstractmethod
|
|
42
|
+
async def fill(self, *args, **kwargs) -> None:
|
|
43
|
+
"""Method for create and fill in."""
|
|
44
|
+
raise NotImplementedError()
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
class XoaResourceError(Exception):
|
|
2
|
+
...
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class WrongTesterError(XoaResourceError):
|
|
6
|
+
def __init__(self) -> None:
|
|
7
|
+
self.msg = "Connected tester is of the wrong type!"
|
|
8
|
+
super().__init__(self.msg)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class NoSuchModuleError(XoaResourceError):
|
|
12
|
+
def __init__(self, module_id: int) -> None:
|
|
13
|
+
self.module_id = module_id
|
|
14
|
+
self.msg = f"No such module {module_id}!"
|
|
15
|
+
super().__init__(self.msg)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class NoSuchPortError(XoaResourceError):
|
|
19
|
+
def __init__(self, port_id: int) -> None:
|
|
20
|
+
self.port_id = port_id
|
|
21
|
+
self.msg = f"No such port {port_id}!"
|
|
22
|
+
super().__init__(self.msg)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import asyncio
|
|
3
|
+
import functools
|
|
4
|
+
from typing import (
|
|
5
|
+
TYPE_CHECKING,
|
|
6
|
+
Awaitable,
|
|
7
|
+
Iterable,
|
|
8
|
+
NamedTuple,
|
|
9
|
+
Type,
|
|
10
|
+
TypeVar,
|
|
11
|
+
Callable,
|
|
12
|
+
Union,
|
|
13
|
+
cast,
|
|
14
|
+
)
|
|
15
|
+
from collections import OrderedDict
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
19
|
+
from xoa_driver.internals.commands import (
|
|
20
|
+
M_REVISION,
|
|
21
|
+
M_MODEL,
|
|
22
|
+
M_VERSIONSTR,
|
|
23
|
+
)
|
|
24
|
+
from .abc import AbcResourcesManager
|
|
25
|
+
from .exceptions import (
|
|
26
|
+
NoSuchModuleError,
|
|
27
|
+
WrongTesterError
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# region Module Init dataset
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ModuleData(NamedTuple):
|
|
34
|
+
"""Base module data."""
|
|
35
|
+
module_id: int
|
|
36
|
+
ports_count: int
|
|
37
|
+
revision: str
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class L23ModuleData(ModuleData):
|
|
41
|
+
"""L23 module data"""
|
|
42
|
+
@classmethod
|
|
43
|
+
async def create(cls, conn, mid: int, p_cnt: int) -> "L23ModuleData":
|
|
44
|
+
"""Return the module name of the L23 module."""
|
|
45
|
+
r = await M_REVISION(conn, mid).get()
|
|
46
|
+
return cls(
|
|
47
|
+
module_id=mid,
|
|
48
|
+
ports_count=p_cnt,
|
|
49
|
+
revision=r.revision
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class L47ModuleData(ModuleData):
|
|
54
|
+
"""L47 module data"""
|
|
55
|
+
@classmethod
|
|
56
|
+
async def create(cls, conn, mid: int, p_cnt: int) -> "L47ModuleData":
|
|
57
|
+
"""Return the module name of the L47 module."""
|
|
58
|
+
r = await M_MODEL(conn, mid).get()
|
|
59
|
+
return cls(
|
|
60
|
+
module_id=mid,
|
|
61
|
+
ports_count=p_cnt,
|
|
62
|
+
revision=r.model
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# endregion
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
MT = TypeVar("MT")
|
|
69
|
+
MTypeObtainer = Callable[[str], Type]
|
|
70
|
+
ModuleDataType = Union[Type["L23ModuleData"], Type["L47ModuleData"]]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class ModulesManager(AbcResourcesManager[MT]):
|
|
74
|
+
"""Modules Manager"""
|
|
75
|
+
|
|
76
|
+
__slots__ = ("_conn", "__m_types_obtainer")
|
|
77
|
+
|
|
78
|
+
def __init__(self, conn: "itf.IConnection", m_types_obtainer: MTypeObtainer) -> None:
|
|
79
|
+
super().__init__()
|
|
80
|
+
self._conn = conn
|
|
81
|
+
self.__m_types_obtainer = m_types_obtainer
|
|
82
|
+
|
|
83
|
+
def obtain(self, key: int) -> MT:
|
|
84
|
+
try:
|
|
85
|
+
return super().obtain(key)
|
|
86
|
+
except KeyError:
|
|
87
|
+
raise NoSuchModuleError(key)
|
|
88
|
+
|
|
89
|
+
def obtain_multiple(self, *keys: int) -> tuple[MT, ...]:
|
|
90
|
+
try:
|
|
91
|
+
return super().obtain_multiple(*keys)
|
|
92
|
+
except KeyError as err:
|
|
93
|
+
raise NoSuchModuleError(err.args[0])
|
|
94
|
+
|
|
95
|
+
async def fill(self, ports_count: list[int], module_type: ModuleDataType) -> None:
|
|
96
|
+
"""Method for create and fill in."""
|
|
97
|
+
assert not self._lock, "Method <fill> can be called only once."
|
|
98
|
+
module_builder = (
|
|
99
|
+
module_type.create(self._conn, slot_id, p_count)
|
|
100
|
+
for slot_id, p_count in enumerate(ports_count)
|
|
101
|
+
if p_count > 0
|
|
102
|
+
)
|
|
103
|
+
identities: Iterable[ModuleData] = await asyncio.gather(*module_builder)
|
|
104
|
+
|
|
105
|
+
self._items = OrderedDict(
|
|
106
|
+
(
|
|
107
|
+
idnt.module_id,
|
|
108
|
+
self.__m_types_obtainer(idnt.revision)(self._conn, idnt)
|
|
109
|
+
)
|
|
110
|
+
for idnt in identities
|
|
111
|
+
)
|
|
112
|
+
if len(self) == 0:
|
|
113
|
+
raise WrongTesterError()
|
|
114
|
+
coros = cast(Iterable[Awaitable], self._items.values())
|
|
115
|
+
await asyncio.gather(*coros)
|
|
116
|
+
|
|
117
|
+
fill_l23 = functools.partialmethod(fill, module_type=L23ModuleData)
|
|
118
|
+
fill_l47 = functools.partialmethod(fill, module_type=L47ModuleData)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
import asyncio
|
|
3
|
+
from typing import (
|
|
4
|
+
Awaitable,
|
|
5
|
+
Iterable,
|
|
6
|
+
Type,
|
|
7
|
+
TypeVar,
|
|
8
|
+
Protocol,
|
|
9
|
+
TYPE_CHECKING,
|
|
10
|
+
cast,
|
|
11
|
+
)
|
|
12
|
+
from collections import OrderedDict
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
15
|
+
|
|
16
|
+
from .abc import AbcResourcesManager
|
|
17
|
+
from .exceptions import NoSuchPortError
|
|
18
|
+
from ..con_traffic_light import ConnectionTrafficLight
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class IPort(Protocol):
|
|
22
|
+
_conn: "itf.IConnection"
|
|
23
|
+
|
|
24
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
25
|
+
...
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
PT = TypeVar("PT", bound=IPort)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class PortBaseManager(AbcResourcesManager[PT]):
|
|
32
|
+
def obtain(self, key: int) -> PT:
|
|
33
|
+
try:
|
|
34
|
+
return super().obtain(key)
|
|
35
|
+
except KeyError:
|
|
36
|
+
raise NoSuchPortError(key)
|
|
37
|
+
|
|
38
|
+
def obtain_multiple(self, *keys: int) -> tuple[PT, ...]:
|
|
39
|
+
try:
|
|
40
|
+
return super().obtain_multiple(*keys)
|
|
41
|
+
except KeyError as err:
|
|
42
|
+
raise NoSuchPortError(err.args[0])
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class PortsManager(PortBaseManager[PT]):
|
|
46
|
+
|
|
47
|
+
__slots__ = ("_conn", "_ports_type", "_ports_count", "_module_id", )
|
|
48
|
+
|
|
49
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, ports_type: Type[PT], ports_count: int) -> None:
|
|
50
|
+
super().__init__()
|
|
51
|
+
self._conn = conn
|
|
52
|
+
self._ports_type = ports_type
|
|
53
|
+
self._module_id = module_id
|
|
54
|
+
self._items: OrderedDict[int, PT] = OrderedDict()
|
|
55
|
+
self._ports_count = 0
|
|
56
|
+
self.reinit(ports_count)
|
|
57
|
+
|
|
58
|
+
def reinit(self, ports_count: int) -> bool:
|
|
59
|
+
if ports_count == self._ports_count:
|
|
60
|
+
return False
|
|
61
|
+
|
|
62
|
+
if self._items:
|
|
63
|
+
for v in self._items.values():
|
|
64
|
+
v._conn.set_outdated()
|
|
65
|
+
del self._items
|
|
66
|
+
self._items: OrderedDict[int, PT] = OrderedDict(
|
|
67
|
+
(
|
|
68
|
+
port_id,
|
|
69
|
+
self._ports_type(
|
|
70
|
+
conn=ConnectionTrafficLight(self._conn),
|
|
71
|
+
module_id=self._module_id,
|
|
72
|
+
port_id=port_id,
|
|
73
|
+
)
|
|
74
|
+
)
|
|
75
|
+
for port_id in range(ports_count)
|
|
76
|
+
)
|
|
77
|
+
self._ports_count = ports_count
|
|
78
|
+
return True
|
|
79
|
+
|
|
80
|
+
async def fill(self) -> None:
|
|
81
|
+
assert not self._lock, "Method <fill> can be called only once."
|
|
82
|
+
coros = cast(Iterable[Awaitable], self._items.values())
|
|
83
|
+
await asyncio.gather(*coros)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class PortResolver(Protocol):
|
|
87
|
+
async def __call__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> Type:
|
|
88
|
+
...
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class PortsCombiManager(PortBaseManager[PT]):
|
|
92
|
+
|
|
93
|
+
__slots__ = ("_conn", "_resolver", "_ports_count", "_module_id",)
|
|
94
|
+
|
|
95
|
+
def __init__(self, conn: "itf.IConnection", module_id: int, resolver: PortResolver, ports_count: int) -> None:
|
|
96
|
+
super().__init__()
|
|
97
|
+
self._conn = conn
|
|
98
|
+
self._resolver = resolver
|
|
99
|
+
self._ports_count = ports_count
|
|
100
|
+
self._module_id = module_id
|
|
101
|
+
self._items: OrderedDict[int, PT] = OrderedDict()
|
|
102
|
+
|
|
103
|
+
async def fill(self) -> None:
|
|
104
|
+
assert not self._lock, "Method <fill> can be called only once."
|
|
105
|
+
coros = iter(
|
|
106
|
+
self._resolver(
|
|
107
|
+
conn=ConnectionTrafficLight(self._conn),
|
|
108
|
+
module_id=self._module_id,
|
|
109
|
+
port_id=port_id,
|
|
110
|
+
)
|
|
111
|
+
for port_id in range(self._ports_count)
|
|
112
|
+
)
|
|
113
|
+
ports = await asyncio.gather(*coros)
|
|
114
|
+
self._items = OrderedDict(
|
|
115
|
+
(port.kind.port_id, port) for port in ports
|
|
116
|
+
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import (
|
|
3
|
+
Type,
|
|
4
|
+
TypeVar
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RegisterModule:
|
|
11
|
+
"""Register revision and it's module class"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, modules_store: dict[str, Type], rev: str) -> None:
|
|
14
|
+
self.modules_store = modules_store
|
|
15
|
+
self.revision = rev
|
|
16
|
+
|
|
17
|
+
def __call__(self, module_type: Type[T]) -> Type[T]:
|
|
18
|
+
if self.revision in self.modules_store:
|
|
19
|
+
raise RuntimeError(f"Module of revision: {self.revision}, is already registered.")
|
|
20
|
+
self.modules_store[self.revision] = module_type
|
|
21
|
+
return module_type
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
from contextlib import suppress
|
|
3
|
+
from typing import (
|
|
4
|
+
TYPE_CHECKING,
|
|
5
|
+
Tuple
|
|
6
|
+
)
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from xoa_driver.internals.core import interfaces as itf
|
|
9
|
+
from xoa_driver.internals.core import funcs
|
|
10
|
+
from xoa_driver.internals.core.exceptions import XmpBadValueError
|
|
11
|
+
from xoa_driver.internals import exceptions
|
|
12
|
+
from xoa_driver.internals.commands import (
|
|
13
|
+
C_LOGON,
|
|
14
|
+
C_LOGOFF,
|
|
15
|
+
C_OWNER,
|
|
16
|
+
C_TIMEOUT,
|
|
17
|
+
C_KEEPALIVE,
|
|
18
|
+
C_INDICES,
|
|
19
|
+
C_STATSESSION,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class TesterSession:
|
|
24
|
+
"""
|
|
25
|
+
Establishing communication session through connection with the tester.
|
|
26
|
+
|
|
27
|
+
:param conn: connection handler
|
|
28
|
+
:type host: itf.IConnection
|
|
29
|
+
:param owner_name: username of the user
|
|
30
|
+
:type username: str
|
|
31
|
+
:param password: login password of the tester, defaults to "xena"
|
|
32
|
+
:type password: str, optional
|
|
33
|
+
:param timeout_seconds: the timeout to close idle connection
|
|
34
|
+
:type port: int, optional
|
|
35
|
+
:param keepalive: `True` if keepalive signal is needed, and `False` otherwise, defaults to `False`.
|
|
36
|
+
:type keepalive: bool, optional
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
__slots__ = ("_conn", "owner_name", "pwd", "timeout", "keepalive")
|
|
40
|
+
|
|
41
|
+
def __init__(self, conn: "itf.IConnection", owner_name: str, password: str = "xena", timeout_seconds: int = 130, keepalive: bool = False) -> None:
|
|
42
|
+
self._conn = conn
|
|
43
|
+
self.owner_name = owner_name
|
|
44
|
+
self.pwd = password
|
|
45
|
+
self.timeout = timeout_seconds
|
|
46
|
+
self.keepalive = keepalive
|
|
47
|
+
|
|
48
|
+
async def logon(self) -> "TesterSession":
|
|
49
|
+
logon, *_ = await funcs.apply(
|
|
50
|
+
C_LOGON(self._conn).set(self.pwd),
|
|
51
|
+
C_OWNER(self._conn).set(self.owner_name),
|
|
52
|
+
C_TIMEOUT(self._conn).set(self.timeout),
|
|
53
|
+
return_exceptions=True,
|
|
54
|
+
token_timeout_sec=1.0
|
|
55
|
+
)
|
|
56
|
+
if isinstance(logon, XmpBadValueError):
|
|
57
|
+
raise exceptions.WrongTesterPasswordError(self.pwd) from None
|
|
58
|
+
|
|
59
|
+
if self.keepalive:
|
|
60
|
+
asyncio.create_task(self.__do_keepalive(), name="keepalive").add_done_callback(
|
|
61
|
+
self.__handle_exceptions
|
|
62
|
+
)
|
|
63
|
+
return self
|
|
64
|
+
|
|
65
|
+
async def chang_timeout(self, seconds: int = 130) -> None:
|
|
66
|
+
"""Modify session timeout, """
|
|
67
|
+
if not self.is_online:
|
|
68
|
+
raise RuntimeError("Timeout can be changet only after connection is established.")
|
|
69
|
+
self.timeout = seconds
|
|
70
|
+
await C_TIMEOUT(self._conn).set(self.timeout)
|
|
71
|
+
|
|
72
|
+
def __handle_exceptions(self, fut: asyncio.Future) -> None:
|
|
73
|
+
if fut.cancelled():
|
|
74
|
+
return None
|
|
75
|
+
elif e := fut.exception():
|
|
76
|
+
raise e
|
|
77
|
+
|
|
78
|
+
async def __do_keepalive(self) -> None:
|
|
79
|
+
while self._conn.is_connected:
|
|
80
|
+
with suppress(Exception):
|
|
81
|
+
await C_KEEPALIVE(self._conn).get()
|
|
82
|
+
await asyncio.sleep(max(0, self.timeout - 5))
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def is_online(self) -> bool:
|
|
86
|
+
"""
|
|
87
|
+
Check if connection is still active.
|
|
88
|
+
|
|
89
|
+
:return: connection is still on or not.
|
|
90
|
+
:rtype: bool
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
return self._conn.is_connected
|
|
94
|
+
|
|
95
|
+
async def logoff(self) -> None:
|
|
96
|
+
"""
|
|
97
|
+
Gracefully log off from the tester.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
await C_LOGOFF(self._conn).set()
|
|
101
|
+
self._conn.close()
|
|
102
|
+
|
|
103
|
+
async def sessions_info(self) -> Tuple[C_STATSESSION.GetDataAttr, ...]:
|
|
104
|
+
"""
|
|
105
|
+
Return information about all active sessions on the tester.
|
|
106
|
+
|
|
107
|
+
:return: a list of session information
|
|
108
|
+
:rtype: List[C_STATSESSION]
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
sessions = await C_INDICES(self._conn).get()
|
|
112
|
+
session_ids = sessions.session_ids
|
|
113
|
+
query_sessions = (
|
|
114
|
+
C_STATSESSION(self._conn, _session_xindex=sid).get()
|
|
115
|
+
for sid in session_ids
|
|
116
|
+
)
|
|
117
|
+
return tuple(await funcs.apply(*query_sessions))
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
from functools import partial
|
|
3
|
+
|
|
4
|
+
__all__ = (
|
|
5
|
+
"depricated",
|
|
6
|
+
"resource"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class XoaResourceWarning(ResourceWarning):
|
|
11
|
+
...
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class XoaDeprecationWarning(DeprecationWarning):
|
|
15
|
+
...
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
warnings.simplefilter('always', XoaResourceWarning)
|
|
19
|
+
warnings.simplefilter('always', XoaDeprecationWarning)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def formatter(message, category, filename, lineno, *_) -> str:
|
|
23
|
+
if category is XoaDeprecationWarning:
|
|
24
|
+
return f"\n\33[101m{category.__name__}\33[0m: {message}\n\n"
|
|
25
|
+
return f"\n\33[103m{category.__name__}\33[0m: {message}\n\n"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
warnings.formatwarning = formatter
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
depricated = partial(warnings.warn, category=XoaDeprecationWarning)
|
|
32
|
+
resource = partial(warnings.warn, category=XoaResourceWarning)
|
xoa_driver/lli.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#: Low-Level interface
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from xoa_driver.internals import commands
|
|
5
|
+
from xoa_driver.internals.core.transporter.registry import get_command
|
|
6
|
+
from xoa_driver.internals.core.transporter.handler import TransportationHandler
|
|
7
|
+
from xoa_driver.internals.core.funcs import establish_connection
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
__all__ = (
|
|
11
|
+
"commands",
|
|
12
|
+
"get_command",
|
|
13
|
+
"TransportationHandler",
|
|
14
|
+
"establish_connection"
|
|
15
|
+
)
|
xoa_driver/misc.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#: Other types which are used by ports or as a parameter to attribute set method.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from .internals.core.token import Token
|
|
5
|
+
from .internals.core.transporter.protocol.payload.types import Hex
|
|
6
|
+
from .internals.commands.subtypes import (
|
|
7
|
+
ArpChunk,
|
|
8
|
+
NdpChunk,
|
|
9
|
+
DhcpChunk,
|
|
10
|
+
GroupAddressElem,
|
|
11
|
+
VlanTag,
|
|
12
|
+
QueueStatsElem,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
|
|
17
|
+
if "xoa_driver.v2" in sys.modules:
|
|
18
|
+
raise ImportError("\33[31mOnly Single interface version is allowed to being use at the same time.\33[0m")
|
|
19
|
+
|
|
20
|
+
# indices types
|
|
21
|
+
from .internals.hli_v1.indices.connection_group.cg import ConnectionGroupIdx as ConnectionGroup
|
|
22
|
+
from .internals.hli_v1.indices.filter.base_filter import BaseFilterIdx as BasePortFilter
|
|
23
|
+
from .internals.hli_v1.indices.filter.genuine_filter import GenuineFilterIdx as GenuinePortFilter
|
|
24
|
+
from .internals.hli_v1.indices.length_term import LengthTermIdx as LengthTerm
|
|
25
|
+
from .internals.hli_v1.indices.match_term import MatchTermIdx as MatchTerm
|
|
26
|
+
from .internals.hli_v1.indices.port_dataset import PortDatasetIdx as PortDataset
|
|
27
|
+
from .internals.hli_v1.indices.streams.base_stream import BaseStreamIdx as BaseStream
|
|
28
|
+
from .internals.hli_v1.indices.streams.genuine_stream import GenuineStreamIdx as GenuineStream
|
|
29
|
+
from .internals.hli_v1.ports.port_l23.chimera.port_emulation import CFlow as ImpairmentFlow
|
|
30
|
+
from .internals.hli_v1.ports.port_l23.chimera.filter_definition.general import ModeBasic as BasicImpairmentFlowFilter
|
|
31
|
+
from .internals.hli_v1.ports.port_l23.chimera.filter_definition.general import ModeExtended as ExtendedImpairmentFlowFilter
|
|
32
|
+
from xoa_driver.internals.hli_v1.indices.macsecscs.genuine_macsecsc import GenuineMacSecTxScIdx, GenuineMacSecRxScIdx
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
__all__ = (
|
|
36
|
+
"Token",
|
|
37
|
+
"Hex",
|
|
38
|
+
"ArpChunk",
|
|
39
|
+
"NdpChunk",
|
|
40
|
+
"DhcpChunk",
|
|
41
|
+
"GroupAddressElem",
|
|
42
|
+
"VlanTag",
|
|
43
|
+
"QueueStatsElem",
|
|
44
|
+
"ConnectionGroup",
|
|
45
|
+
"BasePortFilter",
|
|
46
|
+
"GenuinePortFilter",
|
|
47
|
+
"LengthTerm",
|
|
48
|
+
"MatchTerm",
|
|
49
|
+
"PortDataset",
|
|
50
|
+
"BaseStream",
|
|
51
|
+
"GenuineStream",
|
|
52
|
+
"ImpairmentFlow",
|
|
53
|
+
"BasicImpairmentFlowFilter",
|
|
54
|
+
"ExtendedImpairmentFlowFilter",
|
|
55
|
+
"GenuineMacSecTxScIdx",
|
|
56
|
+
"GenuineMacSecRxScIdx",
|
|
57
|
+
)
|