Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xoa_driver/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "2.1.2"
__version__ = "2.1.3"
__short_version__ = "2.0"
4 changes: 2 additions & 2 deletions xoa_driver/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
IsValid,
LinkTrainFrameLock,
L2PlusPresent,
L3PlusPresent,
L3Present,
L47IPVersion,
L47PortSpeed,
L47PortState,
Expand Down Expand Up @@ -210,7 +210,7 @@
"IsValid",
"LinkTrainFrameLock",
"L2PlusPresent",
"L3PlusPresent",
"L3Present",
"L47IPVersion",
"L47PortSpeed",
"L47PortState",
Expand Down
2 changes: 1 addition & 1 deletion xoa_driver/internals/commands/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ class L2PlusPresent(IntEnum):
"""MPLS label is present"""


class L3PlusPresent(IntEnum):
class L3Present(IntEnum):
"""Presence of Layer-3 protocols"""

NA = 0
Expand Down
24 changes: 12 additions & 12 deletions xoa_driver/internals/commands/pef_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
FilterUse,
InfoAction,
L2PlusPresent,
L3PlusPresent,
L3Present,
FilterMode,
FilterType,
FilterVlanType,
Expand Down Expand Up @@ -797,11 +797,11 @@ class PEF_L3USE:
_filter_type: FilterType

class GetDataAttr(ResponseBodyStruct):
use: L3PlusPresent = field(XmpByte())
use: L3Present = field(XmpByte())
"""coded byte, specifies the presence of Layer 3 protocols:"""

class SetDataAttr(RequestBodyStruct):
use: L3PlusPresent = field(XmpByte())
use: L3Present = field(XmpByte())
"""coded byte, specifies the presence of Layer 3 protocols:"""

def get(self) -> Token[GetDataAttr]:
Expand All @@ -813,22 +813,22 @@ def get(self) -> Token[GetDataAttr]:

return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._flow_xindex, self._filter_type]))

def set(self, use: L3PlusPresent) -> Token[None]:
def set(self, use: L3Present) -> Token[None]:
"""Set Layer 3 protocols settings for the filter.

:param use: specifies the presence of Layer 3 protocols
:type use: L3PlusPresent
:type use: L3Present
"""

return Token(self._connection, build_set_request(self, module=self._module, port=self._port, indices=[self._flow_xindex, self._filter_type], use=use))

set_na = functools.partialmethod(set, L3PlusPresent.NA)
set_na = functools.partialmethod(set, L3Present.NA)
"""Set Layer 3 protocol presence to NA."""

set_ip4 = functools.partialmethod(set, L3PlusPresent.IP4)
set_ip4 = functools.partialmethod(set, L3Present.IP4)
"""Set Layer 3 protocol presence to IPv4."""

set_ip6 = functools.partialmethod(set, L3PlusPresent.IP6)
set_ip6 = functools.partialmethod(set, L3Present.IP6)
"""Set Layer 3 protocol presence to IPv6."""


Expand Down Expand Up @@ -1294,15 +1294,15 @@ class PEF_IPV6TC:
class GetDataAttr(ResponseBodyStruct):
use: OnOff = field(XmpByte())
"""coded byte, specifies the use of IPv6 information."""
value: ipaddress.IPv6Address = field(XmpIPv6Address())
value: int = field(XmpByte())
"""byte, specifying the value of the IPv6 Traffic Class in the upper 6 bits. value[7:2] = IPv6 Traffic Class. value[1:0] = reserved (must be zero). Default value: 0"""
mask: Hex = field(XmpHex(size=1))
"""hex byte, specifying the filter mask for the value in the upper 6 bits. mask[7:2] = IPv6 Traffic Class mask. mask[1:0] = reserved (must be zero). Default value: 0xFC"""

class SetDataAttr(RequestBodyStruct):
use: OnOff = field(XmpByte())
"""coded byte, specifies the use of IPv6 information."""
value: ipaddress.IPv6Address = field(XmpIPv6Address())
value: int = field(XmpByte())
"""byte, specifying the value of the IPv6 Traffic Class in the upper 6 bits. value[7:2] = IPv6 Traffic Class. value[1:0] = reserved (must be zero). Default value: 0"""
mask: Hex = field(XmpHex(size=1))
"""hex byte, specifying the filter mask for the value in the upper 6 bits. mask[7:2] = IPv6 Traffic Class mask. mask[1:0] = reserved (must be zero). Default value: 0xFC"""
Expand All @@ -1316,13 +1316,13 @@ def get(self) -> Token[GetDataAttr]:

return Token(self._connection, build_get_request(self, module=self._module, port=self._port, indices=[self._flow_xindex, self._filter_type]))

def set(self, use: OnOff, value: ipaddress.IPv6Address, mask: Hex) -> Token[None]:
def set(self, use: OnOff, value: int, mask: Hex) -> Token[None]:
"""Set IPv6 Traffic Class settings used for the filter.

:param use: specifies the use of the IPv6 Traffic Class information.
:type use: OnOff
:param value: specifying the value of the IPv6 Traffic Class in the upper 6 bits. value[7:2] = IPv6 Traffic Class. value[1:0] = reserved (must be zero). Default value: 0
:type value: ipaddress.IPv6Address
:type value: int
:param mask: specifying the filter mask for the value in the upper 6 bits. mask[7:2] = IPv6 Traffic Class mask. mask[1:0] = reserved (must be zero). Default value: 0xFC
:type mask: Hex
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_i
class FTpld:
"""Filter for Xena TPLD field."""
def __init__(self, conn: "itf.IConnection", module_id: int, port_id: int, flow_index: int, filter_type: FilterType) -> None:
self.settings = prevent_set(PEF_TPLDSETTINGS(conn, module_id, port_id, flow_index, filter_type))
self.settings = prevent_set(PEF_TPLDSETTINGS(conn, module_id, port_id, flow_index, filter_type), filter_type)
"""Filter action on Xena TPLD field.
Representation of PEF_TPLDSETTINGS
"""
Expand Down