LISP Working Group                                            V. Ermagan
Internet-Draft                                             Cisco Systems
Intended status: Experimental                         A. Rodriguez-Natal
Expires: September 24, 2015 January 7, 2016                                        F. Coras
                                       Technical University of Catalonia
                                                               C. Moberg
                                                           Cisco Systems
                                                    A. Cabellos-Aparicio
                                       Technical University of Catalonia
                                                                F. Maino
                                                           Cisco Systems
                                                          March 23,
                                                            July 6, 2015

                          YANG model for

                     LISP
                       draft-ermagan-lisp-yang-00 Configuration YANG Model
                       draft-ermagan-lisp-yang-01

Abstract

   This document describes a YANG data model to use with the Locator/ID
   Separation Protocol (LISP).

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on September 24, 2015. January 7, 2016.

Copyright Notice

   Copyright (c) 2015 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.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Tree view  LISP Module . . . . . . . . . . . . . . . . . . . . . . . . .   3
     2.1.  Module Structure  .   2 . . . . . . . . . . . . . . . . . . .   3
     2.2.  Module Definition . . . . . . . . . . . . . . . . . . . .   3
   3.  YANG model  LISP-ITR Module . . . . . . . . . . . . . . . . . . . . . . .   9
     3.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .   9
     3.2.  Module Definition . . . . . . . . . . . . . . . . .  11 . . .  22
   4.  Acknowledgments  LISP ETR Module . . . . . . . . . . . . . . . . . . . . . . .  26
     4.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .  26
     4.2.  Module Definition . . . . . . . . . . . . . . . . . . . .  25  30
   5.  LISP Map Server Module  . . . . . . . . . . . . . . . . . . .  32
     5.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .  33
     5.2.  Module Definition . . . . . . . . . . . . . . . . . . . .  43
   6.  LISP Map Resolver Module  . . . . . . . . . . . . . . . . . .  47
     6.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .  47
     6.2.  Module Definition . . . . . . . . . . . . . . . . . . . .  48
   7.  LISP Proxy ITR Module . . . . . . . . . . . . . . . . . . . .  49
     7.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .  50
     7.2.  Module Definition . . . . . . . . . . . . . . . . . . . .  59
   8.  LISP Proxy ETR Module . . . . . . . . . . . . . . . . . . . .  62
     8.1.  Module Structure  . . . . . . . . . . . . . . . . . . . .  62
     8.2.  Module Definition . . . . . . . . . . . . . . . . . . . .  64
   9.  LISP Address Types  . . . . . . . . . . . . . . . . . . . . .  66
     9.1.  Module Definition . . . . . . . . . . . . . . . . . . . .  66
   10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . .  78
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  25
   6.  78
   12. Security Considerations . . . . . . . . . . . . . . . . . . .  25
   7.  78
   13. Normative References  . . . . . . . . . . . . . . . . . . . .  25  78
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  26  79

1.  Introduction

   The Locator/ID Separation Protocol (LISP) defines several network
   elements subject to be configured.  This document presents a the YANG
   data model to define the models required for basic configuration of all major LISP
   elements.

2.  Tree view
   [RFC6830]elements.  The tree view of models also capture some essential
   operational data elements as well.

2.  LISP Module

   This module is the model base LISP module that is depicted below. augmented in multiple
   models to represent various LISP device roles.

2.1.  Module Structure

   module: ietf-lisp
      +--rw lisp
      |  +--rw devices
      |     +--rw device* [type id]
      |        +--rw type       device-ref
      |        +--rw id         string
      |        +--rw enabled?   boolean
      +--ro lisp-state
         +--ro devices
            +--ro device* [type id]
               +--ro type    device-ref
               +--ro id      string

2.2.  Module Definition

   module ietf-lisp {
     namespace "urn:ietf:params:xml:ns:yang:ietf-lisp";
     prefix lisp;
     import ietf-interfaces {
       prefix if;
     }
     import lisp-address-types {
       prefix lcaf;
     }
     organization
       "IETF LISP (Locator/ID Separation Protocol) Working Group";
     contact
       "lisp@ietf.org";
     description
       "This YANG module defines the generic configuration
        and operational data for LISP. The following notation
   is used module can be extended by
        vendors to describe elements within define vendor-specific LISP configuration
        parameters and policies.

        Copyright (c) 2014 IETF Trust and the tree.  For readability
   purposes, persons identified as
        authors of the tree depth code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is limited permitted pursuant to, and subject
        to 9 levels.

   Each node is printed as:

   <status> <flags> <name> <opts> <type> <if-features>

     <status> is one of:
       +  for current
       x  for deprecated
       o  for obsolete

     <flags> 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 one of:
       rw  for configuration data
       ro  for non-configuration data
       -x  for rpcs
       -n part of RFC 6338; see
        the RFC itself for notifications

     <name> full legal notices.
       ";

     revision 2014-12-19 {
       description
         "Initial revision.";
       reference
         "https://tools.ietf.org/html/rfc6830";
     }
     identity lisp-device {
       description
         "LISP network device.";
     }
     typedef device-ref {
       type identityref {
         base lisp-device;
       }
       description
         "LISP device reference";
     }
     typedef map-reply-action {
       type enumeration {
         enum no-action {
           value 0;
           description
             "Mapping is kept alive and no encapsulation occurs.";
         }
         enum natively-forward {
           value 1;
           description
             "Matching packets are not encapsulated or dropped but
              natively forwarded.";
         }
         enum send-map-request {
           value 2;
           description
             "Matching packets invoke Map-Requests.";
         }
         enum drop {
           value 3;
           description
             "Matching packets are dropped.";
         }
       }
       description
         "Defines the name lisp map-cache ACT type";
       reference "https://tools.ietf.org/html/rfc6830#section-6.1.4";
     }
     typedef eid-id {
       type string;
       description
         "Type encoding of lisp-addresses to be generally used in EID
          keyed lists.";
     }
     typedef auth-key-type {
       type enumeration {
         enum none {
           value 0;
           description
             "No authentication.";
         }
         enum hmac-sha-1-96 {
           value 1;
           description
             "HMAC-SHA-1-96 (RFC2404) authentication is used.";
         }
         enum hmac-sha-256-128 {
           value 2;
           description
             "HMAC-SHA-256-128 (RFC4868) authentication is used.";
         }
       }
       description
         "Enumeration of the node
       (<name>) means authentication mechansms supported by
          LISP.";
       reference
         "https://tools.ietf.org/html/rfc6830#section-6.1.6";
     }
     grouping locators {
       description
         "Group that the node is defines a list of LISP locators.";
       list rloc {
         key "id";
         description
           "List of routing locators";
         leaf id {
           type string;
           description
             "Locator id";
         }
         // FC need to be sure we don't use interface-name in itr
         // cached mappings
         choice node
      :(<name>) means that address-type {
           description
             "The address type of the node is a locator";
           case node

      If interface-name {
             leaf interface {
               type if:interface-state-ref;
               description
                 "The name of the node is augmented into interface supporting the tree locator.";
             }
           }
           case address {
             container locator-address {
               uses lcaf:lisp-address;
               description
                 "The locator address provided in LISP canonincal
                  address format.";
             }
           }
         }
         leaf priority {
           type uint8;
           description
             "Locator priority.";
         }
         leaf weight {
           type uint8;
           description
             "Locator weight.";
         }
         leaf multicast-priority {
           type uint8;
           description
             "Locator's multicast priority";
         }
         leaf multicast-weight {
           type uint8;
           description
             "Locator's multicast weight";
         }
       }
     }
     grouping mappings {
       description
         "Group that defines a list of LISP mappings.";
       list mapping {
         key "id";
         description
           "List of EID to RLOCs mappings.";

         leaf id {
           type eid-id;
           description
             "Id that uniquely identifies a mapping.";
         }
         container eid {
           uses lcaf:lisp-address;
           description
             "End-host Identifier (EID) to be mapped to a list of
              locators";
         }
         leaf ttl {
           type uint32;
           description
             "Mapping validity period.";
         }
         leaf authoritative {
           type bits {
             bit A {
               description
                 "Authoritative bit.";
             }
           }
           description
             "Bit that indicates if mapping comes from another module, its
      name is printed as <prefix>:<name>.

     <opts> is one of:
       ?  for an optional leaf or
              authoritative source.";
         }
         choice
       ! locator-list {
           case negative-mapping {
             leaf map-reply-action {
               type map-reply-action;
               description
                 "Forwarding action for a presence negative mapping.";
             }
           }
           case positive-mapping {
             container
       * rlocs {
               uses locators;
               description
                 "List of locators for a leaf-list or positive mapping.";
             }
           }
           default "positive-mapping";
           description
             "Choice of locator list
       [<keys>] based on type of mapping.";
         }
       }
     }
     /* Configuration Data */
     container lisp {
       description
         "Configuration parameters for LISP subsystem.";
       container devices {
         description
           "Configuration of LISP devices.";
         list device {
           key "type id";
           description
             "Each entry contains configuration of a list's keys

     <type> is the name lisp-device.";
           leaf type {
             type device-ref;
             description
               "The type of LISP device - identity derived from the
                'lisp-device' base identity.";
           }
           leaf id {
             type for leafs and leaf-lists

     <if-features> is string;
             description
               "Arbitrary device name.";
           }
           leaf enabled {
             type boolean;
             default "true";
             description
               "Enable/disable the lisp-device.";
           }
         }
       }
     }

     /* Operational state data */
     container lisp-state {
       config false;
       description
         "Operational state of the LISP subsystem.";
       container devices {
         description
           "Operational state of lisp-devices.";
         list device {
           key "type id";
           description
             "Each entry contains operational data of a lisp-device.";
           leaf type {
             type device-ref;
             description
               "Type of LISP device.";

           }
           leaf id {
             type string;
             description
               "Name of LISP device.";
           }
         }
       }
     }

   }

3.  LISP-ITR Module

   This module captures the configuration data model of features this node depends on, printed
       within curly brackets and a question mark "{...}?" LISP ITR.  The
   model also captures some operational data elements.

3.1.  Module Structure

