summaryrefslogtreecommitdiff
path: root/lib/pbr.h
diff options
context:
space:
mode:
authorG. Paul Ziemba <paulz@labn.net>2023-08-01 11:00:52 -0700
committerG. Paul Ziemba <paulz@labn.net>2023-08-09 12:11:43 -0700
commitba240bcfa3762158eaa548906ba9c306d96fe5d1 (patch)
treec37a9c88c752ad6ec7ff215dd727856a2ed6e165 /lib/pbr.h
parent887367a01c0e978e992935ae93f3df4e3c1bd86c (diff)
pbrd: add packet mangling actions (src/dst ip-addr/port, dscp, ecn)
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
Diffstat (limited to 'lib/pbr.h')
-rw-r--r--lib/pbr.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/pbr.h b/lib/pbr.h
index ae01ae7978..c514cc2a65 100644
--- a/lib/pbr.h
+++ b/lib/pbr.h
@@ -93,6 +93,12 @@ struct pbr_action {
#define PBR_ACTION_PCP (1 << 2)
#define PBR_ACTION_VLAN_ID (1 << 3)
#define PBR_ACTION_VLAN_STRIP_INNER_ANY (1 << 4)
+#define PBR_ACTION_SRC_IP (1 << 5)
+#define PBR_ACTION_DST_IP (1 << 6)
+#define PBR_ACTION_SRC_PORT (1 << 7)
+#define PBR_ACTION_DST_PORT (1 << 8)
+#define PBR_ACTION_DSCP (1 << 9)
+#define PBR_ACTION_ECN (1 << 10)
uint32_t table;
uint32_t queue_id;
@@ -101,7 +107,17 @@ struct pbr_action {
uint8_t pcp;
uint16_t vlan_id;
+ /* Source and Destination IP addresses */
+ union sockunion src_ip;
+ union sockunion dst_ip;
+ /* Source and Destination layer 4 (TCP/UDP/etc.) port numbers */
+ uint32_t src_port;
+ uint32_t dst_port;
+
+ /* Differentiated Services field */
+ uint8_t dscp; /* stored here already shifted to upper 6 bits */
+ uint8_t ecn; /* stored here as lower 2 bits */
};
/*