summaryrefslogtreecommitdiffstats
path: root/lisp/api/src/main/yang/lisp.yang
blob: 4f64ca28a91e4faeaaff871af06f7d34f0a7de35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
//TODO mandatory statements
module lisp {
  yang-version 1;
  namespace "urn:opendaylight:params:xml:ns:yang:lisp";
  prefix "lisp";
  import ietf-interfaces {
    prefix "if";
  }
  import ietf-inet-types {
    prefix "inet";
  }
  import ietf-lisp-address-types {
    prefix "lisp-types";
  }
  organization
    "FD.io Overlay Forwarding Engine (ONE) project";
  contact
    "Florin Coras <fcoras@cisco.com>
     Vina Ermagan <vermagan@cisco.com>
     ONE list <one@lists.fd.io>";

  description
    "This YANG module defines the generic configuration and
    operational data for LISP in VPP";
  revision "2016-05-20" {
    description
      "Initial revision of LISP model";
    reference
      "https://tools.ietf.org/html/rfc6830";
  }

  typedef locator-set-ref {
    type leafref {
      path "/lisp/locator-sets/locator-set/name";
    }
    description "Locator-set reference";
  }

  typedef mapping-id {
    type string;
    description "Mapping ID";
  }

  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 lisp map-cache ACT type";
    reference
      "https://tools.ietf.org/html/rfc6830#section-6.1.4";
  }
  grouping locator-properties-grouping {
    description
      "Properties of a RLOC";
    leaf priority {
      type uint8;
      description
        "Locator priority.";
    }
    leaf weight {
      type uint8;
      description
        "Locator weight.";
    }
  }

  grouping locator-sets-grouping {
    // NOTE: to be used only for local locators
    // lisp_add_del_locator_set locator-set <ls_name> [del]
    // lisp_add_del_locator locator-set <ls_name> iface <iface_name>
    //                                  p <val> w <val> [del]
    container locator-sets {
      when "../lisp:enable = 'true'";
      list locator-set {
        key "name";
        leaf name {
          type string;
          description "Locator-set name";
        }
        list interface {
          key "interface-ref";
          leaf interface-ref {
            type if:interface-ref;
            description "Interface reference";
          }
          uses locator-properties-grouping;
          description "List of interfaces part of the locator-set";
        }
        description "Locator-set";
      }
      description "Locator-sets";
    }
    description "Grouping for locator-sets";
  }

  grouping eid-table-grouping {
    container eid-table {
      when "../lisp:enable = 'true'";
      list vni-table {
        key "virtual-network-identifier";
        leaf virtual-network-identifier {
            type uint32;
            description "vni";
        }
        leaf table-id {
            type uint32;
            description "table-id/vrf";
        }
        // Once both vni and table-id are set:
        // lisp_eid_table_add_del_map <vni> <vrf>
        container local-mappings {
          list local-mapping {
            key "id";
            leaf id {
              type mapping-id;
              description "Id that uniquely identifies a mapping";
            }
            container eid {
              uses lisp-types:lisp-address;
              description "EID address";
            }
            leaf locator-set {
              type locator-set-ref;
              description "Locator-set";
            }
            description "Local mapping";
          }
          description "Local EID to locator-set mappings";
        }
    // lisp_add_del_local_eid eid <ip-address/mask> locator-set
    //                            <ls-name> [del]
    // lisp_add_del_remote_mapping vni <vni> eid <ip-pref> seid
    //                             <ip-pref> [action <action>] rloc
    //                             <ip-addr> [rloc <ip-addr> ..]
    // NOTE: 1.lisp_add_del_remote_mapping needs updating, right now
    //         it expects both seid and deid, but this will be
    //         simplified to just eid
    //       2.priority/weight not yet part of API, patch under
    //         review
        container remote-mappings {
          list remote-mapping {
            key "id";
            leaf id {
              type mapping-id;
              description "Id that uniquely identifies a mapping";
            }
            container eid {
                description "Remote EID address";
                uses lisp-types:lisp-address;
            }
            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 an
                 authoritative source.";
            }
            choice locator-list {
              description
                "list of locators are either negative, or positive.";
              case negative-mapping {
                //NOTE if this is enclosed in container,there can be a dedicated writer/reader
                //for setting/reading this node
                leaf map-reply-action {
                  type map-reply-action;
                  description
                    "Forwarding action for a negative mapping.";
                }
              }
              case positive-mapping {
                container rlocs {
                  list locator {
                     key "address";
                     leaf address {
                       type inet:ip-address;
                       description "Locator address";
                     }
                     uses locator-properties-grouping;
                     description "Remote locator";
                  }
                  description
                    "List of locators for a positive mapping.";
                }
              }
            }
            description "List of remote mappings";
          }
          description "Map-cache/remote mappings cache";
        }

        container adjacencies {
          list adjacency {
            key "id";
            leaf id {
              type string;
              description "Adjacency id";
            }
            container local-eid {
              uses lisp-types:lisp-address;
              description "Local EID that must have a local mapping";
            }
            container remote-eid {
              uses lisp-types:lisp-address;
              description "Remote EID that must have a remote mapping";
            }
            description "List of adjacencies";
          }
          description "Adjacencies programmed into the data plane";
        }
        description "VNI tables";
      }
      description "EID table";
    }
    description "EID table grouping";
  }
  grouping map-resolvers-grouping {
    container map-resolvers {
      // lisp_add_del_map_resolver <ip>
      when "../lisp:enable = 'true'";
      list map-resolver {
        key ip-address;
        leaf ip-address {
          type inet:ip-address;
          description "Map-resolver IP address";
        }
        description "List of map-resolvers";
      }
      description "Map-resolvers configured";
    }
    description "Map-Resolver grouping";
  }
  grouping pitr-cfg-grouping {
    // lisp_pitr_set_locator_set <ip>
    container pitr-cfg {
      when "../lisp:enable = 'true'";
      leaf locator-set {
        type locator-set-ref;
        description "Locator-set reference";
      }
      description "Proxy-ITR configuration";
    }
    description "";
  }

  // ref https://wiki.fd.io/view/ONE/Command-line_Interface_CLI_Guide
  container lisp {
    // lisp_enable_disable / lisp_enable_disable_status_dump
    leaf enable {
      type boolean;
      description "Enable/disable LISP feature";
    }
    // lisp_add_del_map_request_itr_rlocs add/del <ls_name>
    leaf itr-rlocs {
      type locator-set-ref;
      description "Locators to be used in map-requests";
    }
    uses locator-sets-grouping;
    uses eid-table-grouping;
    uses map-resolvers-grouping;
    uses pitr-cfg-grouping;

    // lisp_pitr_set_locator_set <ip>
    description "LISP configuration";
  }

  container lisp-state {
    config false;
    leaf enable {
      type boolean;
      description "LISP status";
    }
    leaf itr-rlocs {
      type locator-set-ref;
      description "Locators to be used in map-requests";
    }
    uses locator-sets-grouping;
    uses eid-table-grouping;
    uses map-resolvers-grouping;
    uses pitr-cfg-grouping;

    description "LISP state";
  }
}