netconfcentral logo

ietf-packet-fields@2015-06-11



  module ietf-packet-fields {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-packet-fields";

    prefix packet-fields;

    import ietf-inet-types {
      prefix inet;
    }
    import ietf-yang-types {
      prefix yang;
    }

    organization
      "IETF NETMOD (NETCONF Data Modeling Language) Working
                Group";

    contact
      "WG Web: http://tools.ietf.org/wg/netmod/
    WG List: netmod@ietf.org
    WG Chair: Juergen Schoenwaelder
    j.schoenwaelder@jacobs-university.de
    WG Chair: Tom Nadeau
    tnadeau@lucidvision.com
    Editor: Dean Bogdanovic
    deanb@juniper.net
    Editor: Kiran Agrahara Sreenivasa
    kkoushik@brocade.com
    Editor: Lisa Huang
    lyihuang@juniper.net
    Editor: Dana Blair
    dblair@cisco.com";

    description
      "This YANG module defines groupings that are used by
    ietf-access-control-list YANG module. Their usage is not
    limited to ietf-access-control-list and can be
    used anywhere as applicable.
    Copyright (c) 2015 IETF Trust and the persons identified as
    the document authors.  All rights reserved.
    Redistribution and use in source and binary forms, with or
    without modification, is permitted pursuant to, and subject
    to the license terms contained in, the Simplified BSD
    License set forth in Section 4.c of the IETF Trust's Legal
    Provisions Relating to IETF Documents
    (http://trustee.ietf.org/license-info).
    This version of this YANG module is part of RFC XXXX; see
    the RFC itself for full legal notices.";

    revision "2015-06-11" {
      description
        "Initial version of packet fields used by
      ietf-access-control-list";
      reference
        "RFC XXXX: Network Access Control List (ACL)
        YANG Data  Model";

    }


    grouping acl-transport-header-fields {
      description "Transport header fields";
      container source-port-range {
        presence
          "Enables setting source port range";
        description
          "Inclusive range representing source ports to be used.
        When only lower-port is present, it represents a single port.";
        leaf lower-port {
          type inet:port-number;
          mandatory true;
          description
            "Lower boundary for port.";
        }

        leaf upper-port {
          type inet:port-number;
          must ". >= ../lower-port" {
            error-message
              "The upper-port must be greater than or equal to lower-port";
          }
          description
            "Upper boundary for port . If existing, the upper port
          must be greater or equal to lower-port.";
        }
      }  // 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 lower-port is present, it represents a single port.";
        leaf lower-port {
          type inet:port-number;
          mandatory true;
          description
            "Lower boundary for port.";
        }

        leaf upper-port {
          type inet:port-number;
          must ". >= ../lower-port" {
            error-message
              "The upper-port must be greater than or equal to lower-port";
          }
          description
            "Upper boundary for port. If existing, the upper port must
          be greater or equal to lower-port";
        }
      }  // container destination-port-range
    }  // grouping acl-transport-header-fields

    grouping acl-ip-header-fields {
      description
        "IP header fields common to ipv4 and ipv6";
      leaf dscp {
        type inet:dscp;
        description "Value of dscp.";
      }

      leaf protocol {
        type uint8;
        description
          "Internet Protocol number.";
      }

      uses acl-transport-header-fields;
    }  // grouping acl-ip-header-fields

    grouping acl-ipv4-header-fields {
      description "Fields in IPv4 header.";
      leaf destination-ipv4-network {
        type inet:ipv4-prefix;
        description
          "Destination IPv4 address prefix.";
      }

      leaf source-ipv4-network {
        type inet:ipv4-prefix;
        description
          "Source IPv4 address prefix.";
      }
    }  // grouping acl-ipv4-header-fields

    grouping acl-ipv6-header-fields {
      description "Fields in IPv6 header";
      reference
        "RFC 4291: IP Version 6 Addressing Architecture
         
         RFC 4007: IPv6 Scoped Address Architecture
         RFC 5952: A Recommendation for IPv6 Address Text Representation";

      leaf destination-ipv6-network {
        type inet:ipv6-prefix;
        description
          "Destination IPv6 address prefix.";
      }

      leaf source-ipv6-network {
        type inet:ipv6-prefix;
        description
          "Source IPv6 address prefix.";
      }

      leaf flow-label {
        type inet:ipv6-flow-label;
        description "IPv6 Flow label.";
      }
    }  // grouping acl-ipv6-header-fields

    grouping acl-eth-header-fields {
      description
        "Fields in Ethernet header.";
      reference
        "IEEE 802: IEEE Standard for Local and Metropolitan Area
        Networks: Overview and Architecture.";

      leaf destination-mac-address {
        type yang:mac-address;
        description
          "Destination IEEE 802 MAC address.";
      }

      leaf destination-mac-address-mask {
        type yang:mac-address;
        description
          "Destination IEEE 802 MAC address mask.";
      }

      leaf source-mac-address {
        type yang:mac-address;
        description
          "Source IEEE 802 MAC address.";
      }

      leaf source-mac-address-mask {
        type yang:mac-address;
        description
          "Source IEEE 802 MAC address mask.";
      }
    }  // grouping acl-eth-header-fields

    grouping timerange {
      description
        "Time range contains time
      segments to allow access-control-list to be
      active/inactive when the system time
      is between the range.";
      container absolute-time {
        description
          "Absolute time and date that
        the associated function starts
        going into effect.";
        leaf start {
          type yang:date-and-time;
          description
            "Absolute start time and date";
        }

        leaf end {
          type yang:date-and-time;
          description
            "Absolute end time and date";
        }

        leaf active {
          type boolean;
          default "true";
          description
            "This object indicates whether the
          the ACL will be active(true) or
          inactive(false) during this time range.";
        }
      }  // container absolute-time
    }  // grouping timerange

    grouping metadata {
      description
        "Fields associated with a packet whick are not in
      the header.";
      leaf input-interface {
        type string;
        description
          "Packet was received on this interface.";
      }

      uses timerange;
    }  // grouping metadata
  }  // module ietf-packet-fields