module: lisp lisp-itr
augment /lisp:lisp/lisp:devices/lisp:device:
   +--rw itr-cfg! {itr}?
       |
      +--rw rloc-probing!
      |  |  +--rw interval?           uint16
      |  |  +--rw retries?            uint8
      |  |  +--rw retries-interval?   uint16
       |
      +--rw itr-rlocs
      |  |  +--rw itr-rloc* [id]
      |  |     +--rw id         string
      |  |     +--rw address
      |  |        +--rw afi?           enumeration
       | afi                   lisp-address-family-ref
      |        +--rw instance-id?          instance-id-type
      |  |        +--rw (address)?
      |  |           +--:(ipv4)
      |           |           |  +--rw ipv4?                 inet:ipv4-address
      |  |           +--:(ipv6)
      |           |           |  +--rw ipv6?                 inet:ipv6-address
      |  |           +--:(mac-address)
       |           +--:(mac)
      |           |  +--rw mac-address? mac?                  yang:mac-address
      |  |           +--:(lcaf)           +--:(distinguished-name)
      |           |  +--rw lcaf distinguished-name?   distinguished-name
      |           +--:(lcaf)
      |              +--rw lcaf-type?               enumeration lcaf
      |                 +--rw lcaf-type                lcaf-ref
      |                 +--rw (address)?
      |                    +--:(null-address)
      |                    +--:(as-number)                    |  +--rw null-address
      |                    |     ...     +--rw address?   empty
      |                    +--:(afi-list)
      |                    +--:(sourc-dest-key)                    |  +--rw afi-list
      |                    |     ...     +--rw address-list*   simple-address
      |                    +--:(instance-id)
      |                    +--:(explicit-locator-path)                    |  +--rw instance-id
      |                          ...                    |     +--rw local-eids instance-id?   instance-id-type
      |                    |     +--rw local-eid* [id] mask-length?   uint8
      |                    |     +--rw id             eid-id address?       simple-address
      |                    +--:(as-number)
      |                    |  +--rw eid-address as-number
      |                    |     +--rw afi?           enumeration as?        inet:as-number
      |                    |     +--rw instance-id?   instance-id-type address?   simple-address
      |                    +--:(application-data)
      |                    |  +--rw (address)? application-data
      |                    |           +--:(ipv4)     +--rw address?            simple-address
      |                    |     +--rw protocol?           uint8
      |                    |     +--rw ipv4?          inet:ipv4-address ip-tos?             int32
      |                    |           +--:(ipv6)     +--rw local-port-low?     inet:port-number
      |                    |     +--rw local-port-high?    inet:port-number
      |                    |     +--rw ipv6?          inet:ipv6-address remote-port-low?    inet:port-number
      |                    |           +--:(mac-address)     +--rw remote-port-high?   inet:port-number
      |                    +--:(geo-coordinates)
      |                    |  +--rw mac-address?   yang:mac-address geo-coordinates
      |                    |           +--:(lcaf)     +--rw latitude?            bits
      |                    |     +--rw lcaf latitude-degrees?    uint8
      |                    |     +--rw lcaf-type?               enumeration latitude-minutes?    uint8
      |                    |     +--rw (address)? latitude-seconds?    uint8
      |                    |                    +--:(as-number)     +--rw longitude?           bits
      |                    |     +--rw longitude-degrees?   uint16
      |     ...                    |     +--rw longitude-minutes?   uint8
      |                    +--:(sourc-dest-key)                    |     +--rw longitude-seconds?   uint8
      |                    |     ...     +--rw altitude?            int32
      |                    |                    +--:(explicit-locator-path)     +--rw address?             simple-address
      |                    +--:(nat-traversal)
      |                          ...                    |  +--rw map-resolvers nat-traversal
      |                    |     +--rw map-resolver* [id] ms-udp-port?        uint16
      |                    |     +--rw id                      eid-id etr-udp-port?       uint16
      |                    |     +--rw eid-address
       | global-etr-rloc?    simple-address
      |                    |     +--rw afi?           enumeration
       | ms-rloc?            simple-address
      |                    |     +--rw instance-id?   instance-id-type
       | private-etr-rloc?   simple-address
      |                    |     +--rw (address)? rtr-rlocs*          simple-address
      |                    +--:(explicit-locator-path)
      |                    |     +--:(ipv4)  +--rw explicit-locator-path
      |                    |     +--rw hop* [address]
      |                    |        +--rw ipv4?          inet:ipv4-address address     simple-address
      |                    |        +--rw lrs-bits?   bits
      |                    +--:(sourc-dest-key)
      |     +--:(ipv6)                       +--rw sourc-dest-key
      |                          +--rw source?   inet:ip-prefix
      |                          +--rw dest?     inet:ip-prefix
      +--rw local-eids
      |  +--rw local-eid* [id]
      |     +--rw ipv6?          inet:ipv6-address id             lisp:eid-id
      |     +--rw eid-address
      |        +--rw afi                   lisp-address-family-ref
      |     +--:(mac-address)        +--rw instance-id?          instance-id-type
      |        +--rw (address)?
      |           +--:(ipv4)
      |           |  +--rw mac-address?   yang:mac-address ipv4?                 inet:ipv4-address
      |           +--:(ipv6)
      |           |     +--:(lcaf)  +--rw ipv6?                 inet:ipv6-address
      |           +--:(mac)
      |           |  +--rw lcaf mac?                  yang:mac-address
      |           +--:(distinguished-name)
      |           |  +--rw lcaf-type?               enumeration distinguished-name?   distinguished-name
      |           +--:(lcaf)
      |              +--rw lcaf
      |                 +--rw lcaf-type                lcaf-ref
      |                 +--rw (address)?
      |                    +--:(null-address)
      |                    |              +--:(as-number)  +--rw null-address
      |                    |     +--rw address?   empty
      |                    +--:(afi-list)
      |     ...                    |  +--rw afi-list
      |                    |              +--:(sourc-dest-key)     +--rw address-list*   simple-address
      |                    +--:(instance-id)
      |                    |  +--rw instance-id
      |     ...                    |     +--rw instance-id?   instance-id-type
      |                    |              +--:(explicit-locator-path)     +--rw mask-length?   uint8
      |                    |     +--rw address?       simple-address
      |                    ...                    +--:(as-number)
      |                    |  +--rw map-resolver-address*   inet:ip-address as-number
      |                    |     +--rw proxy-etrs as?        inet:as-number
      |                    |     +--rw proxy-etr* [id] address?   simple-address
      |                    +--:(application-data)
      |                    |  +--rw id                   eid-id application-data
      |                    |     +--rw eid-address
       | address?            simple-address
      |                    |     +--rw afi?           enumeration
       | protocol?           uint8
      |                    |     +--rw instance-id?   instance-id-type ip-tos?             int32
      |                    |     +--rw local-port-low?     inet:port-number
      |                    |     +--rw (address)? local-port-high?    inet:port-number
      |                    |     +--rw remote-port-low?    inet:port-number
      |     +--:(ipv4)                    |     +--rw remote-port-high?   inet:port-number
      |                    +--:(geo-coordinates)
      |                    |  +--rw ipv4?          inet:ipv4-address geo-coordinates
      |                    |     |     +--:(ipv6)     +--rw latitude?            bits
      |                    |     +--rw latitude-degrees?    uint8
      |                    |     +--rw ipv6?          inet:ipv6-address latitude-minutes?    uint8
      |                    |     +--rw latitude-seconds?    uint8
      |                    |     +--:(mac-address)     +--rw longitude?           bits
      |                    |     +--rw longitude-degrees?   uint16
      |                    |     +--rw mac-address?   yang:mac-address longitude-minutes?   uint8
      |                    |     +--rw longitude-seconds?   uint8
      |     +--:(lcaf)                    |     +--rw altitude?            int32
      |                    |     +--rw lcaf address?             simple-address
      |                    +--:(nat-traversal)
      |                    |  +--rw lcaf-type?               enumeration
       | nat-traversal
      |                    |     +--rw (address)? ms-udp-port?        uint16
      |                    |     +--rw etr-udp-port?       uint16
      |              +--:(as-number)                    |     +--rw global-etr-rloc?    simple-address
      |                    |     +--rw ms-rloc?            simple-address
      |     ...                    |     +--rw private-etr-rloc?   simple-address
      |                    |              +--:(sourc-dest-key)     +--rw rtr-rlocs*          simple-address
      |                    +--:(explicit-locator-path)
      |                    |  +--rw explicit-locator-path
      |     ...                    |     +--rw hop* [address]
      |                    |              +--:(explicit-locator-path)        +--rw address     simple-address
      |                    |        +--rw lrs-bits?   bits
      |                    ...                    +--:(sourc-dest-key)
      |                       +--rw sourc-dest-key
      |                          +--rw proxy-etr-address*   inet:ip-address source?   inet:ip-prefix
      |                          +--rw map-cache dest?     inet:ip-prefix
      +--rw map-resolvers
      |  +--rw mapping* map-resolver* [id]
      |     +--rw id                  eid-id                      lisp:eid-id
      |     +--rw eid eid-address
      |     |  +--rw afi?           enumeration afi                   lisp-address-family-ref
      |     |  +--rw instance-id?          instance-id-type
      |     |  +--rw (address)?
      |     |     +--:(ipv4)
      |     |     |  +--rw ipv4?                 inet:ipv4-address
      |     |     +--:(ipv6)
      |     |     |  +--rw ipv6?                 inet:ipv6-address
      |     |     +--:(mac-address)     +--:(mac)
      |     |     |  +--rw mac-address? mac?                  yang:mac-address
      |     |     +--:(distinguished-name)
      |     |     |  +--rw distinguished-name?   distinguished-name
      |     |     +--:(lcaf)
      |     |        +--rw lcaf
      |     |           +--rw lcaf-type?               enumeration lcaf-type                lcaf-ref
      |     |           +--rw (address)?
      |     |              +--:(as-number)              +--:(null-address)
      |     |              |     ...  +--rw null-address
      |     |              +--:(sourc-dest-key)              |     +--rw address?   empty
      |     |     ...              +--:(afi-list)
      |     |              +--:(explicit-locator-path)              |  +--rw afi-list
      |                    ...     |        +--rw ttl?                uint32              |     +--rw (locator-list)? address-list*   simple-address
      |     |  +--:(negative-mapping)              +--:(instance-id)
      |     |              |  +--rw map-reply-action?   map-reply-action
       | instance-id
      |  +--:(positive-mapping)     |              |     +--rw rlocs
       | instance-id?   instance-id-type
      |        +--rw rloc* [name]     |              |     +--rw name                  string mask-length?   uint8
      |     |              |     +--rw (address-type)? address?       simple-address
      |     |              +--:(as-number)
      |     |  +--:(interface-address)              |  +--rw as-number
      |     |              |     ...     +--rw as?        inet:as-number
      |     |              |  +--:(lisp-address)     +--rw address?   simple-address
      |     |              +--:(application-data)
      |        ...     |              |  +--rw priority?             uint8 application-data
      |     |              |     +--rw weight?               uint8 address?            simple-address
      |     |              |     +--rw multicast-priority? protocol?           uint8
      |     |              |     +--rw multicast-weight?     uint8 ip-tos?             int32
      |     |              |     +--rw static?             boolean local-port-low?     inet:port-number
      |     |              |     +--rw etr-cfg! {etr}? local-port-high?    inet:port-number
      |     |              |     +--rw local-eids remote-port-low?    inet:port-number
      |     |              |     +--rw local-eid* [id] remote-port-high?   inet:port-number
      |     |              +--:(geo-coordinates)
      |     |              |  +--rw id                       eid-id geo-coordinates
      |     |              |     +--rw eid-address latitude?            bits
      |     |              |     +--rw afi?           enumeration latitude-degrees?    uint8
      |     |              |     +--rw instance-id?   instance-id-type latitude-minutes?    uint8
      |     |              |     +--rw (address)? latitude-seconds?    uint8
      |     |     +--:(ipv4)              |     +--rw longitude?           bits
      |     |              |     +--rw ipv4?          inet:ipv4-address longitude-degrees?   uint16
      |     |     +--:(ipv6)              |     +--rw longitude-minutes?   uint8
      |     |              |     +--rw ipv6?          inet:ipv6-address longitude-seconds?   uint8
      |     |              |     +--:(mac-address)     +--rw altitude?            int32
      |     |              |     +--rw mac-address?   yang:mac-address address?             simple-address
      |     |     +--:(lcaf)              +--:(nat-traversal)
      |     |              |  +--rw lcaf nat-traversal
      |     |              |     +--rw lcaf-type?               enumeration ms-udp-port?        uint16
      |     |              |     +--rw (address)? etr-udp-port?       uint16
      |     |              +--:(as-number)              |     +--rw global-etr-rloc?    simple-address
      |     |              |     ...     +--rw ms-rloc?            simple-address
      |     |              |              +--:(sourc-dest-key)     +--rw private-etr-rloc?   simple-address
      |     |              |     ...     +--rw rtr-rlocs*          simple-address
      |     |              +--:(explicit-locator-path)
      |     |                    ...              |  +--rw map-servers explicit-locator-path
      |     |              |     +--rw map-server* hop* [address]
      |     |              |        +--rw address          inet:ip-address     simple-address
      |     |              |        +--rw auth-key?        string lrs-bits?   bits
      |     |              +--:(sourc-dest-key)
      |     |                 +--rw auth-key-type?   auth-key-type sourc-dest-key
      |     |                    +--rw rlocs source?   inet:ip-prefix
      |     |                    +--rw rloc* [name] dest?     inet:ip-prefix
      |     +--rw map-resolver-address*   inet:ip-address
      +--rw proxy-etrs
      |  +--rw proxy-etr* [id]
      |     +--rw name                  string id                   lisp:eid-id
      |     +--rw eid-address
      |     |  +--rw (address-type)? afi                   lisp-address-family-ref
      |     |  +--rw instance-id?          instance-id-type
      |     |  +--rw (address)?
      |  +--:(interface-address)     |     +--:(ipv4)
      |     |     |  +--rw interface?            interface-name ipv4?                 inet:ipv4-address
      |     |     +--:(ipv6)
      |     |     |  +--rw ipv6?                 inet:ipv6-address
      |     |  +--:(lisp-address)     +--:(mac)
      |     |     |  +--rw locator-address mac?                  yang:mac-address
      |     |     +--:(distinguished-name)
      |     |     |  +--rw afi?           enumeration distinguished-name?   distinguished-name
      |     |     +--:(lcaf)
      |     |        +--rw instance-id?   instance-id-type lcaf
      |     |           +--rw lcaf-type                lcaf-ref
      |     |           +--rw (address)?
      |     |              +--:(null-address)
      |              ...     |              |  +--rw priority?             uint8 null-address
      |     |              |     +--rw weight?               uint8 address?   empty
      |     |     +--rw multicast-priority?   uint8              +--:(afi-list)
      |     |     +--rw multicast-weight?     uint8              |  +--rw record-ttl?              uint32 afi-list
      |        +--rw want-map-notify?         boolean     |        +--rw proxy-reply?             boolean              |     +--rw registration-interval?   uint16
       +--rw map-server-cfg! {map-server}? address-list*   simple-address
      |     |              +--:(instance-id)
      |  +--rw sites     |              |  +--rw site* [site-id] instance-id
      |     |              |     +--rw site-id    uint64 instance-id?   instance-id-type
      |     |              |     +--rw devices mask-length?   uint8
      |     |              |     +--rw device* [device-id] address?       simple-address
      |     |              +--:(as-number)
      |     |              |  +--rw device-id    uint64 as-number
      |     |              |     +--rw auth-key as?        inet:as-number
      |     |              |     +--rw auth-key-value?   string address?   simple-address
      |     |              +--:(application-data)
      |     |              |  +--rw auth-key-type?    auth-key-type application-data
      |     |              |     +--rw eids address?            simple-address
      |     |              |     +--rw eid* [id] protocol?           uint8
      |     |              |     +--rw id                            eid-id ip-tos?             int32
      |     |              |     +--rw eid-address local-port-low?     inet:port-number
      |     |              |     +--rw afi?           enumeration local-port-high?    inet:port-number
      |     |              |     +--rw instance-id?   instance-id-type remote-port-low?    inet:port-number
      |     |              |     +--rw (address)? remote-port-high?   inet:port-number
      |     |              +--:(geo-coordinates)
      |        ...     |              |  +--rw more-specifics-accepted?      boolean geo-coordinates
      |     |                 +--rw mapping-expiration-timeout?   int16              |     +--rw registered-mappings latitude?            bits
      |     |              |     +--rw mapping* [id] latitude-degrees?    uint8
      |     |              |     +--rw id                  eid-id latitude-minutes?    uint8
      |     |              |     +--rw eid latitude-seconds?    uint8
      |     |              |     +--rw afi?           enumeration longitude?           bits
      |     |              |     +--rw instance-id?   instance-id-type longitude-degrees?   uint16
      |     |              |     +--rw (address)?
       | longitude-minutes?   uint8
      |     |     +--:(ipv4)              |     +--rw longitude-seconds?   uint8
      |     |              |     +--rw ipv4?          inet:ipv4-address altitude?            int32
      |     |              |     +--:(ipv6)     +--rw address?             simple-address
      |     |              +--:(nat-traversal)
      |     |              |  +--rw ipv6?          inet:ipv6-address nat-traversal
      |     |              |     +--:(mac-address)     +--rw ms-udp-port?        uint16
      |     |              |     +--rw etr-udp-port?       uint16
      |     |              |     +--rw mac-address?   yang:mac-address global-etr-rloc?    simple-address
      |     |              |     +--:(lcaf)     +--rw ms-rloc?            simple-address
      |     |              |     +--rw lcaf private-etr-rloc?   simple-address
      |     |              |     +--rw lcaf-type?               enumeration rtr-rlocs*          simple-address
      |     |              +--:(explicit-locator-path)
      |     |              |  +--rw (address)? explicit-locator-path
      |     |              |              +--:(as-number)     +--rw hop* [address]
      |     |              |        +--rw address     simple-address
      |     |     ...              |        +--rw lrs-bits?   bits
      |     |              +--:(sourc-dest-key)
      |     |                 +--rw sourc-dest-key
      |     |                    +--rw source?   inet:ip-prefix
      |     |                    +--rw dest?     inet:ip-prefix
      |     +--rw proxy-etr-address*   inet:ip-address
      +--rw static-mappings
         +--rw mapping* [id]
            +--rw id                  eid-id
            +--rw eid
            |     ...  +--rw afi                   lisp-address-family-ref
            |  +--rw instance-id?          instance-id-type
            |  +--rw (address)?
            |              +--:(explicit-locator-path)     +--:(ipv4)
            |     |  +--rw ipv4?                 inet:ipv4-address
            |                    ...     +--:(ipv6)
            |     |  +--rw ttl?                uint32 ipv6?                 inet:ipv6-address
            |     +--:(mac)
            |     |  +--rw (locator-list)? mac?                  yang:mac-address
            |     +--:(distinguished-name)
            |        +--:(negative-mapping)     |  +--rw distinguished-name?   distinguished-name
            |     +--:(lcaf)
            |        +--rw map-reply-action?   map-reply-action lcaf
            |           +--rw lcaf-type                lcaf-ref
            |        +--:(positive-mapping)           +--rw (address)?
            |              +--:(null-address)
            |              |  +--rw rlocs null-address
            |              |     +--rw rloc* [name] address?   empty
            |              +--:(afi-list)
            |              |  +--rw name                  string afi-list
            |              |     +--rw (address-type)? address-list*   simple-address
            |              +--:(instance-id)
            |              |  +--:(interface-address)  +--rw instance-id
            |              |     +--rw instance-id?   instance-id-type
            |              |     +--rw mask-length?   uint8
            |     ...              |     +--rw address?       simple-address
            |              +--:(as-number)
            |  +--:(lisp-address)              |  +--rw as-number
            |              |        ...     +--rw as?        inet:as-number
            |              |     +--rw priority?             uint8 address?   simple-address
            |              +--:(application-data)
            |              |  +--rw weight?               uint8 application-data
            |              |     +--rw multicast-priority?   uint8 address?            simple-address
            |              |     +--rw multicast-weight? protocol?           uint8
            |              |     +--rw (mapping-system) ip-tos?             int32
            |     +--:(ddt-mapping-system)              |     +--rw local-port-low?     inet:port-number
            |              |     +--rw ddt-mapping-system! local-port-high?    inet:port-number
            |              |     +--rw ddt-root*             inet:ip-address remote-port-low?    inet:port-number
            |              |     +--rw authoritative-eids remote-port-high?   inet:port-number
            |              +--:(geo-coordinates)
            |              |  +--rw authoritative-eid* [id] geo-coordinates
            |              |     +--rw id             eid-id latitude?            bits
            |              |     +--rw eid-address latitude-degrees?    uint8
            |              |     +--rw afi?           enumeration latitude-minutes?    uint8
            |              |     +--rw instance-id?   instance-id-type latitude-seconds?    uint8
            |              |     +--rw (address)? longitude?           bits
            |              |                 +--:(ipv4)     +--rw longitude-degrees?   uint16
            |              |     +--rw longitude-minutes?   uint8
            |     ...              |     +--rw longitude-seconds?   uint8
            |                 +--:(ipv6)              |     +--rw altitude?            int32
            |              |     ...     +--rw address?             simple-address
            |              +--:(nat-traversal)
            |                 +--:(mac-address)              |  +--rw nat-traversal
            |              |     ...     +--rw ms-udp-port?        uint16
            |              |                 +--:(lcaf)     +--rw etr-udp-port?       uint16
            |              |                       ...     +--rw global-etr-rloc?    simple-address
            |     +--:(alt-mapping-system)              |     +--rw alt-mapping-system! ms-rloc?            simple-address
            |              |     +--rw map-resolver-cfg! {map-resolver}? private-etr-rloc?   simple-address
            |              |     +--rw (mapping-system) rtr-rlocs*          simple-address
            |     +--:(ddt-mapping-system)              +--:(explicit-locator-path)
            |              |  +--rw ddt-mapping-system! explicit-locator-path
            |              |     +--rw ddt-root*   inet:ip-address hop* [address]
            |     +--:(alt-mapping-system)              |        +--rw alt-mapping-system!
       +--rw proxy-itr-cfg! {proxy-itr}? address     simple-address
            |              |        +--rw servicing-eids lrs-bits?   bits
            |              +--:(sourc-dest-key)
            |                 +--rw eid* [id] sourc-dest-key
            |                    +--rw source?   inet:ip-prefix
            |                    +--rw dest?     inet:ip-prefix
            +--rw ttl?                uint32
            +--rw authoritative?      bits
            +--rw (locator-list)?
               +--:(negative-mapping)
               |  +--rw map-reply-action?   map-reply-action
               +--:(positive-mapping)
                  +--rw rlocs
                     +--rw rloc* [id]
                        +--rw id             eid-id                    string
                        +--rw (address-type)?
                        |  +--:(interface-name)
                        |  |  +--rw eid-address interface?            if:interface-state-ref
                        |  +--:(address)
                        |     +--rw afi?           enumeration locator-address
                        |        +--rw afi                   lisp-address-family-ref
                        |        +--rw instance-id?          instance-id-type
                        |  |        +--rw (address)?
                        |  |           +--:(ipv4)
                        |           |           |  +--rw ipv4?                 inet:ipv4-address
                        |  |           +--:(ipv6)
                        |           |           |  +--rw ipv6?                 inet:ipv6-address
                        |  |           +--:(mac-address)
       |           +--:(mac)
                        |           |  +--rw mac-address? mac?                  yang:mac-address
                        |  |           +--:(lcaf)           +--:(distinguished-name)
                        |           |  +--rw lcaf distinguished-name?   distinguished-name
                        |           +--:(lcaf)
                        |              +--rw lcaf-type?               enumeration lcaf
                        |                 +--rw lcaf-type                lcaf-ref
                        |                 +--rw (address)?
                        |                    +--:(null-address)
                        |                    +--:(as-number)                    |  +--rw null-address
                        |                    |     ...     +--rw address?   empty
                        |                    +--:(afi-list)
                        |                    +--:(sourc-dest-key)                    |  +--rw afi-list
                        |                    |     ...     +--rw address-list*   simple-address
                        |                    +--:(instance-id)
                        |                    +--:(explicit-locator-path)                    |  +--rw instance-id
                        |                          ...                    |     +--rw map-resolvers instance-id?   instance-id-type
                        |                    |     +--rw map-resolver* [id] mask-length?   uint8
                        |                    |     +--rw id              eid-id address?       simple-address
                        |                    +--:(as-number)
                        |                    |  +--rw eid-address as-number
                        |                    |     +--rw as?        inet:as-number
                        |                    |     +--rw afi?           enumeration address?   simple-address
                        |                    +--:(application-data)
                        |                    |  +--rw instance-id?   instance-id-type application-data
                        |                    |     +--rw address?            simple-address
                        |                    |     +--rw (address)? protocol?           uint8
                        |                    |     +--rw ip-tos?             int32
                        |                    |     +--:(ipv4)     +--rw local-port-low?     inet:port-number
                        |                    |     +--rw local-port-high?    inet:port-number
                        |                    |     +--rw ipv4?          inet:ipv4-address remote-port-low?    inet:port-number
                        |                    |     +--rw remote-port-high?   inet:port-number
                        |     +--:(ipv6)                    +--:(geo-coordinates)
                        |                    |  +--rw geo-coordinates
                        |                    |     +--rw ipv6?          inet:ipv6-address latitude?            bits
                        |                    |     +--rw latitude-degrees?    uint8
                        |                    |     +--:(mac-address)     +--rw latitude-minutes?    uint8
                        |                    |     +--rw latitude-seconds?    uint8
                        |                    |     +--rw mac-address?   yang:mac-address longitude?           bits
                        |                    |     +--rw longitude-degrees?   uint16
                        |     +--:(lcaf)                    |     +--rw longitude-minutes?   uint8
                        |                    |     +--rw lcaf longitude-seconds?   uint8
                        |                    |     +--rw altitude?            int32
                        |                    |     +--rw lcaf-type?               enumeration address?             simple-address
                        |                    +--:(nat-traversal)
                        |                    |  +--rw (address)? nat-traversal
                        |                    |     +--rw ms-udp-port?        uint16
                        |                    |              +--:(as-number)     +--rw etr-udp-port?       uint16
                        |                    |     +--rw global-etr-rloc?    simple-address
                        |                    |     ...     +--rw ms-rloc?            simple-address
                        |                    |     +--rw private-etr-rloc?   simple-address
                        |              +--:(sourc-dest-key)                    |     +--rw rtr-rlocs*          simple-address
                        |                    +--:(explicit-locator-path)
                        |                    |     ...  +--rw explicit-locator-path
                        |                    |     +--rw hop* [address]
                        |              +--:(explicit-locator-path)                    |        +--rw address     simple-address
                        |                    |                    ...        +--rw lrs-bits?   bits
                        |                    +--:(sourc-dest-key)
                        |                       +--rw map-resolver*   inet:ip-address sourc-dest-key
                        |                          +--rw map-cache source?   inet:ip-prefix
                        |                          +--rw dest?     inet:ip-prefix
                        +--rw priority?             uint8
                        +--rw weight?               uint8
                        +--rw multicast-priority?   uint8
                        +--rw multicast-weight?     uint8
