netconfcentral logo

ietf-vbng@2017-07-16



  module ietf-vbng {

    yang-version 1;

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

    prefix vbng;

    import ietf-interfaces {
      prefix if;
    }
    import ietf-logical-network-element {
      prefix lne;
    }

    organization
      "IETF NETCONF Working Group";

    contact
      "
         WG List:  <mailto:netconf@ietf.org>

         Editor:   Fangwei Hu
                   <mailto:hu.fangwei@zte.com.cn>

        ";

    description
      "The YANG module defines a generic configuration
         model for vbng";

    revision "2017-07-16" {
      description "Initial revision";
      reference
        "draft-hu-rtgwg-cu-separation-yang-model-00";

    }


    typedef vlan-id {
      type uint16 {
        range "0..4094";
      }
      description "Typedef for VLAN ID.";
    }

    typedef vxlan-id {
      type uint32;
      description "Typedef for VxLAN ID.";
    }

    typedef address-family-type {
      type enumeration {
        enum "ipv4" {
          value 0;
          description "IPv4";
        }
        enum "ipv6" {
          value 1;
          description "IPv6";
        }
      }
      description
        "Typedef for address family type.";
    }

    augment /lne:logical-network-elements/lne:logical-network-element {
      description "augment lne model";
      container ietf-vbng {
        description
          "ietf-vbng configuration!";
        leaf vbng-name {
          type string;
          description "configure vbng name";
        }

        leaf enable {
          type boolean;
          description
            "'true' to support vbng control plane and user plane separation";
        }

        container interfaces {
          description "interface container";
          list interface {
            key "name";
            description "interfaces list";
            leaf name {
              type if:interface-ref;
              description "interface name";
            }

            container ethernet {
              description
                "configure ethernet interface";
              leaf lacp {
                type boolean;
                description
                  "enable lacp function";
              }
            }  // container ethernet

            leaf mac-offset {
              type uint32;
              description
                "configure mac offset";
            }

            container vlans {
              description "vlans";
              list tag {
                key "index";
                max-elements 2;
                description "tag list";
                leaf index {
                  type uint8 {
                    range "0..1";
                  }
                  must
                    ". = 0 or
                       count(../../tag[index = 0]/index) > 0" {
                    error-message
                      "An inner tag can only be specified if an
                                outer tag has also been specified";
                    description
                      "Ensure that an inner tag cannot be
                              specified without an outer tag'";
                  }
                  description
                    "The index into the tag stack, outermost tag
                            assigned index 0";
                }

                container tag {
                  description "tag";
                  leaf tag-type {
                    type string;
                    description "tag type";
                  }

                  leaf vlan-id {
                    type vlan-id;
                    description
                      "vlan id value";
                  }
                }  // container tag
              }  // list tag
            }  // container vlans
          }  // list interface
        }  // container interfaces

        container openflow-channel {
          description
            "configure openflow channel value";
          leaf ofls-name {
            type string;
            description
              "openflow logical name";
          }

          leaf dpid {
            type uint32;
            description "dpid value";
          }

          leaf of-port {
            type uint32;
            description
              "openflow channel udp port number";
          }
        }  // container openflow-channel

        list vxlan-channel {
          key "vxlan-tunnel-id";
          description
            "Configure the VxLAN channel";
          leaf vxlan-tunnel-id {
            type uint32;
            description
              "Static VxLAN tunnel ID.";
          }

          leaf vxlan-tunnel-name {
            type string;
            description
              "Name of the static VxLAN tunnel.";
          }

          list address-family {
            key "af";
            description "Per-af params.";
            leaf af {
              type address-family-type;
              description
                "Address family type value.";
            }

            leaf tunnel-source-ip {
              type address-family-type;
              description
                "Source IP address for the static VxLAN tunnel";
            }

            leaf tunnel-destination-ip {
              type address-family-type;
              description
                "Destination IP address for the static VxLAN tunnel";
            }

            list bind-vxlan-id {
              key "vxlan-id";
              description
                "VxLAN ID list for the VTEP.";
              leaf vxlan-id {
                type vxlan-id;
                description "VxLAN ID.";
              }
            }  // list bind-vxlan-id
          }  // list address-family
        }  // list vxlan-channel
      }  // container ietf-vbng
    }
  }  // module ietf-vbng