netconfcentral logo

ietf-savi@2017-08-15



  module ietf-savi {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-savi";

    prefix savi;

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

    organization "IETF SAVI Working Group";

    contact
      "
        WG Web:  <http://datatracker.ietf.org/wg/savi/charter>
        Editor:   Changqing An
                  <mailto:acq@tsinghua.edu.cn>
                ";

    description
      "This YANG module defines essential components for the management
        of a savi subsystem.";

    revision "2017-08-15" {
      description "Initial revision.";
      reference
        "DRAFT XXX: A YANG Data Model for SAVI Management.";

    }


    identity binding-state {
      base 
      description
        "Base identity for the sates of binding entry.";
    }

    grouping binding-entry {
      description
        "This grouping provides basic parameters of a binding entry.";
      leaf ifname {
        type if:interface-ref;
        description
          "The name of the interface.";
      }

      leaf mac {
        type yang:mac-address;
        description
          "The binding source mac address.";
      }

      leaf lifetime {
        type yang:timeticks;
        mandatory true;
        description
          "The remaining lifetime of the entry.";
      }
    }  // grouping binding-entry

    grouping binding-table {
      description
        "This grouping defines binding table for both IPv4 and IPv6.";
      container binding-table {
        description
          "Container for binding table.";
        container ipv4 {
          description
            "Container for binding table for IPv4 protocol.";
          list binding-entry {
            key "ifname address";
            description
              "Definition of a binding entry";
            leaf address {
              type inet:ipv4-address;
              description
                "IPv4 address of the binding host.";
            }

            uses binding-entry;

            leaf creationtime {
              type yang:timestamp;
              mandatory true;
              description
                "The value of the local clock when the entry was firstly created.";
            }

            leaf binding-method {
              type string;
              mandatory true;
              description
                "IP address assignment methods.";
            }
          }  // list binding-entry
        }  // container ipv4

        container ipv6 {
          description
            "Container for binding table for IPv4 protocol.";
          list binding-entry {
            key "ifname address";
            description
              "Definition of a binding entry";
            leaf address {
              type inet:ipv6-address;
              description
                "IPv6 address of the binding host.";
            }

            uses binding-entry;

            leaf creationtime {
              type yang:timestamp;
              mandatory true;
              description
                "The value of the local clock when the entry was firstly created.";
            }

            leaf binding-method {
              type string;
              mandatory true;
              description
                "IP address assignment methods.";
            }
          }  // list binding-entry
        }  // container ipv6
      }  // container binding-table
    }  // grouping binding-table

    container savi-state {
      config false;
      description
        "State data of the savi subsystem.";
      container savi-instances {
        description
          "Container of parameters for each savi method.";
        list savi-instance {
          key "savi-method";
          description
            "A list of parameters for each savi method.";
          leaf savi-method {
            type string;
            description
              "IP address assignment methods.";
          }

          leaf preference {
            type uint32;
            description
              "Preference of the savi method.";
          }
        }  // list savi-instance
      }  // container savi-instances

      uses binding-table;

      container statistics {
        description
          "Container of statistics parameters for savi subsystem.";
        leaf bst-entry-volume {
          type uint32;
          description
            "The volume of the the binding state table.";
        }

        leaf bst-entry-counts {
          type uint32;
          description
            "The count of the binding state table.";
        }

        container filtering-pks {
          description
            "Container of parameters for counting filtering packets.";
          list if-filtering-pks {
            key "ifname";
            description
              "A list of parameters for counting filtering packets.";
            leaf ifname {
              type if:interface-ref;
              description
                "The name of the interface.";
            }

            leaf filtering-pks {
              type uint32;
              description
                "The count of filtering packets.";
            }
          }  // list if-filtering-pks
        }  // container filtering-pks
      }  // container statistics
    }  // container savi-state

    container savi {
      description
        "Configuration data of the savi subsystem.";
      container savi-instances {
        description
          "Container of parameters for each savi method.";
        list savi-instance {
          key "savi-method";
          description
            "A list of parameters for each savi method.";
          leaf savi-method {
            type string;
            description
              "IP address assignment methods.";
          }

          leaf enable {
            type boolean;
            description
              "If the savi method is enabled?";
          }

          leaf preference {
            type uint32;
            description
              "Preference of the savi method.";
          }
        }  // list savi-instance
      }  // container savi-instances

      container if-filtering-attributes {
        description
          "Container for defining filtering attributes of each interface, common for every savi instance.";
        list if-filtering-attribute {
          key "ifname";
          description
            "A list of filtering attributes for each interface.";
          leaf ifname {
            type if:interface-ref;
            description
              "The name of the interface.";
          }

          leaf filtering-enabled {
            type boolean;
            default 'true';
            description
              "If the filtering attribute is enabled? ";
          }
        }  // list if-filtering-attribute
      }  // container if-filtering-attributes

      uses binding-table {
        when
          "/savi/savi-instances/savi-instance[savi-method = 'savi-manual']/enable = 'true'";
      }
    }  // container savi
  }  // module ietf-savi