summaryrefslogtreecommitdiffstats
path: root/mpls/api/src/main/yang/vpp-mpls@2017-11-20.yang
blob: c58478102831b3dc009519cd67415223a9d9280b (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
module vpp-mpls {
  yang-version 1;
  namespace "urn:opendaylight:params:xml:ns:yang:vpp:mpls";
  prefix "vpp-mpls";

  import hc2vpp-ietf-mpls {
    prefix mpls;
    revision-date 2017-07-02;
  }

  import hc2vpp-ietf-routing {
    prefix "rt";
    revision-date 2014-05-24;
  }

  import hc2vpp-ietf-mpls-static {
    prefix "mpls-static";
    revision-date 2017-03-10;
  }

  import yang-ext {
    prefix "ext";
  }

  organization
    "FD.io - The Fast Data Project";

  contact
    "Hc2vpp Wiki <https://wiki.fd.io/view/Hc2vpp>
     Mailing List <hc2vpp@lists.fd.io>";

  description
    "This module contains a collection of YANG definitions for
     configuring VPP specific MPLS options.

     See https://docs.fd.io/vpp/18.01/clicmd_src_vnet_mpls.html
     for more details

     Copyright (c) 2017 Cisco and/or its affiliates.

     Licensed under the Apache License, Version 2.0 (the 'License');
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at:

     http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an 'AS IS' BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.";

  revision "2017-11-20" {
    description
      "Initial revision of vpp-mpls model.";
  }

  typedef lookup-type {
    type enumeration {
      enum ipv4 {
        value 0;
      }
      enum ipv6 {
        value 1;
      }
      enum mpls {
        value 2;
      }
    }
    description
      "Label lookup types based on data path protocols supported by vpp.
       Enum values are based on the ones used by mpls apis";
    reference
      "https://git.fd.io/vpp/tree/src/vnet/dpo/dpo.h";
  }

  grouping vpp-label-lookup-attributes {
    container label-lookup {
      leaf type {
        type lookup-type;
      }
      leaf ip4-lookup-in-table {
        when "../type = ipv4";
        type uint32;
        description
          "Mapped to non-eos lookup in IPv4 FIB table with given id.";
      }
      leaf ip6-lookup-in-table {
        when "../type = ipv6";
        type uint32;
        description
          "Mapped to non-eos lookup in IPv6 FIB table with given id.";
      }
      leaf mpls-lookup-in-table {
        when "../type = mpls";
        type uint32;
        description
         "Mapped to eos lookup in MPLS FIB table with given id.";
      }
    }
    description
      "Defines lookup attributes for pop-and-lookup operation.
       Equivalent of CLI command: mpls local-label XXX-lookup-in-table N";
  }

  augment /rt:routing/mpls:mpls/mpls-static:static-lsps/mpls-static:static-lsp/mpls-static:config {
    ext:augment-identifier "static-lsp-vpp-lookup-augmentation";
    when "operation = 'pop-and-lookup'";
    uses vpp-label-lookup-attributes;
    description
      "Augments static-lsp list entry with lookup options available in VPP.";
  }
}