augment /lisp:lisp-state/lisp:devices/lisp:device:
   +--ro itr-state
      +--ro learned-mappings
         +--ro mapping* [id]
       |        +--rw
            +--ro id                  eid-id
       |        +--rw
            +--ro eid
            |  +--ro afi                   lisp-address-family-ref
            |  +--rw afi?           enumeration
       |        |  +--rw  +--ro instance-id?          instance-id-type
            |        |  +--rw  +--ro (address)?
            |        |     +--:(ipv4)
            |     |     |  +--rw  +--ro ipv4?                 inet:ipv4-address
            |        |     +--:(ipv6)
            |     |     |  +--rw  +--ro ipv6?                 inet:ipv6-address
            |     +--:(mac)
            |     +--:(mac-address)     |  +--ro mac?                  yang:mac-address
            |     +--:(distinguished-name)
            |  +--rw mac-address?   yang:mac-address     |  +--ro distinguished-name?   distinguished-name
            |     +--:(lcaf)
            |        |        +--rw        +--ro lcaf
            |           +--ro lcaf-type                lcaf-ref
            |           +--rw lcaf-type?               enumeration           +--ro (address)?
            |              +--:(null-address)
            |           +--rw (address)?              |  +--ro null-address
            |              |     +--ro address?   empty
            |              +--:(afi-list)
            |              |  +--ro afi-list
            |              |     +--ro address-list*   simple-address
            |              +--:(instance-id)
            |              |  +--ro instance-id
            |              |     +--ro instance-id?   instance-id-type
            |              |     +--ro mask-length?   uint8
            |              |     +--ro address?       simple-address
            |              +--:(as-number)
            |              |  +--ro as-number
            |     ...              |     +--ro as?        inet:as-number
            |              +--:(sourc-dest-key)              |     +--ro address?   simple-address
            |              +--:(application-data)
            |     ...              |  +--ro application-data
            |              +--:(explicit-locator-path)              |     +--ro address?            simple-address
            |                    ...              |        +--rw ttl?                uint32     +--ro protocol?           uint8
            |        +--rw (locator-list)?              |           +--:(negative-mapping)     +--ro ip-tos?             int32
            |              |  +--rw map-reply-action?   map-reply-action     +--ro local-port-low?     inet:port-number
            |           +--:(positive-mapping)              |              +--rw rlocs     +--ro local-port-high?    inet:port-number
            |                 +--rw rloc* [name]              |                    +--rw name                  string     +--ro remote-port-low?    inet:port-number
            |                    +--rw (address-type)?              |     +--ro remote-port-high?   inet:port-number
            |  +--:(interface-address)              +--:(geo-coordinates)
            |              |  +--ro geo-coordinates
            |     ...              |     +--ro latitude?            bits
            |  +--:(lisp-address)              |     +--ro latitude-degrees?    uint8
            |        ...              |                    +--rw priority?     +--ro latitude-minutes?    uint8
            |                    +--rw weight?              |     +--ro latitude-seconds?    uint8
            |                    +--rw multicast-priority?              |     +--ro longitude?           bits
            |              |     +--ro longitude-degrees?   uint16
            |              |     +--ro longitude-minutes?   uint8
            |                    +--rw multicast-weight?              |     +--ro longitude-seconds?   uint8
       +--rw proxy-etr-cfg! {proxy-etr}?
          +--rw servicing-eids
             +--rw eid*
            |              |     +--ro altitude?            int32
            |              |     +--ro address?             simple-address
            |              +--:(nat-traversal)
            |              |  +--ro nat-traversal
            |              |     +--ro ms-udp-port?        uint16
            |              |     +--ro etr-udp-port?       uint16
            |              |     +--ro global-etr-rloc?    simple-address
            |              |     +--ro ms-rloc?            simple-address
            |              |     +--ro private-etr-rloc?   simple-address
            |              |     +--ro rtr-rlocs*          simple-address
            |              +--:(explicit-locator-path)
            |              |  +--ro explicit-locator-path
            |              |     +--ro hop* [address]
            |              |        +--ro address     simple-address
            |              |        +--ro lrs-bits?   bits
            |              +--:(sourc-dest-key)
            |                 +--ro sourc-dest-key
            |                    +--ro source?   inet:ip-prefix
            |                    +--ro dest?     inet:ip-prefix
            +--ro ttl?                uint32
            +--ro authoritative?      bits
            +--ro (locator-list)?
               +--:(negative-mapping)
               |  +--ro map-reply-action?   map-reply-action
               +--:(positive-mapping)
                  +--ro rlocs
                     +--ro rloc* [id]
                +--rw
                        +--ro id             eid-id
                +--rw eid-address
                   +--rw afi?           enumeration
                   +--rw                    string
                        +--ro (address-type)?
                        |  +--:(interface-name)
                        |  |  +--ro interface?            if:interface-state-ref
                        |  +--:(address)
                        |     +--ro locator-address
                        |        +--ro afi                   lisp-address-family-ref
                        |        +--ro instance-id?          instance-id-type
                   +--rw
                        |        +--ro (address)?
                        |           +--:(ipv4)
                        |  +--rw           |  +--ro ipv4?                 inet:ipv4-address
                        |           +--:(ipv6)
                        |  +--rw           |  +--ro ipv6?                 inet:ipv6-address
                      +--:(mac-address)
                        |  +--rw mac-address?           +--:(mac)
                        |           |  +--ro mac?                  yang:mac-address
                        |           +--:(distinguished-name)
                        |           |  +--ro distinguished-name?   distinguished-name
                        |           +--:(lcaf)
                         +--rw
                        |              +--ro lcaf
                            +--rw lcaf-type?               enumeration
                            +--rw
                        |                 +--ro lcaf-type                lcaf-ref
                        |                 +--ro (address)?
                        |                    +--:(null-address)
                        |                    |  +--ro null-address
                        |                    |     +--ro address?   empty
                        |                    +--:(afi-list)
                        |                    |  +--ro afi-list
                        |                    |     +--ro address-list*   simple-address
                        |                    +--:(instance-id)
                        |                    |  +--ro instance-id
                        |                    |     +--ro instance-id?   instance-id-type
                        |                    |     +--ro mask-length?   uint8
                        |                    |     +--ro address?       simple-address
                        |                    +--:(as-number)
                        |     ...
                               +--:(sourc-dest-key)                    |     ...  +--ro as-number
                        |                    |     +--ro as?        inet:as-number
                        |                    |     +--ro address?   simple-address
                        |                    +--:(application-data)
                        |                    |  +--ro application-data
                        |                    |     +--ro address?            simple-address
                        |                    |     +--ro protocol?           uint8
                        |                    |     +--ro ip-tos?             int32
                        |                    |     +--ro local-port-low?     inet:port-number
                        |                    |     +--ro local-port-high?    inet:port-number
                        |                    |     +--ro remote-port-low?    inet:port-number
                        |                    |     +--ro remote-port-high?   inet:port-number
                        |                    +--:(geo-coordinates)
                        |                    |  +--ro geo-coordinates
                        |                    |     +--ro latitude?            bits
                        |                    |     +--ro latitude-degrees?    uint8
                        |                    |     +--ro latitude-minutes?    uint8
                        |                    |     +--ro latitude-seconds?    uint8
                        |                    |     +--ro longitude?           bits
                        |                    |     +--ro longitude-degrees?   uint16
                        |                    |     +--ro longitude-minutes?   uint8
                        |                    |     +--ro longitude-seconds?   uint8
                        |                    |     +--ro altitude?            int32
                        |                    |     +--ro address?             simple-address
                        |                    +--:(nat-traversal)
                        |                    |  +--ro nat-traversal
                        |                    |     +--ro ms-udp-port?        uint16
                        |                    |     +--ro etr-udp-port?       uint16
                        |                    |     +--ro global-etr-rloc?    simple-address
                        |                    |     +--ro ms-rloc?            simple-address
                        |                    |     +--ro private-etr-rloc?   simple-address
                        |                    |     +--ro rtr-rlocs*          simple-address
                        |                    +--:(explicit-locator-path)
                                     ...

3.  YANG model

   This section contains the YANG model for lisp configuration and the
   companion lisp-address-types module.

<CODE BEGINS> file "lisp-address-types@2015-03-23.yang"
                        |                    |  +--ro explicit-locator-path
                        |                    |     +--ro hop* [address]
                        |                    |        +--ro address     simple-address
                        |                    |        +--ro lrs-bits?   bits
                        |                    +--:(sourc-dest-key)
                        |                       +--ro sourc-dest-key
                        |                          +--ro source?   inet:ip-prefix
                        |                          +--ro dest?     inet:ip-prefix
                        +--ro priority?             uint8
                        +--ro weight?               uint8
                        +--ro multicast-priority?   uint8
                        +--ro multicast-weight?     uint8

3.2.  Module Definition

   module lisp-address-types lisp-itr {
     namespace "urn:ietf:params:xml:ns:yang:lisp-address-types"; "urn:ietf:params:xml:ns:yang:lisp-itr";
     prefix lisp-itr;
     import ietf-lisp {
       prefix lisp;
     }
     import ietf-inet-types lisp-address-types {
      prefix inet; lcaf;
     }
     import ietf-yang-types ietf-inet-types {
       prefix yang; inet;
     }
     organization
      "IETF LISP (Locator/ID Separation Protocol) Working Group";
     contact
       "lisp@ietf.org";
     description
       "This YANG module defines the LISP Canonical Address Formats (LCAF) generic configuration
        data for LISP. a LISP ITR. The module can be extended by vendors
        to define vendor-specific parameters. configuration parameters and
        policies.

        Copyright (c) 2015 IETF Trust and the persons identified as
        authors of the code.  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 6338; see
        the RFC itself for full legal notices.
       ";

     revision 2015-03-23 2015-07-02 {
       description
         "Initial revision.";
       reference
         "https://tools.ietf.org/html/rfc6830";
     }

  typedef instance-id-type {
    type uint32
     identity itr {
      range "0..16777214";
    }
       base lisp:lisp-device;
       description
         "LISP ITR.";
     }

  typedef simple-address
     augment "/lisp:lisp/lisp:devices/lisp:device" {
    type union
       when "lisp:type = lisp-itr:itr" {
         description
           "Augment is valid when LISP device type inet:ip-address;
      type yang:mac-address;
    } is ITR.";
       }

  grouping lcaf-address
       description
         "This augments LISP devices list with ITR specific
          parameters.";
       container itr-cfg {
         presence "LISP ITR operation enabled";
         description
           "ITR configuration";
         container rloc-probing {
           presence "RLOC probing active";
           description
             "RLOC-probing parameters";
           leaf lcaf-type interval {
             type enumeration {
        enum "null";
        enum "afi-list";
        enum "instance-id";
        enum "as-number";
        enum "application-data";
        enum "geo-coordinates";
        enum "opaque-key";
        enum "nat-ttraversal";
        enum "nonce-locator";
        enum "multicast-info";
        enum "explicit-locator-path";
        enum "security-key";
        enum "source-dest-key";
        enum "replication-list";
        enum "json-data-model";
        enum "key-value-address";
        enum "encapsulation-format";
      } uint16;
             units "seconds";
             description
               "Interval in seconds";
           }
    choice address {
      container as-number {
        when "lcaf-type = as-number";
           leaf as retries {
             type inet:as-number; uint8;
             description
               "Number of retries";
           }
           leaf address retries-interval {
             type simple-address; uint16;
             units "seconds";
             description
               "Interval in seconds between retries";
           }
         }
         container sourc-dest-key itr-rlocs {
        when "lcaf-type = source-dest-key";
           description
             "List of RLOCs of the ITR included in Map-Requests";

           list itr-rloc {
             key "id";
             description
               "ITR's list of RLOCs.";
             leaf source id {
               type inet:ip-prefix; string;
               description
                 "Unique RLOC id.";
             }
        leaf dest
             container address {
          type inet:ip-prefix;
               uses lcaf:lisp-address;
               description
                 "RLOC address in generic LISP address format.";
             }
           }
         }
         container explicit-locator-path local-eids {
        when "lcaf-type = explicit-locator-path";
           description
             "Container for an ITR's local list hop of EIDs";
           list local-eid {
             key "address"; "id";
             min-elements 1;
             description
               "List of EIDs from which the ITR forwards traffic.";
             leaf address id {
               type simple-address; lisp:eid-id;
               description
                 "Unique EID ID";
             }
          leaf lrs-bits {
            type bits
             container eid-address {
              bit lookup;
              bit rloc-probe;
              bit strict;
            }
          }
        }
               uses lcaf:lisp-address;
               description
                 "Addres in generic LISP address format";
             }
           }
         }

  grouping lisp-address {
    leaf afi {
      type enumeration
         container map-resolvers {
        enum "ipv4"
           description
             "The Map-Resolvers configured for the ITR.";
           list map-resolver {
          value
             key "id";
             min-elements 1;
        }
        enum "ipv6"
             description
               "List of Map-Resolvers configured for the ITR.";
             leaf id {
          value 2;
               type lisp:eid-id;
               description
                 "Id of the EID for which the Map-Server is
                  configured.";
             }
        enum "mac-address"
             container eid-address {
          value 6;
               uses lcaf:lisp-address;
               description
                 "EID for which the Map-Resolver is configured.";
             }
        enum "lcaf"
             leaf-list map-resolver-address {
          value 16387;
               type inet:ip-address;
               description
                 "Map-Resolver RLOC address.";
             }
           }
         }
         container proxy-etrs {
           description
             "Proxy ETRs configured for the ITR.";
           list proxy-etr {
             key "id";
             description
               "List of PETR configured for the ITR.";
             leaf instance-id id {
               type instance-id-type; lisp:eid-id;
               description
                 "Id of the EID for which the PETR is configured.";
             }
    choice address {
      case ipv4 {
        when "afi = ipv4";
        leaf ipv4
             container eid-address {
               uses lcaf:lisp-address;
               description
                 "EID for which the PETR is configured.";
             }
             leaf-list proxy-etr-address{
               type inet:ipv4-address; inet:ip-address;
               description
                 "PETR RLOC address.";
             }
           }
      case ipv6 {
        when "afi = ipv6";
        leaf ipv6
         }
         container static-mappings {
          type inet:ipv6-address;
           uses lisp:mappings;
           description
             "EID to RLOCs mappings cache.";
         }
       }
      case mac-address
     }
     augment "/lisp:lisp-state/lisp:devices/lisp:device" {
       when "afi "lisp:type = mac-address";
        leaf mac-address lisp-itr:itr" {
         description
           "Augment is valid when LISP device type yang:mac-address;
        } is ITR.";
       }
      case lcaf
       description
         "This augments LISP devices list state with ITR specific
          parameters.";
       container itr-state {
        when "afi = lcaf";
         config false;
         description
           "ITR state.";
         container lcaf learned-mappings {
           uses lcaf-address;
        } lisp:mappings;
           description
             "EID to RLOCs mappings cache.";
         }
       }
     }
   }

<CODE ENDS>

<CODE BEGINS> file "lisp@2015-03-23.yang"

4.  LISP ETR Module

   This module lisp captures the configuration data model of a LISP ETR.  The
   model also captures some operational data elements.

4.1.  Module Structure

