netconfcentral logo

ietf-trafficselector-types@2017-10-29



  module ietf-trafficselector-types {

    yang-version 1.1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-trafficselector-types";

    prefix traffic-selectors;

    import ietf-inet-types {
      prefix inet;
      revision-date "2013-07-15";
    }

    organization
      "IETF Distributed Mobility Management (DMM)
 Working Group";

    contact
      "WG Web: <http://tools.ietf.org/wg/netmod/>
 WG List: <mailto:netmod@ietf.org>

 WG Chair: Dapeng Liu
 <mailto:maxpassion@gmail.com>

 WG Chair: Jouni Korhonen
 <mailto:jouni.nospam@gmail.com>

 Editor: Satoru Matsushima
 <mailto:satoru.matsushima@g.softbank.co.jp>
 Editor: Lyle Bertz
 <mailto:lylebe551144@gmail.com>";

    description
      "This module contains a collection of YANG definitions for
 traffic selectors for flow bindings.

 Copyright (c) 2016 IETF Trust and the persons identified as the
 document authors. All rights reserved.

 This document is subject to BCP 78 and the IETF Trust's Legal
 Provisions Relating to IETF Documents
 (http://trustee.ietf.org/license-info) in effect on the date of
 publication of this document. Please review these documents
 carefully, as they describe your rights and restrictions with
 respect to this document. Code Components extracted from this
 document must include Simplified BSD License text as described
 in Section 4.e of the Trust Legal Provisions and are provided
 without warranty as described in the Simplified BSD License.";

    revision "2017-10-29" {
      description "Base Version";
      reference
        "RFC 6088: Traffic Selectors for Flow Bindings";

    }


    identity traffic-selector-format {
      base 
      description
        "The base type for Traffic-Selector Formats";
    }

    identity ipv4-binary-selector-format {
      base traffic-selector-format;
      description
        "IPv4 Binary Traffic Selector Format";
    }

    identity ipv6-binary-selector-format {
      base traffic-selector-format;
      description
        "IPv6 Binary Traffic Selector Format";
    }

    typedef ipsec-spi {
      type uint32;
      description
        "The first 32-bit IPsec Security Parameter Index (SPI)
      value on data. This field is defined in [RFC4303].";
      reference
        "RFC 4303: IP Encapsulating Security
        Payload (ESP)";

    }

    grouping traffic-selector-base {
      description
        "A grouping of the commen leaves between the
       v4 and v6 Traffic Selectors";
      container ipsec-spi-range {
        presence
          "Enables setting ipsec spi range";
        description
          "Inclusive range representing IPSec Security Parameter
       Indices to be used. When only start-spi is present, it
       represents a single spi.";
        leaf start-spi {
          type ipsec-spi;
          mandatory true;
          description
            "The first 32-bit IPsec SPI value on data.";
        }

        leaf end-spi {
          type ipsec-spi;
          must ". >= ../start-spi" {
            error-message
              "The end-spi must be greater than or equal
              to start-spi";
          }
          description
            "If more than one contiguous SPI value needs to be matched,
        then this field indicates the end value of a range.";
        }
      }  // container ipsec-spi-range

      container source-port-range {
        presence
          "Enables setting source port range";
        description
          "Inclusive range representing source ports to be used.
        When only start-port is present, it represents a single
     port. These value(s) are from the range of port numbers
        defined by IANA (http://www.iana.org).";
        leaf start-port {
          type inet:port-number;
          mandatory true;
          description
            "The first 16-bit source port number to be matched";
        }

        leaf end-port {
          type inet:port-number;
          must ". >= ../start-port" {
            error-message
              "The end-port must be greater than or equal to start-port";
          }
          description
            "The last 16-bit source port number to be matched";
        }
      }  // container source-port-range

      container destination-port-range {
        presence
          "Enables setting destination port range";
        description
          "Inclusive range representing destination ports to be used.
       When only start-port is present, it represents a single
       port.";
        leaf start-port {
          type inet:port-number;
          mandatory true;
          description
            "The first 16-bit destination port number to be matched";
        }

        leaf end-port {
          type inet:port-number;
          must ". >= ../start-port" {
            error-message
              "The end-port must be greater than or equal to
          start-port";
          }
          description
            "The last 16-bit destination port number to be matched";
        }
      }  // container destination-port-range
    }  // grouping traffic-selector-base

    grouping ipv4-binary-traffic-selector {
      description
        "ipv4 binary traffic selector";
      container source-address-range-v4 {
        presence
          "Enables setting source IPv4 address range";
        description
          "Inclusive range representing IPv4 addresses to be used. When
       only start-address is present, it represents a single
       address.";
        leaf start-address {
          type inet:ipv4-address;
          mandatory true;
          description
            "The first source address to be matched";
        }

        leaf end-address {
          type inet:ipv4-address;
          description
            "The last source address to be matched";
        }
      }  // container source-address-range-v4

      container destination-address-range-v4 {
        presence
          "Enables setting destination IPv4 address range";
        description
          "Inclusive range representing IPv4 addresses to be used.
        When only start-address is present, it represents a
        single address.";
        leaf start-address {
          type inet:ipv4-address;
          mandatory true;
          description
            "The first destination address to be matched";
        }

        leaf end-address {
          type inet:ipv4-address;
          description
            "The last destination address to be matched";
        }
      }  // container destination-address-range-v4

      container ds-range {
        presence
          "Enables setting dscp range";
        description
          "Inclusive range representing DiffServ Codepoints to be used.
       When only start-ds is present, it represents a single
       Codepoint.";
        leaf start-ds {
          type inet:dscp;
          mandatory true;
          description
            "The first differential service value to be matched";
        }

        leaf end-ds {
          type inet:dscp;
          must ". >= ../start-ds" {
            error-message
              "The end-ds must be greater than or equal to start-ds";
          }
          description
            "The last differential service value to be matched";
        }
      }  // container ds-range

      container protocol-range {
        presence
          "Enables setting protocol range";
        description
          "Inclusive range representing IP protocol(s) to be used. When
       only start-protocol is present, it represents a single
       protocol.";
        leaf start-protocol {
          type uint8;
          mandatory true;
          description
            "The first 8-bit protocol value to be matched.";
        }

        leaf end-protocol {
          type uint8;
          must ". >= ../start-protocol" {
            error-message
              "The end-protocol must be greater than or equal to
          start-protocol";
          }
          description
            "The last 8-bit protocol value to be matched.";
        }
      }  // container protocol-range
    }  // grouping ipv4-binary-traffic-selector

    grouping ipv6-binary-traffic-selector {
      description
        "ipv6 binary traffic selector";
      container source-address-range-v6 {
        presence
          "Enables setting source IPv6 address range";
        description
          "Inclusive range representing IPv6 addresses to be used.
       When only start-address is present, it represents a
       single address.";
        leaf start-address {
          type inet:ipv6-address;
          mandatory true;
          description
            "The first source address, from the
        range of 128-bit IPv6 addresses to be matched";
        }

        leaf end-address {
          type inet:ipv6-address;
          description
            "The last source address, from the
            range of 128-bit IPv6 addresses to be matched";
        }
      }  // container source-address-range-v6

      container destination-address-range-v6 {
        presence
          "Enables setting destination IPv6 address range";
        description
          "Inclusive range representing IPv6 addresses to be used.
        When only start-address is present, it represents a
        single address.";
        leaf start-address {
          type inet:ipv6-address;
          mandatory true;
          description
            "The first destination address, from the
           range of 128-bit IPv6 addresses to be matched";
        }

        leaf end-address {
          type inet:ipv6-address;
          description
            "The last destination address, from the
           range of 128-bit IPv6 addresses to be matched";
        }
      }  // container destination-address-range-v6

      container flow-label-range {
        presence
          "Enables setting Flow Label range";
        description
          "Inclusive range representing IPv4 addresses to be used. When
       only start-flow-label is present, it represents a single
       flow label.";
        leaf start-flow-label {
          type inet:ipv6-flow-label;
          description
            "The first flow label value to be matched";
        }

        leaf end-flow-label {
          type inet:ipv6-flow-label;
          must ". >= ../start-flow-label" {
            error-message
              "The end-flow-lable must be greater than or equal to
           start-flow-label";
          }
          description
            "The first flow label value to be matched";
        }
      }  // container flow-label-range

      container traffic-class-range {
        presence
          "Enables setting the traffic class range";
        description
          "Inclusive range representing IPv4 addresses to be used. When
      only start-traffic-class is present, it represents a single
      traffic class.";
        leaf start-traffic-class {
          type inet:dscp;
          description
            "The first traffic class value to be matched";
          reference
            "RFC 3260: New Terminology and Clarifications for Diffserv
             RFC 3168: The Addition of Explicit Congestion Notification
            (ECN) to IP";

        }

        leaf end-traffic-class {
          type inet:dscp;
          must ". >= ../start-traffic-class" {
            error-message
              "The end-traffic-class must be greater than or equal to
           start-traffic-class";
          }
          description
            "The last traffic class value to be matched";
        }
      }  // container traffic-class-range

      container next-header-range {
        presence
          "Enables setting Next Header range";
        description
          "Inclusive range representing Next Headers to be used. When
      only start-next-header is present, it represents a
      single Next Header.";
        leaf start-next-header {
          type uint8;
          description
            "The first 8-bit next header value to be matched.";
        }

        leaf end-next-header {
          type uint8;
          must ". >= ../start-next-header" {
            error-message
              "The end-next-header must be greater than or equal to
          start-next-header";
          }
          description
            "The last 8-bit next header value to be matched.";
        }
      }  // container next-header-range
    }  // grouping ipv6-binary-traffic-selector

    grouping traffic-selector {
      description
        "The traffic selector includes the parameters used to match
       packets for a specific flow binding.";
      reference
        "RFC 6089: Flow Bindings in Mobile IPv6 and Network
         Mobility (NEMO) Basic Support";

      leaf ts-format {
        type identityref {
          base traffic-selector-format;
        }
        description
          "Traffic Selector Format";
      }

      uses traffic-selector-base;

      uses ipv4-binary-traffic-selector;

      uses ipv6-binary-traffic-selector;
    }  // grouping traffic-selector

    grouping ts-list {
      description "traffic selector list";
      list selectors {
        key "index";
        description "traffic selectors";
        leaf index {
          type uint64;
          description "index";
        }

        uses traffic-selector;
      }  // list selectors
    }  // grouping ts-list
  }  // module ietf-trafficselector-types