DPDK  24.11.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_filtering/flow_skeleton.c, examples/flow_filtering/snippets/snippet_match_gre.c, examples/flow_filtering/snippets/snippet_match_ipv4.c, examples/flow_filtering/snippets/snippet_match_mpls.c, examples/ipsec-secgw/flow.c, examples/ipsec-secgw/ipsec-secgw.c, and examples/l2fwd-macsec/main.c.

Definition at line 2127 of file rte_flow.h.

Field Documentation

◆ type

enum rte_flow_item_type type

◆ spec

const void* spec

◆ last

const void* last

Defines an inclusive range (spec to last).

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

Definition at line 2130 of file rte_flow.h.

◆ mask

const void* mask

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