Cisco-IOS-XR-um-monitor-session-cfg

This module contains a collection of YANG definitions for Cisco IOS-XR monitor-session package configuration. This YANG module ...

  • Version: 2021-03-03

    Cisco-IOS-XR-um-monitor-session-cfg@2021-03-03


    
      module Cisco-IOS-XR-um-monitor-session-cfg {
    
        yang-version 1;
    
        namespace
          "http://cisco.com/ns/yang/Cisco-IOS-XR-um-monitor-session-cfg";
    
        prefix um-monitor-session-cfg;
    
        import Cisco-IOS-XR-types {
          prefix xr;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import Cisco-IOS-XR-um-interface-cfg {
          prefix a1;
        }
        import Cisco-IOS-XR-um-if-l2transport-cfg {
          prefix a2;
        }
        import cisco-semver {
          prefix semver;
        }
    
        organization "Cisco Systems, Inc.";
    
        contact
          "Cisco Systems, Inc.
         Customer Service
         
         Postal: 170 West Tasman Drive
         San Jose, CA 95134
         
         Tel: +1 800 553-NETS
         
         E-mail: cs-yang@cisco.com";
    
        description
          "This module contains a collection of YANG definitions
         for Cisco IOS-XR monitor-session package configuration.
         
         This YANG module augments the
         modules with configuration data.
         
         Copyright (c) 2021 by Cisco Systems, Inc.
         All rights reserved.";
    
        revision "2021-03-03" {
          description "Initial release";
        }
    
        semver:module-version "1.0.0";
    
        grouping IF-BODY {
          container monitor-sessions {
            description
              "Monitor-session configuration commands";
            list monitor-session {
              must
                "ethernet or ipv4 or ipv6 or mpls-ipv4 or mpls-ipv6";
              key "session-name";
              description
                "Monitor-session configuration commands";
              leaf session-name {
                type string {
                  length "1..79";
                }
                description
                  "Monitor-session configuration commands";
              }
    
              container ethernet {
                must
                  "not(../ipv4 or ../ipv6 or ../mpls-ipv4 or ../mpls-ipv6)";
                presence
                  "Indicates a ethernet node is configured.";
                description
                  "Replicate Ethernet traffic";
              }  // container ethernet
    
              container ipv4 {
                must
                  "not(../ethernet or ../ipv6 or ../mpls-ipv4 or ../mpls-ipv6)";
                presence
                  "Indicates a ipv4 node is configured.";
                description
                  "Replicate IPv4 traffic";
              }  // container ipv4
    
              container ipv6 {
                must
                  "not(../ipv4 or ../ethernet or ../mpls-ipv4 or ../mpls-ipv6)";
                presence
                  "Indicates a ipv6 node is configured.";
                description
                  "Replicate IPv6 traffic";
              }  // container ipv6
    
              container mpls-ipv4 {
                must
                  "not(../ipv4 or ../ipv6 or ../ethernet or ../mpls-ipv6)";
                presence
                  "Indicates a mpls-ipv4 node is configured.";
                description
                  "Replicate MPLS-IPv4 traffic";
              }  // container mpls-ipv4
    
              container mpls-ipv6 {
                must
                  "not(../ipv4 or ../ipv6 or ../mpls-ipv4 or ../ethernet)";
                presence
                  "Indicates a mpls-ipv6 node is configured.";
                description
                  "Replicate MPLS-IPv6 traffic";
              }  // container mpls-ipv6
    
              container direction {
                description
                  "Specify the direction of traffic to replicate";
                container rx-only {
                  must "not(../tx-only)";
                  presence
                    "Indicates a rx-only node is configured.";
                  description
                    "Replicate only received (ingress) traffic";
                }  // container rx-only
    
                container tx-only {
                  must "not(../rx-only)";
                  presence
                    "Indicates a tx-only node is configured.";
                  description
                    "Replicate only transmitted (egress) traffic";
                }  // container tx-only
              }  // container direction
    
              container port-level {
                presence
                  "Indicates a port-level node is configured.";
                description
                  "Replicate traffic on all interfaces of a main interface";
              }  // container port-level
    
              container acl {
                presence
                  "Indicates a acl node is configured.";
                description
                  "Enable acl based mirroring";
                leaf acl-name {
                  type xr:Cisco-ios-xr-string {
                    length "1..80";
                  }
                  description "ACL name";
                }
              }  // container acl
    
              leaf acl-ipv4 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv4 ACL based mirroring";
              }
    
              leaf acl-ipv6 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv6 ACL based mirroring";
              }
    
              container mirror {
                description
                  "Set the mirroring properties of this interface";
                leaf first {
                  type uint32 {
                    range "1..10000";
                  }
                  description
                    "Enable mirroring on the first portion of a packet";
                }
    
                leaf interval {
                  type enumeration {
                    enum "512" {
                      value 1;
                      description
                        "Mirror 1 in every 512 packets";
                    }
                    enum "1K" {
                      value 2;
                      description
                        "Mirror 1 in every 1024 packets";
                    }
                    enum "2K" {
                      value 3;
                      description
                        "Mirror 1 in every 2048 packets";
                    }
                    enum "4K" {
                      value 4;
                      description
                        "Mirror 1 in every 4096 packets";
                    }
                    enum "8K" {
                      value 5;
                      description
                        "Mirror 1 in every 8192 packets";
                    }
                    enum "16K" {
                      value 6;
                      description
                        "Mirror 1 in every 16384 packets";
                    }
                  }
                  description
                    "Enable mirroring of every Nth packet";
                }
              }  // container mirror
            }  // list monitor-session
          }  // container monitor-sessions
    
          container monitor-session-deprecated {
            description
              "Monitor-session deprecated configuration commands";
            container ethernet {
              presence
                "Indicates a ethernet node is configured.";
              description
                "Replicate Ethernet traffic";
              leaf session-name {
                type xr:Cisco-ios-xr-string {
                  length "1..79";
                }
                mandatory true;
                description "Session Name";
              }
    
              container direction {
                description
                  "Specify the direction of traffic to replicate";
                container rx-only {
                  must "not(../tx-only)";
                  presence
                    "Indicates a rx-only node is configured.";
                  description
                    "Replicate only received (ingress) traffic";
                }  // container rx-only
    
                container tx-only {
                  must "not(../rx-only)";
                  presence
                    "Indicates a tx-only node is configured.";
                  description
                    "Replicate only transmitted (egress) traffic";
                }  // container tx-only
              }  // container direction
    
              container acl {
                presence
                  "Indicates a acl node is configured.";
                description
                  "Enable acl based mirroring";
                leaf acl-name {
                  type xr:Cisco-ios-xr-string {
                    length "1..80";
                  }
                  description "ACL name";
                }
              }  // container acl
    
              leaf acl-ipv4 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv4 ACL based mirroring";
              }
    
              leaf acl-ipv6 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv6 ACL based mirroring";
              }
    
              container mirror {
                description
                  "Set the mirroring properties of this interface";
                leaf first {
                  type uint32 {
                    range "1..10000";
                  }
                  description
                    "Enable mirroring on the first portion of a packet";
                }
    
                leaf interval {
                  type enumeration {
                    enum "512" {
                      value 1;
                      description
                        "Mirror 1 in every 512 packets";
                    }
                    enum "1K" {
                      value 2;
                      description
                        "Mirror 1 in every 1024 packets";
                    }
                    enum "2K" {
                      value 3;
                      description
                        "Mirror 1 in every 2048 packets";
                    }
                    enum "4K" {
                      value 4;
                      description
                        "Mirror 1 in every 4096 packets";
                    }
                    enum "8K" {
                      value 5;
                      description
                        "Mirror 1 in every 8192 packets";
                    }
                    enum "16K" {
                      value 6;
                      description
                        "Mirror 1 in every 16384 packets";
                    }
                  }
                  description
                    "Enable mirroring of every Nth packet";
                }
              }  // container mirror
    
              container port-level {
                presence
                  "Indicates a port-level node is configured.";
                description
                  "Replicate traffic on all interfaces of a main interface";
              }  // container port-level
            }  // container ethernet
    
            container ipv4 {
              presence
                "Indicates a ipv4 node is configured.";
              description
                "Replicate IPv4 traffic";
              leaf session-name {
                type xr:Cisco-ios-xr-string {
                  length "1..79";
                }
                mandatory true;
                description "Session Name";
              }
    
              container direction {
                description
                  "Specify the direction of traffic to replicate";
                container rx-only {
                  must "not(../tx-only)";
                  presence
                    "Indicates a rx-only node is configured.";
                  description
                    "Replicate only received (ingress) traffic";
                }  // container rx-only
    
                container tx-only {
                  must "not(../rx-only)";
                  presence
                    "Indicates a tx-only node is configured.";
                  description
                    "Replicate only transmitted (egress) traffic";
                }  // container tx-only
              }  // container direction
    
              container acl {
                presence
                  "Indicates a acl node is configured.";
                description
                  "Enable acl based mirroring";
                leaf acl-name {
                  type xr:Cisco-ios-xr-string {
                    length "1..80";
                  }
                  description "ACL name";
                }
              }  // container acl
    
              leaf acl-ipv4 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv4 ACL based mirroring";
              }
    
              leaf acl-ipv6 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv6 ACL based mirroring";
              }
    
              container mirror {
                description
                  "Set the mirroring properties of this interface";
                leaf first {
                  type uint32 {
                    range "1..10000";
                  }
                  description
                    "Enable mirroring on the first portion of a packet";
                }
    
                leaf interval {
                  type enumeration {
                    enum "512" {
                      value 1;
                      description
                        "Mirror 1 in every 512 packets";
                    }
                    enum "1K" {
                      value 2;
                      description
                        "Mirror 1 in every 1024 packets";
                    }
                    enum "2K" {
                      value 3;
                      description
                        "Mirror 1 in every 2048 packets";
                    }
                    enum "4K" {
                      value 4;
                      description
                        "Mirror 1 in every 4096 packets";
                    }
                    enum "8K" {
                      value 5;
                      description
                        "Mirror 1 in every 8192 packets";
                    }
                    enum "16K" {
                      value 6;
                      description
                        "Mirror 1 in every 16384 packets";
                    }
                  }
                  description
                    "Enable mirroring of every Nth packet";
                }
              }  // container mirror
    
              container port-level {
                presence
                  "Indicates a port-level node is configured.";
                description
                  "Replicate traffic on all interfaces of a main interface";
              }  // container port-level
            }  // container ipv4
    
            container ipv6 {
              presence
                "Indicates a ipv6 node is configured.";
              description
                "Replicate IPv6 traffic";
              leaf session-name {
                type xr:Cisco-ios-xr-string {
                  length "1..79";
                }
                mandatory true;
                description "Session Name";
              }
    
              container direction {
                description
                  "Specify the direction of traffic to replicate";
                container rx-only {
                  must "not(../tx-only)";
                  presence
                    "Indicates a rx-only node is configured.";
                  description
                    "Replicate only received (ingress) traffic";
                }  // container rx-only
    
                container tx-only {
                  must "not(../rx-only)";
                  presence
                    "Indicates a tx-only node is configured.";
                  description
                    "Replicate only transmitted (egress) traffic";
                }  // container tx-only
              }  // container direction
    
              container acl {
                presence
                  "Indicates a acl node is configured.";
                description
                  "Enable acl based mirroring";
                leaf acl-name {
                  type xr:Cisco-ios-xr-string {
                    length "1..80";
                  }
                  description "ACL name";
                }
              }  // container acl
    
              leaf acl-ipv4 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv4 ACL based mirroring";
              }
    
              leaf acl-ipv6 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv6 ACL based mirroring";
              }
    
              container mirror {
                description
                  "Set the mirroring properties of this interface";
                leaf first {
                  type uint32 {
                    range "1..10000";
                  }
                  description
                    "Enable mirroring on the first portion of a packet";
                }
    
                leaf interval {
                  type enumeration {
                    enum "512" {
                      value 1;
                      description
                        "Mirror 1 in every 512 packets";
                    }
                    enum "1K" {
                      value 2;
                      description
                        "Mirror 1 in every 1024 packets";
                    }
                    enum "2K" {
                      value 3;
                      description
                        "Mirror 1 in every 2048 packets";
                    }
                    enum "4K" {
                      value 4;
                      description
                        "Mirror 1 in every 4096 packets";
                    }
                    enum "8K" {
                      value 5;
                      description
                        "Mirror 1 in every 8192 packets";
                    }
                    enum "16K" {
                      value 6;
                      description
                        "Mirror 1 in every 16384 packets";
                    }
                  }
                  description
                    "Enable mirroring of every Nth packet";
                }
              }  // container mirror
    
              container port-level {
                presence
                  "Indicates a port-level node is configured.";
                description
                  "Replicate traffic on all interfaces of a main interface";
              }  // container port-level
            }  // container ipv6
    
            container mpls-ipv4 {
              presence
                "Indicates a mpls-ipv4 node is configured.";
              description
                "Replicate MPLS-IPv4 traffic";
              leaf session-name {
                type xr:Cisco-ios-xr-string {
                  length "1..79";
                }
                mandatory true;
                description "Session Name";
              }
    
              container direction {
                description
                  "Specify the direction of traffic to replicate";
                container rx-only {
                  must "not(../tx-only)";
                  presence
                    "Indicates a rx-only node is configured.";
                  description
                    "Replicate only received (ingress) traffic";
                }  // container rx-only
    
                container tx-only {
                  must "not(../rx-only)";
                  presence
                    "Indicates a tx-only node is configured.";
                  description
                    "Replicate only transmitted (egress) traffic";
                }  // container tx-only
              }  // container direction
    
              container acl {
                presence
                  "Indicates a acl node is configured.";
                description
                  "Enable acl based mirroring";
                leaf acl-name {
                  type xr:Cisco-ios-xr-string {
                    length "1..80";
                  }
                  description "ACL name";
                }
              }  // container acl
    
              leaf acl-ipv4 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv4 ACL based mirroring";
              }
    
              leaf acl-ipv6 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv6 ACL based mirroring";
              }
    
              container mirror {
                description
                  "Set the mirroring properties of this interface";
                leaf first {
                  type uint32 {
                    range "1..10000";
                  }
                  description
                    "Enable mirroring on the first portion of a packet";
                }
    
                leaf interval {
                  type enumeration {
                    enum "512" {
                      value 1;
                      description
                        "Mirror 1 in every 512 packets";
                    }
                    enum "1K" {
                      value 2;
                      description
                        "Mirror 1 in every 1024 packets";
                    }
                    enum "2K" {
                      value 3;
                      description
                        "Mirror 1 in every 2048 packets";
                    }
                    enum "4K" {
                      value 4;
                      description
                        "Mirror 1 in every 4096 packets";
                    }
                    enum "8K" {
                      value 5;
                      description
                        "Mirror 1 in every 8192 packets";
                    }
                    enum "16K" {
                      value 6;
                      description
                        "Mirror 1 in every 16384 packets";
                    }
                  }
                  description
                    "Enable mirroring of every Nth packet";
                }
              }  // container mirror
    
              container port-level {
                presence
                  "Indicates a port-level node is configured.";
                description
                  "Replicate traffic on all interfaces of a main interface";
              }  // container port-level
            }  // container mpls-ipv4
    
            container mpls-ipv6 {
              presence
                "Indicates a mpls-ipv6 node is configured.";
              description
                "Replicate MPLS-IPv6 traffic";
              leaf session-name {
                type xr:Cisco-ios-xr-string {
                  length "1..79";
                }
                mandatory true;
                description "Session Name";
              }
    
              container direction {
                description
                  "Specify the direction of traffic to replicate";
                container rx-only {
                  must "not(../tx-only)";
                  presence
                    "Indicates a rx-only node is configured.";
                  description
                    "Replicate only received (ingress) traffic";
                }  // container rx-only
    
                container tx-only {
                  must "not(../rx-only)";
                  presence
                    "Indicates a tx-only node is configured.";
                  description
                    "Replicate only transmitted (egress) traffic";
                }  // container tx-only
              }  // container direction
    
              container acl {
                presence
                  "Indicates a acl node is configured.";
                description
                  "Enable acl based mirroring";
                leaf acl-name {
                  type xr:Cisco-ios-xr-string {
                    length "1..80";
                  }
                  description "ACL name";
                }
              }  // container acl
    
              leaf acl-ipv4 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv4 ACL based mirroring";
              }
    
              leaf acl-ipv6 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv6 ACL based mirroring";
              }
    
              container mirror {
                description
                  "Set the mirroring properties of this interface";
                leaf first {
                  type uint32 {
                    range "1..10000";
                  }
                  description
                    "Enable mirroring on the first portion of a packet";
                }
    
                leaf interval {
                  type enumeration {
                    enum "512" {
                      value 1;
                      description
                        "Mirror 1 in every 512 packets";
                    }
                    enum "1K" {
                      value 2;
                      description
                        "Mirror 1 in every 1024 packets";
                    }
                    enum "2K" {
                      value 3;
                      description
                        "Mirror 1 in every 2048 packets";
                    }
                    enum "4K" {
                      value 4;
                      description
                        "Mirror 1 in every 4096 packets";
                    }
                    enum "8K" {
                      value 5;
                      description
                        "Mirror 1 in every 8192 packets";
                    }
                    enum "16K" {
                      value 6;
                      description
                        "Mirror 1 in every 16384 packets";
                    }
                  }
                  description
                    "Enable mirroring of every Nth packet";
                }
              }  // container mirror
    
              container port-level {
                presence
                  "Indicates a port-level node is configured.";
                description
                  "Replicate traffic on all interfaces of a main interface";
              }  // container port-level
            }  // container mpls-ipv6
          }  // container monitor-session-deprecated
        }  // grouping IF-BODY
    
        grouping L2TRANS-BODY {
          container monitor-sessions {
            description
              "Monitor-session configuration commands";
            list monitor-session {
              must
                "ethernet or ipv4 or ipv6 or mpls-ipv4 or mpls-ipv6";
              key "session-name";
              description
                "Monitor-session configuration commands";
              leaf session-name {
                type string {
                  length "1..79";
                }
                description
                  "Monitor-session configuration commands";
              }
    
              container ethernet {
                must
                  "not(../ipv4 or ../ipv6 or ../mpls-ipv4 or ../mpls-ipv6)";
                presence
                  "Indicates a ethernet node is configured.";
                description
                  "Replicate Ethernet traffic";
              }  // container ethernet
    
              container ipv4 {
                must
                  "not(../ethernet or ../ipv6 or ../mpls-ipv4 or ../mpls-ipv6)";
                presence
                  "Indicates a ipv4 node is configured.";
                description
                  "Replicate IPv4 traffic";
              }  // container ipv4
    
              container ipv6 {
                must
                  "not(../ipv4 or ../ethernet or ../mpls-ipv4 or ../mpls-ipv6)";
                presence
                  "Indicates a ipv6 node is configured.";
                description
                  "Replicate IPv6 traffic";
              }  // container ipv6
    
              container mpls-ipv4 {
                must
                  "not(../ipv4 or ../ipv6 or ../ethernet or ../mpls-ipv6)";
                presence
                  "Indicates a mpls-ipv4 node is configured.";
                description
                  "Replicate MPLS-IPv4 traffic";
              }  // container mpls-ipv4
    
              container mpls-ipv6 {
                must
                  "not(../ipv4 or ../ipv6 or ../mpls-ipv4 or ../ethernet)";
                presence
                  "Indicates a mpls-ipv6 node is configured.";
                description
                  "Replicate MPLS-IPv6 traffic";
              }  // container mpls-ipv6
    
              container direction {
                description
                  "Specify the direction of traffic to replicate";
                container rx-only {
                  must "not(../tx-only)";
                  presence
                    "Indicates a rx-only node is configured.";
                  description
                    "Replicate only received (ingress) traffic";
                }  // container rx-only
    
                container tx-only {
                  must "not(../rx-only)";
                  presence
                    "Indicates a tx-only node is configured.";
                  description
                    "Replicate only transmitted (egress) traffic";
                }  // container tx-only
              }  // container direction
    
              container port-level {
                presence
                  "Indicates a port-level node is configured.";
                description
                  "Replicate traffic on all interfaces of a main interface";
              }  // container port-level
    
              container acl {
                presence
                  "Indicates a acl node is configured.";
                description
                  "Enable acl based mirroring";
                leaf acl-name {
                  type xr:Cisco-ios-xr-string {
                    length "1..80";
                  }
                  description "ACL name";
                }
              }  // container acl
    
              leaf acl-ipv4 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv4 ACL based mirroring";
              }
    
              leaf acl-ipv6 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv6 ACL based mirroring";
              }
    
              container mirror {
                description
                  "Set the mirroring properties of this interface";
                leaf first {
                  type uint32 {
                    range "1..10000";
                  }
                  description
                    "Enable mirroring on the first portion of a packet";
                }
    
                leaf interval {
                  type enumeration {
                    enum "512" {
                      value 1;
                      description
                        "Mirror 1 in every 512 packets";
                    }
                    enum "1K" {
                      value 2;
                      description
                        "Mirror 1 in every 1024 packets";
                    }
                    enum "2K" {
                      value 3;
                      description
                        "Mirror 1 in every 2048 packets";
                    }
                    enum "4K" {
                      value 4;
                      description
                        "Mirror 1 in every 4096 packets";
                    }
                    enum "8K" {
                      value 5;
                      description
                        "Mirror 1 in every 8192 packets";
                    }
                    enum "16K" {
                      value 6;
                      description
                        "Mirror 1 in every 16384 packets";
                    }
                  }
                  description
                    "Enable mirroring of every Nth packet";
                }
              }  // container mirror
            }  // list monitor-session
          }  // container monitor-sessions
    
          container monitor-session-deprecated {
            description
              "Monitor-session deprecated configuration commands";
            container ethernet {
              presence
                "Indicates a ethernet node is configured.";
              description
                "Replicate Ethernet traffic";
              leaf session-name {
                type xr:Cisco-ios-xr-string {
                  length "1..79";
                }
                mandatory true;
                description "Session Name";
              }
    
              container direction {
                description
                  "Specify the direction of traffic to replicate";
                container rx-only {
                  must "not(../tx-only)";
                  presence
                    "Indicates a rx-only node is configured.";
                  description
                    "Replicate only received (ingress) traffic";
                }  // container rx-only
    
                container tx-only {
                  must "not(../rx-only)";
                  presence
                    "Indicates a tx-only node is configured.";
                  description
                    "Replicate only transmitted (egress) traffic";
                }  // container tx-only
              }  // container direction
    
              container acl {
                presence
                  "Indicates a acl node is configured.";
                description
                  "Enable acl based mirroring";
                leaf acl-name {
                  type xr:Cisco-ios-xr-string {
                    length "1..80";
                  }
                  description "ACL name";
                }
              }  // container acl
    
              leaf acl-ipv4 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv4 ACL based mirroring";
              }
    
              leaf acl-ipv6 {
                type xr:Cisco-ios-xr-string {
                  length "1..80";
                }
                description
                  "Enable IPv6 ACL based mirroring";
              }
    
              container mirror {
                description
                  "Set the mirroring properties of this interface";
                leaf first {
                  type uint32 {
                    range "1..10000";
                  }
                  description
                    "Enable mirroring on the first portion of a packet";
                }
    
                leaf interval {
                  type enumeration {
                    enum "512" {
                      value 1;
                      description
                        "Mirror 1 in every 512 packets";
                    }
                    enum "1K" {
                      value 2;
                      description
                        "Mirror 1 in every 1024 packets";
                    }
                    enum "2K" {
                      value 3;
                      description
                        "Mirror 1 in every 2048 packets";
                    }
                    enum "4K" {
                      value 4;
                      description
                        "Mirror 1 in every 4096 packets";
                    }
                    enum "8K" {
                      value 5;
                      description
                        "Mirror 1 in every 8192 packets";
                    }
                    enum "16K" {
                      value 6;
                      description
                        "Mirror 1 in every 16384 packets";
                    }
                  }
                  description
                    "Enable mirroring of every Nth packet";
                }
              }  // container mirror
    
              container port-level {
                presence
                  "Indicates a port-level node is configured.";
                description
                  "Replicate traffic on all interfaces of a main interface";
              }  // container port-level
            }  // container ethernet
          }  // container monitor-session-deprecated
        }  // grouping L2TRANS-BODY
    
        augment /a1:interfaces/a1:interface {
          uses IF-BODY;
        }
    
        augment /a1:interfaces/a1:interface-preconfigure {
          uses IF-BODY;
        }
    
        augment /a1:interfaces/a1:interface/a2:l2transport {
          uses L2TRANS-BODY;
        }
    
        augment /a1:interfaces/a1:interface-preconfigure/a2:l2transport {
          uses L2TRANS-BODY;
        }
    
        container monitor-sessions {
          description
            "Monitor-session configuration commands";
          list monitor-session {
            key "session-name";
            description
              "Monitor-session configuration commands";
            leaf session-name {
              type string {
                length "1..79";
              }
              description
                "Monitor-session configuration commands";
            }
    
            leaf traffic-type {
              type enumeration {
                enum "ethernet" {
                  value 0;
                  description
                    "Replicate Ethernet traffic";
                }
                enum "ipv4" {
                  value 1;
                  description
                    "Replicate IPv4 traffic";
                }
                enum "ipv6" {
                  value 2;
                  description
                    "Replicate IPv6 traffic";
                }
                enum "mpls-ipv4" {
                  value 3;
                  description
                    "Replicate MPLS-IPv4 traffic";
                }
                enum "mpls-ipv6" {
                  value 4;
                  description
                    "Replicate MPLS-IPv6 traffic";
                }
              }
              mandatory true;
              description
                "Type of traffic to replicate";
            }
    
            container destination {
              description
                "Specify the destination that traffic should be replicated to";
              leaf interface {
                when
                  "../../traffic-type = 'ethernet' or ../../traffic-type = 'mpls-ipv4'
                 or ../../traffic-type = 'mpls-ipv6'";
                type xr:Interface-name;
                must
                  "not(../pseudowire or ../next-hop/ipv4-address
                 or ../next-hop/ipv6-address or ../file or ../udp)";
                description
                  "Specify a destination interface";
              }
    
              container pseudowire {
                when
                  "../../traffic-type = 'ethernet'";
                must
                  "not(../interface or ../next-hop/ipv4-address
                 or ../next-hop/ipv6-address or ../file or ../udp)";
                presence
                  "Indicates a pseudowire node is configured.";
                description
                  "Specify a pseudowire";
              }  // container pseudowire
    
              container next-hop {
                description
                  "Specify a destination next-hop IP address";
                leaf ipv4-address {
                  when
                    "../../../traffic-type = 'ethernet'
                   or ../../../traffic-type = 'ipv4'";
                  type inet:ipv4-address-no-zone;
                  must
                    "not(../../interface or ../../pseudowire
                   or ../../file or ../../udp)";
                  description
                    "Specify the destination next-hop IPv4 address";
                }
    
                leaf ipv6-address {
                  when
                    "../../../traffic-type = 'ethernet'
                   or ../../../traffic-type = 'ipv6'";
                  type inet:ipv6-address-no-zone;
                  must
                    "not(../../interface or ../../pseudowire
                   or ../../file or ../../udp)";
                  description
                    "Specify the destination next-hop IPv6 address";
                }
              }  // container next-hop
    
              container udp {
                must
                  "not(../interface or ../pseudowire or ../next-hop/ipv4-address
                   or ../next-hop/ipv6-address or ../file)
                   and (ipv4 or ipv6)";
                presence
                  "Indicates a udp node is configured.";
                description
                  "Specify a UDP destination";
                leaf ipv4 {
                  type inet:ipv4-address-no-zone;
                  must
                    "not(../ipv6) and ../ipv4-source-ip";
                  description
                    "Specify an IPv4 address";
                }
    
                leaf ipv6 {
                  type inet:ipv6-address-no-zone;
                  must
                    "not(../ipv4) and ../ipv6-source-ip";
                  description
                    "Specify an IPv6 address";
                }
    
                leaf port {
                  type uint32 {
                    range "0..65535";
                  }
                  mandatory true;
                  description
                    "Specify the destination port number";
                }
    
                leaf ipv4-source-ip {
                  type inet:ipv4-address-no-zone;
                  must "../ipv4";
                  description
                    "Specify the source IPv4 address";
                }
    
                leaf ipv6-source-ip {
                  type inet:ipv6-address-no-zone;
                  must "../ipv6";
                  description
                    "Specify the source IPv6 address";
                }
    
                leaf source-port {
                  type uint32 {
                    range "0..65535";
                  }
                  mandatory true;
                  description
                    "Specify the source port";
                }
    
                leaf vrf {
                  type xr:Cisco-ios-xr-string {
                    length "1..32";
                  }
                  description
                    "Specify the vrf name";
                }
              }  // container udp
    
              container file {
                must
                  "not(../interface or ../next-hop/ipv4-address
                 or ../next-hop/ipv6-address or ../pseudowire
                 or ../udp)";
                presence
                  "Indicates a file node is configured.";
                description
                  "Specify destination as a file";
                leaf size {
                  type uint32 {
                    range "1..16777216";
                  }
                  description
                    "Specify the packet buffer size";
                }
    
                container buffer-type {
                  description
                    "Specify the buffer type";
                  container linear {
                    presence
                      "Indicates a linear node is configured.";
                    description
                      "Specify a linear buffer";
                  }  // container linear
                }  // container buffer-type
    
                container format {
                  description
                    "Specify the file output file format";
                  container pcapng {
                    presence
                      "Indicates a pcapng node is configured.";
                    description
                      "Specify pcapng format";
                  }  // container pcapng
                }  // container format
    
                leaf filter {
                  type string {
                    length "1..800";
                  }
                  description
                    "Specify a pcap filter to apply - not yet supported";
                }
              }  // container file
            }  // container destination
    
            container rx {
              description
                "Specify the destination that rx traffic should be replicated to";
              leaf interface {
                when
                  "../../traffic-type = 'ethernet' or ../../traffic-type = 'mpls-ipv4'
                 or ../../traffic-type = 'mpls-ipv6'";
                type xr:Interface-name;
                must
                  "not(../pseudowire or ../next-hop/ipv4-address
                 or ../next-hop/ipv6-address)";
                description
                  "Specify a destination interface";
              }
    
              container pseudowire {
                when
                  "../../traffic-type = 'ethernet'";
                must
                  "not(../interface or ../next-hop/ipv4-address
                 or ../next-hop/ipv6-address)";
                presence
                  "Indicates a pseudowire node is configured.";
                description
                  "Specify a pseudowire";
              }  // container pseudowire
    
              container next-hop {
                description
                  "Specify a destination next-hop IP address";
                leaf ipv4-address {
                  when
                    "../../../traffic-type = 'ethernet'
                   or ../../../traffic-type = 'ipv4'";
                  type inet:ipv4-address-no-zone;
                  must
                    "not(../../interface or ../../pseudowire)";
                  description
                    "Specify the destination next-hop IPv4 address";
                }
    
                leaf ipv6-address {
                  when
                    "../../../traffic-type = 'ethernet'
                   or ../../../traffic-type = 'ipv6'";
                  type inet:ipv6-address-no-zone;
                  must
                    "not(../../interface or ../../pseudowire)";
                  description
                    "Specify the destination next-hop IPv6 address";
                }
              }  // container next-hop
            }  // container rx
    
            container tx {
              description
                "Specify the destination that tx traffic should be replicated to";
              leaf interface {
                when
                  "../../traffic-type = 'ethernet' or ../../traffic-type = 'mpls-ipv4'
                 or ../../traffic-type = 'mpls-ipv6'";
                type xr:Interface-name;
                must
                  "not(../pseudowire or ../next-hop/ipv4-address
                 or ../next-hop/ipv6-address)";
                description
                  "Specify a destination interface";
              }
    
              container pseudowire {
                when
                  "../../traffic-type = 'ethernet'";
                must
                  "not(../interface or ../next-hop/ipv4-address
                 or ../next-hop/ipv6-address)";
                presence
                  "Indicates a pseudowire node is configured.";
                description
                  "Specify a pseudowire";
              }  // container pseudowire
    
              container next-hop {
                description
                  "Specify a destination next-hop IP address";
                leaf ipv4-address {
                  when
                    "../../../traffic-type = 'ethernet'
                   or ../../../traffic-type = 'ipv4'";
                  type inet:ipv4-address-no-zone;
                  must
                    "not(../../interface or ../../pseudowire)";
                  description
                    "Specify the destination next-hop IPv4 address";
                }
    
                leaf ipv6-address {
                  when
                    "../../../traffic-type = 'ethernet'
                   or ../../../traffic-type = 'ipv6'";
                  type inet:ipv6-address-no-zone;
                  must
                    "not(../../interface or ../../pseudowire)";
                  description
                    "Specify the destination next-hop IPv6 address";
                }
              }  // container next-hop
            }  // container tx
    
            leaf inject-interface {
              type xr:Interface-name;
              description
                "Specify the attachment interface into which traffic may be injected from the SPAN session's destination";
            }
    
            container cloud-span {
              presence
                "Indicates a cloud-span node is configured.";
              description
                "Configure CloudSPAN on this session";
            }  // container cloud-span
    
            leaf discard-class {
              type uint32 {
                range "0..2";
              }
              description
                "Specify the discard class value to be set on all traffic mirrored to the destination";
            }
    
            leaf traffic-class {
              type uint32 {
                range "0..7";
              }
              description
                "Specify the traffic class value to be set on all traffic mirrored to the destination";
            }
          }  // list monitor-session
        }  // container monitor-sessions
      }  // module Cisco-IOS-XR-um-monitor-session-cfg
    

© 2023 YumaWorks, Inc. All rights reserved.