vpp-mpls@2017-11-20.yang revision 149d172a
1module vpp-mpls {
2  yang-version 1;
3  namespace "urn:opendaylight:params:xml:ns:yang:vpp:mpls";
4  prefix "vpp-mpls";
5
6  import hc2vpp-ietf-mpls {
7    prefix mpls;
8    revision-date 2017-07-02;
9  }
10
11  import hc2vpp-ietf-routing {
12    prefix "rt";
13    revision-date 2018-03-13;
14  }
15
16  import hc2vpp-ietf-mpls-static {
17    prefix "mpls-static";
18    revision-date 2017-07-02;
19  }
20
21  import yang-ext {
22    prefix "ext";
23  }
24
25  organization
26    "FD.io - The Fast Data Project";
27
28  contact
29    "Hc2vpp Wiki <https://wiki.fd.io/view/Hc2vpp>
30     Mailing List <hc2vpp@lists.fd.io>";
31
32  description
33    "This module contains a collection of YANG definitions for
34     configuring VPP specific MPLS options.
35
36     See https://docs.fd.io/vpp/18.01/clicmd_src_vnet_mpls.html
37     for more details
38
39     Copyright (c) 2017 Cisco and/or its affiliates.
40
41     Licensed under the Apache License, Version 2.0 (the 'License');
42     you may not use this file except in compliance with the License.
43     You may obtain a copy of the License at:
44
45     http://www.apache.org/licenses/LICENSE-2.0
46
47     Unless required by applicable law or agreed to in writing, software
48     distributed under the License is distributed on an 'AS IS' BASIS,
49     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50     See the License for the specific language governing permissions and
51     limitations under the License.";
52
53  revision "2017-11-20" {
54    description
55      "Initial revision of vpp-mpls model.";
56  }
57
58  typedef lookup-type {
59    type enumeration {
60      enum ipv4 {
61        value 0;
62      }
63      enum ipv6 {
64        value 1;
65      }
66      enum mpls {
67        value 2;
68      }
69    }
70    description
71      "Label lookup types based on data path protocols supported by vpp.
72       Enum values are based on the ones used by mpls apis";
73    reference
74      "https://git.fd.io/vpp/tree/src/vnet/dpo/dpo.h";
75  }
76
77  grouping vpp-label-lookup-attributes {
78    container label-lookup {
79      leaf type {
80        type lookup-type;
81      }
82      leaf ip4-lookup-in-table {
83        when "../type = ipv4";
84        type uint32;
85        description
86          "Mapped to non-eos lookup in IPv4 FIB table with given id.";
87      }
88      leaf ip6-lookup-in-table {
89        when "../type = ipv6";
90        type uint32;
91        description
92          "Mapped to non-eos lookup in IPv6 FIB table with given id.";
93      }
94      leaf mpls-lookup-in-table {
95        when "../type = mpls";
96        type uint32;
97        description
98         "Mapped to eos lookup in MPLS FIB table with given id.";
99      }
100    }
101    description
102      "Defines lookup attributes for pop-and-lookup operation.
103       Equivalent of CLI command: mpls local-label XXX-lookup-in-table N";
104  }
105
106  augment /rt:routing/mpls:mpls/mpls-static:static-lsps/mpls-static:static-lsp/mpls-static:config {
107    ext:augment-identifier "static-lsp-vpp-lookup-augmentation";
108    when "operation = 'pop-and-lookup'";
109    uses vpp-label-lookup-attributes;
110    description
111      "Augments static-lsp list entry with lookup options available in VPP.";
112  }
113}
114