tdl-xoa-driver 1.0.0b1__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.0b1.dist-info/LICENSE +202 -0
- tdl_xoa_driver-1.0.0b1.dist-info/METADATA +177 -0
- tdl_xoa_driver-1.0.0b1.dist-info/RECORD +325 -0
- tdl_xoa_driver-1.0.0b1.dist-info/WHEEL +5 -0
- tdl_xoa_driver-1.0.0b1.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,335 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
import typing
|
|
4
|
+
import functools
|
|
5
|
+
|
|
6
|
+
from xoa_driver.internals.core.builders import (
|
|
7
|
+
build_get_request,
|
|
8
|
+
build_set_request
|
|
9
|
+
)
|
|
10
|
+
from xoa_driver.internals.core import interfaces
|
|
11
|
+
from xoa_driver.internals.core.token import Token
|
|
12
|
+
from xoa_driver.internals.core.transporter.registry import register_command
|
|
13
|
+
from xoa_driver.internals.core.transporter.protocol.payload import (
|
|
14
|
+
field,
|
|
15
|
+
RequestBodyStruct,
|
|
16
|
+
ResponseBodyStruct,
|
|
17
|
+
XmpHex,
|
|
18
|
+
XmpInt,
|
|
19
|
+
XmpLong,
|
|
20
|
+
XmpSequence,
|
|
21
|
+
Hex,
|
|
22
|
+
)
|
|
23
|
+
from .enums import (
|
|
24
|
+
StartTrigger,
|
|
25
|
+
StopTrigger,
|
|
26
|
+
PacketType,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@register_command
|
|
31
|
+
@dataclass
|
|
32
|
+
class PC_TRIGGER:
|
|
33
|
+
"""
|
|
34
|
+
The criteria for when to start and stop the capture process for a port. Even
|
|
35
|
+
when capture is enabled with :class:`P_CAPTURE`, the actual capturing of packets can be
|
|
36
|
+
delayed until a particular start criteria is met by a received packet.
|
|
37
|
+
Likewise, a stop criteria can be specified, based on a received packet. If no
|
|
38
|
+
explicit stop criteria is specified, capture stops when the internal buffer
|
|
39
|
+
runs full. In buffer overflow situations, if there is an explicit stop
|
|
40
|
+
criteria, then the latest packets will be retained (and the early ones
|
|
41
|
+
discarded), and otherwise, the earliest packets are retained (and the later
|
|
42
|
+
ones discarded).
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
code: typing.ClassVar[int] = 221
|
|
46
|
+
pushed: typing.ClassVar[bool] = True
|
|
47
|
+
|
|
48
|
+
_connection: 'interfaces.IConnection'
|
|
49
|
+
_module: int
|
|
50
|
+
_port: int
|
|
51
|
+
|
|
52
|
+
class GetDataAttr(ResponseBodyStruct):
|
|
53
|
+
start_criteria: StartTrigger = field(XmpInt())
|
|
54
|
+
"""The criteria for starting the actual packet capture.
|
|
55
|
+
|
|
56
|
+
:type: StartTrigger
|
|
57
|
+
"""
|
|
58
|
+
start_criteria_filter: int = field(XmpInt())
|
|
59
|
+
"""The index of a particular filter for the start criteria.
|
|
60
|
+
|
|
61
|
+
:type: int
|
|
62
|
+
"""
|
|
63
|
+
stop_criteria: StopTrigger = field(XmpInt())
|
|
64
|
+
"""The criteria for stopping the actual packet capture.
|
|
65
|
+
|
|
66
|
+
:type: StopTrigger
|
|
67
|
+
"""
|
|
68
|
+
stop_criteria_filter: int = field(XmpInt())
|
|
69
|
+
"""The index of a particular filter for the stop criteria.
|
|
70
|
+
|
|
71
|
+
:type: int
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
class SetDataAttr(RequestBodyStruct):
|
|
75
|
+
start_criteria: StartTrigger = field(XmpInt())
|
|
76
|
+
"""coded integer, the criteria for starting the actual packet capture"""
|
|
77
|
+
start_criteria_filter: int = field(XmpInt())
|
|
78
|
+
"""integer, the index of a particular filter for the start criteria."""
|
|
79
|
+
stop_criteria: StopTrigger = field(XmpInt())
|
|
80
|
+
"""coded integer, the criteria for stopping the actual packet capture"""
|
|
81
|
+
stop_criteria_filter: int = field(XmpInt())
|
|
82
|
+
"""integer, the index of a particular filter for the stop criteria."""
|
|
83
|
+
|
|
84
|
+
def get(self) -> Token[GetDataAttr]:
|
|
85
|
+
"""Get the capture criteria configurations.
|
|
86
|
+
|
|
87
|
+
:return: capture criteria configuration.
|
|
88
|
+
:rtype: ~PC_TRIGGER.GetDataAttr
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
return Token(self._connection, build_get_request(self, module=self._module, port=self._port))
|
|
92
|
+
|
|
93
|
+
def set(self, start_criteria: StartTrigger, start_criteria_filter: int, stop_criteria: StopTrigger, stop_criteria_filter: int) -> Token[None]:
|
|
94
|
+
"""Set the capture criteria configurations.
|
|
95
|
+
|
|
96
|
+
:param start_criteria: the criteria for starting the actual packet capture
|
|
97
|
+
:type start_criteria: StartTrigger
|
|
98
|
+
:param start_criteria_filter: the index of a particular filter for the start criteria
|
|
99
|
+
:type start_criteria_filter: int
|
|
100
|
+
:param stop_criteria: the criteria for stopping the actual packet capture
|
|
101
|
+
:type stop_criteria: StopTrigger
|
|
102
|
+
:param stop_criteria_filter: the index of a particular filter for the stop criteria
|
|
103
|
+
:type stop_criteria_filter: int
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
return Token(
|
|
107
|
+
self._connection,
|
|
108
|
+
build_set_request(
|
|
109
|
+
self,
|
|
110
|
+
module=self._module,
|
|
111
|
+
port=self._port,
|
|
112
|
+
start_criteria=start_criteria,
|
|
113
|
+
start_criteria_filter=start_criteria_filter,
|
|
114
|
+
stop_criteria=stop_criteria,
|
|
115
|
+
stop_criteria_filter=stop_criteria_filter
|
|
116
|
+
)
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@register_command
|
|
121
|
+
@dataclass
|
|
122
|
+
class PC_KEEP:
|
|
123
|
+
"""
|
|
124
|
+
Which packets to keep once the start criteria has been triggered for a port.
|
|
125
|
+
Also how big a portion of each packet to retain, saving space for more packets
|
|
126
|
+
in the capture buffer.
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
code: typing.ClassVar[int] = 222
|
|
130
|
+
pushed: typing.ClassVar[bool] = True
|
|
131
|
+
|
|
132
|
+
_connection: 'interfaces.IConnection'
|
|
133
|
+
_module: int
|
|
134
|
+
_port: int
|
|
135
|
+
|
|
136
|
+
class GetDataAttr(ResponseBodyStruct):
|
|
137
|
+
kind: PacketType = field(XmpInt())
|
|
138
|
+
"""The type of packet to keep.
|
|
139
|
+
|
|
140
|
+
:type: PacketType
|
|
141
|
+
"""
|
|
142
|
+
index: int = field(XmpInt())
|
|
143
|
+
"""Test payload id or filter index for which packets to keep.
|
|
144
|
+
|
|
145
|
+
:type: int
|
|
146
|
+
"""
|
|
147
|
+
byte_count: int = field(XmpInt())
|
|
148
|
+
"""How many bytes to keep in the buffer for of each packet. The value -1 means no limit on packet size.
|
|
149
|
+
|
|
150
|
+
:type: int
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
class SetDataAttr(RequestBodyStruct):
|
|
154
|
+
kind: PacketType = field(XmpInt())
|
|
155
|
+
"""coded integer, which general kind of packets to keep"""
|
|
156
|
+
index: int = field(XmpInt())
|
|
157
|
+
"""integer, test payload id or filter index for which packets to keep."""
|
|
158
|
+
byte_count: int = field(XmpInt())
|
|
159
|
+
"""integer, how many bytes to keep in the buffer for of each packet. The value -1 means no limit on packet size."""
|
|
160
|
+
|
|
161
|
+
def get(self) -> Token[GetDataAttr]:
|
|
162
|
+
"""Get the configuration of how to keep captured packets.
|
|
163
|
+
|
|
164
|
+
:return: the configuration of how to keep captured packets
|
|
165
|
+
:rtype: ~PC_KEEP.GetDataAttr
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
return Token(self._connection, build_get_request(self, module=self._module, port=self._port))
|
|
169
|
+
|
|
170
|
+
def set(self, kind: PacketType, index: int, byte_count: int) -> Token[None]:
|
|
171
|
+
"""Set the configuration of how to keep captured packets.
|
|
172
|
+
|
|
173
|
+
:param kind: which general kind of packets to keep
|
|
174
|
+
:type kind: PacketType
|
|
175
|
+
:param index: test payload id or filter index for which packets to keep
|
|
176
|
+
:type index: int
|
|
177
|
+
:param byte_count: how many bytes to keep in the buffer for of each packet. The value -1 means no limit on packet size.
|
|
178
|
+
:type byte_count: int
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
return Token(self._connection, build_set_request(self, module=self._module, port=self._port, kind=kind, index=index, byte_count=byte_count))
|
|
182
|
+
|
|
183
|
+
set_all = functools.partialmethod(set, PacketType.ALL)
|
|
184
|
+
"""Keep all types of packets.
|
|
185
|
+
"""
|
|
186
|
+
|
|
187
|
+
set_fcserr = functools.partialmethod(set, PacketType.FCSERR)
|
|
188
|
+
"""Only keep the packets with FCS errors.
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
set_notpld = functools.partialmethod(set, PacketType.NOTPLD)
|
|
192
|
+
"""Only keep the packets without test payload.
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
set_tpld = functools.partialmethod(set, PacketType.TPLD)
|
|
196
|
+
"""Only keep the packets with test payload.
|
|
197
|
+
"""
|
|
198
|
+
|
|
199
|
+
set_filter = functools.partialmethod(set, PacketType.FILTER)
|
|
200
|
+
"""Only keep the packets that satisfy the given filter.
|
|
201
|
+
"""
|
|
202
|
+
|
|
203
|
+
set_plderr = functools.partialmethod(set, PacketType.PLDERR)
|
|
204
|
+
"""Only keep the packets with payload error in.
|
|
205
|
+
"""
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
@register_command
|
|
209
|
+
@dataclass
|
|
210
|
+
class PC_STATS:
|
|
211
|
+
"""
|
|
212
|
+
Obtains the number of packets currently in the capture buffer for a port. The
|
|
213
|
+
count is reset to zero when capture is turned on.
|
|
214
|
+
"""
|
|
215
|
+
|
|
216
|
+
code: typing.ClassVar[int] = 224
|
|
217
|
+
pushed: typing.ClassVar[bool] = False
|
|
218
|
+
|
|
219
|
+
_connection: 'interfaces.IConnection'
|
|
220
|
+
_module: int
|
|
221
|
+
_port: int
|
|
222
|
+
|
|
223
|
+
class GetDataAttr(ResponseBodyStruct):
|
|
224
|
+
status: int = field(XmpLong())
|
|
225
|
+
"""Capture status, 1 if capture has been stopped because of overflow, 0 if still running.
|
|
226
|
+
|
|
227
|
+
:type: int
|
|
228
|
+
"""
|
|
229
|
+
packets: int = field(XmpLong())
|
|
230
|
+
"""The number of packets in the buffer.
|
|
231
|
+
|
|
232
|
+
:type: int
|
|
233
|
+
"""
|
|
234
|
+
start_time: int = field(XmpLong())
|
|
235
|
+
"""Time when capture was started, in **nanoseconds** since 2010-01-01.
|
|
236
|
+
|
|
237
|
+
:type: int
|
|
238
|
+
"""
|
|
239
|
+
|
|
240
|
+
def get(self) -> Token[GetDataAttr]:
|
|
241
|
+
"""Get the number of packets currently in the capture buffer for a port. The count is reset to zero when capture is turned on.
|
|
242
|
+
|
|
243
|
+
:return: status of the capture, number of packets in the buffer, and start time in nanoseconds since 2010-01-01.
|
|
244
|
+
:rtype: ~PC_STATS.GetDataAttr
|
|
245
|
+
"""
|
|
246
|
+
|
|
247
|
+
return Token(self._connection, build_get_request(self, module=self._module, port=self._port))
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
@register_command
|
|
251
|
+
@dataclass
|
|
252
|
+
class PC_EXTRA:
|
|
253
|
+
"""
|
|
254
|
+
Obtains extra information about a captured packet for a port. The information
|
|
255
|
+
comprises time of capture, latency, inter-frame gap, and original packet length.
|
|
256
|
+
Latency is only valid for packets with test payloads and where the originating
|
|
257
|
+
port is on the same module and therefore has the same clock.
|
|
258
|
+
"""
|
|
259
|
+
|
|
260
|
+
code: typing.ClassVar[int] = 225
|
|
261
|
+
pushed: typing.ClassVar[bool] = False
|
|
262
|
+
|
|
263
|
+
_connection: 'interfaces.IConnection'
|
|
264
|
+
_module: int
|
|
265
|
+
_port: int
|
|
266
|
+
_capture_packet_xindex: int
|
|
267
|
+
|
|
268
|
+
class GetDataAttr(ResponseBodyStruct):
|
|
269
|
+
time_captured: int = field(XmpLong())
|
|
270
|
+
"""
|
|
271
|
+
Time of capture, in **nanoseconds** since 2010-01-01.
|
|
272
|
+
|
|
273
|
+
:type: int
|
|
274
|
+
"""
|
|
275
|
+
latency: int = field(XmpLong())
|
|
276
|
+
"""
|
|
277
|
+
The number of **nanoseconds** since the packet was transmitted.
|
|
278
|
+
|
|
279
|
+
:type: int
|
|
280
|
+
"""
|
|
281
|
+
byte_time_count: int = field(XmpLong())
|
|
282
|
+
"""
|
|
283
|
+
The number of byte-times since previous packet.
|
|
284
|
+
|
|
285
|
+
:type: int
|
|
286
|
+
"""
|
|
287
|
+
length: int = field(XmpInt())
|
|
288
|
+
"""
|
|
289
|
+
The real length of the packet on the wire.
|
|
290
|
+
|
|
291
|
+
:type: int
|
|
292
|
+
"""
|
|
293
|
+
|
|
294
|
+
def get(self) -> Token[GetDataAttr]:
|
|
295
|
+
"""Get extra information about a captured packet for a port.
|
|
296
|
+
|
|
297
|
+
:return: Extra information about a captured packet for a port.
|
|
298
|
+
|
|
299
|
+
:rtype: ~PC_EXTRA.GetDataAttr
|
|
300
|
+
"""
|
|
301
|
+
|
|
302
|
+
return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._capture_packet_xindex]))
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
@register_command
|
|
306
|
+
@dataclass
|
|
307
|
+
class PC_PACKET:
|
|
308
|
+
"""
|
|
309
|
+
Obtains the raw bytes of a captured packet for a port. The packet data may be
|
|
310
|
+
truncated if the :class:`PC_KEEP` command specified a limit on the number of bytes kept.
|
|
311
|
+
"""
|
|
312
|
+
|
|
313
|
+
code: typing.ClassVar[int] = 226
|
|
314
|
+
pushed: typing.ClassVar[bool] = False
|
|
315
|
+
|
|
316
|
+
_connection: 'interfaces.IConnection'
|
|
317
|
+
_module: int
|
|
318
|
+
_port: int
|
|
319
|
+
_capture_packet_xindex: int
|
|
320
|
+
|
|
321
|
+
class GetDataAttr(ResponseBodyStruct):
|
|
322
|
+
hex_data: Hex = field(XmpHex())
|
|
323
|
+
"""The raw bytes kept for the packet.
|
|
324
|
+
|
|
325
|
+
:type: list
|
|
326
|
+
"""
|
|
327
|
+
|
|
328
|
+
def get(self) -> Token[GetDataAttr]:
|
|
329
|
+
"""Get the raw bytes of a captured packet for a port.
|
|
330
|
+
|
|
331
|
+
:return: the raw bytes of a captured packet
|
|
332
|
+
:rtype: ~PC_PACKET.GetDataAttr
|
|
333
|
+
"""
|
|
334
|
+
|
|
335
|
+
return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._capture_packet_xindex]))
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
import typing
|
|
4
|
+
import functools
|
|
5
|
+
|
|
6
|
+
from xoa_driver.internals.core.builders import (
|
|
7
|
+
build_get_request,
|
|
8
|
+
build_set_request
|
|
9
|
+
)
|
|
10
|
+
from xoa_driver.internals.core import interfaces
|
|
11
|
+
from xoa_driver.internals.core.token import Token
|
|
12
|
+
from xoa_driver.internals.core.transporter.registry import register_command
|
|
13
|
+
from xoa_driver.internals.core.transporter.protocol.payload import (
|
|
14
|
+
field,
|
|
15
|
+
RequestBodyStruct,
|
|
16
|
+
ResponseBodyStruct,
|
|
17
|
+
XmpByte,
|
|
18
|
+
XmpInt,
|
|
19
|
+
XmpLong,
|
|
20
|
+
XmpSequence,
|
|
21
|
+
|
|
22
|
+
)
|
|
23
|
+
from .enums import (
|
|
24
|
+
OnOff,
|
|
25
|
+
SourceType,
|
|
26
|
+
PacketDetailSelection,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@register_command
|
|
31
|
+
@dataclass
|
|
32
|
+
class PD_INDICES:
|
|
33
|
+
"""
|
|
34
|
+
Obtain or configure histogram indices for each of N histograms.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
code: typing.ClassVar[int] = 140
|
|
38
|
+
pushed: typing.ClassVar[bool] = False
|
|
39
|
+
|
|
40
|
+
_connection: 'interfaces.IConnection'
|
|
41
|
+
_module: int
|
|
42
|
+
_port: int
|
|
43
|
+
|
|
44
|
+
class GetDataAttr(ResponseBodyStruct):
|
|
45
|
+
histogram_indices: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
|
|
46
|
+
"""list of integers, histogram indices"""
|
|
47
|
+
|
|
48
|
+
class SetDataAttr(RequestBodyStruct):
|
|
49
|
+
histogram_indices: typing.List[int] = field(XmpSequence(types_chunk=[XmpInt()]))
|
|
50
|
+
"""list of integers, histogram indices"""
|
|
51
|
+
|
|
52
|
+
def get(self) -> Token[GetDataAttr]:
|
|
53
|
+
"""Get the histogram indices for each of N histograms.
|
|
54
|
+
|
|
55
|
+
:return: the histogram indices for each of N histograms
|
|
56
|
+
:rtype: PD_INDICES.GetDataAttr
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
return Token(self._connection, build_get_request(self, module=self._module, port=self._port))
|
|
60
|
+
|
|
61
|
+
def set(self, histogram_indices: typing.List[int]) -> Token[None]:
|
|
62
|
+
"""Set the histogram indices for each of N histograms.
|
|
63
|
+
|
|
64
|
+
:param histogram_indices: histogram indices
|
|
65
|
+
:type histogram_indices: typing.List[int]
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
return Token(self._connection, build_set_request(self, module=self._module, port=self._port, histogram_indices=histogram_indices))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@register_command
|
|
72
|
+
@dataclass
|
|
73
|
+
class PD_CREATE:
|
|
74
|
+
"""
|
|
75
|
+
Creates a histogram definition with the specified sub-index value.
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
code: typing.ClassVar[int] = 141
|
|
79
|
+
pushed: typing.ClassVar[bool] = False
|
|
80
|
+
|
|
81
|
+
_connection: 'interfaces.IConnection'
|
|
82
|
+
_module: int
|
|
83
|
+
_port: int
|
|
84
|
+
_dataset_xindex: int
|
|
85
|
+
|
|
86
|
+
class SetDataAttr(RequestBodyStruct):
|
|
87
|
+
pass
|
|
88
|
+
|
|
89
|
+
def set(self) -> Token[None]:
|
|
90
|
+
"""Create a histogram definition with the specified sub-index value.
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._dataset_xindex]))
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@register_command
|
|
97
|
+
@dataclass
|
|
98
|
+
class PD_DELETE:
|
|
99
|
+
"""
|
|
100
|
+
Delete an existing histogram definition.
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
code: typing.ClassVar[int] = 142
|
|
104
|
+
pushed: typing.ClassVar[bool] = False
|
|
105
|
+
|
|
106
|
+
_connection: 'interfaces.IConnection'
|
|
107
|
+
_module: int
|
|
108
|
+
_port: int
|
|
109
|
+
_dataset_xindex: int
|
|
110
|
+
|
|
111
|
+
class SetDataAttr(RequestBodyStruct):
|
|
112
|
+
pass
|
|
113
|
+
|
|
114
|
+
def set(self) -> Token[None]:
|
|
115
|
+
"""Delete an existing histogram definition.
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._dataset_xindex]))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@register_command
|
|
122
|
+
@dataclass
|
|
123
|
+
class PD_ENABLE:
|
|
124
|
+
"""
|
|
125
|
+
Whether a histogram is currently active on a port. When turned on, all the bucket
|
|
126
|
+
counts are cleared to zero. Subsequently each packet matching the histogram source
|
|
127
|
+
criteria is counted into one of the buckets. While a histogram is enabled its
|
|
128
|
+
parameters cannot be changed.
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
code: typing.ClassVar[int] = 143
|
|
132
|
+
pushed: typing.ClassVar[bool] = False
|
|
133
|
+
|
|
134
|
+
_connection: 'interfaces.IConnection'
|
|
135
|
+
_module: int
|
|
136
|
+
_port: int
|
|
137
|
+
_dataset_xindex: int
|
|
138
|
+
|
|
139
|
+
class GetDataAttr(ResponseBodyStruct):
|
|
140
|
+
on_off: OnOff = field(XmpByte())
|
|
141
|
+
"""coded integer, whether the histogram is enabled."""
|
|
142
|
+
|
|
143
|
+
class SetDataAttr(RequestBodyStruct):
|
|
144
|
+
on_off: OnOff = field(XmpByte())
|
|
145
|
+
"""coded integer, whether the histogram is enabled."""
|
|
146
|
+
|
|
147
|
+
def get(self) -> Token[GetDataAttr]:
|
|
148
|
+
"""Get whether a histogram is currently active on a port.
|
|
149
|
+
|
|
150
|
+
:return: whether the histogram is enabled
|
|
151
|
+
:rtype: OnOff
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._dataset_xindex]))
|
|
155
|
+
|
|
156
|
+
def set(self, on_off: OnOff) -> Token[None]:
|
|
157
|
+
"""Set whether a histogram is currently active on a port.
|
|
158
|
+
|
|
159
|
+
:param on_off: whether the histogram is enabled
|
|
160
|
+
:type on_off: OnOff
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._dataset_xindex], on_off=on_off))
|
|
164
|
+
|
|
165
|
+
set_off = functools.partialmethod(set, OnOff.OFF)
|
|
166
|
+
"""Disable the histogram on the port.
|
|
167
|
+
"""
|
|
168
|
+
|
|
169
|
+
set_on = functools.partialmethod(set, OnOff.ON)
|
|
170
|
+
"""Enable the histogram on the port.
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
@register_command
|
|
175
|
+
@dataclass
|
|
176
|
+
class PD_SOURCE:
|
|
177
|
+
"""
|
|
178
|
+
The source criteria specifying what is counted, and for which packets, by a
|
|
179
|
+
histogram of a port.
|
|
180
|
+
"""
|
|
181
|
+
|
|
182
|
+
code: typing.ClassVar[int] = 144
|
|
183
|
+
pushed: typing.ClassVar[bool] = True
|
|
184
|
+
|
|
185
|
+
_connection: 'interfaces.IConnection'
|
|
186
|
+
_module: int
|
|
187
|
+
_port: int
|
|
188
|
+
_dataset_xindex: int
|
|
189
|
+
|
|
190
|
+
class GetDataAttr(ResponseBodyStruct):
|
|
191
|
+
source_type: SourceType = field(XmpInt())
|
|
192
|
+
"""coded integer, specifying what is counted and for which packets."""
|
|
193
|
+
which_packets: PacketDetailSelection = field(XmpInt())
|
|
194
|
+
"""coded integer, specifying a further detail on which packets to count."""
|
|
195
|
+
identity: int = field(XmpInt())
|
|
196
|
+
"""integer, test payload id or filter id for the wanted packets."""
|
|
197
|
+
|
|
198
|
+
class SetDataAttr(RequestBodyStruct):
|
|
199
|
+
source_type: SourceType = field(XmpInt())
|
|
200
|
+
"""coded integer, specifying what is counted and for which packets."""
|
|
201
|
+
which_packets: PacketDetailSelection = field(XmpInt())
|
|
202
|
+
"""coded integer, specifying a further detail on which packets to count."""
|
|
203
|
+
identity: int = field(XmpInt())
|
|
204
|
+
"""integer, test payload id or filter id for the wanted packets."""
|
|
205
|
+
|
|
206
|
+
def get(self) -> Token[GetDataAttr]:
|
|
207
|
+
"""Get the source criteria specifying what is counted, and for which packets, by a histogram of a port.
|
|
208
|
+
|
|
209
|
+
:return: what is counted and for which packets, a further detail on which packets to count, test payload id or filter id for the wanted packets
|
|
210
|
+
:rtype: PD_SOURCE.GetDataAttr
|
|
211
|
+
"""
|
|
212
|
+
|
|
213
|
+
return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._dataset_xindex]))
|
|
214
|
+
|
|
215
|
+
def set(self, source_type: SourceType, which_packets: PacketDetailSelection, identity: int) -> Token[None]:
|
|
216
|
+
"""Set the source criteria specifying what is counted, and for which packets, by a histogram of a port.
|
|
217
|
+
|
|
218
|
+
:param source_type: what is counted and for which packets
|
|
219
|
+
:type source_type: SourceType
|
|
220
|
+
:param which_packets: a further detail on which packets to count
|
|
221
|
+
:type which_packets: PacketDetailSelection
|
|
222
|
+
:param identity: test payload id or filter id for the wanted packets
|
|
223
|
+
:type identity: int
|
|
224
|
+
"""
|
|
225
|
+
|
|
226
|
+
return Token(
|
|
227
|
+
self._connection,
|
|
228
|
+
build_set_request(
|
|
229
|
+
self,
|
|
230
|
+
module=self._module,
|
|
231
|
+
port=self._port,
|
|
232
|
+
indices=[self._dataset_xindex],
|
|
233
|
+
source_type=source_type,
|
|
234
|
+
which_packets=which_packets,
|
|
235
|
+
identity=identity
|
|
236
|
+
)
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
@register_command
|
|
241
|
+
@dataclass
|
|
242
|
+
class PD_RANGE:
|
|
243
|
+
"""
|
|
244
|
+
The bucket ranges used for classifying the packets counted by a histogram of a
|
|
245
|
+
port. The packets are either counted by length, measured in bytes, by inter-
|
|
246
|
+
frame gap to the preceding packet, also measured in bytes, or by latency in
|
|
247
|
+
transmission measured in nanoseconds. There are a fixed number of buckets, each
|
|
248
|
+
middle bucket covering a fixed-size range of values which is a power of two.
|
|
249
|
+
The first and last buckets count all the packets that do not fit within the
|
|
250
|
+
ranges of the middle buckets. The buckets are placed at a certain offset by
|
|
251
|
+
specifying the first value that should be counted by the first middle bucket.
|
|
252
|
+
"""
|
|
253
|
+
|
|
254
|
+
code: typing.ClassVar[int] = 145
|
|
255
|
+
pushed: typing.ClassVar[bool] = True
|
|
256
|
+
|
|
257
|
+
_connection: 'interfaces.IConnection'
|
|
258
|
+
_module: int
|
|
259
|
+
_port: int
|
|
260
|
+
_dataset_xindex: int
|
|
261
|
+
|
|
262
|
+
class GetDataAttr(ResponseBodyStruct):
|
|
263
|
+
start: int = field(XmpInt())
|
|
264
|
+
"""integer, first value going into the second bucket."""
|
|
265
|
+
step: int = field(XmpInt())
|
|
266
|
+
"""integer, the span of each middle bucket:
|
|
267
|
+
(1) 1,2,4,8,16,32,64,128,256,512 (bytes, non-latency histograms).
|
|
268
|
+
(2) 16,32,64,128,...,1048576,2097152 (nanoseconds, latency histograms).
|
|
269
|
+
"""
|
|
270
|
+
bucket_count: int = field(XmpInt())
|
|
271
|
+
"""integer, the total number of buckets."""
|
|
272
|
+
|
|
273
|
+
class SetDataAttr(RequestBodyStruct):
|
|
274
|
+
start: int = field(XmpInt())
|
|
275
|
+
"""integer, first value going into the second bucket."""
|
|
276
|
+
step: int = field(XmpInt())
|
|
277
|
+
"""integer, the span of each middle bucket:
|
|
278
|
+
(1) 1,2,4,8,16,32,64,128,256,512 (bytes, non-latency histograms).
|
|
279
|
+
(2) 16,32,64,128,...,1048576,2097152 (nanoseconds, latency histograms).
|
|
280
|
+
"""
|
|
281
|
+
bucket_count: int = field(XmpInt())
|
|
282
|
+
"""integer, the total number of buckets."""
|
|
283
|
+
|
|
284
|
+
def get(self) -> Token[GetDataAttr]:
|
|
285
|
+
"""Get the bucket ranges used for classifying the packets counted by a histogram of a port.
|
|
286
|
+
|
|
287
|
+
:return: first value going into the second bucket, the span of each middle bucket, the total number of buckets
|
|
288
|
+
:rtype: PD_RANGE.GetDataAttr
|
|
289
|
+
"""
|
|
290
|
+
|
|
291
|
+
return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._dataset_xindex]))
|
|
292
|
+
|
|
293
|
+
def set(self, start: int, step: int, bucket_count: int) -> Token[None]:
|
|
294
|
+
"""Set the bucket ranges used for classifying the packets counted by a histogram of a port.
|
|
295
|
+
The packets are either counted by length, measured in bytes, by inter-
|
|
296
|
+
frame gap to the preceding packet, also measured in bytes, or by latency in
|
|
297
|
+
transmission measured in nanoseconds. There are a fixed number of buckets, each
|
|
298
|
+
middle bucket covering a fixed-size range of values which is a power of two.
|
|
299
|
+
The first and last buckets count all the packets that do not fit within the
|
|
300
|
+
ranges of the middle buckets. The buckets are placed at a certain offset by
|
|
301
|
+
specifying the first value that should be counted by the first middle bucket.
|
|
302
|
+
|
|
303
|
+
:param start: first value going into the second bucket
|
|
304
|
+
:type start: int
|
|
305
|
+
:param step: the span of each middle bucket:
|
|
306
|
+
(1) 1,2,4,8,16,32,64,128,256,512 (bytes, non-latency histograms).
|
|
307
|
+
(2) 16,32,64,128,...,1048576,2097152 (nanoseconds, latency histograms)
|
|
308
|
+
:type step: int
|
|
309
|
+
:param bucket_count: the total number of buckets
|
|
310
|
+
:type bucket_count: int
|
|
311
|
+
"""
|
|
312
|
+
|
|
313
|
+
return Token(
|
|
314
|
+
self._connection,
|
|
315
|
+
build_set_request(
|
|
316
|
+
self,
|
|
317
|
+
module=self._module,
|
|
318
|
+
port=self._port,
|
|
319
|
+
indices=[self._dataset_xindex],
|
|
320
|
+
start=start,
|
|
321
|
+
step=step,
|
|
322
|
+
bucket_count=bucket_count
|
|
323
|
+
)
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
@register_command
|
|
328
|
+
@dataclass
|
|
329
|
+
class PD_SAMPLES:
|
|
330
|
+
"""
|
|
331
|
+
The current set of counts collected by a histogram for a port. There is one value
|
|
332
|
+
for each bucket, but any trailing zeros are left out. The list is empty if all
|
|
333
|
+
counts are zero.
|
|
334
|
+
"""
|
|
335
|
+
|
|
336
|
+
code: typing.ClassVar[int] = 146
|
|
337
|
+
pushed: typing.ClassVar[bool] = False
|
|
338
|
+
|
|
339
|
+
_connection: 'interfaces.IConnection'
|
|
340
|
+
_module: int
|
|
341
|
+
_port: int
|
|
342
|
+
_dataset_xindex: int
|
|
343
|
+
|
|
344
|
+
class GetDataAttr(ResponseBodyStruct):
|
|
345
|
+
packet_counts: typing.List[int] = field(XmpSequence(types_chunk=[XmpLong()]))
|
|
346
|
+
"""list of long integers, the number of packets counted for each bucket."""
|
|
347
|
+
|
|
348
|
+
def get(self) -> Token[GetDataAttr]:
|
|
349
|
+
"""Get current set of counts collected by a histogram for a port.
|
|
350
|
+
|
|
351
|
+
:return: the number of packets counted for each bucket
|
|
352
|
+
:rtype: PD_SAMPLES.GetDataAttr
|
|
353
|
+
"""
|
|
354
|
+
|
|
355
|
+
return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._dataset_xindex]))
|