diff options
| author | Wesley Coakley <wcoakley@nvidia.com> | 2020-06-17 20:20:05 -0400 |
|---|---|---|
| committer | Wesley Coakley <wcoakley@nvidia.com> | 2020-07-15 12:59:36 -0400 |
| commit | 01f23affdb68d0117d0f2be652eebd835bdbc13e (patch) | |
| tree | 206fc9c99eb5e9e65c996d8de580165cbf887c4d /lib/pbr.h | |
| parent | 9a4dee5c3534c298d439eb6e4b6e45e89f66d4da (diff) | |
pbrd, zebra, lib: DSCP / ECN-based PBR Matching
Extend PBR maps to discriminate by Differentiated Services Code Point and / or
Explicit Congestion Notification fields. These fields are used in the IP header
for classifying network traffic.
0 1 2 3 4 5 6 7
+-----+-----+-----+-----+-----+-----+-----+-----+
| DS FIELD, DSCP | ECN FIELD |
+-----+-----+-----+-----+-----+-----+-----+-----+
DSCP: differentiated services codepoint
ECN: Explicit Congestion Notification
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
Signed-off-by: Saurav Kumar Paul <saurav@cumulusnetworks.com>
Diffstat (limited to 'lib/pbr.h')
| -rw-r--r-- | lib/pbr.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -49,6 +49,10 @@ struct pbr_filter { #define PBR_FILTER_PROTO (1 << 5) #define PBR_FILTER_SRC_PORT_RANGE (1 << 6) #define PBR_FILTER_DST_PORT_RANGE (1 << 7) +#define PBR_FILTER_DSFIELD (1 << 8) + +#define PBR_DSFIELD_DSCP (0xfc) /* Upper 6 bits of DS field: DSCP */ +#define PBR_DSFIELD_ECN (0x03) /* Lower 2 bits of DS field: BCN */ /* Source and Destination IP address with masks. */ struct prefix src_ip; @@ -58,6 +62,9 @@ struct pbr_filter { uint16_t src_port; uint16_t dst_port; + /* Filter by Differentiated Services field */ + uint8_t dsfield; /* DSCP (6 bits) & ECN (2 bits) */ + /* Filter with fwmark */ uint32_t fwmark; }; |