module: lisp-etr
augment /lisp:lisp/lisp:devices/lisp:device:
   +--rw etr-cfg!
      +--rw local-eids
         +--rw local-eid* [id]
            +--rw id                       lisp:eid-id
            +--rw eid-address
            |  +--rw afi                   lisp-address-family-ref
            |  +--rw instance-id?          instance-id-type
            |  +--rw (address)?
            |     +--:(ipv4)
            |     |  +--rw ipv4?                 inet:ipv4-address
            |     +--:(ipv6)
            |     |  +--rw ipv6?                 inet:ipv6-address
            |     +--:(mac)
            |     |  +--rw mac?                  yang:mac-address
            |     +--:(distinguished-name)
            |     |  +--rw distinguished-name?   distinguished-name
            |     +--:(lcaf)
            |        +--rw lcaf
            |           +--rw lcaf-type                lcaf-ref
            |           +--rw (address)?
            |              +--:(null-address)
            |              |  +--rw null-address
            |              |     +--rw address?   empty
            |              +--:(afi-list)
            |              |  +--rw afi-list
            |              |     +--rw address-list*   simple-address
            |              +--:(instance-id)
            |              |  +--rw instance-id
            |              |     +--rw instance-id?   instance-id-type
            |              |     +--rw mask-length?   uint8
            |              |     +--rw address?       simple-address
            |              +--:(as-number)
            |              |  +--rw as-number
            |              |     +--rw as?        inet:as-number
            |              |     +--rw address?   simple-address
            |              +--:(application-data)
            |              |  +--rw application-data
            |              |     +--rw address?            simple-address
            |              |     +--rw protocol?           uint8
            |              |     +--rw ip-tos?             int32
            |              |     +--rw local-port-low?     inet:port-number
            |              |     +--rw local-port-high?    inet:port-number
            |              |     +--rw remote-port-low?    inet:port-number
            |              |     +--rw remote-port-high?   inet:port-number
            |              +--:(geo-coordinates)
            |              |  +--rw geo-coordinates
            |              |     +--rw latitude?            bits
            |              |     +--rw latitude-degrees?    uint8
            |              |     +--rw latitude-minutes?    uint8
            |              |     +--rw latitude-seconds?    uint8
            |              |     +--rw longitude?           bits
            |              |     +--rw longitude-degrees?   uint16
            |              |     +--rw longitude-minutes?   uint8
            |              |     +--rw longitude-seconds?   uint8
            |              |     +--rw altitude?            int32
            |              |     +--rw address?             simple-address
            |              +--:(nat-traversal)
            |              |  +--rw nat-traversal
            |              |     +--rw ms-udp-port?        uint16
            |              |     +--rw etr-udp-port?       uint16
            |              |     +--rw global-etr-rloc?    simple-address
            |              |     +--rw ms-rloc?            simple-address
            |              |     +--rw private-etr-rloc?   simple-address
            |              |     +--rw rtr-rlocs*          simple-address
            |              +--:(explicit-locator-path)
            |              |  +--rw explicit-locator-path
            |              |     +--rw hop* [address]
            |              |        +--rw address     simple-address
            |              |        +--rw lrs-bits?   bits
            |              +--:(sourc-dest-key)
            |                 +--rw sourc-dest-key
            |                    +--rw source?   inet:ip-prefix
            |                    +--rw dest?     inet:ip-prefix
            +--rw map-servers
            |  +--rw map-server* [address]
            |     +--rw address          inet:ip-address
            |     +--rw auth-key?        string
            |     +--rw auth-key-type?   lisp:auth-key-type
            +--rw rlocs
            |  +--rw rloc* [id]
            |     +--rw id                    string
            |     +--rw (address-type)?
            |     |  +--:(interface-name)
            |     |  |  +--rw interface?            if:interface-state-ref
            |     |  +--:(address)
            |     |     +--rw locator-address
            |     |        +--rw afi                   lisp-address-family-ref
            |     |        +--rw instance-id?          instance-id-type
            |     |        +--rw (address)?
            |     |           +--:(ipv4)
            |     |           |  +--rw ipv4?                 inet:ipv4-address
            |     |           +--:(ipv6)
            |     |           |  +--rw ipv6?                 inet:ipv6-address
            |     |           +--:(mac)
            |     |           |  +--rw mac?                  yang:mac-address
            |     |           +--:(distinguished-name)
            |     |           |  +--rw distinguished-name?   distinguished-name
            |     |           +--:(lcaf)
            |     |              +--rw lcaf
            |     |                 +--rw lcaf-type                lcaf-ref
            |     |                 +--rw (address)?
            |     |                    +--:(null-address)
            |     |                    |  +--rw null-address
            |     |                    |     +--rw address?   empty
            |     |                    +--:(afi-list)
            |     |                    |  +--rw afi-list
            |     |                    |     +--rw address-list*   simple-address
            |     |                    +--:(instance-id)
            |     |                    |  +--rw instance-id
            |     |                    |     +--rw instance-id?   instance-id-type
            |     |                    |     +--rw mask-length?   uint8
            |     |                    |     +--rw address?       simple-address
            |     |                    +--:(as-number)
            |     |                    |  +--rw as-number
            |     |                    |     +--rw as?        inet:as-number
            |     |                    |     +--rw address?   simple-address
            |     |                    +--:(application-data)
            |     |                    |  +--rw application-data
            |     |                    |     +--rw address?            simple-address
            |     |                    |     +--rw protocol?           uint8
            |     |                    |     +--rw ip-tos?             int32
            |     |                    |     +--rw local-port-low?     inet:port-number
            |     |                    |     +--rw local-port-high?    inet:port-number
            |     |                    |     +--rw remote-port-low?    inet:port-number
            |     |                    |     +--rw remote-port-high?   inet:port-number
            |     |                    +--:(geo-coordinates)
            |     |                    |  +--rw geo-coordinates
            |     |                    |     +--rw latitude?            bits
            |     |                    |     +--rw latitude-degrees?    uint8
            |     |                    |     +--rw latitude-minutes?    uint8
            |     |                    |     +--rw latitude-seconds?    uint8
            |     |                    |     +--rw longitude?           bits
            |     |                    |     +--rw longitude-degrees?   uint16
            |     |                    |     +--rw longitude-minutes?   uint8
            |     |                    |     +--rw longitude-seconds?   uint8
            |     |                    |     +--rw altitude?            int32
            |     |                    |     +--rw address?             simple-address
            |     |                    +--:(nat-traversal)
            |     |                    |  +--rw nat-traversal
            |     |                    |     +--rw ms-udp-port?        uint16
            |     |                    |     +--rw etr-udp-port?       uint16
            |     |                    |     +--rw global-etr-rloc?    simple-address
            |     |                    |     +--rw ms-rloc?            simple-address
            |     |                    |     +--rw private-etr-rloc?   simple-address
            |     |                    |     +--rw rtr-rlocs*          simple-address
            |     |                    +--:(explicit-locator-path)
            |     |                    |  +--rw explicit-locator-path
            |     |                    |     +--rw hop* [address]
            |     |                    |        +--rw address     simple-address
            |     |                    |        +--rw lrs-bits?   bits
            |     |                    +--:(sourc-dest-key)
            |     |                       +--rw sourc-dest-key
            |     |                          +--rw source?   inet:ip-prefix
            |     |                          +--rw dest?     inet:ip-prefix
            |     +--rw priority?             uint8
            |     +--rw weight?               uint8
            |     +--rw multicast-priority?   uint8
            |     +--rw multicast-weight?     uint8
            +--rw record-ttl?              uint32
            +--rw want-map-notify?         boolean
            +--rw proxy-reply?             boolean
            +--rw registration-interval?   uint16

4.2.  Module Definition

   module lisp-etr {
     namespace "urn:ietf:params:xml:ns:yang:lisp"; "urn:ietf:params:xml:ns:yang:lisp-etr";
     prefix lisp; lisp-etr;
     import ietf-inet-types ietf-lisp {
       prefix inet; lisp;
     }
     import lisp-address-types {
           prefix lcaf;
     }
     import ietf-inet-types {
       prefix inet;
     }
     organization
           "IETF LISP (Locator/ID Separation Protocol) Working Group";
     contact
       "lisp@ietf.org";
     description
       "This YANG module defines the generic configuration
        data for LISP. a LISP ETR. The module can be extended by vendors
        to define vendor-specific LISP configuration parameters and
        policies.

        Copyright (c) 2015 IETF Trust and the persons identified as
        authors of the code.  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 6338; see
        the RFC itself for full legal notices.
       ";
     revision 2015-03-23 2015-07-02 {
       description
         "Initial revision.";
       reference
         "https://tools.ietf.org/html/rfc6830";
     }

  typedef interface-name {
    description
      "Name of a device interface";
    type string;
  }

  typedef map-reply-action {
    description
      "Defines the lisp map-cache ACT type";
    type enumeration {
      enum "no-action" {
        value 0;
      }
      enum "natively-forward" {
        value 1;
      }
      enum "send-map-request" {
        value 2;
      }
      enum "drop" {
        value 3;
      }
    }
  }

  typedef eid-id {
    type string;
  }

  typedef instance-id-type {
    type uint32 {
      range "0..16777214";
    }
  }
  typedef auth-key-type {
    type enumeration {
      enum "none" {
        value 0;
      }
      enum "hmac-sha-1-96" {
        value 1;
      }
      enum "hmac-sha-256-128" {
        value 2;
      }
    }
  }

  feature itr {
    description
      "ITR operation supported";
  }

  feature
     identity etr {
       base lisp:lisp-device;
       description
      "ETR operation supported";
  }

  feature proxy-itr {
    description
      "PITR operation supported";
  }

  feature proxy-etr {
    description
      "PETR operation supported";
         "LISP ETR.";
     }

  feature map-server
     augment "/lisp:lisp/lisp:devices/lisp:device" {
    description
      "MS operation supported";
  }

  feature map-resolver
       when "lisp:type = lisp-etr:etr" {
         description
      "MR operation supported";
  }

  grouping locators {
    list rloc {
      key "name";
      leaf name {
        type string;
      }
      choice address-type {
        case interface-address {
          leaf interface {
            type interface-name;
          }
        }
        case lisp-address {
          container locator-address {
            uses lcaf:lisp-address;
          }
        }
      }
      leaf priority {
        type uint8;
      }
      leaf weight {
        type uint8;
      }
      leaf multicast-priority {
        type uint8;
      }
      leaf multicast-weight {
           "Augment is valid when LISP device type uint8;
      }
    } is ETR.";
       }

  grouping mappings {
       description
         "This augments LISP devices list mapping {
      key "id";
      leaf id {
        type eid-id;
      }
      container eid {
        uses lcaf:lisp-address;
      }
      leaf ttl {
        type uint32;
      }
      choice locator-list {
        case negative-mapping {
          leaf map-reply-action {
            type map-reply-action;
          }
        }
        case positive-mapping {
          container rlocs {
            uses locators;
          }
        }
        default "positive-mapping";
      }
    }
  } with ETR specific
          parameters.";
       container itr-cfg etr-cfg {
    if-feature itr;
         presence "LISP ITR ETR operation enabled";
    config true;
    container rloc-probing {
      presence "RLOC probing active";
      leaf interval {
        type uint16;
        units "seconds";
        description
          "Interval in seconds";
      }
      leaf retries {
        type uint8;
        description
          "Number of retries";
      }
      leaf retries-interval {
        type uint16;
        units "seconds";
         description
          "Interval in seconds between retries";
      }
    }
           "ETR configuration parameters.";
         container itr-rlocs local-eids {
           description
        "List of RLOCs of
             "EIDs served by the ITR included in Map-Requests";
      list itr-rloc {
        key "id";
        leaf id {
          type string;
        }
        container address {
          uses lcaf:lisp-address;
        }
      }
    }
    container local-eids { ETR.";
           list local-eid {
        min-elements 1;
             key "id";
        leaf id {
          type eid-id;
        }
        container eid-address {
          uses lcaf:lisp-address;
        }
      }
    }
    container map-resolvers {
      list map-resolver {
             min-elements 1;
        key "id";
             description
               "List of local EIDs.";
             leaf id {
               type eid-id;
        }
        container eid-address {
          uses lcaf:lisp-address;
        }
        leaf-list map-resolver-address {
          type inet:ip-address;
        }
      }
    }
    container proxy-etrs {
      list proxy-etr {
        key "id";
        leaf lisp:eid-id;
               description
                 "Unique id {
          type eid-id; of local EID.";
             }
             container eid-address {
               uses lcaf:lisp-address;
        }
        leaf-list proxy-etr-address {
          type inet:ip-address;
        }
      }
               description
                 "EID address in generic LISP address format.";
             }
             container map-cache {
      uses mappings {
        augment "mapping" {
          leaf static map-servers {
               description
              "A
                 "Map-Servers configured mapping is a static mapping. If for the mapping
               is learned, it is operational data and static is false.";
            type boolean;
            default "true";

          }
        }
      }
    }
  }
  container etr-cfg {
    if-feature etr;
    presence "LISP ETR operation enabled";
    config true;
    container local-eids {
      list local-eid {
        min-elements 1;
        key "id";
        leaf id {
          type eid-id;
        }
        container eid-address {
          uses lcaf:lisp-address;
        }
        container map-servers { ETR.";
               list map-server {
                 key "address";
                 description
                   "List of Map-Servers configured for the ETR.";
                 leaf address {
                   type inet:ip-address;
                   description
                     "Map-Server address.";
                 }
                 leaf auth-key {
                   type string;
                   description
                     "Map-Server authentication key.";
                 }
                 leaf auth-key-type {
                   type auth-key-type; lisp:auth-key-type;
                   description
                     "Map-Server authentication type.";
                 }
               }
             }
             container rlocs {
               uses locators; lisp:locators;
               description
                 "Locators mapped to local EID.";
             }
             leaf record-ttl {
               type uint32;
               description
                 "Validity period of the EID to RLOCs mapping provided
                  in Map-Replies.";
             }
             leaf want-map-notify {
               type boolean;
               description
                 "Flag which if set in a Map-Register requests that a
                  Map-Notify be sent in response.";
             }
             leaf proxy-reply {
               type boolean;
               description
                 "Flag which if set in a Map-Register requests that the
                  Map-Server proxy Map-Replies for the ETR.";
             }
             leaf registration-interval {
          units "seconds";
               type uint16;
               units "seconds";
               default "60";
               description
                 "Interval between consecutive Map-Register messages.";
             }
           }
         }
       }
  container map-server-cfg {
    if-feature map-server;
    presence "LISP
     }
   }

5.  LISP Map Server operation enabled";
    config true;
    container Module

   This module captures the configuration data model of a LISP Map
   Server [RFC6833].  The model also captures some operational data
   elements.

5.1.  Module Structure

