pef_commands module
This module contains the impairment port flow filter commands.
There are 2 register copies used to configure the filters:
Shadow-copy (type value = 0), temporary copy configured by sever. Values stored inshadow-copyhave no immediate effect on the flow filters.PEF_APPLYwill pass the values from theshadow-copyto theworking-copy.Working-copy (type value = 1), reflects what is currently used for filtering in the FPGA.Working-copycannot be written directly. Onlyshadow-copyallows direct write.All
setactions are performed onshadow-copyONLY.Only when
PEF_APPLYis called,working-copyand FPGA are updated with values from theshadow-copy.
Note
Flow filter is only applicable to flow ID from 1 to 7. You cannot place a filter on flow 0.
Port (Impairment) Filter Commands
- class PEF_ANYCONFIG[source]
Bases:
objectBasic mode only. Defines the ANY field filter configuration. The “ANY field” filter will match 6 consecutive bytes in the incoming packets at a programmable offset. Applying a mask, allows to only filter based on selected bits within the 6 bytes.
Note
For SET, the only allowed
_filter_typeisshadow-copy.- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
6 hex bytes, specifying the six bytes of the field. Default value: 0xFFFFFFFFFFFF
- position
byte, specifies the start position of the ANY field. Default value: 0, Range:0-127
- value
6 hex bytes, specifying the six bytes of the field. Default value: 0x000000000000
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
6 hex bytes, specifying the six bytes of the field. Default value: 0xFFFFFFFFFFFF
- position
byte, specifies the start position of the ANY field. Default value: 0, Range:0-127
- value
6 hex bytes, specifying the six bytes of the field. Default value: 0x000000000000
- get()[source]
Get the ANY field filter configuration.
- Returns:
the ANY field filter configuration
- Return type:
- class PEF_ANYSETTINGS[source]
Bases:
objectBasic mode only. Defines if filtering on ANY field in a packet is used for flow filtering.
Note
For SET, the only allowed
_filter_typeisshadow-copy.- class GetDataAttr[source]
Bases:
ResponseBodyStruct- action
coded byte, specifies the action of ANY field information.
- use
coded byte, specifies the use of ANY field information.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- action
coded byte, specifies the action of ANY field information.
- use
coded byte, specifies the use of ANY field information.
- get()[source]
Get the settings of filtering state on ANY field in a packet.
- Returns:
settings of filtering state on ANY field in a packet.
- Return type:
- set(use, action)[source]
Set the settings of filtering state on ANY field in a packet.
- Parameters:
use (FilterUse) – specifies the use of ANY field information.
action (InfoAction) – specifies the action of ANY field information.
- class PEF_APPLY[source]
Bases:
objectApplies filter definitions from “shadow-copy” to “working-copy”. This also pushes these settings to the FPGA.
- class PEF_ENABLE[source]
Bases:
objectDefines if filtering is enabled for the flow.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- state
coded byte, specifies the state of the filter.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- state
coded byte, specifies the state of the filter.
- set_off()
Set the filter state to OFF.
- set_on()
Set the filter state to ON.
- class PEF_ETHDESTADDR[source]
Bases:
objectDefines the Ethernet Destination Address settings for the Ethernet filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
six hex bytes, specifying the mask corresponding to the address. Default value: 0xFFFFFFFFFFFF
- use
coded byte, specifies the use of Ethernet information
- value
six hex bytes, specifying the six bytes of the address. Default value: 0x000000000000
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
six hex bytes, specifying the mask corresponding to the address. Default value: 0xFFFFFFFFFFFF
- use
coded byte, specifies the use of Ethernet information
- value
six hex bytes, specifying the six bytes of the address. Default value: 0x000000000000
- get()[source]
Get the Ethernet Destination Address settings for the Ethernet filter.
- Returns:
the Ethernet Destination Address settings for the Ethernet filter.
- Return type:
- set(use, value, mask)[source]
Set the Ethernet Destination Address settings for the Ethernet filter.
- Parameters:
use (OnOff) – specifies the use of Ethernet Destination Address information
value (Hex) – specifying the six bytes of the address. Default value: 0x000000000000
mask (Hex) – specifying the mask corresponding to the address. Default value: 0xFFFFFFFFFFFF
- set_off(value, mask)
Ethernet Destination Address is not used for the filter.
- set_on(value, mask)
Ethernet Destination Address is used for the filter.
- class PEF_ETHSETTINGS[source]
Bases:
objectDefines what filter action is performed on the Ethernet header.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- action
coded byte, specifies the action of Ethernet information.
- use
coded byte, specifies the use of Ethernet information.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- action
coded byte, specifies the action of Ethernet information.
- use
coded byte, specifies the use of Ethernet information.
- get()[source]
Get the filter action settings on Ethernet header.
- Returns:
Filter setting
- Return type:
- set(use, action)[source]
Set the filter action settings on Ethernet header.
- Parameters:
use (FilterUse) – specifies if Ethernet information is expected
action (InfoAction) – specifies the use of Ethernet information.
- class PEF_ETHSRCADDR[source]
Bases:
objectDefines the Ethernet Source Address settings for the Ethernet filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
six hex bytes, specifying the mask corresponding to the address. Default value: 0xFFFFFFFFFFFF.
- use
coded byte, specifies the use of Ethernet Source Address information.
- value
six hex bytes, specifying the six bytes of the address. Default value: 0x000000000000.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
six hex bytes, specifying the mask corresponding to the address. Default value: 0xFFFFFFFFFFFF.
- use
coded byte, specifies the use of Ethernet Source Address information.
- value
six hex bytes, specifying the six bytes of the address. Default value: 0x000000000000.
- get()[source]
Get the Ethernet Source Address settings for the Ethernet filter.
- Returns:
the Ethernet Source Address settings for the Ethernet filter
- Return type:
- set(use, value, mask)[source]
Set the Ethernet Source Address settings for the Ethernet filter.
- Parameters:
use (OnOff) – specifies the use of Ethernet Source Address information
value (Hex) – specifying the six bytes of the address. Default value: 0x000000000000.
mask (Hex) – specifying the mask corresponding to the address. Default value: 0xFFFFFFFFFFFF.
- set_off(value, mask)
Ethernet Source Address is not used for the filter.
- set_on(value, mask)
Ethernet Source Address is used for the filter.
- class PEF_INIT[source]
Bases:
objectPrepares for setting up a filter definition. When called, all filter definitions in the shadow-set which are not applied are discarded and replaced with the default values (DEFAULT).
Note
There are 2 register copies used to configure the filters:
Shadow-copy (type value = 0)temporary copy configured by sever. Values stored inshadow-copyhave no immediate effect on the flow filters. PEF_APPLY will pass the values from theshadow-copyto theworking-copy.Working-copy (type value = 1)reflects what is currently used for filtering in the FPGA.Working-copycannot be written directly. Onlyshadow-copyallows direct write.All
setactions are performed onshadow-copyONLY.Only when PEF_APPLY is called,
working-copyand FPGA are updated with values from theshadow-copy.
- class PEF_IPV4DESTADDR[source]
Bases:
objectBasic mode only. Defines the IPv4 Destination Address settings for the IPv4 filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
four hex bytes, specifying the filter mask of the value. Default value: 0xFFFFFFFF
- use
coded byte, specifies the use of IPv4 Destination Address.
- value
address, specifying the four bytes of the address. Default value: 0.0.0.0
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
four hex bytes, specifying the filter mask of the value. Default value: 0xFFFFFFFF
- use
coded byte, specifies the use of IPv4 Destination Address.
- value
address, specifying the four bytes of the address. Default value: 0.0.0.0
- get()[source]
Get the IPv4 Destination Address settings for the IPv4 filter.
- Returns:
the IPv4 Destination Address settings for the IPv4 filter
- Return type:
- set(use, value, mask)[source]
Set the IPv4 Destination Address settings for the IPv4 filter.
- Parameters:
use (OnOff) – specifies the use of IPv4 Destination Address information
value (ipaddress.IPv4Address) – specifying the four bytes of the address. Default value: 0.0.0.0
mask (Hex) – specifying the filter mask of the value. Default value: 0xFFFFFFFF
- set_off(value, mask)
IPv4 Destination Address is not used by the filter.
- set_on(value, mask)
IPv4 Destination Address is used by the filter.
- class PEF_IPV4DSCP[source]
Bases:
objectBasic mode only. Defines if IPv4 DSCP/TOS settings used for the IPv4 filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
hex byte, specifying the filter mask of the value in the upper 6 bits. mask[7:2] = DSCP/TOS mask, mask[1:0] = reserved (must be zero). Default value: 0xFC
- use
coded byte, specifies the use of IPv4 information.
- value
byte, specifying the value of the IPv4 DSCP/TOS in the upper 6 bits. value[7:2] = DSCP/TOS, value[1:0] = reserved (must be zero). Default value: 0
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
hex byte, specifying the filter mask of the value in the upper 6 bits. mask[7:2] = DSCP/TOS mask, mask[1:0] = reserved (must be zero). Default value: 0xFC
- use
coded byte, specifies the use of IPv4 information.
- value
byte, specifying the value of the IPv4 DSCP/TOS in the upper 6 bits. value[7:2] = DSCP/TOS, value[1:0] = reserved (must be zero). Default value: 0
- get()[source]
Get IPv4 DSCP/TOS settings for the filter.
- Returns:
IPv4 DSCP/TOS settings for the filter.
- Return type:
- set(use, value, mask)[source]
Set IPv4 DSCP/TOS settings for the filter.
- Parameters:
use (OnOff) – specifies the use of IPv4 DSCP/TOS information.
value (int) – specifying the value of the IPv4 DSCP/TOS in the upper 6 bits. value[7:2] = DSCP/TOS, value[1:0] = reserved (must be zero). Default value: 0
mask (Hex) – specifying the filter mask of the value in the upper 6 bits. mask[7:2] = DSCP/TOS mask, mask[1:0] = reserved (must be zero). Default value: 0xFC
- set_off(value, mask)
IPv4 DSCP/TOS is not used in the filter.
- set_on(value, mask)
IPv4 DSCP/TOS is used in the filter.
- class PEF_IPV4SETTINGS[source]
Bases:
objectBasic mode only. Defines what filter action is performed on the IPv4 header.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- action
coded byte, specifies the action of IPv4 information.
- use
coded byte, specifies the use of IPv4 information.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- action
coded byte, specifies the action of IPv4 information.
- use
coded byte, specifies the use of IPv4 information.
- get()[source]
Get the filter action settings on IPv4 header.
- Returns:
the filter action settings on IPv4 header
- Return type:
- set(use, action)[source]
Set the filter action settings on IPv4 header.
- Parameters:
use (FilterUse) – specifies the use of IPv4 information
action (InfoAction) – specifies the action of IPv4 information
- class PEF_IPV4SRCADDR[source]
Bases:
objectBasic mode only. Defines the IPv4 Source Address settings for the IPv4 filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
four hex bytes, specifying the filter mask of the value. Default value: 0xFFFFFFFF
- use
coded byte, specifies the use of IPv4 Source Address.
- value
address, specifying the four bytes of the address. Default value: 0.0.0.0
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
four hex bytes, specifying the filter mask of the value. Default value: 0xFFFFFFFF
- use
coded byte, specifies the use of IPv4 Source Address.
- value
address, specifying the four bytes of the address. Default value: 0.0.0.0
- get()[source]
Get the IPv4 Source Address settings for the IPv4 filter.
- Returns:
the IPv4 Source Address settings for the IPv4 filter
- Return type:
- set(use, value, mask)[source]
Set the IPv4 Source Address settings for the IPv4 filter.
- Parameters:
use (OnOff) – specifies the use of IPv4 Source Address information
value (ipaddress.IPv4Address) – specifying the four bytes of the address. Default value: 0.0.0.0
mask (Hex) – specifying the filter mask of the value. Default value: 0xFFFFFFFF
- set_off(value, mask)
IPv4 Source Address is not used by the filter.
- set_on(value, mask)
IPv4 Source Address is used by the filter.
- class PEF_IPV6DESTADDR[source]
Bases:
objectBasic mode only. Defines the IPv6 Destination Address settings for the IPv6 filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
16 hex bytes, specifying the six first bytes of the address. Default value: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- use
coded byte, specifies the use of IPv6 Destination Address.
- value
16 hex bytes, specifying the address. Default : 0x00000000000000000000000000000000
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
16 hex bytes, specifying the six first bytes of the address. Default value: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- use
coded byte, specifies the use of IPv6 Destination Address.
- value
16 hex bytes, specifying the address. Default : 0x00000000000000000000000000000000
- get()[source]
Get the IPv6 Destination Address settings for the IPv6 filter.
- Returns:
IPv6 Destination Address settings for the IPv6 filter
- Return type:
- set(use, value, mask)[source]
Set the IPv6 Destination Address settings for the IPv6 filter.
- Parameters:
use (OnOff) – specifies the use of IPv6 Destination Address information
value (ipaddress.IPv6Address) – specifying the address. Default : 0x00000000000000000000000000000000
mask (Hex) – specifying the six first bytes of the address. Default value: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- set_off(value, mask)
IPv6 Destination Address is not used in the filter.
- set_on(value, mask)
IPv6 Destination Address is used in the filter.
- class PEF_IPV6SETTINGS[source]
Bases:
objectBasic mode only. Defines what filter action is performed on the IPv6 header.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- action
coded byte, specifies the action of IPv6 information.
- use
coded byte, specifies the use of IPv6 information.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- action
coded byte, specifies the action of IPv6 information.
- use
coded byte, specifies the use of IPv6 information.
- get()[source]
Get filter action settings on the IPv6 header.
- Returns:
specifies the use of IPv6 header
- Return type:
- set(use, action)[source]
Set filter action settings on the IPv6 header.
- Parameters:
use (FilterUse) – specifies the use of IPv6 header
action (InfoAction) – specifies the action of IPv6 header
- class PEF_IPV6SRCADDR[source]
Bases:
objectBasic mode only. Defines the IPv6 Source Address settings for the IPv6 filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
16 hex bytes, specifying the six first bytes of the address. Default value: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- use
coded byte, specifies the use of IPv6 Source Address.
- value
16 hex bytes, specifying the address. Default : 0x00000000000000000000000000000000
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
16 hex bytes, specifying the six first bytes of the address. Default value: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- use
coded byte, specifies the use of IPv6 Source Address.
- value
16 hex bytes, specifying the address. Default : 0x00000000000000000000000000000000
- get()[source]
Get the IPv6 Source Address settings for the IPv6 filter.
- Returns:
the IPv6 Source Address settings for the IPv6 filter
- Return type:
- set(use, value, mask)[source]
Set the IPv6 Source Address settings for the IPv6 filter.
- Parameters:
use (OnOff) – specifies the use of IPv6 Source Address information
value (ipaddress.IPv6Address) – specifying the address. Default : 0x00000000000000000000000000000000
mask (Hex) – specifying the six first bytes of the address. Default value: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
- set_off(value, mask)
IPv6 Source Address is not used in the filter.
- set_on(value, mask)
IPv6 Source Address is used in the filter.
- class PEF_IPV6TC[source]
Bases:
objectBasic mode only. Defines the IPv6 Traffic Class settings used for the filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
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
- use
coded byte, specifies the use of IPv6 information.
- value
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
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
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
- use
coded byte, specifies the use of IPv6 information.
- value
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
- get()[source]
Get IPv6 Traffic Class settings used for the filter.
- Returns:
IPv6 Traffic Class settings used for the filter
- Return type:
- set(use, value, mask)[source]
Set IPv6 Traffic Class settings used for the filter.
- Parameters:
use (OnOff) – specifies the use of the IPv6 Traffic Class information.
value (int) – 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) – 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
- set_off(value, mask)
IPv6 Traffic Class is not used in the filter.
- set_on(value, mask)
IPv6 Traffic Class is used in the filter.
- class PEF_ISSHADOWDIRTY[source]
Bases:
objectGet shadow filter status (if shadow is in sync with working copy or not).
- class GetDataAttr[source]
Bases:
ResponseBodyStruct- is_in_sync
coded byte, if shadow is in sync with working copy or not.
- class PEF_L2PUSE[source]
Bases:
objectDefines what Layer 2+ protocols that are present and may be used for the filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- use
coded byte, specifies the presence of Layer 2+ protocols.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- use
coded byte, specifies the presence of Layer 2+ protocols.
- get()[source]
Get the Layer 2+ protocols settings for the filter.
- Returns:
the Layer 2+ protocols settings for the filter
- Return type:
- set(use)[source]
Set the Layer 2+ protocols settings for the filter.
- Parameters:
use (L2PlusPresent) – specifies the presence of Layer 2+ protocols.
- set_mpls()
Set the presence of Layer 2+ protocols to MPLS.
- set_na()
Set the presence of Layer 2+ protocols to NA.
- set_vlan1()
Set the presence of Layer 2+ protocols to one VLAN Tag.
- set_vlan2()
Set the presence of Layer 2+ protocols to two VLAN Tags.
- class PEF_L3USE[source]
Bases:
objectBasic mode only. Defines what Layer 3 protocols that are present and may be used for the filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- use
coded byte, specifies the presence of Layer 3 protocols:
- class SetDataAttr[source]
Bases:
RequestBodyStruct- use
coded byte, specifies the presence of Layer 3 protocols:
- get()[source]
Get Layer 3 protocols settings for the filter.
- Returns:
Layer 3 protocols settings for the filter.
- Return type:
- set(use)[source]
Set Layer 3 protocols settings for the filter.
- Parameters:
use (L3Present) – specifies the presence of Layer 3 protocols
- set_ip4()
Set Layer 3 protocol presence to IPv4.
- set_ip6()
Set Layer 3 protocol presence to IPv6.
- set_na()
Set Layer 3 protocol presence to NA.
- class PEF_MASK[source]
Bases:
objectThis command is valid only for
Extended filter mode(checkPEF_MODE).Defines the mask byte values that select the values specified by
PEF_VALUE.For a chosen
<protocol_segment_index>the first byte in the value masks the first byte of the correspondingPEF_VALUEand so on.If
<protocol_segment_index> = 0the maximum number of match value bytes that can be set is determined by the total length of the protocol segments specified with PEF_PROTOCOL`.E.g. if PEF_PROTOCOL is set to ETHERNET then only 12 bytes can be set. In order to set the full 128 bytes, either specify a detailed protocol segment list, or use the raw protocol segment type. This specifies 12 + 116 = 128 bytes.
If
<protocol_segment_index> != 0only the bytes covered by that segment are manipulated, so if PEF_PROTOCOL is set toETHERNET VLAN ETHERTYPE eCPRIthen<protocol_segment_index> = 4selects the 8 bytes of the eCPRI header starting at byte position (12 + 2 + 4) = 18.get/setsemantics are similar toPEF_VALUE.
- class PEF_MODE[source]
Bases:
objectControl the filter mode.
- set_basic()
Set the filter mode to Basic.
- set_extended()
Set the filter mode to Extended.
- class PEF_MPLSLABEL[source]
Bases:
objectBasic mode only. Defines the MPLS label settings for the filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
three hex bytes, specifying the 20 bit value of the label. Default value: 0x0FFFFF,
- use
coded byte, specifies the use of MPLS information.
- value
integer, specifying the 20 bit value of the label. Default value: 0.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
three hex bytes, specifying the 20 bit value of the label. Default value: 0x0FFFFF,
- use
coded byte, specifies the use of MPLS information.
- value
integer, specifying the 20 bit value of the label. Default value: 0.
- get()[source]
Get the MPLS label settings for the filter.
- Returns:
the MPLS label settings for the filter
- Return type:
- set_off(value, mask)
The MPLS label is not used by the filter
- set_on(value, mask)
The MPLS label is used by the filter
- class PEF_MPLSSETTINGS[source]
Bases:
objectBasic mode only. Defines what filter action is performed on the MPLS header.
- class GetDataAttr[source]
Bases:
ResponseBodyStruct- action
coded byte, specifies the action on MPLS information
- use
coded byte, specifies the use of MPLS information
- class SetDataAttr[source]
Bases:
RequestBodyStruct- action
coded byte, specifies the action on MPLS information
- use
coded byte, specifies the use of MPLS information.
- get()[source]
Get the filter action settings on the MPLS header.
- Returns:
the filter action settings on the MPLS header
- Return type:
- set(use, action)[source]
Set the filter action settings on the MPLS header.
- Parameters:
use (FilterUse) – specifies the use of MPLS information
action (InfoAction) – specifies specifies if MPLS information is expected
- class PEF_MPLSTOC[source]
Bases:
objectBasic mode only. Defines the MPLS TOC settings for the filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
hex byte, specifying the filter mask for the value of the MPLS TOC. Default value: 0x07
- use
coded byte, specifies the use of MPLS TOC information.
- value
byte, specifying the value of the MPLS TOC. Default value: 0 (Range: 0 to 7).
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
hex byte, specifying the filter mask for the value of the MPLS TOC. Default value: 0x07
- use
coded byte, specifies the use of MPLS TOC information.
- value
byte, specifying the value of the MPLS TOC. Default value: 0 (Range: 0 to 7).
- get()[source]
Get the MPLS TOC settings for the filter.
- Returns:
the MPLS TOC settings for the filter
- Return type:
- set_off(value, mask)
The MPLS TOC is not used by the filter.
- set_on(value, mask)
The MPLS TOC is used by the filter.
- class PEF_PROTOCOL[source]
Bases:
objectThis command is valid only for
Extended filter mode(checkPEF_MODE).Defines the sequence of protocol segments that can be matched. The total length of the specified segments cannot exceed 128 bytes. If an existing sequence of segments is changed (using PEF_PROTOCOL) the underlying value and mask bytes remain unchanged, even though the semantics of those bytes may have changed. However, if the total length, in bytes, of the segments is reduced, then the excess bytes of value and mask are set to zero. I.e. to update an existing filter, you must first correct the list of segments (using PEF_PROTOCOL) and subsequently update the filtering value (using
PEF_VALUE) and filtering mask (PEF_MASK).- class GetDataAttr[source]
Bases:
ResponseBodyStruct- segment_list
list of bytes, specifying the list of protocol segment types in the order they are expected in a frame. First segment type must be ETHERNET; the following can be chosen freely.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- segment_list
list of bytes, specifying the list of protocol segment types in the order they are expected in a frame. First segment type must be ETHERNET; the following can be chosen freely.
- get()[source]
Get the sequence of protocol segments that can be matched.
- Returns:
the sequence of protocol segments that can be matched.
- Return type:
- set(segment_list)[source]
Set the sequence of protocol segments that can be matched.
- Parameters:
segment_list (List[ProtocolOption]) – specifying the list of protocol segment types in the order they are expected in a frame. First segment type must be
ETHERNET; the following can be chosen freely.
- class PEF_TCPDESTPORT[source]
Bases:
objectBasic mode only. Defines TCP Destination Port settings used for the filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy.- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
two hex bytes , specifying the filter mask for the value. Default value: 0xFFFF
- use
coded byte, specifies the use of TCP Destination Port information
- value
integer , specifying the value of the TCP Destination Port. Default value: 0
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
two hex bytes , specifying the filter mask for the value. Default value: 0xFFFF
- use
coded byte, specifies the use of TCP Destination Port information
- value
integer , specifying the value of the TCP Destination Port. Default value: 0
- get()[source]
Get TCP Destination Port settings used for the filter.
- Returns:
TCP Destination Port settings used for the filter.
- Return type:
- set_off(value, mask)
TCP Destination Port is not used in the filter.
- set_on(value, mask)
TCP Destination Port is used in the filter.
- class PEF_TCPSETTINGS[source]
Bases:
objectBasic mode only. Defines if filtering on TCP information is used for flow filtering.
Note
For SET, the only allowed
_filter_typeisshadow-copy.- class GetDataAttr[source]
Bases:
ResponseBodyStruct- action
coded byte, specifies the action of TCP information.
- use
coded byte, specifies the use of TCP information.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- action
coded byte, specifies the action of TCP information.
- use
coded byte, specifies the use of TCP information.
- get()[source]
Get filter action settings on the TCP header.
- Returns:
filter action settings on the TCP header.
- Return type:
- set(use, action)[source]
Set filter action settings on the TCP header.
- Parameters:
use (FilterUse) – specifies the use of TCP information.
action (InfoAction) – specifies the action of TCP information.
- class PEF_TCPSRCPORT[source]
Bases:
objectBasic mode only. Defines TCP Source Port settings used for the filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy.- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
two hex bytes , specifying the filter mask for the value. Default value: 0xFFFF
- use
coded byte, specifies the use of TCP Source Port information
- value
integer , specifying the value of the TCP Source Port. Default value: 0
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
two hex bytes , specifying the filter mask for the value. Default value: 0xFFFF
- use
coded byte, specifies the use of TCP Source Port information
- value
integer , specifying the value of the TCP Source Port. Default value: 0
- get()[source]
Get TCP Source Port settings used for the filter.
- Returns:
TCP Source Port settings used for the filter.
- Return type:
- set_off(value, mask)
TCP Source Port is not used in the filter.
- set_on(value, mask)
TCP Source Port is used in the filter.
- class PEF_TPLDCONFIG[source]
Bases:
objectDefines the TPLD filter configuration. There are only 16 TPLD filter, thus the index values are from 0 to 15.
Note
For SET, the only allowed
_filter_typeisshadow-copy.- class GetDataAttr[source]
Bases:
ResponseBodyStruct- id
int, specifies the TPLD ID. Range: 0-2015, Default value: 0
- use
coded byte, specifies the use of TPLD field information.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- id
int, specifies the TPLD ID. Range: 0-2015, Default value: 0
- use
coded byte, specifies the use of TPLD field information.
- get()[source]
Get the TPLD filter configuration.
- Returns:
the use of TPLD field information, and the TPLD ID. Range: 0-2015, Default value: 0
- Return type:
- set_off(id)
The TPLD information is not used.
- set_on(id)
The TPLD information is used.
- class PEF_TPLDSETTINGS[source]
Bases:
objectDefines if filtering on TPLD field in a packet is used for flow filtering. The TPLD filter allows filtering based on the Xena TPLD ID. The TPLD ID is meta data, which can be inserted into the Ethernet packets by Xena traffic generators. For each flow filter, can the filter be based on 16 TPLD ID values.
Note
For SET, the only allowed
_filter_typeisshadow-copy.- class GetDataAttr[source]
Bases:
ResponseBodyStruct- action
coded byte, specifies the action of TPLD information.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- action
coded byte, specifies the action of TPLD information.
- get()[source]
Get the settings of filtering on TPLD field in a packet.
- Returns:
the settings of filtering on TPLD field in a packet.
- Return type:
- set(action)[source]
Set the settings of filtering on TPLD field in a packet.
- Parameters:
action (InfoAction) – specifies the action of TPLD information.
- class PEF_UDPDESTPORT[source]
Bases:
objectBasic mode only. Defines UDP Destination Port settings used for the filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy.- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
two hex bytes , specifying the filter mask for the value. Default value: 0xFFFF
- use
coded byte, specifies the use of UDP Destination Port information
- value
integer , specifying the value of the UDP Destination Port. Default value: 0
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
two hex bytes , specifying the filter mask for the value. Default value: 0xFFFF
- use
coded byte, specifies the use of UDP Destination Port information
- value
integer , specifying the value of the UDP Destination Port. Default value: 0
- get()[source]
Get UDP Destination Port settings used for the filter.
- Returns:
UDP Destination Port settings used for the filter.
- Return type:
- set_off(value, mask)
UDP Destination Port is not used in the filter.
- set_on(value, mask)
UDP Destination Port is used in the filter.
- class PEF_UDPSETTINGS[source]
Bases:
objectBasic mode only. Controls if UDP packet information is used for flow filtering.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- action
coded byte, specifies action use of UDP information.
- use
coded byte, specifies the use of UDP information.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- action
coded byte, specifies the action of UDP information.
- use
coded byte, specifies the use of UDP information.
- get()[source]
Get filter settings on the UDP header.
- Returns:
filter action settings on the UDP header
- Return type:
- set(use, action)[source]
Set filter settings on the UDP header.
- Parameters:
use (FilterUse) – specifies the use of UDP information.
action (InfoAction) – specifies the action of UDP information.
- class PEF_UDPSRCPORT[source]
Bases:
objectBasic mode only. Defines UDP Source Port settings used for the filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
two hex bytes , specifying the filter mask for the value. Default value: 0xFFFF
- use
coded byte, specifies the use of UDP Source Port information
- value
integer , specifying the value of the UDP Source Port. Default value: 0
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
two hex bytes , specifying the filter mask for the value. Default value: 0xFFFF
- use
coded byte, specifies the use of UDP Source Port information
- value
integer , specifying the value of the UDP Source Port. Default value: 0
- get()[source]
Get UDP Source Port settings used for the filter.
- Returns:
UDP Source Port settings used for the filter.
- Return type:
- set_off(value, mask)
UDP Source Port is not used in the filter.
- set_on(value, mask)
UDP Source Port is used in the filter.
- class PEF_VALUE[source]
Bases:
objectThis command is valid only for
Extended filter mode(checkPEF_MODE).Defines the byte values that can be matched if selected by
PEF_MASK.If
<protocol_segment_index> = 0the maximum number of match value bytes that can be set is determined by the total length of the protocol segments specified with PEF_PROTOCOL.E.g. if PEF_PROTOCOL is set to ETHERNET then only 12 bytes can be set. In order to set the full 128 bytes, either specify a detailed protocol segment list, or use the raw protocol segment type. This specifies 12 + 116 = 128 bytes.
If
<protocol_segment_index> != 0only the bytes covered by that segment are manipulated, so if PEF_PROTOCOL is set toETHERNET VLAN ETHERTYPE eCPRIthen<protocol_segment_index> = 4selects the 8 bytes of the eCPRI header starting at byte position (12 + 2 + 4) = 18.For
setcommand where fewer value bytes are provided than specified by the protocol segment, those unspecified bytes are set to zero.The
getcommand always returns the number of bytes specified by the protocol segment.- class GetDataAttr[source]
Bases:
ResponseBodyStruct- value
list of hex bytes, the raw bytes comprising the packet header.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- value
list of hex bytes, the raw bytes comprising the packet header.
- class PEF_VLANPCP[source]
Bases:
objectBasic mode only. Defines the VLAN PCP settings for the VLAN filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
hex byte, specifying the 8 bit value mask. Default value: 0x07
- use
coded byte, specifies the use of VLAN information.
- value
byte, specifying the value of the PCP. Default value: 0 (Range: 0 to 7)
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
hex byte, specifying the 8 bit value mask. Default value: 0x07
- use
coded byte, specifies the use of VLAN information.
- value
byte, specifying the value of the PCP. Default value: 0 (Range: 0 to 7)
- get()[source]
Get the VLAN PCP settings for the VLAN filter.
- Returns:
the VLAN PCP settings for the VLAN filter
- Return type:
- set_off(value, mask)
VLAN PCP is not used for the filter.
- set_on(value, mask)
VLAN PCP is used for the filter.
- class PEF_VLANSETTINGS[source]
Bases:
objectDefines what filter action is performed on the VLAN header.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- action
coded byte, specifies the use of VLAN information.
- use
coded byte, specifies if VLAN information is expected.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- action
coded byte, specifies the use of VLAN information.
- use
coded byte, specifies if VLAN information is expected.
- get()[source]
Get filter action settings on VLAN header.
- Returns:
filter action settings on VLAN header
- Return type:
- set(use, action)[source]
Set filter action settings on VLAN header.
- Parameters:
use (FilterUse) – specifies if VLAN information is expected
action (InfoAction) – specifies the action of VLAN information
- class PEF_VLANTAG[source]
Bases:
objectBasic mode only. Defines the VLAN TAG settings for the VLAN filter.
Note
For SET, the only allowed
_filter_typeisshadow-copy- class GetDataAttr[source]
Bases:
ResponseBodyStruct- mask
two hex digits, specifying the 12 bit value of the tag. Default value: 0x0FFF
- use
coded byte, specifies the use of VLAN information
- value
decimal digits, specifying the 12 bit value of the tag. Default value: 0.
- class SetDataAttr[source]
Bases:
RequestBodyStruct- mask
two hex digits, specifying the 12 bit value of the tag. Default value: 0x0FFF
- use
coded byte, specifies the use of VLAN information
- value
decimal digits, specifying the 12 bit value of the tag. Default value: 0.
- get()[source]
Get the VLAN TAG settings for the VLAN filter.
- Returns:
the VLAN TAG settings for the VLAN filter
- Return type:
- set_off(value, mask)
VLAN TAG is not used for the filter.
- set_on(value, mask)
VLAN TAG is used for the filter.