8.3.3.5. Port Filter

This module contains the impairment port flow filter commands.

There are 2 register copies used to configure the filters:

  1. Shadow-copy (type value = 0), temporary copy configured by sever. Values stored in shadow-copy have no immediate effect on the flow filters. PEF_APPLY will pass the values from the shadow-copy to the working-copy.

  2. Working-copy (type value = 1), reflects what is currently used for filtering in the FPGA. Working-copy cannot be written directly. Only shadow-copy allows direct write.

  3. All set actions are performed on shadow-copy ONLY.

  4. Only when PEF_APPLY is called, working-copy and FPGA are updated with values from the shadow-copy.

Note

Flow filter is only applicable to flow ID from 1 to 7. You cannot place a filter on flow 0.


class PEF_ANYCONFIG[source]

Bases: object

Basic 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_type is shadow-copy.

get()[source]

Get the ANY field filter configuration.

Returns:

the ANY field filter configuration

Return type:

PEF_ANYCONFIG.GetDataAttr

set(position, value, mask)[source]

Set the ANY field filter configuration

Parameters:
  • position (int) – specifies the start position of the ANY field. Default value: 0, Range:0-127

  • value (str) – specifying the six bytes of the field. Default value: 0x000000000000

  • mask (str) – specifying the six bytes of the field. Default value: 0xFFFFFFFFFFFF

class PEF_ANYSETTINGS[source]

Bases: object

Basic mode only. Defines if filtering on ANY field in a packet is used for flow filtering.

Note

For SET, the only allowed _filter_type is shadow-copy.

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:

PEF_ANYSETTINGS.GetDataAttr

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: object

Applies filter definitions from “shadow-copy” to “working-copy”. This also pushes these settings to the FPGA.

set()[source]

Applies filter definitions from “shadow-copy” to “working-copy”.

class PEF_CANCEL[source]

Bases: object

Undo updates to shadow filter settings, sets dirty false.

set()[source]

Undo updates to shadow filter settings, sets dirty false.

class PEF_ENABLE[source]

Bases: object

Defines if filtering is enabled for the flow.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get if filtering is enabled for the flow.

Returns:

filter state

Return type:

PEF_ENABLE.GetDataAttr

set(state)[source]

Set the filter state.

Parameters:

state (OnOff) – 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: object

Defines the Ethernet Destination Address settings for the Ethernet filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the Ethernet Destination Address settings for the Ethernet filter.

Returns:

the Ethernet Destination Address settings for the Ethernet filter.

Return type:

PEF_ETHDESTADDR.GetDataAttr

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: object

Defines what filter action is performed on the Ethernet header.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the filter action settings on Ethernet header.

Returns:

Filter setting

Return type:

PEF_ETHSETTINGS.GetDataAttr

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: object

Defines the Ethernet Source Address settings for the Ethernet filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the Ethernet Source Address settings for the Ethernet filter.

Returns:

the Ethernet Source Address settings for the Ethernet filter

Return type:

PEF_ETHSRCADDR.GetDataAttr

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: object

Prepares 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:

  1. Shadow-copy (type value = 0) temporary copy configured by sever. Values stored in shadow-copy have no immediate effect on the flow filters. PEF_APPLY will pass the values from the shadow-copy to the working-copy.

  2. Working-copy (type value = 1) reflects what is currently used for filtering in the FPGA. Working-copy cannot be written directly. Only shadow-copy allows direct write.

  3. All set actions are performed on shadow-copy ONLY.

  4. Only when PEF_APPLY is called, working-copy and FPGA are updated with values from the shadow-copy.

set()[source]

Setting up a filter definition.

class PEF_IPV4DESTADDR[source]

Bases: object

Basic mode only. Defines the IPv4 Destination Address settings for the IPv4 filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the IPv4 Destination Address settings for the IPv4 filter.

Returns:

the IPv4 Destination Address settings for the IPv4 filter

Return type:

PEF_IPV4DESTADDR.GetDataAttr

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: object

Basic mode only. Defines if IPv4 DSCP/TOS settings used for the IPv4 filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get IPv4 DSCP/TOS settings for the filter.

Returns:

IPv4 DSCP/TOS settings for the filter.

Return type:

PEF_IPV4DSCP.GetDataAttr

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: object

Basic mode only. Defines what filter action is performed on the IPv4 header.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the filter action settings on IPv4 header.

Returns:

the filter action settings on IPv4 header

Return type:

PEF_IPV4SETTINGS.GetDataAttr

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: object

Basic mode only. Defines the IPv4 Source Address settings for the IPv4 filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the IPv4 Source Address settings for the IPv4 filter.

Returns:

the IPv4 Source Address settings for the IPv4 filter

Return type:

PEF_IPV4SRCADDR.GetDataAttr

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: object

Basic mode only. Defines the IPv6 Destination Address settings for the IPv6 filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the IPv6 Destination Address settings for the IPv6 filter.

Returns:

IPv6 Destination Address settings for the IPv6 filter

Return type:

PEF_IPV6DESTADDR.GetDataAttr

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: object

Basic mode only. Defines what filter action is performed on the IPv6 header.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get filter action settings on the IPv6 header.

Returns:

specifies the use of IPv6 header

Return type:

PEF_IPV6SETTINGS.GetDataAttr

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: object

Basic mode only. Defines the IPv6 Source Address settings for the IPv6 filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the IPv6 Source Address settings for the IPv6 filter.

Returns:

the IPv6 Source Address settings for the IPv6 filter

Return type:

PEF_IPV6SRCADDR.GetDataAttr

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: object

Basic mode only. Defines the IPv6 Traffic Class settings used for the filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get IPv6 Traffic Class settings used for the filter.

Returns:

IPv6 Traffic Class settings used for the filter

Return type:

PEF_IPV6TC.GetDataAttr

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: object

Get shadow filter status (if shadow is in sync with working copy or not).

get()[source]

Get shadow filter status.

Returns:

if shadow is in sync with working copy or not.

Return type:

PEF_ISSHADOWDIRTY.GetDataAttr

class PEF_L2PUSE[source]

Bases: object

Defines what Layer 2+ protocols that are present and may be used for the filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the Layer 2+ protocols settings for the filter.

Returns:

the Layer 2+ protocols settings for the filter

Return type:

PEF_L2PUSE.GetDataAttr

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: object

Basic mode only. Defines what Layer 3 protocols that are present and may be used for the filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get Layer 3 protocols settings for the filter.

Returns:

Layer 3 protocols settings for the filter.

Return type:

PEF_L3USE.GetDataAttr

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: object