module: lisp-map-server
augment /lisp:lisp/lisp:devices/lisp:device:
   +--rw map-server-cfg!
      +--rw sites {
      list site {
        key "site-id";
        leaf
      |  +--rw site* [site-id]
      |     +--rw site-id {
          type uint64;
        }
        container    uint64
      |     +--rw devices {
          list device {
            key "device-id";
            leaf
      |        +--rw device* [device-id]
      |           +--rw device-id {
              type uint64;
            }
            container    uint64
      |           +--rw auth-key {
              leaf auth-key-value {
                description
                  "clear text authentication key";
                type string;
              }
              leaf auth-key-type {
                type auth-key-type;
              }
            }
            container
      |           |  +--rw auth-key-value?   string
      |           |  +--rw auth-key-type?    lisp:auth-key-type
      |           +--rw eids {
              list eid {
                key "id";
                leaf
      |              +--rw eid* [id]
      |                 +--rw id {
                  type eid-id;
                }
                container                            lisp:eid-id
      |                 +--rw eid-address {
                  uses lcaf:lisp-address;
                }
                leaf more-specifics-accepted {
                  type boolean;
                }
                leaf mapping-expiration-timeout {
                  type int16;
                  units "seconds";
                  default "180";
                }

              }
            }
          }
        }
      }
    }
    container registered-mappings {
      uses mappings;
    }
    choice mapping-system {
      mandatory true;
      container ddt-mapping-system {
        presence "DDT Mapping System in use";
        leaf-list ddt-root {
          type inet:ip-address;
        }
        container authoritative-eids {
          list authoritative-eid {
            key "id";
            leaf id {
              type eid-id;
            }
            container
      |                 |  +--rw afi                   lisp-address-family-ref
      |                 |  +--rw instance-id?          instance-id-type
      |                 |  +--rw (address)?
      |                 |     +--:(ipv4)
      |                 |     |  +--rw ipv4?                 inet:ipv4-address
      |                 |     +--:(ipv6)
      |                 |     |  +--rw ipv6?                 inet:ipv6-address
      |                 |     +--:(mac)
      |                 |     |  +--rw mac?                  yang:mac-address
      |                 |     +--:(distinguished-name)
      |                 |     |  +--rw distinguished-name?   distinguished-name
      |                 |     +--:(lcaf)
      |                 |        +--rw lcaf
      |                 |           +--rw lcaf-type                lcaf-ref
      |                 |           +--rw (address)?
      |                 |              +--:(null-address)
      |                 |              |  +--rw null-address
      |                 |              |     +--rw address?   empty
      |                 |              +--:(afi-list)
      |                 |              |  +--rw afi-list
      |                 |              |     +--rw address-list*   simple-address
      |                 |              +--:(instance-id)
      |                 |              |  +--rw instance-id
      |                 |              |     +--rw instance-id?   instance-id-type
      |                 |              |     +--rw mask-length?   uint8
      |                 |              |     +--rw address?       simple-address
      |                 |              +--:(as-number)
      |                 |              |  +--rw as-number
      |                 |              |     +--rw as?        inet:as-number
      |                 |              |     +--rw address?   simple-address
      |                 |              +--:(application-data)
      |                 |              |  +--rw application-data
      |                 |              |     +--rw address?            simple-address
      |                 |              |     +--rw protocol?           uint8
      |                 |              |     +--rw ip-tos?             int32
      |                 |              |     +--rw local-port-low?     inet:port-number
      |                 |              |     +--rw local-port-high?    inet:port-number
      |                 |              |     +--rw remote-port-low?    inet:port-number
      |                 |              |     +--rw remote-port-high?   inet:port-number
      |                 |              +--:(geo-coordinates)
      |                 |              |  +--rw geo-coordinates
      |                 |              |     +--rw latitude?            bits
      |                 |              |     +--rw latitude-degrees?    uint8
      |                 |              |     +--rw latitude-minutes?    uint8
      |                 |              |     +--rw latitude-seconds?    uint8
      |                 |              |     +--rw longitude?           bits
      |                 |              |     +--rw longitude-degrees?   uint16
      |                 |              |     +--rw longitude-minutes?   uint8
      |                 |              |     +--rw longitude-seconds?   uint8
      |                 |              |     +--rw altitude?            int32
      |                 |              |     +--rw address?             simple-address
      |                 |              +--:(nat-traversal)
      |                 |              |  +--rw nat-traversal
      |                 |              |     +--rw ms-udp-port?        uint16
      |                 |              |     +--rw etr-udp-port?       uint16
      |                 |              |     +--rw global-etr-rloc?    simple-address
      |                 |              |     +--rw ms-rloc?            simple-address
      |                 |              |     +--rw private-etr-rloc?   simple-address
      |                 |              |     +--rw rtr-rlocs*          simple-address
      |                 |              +--:(explicit-locator-path)
      |                 |              |  +--rw explicit-locator-path
      |                 |              |     +--rw hop* [address]
      |                 |              |        +--rw address     simple-address
      |                 |              |        +--rw lrs-bits?   bits
      |                 |              +--:(sourc-dest-key)
      |                 |                 +--rw sourc-dest-key
      |                 |                    +--rw source?   inet:ip-prefix
      |                 |                    +--rw dest?     inet:ip-prefix
      |                 +--rw more-specifics-accepted?      boolean
      |                 +--rw mapping-expiration-timeout?   int16
      +--rw static-mappings
      |  +--rw mapping* [id]
      |     +--rw id                  eid-id
      |     +--rw eid
      |     |  +--rw afi                   lisp-address-family-ref
      |     |  +--rw instance-id?          instance-id-type
      |     |  +--rw (address)?
      |     |     +--:(ipv4)
      |     |     |  +--rw ipv4?                 inet:ipv4-address
      |     |     +--:(ipv6)
      |     |     |  +--rw ipv6?                 inet:ipv6-address
      |     |     +--:(mac)
      |     |     |  +--rw mac?                  yang:mac-address
      |     |     +--:(distinguished-name)
      |     |     |  +--rw distinguished-name?   distinguished-name
      |     |     +--:(lcaf)
      |     |        +--rw lcaf
      |     |           +--rw lcaf-type                lcaf-ref
      |     |           +--rw (address)?
      |     |              +--:(null-address)
      |     |              |  +--rw null-address
      |     |              |     +--rw address?   empty
      |     |              +--:(afi-list)
      |     |              |  +--rw afi-list
      |     |              |     +--rw address-list*   simple-address
      |     |              +--:(instance-id)
      |     |              |  +--rw instance-id
      |     |              |     +--rw instance-id?   instance-id-type
      |     |              |     +--rw mask-length?   uint8
      |     |              |     +--rw address?       simple-address
      |     |              +--:(as-number)
      |     |              |  +--rw as-number
      |     |              |     +--rw as?        inet:as-number
      |     |              |     +--rw address?   simple-address
      |     |              +--:(application-data)
      |     |              |  +--rw application-data
      |     |              |     +--rw address?            simple-address
      |     |              |     +--rw protocol?           uint8
      |     |              |     +--rw ip-tos?             int32
      |     |              |     +--rw local-port-low?     inet:port-number
      |     |              |     +--rw local-port-high?    inet:port-number
      |     |              |     +--rw remote-port-low?    inet:port-number
      |     |              |     +--rw remote-port-high?   inet:port-number
      |     |              +--:(geo-coordinates)
      |     |              |  +--rw geo-coordinates
      |     |              |     +--rw latitude?            bits
      |     |              |     +--rw latitude-degrees?    uint8
      |     |              |     +--rw latitude-minutes?    uint8
      |     |              |     +--rw latitude-seconds?    uint8
      |     |              |     +--rw longitude?           bits
      |     |              |     +--rw longitude-degrees?   uint16
      |     |              |     +--rw longitude-minutes?   uint8
      |     |              |     +--rw longitude-seconds?   uint8
      |     |              |     +--rw altitude?            int32
      |     |              |     +--rw address?             simple-address
      |     |              +--:(nat-traversal)
      |     |              |  +--rw nat-traversal
      |     |              |     +--rw ms-udp-port?        uint16
      |     |              |     +--rw etr-udp-port?       uint16
      |     |              |     +--rw global-etr-rloc?    simple-address
      |     |              |     +--rw ms-rloc?            simple-address
      |     |              |     +--rw private-etr-rloc?   simple-address
      |     |              |     +--rw rtr-rlocs*          simple-address
      |     |              +--:(explicit-locator-path)
      |     |              |  +--rw explicit-locator-path
      |     |              |     +--rw hop* [address]
      |     |              |        +--rw address     simple-address
      |     |              |        +--rw lrs-bits?   bits
      |     |              +--:(sourc-dest-key)
      |     |                 +--rw sourc-dest-key
      |     |                    +--rw source?   inet:ip-prefix
      |     |                    +--rw dest?     inet:ip-prefix
      |     +--rw ttl?                uint32
      |     +--rw authoritative?      bits
      |     +--rw (locator-list)?
      |        +--:(negative-mapping)
      |        |  +--rw map-reply-action?   map-reply-action
      |        +--:(positive-mapping)
      |           +--rw rlocs
      |              +--rw rloc* [id]
      |                 +--rw id                    string
      |                 +--rw (address-type)?
      |                 |  +--:(interface-name)
      |                 |  |  +--rw interface?            if:interface-state-ref
      |                 |  +--:(address)
      |                 |     +--rw locator-address
      |                 |        +--rw afi                   lisp-address-family-ref
      |                 |        +--rw instance-id?          instance-id-type
      |                 |        +--rw (address)?
      |                 |           +--:(ipv4)
      |                 |           |  +--rw ipv4?                 inet:ipv4-address
      |                 |           +--:(ipv6)
      |                 |           |  +--rw ipv6?                 inet:ipv6-address
      |                 |           +--:(mac)
      |                 |           |  +--rw mac?                  yang:mac-address
      |                 |           +--:(distinguished-name)
      |                 |           |  +--rw distinguished-name?   distinguished-name
      |                 |           +--:(lcaf)
      |                 |              +--rw lcaf
      |                 |                 +--rw lcaf-type                lcaf-ref
      |                 |                 +--rw (address)?
      |                 |                    +--:(null-address)
      |                 |                    |  +--rw null-address
      |                 |                    |     +--rw address?   empty
      |                 |                    +--:(afi-list)
      |                 |                    |  +--rw afi-list
      |                 |                    |     +--rw address-list*   simple-address
      |                 |                    +--:(instance-id)
      |                 |                    |  +--rw instance-id
      |                 |                    |     +--rw instance-id?   instance-id-type
      |                 |                    |     +--rw mask-length?   uint8
      |                 |                    |     +--rw address?       simple-address
      |                 |                    +--:(as-number)
      |                 |                    |  +--rw as-number
      |                 |                    |     +--rw as?        inet:as-number
      |                 |                    |     +--rw address?   simple-address
      |                 |                    +--:(application-data)
      |                 |                    |  +--rw application-data
      |                 |                    |     +--rw address?            simple-address
      |                 |                    |     +--rw protocol?           uint8
      |                 |                    |     +--rw ip-tos?             int32
      |                 |                    |     +--rw local-port-low?     inet:port-number
      |                 |                    |     +--rw local-port-high?    inet:port-number
      |                 |                    |     +--rw remote-port-low?    inet:port-number
      |                 |                    |     +--rw remote-port-high?   inet:port-number
      |                 |                    +--:(geo-coordinates)
      |                 |                    |  +--rw geo-coordinates
      |                 |                    |     +--rw latitude?            bits
      |                 |                    |     +--rw latitude-degrees?    uint8
      |                 |                    |     +--rw latitude-minutes?    uint8
      |                 |                    |     +--rw latitude-seconds?    uint8
      |                 |                    |     +--rw longitude?           bits
      |                 |                    |     +--rw longitude-degrees?   uint16
      |                 |                    |     +--rw longitude-minutes?   uint8
      |                 |                    |     +--rw longitude-seconds?   uint8
      |                 |                    |     +--rw altitude?            int32
      |                 |                    |     +--rw address?             simple-address
      |                 |                    +--:(nat-traversal)
      |                 |                    |  +--rw nat-traversal
      |                 |                    |     +--rw ms-udp-port?        uint16
      |                 |                    |     +--rw etr-udp-port?       uint16
      |                 |                    |     +--rw global-etr-rloc?    simple-address
      |                 |                    |     +--rw ms-rloc?            simple-address
      |                 |                    |     +--rw private-etr-rloc?   simple-address
      |                 |                    |     +--rw rtr-rlocs*          simple-address
      |                 |                    +--:(explicit-locator-path)
      |                 |                    |  +--rw explicit-locator-path
      |                 |                    |     +--rw hop* [address]
      |                 |                    |        +--rw address     simple-address
      |                 |                    |        +--rw lrs-bits?   bits
      |                 |                    +--:(sourc-dest-key)
      |                 |                       +--rw sourc-dest-key
      |                 |                          +--rw source?   inet:ip-prefix
      |                 |                          +--rw dest?     inet:ip-prefix
      |                 +--rw priority?             uint8
      |                 +--rw weight?               uint8
      |                 +--rw multicast-priority?   uint8
      |                 +--rw multicast-weight?     uint8
      +--rw (mapping-system)
         +--:(ddt-mapping-system)
         |  +--rw ddt-mapping-system!
         |     +--rw ddt-root*             inet:ip-address
         |     +--rw authoritative-eids
         |        +--rw authoritative-eid* [id]
         |           +--rw id             lisp:eid-id
         |           +--rw eid-address
         |              +--rw afi                   lisp-address-family-ref
         |              +--rw instance-id?          instance-id-type
         |              +--rw (address)?
         |                 +--:(ipv4)
         |                 |  +--rw ipv4?                 inet:ipv4-address
         |                 +--:(ipv6)
         |                 |  +--rw ipv6?                 inet:ipv6-address
         |                 +--:(mac)
         |                 |  +--rw mac?                  yang:mac-address
         |                 +--:(distinguished-name)
         |                 |  +--rw distinguished-name?   distinguished-name
         |                 +--:(lcaf)
         |                    +--rw lcaf
         |                       +--rw lcaf-type                lcaf-ref
         |                       +--rw (address)?
         |                          +--:(null-address)
         |                          |  +--rw null-address
         |                          |     +--rw address?   empty
         |                          +--:(afi-list)
         |                          |  +--rw afi-list
         |                          |     +--rw address-list*   simple-address
         |                          +--:(instance-id)
         |                          |  +--rw instance-id
         |                          |     +--rw instance-id?   instance-id-type
         |                          |     +--rw mask-length?   uint8
         |                          |     +--rw address?       simple-address
         |                          +--:(as-number)
         |                          |  +--rw as-number
         |                          |     +--rw as?        inet:as-number
         |                          |     +--rw address?   simple-address
         |                          +--:(application-data)
         |                          |  +--rw application-data
         |                          |     +--rw address?            simple-address
         |                          |     +--rw protocol?           uint8
         |                          |     +--rw ip-tos?             int32
         |                          |     +--rw local-port-low?     inet:port-number
         |                          |     +--rw local-port-high?    inet:port-number
         |                          |     +--rw remote-port-low?    inet:port-number
         |                          |     +--rw remote-port-high?   inet:port-number
         |                          +--:(geo-coordinates)
         |                          |  +--rw geo-coordinates
         |                          |     +--rw latitude?            bits
         |                          |     +--rw latitude-degrees?    uint8
         |                          |     +--rw latitude-minutes?    uint8
         |                          |     +--rw latitude-seconds?    uint8
         |                          |     +--rw longitude?           bits
         |                          |     +--rw longitude-degrees?   uint16
         |                          |     +--rw longitude-minutes?   uint8
         |                          |     +--rw longitude-seconds?   uint8
         |                          |     +--rw altitude?            int32
         |                          |     +--rw address?             simple-address
         |                          +--:(nat-traversal)
         |                          |  +--rw nat-traversal
         |                          |     +--rw ms-udp-port?        uint16
         |                          |     +--rw etr-udp-port?       uint16
         |                          |     +--rw global-etr-rloc?    simple-address
         |                          |     +--rw ms-rloc?            simple-address
         |                          |     +--rw private-etr-rloc?   simple-address
         |                          |     +--rw rtr-rlocs*          simple-address
         |                          +--:(explicit-locator-path)
         |                          |  +--rw explicit-locator-path
         |                          |     +--rw hop* [address]
         |                          |        +--rw address     simple-address
         |                          |        +--rw lrs-bits?   bits
         |                          +--:(sourc-dest-key)
         |                             +--rw sourc-dest-key
         |                                +--rw source?   inet:ip-prefix
         |                                +--rw dest?     inet:ip-prefix
         +--:(alt-mapping-system)
            +--rw alt-mapping-system!
augment /lisp:lisp-state/lisp:devices/lisp:device:
   +--ro ms-state
      +--ro registered-mappings
         +--ro mapping* [id]
            +--ro id                  eid-id
            +--ro eid
            |  +--ro afi                   lisp-address-family-ref
            |  +--ro instance-id?          instance-id-type
            |  +--ro (address)?
            |     +--:(ipv4)
            |     |  +--ro ipv4?                 inet:ipv4-address
            |     +--:(ipv6)
            |     |  +--ro ipv6?                 inet:ipv6-address
            |     +--:(mac)
            |     |  +--ro mac?                  yang:mac-address
            |     +--:(distinguished-name)
            |     |  +--ro distinguished-name?   distinguished-name
            |     +--:(lcaf)
            |        +--ro lcaf
            |           +--ro lcaf-type                lcaf-ref
            |           +--ro (address)?
            |              +--:(null-address)
            |              |  +--ro null-address
            |              |     +--ro address?   empty
            |              +--:(afi-list)
            |              |  +--ro afi-list
            |              |     +--ro address-list*   simple-address
            |              +--:(instance-id)
            |              |  +--ro instance-id
            |              |     +--ro instance-id?   instance-id-type
            |              |     +--ro mask-length?   uint8
            |              |     +--ro address?       simple-address
            |              +--:(as-number)
            |              |  +--ro as-number
            |              |     +--ro as?        inet:as-number
            |              |     +--ro address?   simple-address
            |              +--:(application-data)
            |              |  +--ro application-data
            |              |     +--ro address?            simple-address
            |              |     +--ro protocol?           uint8
            |              |     +--ro ip-tos?             int32
            |              |     +--ro local-port-low?     inet:port-number
            |              |     +--ro local-port-high?    inet:port-number
            |              |     +--ro remote-port-low?    inet:port-number
            |              |     +--ro remote-port-high?   inet:port-number
            |              +--:(geo-coordinates)
            |              |  +--ro geo-coordinates
            |              |     +--ro latitude?            bits
            |              |     +--ro latitude-degrees?    uint8
            |              |     +--ro latitude-minutes?    uint8
            |              |     +--ro latitude-seconds?    uint8
            |              |     +--ro longitude?           bits
            |              |     +--ro longitude-degrees?   uint16
            |              |     +--ro longitude-minutes?   uint8
            |              |     +--ro longitude-seconds?   uint8
            |              |     +--ro altitude?            int32
            |              |     +--ro address?             simple-address
            |              +--:(nat-traversal)
            |              |  +--ro nat-traversal
            |              |     +--ro ms-udp-port?        uint16
            |              |     +--ro etr-udp-port?       uint16
            |              |     +--ro global-etr-rloc?    simple-address
            |              |     +--ro ms-rloc?            simple-address
            |              |     +--ro private-etr-rloc?   simple-address
            |              |     +--ro rtr-rlocs*          simple-address
            |              +--:(explicit-locator-path)
            |              |  +--ro explicit-locator-path
            |              |     +--ro hop* [address]
            |              |        +--ro address     simple-address
            |              |        +--ro lrs-bits?   bits
            |              +--:(sourc-dest-key)
            |                 +--ro sourc-dest-key
            |                    +--ro source?   inet:ip-prefix
            |                    +--ro dest?     inet:ip-prefix
            +--ro ttl?                uint32
            +--ro authoritative?      bits
            +--ro (locator-list)?
               +--:(negative-mapping)
               |  +--ro map-reply-action?   map-reply-action
               +--:(positive-mapping)
                  +--ro rlocs
                     +--ro rloc* [id]
                        +--ro id                    string
                        +--ro (address-type)?
                        |  +--:(interface-name)
                        |  |  +--ro interface?            if:interface-state-ref
                        |  +--:(address)
                        |     +--ro locator-address
                        |        +--ro afi                   lisp-address-family-ref
                        |        +--ro instance-id?          instance-id-type
                        |        +--ro (address)?
                        |           +--:(ipv4)
                        |           |  +--ro ipv4?                 inet:ipv4-address
                        |           +--:(ipv6)
                        |           |  +--ro ipv6?                 inet:ipv6-address
                        |           +--:(mac)
                        |           |  +--ro mac?                  yang:mac-address
                        |           +--:(distinguished-name)
                        |           |  +--ro distinguished-name?   distinguished-name
                        |           +--:(lcaf)
                        |              +--ro lcaf
                        |                 +--ro lcaf-type                lcaf-ref
                        |                 +--ro (address)?
                        |                    +--:(null-address)
                        |                    |  +--ro null-address
                        |                    |     +--ro address?   empty
                        |                    +--:(afi-list)
                        |                    |  +--ro afi-list
                        |                    |     +--ro address-list*   simple-address
                        |                    +--:(instance-id)
                        |                    |  +--ro instance-id
                        |                    |     +--ro instance-id?   instance-id-type
                        |                    |     +--ro mask-length?   uint8
                        |                    |     +--ro address?       simple-address
                        |                    +--:(as-number)
                        |                    |  +--ro as-number
                        |                    |     +--ro as?        inet:as-number
                        |                    |     +--ro address?   simple-address
                        |                    +--:(application-data)
                        |                    |  +--ro application-data
                        |                    |     +--ro address?            simple-address
                        |                    |     +--ro protocol?           uint8
                        |                    |     +--ro ip-tos?             int32
                        |                    |     +--ro local-port-low?     inet:port-number
                        |                    |     +--ro local-port-high?    inet:port-number
                        |                    |     +--ro remote-port-low?    inet:port-number
                        |                    |     +--ro remote-port-high?   inet:port-number
                        |                    +--:(geo-coordinates)
                        |                    |  +--ro geo-coordinates
                        |                    |     +--ro latitude?            bits
                        |                    |     +--ro latitude-degrees?    uint8
                        |                    |     +--ro latitude-minutes?    uint8
                        |                    |     +--ro latitude-seconds?    uint8
                        |                    |     +--ro longitude?           bits
                        |                    |     +--ro longitude-degrees?   uint16
                        |                    |     +--ro longitude-minutes?   uint8
                        |                    |     +--ro longitude-seconds?   uint8
                        |                    |     +--ro altitude?            int32
                        |                    |     +--ro address?             simple-address
                        |                    +--:(nat-traversal)
                        |                    |  +--ro nat-traversal
                        |                    |     +--ro ms-udp-port?        uint16
                        |                    |     +--ro etr-udp-port?       uint16
                        |                    |     +--ro global-etr-rloc?    simple-address
                        |                    |     +--ro ms-rloc?            simple-address
                        |                    |     +--ro private-etr-rloc?   simple-address
                        |                    |     +--ro rtr-rlocs*          simple-address
                        |                    +--:(explicit-locator-path)
                        |                    |  +--ro explicit-locator-path
                        |                    |     +--ro hop* [address]
                        |                    |        +--ro address     simple-address
                        |                    |        +--ro lrs-bits?   bits
                        |                    +--:(sourc-dest-key)
                        |                       +--ro sourc-dest-key
                        |                          +--ro source?   inet:ip-prefix
                        |                          +--ro dest?     inet:ip-prefix
                        +--ro priority?             uint8
                        +--ro weight?               uint8
                        +--ro multicast-priority?   uint8
                        +--ro multicast-weight?     uint8

5.2.  Module Definition

   module lisp-map-server {
     namespace "urn:ietf:params:xml:ns:yang:lisp-map-server";
     prefix lisp-ms;
     import ietf-lisp {
       prefix lisp;
     }
     import lisp-address-types {
      prefix lcaf;
     }
     import ietf-inet-types {
       prefix inet;
     }
     organization
      "IETF LISP (Locator/ID Separation Protocol) Working Group";
     contact
       "lisp@ietf.org";
     description
       "This YANG module defines the generic configuration
        data for a LISP Map-Server. The module can be extended by
        vendors to define vendor-specific configuration parameters
        and policies.

        Copyright (c) 2015 IETF Trust and the persons identified as
        authors of the code.  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 6338; see
        the RFC itself for full legal notices.
       ";

     revision 2015-07-02 {
       description
         "Initial revision.";
       reference
         "https://tools.ietf.org/html/rfc6833";

     }
     identity ms {
       base lisp:lisp-device;
       description
         "LISP Map-Server.";
     }
     augment "/lisp:lisp/lisp:devices/lisp:device" {
       when "lisp:type = lisp-ms:ms" {
         description
           "Augment is valid when LISP device type is Map-Server.";
       }
       description
         "This augments LISP devices list with Map-Server specific
          parameters.";
       container map-server-cfg {
         presence "LISP Map-Server operation enabled";
         description
           "Map-Server configuration parameters.";
         container sites {
           description
             "Sites for which the Map-Server accepts registrations.";
           list site {
             key "site-id";
             description
               "List of sites for which the Map-Server acceptes
                registrations.";
             leaf site-id {
               type uint64;
               description
                 "Site identifier.";
             }
       //VINA: can be augmented to have below for per site auth-key
       //      leaf auth-key {
       //        description "clear text authentication key";
       //        type string;
       //      }
             container devices {
               description
                 "Site devices registered with the Map-Server.";
               list device {
                 key "device-id";
                 description
                   "List of site devices registered with the
                    Map-Server.";
                 leaf device-id {
                   type uint64;
                   description
                     "Device identifier.";

                 }
                 container auth-key {
                   description
                     "Device authentication key.";
                   leaf auth-key-value {
                     type string;
                     description
                       "Clear text authentication key";
                   }
                   leaf auth-key-type {
                     type lisp:auth-key-type;
                     description
                       "Authentication key type.";
                   }
                 }

                 container eids {
                   description
                     "EIDs registered by device.";
                   list eid {
                     key "id";
                     description
                       "List of EIDs registered by device.";
                     leaf id {
                       type lisp:eid-id;
                       description
                         "Id of the EID registered.";
                     }
                     container eid-address {
                       uses lcaf:lisp-address;
                       description
                         "EID in generic LISP address format registered
                          with the Map-Server.";
                     }
                     leaf more-specifics-accepted {
                         type boolean;
                         description
                           "Flag indicating if more specific prefixes
                            can be registered.";
                     }
                     leaf mapping-expiration-timeout {
                         type int16;
                         units "seconds";
                         default "180"; //3 times the mapregister int
                         description
                           "Time before mapping is expired if no new
                            registrations are received.";
                     }

           // VINA: can be augmented to have below for per-eid auth-key
           //          leaf auth-key {
           //            description "clear text authentication key";
           //            type string;
           //          }
                   }
                 }
               }
             }
           }
         }
         container static-mappings {
           uses lisp:mappings;
           description
             "Datastore of statically registred mappings.";
         }
         choice mapping-system {
           mandatory true;
           description
             "Interface to Mapping System.";
           container ddt-mapping-system {
             presence "DDT Mapping System in use";
             description
               "DDT Mapping System interface.";
             leaf-list ddt-root {
               type inet:ip-address;
               description
                 "List of DDT root address.";
             }
             container authoritative-eids {
               description
                 "Authoritative EIDs";
               list authoritative-eid {
                 key "id";
                 description
                   "List of authoritative EIDs.";
                 leaf id {
                   type lisp:eid-id;
                   description
                     "EID id.";
                 }
                 container eid-address {
                   uses lcaf:lisp-address;
                   description
                     "EID in generic LISP address format.";
                 }
               }
             }

           }
           container alt-mapping-system {
             presence "ALT Mapping System in use";
             description
               "ALT Mapping System interface.";
           // TBD
           }
         }
       }
     }
     augment "/lisp:lisp-state/lisp:devices/lisp:device" {
       when "lisp:type = lisp-ms:ms" {
         description
           "Augment is valid when LISP device type is Map-Server.";
       }
       description
         "This augments LISP devices list state with Map-Server
          specific parameters.";
       container ms-state {
         config false;
         description
           "Map-Server state.";
         container registered-mappings {
           uses lisp:mappings;
           description
             "Datastore of registred mappings.";
         }
       }
     }
   }

6.  LISP Map Resolver Module

   This module captures the configuration data model of a LISP Map
   Resolver [RFC6833].  The model also captures some operational data
   elements.

6.1.  Module Structure

   module: lisp-map-resolver
   augment /lisp:lisp/lisp:devices/lisp:device:
      +--rw map-resolver-cfg!
         +--rw (mapping-system)
            +--:(ddt-mapping-system)
            |  +--rw ddt-mapping-system!
            |     +--rw ddt-root*   inet:ip-address
            +--:(alt-mapping-system)
               +--rw alt-mapping-system!

6.2.  Module Definition

   module lisp-map-resolver {
     namespace "urn:ietf:params:xml:ns:yang:lisp-map-resolver";
     prefix lisp-mr;
     import ietf-lisp {
       prefix lisp;
     }
     import ietf-inet-types {
       prefix inet;
     }
     organization
      "IETF LISP (Locator/ID Separation Protocol) Working Group";
     contact
       "lisp@ietf.org";
     description
       "This YANG module defines the generic configuration
        data for a LISP Map-Resolver. The module can be extended by
        vendors to define vendor-specific configuration parameters
        and policies.

        Copyright (c) 2015 IETF Trust and the persons identified as
        authors of the code.  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 6338; see
        the RFC itself for full legal notices.
       ";
     revision 2015-07-02 {
       description
         "Initial revision.";
       reference
         "https://tools.ietf.org/html/rfc6833";
     }
     identity mr {
       base lisp:lisp-device;
       description
         "LISP Map-Resolver.";
     }
     augment "/lisp:lisp/lisp:devices/lisp:device" {
       when "lisp:type = lisp-mr:mr" {
         description
           "Augment is valid when LISP device type is Map-Resolver.";
       }
       description
         "This augments LISP devices list with Map-Resolver specific
          parameters.";
       container map-resolver-cfg {
    if-feature map-resolver;
         presence "LISP Map-Resolver operation enabled";
    config true;
         description
           "Map-Resolver configuration parameters.";
         choice mapping-system {
           mandatory true;
           description
             "Mapping system interface.";
           container ddt-mapping-system {
             presence "DDT Mapping System in use";
             description
               "DDT mapping system interface.";
             leaf-list ddt-root {
               type inet:ip-address;
               description
                 "List of DDT root addresses.";
             }
           }
           container alt-mapping-system { alt-mapping-system{
             presence "ALT Mapping System in use";
             description
               "ALT mapping system interface.";
            // TBD
           }
         }
     // VE: move to operational model/container
     //    container mappings {
     //      config false;
     //      uses mappings;
     //    }
       }
     }
     // FC : should we add as operational data
     // cached mappings?
   }

7.  LISP Proxy ITR Module

   This module captures the configuration data model of a LISP Proxy ITR
   [RFC6832].  The model may also capture some operational data
   elements.

7.1.  Module Structure

module: lisp-pitr
augment /lisp:lisp/lisp:devices/lisp:device:
   +--rw proxy-itr-cfg!
      +--rw servicing-eids
      |  +--rw eid* [id]
      |     +--rw id             lisp:eid-id
      |     +--rw eid-address
      |        +--rw afi                   lisp-address-family-ref
      |        +--rw instance-id?          instance-id-type
      |        +--rw (address)?
      |           +--:(ipv4)
      |           |  +--rw ipv4?                 inet:ipv4-address
      |           +--:(ipv6)
      |           |  +--rw ipv6?                 inet:ipv6-address
      |           +--:(mac)
      |           |  +--rw mac?                  yang:mac-address
      |           +--:(distinguished-name)
      |           |  +--rw distinguished-name?   distinguished-name
      |           +--:(lcaf)
      |              +--rw lcaf
      |                 +--rw lcaf-type                lcaf-ref
      |                 +--rw (address)?
      |                    +--:(null-address)
      |                    |  +--rw null-address
      |                    |     +--rw address?   empty
      |                    +--:(afi-list)
      |                    |  +--rw afi-list
      |                    |     +--rw address-list*   simple-address
      |                    +--:(instance-id)
      |                    |  +--rw instance-id
      |                    |     +--rw instance-id?   instance-id-type
      |                    |     +--rw mask-length?   uint8
      |                    |     +--rw address?       simple-address
      |                    +--:(as-number)
      |                    |  +--rw as-number
      |                    |     +--rw as?        inet:as-number
      |                    |     +--rw address?   simple-address
      |                    +--:(application-data)
      |                    |  +--rw application-data
      |                    |     +--rw address?            simple-address
      |                    |     +--rw protocol?           uint8
      |                    |     +--rw ip-tos?             int32
      |                    |     +--rw local-port-low?     inet:port-number
      |                    |     +--rw local-port-high?    inet:port-number
      |                    |     +--rw remote-port-low?    inet:port-number
      |                    |     +--rw remote-port-high?   inet:port-number
      |                    +--:(geo-coordinates)
      |                    |  +--rw geo-coordinates
      |                    |     +--rw latitude?            bits
      |                    |     +--rw latitude-degrees?    uint8
      |                    |     +--rw latitude-minutes?    uint8
      |                    |     +--rw latitude-seconds?    uint8
      |                    |     +--rw longitude?           bits
      |                    |     +--rw longitude-degrees?   uint16
      |                    |     +--rw longitude-minutes?   uint8
      |                    |     +--rw longitude-seconds?   uint8
      |                    |     +--rw altitude?            int32
      |                    |     +--rw address?             simple-address
      |                    +--:(nat-traversal)
      |                    |  +--rw nat-traversal
      |                    |     +--rw ms-udp-port?        uint16
      |                    |     +--rw etr-udp-port?       uint16
      |                    |     +--rw global-etr-rloc?    simple-address
      |                    |     +--rw ms-rloc?            simple-address
      |                    |     +--rw private-etr-rloc?   simple-address
      |                    |     +--rw rtr-rlocs*          simple-address
      |                    +--:(explicit-locator-path)
      |                    |  +--rw explicit-locator-path
      |                    |     +--rw hop* [address]
      |                    |        +--rw address     simple-address
      |                    |        +--rw lrs-bits?   bits
      |                    +--:(sourc-dest-key)
      |                       +--rw sourc-dest-key
      |                          +--rw source?   inet:ip-prefix
      |                          +--rw dest?     inet:ip-prefix
      +--rw map-resolvers
      |  +--rw map-resolver* [id]
      |     +--rw id         lisp:eid-id
      |     +--rw eid
      |     |  +--rw afi                   lisp-address-family-ref
      |     |  +--rw instance-id?          instance-id-type
      |     |  +--rw (address)?
      |     |     +--:(ipv4)
      |     |     |  +--rw ipv4?                 inet:ipv4-address
      |     |     +--:(ipv6)
      |     |     |  +--rw ipv6?                 inet:ipv6-address
      |     |     +--:(mac)
      |     |     |  +--rw mac?                  yang:mac-address
      |     |     +--:(distinguished-name)
      |     |     |  +--rw distinguished-name?   distinguished-name
      |     |     +--:(lcaf)
      |     |        +--rw lcaf
      |     |           +--rw lcaf-type                lcaf-ref
      |     |           +--rw (address)?
      |     |              +--:(null-address)
      |     |              |  +--rw null-address
      |     |              |     +--rw address?   empty
      |     |              +--:(afi-list)
      |     |              |  +--rw afi-list
      |     |              |     +--rw address-list*   simple-address
      |     |              +--:(instance-id)
      |     |              |  +--rw instance-id
      |     |              |     +--rw instance-id?   instance-id-type
      |     |              |     +--rw mask-length?   uint8
      |     |              |     +--rw address?       simple-address
      |     |              +--:(as-number)
      |     |              |  +--rw as-number
      |     |              |     +--rw as?        inet:as-number
      |     |              |     +--rw address?   simple-address
      |     |              +--:(application-data)
      |     |              |  +--rw application-data
      |     |              |     +--rw address?            simple-address
      |     |              |     +--rw protocol?           uint8
      |     |              |     +--rw ip-tos?             int32
      |     |              |     +--rw local-port-low?     inet:port-number
      |     |              |     +--rw local-port-high?    inet:port-number
      |     |              |     +--rw remote-port-low?    inet:port-number
      |     |              |     +--rw remote-port-high?   inet:port-number
      |     |              +--:(geo-coordinates)
      |     |              |  +--rw geo-coordinates
      |     |              |     +--rw latitude?            bits
      |     |              |     +--rw latitude-degrees?    uint8
      |     |              |     +--rw latitude-minutes?    uint8
      |     |              |     +--rw latitude-seconds?    uint8
      |     |              |     +--rw longitude?           bits
      |     |              |     +--rw longitude-degrees?   uint16
      |     |              |     +--rw longitude-minutes?   uint8
      |     |              |     +--rw longitude-seconds?   uint8
      |     |              |     +--rw altitude?            int32
      |     |              |     +--rw address?             simple-address
      |     |              +--:(nat-traversal)
      |     |              |  +--rw nat-traversal
      |     |              |     +--rw ms-udp-port?        uint16
      |     |              |     +--rw etr-udp-port?       uint16
      |     |              |     +--rw global-etr-rloc?    simple-address
      |     |              |     +--rw ms-rloc?            simple-address
      |     |              |     +--rw private-etr-rloc?   simple-address
      |     |              |     +--rw rtr-rlocs*          simple-address
      |     |              +--:(explicit-locator-path)
      |     |              |  +--rw explicit-locator-path
      |     |              |     +--rw hop* [address]
      |     |              |        +--rw address     simple-address
      |     |              |        +--rw lrs-bits?   bits
      |     |              +--:(sourc-dest-key)
      |     |                 +--rw sourc-dest-key
      |     |                    +--rw source?   inet:ip-prefix
      |     |                    +--rw dest?     inet:ip-prefix
      |     +--rw address*   inet:ip-address
      +--rw static-mappings
         +--rw mapping* [id]
            +--rw id                  eid-id
            +--rw eid
            |  +--rw afi                   lisp-address-family-ref
            |  +--rw instance-id?          instance-id-type
            |  +--rw (address)?
            |     +--:(ipv4)
            |     |  +--rw ipv4?                 inet:ipv4-address
            |     +--:(ipv6)
            |     |  +--rw ipv6?                 inet:ipv6-address
            |     +--:(mac)
            |     |  +--rw mac?                  yang:mac-address
            |     +--:(distinguished-name)
            |     |  +--rw distinguished-name?   distinguished-name
            |     +--:(lcaf)
            |        +--rw lcaf
            |           +--rw lcaf-type                lcaf-ref
            |           +--rw (address)?
            |              +--:(null-address)
            |              |  +--rw null-address
            |              |     +--rw address?   empty
            |              +--:(afi-list)
            |              |  +--rw afi-list
            |              |     +--rw address-list*   simple-address
            |              +--:(instance-id)
            |              |  +--rw instance-id
            |              |     +--rw instance-id?   instance-id-type
            |              |     +--rw mask-length?   uint8
            |              |     +--rw address?       simple-address
            |              +--:(as-number)
            |              |  +--rw as-number
            |              |     +--rw as?        inet:as-number
            |              |     +--rw address?   simple-address
            |              +--:(application-data)
            |              |  +--rw application-data
            |              |     +--rw address?            simple-address
            |              |     +--rw protocol?           uint8
            |              |     +--rw ip-tos?             int32
            |              |     +--rw local-port-low?     inet:port-number
            |              |     +--rw local-port-high?    inet:port-number
            |              |     +--rw remote-port-low?    inet:port-number
            |              |     +--rw remote-port-high?   inet:port-number
            |              +--:(geo-coordinates)
            |              |  +--rw geo-coordinates
            |              |     +--rw latitude?            bits
            |              |     +--rw latitude-degrees?    uint8
            |              |     +--rw latitude-minutes?    uint8
            |              |     +--rw latitude-seconds?    uint8
            |              |     +--rw longitude?           bits
            |              |     +--rw longitude-degrees?   uint16
            |              |     +--rw longitude-minutes?   uint8
            |              |     +--rw longitude-seconds?   uint8
            |              |     +--rw altitude?            int32
            |              |     +--rw address?             simple-address
            |              +--:(nat-traversal)
            |              |  +--rw nat-traversal
            |              |     +--rw ms-udp-port?        uint16
            |              |     +--rw etr-udp-port?       uint16
            |              |     +--rw global-etr-rloc?    simple-address
            |              |     +--rw ms-rloc?            simple-address
            |              |     +--rw private-etr-rloc?   simple-address
            |              |     +--rw rtr-rlocs*          simple-address
            |              +--:(explicit-locator-path)
            |              |  +--rw explicit-locator-path
            |              |     +--rw hop* [address]
            |              |        +--rw address     simple-address
            |              |        +--rw lrs-bits?   bits
            |              +--:(sourc-dest-key)
            |                 +--rw sourc-dest-key
            |                    +--rw source?   inet:ip-prefix
            |                    +--rw dest?     inet:ip-prefix
            +--rw ttl?                uint32
            +--rw authoritative?      bits
            +--rw (locator-list)?
               +--:(negative-mapping)
               |  +--rw map-reply-action?   map-reply-action
               +--:(positive-mapping)
                  +--rw rlocs
                     +--rw rloc* [id]
                        +--rw id                    string
                        +--rw (address-type)?
                        |  +--:(interface-name)
                        |  |  +--rw interface?            if:interface-state-ref
                        |  +--:(address)
                        |     +--rw locator-address
                        |        +--rw afi                   lisp-address-family-ref
                        |        +--rw instance-id?          instance-id-type
                        |        +--rw (address)?
                        |           +--:(ipv4)
                        |           |  +--rw ipv4?                 inet:ipv4-address
                        |           +--:(ipv6)
                        |           |  +--rw ipv6?                 inet:ipv6-address
                        |           +--:(mac)
                        |           |  +--rw mac?                  yang:mac-address
                        |           +--:(distinguished-name)
                        |           |  +--rw distinguished-name?   distinguished-name
                        |           +--:(lcaf)
                        |              +--rw lcaf
                        |                 +--rw lcaf-type                lcaf-ref
                        |                 +--rw (address)?
                        |                    +--:(null-address)
                        |                    |  +--rw null-address
                        |                    |     +--rw address?   empty
                        |                    +--:(afi-list)
                        |                    |  +--rw afi-list
                        |                    |     +--rw address-list*   simple-address
                        |                    +--:(instance-id)
                        |                    |  +--rw instance-id
                        |                    |     +--rw instance-id?   instance-id-type
                        |                    |     +--rw mask-length?   uint8
                        |                    |     +--rw address?       simple-address
                        |                    +--:(as-number)
                        |                    |  +--rw as-number
                        |                    |     +--rw as?        inet:as-number
                        |                    |     +--rw address?   simple-address
                        |                    +--:(application-data)
                        |                    |  +--rw application-data
                        |                    |     +--rw address?            simple-address
                        |                    |     +--rw protocol?           uint8
                        |                    |     +--rw ip-tos?             int32
                        |                    |     +--rw local-port-low?     inet:port-number
                        |                    |     +--rw local-port-high?    inet:port-number
                        |                    |     +--rw remote-port-low?    inet:port-number
                        |                    |     +--rw remote-port-high?   inet:port-number
                        |                    +--:(geo-coordinates)
                        |                    |  +--rw geo-coordinates
                        |                    |     +--rw latitude?            bits
                        |                    |     +--rw latitude-degrees?    uint8
                        |                    |     +--rw latitude-minutes?    uint8
                        |                    |     +--rw latitude-seconds?    uint8
                        |                    |     +--rw longitude?           bits
                        |                    |     +--rw longitude-degrees?   uint16
                        |                    |     +--rw longitude-minutes?   uint8
                        |                    |     +--rw longitude-seconds?   uint8
                        |                    |     +--rw altitude?            int32
                        |                    |     +--rw address?             simple-address
                        |                    +--:(nat-traversal)
                        |                    |  +--rw nat-traversal
                        |                    |     +--rw ms-udp-port?        uint16
                        |                    |     +--rw etr-udp-port?       uint16
                        |                    |     +--rw global-etr-rloc?    simple-address
                        |                    |     +--rw ms-rloc?            simple-address
                        |                    |     +--rw private-etr-rloc?   simple-address
                        |                    |     +--rw rtr-rlocs*          simple-address
                        |                    +--:(explicit-locator-path)
                        |                    |  +--rw explicit-locator-path
                        |                    |     +--rw hop* [address]
                        |                    |        +--rw address     simple-address
                        |                    |        +--rw lrs-bits?   bits
                        |                    +--:(sourc-dest-key)
                        |                       +--rw sourc-dest-key
                        |                          +--rw source?   inet:ip-prefix
                        |                          +--rw dest?     inet:ip-prefix
                        +--rw priority?             uint8
                        +--rw weight?               uint8
                        +--rw multicast-priority?   uint8
                        +--rw multicast-weight?     uint8
augment /lisp:lisp-state/lisp:devices/lisp:device:
   +--ro pitr-state
      +--ro learned-mappings
         +--ro mapping* [id]
            +--ro id                  eid-id
            +--ro eid
            |  +--ro afi                   lisp-address-family-ref
            |  +--ro instance-id?          instance-id-type
            |  +--ro (address)?
            |     +--:(ipv4)
            |     |  +--ro ipv4?                 inet:ipv4-address
            |     +--:(ipv6)
            |     |  +--ro ipv6?                 inet:ipv6-address
            |     +--:(mac)
            |     |  +--ro mac?                  yang:mac-address
            |     +--:(distinguished-name)
            |     |  +--ro distinguished-name?   distinguished-name
            |     +--:(lcaf)
            |        +--ro lcaf
            |           +--ro lcaf-type                lcaf-ref
            |           +--ro (address)?
            |              +--:(null-address)
            |              |  +--ro null-address
            |              |     +--ro address?   empty
            |              +--:(afi-list)
            |              |  +--ro afi-list
            |              |     +--ro address-list*   simple-address
            |              +--:(instance-id)
            |              |  +--ro instance-id
            |              |     +--ro instance-id?   instance-id-type
            |              |     +--ro mask-length?   uint8
            |              |     +--ro address?       simple-address
            |              +--:(as-number)
            |              |  +--ro as-number
            |              |     +--ro as?        inet:as-number
            |              |     +--ro address?   simple-address
            |              +--:(application-data)
            |              |  +--ro application-data
            |              |     +--ro address?            simple-address
            |              |     +--ro protocol?           uint8
            |              |     +--ro ip-tos?             int32
            |              |     +--ro local-port-low?     inet:port-number
            |              |     +--ro local-port-high?    inet:port-number
            |              |     +--ro remote-port-low?    inet:port-number
            |              |     +--ro remote-port-high?   inet:port-number
            |              +--:(geo-coordinates)
            |              |  +--ro geo-coordinates
            |              |     +--ro latitude?            bits
            |              |     +--ro latitude-degrees?    uint8
            |              |     +--ro latitude-minutes?    uint8
            |              |     +--ro latitude-seconds?    uint8
            |              |     +--ro longitude?           bits
            |              |     +--ro longitude-degrees?   uint16
            |              |     +--ro longitude-minutes?   uint8
            |              |     +--ro longitude-seconds?   uint8
            |              |     +--ro altitude?            int32
            |              |     +--ro address?             simple-address
            |              +--:(nat-traversal)
            |              |  +--ro nat-traversal
            |              |     +--ro ms-udp-port?        uint16
            |              |     +--ro etr-udp-port?       uint16
            |              |     +--ro global-etr-rloc?    simple-address
            |              |     +--ro ms-rloc?            simple-address
            |              |     +--ro private-etr-rloc?   simple-address
            |              |     +--ro rtr-rlocs*          simple-address
            |              +--:(explicit-locator-path)
            |              |  +--ro explicit-locator-path
            |              |     +--ro hop* [address]
            |              |        +--ro address     simple-address
            |              |        +--ro lrs-bits?   bits
            |              +--:(sourc-dest-key)
            |                 +--ro sourc-dest-key
            |                    +--ro source?   inet:ip-prefix
            |                    +--ro dest?     inet:ip-prefix
            +--ro ttl?                uint32
            +--ro authoritative?      bits
            +--ro (locator-list)?
               +--:(negative-mapping)
               |  +--ro map-reply-action?   map-reply-action
               +--:(positive-mapping)
                  +--ro rlocs
                     +--ro rloc* [id]
                        +--ro id                    string
                        +--ro (address-type)?
                        |  +--:(interface-name)
                        |  |  +--ro interface?            if:interface-state-ref
                        |  +--:(address)
                        |     +--ro locator-address
                        |        +--ro afi                   lisp-address-family-ref
                        |        +--ro instance-id?          instance-id-type
                        |        +--ro (address)?
                        |           +--:(ipv4)
                        |           |  +--ro ipv4?                 inet:ipv4-address
                        |           +--:(ipv6)
                        |           |  +--ro ipv6?                 inet:ipv6-address
                        |           +--:(mac)
                        |           |  +--ro mac?                  yang:mac-address
                        |           +--:(distinguished-name)
                        |           |  +--ro distinguished-name?   distinguished-name
                        |           +--:(lcaf)
                        |              +--ro lcaf
                        |                 +--ro lcaf-type                lcaf-ref
                        |                 +--ro (address)?
                        |                    +--:(null-address)
                        |                    |  +--ro null-address
                        |                    |     +--ro address?   empty
                        |                    +--:(afi-list)
                        |                    |  +--ro afi-list
                        |                    |     +--ro address-list*   simple-address
                        |                    +--:(instance-id)
                        |                    |  +--ro instance-id
                        |                    |     +--ro instance-id?   instance-id-type
                        |                    |     +--ro mask-length?   uint8
                        |                    |     +--ro address?       simple-address
                        |                    +--:(as-number)
                        |                    |  +--ro as-number
                        |                    |     +--ro as?        inet:as-number
                        |                    |     +--ro address?   simple-address
                        |                    +--:(application-data)
                        |                    |  +--ro application-data
                        |                    |     +--ro address?            simple-address
                        |                    |     +--ro protocol?           uint8
                        |                    |     +--ro ip-tos?             int32
                        |                    |     +--ro local-port-low?     inet:port-number
                        |                    |     +--ro local-port-high?    inet:port-number
                        |                    |     +--ro remote-port-low?    inet:port-number
                        |                    |     +--ro remote-port-high?   inet:port-number
                        |                    +--:(geo-coordinates)
                        |                    |  +--ro geo-coordinates
                        |                    |     +--ro latitude?            bits
                        |                    |     +--ro latitude-degrees?    uint8
                        |                    |     +--ro latitude-minutes?    uint8
                        |                    |     +--ro latitude-seconds?    uint8
                        |                    |     +--ro longitude?           bits
                        |                    |     +--ro longitude-degrees?   uint16
                        |                    |     +--ro longitude-minutes?   uint8
                        |                    |     +--ro longitude-seconds?   uint8
                        |                    |     +--ro altitude?            int32
                        |                    |     +--ro address?             simple-address
                        |                    +--:(nat-traversal)
                        |                    |  +--ro nat-traversal
                        |                    |     +--ro ms-udp-port?        uint16
                        |                    |     +--ro etr-udp-port?       uint16
                        |                    |     +--ro global-etr-rloc?    simple-address
                        |                    |     +--ro ms-rloc?            simple-address
                        |                    |     +--ro private-etr-rloc?   simple-address
                        |                    |     +--ro rtr-rlocs*          simple-address
                        |                    +--:(explicit-locator-path)
                        |                    |  +--ro explicit-locator-path
                        |                    |     +--ro hop* [address]
                        |                    |        +--ro address     simple-address
                        |                    |        +--ro lrs-bits?   bits
                        |                    +--:(sourc-dest-key)
                        |                       +--ro sourc-dest-key
                        |                          +--ro source?   inet:ip-prefix
                        |                          +--ro dest?     inet:ip-prefix
                        +--ro priority?             uint8
                        +--ro weight?               uint8
                        +--ro multicast-priority?   uint8
                        +--ro multicast-weight?     uint8

7.2.  Module Definition

   module lisp-pitr {
     namespace "urn:ietf:params:xml:ns:yang:lisp-pitr";
     prefix lisp-pitr;
     import ietf-lisp {
       prefix lisp;
     }
     import lisp-address-types {
      prefix lcaf;
     }
     import ietf-inet-types {
       prefix inet;
     }
     organization
      "IETF LISP (Locator/ID Separation Protocol) Working Group";
     contact
       "lisp@ietf.org";
     description
       "This YANG module defines the generic configuration
        data for a LISP PITR. The module can be extended by vendors
        to define vendor-specific configuration parameters and
        policies.

        Copyright (c) 2015 IETF Trust and the persons identified as
        authors of the code.  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 6338; see
        the RFC itself for full legal notices.
       ";
     revision 2015-07-02 {
       description
         "Initial revision.";
       reference
         "https://tools.ietf.org/html/rfc6832";
     }
     identity pitr {
       base lisp:lisp-device;
       description
         "LISP PITR.";
     }
     augment "/lisp:lisp/lisp:devices/lisp:device" {
       when "lisp:type = lisp-pitr:pitr" {
         description
           "Augment is valid when LISP device type is PITR.";
       }
       description
         "This augments LISP devices list with PITR specific
          parameters.";
       container proxy-itr-cfg {
    if-feature proxy-itr;
         presence "LISP PITR operation enabled";
    config true;
         description
           "Proxy-ITR configuration parameters.";
         container servicing-eids {
           description
             "EIDs serviced by the PITR.";
           list eid {
             key "id";
             description
               "List of EIDs serviced by the PITR.";
             leaf id {
               type eid-id; lisp:eid-id;
               description
                 "Id of serviced EID.";
             }
             container eid-address {
               uses lcaf:lisp-address;
               description
                 "Serviced EID address in generic LISP address format.";
             }
           }
         }

         container map-resolvers {
           description
             "Map-Resolvers configured for PITR.";
           list map-resolver {
             key "id";
             description
               "List of Map-Resolvers configured for PITR.";
             leaf id {
               type eid-id; lisp:eid-id;
               description
                 "Id of EID for which the Map-Resolver is used.";
             }
             container eid-address eid {
               uses lcaf:lisp-address;
               description
                 "EID for which the Map-Resolver is used.";
             }
             leaf-list map-resolver address {
          min-elements 1;
               type inet:ip-address;
               min-elements 1;
               description
                 "List of Map-Resolver's addresses.";
             }
           }
         }
         container map-cache static-mappings{
           uses lisp:mappings;
           description
             "EID to RLOCs mappings cache.";
         }
       }
     }
     augment "/lisp:lisp-state/lisp:devices/lisp:device" {
       when "lisp:type = lisp-pitr:pitr" {
         description
           "Augment is valid when LISP device type is PITR.";
       }
       description
         "This augments LISP devices list state with PITR specific
          parameters.";
       container pitr-state {
         config false;
         description
           "ITR state.";
         container learned-mappings {
           uses mappings; lisp:mappings;
           description
             "EID to RLOCs mappings cache.";
         }
       }
     }
   }

8.  LISP Proxy ETR Module

   This module captures the configuration data model of a LISP Proxy ETR
   [RFC6832].  The model may also capture some operational data
   elements.

8.1.  Module Structure

module: lisp-petr
augment /lisp:lisp/lisp:devices/lisp:device:
   +--rw proxy-etr-cfg!
      +--rw servicing-eids
         +--rw eid* [id]
            +--rw id             lisp:eid-id
            +--rw eid-address
               +--rw afi                   lisp-address-family-ref
               +--rw instance-id?          instance-id-type
               +--rw (address)?
                  +--:(ipv4)
                  |  +--rw ipv4?                 inet:ipv4-address
                  +--:(ipv6)
                  |  +--rw ipv6?                 inet:ipv6-address
                  +--:(mac)
                  |  +--rw mac?                  yang:mac-address
                  +--:(distinguished-name)
                  |  +--rw distinguished-name?   distinguished-name
                  +--:(lcaf)
                     +--rw lcaf
                        +--rw lcaf-type                lcaf-ref
                        +--rw (address)?
                           +--:(null-address)
                           |  +--rw null-address
                           |     +--rw address?   empty
                           +--:(afi-list)
                           |  +--rw afi-list
                           |     +--rw address-list*   simple-address
                           +--:(instance-id)
                           |  +--rw instance-id
                           |     +--rw instance-id?   instance-id-type
                           |     +--rw mask-length?   uint8
                           |     +--rw address?       simple-address
                           +--:(as-number)
                           |  +--rw as-number
                           |     +--rw as?        inet:as-number
                           |     +--rw address?   simple-address
                           +--:(application-data)
                           |  +--rw application-data
                           |     +--rw address?            simple-address
                           |     +--rw protocol?           uint8
                           |     +--rw ip-tos?             int32
                           |     +--rw local-port-low?     inet:port-number
                           |     +--rw local-port-high?    inet:port-number
                           |     +--rw remote-port-low?    inet:port-number
                           |     +--rw remote-port-high?   inet:port-number
                           +--:(geo-coordinates)
                           |  +--rw geo-coordinates
                           |     +--rw latitude?            bits
                           |     +--rw latitude-degrees?    uint8
                           |     +--rw latitude-minutes?    uint8
                           |     +--rw latitude-seconds?    uint8
                           |     +--rw longitude?           bits
                           |     +--rw longitude-degrees?   uint16
                           |     +--rw longitude-minutes?   uint8
                           |     +--rw longitude-seconds?   uint8
                           |     +--rw altitude?            int32
                           |     +--rw address?             simple-address
                           +--:(nat-traversal)
                           |  +--rw nat-traversal
                           |     +--rw ms-udp-port?        uint16
                           |     +--rw etr-udp-port?       uint16
                           |     +--rw global-etr-rloc?    simple-address
                           |     +--rw ms-rloc?            simple-address
                           |     +--rw private-etr-rloc?   simple-address
                           |     +--rw rtr-rlocs*          simple-address
                           +--:(explicit-locator-path)
                           |  +--rw explicit-locator-path
                           |     +--rw hop* [address]
                           |        +--rw address     simple-address
                           |        +--rw lrs-bits?   bits
                           +--:(sourc-dest-key)
                              +--rw sourc-dest-key
                                 +--rw source?   inet:ip-prefix
                                 +--rw dest?     inet:ip-prefix

8.2.  Module Definition

   module lisp-petr {
     namespace "urn:ietf:params:xml:ns:yang:lisp-petr";
     prefix lisp-petr;
     import ietf-lisp {
       prefix lisp;
     }
     import lisp-address-types {
       prefix lcaf;
     }
     organization
      "IETF LISP (Locator/ID Separation Protocol) Working Group";
     contact
       "lisp@ietf.org";
     description
       "This YANG module defines the generic configuration
        data for a LISP PETR. The module can be extended by vendors to
        define vendor-specific configuration parameters and policies.

        Copyright (c) 2015 IETF Trust and the persons identified as
        authors of the code.  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 6338; see
        the RFC itself for full legal notices.
       ";
     revision 2015-07-02 {
       description
         "Initial revision.";
       reference
         "https://tools.ietf.org/html/rfc6832";
     }
     identity petr {
       base lisp:lisp-device;
       description
         "LISP PETR.";
     }
     augment "/lisp:lisp/lisp:devices/lisp:device" {
       when "lisp:type = lisp-petr:petr" {
         description
           "Augment is valid when LISP device type is PETR.";
       }
       description
         "This augments LISP devices list with PETR specific
          parameters.";
       container proxy-etr-cfg {
    if-feature proxy-etr;
         presence "LISP PETR operation enabled";
    config true;
         description
           "Proxy ETR configuration parameters.";
         container servicing-eids {
           description
             "EIDs serviced by the PETR.";
           list eid {
             key "id";
             description
               "List of EIDs serviced by the PETR.";
             leaf id {
               type eid-id; lisp:eid-id;
               description
                 "Id of serviced EID.";
             }
             container eid-address {
               uses lcaf:lisp-address;
               description
                 "Serviced EID in generic LISP address format.";
             }
           }
         }
       }
     }

<CODE ENDS>

4.
   }

9.  LISP Address Types

   This module captures the various LISP address types, and is an
   essential building block used in other LISP modules.

9.1.  Module Definition

   module lisp-address-types {
     namespace "urn:ietf:params:xml:ns:yang:lisp-address-types";
     prefix laddr;
     import ietf-inet-types {
       prefix inet;
     }
     import ietf-yang-types {
       prefix yang;
     }
     organization
       "IETF LISP (Locator/ID Separation Protocol) Working Group";
     contact
       "lisp@ietf.org";
     description
       "This YANG module defines the LISP Canonical Address Formats
        (LCAF) for LISP. The module can be extended by vendors to
        define vendor-specific parameters.

        Copyright (c) 2014 IETF Trust and the persons identified as
        authors of the code.  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 6338; see
        the RFC itself for full legal notices.

       ";
     revision 2015-03-09 {
       description
         "Initial revision.";
       reference
         "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10";
     }
     identity lisp-address-family {
       description
         "Base identity from which identities describing LISP address
          families are derived.";
     }
     identity ipv4 {
       base lisp-address-family;
       description
         "IANA IPv4 address family.";
     }
     identity ipv6 {
       base lisp-address-family;
       description
         "IANA IPv6 address family.";
     }
     identity mac {
       base lisp-address-family;
       description
         "IANA MAC address family.";
     }
     identity distinguished-name {
       base lisp-address-family;
       description
         "IANA Distinguished Name address family.";
     }
     identity lcaf {
       base lisp-address-family;
       description
         "IANA LISP Canonical Address Format address family.";
     }
     identity null-address {
       base lcaf;
       description
         "Null body LCAF type.";
     }
     identity afi-list {
       base lcaf;
       description
         "AFI-List LCAF type.";
     }
     identity instance-id {
       base lcaf;
       description
         "Instance-ID LCAF type.";
     }
     identity as-number {
       base lcaf;
       description
         "AS Number LCAF type.";
     }
     identity application-data {
       base lcaf;
       description
         "Application Data LCAF type.";
     }
     identity geo-coordinates {
       base lcaf;
       description
         "Geo-coordinates LCAF type.";
     }
     identity opaque-key {
       base lcaf;
       description
         "Opaque Key LCAF type.";
     }
     identity nat-traversal {
       base lcaf;
       description
         "NAT-Traversal LCAF type.";
     }
     identity nonce-locator {
       base lcaf;
       description
         "Nonce-Locator LCAF type.";
     }
     identity multicast-info {
       base lcaf;
       description
         "Multicast Info LCAF type.";
     }
     identity explicit-locator-path {
       base lcaf;
       description
         "Explicit Locator Path LCAF type.";
     }
     identity security-key {
       base lcaf;
       description
         "Security Key LCAF type.";
     }
     identity source-dest-key {
       base lcaf;
       description
         "Source/Dest LCAF type.";
     }
     identity replication-list {
       base lcaf;
       description
         "Replication-List LCAF type.";

     }
     identity json-data-model {
       base lcaf;
       description
         "JSON Data Model LCAF type.";
     }
     identity key-value-address {
       base lcaf;
       description
         "Key-Value LCAF type.";
     }
     identity encapsulation-format {
       base lcaf;
       description
         "Encapsulation Format LCAF type.";
     }
     typedef instance-id-type {
       type uint32 {
         range "0..16777214";
       }
       description
         "Defines the range of values for an Instance ID.";
     }
     typedef simple-address {
       type union {
         type inet:ip-address;
         type inet:ip-prefix;
         type yang:mac-address;
         type distinguished-name;
       }
       description
         "Union of address types that can be part of LCAFs.";
     }
     typedef distinguished-name {
       type string;
       description
         "Distinguished Name address.";
       reference
         "http://www.iana.org/assignments/address-family-numbers/
          address-family-numbers.xhtml";
     }
     typedef lisp-address-family-ref {
       type identityref {
         base lisp-address-family;
       }
       description
         "LISP address family reference.";
     }
     typedef lcaf-ref {
       type identityref {
         base lcaf;
       }
       description
         "LCAF types reference.";
     }
     grouping lcaf-address {
       description
         "Group of all the LCAF types.";
       leaf lcaf-type {
         type lcaf-ref;
         mandatory true;
         description
           "Enumeration of LCAF types.";
       }
       choice address {
         description "The LCAF addresses.";
         container null-address {
           when "../../lcaf-type = null" {
             description
               "When LCAF type is null.";
           }
           description
             "Null body LCAF type";
           leaf address {
             type empty;
             description
               "AFI address.";
           }
         }
         container afi-list {
           when "../../lcaf-type = afi-list" {
             description
               "When LCAF type is AFI-List.";
           }
           description
             "AFI-List LCAF type.";
           reference
             "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
              #section-4.16.1";
           leaf-list address-list {
             type simple-address;
             description
               "List of AFI addresses.";
           }
         }
         container instance-id {
           when "../../lcaf-type = instance-id" {
             description
               "When LCAF type is Instance-ID";
           }
           description
             "Instance ID LCAF type.";
           reference
             "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
              #section-4.2";
           leaf instance-id {
             type instance-id-type;
             description
               "Instance ID value.";
           }
           leaf mask-length {
               type uint8;
               description
                 "Mask length.";
           }
           leaf address {
             type simple-address;
             description
               "AFI address.";
           }
         }
         container as-number {
           when "../../lcaf-type = as-number" {
             description
               "When LCAF type is AS-Number.";
           }
           description
             "AS Number LCAF type.";
           reference
             "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
              #section-4.3";
           leaf as {
             type inet:as-number;
             description
               "AS number.";
           }
           leaf address {
             type simple-address;
             description
               "AFI address.";
           }
         }
         container application-data {
           when "../../lcaf-type = application-data" {
             description
               "When LCAF type is Application Data.";
           }
           description
             "Application Data LCAF type.";
           reference
             "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
              #section-4.4";
           leaf address {
               type simple-address;
               description
                 "AFI address.";
           }
           leaf protocol {
               type uint8;
               description
                 "Protocol number.";
           }
           leaf ip-tos {
               type int32;
               description
                 "Type of service field.";
           }
           leaf local-port-low {
               type inet:port-number;
               description
                 "Low end of local port range.";
           }
           leaf local-port-high {
               type inet:port-number;
               description
                 "High end of local port range.";
           }
           leaf remote-port-low {
               type inet:port-number;
               description
                 "Low end of remote port range.";
           }
           leaf remote-port-high {
               type inet:port-number;
               description
                 "High end of remote port range.";
           }
         }
         container geo-coordinates {
           when "../../lcaf-type = geo-coordinates" {
             description
               "When LCAF type is Geo-coordinates.";

           }
           description
             "Geo-coordinates LCAF type.";
           reference
             "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
              #section-4.5";
           leaf latitude {
             type bits {
               bit N {
                 description
                   "Latitude bit.";
               }
             }
             description
               "Bit that selects between North and South latitude.";
           }
           leaf latitude-degrees {
             type uint8 {
               range "0 .. 90";
             }
             description
               "Degrees of latitude.";
           }
           leaf latitude-minutes {
             type uint8 {
               range "0..59";
             }
             description
               "Minutes of latitude.";
           }
           leaf latitude-seconds {
             type uint8 {
               range "0..59";
             }
             description
               "Seconds of latitude.";
           }
           leaf longitude {
             type bits {
               bit E {
                 description
                   "Longitude bit.";
               }
             }
             description
               "Bit that selects between East and West longitude.";
           }
           leaf longitude-degrees {
             type uint16 {
               range "0 .. 180";
             }
             description
               "Degrees of longitude.";
           }
           leaf longitude-minutes {
             type uint8 {
               range "0..59";
             }
             description
               "Minutes of longitude.";
           }
           leaf longitude-seconds {
             type uint8 {
               range "0..59";
             }
             description
               "Seconds of longitude.";
           }
           leaf altitude {
             type int32;
             description
               "Height relative to sea level in meters.";
           }
           leaf address {
             type simple-address;
             description
               "AFI address.";
           }
         }
         container nat-traversal {
           when "../../lcaf-type = nat-traversal" {
             description
               "When LCAF type is NAT-Traversal.";
           }
           description
             "NAT-Traversal LCAF type.";
           reference
             "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
              #section-4.6";
           leaf ms-udp-port {
             type uint16;
             description
               "Map-Server UDP port (set to 4342).";
           }
           leaf etr-udp-port {
             type uint16;
             description
               "ETR UDP port.";
           }
           leaf global-etr-rloc {
             type simple-address;
             description
               "Global ETR RLOC address.";
           }
           leaf ms-rloc {
             type simple-address;
             description
               "Map-Server RLOC address.";
           }
           leaf private-etr-rloc {
             type simple-address;
             description
               "Private ETR RLOC address.";
           }
           leaf-list rtr-rlocs {
             type simple-address;
             description
               "List of RTR RLOC addresses.";
           }
         }
         container explicit-locator-path {
           when "../../lcaf-type = explicit-locator-path" {
             description
               "When LCAF type type is Explicit Locator Path.";
           }
           description
             "Explicit Locator Path LCAF type.";
           reference
             "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
              #section-4.9";
           list hop {
             key "address";
             description
               "List of locator hops forming the explicit path.";
             leaf address {
               type simple-address;
               description
                 "AFI address.";
             }
             leaf lrs-bits {
               type bits{
                 bit lookup {
                   description
                     "Lookup bit.";

                 }
                 bit rloc-probe {
                   description
                     "RLOC-probe bit.";
                 }
                 bit strict {
                   description
                     "Strict bit.";
                 }
               }
               description
                 "Flag bits per hop.";
             }
           }
         }
         container sourc-dest-key {
           when "../../lcaf-type = source-dest-key" {
             description
               "When LCAF type type is Source/Dest.";
           }
           description
             "Source/Dest LCAF type.";
           reference
             "http://tools.ietf.org/html/draft-ietf-lisp-lcaf-10
              #section-4.11";
           leaf source {
             type inet:ip-prefix;
             description
               "Source prefix.";
           }
           leaf dest {
             type inet:ip-prefix;
             description
               "Destination prefix.";
           }
         }
       }
     }
     grouping lisp-address {
       description
         "Generic LISP address.";
       leaf afi {
         type lisp-address-family-ref;
         mandatory true;
         description
           "LISP address family AFI.";
       }
       leaf instance-id {
         type instance-id-type;
         description
           "Instance ID of the address.";
       }
       choice address {
         leaf ipv4 {
           when "../../afi = 'laddr:ipv4'" {
             description
               "When AFI is IPv4.";
           }
           type inet:ipv4-address;
           description
             "IPv4 address.";
         }
         leaf ipv6 {
           when "../../afi = 'laddr:ipv6'" {
             description
               "When AFI is IPv6.";
           }
           type inet:ipv6-address;
           description
             "IPv6 address.";
         }
         leaf mac {
           when "../../afi = 'laddr:mac'" {
             description
               "When AFI is MAC.";
           }
           type yang:mac-address;
           description
             "MAC address.";
         }
         leaf distinguished-name {
           when "../../afi = 'laddr:distinguished-name'" {
             description
               "When AFI is distinguished-name.";
           }
           type distinguished-name;
           description
             "Distinguished Name address.";
         }
         container lcaf {
           when "../../afi = 'laddr:lcaf'" {
             description
               "When AFI is LCAF.";
           }
           uses lcaf-address;
           description
             "LCAF address.";
         }
         description
           "Selection of address type.";
       }
     }
   }

10.  Acknowledgments

   The tree view and the YANG model shown in this document have been
   formated with the 'pyang' tool.

5.

11.  IANA Considerations

   This memo includes no request to IANA.

6.

12.  Security Considerations

   Security Considerations TBD

7.

13.  Normative References

   [I-D.ietf-lisp-ddt]
              Fuller, V., Lewis, D., Ermagan, V., and A. Jain, "LISP
              Delegated Database Tree", draft-ietf-lisp-ddt-02 draft-ietf-lisp-ddt-03 (work in
              progress), October 2014. April 2015.

   [I-D.ietf-lisp-lcaf]
              Farinacci, D., Meyer, D., and J. Snijders, "LISP Canonical
              Address Format (LCAF)", draft-ietf-lisp-lcaf-04 draft-ietf-lisp-lcaf-10 (work in
              progress), January 2014. June 2015.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC6830]  Farinacci, D., Fuller, V., Meyer, D., and D. Lewis, "The
              Locator/ID Separation Protocol (LISP)", RFC 6830, January
              2013.

   [RFC6832]  Lewis, D., Meyer, D., Farinacci, D., and V. Fuller,
              "Interworking between Locator/ID Separation Protocol
              (LISP) and Non-LISP Sites", RFC 6832.

   [RFC6833]  Fuller, V. and D. Farinacci, "Locator/ID Separation
              Protocol (LISP) Map-Server Interface", RFC 6833, January
              2013.

   [RFC6836]  Fuller, V., Farinacci, D., Meyer, D., and D. Lewis,
              "Locator/ID Separation Protocol Alternative Logical
              Topology (LISP+ALT)", RFC 6836, January 2013.

Authors' Addresses

   Vina Ermagan
   Cisco Systems
   170 Tasman Drive
   San Jose, CA
   USA

   Email: vermagan@cisco.com

   Alberto Rodriguez-Natal
   Technical University of Catalonia
   Barcelona
   Spain

   Email: arnatal@ac.upc.edu

   Florin Coras
   Technical University of Catalonia
   Barcelona
   Spain

   Email: fcoras@ac.upc.edu

   Carl Moberg
   Cisco Systems
   170 W Tasman Dr
   San Jose, CA
   USA

   Email: camoberg@cisco.com

   Albert Cabellos-Aparicio
   Technical University of Catalonia
   Barcelona
   Spain

   Email: acabello@ac.upc.edu
   Fabio Maino
   Cisco Systems
   170 Tasman Drive
   San Jose, CA
   USA

   Email: fmaino@cisco.com