Commit 54310374 authored by Javier Velázquez's avatar Javier Velázquez Committed by Samuel Santos
Browse files

Add match type "any"

parent d7042277
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ def configure_match_criteria(network_access, site, sdp, layer_type):
        MATCH_TYPE_MAPPING["source-ip-prefix"] = "ipv4-src-prefix"
        MATCH_TYPE_MAPPING["destination-ip-prefix"] = "ipv4-dst-prefix"
        MATCH_TYPE_MAPPING["vlan"] = "vlan" # Need to check if applies with l2 too
        MATCH_TYPE_MAPPING["any"] = "any" # Need to check if applies with l2 too
        
    match_criteria = sdp.get("match_criteria")
    if not match_criteria:
@@ -46,7 +47,7 @@ def configure_match_criteria(network_access, site, sdp, layer_type):
    prefix_length = safe_get(sdp, ["sdp", "attachment-circuits", "attachment-circuit", 0, "ac-ipv4-prefix-length"])
    lan = f"{provider_address}/{prefix_length}" if provider_address and prefix_length else None

    if match_type != "vlan":
    if match_type != "vlan" and match_type != "any":
        rule = {
            "id": f"match-{match_type}-{index}",
            "match-flow": {
@@ -55,7 +56,8 @@ def configure_match_criteria(network_access, site, sdp, layer_type):
        }
        
        network_access["service"]["qos"]["qos-classification-policy"]["rule"].append(rule)
    else:
    elif match_type == "vlan":
        site["routing-protocols"] = {"routing-protocol": []}
        # Handle VLAN match criteria
        routing_protocol = {
            "type": "static",