This command is valid only for Extended filter mode (check PEF_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 corresponding PEF_VALUE and so on.

If <protocol_segment_index> = 0 the 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> != 0 only the bytes covered by that segment are manipulated, so if PEF_PROTOCOL is set to ETHERNET VLAN ETHERTYPE eCPRI then <protocol_segment_index> = 4 selects the 8 bytes of the eCPRI header starting at byte position (12 + 2 + 4) = 18.

get/set semantics are similar to PEF_VALUE.

get()[source]

Get the mask byte values that select the values specified by PEF_VALUE.

Returns:

the mask byte values that select the values specified by PEF_VALUE.

Return type:

PEF_MASK.GetDataAttr

set(masks)[source]

Set the mask byte values that select the values specified by PEF_VALUE`.

Parameters:

masks (Hex) – mask byte values

class PEF_MODE[source]

Bases: object

Control the filter mode.

get()[source]

Get the filter mode.

Returns:

the filter mode

Return type:

PEF_MODE.GetDataAttr

set(mode)[source]

Set the filter mode.

Parameters:

mode – the mode of the filter.

set_basic()

Set the filter mode to Basic.

set_extended()

Set the filter mode to Extended.

class PEF_MPLSLABEL[source]

Bases: object

Basic mode only. Defines the MPLS label settings for the filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the MPLS label settings for the filter.

Returns:

the MPLS label settings for the filter

Return type:

PEF_MPLSLABEL.GetDataAttr

set(use, value, mask)[source]

Set the MPLS label settings for the filter.

Parameters:
  • use (OnOff) – specifies the use of MPLS label information.

  • value (int) – specifying the 20-bit value of the label. Default value: 0.

  • mask (Hex) – specifying the 20-bit value of the label. Default value: 0x0FFFFF,

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: object

Basic mode only. Defines what filter action is performed on the MPLS header.

get()[source]

Get the filter action settings on the MPLS header.

Returns:

the filter action settings on the MPLS header

Return type:

PEF_MPLSSETTINGS.GetDataAttr

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: object

Basic mode only. Defines the MPLS TOC settings for the filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the MPLS TOC settings for the filter.

Returns:

the MPLS TOC settings for the filter

Return type:

PEF_MPLSTOC.GetDataAttr

set(use, value, mask)[source]

Set the MPLS TOC settings for the filter.

Parameters:
  • use (OnOff) – specifies the use of MPLS TOC information

  • value (int) – specifying the value of the MPLS TOC. Default value: 0 (Range: 0 to 7).

  • mask (Hex) – specifying the filter mask for the value of the MPLS TOC. Default value: 0x07

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: object

This command is valid only for Extended filter mode (check PEF_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).

get()[source]

Get the sequence of protocol segments that can be matched.

Returns:

the sequence of protocol segments that can be matched.

Return type:

PEF_PROTOCOL.GetDataAttr

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: object

Basic mode only. Defines TCP Destination Port settings used for the filter.

Note

For SET, the only allowed _filter_type is shadow-copy.

get()[source]

Get TCP Destination Port settings used for the filter.

Returns:

TCP Destination Port settings used for the filter.

Return type:

PEF_TCPDESTPORT.GetDataAttr

set(use, value, mask)[source]

Set TCP Destination Port settings used for the filter.

Parameters:
  • use (OnOff) – specifies the use of TCP Destination Port information

  • value (int) – specifies the value of the TCP Destination Port. Default value: 0

  • mask (Hex) – specifies the filter mask for the value. Default value: 0xFFFF

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: object

Basic mode only. Defines if filtering on TCP information is used for flow filtering.

Note

For SET, the only allowed _filter_type is shadow-copy.

get()[source]

Get filter action settings on the TCP header.

Returns:

filter action settings on the TCP header.

Return type:

PEF_TCPSETTINGS.GetDataAttr

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: object

Basic mode only. Defines TCP Source Port settings used for the filter.

Note

For SET, the only allowed _filter_type is shadow-copy.

get()[source]

Get TCP Source Port settings used for the filter.

Returns:

TCP Source Port settings used for the filter.

Return type:

PEF_TCPSRCPORT.GetDataAttr

set(use, value, mask)[source]

Set TCP Source Port settings used for the filter.

Parameters:
  • use (OnOff) – specifies the use of TCP Source Port information

  • value (int) – specifies the value of the TCP Source Port. Default value: 0

  • mask (Hex) – specifies the filter mask for the value. Default value: 0xFFFF

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: object

Defines 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_type is shadow-copy.

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:

PEF_TPLDCONFIG.GetDataAttr

set(use, id)[source]

Set the TPLD filter configuration.

Parameters:
  • use (OnOff) – specifies the use of TPLD field information

  • id (int) – specifies the TPLD ID. Range: 0-2015, Default value: 0

set_off(id)

The TPLD information is not used.

set_on(id)

The TPLD information is used.

class PEF_TPLDSETTINGS[source]

Bases: object

Defines 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_type is shadow-copy.

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:

PEF_TPLDSETTINGS.GetDataAttr

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: object

Basic mode only. Defines UDP Destination Port settings used for the filter.

Note

For SET, the only allowed _filter_type is shadow-copy.

get()[source]

Get UDP Destination Port settings used for the filter.

Returns:

UDP Destination Port settings used for the filter.

Return type:

PEF_UDPDESTPORT.GetDataAttr

set(use, value, mask)[source]

Set UDP Destination Port settings used for the filter.

Parameters:
  • use (OnOff) – specifies the use of UDP Destination Port information

  • value (int) – specifying the value of the UDP Destination Port. Default value: 0

  • mask (Hex) – specifying the filter mask for the value. Default value: 0xFFFF

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: object

Basic mode only. Controls if UDP packet information is used for flow filtering.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get filter settings on the UDP header.

Returns:

filter action settings on the UDP header

Return type:

PEF_UDPSETTINGS.GetDataAttr

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: object

Basic mode only. Defines UDP Source Port settings used for the filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get UDP Source Port settings used for the filter.

Returns:

UDP Source Port settings used for the filter.

Return type:

PEF_UDPSRCPORT.GetDataAttr

set(use, value, mask)[source]

Set UDP Source Port settings used for the filter.

Parameters:
  • use (OnOff) – specifies the use of UDP Source Port information

  • value (int) – specifying the value of the UDP Source Port. Default value: 0

  • mask (Hex) – specifying the filter mask for the value. Default value: 0xFFFF

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: object

This command is valid only for Extended filter mode (check PEF_MODE).

Defines the byte values that can be matched if selected by PEF_MASK.

If <protocol_segment_index> = 0 the 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> != 0 only the bytes covered by that segment are manipulated, so if PEF_PROTOCOL is set to ETHERNET VLAN ETHERTYPE eCPRI then <protocol_segment_index> = 4 selects the 8 bytes of the eCPRI header starting at byte position (12 + 2 + 4) = 18.

For set command where fewer value bytes are provided than specified by the protocol segment, those unspecified bytes are set to zero.

The get command always returns the number of bytes specified by the protocol segment.

get()[source]

Get the byte values that can be matched if selected by PEF_MASK.

Returns:

the byte values that can be matched if selected by PEF_MASK

Return type:

PEF_VALUE.GetDataAttr

set(value)[source]

Set the byte values that can be matched if selected by PEF_MASK.

Parameters:

value (Hex) – the raw bytes comprising the packet header

class PEF_VLANPCP[source]

Bases: object

Basic mode only. Defines the VLAN PCP settings for the VLAN filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the VLAN PCP settings for the VLAN filter.

Returns:

the VLAN PCP settings for the VLAN filter

Return type:

PEF_VLANPCP.GetDataAttr

set(use, value, mask)[source]

Set the VLAN PCP settings for the VLAN filter.

Parameters:
  • use (OnOff) – specifies the use of VLAN PCP information

  • value (int) – specifying the value of the PCP. Default value: 0 (Range: 0 to 7)

  • mask (Hex) – specifying the 8 bit value mask. Default value: 0x07

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: object

Defines what filter action is performed on the VLAN header.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get filter action settings on VLAN header.

Returns:

filter action settings on VLAN header

Return type:

PEF_VLANSETTINGS.GetDataAttr

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: object

Basic mode only. Defines the VLAN TAG settings for the VLAN filter.

Note

For SET, the only allowed _filter_type is shadow-copy

get()[source]

Get the VLAN TAG settings for the VLAN filter.

Returns:

the VLAN TAG settings for the VLAN filter

Return type:

PEF_VLANTAG.GetDataAttr

set(use, value, mask)[source]

Set the VLAN TAG settings for the VLAN filter.

Parameters:
  • use (OnOff) – specifies the use of VLAN TAG information

  • value (int) – specifying the 12 bit value of the tag. Default value: 0.

  • mask (Hex) – specifying the 12 bit value of the tag. Default value: 0x0FFF

set_off(value, mask)

VLAN TAG is not used for the filter.

set_on(value, mask)

VLAN TAG is used for the filter.