--- /dev/null
+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 no-address {
+ base lisp-address-family;
+ description
+ "IANA Reserved.";
+ }
+ identity ipv4 {
+ base lisp-address-family;
+ description
+ "IANA IPv4 address family.";
+ }
+ identity ipv4-prefix {
+ base lisp-address-family;
+ description
+ "IANA IPv4 address family prefix.";
+ }
+ identity ipv6 {
+ base lisp-address-family;
+ description
+ "IANA IPv6 address family.";
+ }
+ identity ipv6-prefix {
+ base lisp-address-family;
+ description
+ "IANA IPv6 address family prefix.";
+ }
+ 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 as-number {
+ base lisp-address-family;
+ description
+ "IANA AS Number 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-lcaf {
+ 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;
+ type inet:as-number;
+ }
+ 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-lcaf {
+ when "../../lcaf-type = as-number-lcaf" {
+ 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 source-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 no-address {
+ when "../../afi = 'laddr:no-addr'" {
+ description
+ "When AFI is 0.";
+ }
+ type empty;
+ description
+ "No address.";
+ }
+ leaf ipv4 {
+ when "../../afi = 'laddr:ipv4'" {
+ description
+ "When AFI is IPv4.";
+ }
+ type inet:ipv4-address;
+ description
+ "IPv4 address.";
+ }
+ leaf ipv4-prefix {
+ when "../../afi = 'laddr:ipv4-prefix'" {
+ description
+ "When AFI is IPv4.";
+ }
+ type inet:ipv4-prefix;
+ description
+ "IPv4 prefix.";
+ }
+ leaf ipv6 {
+ when "../../afi = 'laddr:ipv6'" {
+ description
+ "When AFI is IPv6.";
+ }
+ type inet:ipv6-address;
+ description
+ "IPv6 address.";
+ }
+ leaf ipv6-prefix {
+ when "../../afi = 'laddr:ipv6-prefix'" {
+ description
+ "When AFI is IPv6.";
+ }
+ type inet:ipv6-prefix;
+ 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.";
+ }
+ leaf as-number {
+ when "../../afi = 'laddr:as-number'" {
+ description
+ "When AFI is as-number.";
+ }
+ type inet:as-number;
+ description
+ "AS Number.";
+ }
+ container lcaf {
+ when "../../afi = 'laddr:lcaf'" {
+ description
+ "When AFI is LCAF.";
+ }
+ uses lcaf-address;
+ description
+ "LCAF address.";
+ }
+ description
+ "Selection of address type.";
+ }
+ }
+}