DPDK  21.05.0-rc3
Data Fields
rte_flow_item Struct Reference

#include <rte_flow.h>

Data Fields

enum rte_flow_item_type type
 
const void * spec
 
const void * last
 
const void * mask
 

Detailed Description

Matching pattern item definition.

A pattern is formed by stacking items starting from the lowest protocol layer to match. This stacking restriction does not apply to meta items which can be placed anywhere in the stack without affecting the meaning of the resulting pattern.

Patterns are terminated by END items.

The spec field should be a valid pointer to a structure of the related item type. It may remain unspecified (NULL) in many cases to request broad (nonspecific) matching. In such cases, last and mask must also be set to NULL.

Optionally, last can point to a structure of the same type to define an inclusive range. This is mostly supported by integer and address fields, may cause errors otherwise. Fields that do not support ranges must be set to 0 or to the same value as the corresponding fields in spec.

Only the fields defined to nonzero values in the default masks (see rte_flow_item_{name}_mask constants) are considered relevant by default. This can be overridden by providing a mask structure of the same type with applicable bits set to one. It can also be used to partially filter out specific fields (e.g. as an alternate mean to match ranges of IP addresses).

Mask is a simple bit-mask applied before interpreting the contents of spec and last, which may yield unexpected results if not used carefully. For example, if for an IPv4 address field, spec provides 10.1.2.3, last provides 10.3.4.5 and mask provides 255.255.0.0, the effective range becomes 10.1.0.0 to 10.3.255.255.

Examples:
examples/flow_classify/flow_classify.c, examples/flow_filtering/flow_blocks.c, examples/ipsec-secgw/flow.c, and examples/ipsec-secgw/ipsec-secgw.c.

Definition at line 1827 of file rte_flow.h.

Field Documentation

◆ type

enum rte_flow_item_type type

◆ spec

const void* spec

Pointer to item specification structure.

Examples:
examples/flow_classify/flow_classify.c, examples/ipsec-secgw/flow.c, and examples/ipsec-secgw/ipsec-secgw.c.

Definition at line 1829 of file rte_flow.h.

◆ last

const void* last

Defines an inclusive range (spec to last).

Examples:
examples/flow_classify/flow_classify.c, and examples/ipsec-secgw/ipsec-secgw.c.

Definition at line 1830 of file rte_flow.h.

◆ mask

const void* mask

Bit-mask applied to spec and last.

Examples:
examples/flow_classify/flow_classify.c, examples/ipsec-secgw/flow.c, and examples/ipsec-secgw/ipsec-secgw.c.

Definition at line 1831 of file rte_flow.h.


The documentation for this struct was generated from the following file: