aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_packet.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-11-25 13:04:44 +0000
committerOle Trøan <otroan@employees.org>2019-12-03 19:36:26 +0000
commit9534696b4637185c9f296375e63c50d8976d153d (patch)
tree7e5bce5d492b6b376e42f9df175e18202f93af68 /src/vnet/ip/ip_packet.h
parentc8972fe506c78530a3e4085453e86a0b85b245ef (diff)
ipip: Tunnel flags controlling copying data to/from payload/encap
Type: feature Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I9467f11775936754406892b8e9e275f989ac9b30
Diffstat (limited to 'src/vnet/ip/ip_packet.h')
-rw-r--r--src/vnet/ip/ip_packet.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/vnet/ip/ip_packet.h b/src/vnet/ip/ip_packet.h
index 63a59f87668..9a55d5f644e 100644
--- a/src/vnet/ip/ip_packet.h
+++ b/src/vnet/ip/ip_packet.h
@@ -118,10 +118,35 @@ typedef enum ip_dscp_t_
#undef _
} __clib_packed ip_dscp_t;
-STATIC_ASSERT_SIZEOF (ip_dscp_t, 1);
-
extern u8 *format_ip_dscp (u8 * s, va_list * va);
+/**
+ * IP DSCP bit shift
+ * The ECN occupies the 2 least significant bits of the TC field
+ */
+#define IP_PACKET_TC_FIELD_DSCP_BIT_SHIFT 2
+#define IP_PACKET_TC_FIELD_ECN_MASK 0x03
+
+/**
+ * The set of RFC defined DSCP values.
+ */
+#define foreach_ip_ecn \
+ _(0, NON_ECN) \
+ _(1, ECT_0) \
+ _(2, ECT_1) \
+ _(3, CE)
+
+typedef enum ip_ecn_t_
+{
+#define _(n,f) IP_ECN_##f = n,
+ foreach_ip_ecn
+#undef _
+} __clib_packed ip_ecn_t;
+
+STATIC_ASSERT_SIZEOF (ip_ecn_t, 1);
+
+extern u8 *format_ip_ecn (u8 * s, va_list * va);
+
/* IP checksum support. */
static_always_inline u16