diff --git a/misc/tests/utils_unittest.cpp b/misc/tests/utils_unittest.cpp index 581de2d..8b44f06 100644 --- a/misc/tests/utils_unittest.cpp +++ b/misc/tests/utils_unittest.cpp @@ -26,15 +26,19 @@ TEST(Utils, ValidUrlConversion) {"sonic/dash.acl_rule.AclRule", "DASH_ACL_RULE_TABLE"}, {"sonic/dash.appliance.Appliance", "DASH_APPLIANCE_TABLE"}, {"sonic/dash.eni.Eni", "DASH_ENI_TABLE"}, + {"sonic/dash.eni_route.EniRoute", "DASH_ENI_ROUTE_TABLE"}, {"sonic/dash.meter_policy.MeterPolicy", "DASH_METER_POLICY_TABLE"}, {"sonic/dash.meter_rule.MeterRule", "DASH_METER_RULE_TABLE"}, {"sonic/dash.meter.Meter", "DASH_METER_TABLE"}, + {"sonic/dash.pa_validation.PaValidation", "DASH_PA_VALIDATION_TABLE"}, {"sonic/dash.prefix_tag.PrefixTag", "DASH_PREFIX_TAG_TABLE"}, {"sonic/dash.qos.Qos", "DASH_QOS_TABLE"}, + {"sonic/dash.route_group.RouteGroup", "DASH_ROUTE_GROUP_TABLE"}, {"sonic/dash.route_rule.RouteRule", "DASH_ROUTE_RULE_TABLE"}, {"sonic/dash.route_type.RouteType", "DASH_ROUTE_TYPE_TABLE"}, {"sonic/dash.route.Route", "DASH_ROUTE_TABLE"}, {"sonic/dash.routing_appliance.RoutingAppliance", "DASH_ROUTING_APPLIANCE_TABLE"}, + {"sonic/dash.tunnel.Tunnel", "DASH_TUNNEL_TABLE"}, {"sonic/dash.vnet_mapping.VnetMapping", "DASH_VNET_MAPPING_TABLE"}, {"sonic/dash.vnet.Vnet", "DASH_VNET_TABLE"}, }; @@ -97,7 +101,8 @@ TEST(Utils, CInterface) const std::string json_str1 = "{\n" - " \"action_type\": \"ROUTING_TYPE_VNET\",\n" + " \"action_type\": \"ROUTING_TYPE_UNSPECIFIED\",\n" + " \"routing_type\": \"ROUTING_TYPE_VNET\",\n" " \"vnet\": \"Vnet2\"\n" "}\n"; diff --git a/proto/eni.proto b/proto/eni.proto index ff719f9..792dfc6 100644 --- a/proto/eni.proto +++ b/proto/eni.proto @@ -23,7 +23,7 @@ message Eni { string vnet = 6; // Optional // Private Link encoding for IPv6 SIP transpositions - optional types.IpPrefix pl_sip_encoding = 7; + optional types.IpPrefix pl_sip_encoding = 7 [deprecated = true]; // Optional // Underlay SIP (ST GW VIP) to be used for all private link transformation for this ENI optional types.IpAddress pl_underlay_sip = 8; @@ -33,6 +33,7 @@ message Eni { // Optional // IPv6 meter policy ID optional string v6_meter_policy_id = 10; + optional bool disable_fast_path_icmp_flow_redirection = 11; } message EniKey { diff --git a/proto/eni_route.proto b/proto/eni_route.proto new file mode 100644 index 0000000..25b3c86 --- /dev/null +++ b/proto/eni_route.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package dash.eni_route; + +message EniRoute { + // Group ID in DASH_ROUTE_GROUP_TABLE + string group_id = 1; +} + +message EniRouteKey { + string eni = 1; +} diff --git a/proto/pa_validation.proto b/proto/pa_validation.proto new file mode 100644 index 0000000..51cd1b6 --- /dev/null +++ b/proto/pa_validation.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package dash.pa_validation; + +import "types.proto"; + +message PaValidation { + repeated types.IpAddress addresses = 1; +} + +message PaValidationKey { + uint32 vni = 1; +} diff --git a/proto/route.proto b/proto/route.proto index 6955674..2ecd566 100644 --- a/proto/route.proto +++ b/proto/route.proto @@ -6,7 +6,7 @@ import "types.proto"; import "route_type.proto"; message VnetDirect { - // destination vnet name if action_type is {vnet, vnet_direct}, a vnet other than eni's vnet means vnet peering + // destination vnet name if routing_type is {vnet, vnet_direct}, a vnet other than eni's vnet means vnet peering string vnet = 1; // overly_ip to lookup if routing_type is {vnet_direct}, use dst ip from packet if not specified optional types.IpAddress overlay_ip = 2; @@ -14,36 +14,42 @@ message VnetDirect { message ServiceTunnel { // overlay ipv6 src ip if routing_type is {servicetunnel} - types.IpAddress overlay_sip = 1; + types.IpAddress overlay_sip = 1 [deprecated = true]; // replaced by overlay_sip_prefix // overlay ipv6 dst ip if routing_type is {servicetunnel} - types.IpAddress overlay_dip = 2; + types.IpAddress overlay_dip = 2 [deprecated = true]; // replaced by overlay_dip_prefix // underlay ipv4 src ip if routing_type is {servicetunnel}, this is the ST GW VIP (for ST traffic) or custom VIP types.IpAddress underlay_sip = 3; // underlay ipv4 dst ip to override if routing_type is {servicetunnel}, use dst ip from packet if not specified types.IpAddress underlay_dip = 4; + types.IpAddress overlay_sip_prefix = 5; + types.IpAddress overlay_dip_prefix = 6; } message Route { - route_type.RoutingType action_type = 1; + route_type.RoutingType action_type = 1 [deprecated = true]; // renamed as routing_type oneof Action { - // destination vnet name if action_type is vnet,, a vnet other than eni's vnet means vnet peering + // destination vnet name if routing_type is vnet,, a vnet other than eni's vnet means vnet peering string vnet = 2; - // destination vnet name if action_type is vnet_direct,, a vnet other than eni's vnet means vnet peering + // destination vnet name if routing_type is vnet_direct,, a vnet other than eni's vnet means vnet peering route.VnetDirect vnet_direct = 3; - // appliance id if action_type is {appliance} + // appliance id if routing_type is {appliance} string appliance = 4; - // service tunnel if action_type is {service_tunnel} + // service tunnel if routing_type is {service_tunnel} route.ServiceTunnel service_tunnel = 5; } // Metering policy lookup enable (optional), default = false - optional bool metering_policy_en = 6; + optional bool metering_policy_en = 6 [deprecated = true]; // Metering class-id, used if metering policy lookup is not enabled - optional uint64 metering_class = 7; + optional uint64 metering_class = 7 [deprecated = true]; + optional uint32 metering_class_or = 8; + optional uint32 metering_class_and = 9; + route_type.RoutingType routing_type = 10; } // ENI route table with CA prefix for packet Outbound message RouteKey { - string eni = 1; + string eni = 1 [deprecated = true]; // renamed as group_id // IP prefix string with prefix length. E.G. 10.1.0.0/16 string prefix = 2; + string group_id = 3; } diff --git a/proto/route_group.proto b/proto/route_group.proto new file mode 100644 index 0000000..a25220e --- /dev/null +++ b/proto/route_group.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package dash.route_group; + +message RouteGroup { + optional string guid = 1; + string version = 2; +} + +message RouteGroupKey { + string group_id = 1; +} diff --git a/proto/route_rule.proto b/proto/route_rule.proto index 2ee4caa..61e6c25 100644 --- a/proto/route_rule.proto +++ b/proto/route_rule.proto @@ -6,7 +6,7 @@ import "route_type.proto"; message RouteRule { // reference to routing type, action can be decap or drop - route_type.RoutingType action_type = 1; + route_type.RoutingType action_type = 1 [deprecated = true]; // renamed as routing_type // priority of the rule, lower the value, higher the priority uint32 priority = 2; // Optional @@ -20,10 +20,15 @@ message RouteRule { optional bool pa_validation = 5; // Optional // Metering class-id - optional uint64 metering_class = 6; + optional uint64 metering_class = 6 [deprecated = true]; // replaced by metering_class_or and metering_class_and // Optional // optional region_id which the vni/prefix belongs to as a string for any vendor optimizations optional string region = 7; + route_type.RoutingType routing_type = 8; + // Optional + // Metering class aggregate bits + optional uint32 metering_class_or = 9; + optional uint32 metering_class_and = 10; } // ENI Inbound route table with VNI and optional SRC PA prefix diff --git a/proto/route_type.proto b/proto/route_type.proto index b1fe604..0cbef7c 100644 --- a/proto/route_type.proto +++ b/proto/route_type.proto @@ -28,7 +28,7 @@ enum RoutingType { ROUTING_TYPE_VNET_ENCAP = 4; ROUTING_TYPE_APPLIANCE = 5; ROUTING_TYPE_PRIVATELINK = 6; - ROUTING_TYPE_PRIVATELINKNSG = 7; + ROUTING_TYPE_PRIVATELINKNSG = 7 [deprecated = true]; ROUTING_TYPE_SERVICETUNNEL = 8; ROUTING_TYPE_DROP = 9; } diff --git a/proto/tunnel.proto b/proto/tunnel.proto new file mode 100644 index 0000000..cbf4779 --- /dev/null +++ b/proto/tunnel.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package dash.tunnel; + +import "route_type.proto"; +import "types.proto"; + +message Tunnel { + repeated types.IpAddress endpoints = 1; + route_type.EncapType encap_type = 2; + uint32 vni = 3; + optional uint32 metering_class_or = 4; +} + +// ENI Inbound route table with VNI and optional SRC PA prefix +message TunnelKey { + string tunnel_name = 1; +}; diff --git a/proto/vnet_mapping.proto b/proto/vnet_mapping.proto index 609ff99..0616ae3 100644 --- a/proto/vnet_mapping.proto +++ b/proto/vnet_mapping.proto @@ -7,7 +7,7 @@ import "route_type.proto"; message VnetMapping { // reference to routing type - route_type.RoutingType action_type = 1; + route_type.RoutingType action_type = 1 [deprecated = true]; // renamed as routing_type // PA address for the CA types.IpAddress underlay_ip = 2; // Optional @@ -15,10 +15,10 @@ message VnetMapping { optional bytes mac_address = 3; // Optional // metering class-id - optional uint64 metering_class = 4; + optional uint64 metering_class = 4 [deprecated = true]; // Optional // override the metering class-id coming from the route table - optional bool override_meter = 5; + optional bool override_meter = 5 [deprecated = true]; // Optional // if true, use the destination VNET VNI for encap. If false or not specified, use source VNET's VNI optional bool use_dst_vni = 6; @@ -26,13 +26,18 @@ message VnetMapping { optional bool use_pl_sip_eni = 7; // Optional // overlay src ip if routing_type is {privatelink} - optional types.IpAddress overlay_sip = 8; + optional types.IpAddress overlay_sip = 8 [deprecated = true]; // changed to overlay_sip_prefix // Optional // overlay dst ip if routing_type is {privatelink} - optional types.IpAddress overlay_dip = 9; + optional types.IpAddress overlay_dip = 9 [deprecated = true]; // changed to overlay_dip_prefix // Optional // ID of routing appliance if routing_type is {privatelinknsg} - optional uint32 routing_appliance_id = 10; + optional uint32 routing_appliance_id = 10 [deprecated = true]; + optional uint32 metering_class_or = 12; + optional types.IpPrefix overlay_sip_prefix = 13; + optional types.IpPrefix overlay_dip_prefix = 14; + optional string tunnel = 15; + route_type.RoutingType routing_type = 16; } // CA-PA mapping table for Vnet