huawei-mirror

Network monitor.

  • Version: 2021-06-22

    huawei-mirror@2021-06-22


    
      module huawei-mirror {
    
        yang-version 1;
    
        namespace
          "urn:huawei:yang:huawei-mirror";
    
        prefix mirror;
    
        import huawei-qos {
          prefix qos;
        }
        import huawei-devm {
          prefix devm;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-ifm {
          prefix ifm;
        }
        import huawei-pub-type {
          prefix pub-type;
        }
        import huawei-bd {
          prefix bd;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import huawei-ethernet {
          prefix ethernet;
        }
    
        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 "Network monitor.";
    
        revision "2021-06-22" {
          description
            "Optimization constraints.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-07-11" {
          description
            "Optimization constraints.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-02-25" {
          description
            "Optimization constraints.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-01-19" {
          description
            "Optimization constraints.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-01-14" {
          description
            "Add global observes container.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-12-24" {
          description
            "The modifications in the schema file are synchronized to the YANG file.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-12-13" {
          description
            "The modifications in the schema file are synchronized to the YANG file.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-11-21" {
          description
            "The modifications in the schema file are synchronized to the YANG file.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-10-24" {
          description
            "The modifications in the schema file are synchronized to the YANG file.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-05-04" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "mirror";
    
        typedef direction-type {
          type enumeration {
            enum "inbound" {
              value 0;
              description "Inbound.";
            }
            enum "outbound" {
              value 1;
              description "Outbound.";
            }
          }
          description "Direction.";
        }
    
        typedef without-filter {
          type enumeration {
            enum "true" {
              value 1;
              description "Enable.";
            }
            enum "false" {
              value 0;
              description "Disable.";
            }
          }
          description
            "Disable observe filter in observe port.";
        }
    
        typedef with-linklayer-header {
          type enumeration {
            enum "true" {
              value 1;
              description "Enable.";
            }
            enum "false" {
              value 0;
              description "Disable.";
            }
          }
          description
            "With linklayer header observe filter in observe port.";
        }
    
        typedef pop-label {
          type enumeration {
            enum "one" {
              value 1;
              description "One POP.";
            }
            enum "two" {
              value 2;
              description "Two POP.";
            }
            enum "all" {
              value 3;
              description "All POP.";
            }
          }
          description "Specify POP MPLS label.";
        }
    
        typedef mirror-type {
          type enumeration {
            enum "port" {
              value 0;
              description "Port.";
            }
            enum "policy" {
              value 1;
              description "Traffic policy.";
            }
          }
          description "Mirror type.";
        }
    
        typedef query-direction-type {
          type enumeration {
            enum "in" {
              value 0;
              description "In.";
            }
            enum "out" {
              value 1;
              description "Out.";
            }
            enum "in-out" {
              value 2;
              description "In-Out.";
            }
          }
          description "Direction type.";
        }
    
        typedef identifier-type {
          type enumeration {
            enum "none" {
              value 0;
              description "None.";
            }
            enum "pe-vid" {
              value 1;
              description "PE-VID.";
            }
            enum "ce-vid" {
              value 2;
              description "CE-VID.";
            }
            enum "pe-ce-vid" {
              value 3;
              description "PE-CE-VID.";
            }
          }
          description "Identifier type.";
        }
    
        container mirror {
          description "Mirror.";
          container statistic-enable {
            presence "create statistic-enable";
            description
              "Enable/disable mirror statistic.";
          }  // container statistic-enable
    
          container instances {
            description
              "List of mirror instance.";
            list instance {
              key "instance-name";
              description
                "Configure mirror instance.";
              leaf instance-name {
                type string {
                  length "1..31";
                }
                description
                  "Mirror instance name.";
              }
    
              container instance-slice {
                presence
                  "create instance mirror slice-size";
                description
                  "Enable/disable mirror instance slice.";
                leaf slice-size {
                  type uint32 {
                    range "64..9600";
                  }
                  units "Byte";
                  mandatory true;
                  description
                    "Length of packet.";
                }
              }  // container instance-slice
    
              container instance-car {
                must
                  "(not(./pir) and not(./pbs)) or (./pbs)";
                must
                  "not(./pir) or ./pir>=./cir";
                presence "create instance-car";
                description
                  "Enable/disable mirror instance car.";
                leaf cir {
                  type uint32 {
                    range "0..4294967295";
                  }
                  units "kbit/s";
                  mandatory true;
                  description
                    "Committed information rate.";
                }
    
                leaf pir {
                  type uint32 {
                    range "1..4294967295";
                  }
                  units "kbit/s";
                  description
                    "Peak information rate.";
                }
    
                leaf cbs {
                  type uint32 {
                    range "0..4294967295";
                  }
                  units "Byte";
                  mandatory true;
                  description
                    "Committed burst size, which has dynamic defaults.";
                }
    
                leaf pbs {
                  type uint32 {
                    range "0..4294967295";
                  }
                  units "Byte";
                  description
                    "Peak burst size, which has dynamic defaults.";
                }
              }  // container instance-car
            }  // list instance
          }  // container instances
    
          container observe-user-define-acls {
            description
              "List of observe user-defined acl.";
            list observe-user-define-acl {
              key "filter-id";
              max-elements 8;
              description
                "Configure observe user-defined acl.";
              leaf filter-id {
                type uint8 {
                  range "1..8";
                }
                description "Filter index.";
              }
    
              container offsets {
                description
                  "List of observe user-defined offset.";
                list offset {
                  key "config-index";
                  unique "offset-value";
                  min-elements 1;
                  max-elements 4;
                  description
                    "Configure observe user-defined offset.";
                  leaf config-index {
                    type uint32 {
                      range "1..4";
                    }
                    description
                      "Offset index. The config-index values in the offset must start at 1 and be consecutive.";
                  }
    
                  leaf offset-value {
                    type uint32 {
                      range "0..114";
                    }
                    mandatory true;
                    description "Offset.";
                  }
    
                  leaf payload-value {
                    type pub-type:hex-binary;
                    mandatory true;
                    description
                      "Payload value, Value range HEX[0,ffffffff].";
                  }
    
                  leaf payload-mask {
                    type pub-type:hex-binary;
                    mandatory true;
                    description
                      "Payload mask, Value range HEX[0,ffffffff].";
                  }
                }  // list offset
              }  // container offsets
            }  // list observe-user-define-acl
          }  // container observe-user-define-acls
    
          container query-ports {
            config false;
            description
              "List of query port-mirror infos.";
            list query-port {
              key "if-name";
              config false;
              description
                "Query port-mirror info state.";
              leaf if-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                config false;
                description "Interface name.";
              }
    
              leaf type {
                type mirror-type;
                config false;
                description
                  "The value 0 indicates port mirroring, and the value 1 indicates flow mirroring.";
              }
    
              leaf direction {
                type query-direction-type;
                config false;
                description "Direction.";
              }
    
              leaf in-packets {
                type uint64;
                units "packet";
                config false;
                description "Inbound packets.";
              }
    
              leaf out-packets {
                type uint64;
                units "packet";
                config false;
                description "Outbound packets.";
              }
    
              leaf in-drop-packets {
                type uint64;
                units "packet";
                config false;
                description
                  "Inbound Drop Packets.";
              }
    
              leaf out-drop-packets {
                type uint64;
                units "packet";
                config false;
                description
                  "Outbound Drop Packets.";
              }
    
              leaf in-bytes {
                type uint64;
                units "Byte";
                config false;
                description "Inbound bytes.";
              }
    
              leaf out-bytes {
                type uint64;
                units "Byte";
                config false;
                description "Outbound bytes.";
              }
    
              leaf in-drop-bytes {
                type uint64;
                units "Byte";
                config false;
                description
                  "Inbound Drop Bytes.";
              }
    
              leaf out-drop-bytes {
                type uint64;
                units "Byte";
                config false;
                description
                  "Outbound Drop Bytes.";
              }
    
              leaf in-pps {
                type uint64;
                units "pps";
                config false;
                description "Inbound pps.";
              }
    
              leaf out-pps {
                type uint64;
                units "pps";
                config false;
                description "Outbound pps.";
              }
    
              leaf in-drop-pps {
                type uint64;
                units "pps";
                config false;
                description "Inbound Drop pps.";
              }
    
              leaf out-drop-pps {
                type uint64;
                units "pps";
                config false;
                description "Outbound Drop pps.";
              }
    
              leaf in-bps {
                type uint64;
                units "bit/s";
                config false;
                description "Inbound bps.";
              }
    
              leaf out-bps {
                type uint64;
                units "bit/s";
                config false;
                description "Outbound bps.";
              }
    
              leaf in-drop-bps {
                type uint64;
                units "bit/s";
                config false;
                description "Inbound Drop bps.";
              }
    
              leaf out-drop-bps {
                type uint64;
                units "bit/s";
                config false;
                description "Outbound Drop bps.";
              }
    
              leaf in-car-speed {
                type uint32;
                units "kbit/s";
                config false;
                description "Inbound CAR speed.";
              }
    
              leaf out-car-speed {
                type uint32;
                units "kbit/s";
                config false;
                description
                  "Outbound CAR speed.";
              }
            }  // list query-port
          }  // container query-ports
    
          container query-traffic-policy-ports {
            config false;
            description
              "List of query traffic policy port.";
            list query-traffic-policy-port {
              key "if-name traffic-policy-name";
              description
                "Query port-mirror for multi traffic policy state.";
              leaf if-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description "Interface name.";
              }
    
              leaf traffic-policy-name {
                type string {
                  length "1..127";
                }
                description
                  "Traffic policy name.";
              }
    
              leaf type {
                type mirror-type;
                description
                  "The value 0 indicates port mirroring, and the value 1 indicates flow mirroring.";
              }
    
              leaf direction {
                type query-direction-type;
                description "Direction.";
              }
    
              leaf in-packets {
                type uint64;
                units "packet";
                description "Inbound packets.";
              }
    
              leaf out-packets {
                type uint64;
                units "packet";
                description "Outbound packets.";
              }
    
              leaf in-drop-packets {
                type uint64;
                units "packet";
                description
                  "Inbound Drop Packets.";
              }
    
              leaf out-drop-packets {
                type uint64;
                units "packet";
                description
                  "Outbound Drop Packets.";
              }
    
              leaf in-bytes {
                type uint64;
                units "Byte";
                description "Inbound bytes.";
              }
    
              leaf out-bytes {
                type uint64;
                units "Byte";
                description "Outbound bytes.";
              }
    
              leaf in-drop-bytes {
                type uint64;
                units "Byte";
                description
                  "Inbound Drop Bytes.";
              }
    
              leaf out-drop-bytes {
                type uint64;
                units "Byte";
                description
                  "Outbound Drop Bytes.";
              }
    
              leaf in-pps {
                type uint64;
                units "pps";
                description "Inbound pps.";
              }
    
              leaf out-pps {
                type uint64;
                units "pps";
                description "Outbound pps.";
              }
    
              leaf in-drop-pps {
                type uint64;
                units "pps";
                description "Inbound Drop pps.";
              }
    
              leaf out-drop-pps {
                type uint64;
                units "pps";
                description "Outbound Drop pps.";
              }
    
              leaf in-bps {
                type uint64;
                units "bit/s";
                description "Inbound bps.";
              }
    
              leaf out-bps {
                type uint64;
                units "bit/s";
                description "Outbound bps.";
              }
    
              leaf in-drop-bps {
                type uint64;
                units "bit/s";
                description "Inbound Drop bps.";
              }
    
              leaf out-drop-bps {
                type uint64;
                units "bit/s";
                description "Outbound Drop bps.";
              }
    
              leaf in-car-speed {
                type uint32;
                units "kbit/s";
                config false;
                description "Inbound CAR speed.";
              }
    
              leaf out-car-speed {
                type uint32;
                units "kbit/s";
                config false;
                description
                  "Outbound CAR speed.";
              }
            }  // list query-traffic-policy-port
          }  // container query-traffic-policy-ports
        }  // container mirror
      }  // module huawei-mirror
    

© 2023 YumaWorks, Inc. All rights reserved.