Use IP address types on UDP encap API
[vpp.git] / src / vnet / ip / ip6_packet.h
index 9916f30..ceaa7ec 100644 (file)
@@ -53,6 +53,11 @@ typedef union
 }
 ip6_address_t;
 
+typedef struct
+{
+  ip6_address_t addr, mask;
+} ip6_address_and_mask_t;
+
 /* Packed so that the mhash key doesn't include uninitialized pad bytes */
 /* *INDENT-OFF* */
 typedef CLIB_PACKED (struct {
@@ -62,6 +67,13 @@ typedef CLIB_PACKED (struct {
 }) ip6_address_fib_t;
 /* *INDENT-ON* */
 
+typedef enum
+{
+  IP46_TYPE_ANY,
+  IP46_TYPE_IP4,
+  IP46_TYPE_IP6
+} ip46_type_t;
+
 /* *INDENT-OFF* */
 typedef CLIB_PACKED (union {
   struct {
@@ -360,6 +372,7 @@ ip6_set_traffic_class_network_order (ip6_header_t * ip6, u8 dscp)
 {
   u32 tmp =
     clib_net_to_host_u32 (ip6->ip_version_traffic_class_and_flow_label);
+  tmp &= 0xf00fffff;
   tmp |= (dscp << 20);
   ip6->ip_version_traffic_class_and_flow_label = clib_host_to_net_u32 (tmp);
 }