tdl-xoa-driver 1.3.0__py3-none-any.whl → 1.4.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.3.0.dist-info → tdl_xoa_driver-1.4.0.dist-info}/METADATA +5 -5
- tdl_xoa_driver-1.4.0.dist-info/RECORD +218 -0
- xoa_driver/__init__.py +2 -2
- xoa_driver/functions/anlt.py +2 -2
- xoa_driver/functions/mgmt.py +11 -20
- xoa_driver/hlfuncs.py +1 -1
- xoa_driver/internals/commands/p_commands.py +12 -10
- xoa_driver/internals/commands/pt_commands.py +21 -1
- xoa_driver/internals/commands/px_commands.py +1686 -6
- xoa_driver/internals/core/transporter/_request_id_counter.py +1 -1
- xoa_driver/internals/core/transporter/protocol/payload/__init__.py +3 -1
- xoa_driver/internals/core/transporter/protocol/payload/field.py +41 -0
- xoa_driver/internals/core/transporter/protocol/payload/types.py +19 -0
- xoa_driver/internals/{hli_v1 → hli}/indices/filter/base_filter.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/indices/length_term.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/indices/macsecscs/base_macsecsc.py +2 -2
- xoa_driver/internals/{hli_v1 → hli}/indices/match_term.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/indices/port_dataset.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/indices/streams/base_stream.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/module_chimera.py +3 -3
- xoa_driver/internals/{hli_v1 → hli}/modules/module_l47.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_combi.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_d.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_e.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_f.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_g.py +17 -2
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_h.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_i.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_j.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_k.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_l.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_l1.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_m.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/family_n.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/module_l23_base.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/bases/port_l23.py +3 -3
- xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/bases/port_l23_genuine.py +4 -4
- xoa_driver/internals/hli/ports/port_l23/bases/port_transceiver.py +247 -0
- xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/bases/port_transmission_statistics.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/port_chimera.py +1 -1
- xoa_driver/internals/{hli_v2 → hli}/ports/port_l23/family_g.py +5 -0
- xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/port_l23ve.py +2 -2
- xoa_driver/internals/{hli_v1 → hli}/ports/port_l47/main.py +2 -2
- xoa_driver/internals/{hli_v1 → hli}/testers/l23_tester.py +1 -1
- xoa_driver/internals/{hli_v1 → hli}/testers/l47_tester.py +2 -2
- xoa_driver/misc.py +12 -17
- xoa_driver/modules.py +18 -22
- xoa_driver/ports.py +20 -20
- xoa_driver/testers.py +4 -8
- tdl_xoa_driver-1.3.0.dist-info/RECORD +0 -325
- xoa_driver/internals/hli_v1/ports/port_l23/bases/port_transceiver.py +0 -117
- xoa_driver/internals/hli_v1/ports/port_l23/family_g.py +0 -77
- 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 +0 -39
- xoa_driver/internals/hli_v2/indices/connection_group/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/connection_group/cg.py +0 -115
- xoa_driver/internals/hli_v2/indices/connection_group/histogram.py +0 -59
- xoa_driver/internals/hli_v2/indices/connection_group/l2.py +0 -71
- xoa_driver/internals/hli_v2/indices/connection_group/l3.py +0 -96
- xoa_driver/internals/hli_v2/indices/connection_group/raw.py +0 -148
- xoa_driver/internals/hli_v2/indices/connection_group/replay.py +0 -89
- xoa_driver/internals/hli_v2/indices/connection_group/tcp.py +0 -261
- xoa_driver/internals/hli_v2/indices/connection_group/tls.py +0 -166
- xoa_driver/internals/hli_v2/indices/connection_group/udp.py +0 -112
- xoa_driver/internals/hli_v2/indices/connection_group/user_state.py +0 -25
- xoa_driver/internals/hli_v2/indices/filter/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/filter/base_filter.py +0 -50
- xoa_driver/internals/hli_v2/indices/filter/genuine_filter.py +0 -17
- xoa_driver/internals/hli_v2/indices/length_term.py +0 -44
- xoa_driver/internals/hli_v2/indices/match_term.py +0 -49
- xoa_driver/internals/hli_v2/indices/port_dataset.py +0 -53
- xoa_driver/internals/hli_v2/indices/streams/__init__.py +0 -0
- xoa_driver/internals/hli_v2/indices/streams/base_stream.py +0 -234
- xoa_driver/internals/hli_v2/indices/streams/genuine_stream.py +0 -32
- xoa_driver/internals/hli_v2/modules/__init__.py +0 -0
- xoa_driver/internals/hli_v2/modules/__interfaces.py +0 -21
- xoa_driver/internals/hli_v2/modules/base_module.py +0 -125
- xoa_driver/internals/hli_v2/modules/module_chimera.py +0 -358
- xoa_driver/internals/hli_v2/modules/module_l23ve.py +0 -58
- xoa_driver/internals/hli_v2/modules/module_l47.py +0 -230
- xoa_driver/internals/hli_v2/modules/module_l47ve.py +0 -8
- xoa_driver/internals/hli_v2/modules/modules_l23/__init__.py +0 -0
- xoa_driver/internals/hli_v2/modules/modules_l23/family_combi.py +0 -73
- xoa_driver/internals/hli_v2/modules/modules_l23/family_d.py +0 -75
- xoa_driver/internals/hli_v2/modules/modules_l23/family_e.py +0 -85
- xoa_driver/internals/hli_v2/modules/modules_l23/family_f.py +0 -144
- xoa_driver/internals/hli_v2/modules/modules_l23/family_g.py +0 -84
- xoa_driver/internals/hli_v2/modules/modules_l23/family_h.py +0 -40
- xoa_driver/internals/hli_v2/modules/modules_l23/family_i.py +0 -25
- xoa_driver/internals/hli_v2/modules/modules_l23/family_j.py +0 -25
- xoa_driver/internals/hli_v2/modules/modules_l23/family_k.py +0 -39
- xoa_driver/internals/hli_v2/modules/modules_l23/family_l.py +0 -55
- xoa_driver/internals/hli_v2/modules/modules_l23/family_l1.py +0 -797
- xoa_driver/internals/hli_v2/modules/modules_l23/family_m.py +0 -25
- xoa_driver/internals/hli_v2/modules/modules_l23/family_n.py +0 -40
- xoa_driver/internals/hli_v2/modules/modules_l23/module_l23_base.py +0 -339
- xoa_driver/internals/hli_v2/ports/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/base_port.py +0 -105
- 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 +0 -64
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_l23.py +0 -441
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_l23_genuine.py +0 -172
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_reception_statistics.py +0 -156
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_transceiver.py +0 -117
- xoa_driver/internals/hli_v2/ports/port_l23/bases/port_transmission_statistics.py +0 -59
- 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 +0 -15
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/general.py +0 -340
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/shadow.py +0 -99
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/filter_definition/working.py +0 -36
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/pe_custom_distribution.py +0 -116
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/pe_distribution.py +0 -102
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/port_chimera.py +0 -113
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/port_emulation.py +0 -420
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/reception_statistics.py +0 -22
- xoa_driver/internals/hli_v2/ports/port_l23/chimera/transmission_statistics.py +0 -22
- xoa_driver/internals/hli_v2/ports/port_l23/family_combi.py +0 -36
- xoa_driver/internals/hli_v2/ports/port_l23/family_d.py +0 -49
- xoa_driver/internals/hli_v2/ports/port_l23/family_e.py +0 -96
- xoa_driver/internals/hli_v2/ports/port_l23/family_f.py +0 -144
- xoa_driver/internals/hli_v2/ports/port_l23/family_h.py +0 -60
- xoa_driver/internals/hli_v2/ports/port_l23/family_i.py +0 -66
- xoa_driver/internals/hli_v2/ports/port_l23/family_j.py +0 -53
- xoa_driver/internals/hli_v2/ports/port_l23/family_k.py +0 -58
- xoa_driver/internals/hli_v2/ports/port_l23/family_l.py +0 -67
- xoa_driver/internals/hli_v2/ports/port_l23/family_l1.py +0 -149
- xoa_driver/internals/hli_v2/ports/port_l23/family_m.py +0 -28
- xoa_driver/internals/hli_v2/ports/port_l23/fault_jkl.py +0 -22
- xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_ghijkl.py +0 -342
- xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_ijkl_chimera.py +0 -50
- xoa_driver/internals/hli_v2/ports/port_l23/pcs_pma_l.py +0 -65
- xoa_driver/internals/hli_v2/ports/port_l23/port_l23ve.py +0 -81
- xoa_driver/internals/hli_v2/ports/port_l47/__init__.py +0 -0
- xoa_driver/internals/hli_v2/ports/port_l47/counters.py +0 -146
- xoa_driver/internals/hli_v2/ports/port_l47/main.py +0 -137
- xoa_driver/internals/hli_v2/ports/port_l47/packet_engine.py +0 -20
- xoa_driver/internals/hli_v2/revisions.py +0 -11
- xoa_driver/internals/hli_v2/testers/__init__.py +0 -0
- xoa_driver/internals/hli_v2/testers/_base_tester.py +0 -207
- 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 +0 -16
- xoa_driver/internals/hli_v2/testers/genuine/l_23/rest_api.py +0 -34
- xoa_driver/internals/hli_v2/testers/genuine/l_23/time_keeper.py +0 -50
- xoa_driver/internals/hli_v2/testers/genuine/l_23/upload_file.py +0 -26
- xoa_driver/internals/hli_v2/testers/genuine/management_interface.py +0 -38
- xoa_driver/internals/hli_v2/testers/l23_tester.py +0 -159
- xoa_driver/internals/hli_v2/testers/l23ve_tester.py +0 -98
- xoa_driver/internals/hli_v2/testers/l47_tester.py +0 -95
- xoa_driver/internals/hli_v2/testers/l47ve_tester.py +0 -50
- xoa_driver/v2/__init__.py +0 -11
- xoa_driver/v2/misc.py +0 -77
- xoa_driver/v2/modules.py +0 -308
- xoa_driver/v2/ports.py +0 -232
- xoa_driver/v2/testers.py +0 -24
- {tdl_xoa_driver-1.3.0.dist-info → tdl_xoa_driver-1.4.0.dist-info}/WHEEL +0 -0
- {tdl_xoa_driver-1.3.0.dist-info → tdl_xoa_driver-1.4.0.dist-info}/licenses/LICENSE +0 -0
- {tdl_xoa_driver-1.3.0.dist-info → tdl_xoa_driver-1.4.0.dist-info}/top_level.txt +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/base_index.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/cg.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/histogram.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/l2.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/l3.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/raw.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/replay.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/tcp.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/tls.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/udp.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/connection_group/user_state.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/filter/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/filter/genuine_filter.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/macsecscs/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/macsecscs/genuine_macsecsc.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/streams/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/indices/streams/genuine_stream.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/modules/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/modules/__interfaces.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/modules/base_module.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/modules/module_l23ve.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/modules/module_l47ve.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/modules/modules_l23/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/base_port.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/bases/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/bases/port_capture.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/bases/port_reception_statistics.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/filter_definition/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/filter_definition/_utils.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/filter_definition/general.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/filter_definition/shadow.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/filter_definition/working.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/pe_custom_distribution.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/pe_distribution.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/port_emulation.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/reception_statistics.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/chimera/transmission_statistics.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_combi.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_d.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_e.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_f.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_h.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_i.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_j.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_k.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_l.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_l1.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/family_m.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/fault_jkl.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/freya_l1.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/pcs_pma_ghijkl.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/pcs_pma_ijkl_chimera.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l23/pcs_pma_l.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l47/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l47/counters.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/ports/port_l47/packet_engine.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/revisions.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/_base_tester.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/genuine/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/genuine/l_23/__init__.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/genuine/l_23/health.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/genuine/l_23/rest_api.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/genuine/l_23/time_keeper.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/genuine/l_23/upload_file.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/genuine/management_interface.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/l23ve_tester.py +0 -0
- /xoa_driver/internals/{hli_v1 → hli}/testers/l47ve_tester.py +0 -0
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
from typing import (
|
|
2
|
-
TYPE_CHECKING,
|
|
3
|
-
Dict,
|
|
4
|
-
)
|
|
5
|
-
if TYPE_CHECKING:
|
|
6
|
-
from xoa_driver.internals.core import interfaces as itf
|
|
7
|
-
|
|
8
|
-
from xoa_driver.internals.commands import (
|
|
9
|
-
PR_TPLDJITTER,
|
|
10
|
-
PR_TOTAL,
|
|
11
|
-
PR_NOTPLD,
|
|
12
|
-
PR_EXTRA,
|
|
13
|
-
PR_TPLDS,
|
|
14
|
-
PR_TPLDTRAFFIC,
|
|
15
|
-
PR_TPLDERRORS,
|
|
16
|
-
PR_TPLDLATENCY,
|
|
17
|
-
PR_FILTER,
|
|
18
|
-
PR_CLEAR,
|
|
19
|
-
PR_PFCSTATS,
|
|
20
|
-
# genuine only
|
|
21
|
-
PR_CALIBRATE,
|
|
22
|
-
PR_UAT_STATUS,
|
|
23
|
-
PR_UAT_TIME,
|
|
24
|
-
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# region All Ports
|
|
29
|
-
|
|
30
|
-
class PrsTPLD:
|
|
31
|
-
"""L23 port's TPLD traffic statistics."""
|
|
32
|
-
|
|
33
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, tpld_idx: int) -> None:
|
|
34
|
-
self.traffic = PR_TPLDTRAFFIC(conn, module_id, port_id, tpld_idx)
|
|
35
|
-
"""L23 port's statistics of traffic with TPLD.
|
|
36
|
-
Representation of PR_TPLDTRAFFIC
|
|
37
|
-
"""
|
|
38
|
-
|
|
39
|
-
self.errors = PR_TPLDERRORS(conn, module_id, port_id, tpld_idx)
|
|
40
|
-
"""L23 port's error statistics of traffic with TPLD.
|
|
41
|
-
Representation of PR_TPLDERRORS
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
self.latency = PR_TPLDLATENCY(conn, module_id, port_id, tpld_idx)
|
|
45
|
-
"""L23 port's latency statistics of traffic with TPLD.
|
|
46
|
-
Representation of PR_TPLDLATENCY
|
|
47
|
-
"""
|
|
48
|
-
|
|
49
|
-
self.jitter = PR_TPLDJITTER(conn, module_id, port_id, tpld_idx)
|
|
50
|
-
"""L23 port's jitter statistics of traffic with TPLD.
|
|
51
|
-
Representation of PR_TPLDJITTER
|
|
52
|
-
"""
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
class PortReceptionStatistics:
|
|
56
|
-
"""Port RX statistics"""
|
|
57
|
-
|
|
58
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
59
|
-
self.__conn = conn
|
|
60
|
-
self.__module_id = module_id
|
|
61
|
-
self.__port_id = port_id
|
|
62
|
-
|
|
63
|
-
self.__tpld_ids = PR_TPLDS(conn, module_id, port_id)
|
|
64
|
-
|
|
65
|
-
self.total = PR_TOTAL(conn, module_id, port_id)
|
|
66
|
-
"""L23 port's total traffic statistics.
|
|
67
|
-
Representation of PR_TOTAL
|
|
68
|
-
"""
|
|
69
|
-
|
|
70
|
-
self.no_tpld = PR_NOTPLD(conn, module_id, port_id)
|
|
71
|
-
"""L23 port's statistics of traffic without TPLD.
|
|
72
|
-
Representation of PR_NOTPLD
|
|
73
|
-
"""
|
|
74
|
-
|
|
75
|
-
self.extra = PR_EXTRA(conn, module_id, port_id)
|
|
76
|
-
"""L23 port's extra traffic statistics.
|
|
77
|
-
Representation of PR_EXTRA
|
|
78
|
-
"""
|
|
79
|
-
self.pfc_stats = PR_PFCSTATS(conn, module_id, port_id)
|
|
80
|
-
"""L23 port's statistics of received PFC packets.
|
|
81
|
-
Representation of PR_PFCSTATS
|
|
82
|
-
"""
|
|
83
|
-
self.clear = PR_CLEAR(conn, module_id, port_id)
|
|
84
|
-
"""Clear all RX statistics on the L23 port.
|
|
85
|
-
Representation of PR_CLEAR
|
|
86
|
-
"""
|
|
87
|
-
|
|
88
|
-
def obtain_filter_statistics(self, filter: int) -> "PR_FILTER":
|
|
89
|
-
"""Obtain L23 port filtered traffic statistics.
|
|
90
|
-
|
|
91
|
-
:param filter: index of the filter
|
|
92
|
-
:type filter: int
|
|
93
|
-
:return: filtered traffic statistics
|
|
94
|
-
:rtype: PR_FILTER
|
|
95
|
-
"""
|
|
96
|
-
|
|
97
|
-
return PR_FILTER(
|
|
98
|
-
self.__conn,
|
|
99
|
-
self.__module_id,
|
|
100
|
-
self.__port_id,
|
|
101
|
-
filter
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
def access_tpld(self, tpld_id: int) -> "PrsTPLD":
|
|
105
|
-
"""Access a certain TPLD value on a L23 port.
|
|
106
|
-
|
|
107
|
-
:param tpld_id: TPLD value.
|
|
108
|
-
:type tpld_id: int
|
|
109
|
-
:return: L23 port's TPLD traffic statistics
|
|
110
|
-
:rtype: PrsTPLD
|
|
111
|
-
"""
|
|
112
|
-
return PrsTPLD(self.__conn, self.__module_id, self.__port_id, tpld_id)
|
|
113
|
-
|
|
114
|
-
async def obtain_available_tplds(self) -> Dict[int, "PrsTPLD"]:
|
|
115
|
-
#TODO: need to check use case if this is enough, otherwise to extend by give possibility manually specify indices
|
|
116
|
-
tplds = await self.__tpld_ids.get()
|
|
117
|
-
return {
|
|
118
|
-
idx:
|
|
119
|
-
PrsTPLD(self.__conn, self.__module_id, self.__port_id, idx)
|
|
120
|
-
for idx in tplds.test_payload_identifiers
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
# endregion
|
|
125
|
-
|
|
126
|
-
# region Genuine Ports
|
|
127
|
-
class GPrsUat():
|
|
128
|
-
"""L23 port UAT info."""
|
|
129
|
-
|
|
130
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
131
|
-
self.status = PR_UAT_STATUS(conn, module_id, port_id)
|
|
132
|
-
"""L23 port UAT status.
|
|
133
|
-
Representation of PR_UAT_STATUS
|
|
134
|
-
"""
|
|
135
|
-
|
|
136
|
-
self.time = PR_UAT_TIME(conn, module_id, port_id)
|
|
137
|
-
"""L23 port number of unavailable seconds.
|
|
138
|
-
Representation of PR_UAT_TIME
|
|
139
|
-
"""
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
class GenuinePortReceptionStatistics(PortReceptionStatistics):
|
|
143
|
-
"""L23 port RX statistics."""
|
|
144
|
-
|
|
145
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
146
|
-
super().__init__(conn, module_id, port_id)
|
|
147
|
-
self.calibrate = PR_CALIBRATE(conn, module_id, port_id)
|
|
148
|
-
"""L23 port calibration of latency for received packets.
|
|
149
|
-
Representation of PR_CALIBRATE
|
|
150
|
-
"""
|
|
151
|
-
|
|
152
|
-
self.uat = GPrsUat(conn, module_id, port_id)
|
|
153
|
-
"""L23 port UAT info.
|
|
154
|
-
"""
|
|
155
|
-
|
|
156
|
-
# endregion
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING
|
|
2
|
-
if TYPE_CHECKING:
|
|
3
|
-
from xoa_driver.internals.core import interfaces as itf
|
|
4
|
-
from xoa_driver.internals.commands import (
|
|
5
|
-
PX_RW,
|
|
6
|
-
PX_MII,
|
|
7
|
-
PX_TEMPERATURE,
|
|
8
|
-
PX_RW_SEQ,
|
|
9
|
-
PX_I2C_CONFIG,
|
|
10
|
-
PX_RW_SEQ_BANK,
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class PortTransceiver:
|
|
15
|
-
"""L23 port transceiver."""
|
|
16
|
-
|
|
17
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
18
|
-
self.__conn = conn
|
|
19
|
-
self.__module_id = module_id
|
|
20
|
-
self.__port_id = port_id
|
|
21
|
-
|
|
22
|
-
self.i2c_config = PX_I2C_CONFIG(conn, module_id, port_id)
|
|
23
|
-
"""Access speed on a transceiver.
|
|
24
|
-
:type: PX_I2C_CONFIG
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
def access_temperature(self):
|
|
28
|
-
"""Transceiver temperature in Celsius.
|
|
29
|
-
|
|
30
|
-
:return: Transceiver temperature integral and decimal parts
|
|
31
|
-
:rtype: PX_TEMPERATURE
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
return PX_TEMPERATURE(
|
|
35
|
-
self.__conn,
|
|
36
|
-
self.__module_id,
|
|
37
|
-
self.__port_id,
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
def access_rw(self, page_address: int, register_address: int) -> "PX_RW":
|
|
41
|
-
"""Access to register interface by the transceiver.
|
|
42
|
-
|
|
43
|
-
:param page_address: page address
|
|
44
|
-
:type page_address: int
|
|
45
|
-
:param register_address: register address
|
|
46
|
-
:type register_address: int
|
|
47
|
-
:return: transceiver register values
|
|
48
|
-
:rtype: PX_RW
|
|
49
|
-
"""
|
|
50
|
-
|
|
51
|
-
return PX_RW(
|
|
52
|
-
self.__conn,
|
|
53
|
-
self.__module_id,
|
|
54
|
-
self.__port_id,
|
|
55
|
-
page_address,
|
|
56
|
-
register_address
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
def access_mii(self, register_address: int) -> "PX_MII":
|
|
60
|
-
"""Access to the register interface supported by the media-independent interface (MII) transceiver.
|
|
61
|
-
|
|
62
|
-
:param register_address: register address
|
|
63
|
-
:type register_address: int
|
|
64
|
-
:return: register values
|
|
65
|
-
:rtype: PX_MII
|
|
66
|
-
"""
|
|
67
|
-
return PX_MII(
|
|
68
|
-
self.__conn,
|
|
69
|
-
self.__module_id,
|
|
70
|
-
self.__port_id,
|
|
71
|
-
register_address
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
def access_rw_seq(self, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ":
|
|
75
|
-
"""Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
|
|
76
|
-
|
|
77
|
-
:param page_address: page address (0-255)
|
|
78
|
-
:type page_address: int
|
|
79
|
-
:param register_address: register address (0-255)
|
|
80
|
-
:type register_address: int
|
|
81
|
-
:param byte_count: the number of bytes to read/write
|
|
82
|
-
:type byte_count: int
|
|
83
|
-
:return: transceiver register values
|
|
84
|
-
:rtype: PX_RW_SEQ
|
|
85
|
-
"""
|
|
86
|
-
return PX_RW_SEQ(
|
|
87
|
-
self.__conn,
|
|
88
|
-
self.__module_id,
|
|
89
|
-
self.__port_id,
|
|
90
|
-
page_address,
|
|
91
|
-
register_address,
|
|
92
|
-
byte_count
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
def access_rw_seq_bank(self, bank_address: int, page_address: int, register_address: int, byte_count: int) -> "PX_RW_SEQ_BANK":
|
|
96
|
-
"""Sequential read/write a number of bytes to the register interface supported by the media-independent interface (MII) transceiver.
|
|
97
|
-
|
|
98
|
-
:param bank_address: bank address (0-255)
|
|
99
|
-
:type bank_address: int
|
|
100
|
-
:param page_address: page address (0-255)
|
|
101
|
-
:type page_address: int
|
|
102
|
-
:param register_address: register address (0-255)
|
|
103
|
-
:type register_address: int
|
|
104
|
-
:param byte_count: the number of bytes to read/write
|
|
105
|
-
:type byte_count: int
|
|
106
|
-
:return: transceiver register values
|
|
107
|
-
:rtype: PX_RW_SEQ_BANK
|
|
108
|
-
"""
|
|
109
|
-
return PX_RW_SEQ_BANK(
|
|
110
|
-
self.__conn,
|
|
111
|
-
self.__module_id,
|
|
112
|
-
self.__port_id,
|
|
113
|
-
bank_address,
|
|
114
|
-
page_address,
|
|
115
|
-
register_address,
|
|
116
|
-
byte_count
|
|
117
|
-
)
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
from typing import (
|
|
2
|
-
TYPE_CHECKING,
|
|
3
|
-
Union,
|
|
4
|
-
)
|
|
5
|
-
if TYPE_CHECKING:
|
|
6
|
-
from xoa_driver.internals.core import interfaces as itf
|
|
7
|
-
from xoa_driver.internals.hli_v2.indices.streams.genuine_stream import GenuineStreamIdx
|
|
8
|
-
from xoa_driver.internals.commands import (
|
|
9
|
-
PT_TOTAL,
|
|
10
|
-
PT_NOTPLD,
|
|
11
|
-
PT_STREAM,
|
|
12
|
-
PT_CLEAR,
|
|
13
|
-
PT_EXTRA,
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class PortTransmissionStatistics:
|
|
18
|
-
"""L23 port TX statistics"""
|
|
19
|
-
|
|
20
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int) -> None:
|
|
21
|
-
self.__conn = conn
|
|
22
|
-
self.__module_id = module_id
|
|
23
|
-
self.__port_id = port_id
|
|
24
|
-
self.total = PT_TOTAL(conn, module_id, port_id)
|
|
25
|
-
"""All TX statistics on the L23 port.
|
|
26
|
-
Representation of PT_TOTAL
|
|
27
|
-
"""
|
|
28
|
-
|
|
29
|
-
self.extra = PT_EXTRA(conn, module_id, port_id)
|
|
30
|
-
"""Extra TX statistics on the L23 port.
|
|
31
|
-
Representation of PT_EXTRA
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
self.no_tpld = PT_NOTPLD(conn, module_id, port_id)
|
|
35
|
-
"""TX statistics of packets without TPLD on the L23 port.
|
|
36
|
-
Representation of PT_NOTPLD
|
|
37
|
-
"""
|
|
38
|
-
|
|
39
|
-
self.clear = PT_CLEAR(conn, module_id, port_id)
|
|
40
|
-
"""Clear TX statistics on the L23 port.
|
|
41
|
-
Representation of PT_CLEAR
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
def obtain_from_stream(self, stream: Union[int, "GenuineStreamIdx"]) -> "PT_STREAM":
|
|
45
|
-
"""Obtain statistics of packets of a specific stream on a L23 port.
|
|
46
|
-
|
|
47
|
-
:param stream: stream object
|
|
48
|
-
:type stream: Union[int, "GenuineStreamIdx"]
|
|
49
|
-
:return: statistics of packets of a specific stream on a L23 port
|
|
50
|
-
:rtype: PT_STREAM
|
|
51
|
-
"""
|
|
52
|
-
|
|
53
|
-
stream_idx = stream if isinstance(stream, int) else stream.kind.index_id
|
|
54
|
-
return PT_STREAM(
|
|
55
|
-
self.__conn,
|
|
56
|
-
self.__module_id,
|
|
57
|
-
self.__port_id,
|
|
58
|
-
stream_idx
|
|
59
|
-
)
|
|
File without changes
|
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from typing import NoReturn, TypeVar
|
|
2
|
-
from xoa_driver.internals.commands.enums import FilterType
|
|
3
|
-
|
|
4
|
-
T = TypeVar("T")
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def prevent_set(inst: T, filter_type: FilterType = FilterType.WORKING) -> T:
|
|
8
|
-
METHOD_NAME = "set"
|
|
9
|
-
|
|
10
|
-
def _set(*args, **kwargs) -> NoReturn:
|
|
11
|
-
raise Exception(f"Method {METHOD_NAME} is not allowed")
|
|
12
|
-
|
|
13
|
-
if filter_type is FilterType.WORKING and hasattr(inst, METHOD_NAME):
|
|
14
|
-
setattr(inst, METHOD_NAME, _set)
|
|
15
|
-
return inst
|
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
from typing import (
|
|
2
|
-
Dict,
|
|
3
|
-
Tuple,
|
|
4
|
-
Type,
|
|
5
|
-
TypeVar,
|
|
6
|
-
TYPE_CHECKING
|
|
7
|
-
)
|
|
8
|
-
if TYPE_CHECKING:
|
|
9
|
-
from xoa_driver.internals.core import interfaces as itf
|
|
10
|
-
from xoa_driver.internals.commands.enums import (
|
|
11
|
-
FilterType,
|
|
12
|
-
FilterVlanType,
|
|
13
|
-
ProtocolOption,
|
|
14
|
-
FilterMode,
|
|
15
|
-
)
|
|
16
|
-
from xoa_driver.internals.commands import (
|
|
17
|
-
PEF_ETHSETTINGS,
|
|
18
|
-
PEF_ETHSRCADDR,
|
|
19
|
-
PEF_ETHDESTADDR,
|
|
20
|
-
PEF_L2PUSE,
|
|
21
|
-
PEF_VLANSETTINGS,
|
|
22
|
-
PEF_VLANTAG,
|
|
23
|
-
PEF_VLANPCP,
|
|
24
|
-
PEF_MPLSSETTINGS,
|
|
25
|
-
PEF_MPLSLABEL,
|
|
26
|
-
PEF_MPLSTOC,
|
|
27
|
-
PEF_L3USE,
|
|
28
|
-
PEF_IPV4SETTINGS,
|
|
29
|
-
PEF_IPV4SRCADDR,
|
|
30
|
-
PEF_IPV4DESTADDR,
|
|
31
|
-
PEF_IPV4DSCP,
|
|
32
|
-
PEF_IPV6SETTINGS,
|
|
33
|
-
PEF_IPV6SRCADDR,
|
|
34
|
-
PEF_IPV6DESTADDR,
|
|
35
|
-
PEF_IPV6TC,
|
|
36
|
-
PEF_UDPSETTINGS,
|
|
37
|
-
PEF_UDPSRCPORT,
|
|
38
|
-
PEF_UDPDESTPORT,
|
|
39
|
-
PEF_TCPSETTINGS,
|
|
40
|
-
PEF_TCPSRCPORT,
|
|
41
|
-
PEF_TCPDESTPORT,
|
|
42
|
-
PEF_ANYSETTINGS,
|
|
43
|
-
PEF_ANYCONFIG,
|
|
44
|
-
PEF_TPLDSETTINGS,
|
|
45
|
-
PEF_TPLDCONFIG,
|
|
46
|
-
# PEF_ISSHADOWDIRTY, #TODO: need to implement
|
|
47
|
-
# PEF_CANCEL, #TODO: need to implement
|
|
48
|
-
PEF_VALUE,
|
|
49
|
-
PEF_MASK,
|
|
50
|
-
PEF_PROTOCOL,
|
|
51
|
-
PEF_MODE,
|
|
52
|
-
)
|
|
53
|
-
from ._utils import prevent_set
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
class FEthernet:
|
|
57
|
-
"""Filter for Ethernet field."""
|
|
58
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
59
|
-
self.settings = prevent_set(PEF_ETHSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
60
|
-
"""Filter action on Ethernet field.
|
|
61
|
-
Representation of PEF_ETHSETTINGS
|
|
62
|
-
"""
|
|
63
|
-
self.src_address = prevent_set(PEF_ETHSRCADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
64
|
-
"""Ethernet source address settings for the filter.
|
|
65
|
-
Representation of PEF_ETHSRCADDR
|
|
66
|
-
"""
|
|
67
|
-
self.dest_address = prevent_set(PEF_ETHDESTADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
68
|
-
"""Ethernet destination address settings for the filter.
|
|
69
|
-
Representation of PEF_ETHDESTADDR
|
|
70
|
-
"""
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
class FPerVlanType:
|
|
74
|
-
"""Filter for VLAN tag."""
|
|
75
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType, vlan_type: FilterVlanType) -> None:
|
|
76
|
-
self.tag = prevent_set(PEF_VLANTAG(conn, module_id, port_id, flow_index, filter_type, vlan_type), filter_type)
|
|
77
|
-
"""VLAN tag setting for the filter.
|
|
78
|
-
Representation of PEF_VLANTAG
|
|
79
|
-
"""
|
|
80
|
-
self.pcp = prevent_set(PEF_VLANPCP(conn, module_id, port_id, flow_index, filter_type, vlan_type), filter_type)
|
|
81
|
-
"""VLAN PCP setting for the filter.
|
|
82
|
-
Representation of PEF_VLANPCP
|
|
83
|
-
"""
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
class FVlan:
|
|
87
|
-
"""Filter for VLAN field."""
|
|
88
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
89
|
-
self.settings = prevent_set(PEF_VLANSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
90
|
-
"""Filter action on VLAN field.
|
|
91
|
-
Representation of PEF_VLANSETTINGS
|
|
92
|
-
"""
|
|
93
|
-
|
|
94
|
-
self.inner = FPerVlanType(conn, module_id, port_id, flow_index, filter_type, FilterVlanType.INNER)
|
|
95
|
-
"""Filter for inner VLAN tag."""
|
|
96
|
-
|
|
97
|
-
self.outer = FPerVlanType(conn, module_id, port_id, flow_index, filter_type, FilterVlanType.OUTER)
|
|
98
|
-
"""Filter for outer VLAN tag."""
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
class FUdp:
|
|
102
|
-
"""Filer for UDP field."""
|
|
103
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
104
|
-
self.settings = prevent_set(PEF_UDPSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
105
|
-
"""Filter action on UDP field.
|
|
106
|
-
Representation of PEF_UDPSETTINGS
|
|
107
|
-
"""
|
|
108
|
-
self.src_port = prevent_set(PEF_UDPSRCPORT(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
109
|
-
"""UDP source port settings for the filter.
|
|
110
|
-
Representation of PEF_UDPSRCPORT
|
|
111
|
-
"""
|
|
112
|
-
self.dest_port = prevent_set(PEF_UDPDESTPORT(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
113
|
-
"""UDP destination port settings for the filter.
|
|
114
|
-
Representation of PEF_UDPDESTPORT
|
|
115
|
-
"""
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
class FTcp:
|
|
119
|
-
"""Filter for TCP."""
|
|
120
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
121
|
-
self.settings = prevent_set(PEF_TCPSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
122
|
-
"""Filter action on TCP field.
|
|
123
|
-
Representation of PEF_TCPSETTINGS
|
|
124
|
-
"""
|
|
125
|
-
self.src_port = prevent_set(PEF_TCPSRCPORT(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
126
|
-
"""TCP source port settings for the filter.
|
|
127
|
-
Representation of PEF_TCPSRCPORT
|
|
128
|
-
"""
|
|
129
|
-
self.dest_port = prevent_set(PEF_TCPDESTPORT(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
130
|
-
"""TCP destination port settings for the filter.
|
|
131
|
-
Representation of PEF_TCPDESTPORT
|
|
132
|
-
"""
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
class FIPv4:
|
|
136
|
-
"""Filter for IPv4 field."""
|
|
137
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
138
|
-
self.settings = prevent_set(PEF_IPV4SETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
139
|
-
"""Filter action on IPv4 field.
|
|
140
|
-
Representation of PEF_IPV4SETTINGS
|
|
141
|
-
"""
|
|
142
|
-
self.src_address = prevent_set(PEF_IPV4SRCADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
143
|
-
"""IPv4 source address settings for the filter.
|
|
144
|
-
Representation of PEF_IPV4SRCADDR
|
|
145
|
-
"""
|
|
146
|
-
self.dest_address = prevent_set(PEF_IPV4DESTADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
147
|
-
"""IPv4 destination address settings for the filter.
|
|
148
|
-
Representation of PEF_IPV4DESTADDR
|
|
149
|
-
"""
|
|
150
|
-
self.dscp = prevent_set(PEF_IPV4DSCP(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
151
|
-
"""IPv4 DSCP/TOS settings for the filter.
|
|
152
|
-
Representation of PEF_IPV4DSCP
|
|
153
|
-
"""
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
class FIPv6:
|
|
157
|
-
"""Filter for IPv6 field."""
|
|
158
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
159
|
-
self.settings = prevent_set(PEF_IPV6SETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
160
|
-
"""Filter action on IPv6 field.
|
|
161
|
-
Representation of PEF_IPV6SETTINGS
|
|
162
|
-
"""
|
|
163
|
-
self.src_address = prevent_set(PEF_IPV6SRCADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
164
|
-
"""IPv6 source address settings for the filter.
|
|
165
|
-
Representation of PEF_IPV6SRCADDR
|
|
166
|
-
"""
|
|
167
|
-
self.dest_address = prevent_set(PEF_IPV6DESTADDR(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
168
|
-
"""IPv6 destination address settings for the filter.
|
|
169
|
-
Representation of PEF_IPV6DESTADDR
|
|
170
|
-
"""
|
|
171
|
-
self.traffic_class = prevent_set(PEF_IPV6TC(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
172
|
-
"""IPv6 traffic class settings for the filter.
|
|
173
|
-
Representation of PEF_IPV6TC
|
|
174
|
-
"""
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
class FIp:
|
|
178
|
-
"""Filter for IP field."""
|
|
179
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
180
|
-
self.v4 = FIPv4(conn, module_id, port_id, flow_index, filter_type)
|
|
181
|
-
"""Filter for IPv4 field."""
|
|
182
|
-
|
|
183
|
-
self.v6 = FIPv6(conn, module_id, port_id, flow_index, filter_type)
|
|
184
|
-
"""Filter for IPv6 field."""
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
class FMpls:
|
|
188
|
-
"""Filter for MPLS field."""
|
|
189
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
190
|
-
self.settings = prevent_set(PEF_MPLSSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
191
|
-
"""Filter action on MPLS field.
|
|
192
|
-
Representation of PEF_MPLSSETTINGS
|
|
193
|
-
"""
|
|
194
|
-
self.label = prevent_set(PEF_MPLSLABEL(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
195
|
-
"""MPLS label settings for the filter.
|
|
196
|
-
Representation of PEF_MPLSLABEL
|
|
197
|
-
"""
|
|
198
|
-
self.toc = prevent_set(PEF_MPLSTOC(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
199
|
-
""""MPLS TOC settings for the filter.
|
|
200
|
-
Representation of PEF_MPLSTOC
|
|
201
|
-
"""
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
class FTpld:
|
|
205
|
-
"""Filter for Xena TPLD field."""
|
|
206
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
207
|
-
self.settings = prevent_set(PEF_TPLDSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
208
|
-
"""Filter action on Xena TPLD field.
|
|
209
|
-
Representation of PEF_TPLDSETTINGS
|
|
210
|
-
"""
|
|
211
|
-
|
|
212
|
-
self.test_payload_filters_config = tuple(
|
|
213
|
-
prevent_set(PEF_TPLDCONFIG(conn, module_id, port_id, flow_index, filter_type, test_payload_filter_index), filter_type)
|
|
214
|
-
for test_payload_filter_index in range(16) # range need to put to the constants place
|
|
215
|
-
)
|
|
216
|
-
"""TPLD filter configurations.
|
|
217
|
-
Representation of PEF_TPLDCONFIG
|
|
218
|
-
"""
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
class FAny:
|
|
222
|
-
"""Filter for any field."""
|
|
223
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
224
|
-
self.settings = prevent_set(PEF_ANYSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
225
|
-
"""Filter action on any field.
|
|
226
|
-
Representation of PEF_ANYSETTINGS
|
|
227
|
-
"""
|
|
228
|
-
self.config = prevent_set(PEF_ANYCONFIG(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
229
|
-
"""Any field's filter configurations.
|
|
230
|
-
Representation of PEF_ANYCONFIG
|
|
231
|
-
"""
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
class ModeBasic:
|
|
235
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
236
|
-
self.l2plus_use = prevent_set(PEF_L2PUSE(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
237
|
-
"""L2 protocol to use.
|
|
238
|
-
Representation of PEF_L2PUSE
|
|
239
|
-
"""
|
|
240
|
-
self.l3_use = prevent_set(PEF_L3USE(conn, module_id, port_id, flow_index, filter_type), filter_type)
|
|
241
|
-
"""L3 protocol to use.
|
|
242
|
-
Representation of PEF_L3USE
|
|
243
|
-
"""
|
|
244
|
-
self.any = FAny(conn, module_id, port_id, flow_index, filter_type)
|
|
245
|
-
"""Filter for any field."""
|
|
246
|
-
|
|
247
|
-
self.tpld = FTpld(conn, module_id, port_id, flow_index, filter_type)
|
|
248
|
-
"""Filter for Xena TPLD field."""
|
|
249
|
-
|
|
250
|
-
self.mpls = FMpls(conn, module_id, port_id, flow_index, filter_type)
|
|
251
|
-
"""Filter for MPLS field."""
|
|
252
|
-
|
|
253
|
-
self.ip = FIp(conn, module_id, port_id, flow_index, filter_type)
|
|
254
|
-
"""Filter for IP field."""
|
|
255
|
-
|
|
256
|
-
self.tcp = FTcp(conn, module_id, port_id, flow_index, filter_type)
|
|
257
|
-
"""Filter for TCP field."""
|
|
258
|
-
|
|
259
|
-
self.udp = FUdp(conn, module_id, port_id, flow_index, filter_type)
|
|
260
|
-
"""Filter for UDP field."""
|
|
261
|
-
|
|
262
|
-
self.vlan = FVlan(conn, module_id, port_id, flow_index, filter_type)
|
|
263
|
-
"""Filter for VLAN field."""
|
|
264
|
-
|
|
265
|
-
self.ethernet = FEthernet(conn, module_id, port_id, flow_index, filter_type)
|
|
266
|
-
"""Filter for Ethernet field."""
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
class ProtocolSegment:
|
|
270
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType, protocol_segment_index: int, segment_type: ProtocolOption) -> None: # noqa: E501
|
|
271
|
-
self.segment_type = segment_type
|
|
272
|
-
|
|
273
|
-
self.value = prevent_set(PEF_VALUE(conn, module_id, port_id, flow_index, filter_type, protocol_segment_index), filter_type)
|
|
274
|
-
"""Value bytes match for the filter.
|
|
275
|
-
Representation of PEF_VALUE
|
|
276
|
-
"""
|
|
277
|
-
self.mask = prevent_set(PEF_MASK(conn, module_id, port_id, flow_index, filter_type, protocol_segment_index), filter_type)
|
|
278
|
-
"""Mask byte value.
|
|
279
|
-
Representation of PEF_MASK
|
|
280
|
-
"""
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
class ModeExtended:
|
|
284
|
-
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
|
|
285
|
-
self._conn = conn
|
|
286
|
-
self._module_id = module_id
|
|
287
|
-
self._port_id = port_id
|
|
288
|
-
self._flow_index = flow_index
|
|
289
|
-
self._filter_type = filter_type
|
|
290
|
-
|
|
291
|
-
# self.protocol = prevent_set(PEF_PROTOCOL(conn, module_id, port_id, flow_index, filter_type))
|
|
292
|
-
# """Protocol segments match for the filter.
|
|
293
|
-
# Representation of PEF_PROTOCOL
|
|
294
|
-
# """
|
|
295
|
-
|
|
296
|
-
async def get_protocol_segments(self) -> Tuple[ProtocolSegment, ...]:
|
|
297
|
-
segments_raw = (
|
|
298
|
-
await PEF_PROTOCOL(
|
|
299
|
-
self._conn,
|
|
300
|
-
self._module_id,
|
|
301
|
-
self._port_id,
|
|
302
|
-
self._flow_index,
|
|
303
|
-
self._filter_type
|
|
304
|
-
).get()
|
|
305
|
-
).segment_list
|
|
306
|
-
return tuple(
|
|
307
|
-
ProtocolSegment(
|
|
308
|
-
self._conn,
|
|
309
|
-
self._module_id,
|
|
310
|
-
self._port_id,
|
|
311
|
-
self._flow_index,
|
|
312
|
-
self._filter_type,
|
|
313
|
-
idx + 1, # TODO: need to discuss with Leo
|
|
314
|
-
ProtocolOption(segment_type)
|
|
315
|
-
)
|
|
316
|
-
for idx, segment_type in enumerate(segments_raw)
|
|
317
|
-
)
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
T = TypeVar("T")
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
async def get_mode(conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType, mode_types: Dict[FilterMode, Type[T]]) -> T:
|
|
324
|
-
mode_raw = (
|
|
325
|
-
await PEF_MODE(
|
|
326
|
-
conn,
|
|
327
|
-
module_id,
|
|
328
|
-
port_id,
|
|
329
|
-
flow_index,
|
|
330
|
-
filter_type,
|
|
331
|
-
).get()
|
|
332
|
-
).mode
|
|
333
|
-
mode_type = mode_types[FilterMode(mode_raw)]
|
|
334
|
-
return mode_type(
|
|
335
|
-
conn,
|
|
336
|
-
module_id,
|
|
337
|
-
port_id,
|
|
338
|
-
flow_index,
|
|
339
|
-
filter_type,
|
|
340
|
-
)
|