huawei-ifit-common

This module contains a collection of YANG definitions iFIT feature.

  • Version: 2020-04-08

    huawei-ifit-common@2020-04-08


    
      module huawei-ifit-common {
    
        yang-version 1;
    
        namespace
          "urn:huawei:yang:huawei-ifit-common";
    
        prefix ifit-common;
    
        import huawei-ifit {
          prefix ifit;
        }
        import huawei-extension {
          prefix ext;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import huawei-ifm {
          prefix ifm;
        }
        import huawei-network-instance {
          prefix ni;
        }
        import huawei-l3vpn {
          prefix l3vpn;
        }
        import huawei-evpl {
          prefix evpl;
        }
    
        organization
          "Huawei Technologies Co., Ltd.";
    
        contact
          "Huawei Industrial Base
         Bantian, Longgang
         Shenzhen 518129
         People's Republic of China
         Website: http://www.huawei.com
         Email: support@huawei.com";
    
        description
          "This module contains a collection of YANG definitions iFIT feature.";
    
        revision "2020-04-08" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "ifit";
    
        typedef flow-type {
          type enumeration {
            enum "unidirection" {
              value 2;
              description
                "An unidirection iFIT flow.";
            }
            enum "bidirection" {
              value 1;
              description
                "A bidirection iFIT flow.";
            }
          }
          description "Flow type.";
        }
    
        typedef measure-mode {
          type enumeration {
            enum "e2e" {
              value 1;
              description "E2E measure mode.";
            }
            enum "trace" {
              value 2;
              description "Trace measure mode.";
            }
          }
          description "Measure mode.";
        }
    
        typedef addr-type {
          type enumeration {
            enum "ipv4" {
              value 0;
              description "IPv4 address.";
            }
            enum "ipv6" {
              value 1;
              description "IPv6 address.";
            }
          }
          description "Address type.";
        }
    
        typedef flow-direction {
          type enumeration {
            enum "ingress" {
              value 1;
              description
                "Ingress of an iFIT flow.";
            }
            enum "transit-input" {
              value 2;
              description
                "Transit input of an iFIT flow.";
            }
            enum "transit-output" {
              value 3;
              description
                "Transit output of an iFIT flow.";
            }
            enum "egress" {
              value 4;
              description
                "Egress of an iFIT flow.";
            }
            enum "egress-to-cpu" {
              value 7;
              description
                "Egress to cpu of an IFIT flow.";
            }
            enum "egress-normal-drop" {
              value 8;
              description
                "Egress normal drop of an IFIT flow.";
            }
          }
          description "Flow direction.";
        }
    
        typedef addr-family-type {
          type enumeration {
            enum "ipv4-unicast" {
              value 1;
              description "IPv4 unicast.";
            }
            enum "ipv6-unicast" {
              value 2;
              description "IPv6 unicast.";
            }
          }
          description "Address family.";
        }
    
        typedef learning-mode {
          type enumeration {
            enum "sip-mask-dip-exact" {
              value 1;
              description
                "Mask included for source IP matching, and exact matching for destination IP address.";
            }
            enum "sip-mask-dip-mask" {
              value 2;
              description
                "Mask included for source and destination IP matching.";
            }
            enum "sip-exact-dip-exact" {
              value 3;
              description
                "Exact matching for source and destination IP addresses.";
            }
            enum "sip-exact-dip-mask" {
              value 4;
              description
                "Exact matching for source IP address, and mask included for destination IP matching.";
            }
          }
          description "Learning mode.";
        }
    
        typedef mapping-type {
          type enumeration {
            enum "ingress" {
              value 1;
              description "Ingress.";
            }
            enum "egress" {
              value 2;
              description "Egress.";
            }
          }
          description "Mapping type.";
        }
    
        rpc reset-dynamic-flow-all {
          ext:node-ref "/ifit:ifit/ifit-common:ifit-common/ifit-common:dynamic-flow-hops";
          description
            "Clear all dynamic iFIT flow.";
          input {
            leaf all-flow {
              type boolean;
              mandatory true;
              description
                "Clear all dynamic iFIT flow.";
            }
          }
        }  // rpc reset-dynamic-flow-all
    
        rpc reset-dynamic-flowid {
          ext:node-ref "/ifit:ifit/ifit-common:ifit-common/ifit-common:dynamic-flow-hops/ifit-common:dynamic-flow-hop";
          description
            "Clear specified dynamic iFIT ID.";
          input {
            leaf flow-id {
              type uint64;
              mandatory true;
              description
                "Clear specified dynamic iFIT ID.";
            }
          }
        }  // rpc reset-dynamic-flowid
    
        rpc set-dynamic-flow {
          ext:node-ref "/ifit:ifit/ifit-common:ifit-common/ifit-common:dynamic-flows/ifit-common:dynamic-flow";
          description "Set iFIT Flow parameter.";
          input {
            leaf source-ip {
              type inet:ip-address-no-zone;
              description
                "Source IP address of an iFIT flow.";
            }
    
            leaf destination-ip {
              type inet:ip-address-no-zone;
              description
                "Destination IP address of an iFIT flow.";
            }
    
            leaf source-mask {
              when "../source-ip";
              type uint8;
              description
                "Source IP address mask of an iFIT flow.";
            }
    
            leaf destination-mask {
              when "../destination-ip";
              type uint8;
              description
                "Destination IP address mask of an iFIT flow.";
            }
    
            leaf address-type {
              type addr-type;
              mandatory true;
              description
                "Address type of iFIT flow.";
            }
    
            leaf if-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              mandatory true;
              description
                "Interface name to which an iFIT flow binds.";
            }
    
            leaf ni-name {
              type leafref {
                path "/ni:network-instance/ni:instances/ni:instance/ni:name";
              }
              description
                "Name of the VPN to which an iFIT flow belongs.";
            }
    
            leaf dscp {
              type uint16 {
                range "0..63";
              }
              description
                "DSCP of an iFIT flow.";
            }
    
            leaf interval {
              type uint16 {
                range "10|30|60|300";
              }
              units "s";
              default "30";
              description
                "Interval of an iFIT flow.";
            }
    
            leaf measure-mode {
              type measure-mode;
              default "e2e";
              description
                "Measure mode of an iFIT flow.";
            }
    
            leaf loss-measure-enable {
              type boolean;
              default "true";
              description
                "Enable/disable loss measure function of an iFIT flow.";
            }
    
            leaf delay-measure-enable {
              type boolean;
              default "true";
              description
                "Enable/disable delay measure function of an iFIT flow.";
            }
    
            leaf disorder-measure-enable {
              type boolean;
              default "false";
              description
                "Enable/disable disorder measure function of an iFIT flow.";
            }
    
            leaf protocol {
              type uint8 {
                ext:value-meaning {
                  ext:item "6" {
                    ext:meaning "tcp";
                  }
                  ext:item "17" {
                    ext:meaning "udp";
                  }
                  ext:item "132" {
                    ext:meaning "sctp";
                  }
                }
                range "0..254";
              }
              description
                "Protocol of an iFIT flow.";
            }
    
            leaf source-port {
              type uint16 {
                range "1..65535";
              }
              description
                "Source port of an iFIT flow.";
            }
    
            leaf destination-port {
              type uint16 {
                range "1..65535";
              }
              description
                "Destination port of an iFIT flow.";
            }
    
            leaf delay-per-packet-enable {
              type boolean;
              default "false";
              description
                "Enable/disable delay per-packet function of an iFIT flow.";
            }
          }
        }  // rpc set-dynamic-flow
    
        rpc reset-dynamic-flow {
          ext:node-ref "/ifit:ifit/ifit-common:ifit-common/ifit-common:dynamic-flows/ifit-common:dynamic-flow";
          description
            "Clear specified dynamic flow.";
          input {
            leaf address-type {
              type addr-type;
              mandatory true;
              description
                "Address type of iFIT flow.";
            }
    
            leaf source-ip {
              type inet:ip-address-no-zone;
              description
                "Source IP address of an iFIT flow.";
            }
    
            leaf destination-ip {
              type inet:ip-address-no-zone;
              description
                "Destination IP address of an iFIT flow.";
            }
    
            leaf source-mask {
              when "../source-ip";
              type uint8 {
                range "1..128";
              }
              description
                "Source IP address mask of an iFIT flow.";
            }
    
            leaf destination-mask {
              when "../destination-ip";
              type uint8 {
                range "1..128";
              }
              description
                "Destination IP address mask of an iFIT flow.";
            }
    
            leaf protocol {
              type uint8 {
                ext:value-meaning {
                  ext:item "6" {
                    ext:meaning "tcp";
                  }
                  ext:item "17" {
                    ext:meaning "udp";
                  }
                  ext:item "132" {
                    ext:meaning "sctp";
                  }
                }
                range "0..254";
              }
              description
                "Protocol of an iFIT flow.";
            }
    
            leaf source-port {
              type uint16 {
                range "1..65535";
              }
              description
                "Source port of an iFIT flow.";
            }
    
            leaf destination-port {
              type uint16 {
                range "1..65535";
              }
              description
                "Destination port of an iFIT flow.";
            }
    
            leaf ni-name {
              type leafref {
                path "/ni:network-instance/ni:instances/ni:instance/ni:name";
              }
              description
                "Name of the VPN to which an iFIT flow belongs.";
            }
    
            leaf if-name {
              type leafref {
                path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
              }
              mandatory true;
              description
                "Interface name to which an iFIT flow binds.";
            }
    
            leaf dscp {
              type uint16 {
                range "0..63";
              }
              description
                "DSCP of an iFIT flow.";
            }
          }
        }  // rpc reset-dynamic-flow
    
        augment /ifit:ifit {
          description "The iFIT augment.";
          container ifit-common {
            description
              "Configure iFIT function.";
            container global {
              description
                "Configure global parameter of iFIT.";
              leaf node-id {
                ext:operation-exclude "update" {
                  when "../../static-instances/static-instance";
                  description "The 'node-id' cannot be updated, when static-instance exists.";
                }
                type uint32 {
                  range "1..1048575";
                }
                description "Node ID of iFIT.";
              }
    
              leaf dynamic-flow-aging-multiplier {
                type uint16 {
                  range "2..100";
                }
                description
                  "Multiplier of an dynamic iFIT flow age interval. If the instance interval calculation result is less than 10 minutes, the 10 minutes shall prevail.";
              }
            }  // container global
    
            container next-hops {
              description
                "List of iFIT function for the next hop addresses.";
              list next-hop {
                key "address";
                description
                  "Configure iFIT function for the next hop address.";
                leaf address {
                  type inet:ip-address-no-zone;
                  description
                    "Next hop address.";
                }
              }  // list next-hop
            }  // container next-hops
    
            container peer-locators {
              description
                "List of iFIT function for the next locator addresses.";
              list peer-locator {
                key "prefix";
                status obsolete;
                description
                  "Configure iFIT function for the next locator address.";
                leaf prefix {
                  type inet:ipv6-address-no-zone;
                  status obsolete;
                  description
                    "Next locator address.";
                }
    
                leaf prefix-mask-length {
                  ext:operation-exclude "update";
                  type uint32 {
                    range "32..120";
                  }
                  mandatory true;
                  status obsolete;
                  description
                    "Mask length of a next locator address.";
                }
              }  // list peer-locator
            }  // container peer-locators
    
            container static-instances {
              description
                "List of static instances of iFIT.";
              list static-instance {
                must
                  "gtpu-sn-measure-enable='false' or disorder-measure-enable = 'false'";
                must
                  "delay-per-packet-enable = 'false' or (loss-measure-enable = 'true' and disorder-measure-enable = 'false' and gtpu-sn-measure-enable = 'false')";
                key "name";
                unique "flow/flow-filter/filter-condition1/flow-address-type/ipv4-condition/source-ip flow/flow-filter/filter-condition1/flow-address-type/ipv4-condition/destination-ip flow/flow-filter/filter-condition1/flow-address-type/ipv4-condition/source-mask flow/flow-filter/filter-condition1/flow-address-type/ipv4-condition/destination-mask flow/flow-filter/filter-condition1/protocol flow/flow-filter/filter-condition1/source-port flow/flow-filter/filter-condition1/destination-port flow/flow-filter/filter-condition1/gtp-enable flow/flow-filter/filter-condition1/gtp-teid flow/flow-filter/filter-condition1/ni-name flow/flow-filter/filter-condition1/dscp";
                unique "flow/flow-filter/filter-condition1/flow-address-type/ipv6-condition/source-ipv6 flow/flow-filter/filter-condition1/flow-address-type/ipv6-condition/destination-ipv6 flow/flow-filter/filter-condition1/flow-address-type/ipv6-condition/source-ipv6-mask flow/flow-filter/filter-condition1/flow-address-type/ipv6-condition/destination-ipv6-mask flow/flow-filter/filter-condition1/protocol flow/flow-filter/filter-condition1/source-port flow/flow-filter/filter-condition1/destination-port flow/flow-filter/filter-condition1/gtp-enable flow/flow-filter/filter-condition1/gtp-teid flow/flow-filter/filter-condition1/ni-name flow/flow-filter/filter-condition1/dscp";
                unique "flow/flow-filter/filter-condition2/vpn-filter/ni-condition/address-type flow/flow-filter/filter-condition2/vpn-filter/ni-condition/peer-ni-name flow/flow-filter/filter-condition2/peer-filter/ip-condition/peer-ip";
                unique "flow/flow-filter/filter-condition2/vpn-filter/evpl-condition/peer-evpl-id flow/flow-filter/filter-condition2/peer-filter/ip-condition/peer-ip";
                description
                  "Configure static instance of iFIT.";
                leaf name {
                  type string {
                    length "1..31";
                  }
                  must
                    "(../../../global/node-id)";
                  description
                    "Instance name of iFIT.";
                }
    
                leaf interval {
                  type uint16 {
                    range "10|30|60|300";
                  }
                  units "s";
                  default "30";
                  description
                    "Interval of an iFIT flow.";
                }
    
                leaf measure-mode {
                  type measure-mode;
                  default "e2e";
                  description
                    "Measure mode of an iFIT flow.";
                }
    
                leaf loss-measure-enable {
                  type boolean;
                  default "true";
                  description
                    "Enable/disable loss measure function of an iFIT flow.";
                }
    
                leaf delay-measure-enable {
                  type boolean;
                  default "true";
                  description
                    "Enable/disable delay measure function of an iFIT flow.";
                }
    
                leaf disorder-measure-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable disorder measure function of an iFIT flow.";
                }
    
                leaf gtpu-sn-measure-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable gtpu sequence number measure function of an iFIT flow.";
                }
    
                leaf delay-per-packet-enable {
                  type boolean;
                  default "false";
                  description
                    "Enable/disable delay per-packet function of an iFIT flow.";
                }
    
                container flow {
                  must
                    "flow-type='bidirection' or (source-ip or source-ipv6 or address-type or peer-evpl-id)";
                  must
                    "not (gtp-enable='true') or (not (protocol) or (protocol='17' and ((source-port=2152 and destination-port>=2152) or (destination-port=2152 and source-port>=2152))))";
                  presence "Enable flow";
                  description
                    "Configure iFIT flow.";
                  leaf flow-type {
                    ext:operation-exclude "update";
                    type flow-type;
                    mandatory true;
                    description
                      "Flow type of an iFIT flow.";
                  }
    
                  choice flow-filter {
                    mandatory true;
                    description
                      "Configure the filter of a flow.";
                    case filter-condition1 {
                      description
                        "Filter condition 1.";
                      choice flow-address-type {
                        mandatory true;
                        description
                          "Configure the address of a flow.";
                        case ipv4-condition {
                          description
                            "IPv4 condition.";
                          leaf source-ip {
                            ext:operation-exclude "update|delete";
                            ext:support-filter "true";
                            type inet:ipv4-address-no-zone;
                            description
                              "Source IPv4 address of an iFIT flow.";
                          }
    
                          leaf destination-ip {
                            ext:operation-exclude "update";
                            ext:support-filter "true";
                            type inet:ipv4-address-no-zone;
                            must
                              "../destination-ip != ../source-ip";
                            mandatory true;
                            description
                              "Destination IPv4 address of an iFIT flow.";
                          }
    
                          leaf source-mask {
                            ext:operation-exclude "update|delete";
                            when "../source-ip";
                            type uint8 {
                              range "1..32";
                            }
                            default "32";
                            description
                              "Source IPv4 address mask of an iFIT flow.";
                          }
    
                          leaf destination-mask {
                            ext:operation-exclude "update|delete";
                            type uint8 {
                              range "1..32";
                            }
                            default "32";
                            description
                              "Destination IPv4 address mask of an iFIT flow.";
                          }
                        }  // case ipv4-condition
    
                        case ipv6-condition {
                          description
                            "IPv6 condition.";
                          leaf source-ipv6 {
                            ext:operation-exclude "update";
                            ext:support-filter "true";
                            type inet:ipv6-address-no-zone;
                            mandatory true;
                            description
                              "Source IPv6 address of an iFIT flow.";
                          }
    
                          leaf destination-ipv6 {
                            ext:operation-exclude "update";
                            ext:support-filter "true";
                            type inet:ipv6-address-no-zone;
                            must
                              "../destination-ipv6 != ../source-ipv6";
                            mandatory true;
                            description
                              "Destination IPv6 address of an iFIT flow.";
                          }
    
                          leaf source-ipv6-mask {
                            ext:operation-exclude "update|delete";
                            type uint8 {
                              range "32..128";
                            }
                            default "128";
                            description
                              "Source IPv6 address mask of an iFIT flow.";
                          }
    
                          leaf destination-ipv6-mask {
                            ext:operation-exclude "update|delete";
                            type uint8 {
                              range "32..128";
                            }
                            default "128";
                            description
                              "Destination IPv6 address mask of an iFIT flow.";
                          }
                        }  // case ipv6-condition
                      }  // choice flow-address-type
    
                      leaf protocol {
                        ext:operation-exclude "update|delete";
                        type uint8 {
                          ext:value-meaning {
                            ext:item "6" {
                              ext:meaning "tcp";
                            }
                            ext:item "17" {
                              ext:meaning "udp";
                            }
                            ext:item "132" {
                              ext:meaning "sctp";
                            }
                          }
                          range "0..254";
                        }
                        description
                          "Protocol of an iFIT flow.";
                      }
    
                      leaf source-port {
                        ext:operation-exclude "update|delete";
                        type uint16 {
                          range "1..65535";
                        }
                        must
                          "../protocol=6 or ../protocol=17 or ../protocol=132";
                        description
                          "Source port of an iFIT flow.";
                      }
    
                      leaf destination-port {
                        ext:operation-exclude "update|delete";
                        type uint16 {
                          range "1..65535";
                        }
                        must
                          "../protocol =6 or ../protocol=17 or ../protocol=132";
                        description
                          "Destination port of an iFIT flow.";
                      }
    
                      leaf gtp-enable {
                        ext:operation-exclude "update|delete";
                        when
                          "../flow-type='unidirection'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable GTP protocol measure for an iFIT flow.";
                      }
    
                      leaf gtp-teid {
                        ext:operation-exclude "update|delete";
                        when
                          "../flow-type='unidirection' and ../gtp-enable = 'true'";
                        type uint32 {
                          range "1..4294967295";
                        }
                        description
                          "GTP TEID of an iFIT flow.";
                      }
    
                      leaf ni-name {
                        ext:operation-exclude "update|delete";
                        type leafref {
                          path "/ni:network-instance/ni:instances/ni:instance/ni:name";
                        }
                        must
                          "../ni-name!='_public_' and (((../destination-ip) and /ni:network-instance/ni:instances/ni:instance[ni:name=current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']) or ((../destination-ipv6) and /ni:network-instance/ni:instances/ni:instance[ni:name=current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv6-unicast']))";
                        description
                          "Name of the VPN to which an iFIT flow belongs.";
                      }
    
                      leaf dscp {
                        ext:operation-exclude "update|delete";
                        type uint16 {
                          range "0..63";
                        }
                        description
                          "DSCP of an iFIT flow.";
                      }
                    }  // case filter-condition1
    
                    case filter-condition2 {
                      when
                        "flow-type='unidirection' and ../gtpu-sn-measure-enable='false'";
                      description
                        "Filter condition 2.";
                      choice vpn-filter {
                        mandatory true;
                        description
                          "Configure the VPN filter of a flow.";
                        case ni-condition {
                          description
                            "Peer netconf instance condition.";
                          leaf address-type {
                            ext:operation-exclude "update";
                            type addr-family-type;
                            mandatory true;
                            description
                              "Address type of an iFIT flow peer.";
                          }
    
                          leaf peer-ni-name {
                            ext:operation-exclude "update|delete";
                            type leafref {
                              path "/ni:network-instance/ni:instances/ni:instance/ni:name";
                            }
                            must
                              " ../peer-ni-name!='_public_' and /ni:network-instance/ni:instances/ni:instance[ni:name = current()]/l3vpn:afs/l3vpn:af[l3vpn:type=current()/../address-type]";
                            description
                              "Name of the VPN to which an iFIT flow peer belongs.";
                          }
                        }  // case ni-condition
    
                        case evpl-condition {
                          description
                            "Peer EVPL condition.";
                          leaf peer-evpl-id {
                            ext:operation-exclude "update";
                            type leafref {
                              path "/evpl:evpl/evpl:instances/evpl:instance/evpl:id";
                            }
                            must
                              "((../peer-ip and /evpl:evpl/evpl:instances/evpl:instance[evpl:id=current()][evpl:mode!='vxlan-mode']) or (../peer-locator-prefix and /evpl:evpl/evpl:instances/evpl:instance[evpl:id=current()][evpl:mode!='vxlan-mode']))";
                            mandatory true;
                            description
                              "ID of the EVPL instance to which an iFIT flow peer belongs.";
                          }
                        }  // case evpl-condition
                      }  // choice vpn-filter
    
                      choice peer-filter {
                        mandatory true;
                        description
                          "Configure the peer filter of a flow.";
                        case ip-condition {
                          description
                            "Peer filter ip condition.";
                          leaf peer-ip {
                            ext:operation-exclude "update";
                            type inet:ipv4-address-no-zone;
                            must
                              "../peer-ni-name or ../peer-evpl-id";
                            mandatory true;
                            description
                              "Peer IP address of an iFIT flow.";
                          }
                        }  // case ip-condition
    
                        case locator-condition {
                          description
                            "Peer filter locatior condition.";
                          leaf peer-locator-prefix {
                            ext:operation-exclude "update";
                            type inet:ipv6-address-no-zone;
                            mandatory true;
                            description
                              "Peer locator address.";
                          }
    
                          leaf peer-locator-prefix-mask-len {
                            ext:operation-exclude "update";
                            type uint32 {
                              range "32..120";
                            }
                            mandatory true;
                            description
                              "Mask length of a peer locator address.";
                          }
                        }  // case locator-condition
                      }  // choice peer-filter
                    }  // case filter-condition2
                  }  // choice flow-filter
    
                  container bind-ifs {
                    description
                      "List of flow specified interfaces of iFIT.";
                    list bind-if {
                      key "if-name";
                      description
                        "Configure flow specified interface of iFIT.";
                      leaf if-name {
                        type leafref {
                          path
                            "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                        }
                        description
                          "Interface name to which an iFIT flow binds.";
                      }
    
                      leaf flow-id {
                        type uint64;
                        config false;
                        description
                          "Flow ID of an iFIT flow.";
                      }
                    }  // list bind-if
                  }  // container bind-ifs
                }  // container flow
              }  // list static-instance
            }  // container static-instances
    
            container dynamic-flow-hops {
              config false;
              description
                "List of dynamic flow hops of iFIT.";
              list dynamic-flow-hop {
                key "flow-id";
                description
                  "Operational data of dynamic flow hop of iFIT.";
                leaf flow-id {
                  type uint64;
                  description
                    "Flow ID of an iFIT flow.";
                }
    
                leaf flow-type {
                  type flow-type;
                  description
                    "Flow type of an iFIT flow.";
                }
    
                leaf if-name {
                  type leafref {
                    path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                  }
                  description
                    "Interface name to which an iFIT flow passes.";
                }
    
                leaf interval {
                  type uint16 {
                    range "10|30|60|300";
                  }
                  units "s";
                  description
                    "Interval of an iFIT flow.";
                }
    
                leaf direction {
                  type flow-direction;
                  description
                    "Direction of an iFIT flow.";
                }
    
                leaf loss-measure-enable {
                  type boolean;
                  description
                    "Enable/disable loss measure function of an iFIT flow.";
                }
    
                leaf delay-measure-enable {
                  type boolean;
                  description
                    "Enable/disable delay measure function of an iFIT flow.";
                }
    
                leaf disorder-measure-enable {
                  type boolean;
                  description
                    "Enable/disable disorder measure function of an iFIT flow.";
                }
              }  // list dynamic-flow-hop
            }  // container dynamic-flow-hops
    
            container dynamic-flows {
              config false;
              description
                "List of dynamic flows of iFIT.";
              list dynamic-flow {
                key "flow-id";
                description
                  "Operational data of dynamic flow of iFIT.";
                leaf flow-id {
                  type uint64;
                  description
                    "Flow ID of an iFIT flow.";
                }
    
                leaf flow-type {
                  type flow-type;
                  description
                    "Flow type of an iFIT flow.";
                }
    
                leaf address-type {
                  type addr-type;
                  description
                    "Address type of an iFIT flow.";
                }
    
                leaf source-ip {
                  ext:support-filter "true";
                  type inet:ip-address-no-zone;
                  description
                    "Source IP address of an iFIT flow.";
                }
    
                leaf destination-ip {
                  ext:support-filter "true";
                  type inet:ip-address-no-zone;
                  description
                    "Destination IP address of an iFIT flow.";
                }
    
                leaf source-mask {
                  type uint8 {
                    range "1..128";
                  }
                  description
                    "Source IP address mask of an iFIT flow.";
                }
    
                leaf destination-mask {
                  type uint8 {
                    range "1..128";
                  }
                  description
                    "Destination IP address mask of an iFIT flow.";
                }
    
                leaf protocol {
                  type uint8 {
                    ext:value-meaning {
                      ext:item "6" {
                        ext:meaning "tcp";
                      }
                      ext:item "17" {
                        ext:meaning "udp";
                      }
                      ext:item "132" {
                        ext:meaning "sctp";
                      }
                    }
                    range "0..254";
                  }
                  description
                    "Protocol of an iFIT flow.";
                }
    
                leaf source-port {
                  type uint16 {
                    range "1..65535";
                  }
                  description
                    "Source port of an iFIT flow.";
                }
    
                leaf destination-port {
                  type uint16 {
                    range "1..65535";
                  }
                  description
                    "Destination port of an iFIT flow.";
                }
    
                leaf ni-name {
                  type leafref {
                    path "/ni:network-instance/ni:instances/ni:instance/ni:name";
                  }
                  description
                    "Name of the VPN to which an iFIT flow belongs.";
                }
    
                leaf if-name {
                  type leafref {
                    path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                  }
                  description
                    "Interface name to which an iFIT flow passes.";
                }
    
                leaf interval {
                  type uint16 {
                    range "10|30|60|300";
                  }
                  units "s";
                  description
                    "Interval of an iFIT flow.";
                }
    
                leaf measure-mode {
                  type measure-mode;
                  description
                    "Measure mode of an iFIT flow.";
                }
    
                leaf delay-measure-enable {
                  type boolean;
                  description
                    "Enable/disable delay measure function of an iFIT flow.";
                }
    
                leaf loss-measure-enable {
                  type boolean;
                  description
                    "Enable/disable loss measure function of an iFIT flow.";
                }
    
                leaf disorder-measure-enable {
                  type boolean;
                  description
                    "Enable/disable disorder measure function of an iFIT flow.";
                }
    
                leaf dscp {
                  type uint16 {
                    range "0..63";
                  }
                  description
                    "DSCP of an iFIT flow.";
                }
    
                leaf delay-per-packet-enable {
                  type boolean;
                  description
                    "Enable/disable delay per-packet function of an IFIT flow.";
                }
              }  // list dynamic-flow
            }  // container dynamic-flows
    
            container whitelist-groups {
              description
                "List of whitelist groups of iFIT.";
              list whitelist-group {
                key "group-name";
                description
                  "Configure whitelist group of iFIT.";
                leaf group-name {
                  type string {
                    length "1..31";
                  }
                  description
                    "Whitelist group name.";
                }
    
                container whitelist-rules {
                  description
                    "List of whitelist rules of iFIT.";
                  list whitelist-rule {
                    ext:operation-exclude "update";
                    must
                      "source-ipv4-address or source-ipv4-mask or destination-ipv4-address or destination-ipv4-mask or source-ipv6-address or source-ipv6-mask or destination-ipv6-address or destination-ipv6-mask or protocol";
                    key "rule-name";
                    description
                      "Configure whitelist rule of iFIT.";
                    leaf rule-name {
                      type string {
                        length "1..31";
                      }
                      description
                        "Whitelist rule name.";
                    }
    
                    leaf address-family {
                      type addr-type;
                      mandatory true;
                      description
                        "Address family type of an iFIT whitelist rule.";
                    }
    
                    choice address-type {
                      description
                        "Configure the address of an iFIT whitelist rule.";
                      case ipv4-condition {
                        when
                          "address-family='ipv4'";
                        description
                          "IPv4 condition.";
                        leaf source-ipv4-address {
                          type inet:ipv4-address-no-zone;
                          description
                            "Source IPv4 address.";
                        }
    
                        leaf source-ipv4-mask {
                          ext:dynamic-default {
                            ext:default-value "32" {
                              when "../source-ipv4-address";
                              description "The default value is 32 when source IPv4 address is configured.";
                            }
                          }
                          type uint8 {
                            range "1..32";
                          }
                          description
                            "Source IPv4 address mask.";
                        }
    
                        leaf destination-ipv4-address {
                          type inet:ipv4-address-no-zone;
                          description
                            "Destination IPv4 address.";
                        }
    
                        leaf destination-ipv4-mask {
                          ext:dynamic-default {
                            ext:default-value "32" {
                              when "../destination-ipv4-address";
                              description "The default value is 32 when destination IPv4 address is configured.";
                            }
                          }
                          type uint8 {
                            range "1..32";
                          }
                          description
                            "Destination IPv4 address mask.";
                        }
                      }  // case ipv4-condition
    
                      case ipv6-condition {
                        when
                          "address-family='ipv6'";
                        description
                          "IPv6 condition.";
                        leaf source-ipv6-address {
                          type inet:ipv6-address-no-zone;
                          description
                            "Source IPv6 address.";
                        }
    
                        leaf source-ipv6-mask {
                          ext:dynamic-default {
                            ext:default-value "128" {
                              when "../source-ipv6-address";
                              description "The default value is 128 when source IPv6 address is configured.";
                            }
                          }
                          type uint8 {
                            range "1..128";
                          }
                          description
                            "Source IPv6 address mask.";
                        }
    
                        leaf destination-ipv6-address {
                          type inet:ipv6-address-no-zone;
                          description
                            "Destination IPv6 address.";
                        }
    
                        leaf destination-ipv6-mask {
                          ext:dynamic-default {
                            ext:default-value "128" {
                              when "../destination-ipv6-address";
                              description "The default value is 128 when destination IPv6 address is configured.";
                            }
                          }
                          type uint8 {
                            range "1..128";
                          }
                          description
                            "Destination IPv6 address mask.";
                        }
                      }  // case ipv6-condition
                    }  // choice address-type
    
                    leaf protocol {
                      type uint8 {
                        ext:value-meaning {
                          ext:item "6" {
                            ext:meaning "tcp";
                          }
                          ext:item "17" {
                            ext:meaning "udp";
                          }
                          ext:item "132" {
                            ext:meaning "sctp";
                          }
                        }
                        range "0..254";
                      }
                      description
                        "Protocol of an iFIT whitelist rule.";
                    }
    
                    leaf source-port {
                      type uint16 {
                        range "1..65535";
                      }
                      must
                        "../protocol=6 or ../protocol=17 or ../protocol=132";
                      description
                        "Source port of an iFIT whitelist rule.";
                    }
    
                    leaf destination-port {
                      type uint16 {
                        range "1..65535";
                      }
                      must
                        "../protocol=6 or ../protocol=17 or ../protocol=132";
                      description
                        "Destination port of an iFIT whitelist rule.";
                    }
                  }  // list whitelist-rule
                }  // container whitelist-rules
              }  // list whitelist-group
            }  // container whitelist-groups
          }  // container ifit-common
        }
    
        augment /ni:network-instance/ni:instances/ni:instance {
          description
            "The iFIT configuration in vpn.";
          container ifit-learning {
            when "/ifit:ifit";
            presence "Flow learning.";
            description
              "Configure iFIT flow learning for the VPN.";
            leaf flow-type {
              type flow-type;
              default "bidirection";
              description
                "Flow type of the iFIT flow learning.";
            }
    
            leaf interval {
              type uint16 {
                range "10|30|60|300";
              }
              units "s";
              default "60";
              description
                "Interval of the iFIT flow learning.";
            }
    
            leaf measure-mode {
              type measure-mode;
              default "e2e";
              description
                "Measure mode of the iFIT flow learning.";
            }
    
            leaf learning-mode {
              type learning-mode;
              default "sip-mask-dip-exact";
              description
                "Learning mode of the iFIT flow learning.";
            }
    
            leaf per-packet-delay-measure {
              type boolean;
              default "false";
              description
                "Enable/disable per packet delay measure function for the iFIT flow learning.";
            }
    
            container bind-learning-interface {
              when
                "/ifit:ifit/ifit-common:ifit-common/ifit-common:global/ifit-common:node-id";
              description
                "Configure interface for iFIT flow learning.";
              choice learning-interface {
                description
                  "Specify interface parameter.";
                case all-interfaces {
                  description
                    "Specify all interfaces.";
                  container all-interfaces {
                    presence
                      "Bind all interfaces.";
                    description
                      "Configure all interfaces for iFIT flow learning.";
                    leaf all {
                      type empty;
                      mandatory true;
                      description
                        "All interfaces.";
                    }
    
                    leaf group-name {
                      type leafref {
                        path "/ifit:ifit/ifit-common:ifit-common/ifit-common:whitelist-groups/ifit-common:whitelist-group/ifit-common:group-name";
                      }
                      description
                        "Whitelist group name.";
                    }
                  }  // container all-interfaces
                }  // case all-interfaces
    
                case specified-interface {
                  description
                    "Specify interface name.";
                  container specified-interfaces {
                    description
                      "List of flow learning specified interfaces of iFIT.";
                    list specified-interface {
                      key "interface-name";
                      description
                        "Configure flow learning specified interface of iFIT.";
                      leaf interface-name {
                        type leafref {
                          path
                            "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                        }
                        description
                          "Interface name to which an iFIT flow learning binds.";
                      }
    
                      leaf group-name {
                        type leafref {
                          path "/ifit:ifit/ifit-common:ifit-common/ifit-common:whitelist-groups/ifit-common:whitelist-group/ifit-common:group-name";
                        }
                        description
                          "Whitelist group name.";
                      }
                    }  // list specified-interface
                  }  // container specified-interfaces
                }  // case specified-interface
              }  // choice learning-interface
            }  // container bind-learning-interface
          }  // container ifit-learning
        }
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface {
          description
            "The iFIT configuration in interface.";
          container ifit {
            when "/ifit:ifit";
            description
              "Configure iFIT mapping on the interface.";
            container mappings {
              when
                "../../ifm:vrf-name != '_public_'";
              description
                "List of configure iFIT mapping on the local interface.";
              list mapping {
                key "mapping-type";
                description
                  "Configure iFIT mapping on the local interface.";
                leaf mapping-type {
                  type mapping-type;
                  description
                    "Mapping type of iFIT.";
                }
              }  // list mapping
            }  // container mappings
          }  // container ifit
        }
      }  // module huawei-ifit-common
    

© 2023 YumaWorks, Inc. All rights reserved.