vpp-fib-table-management@2018-05-21.yang revision e6bd81db
1module vpp-fib-table-management {
2    yang-version "1.1";
3    namespace "http://fd.io/hc2vpp/yang/vpp-fib-table-management";
4    prefix "vpp-fib-table-management";
5
6    organization
7        "FD.io - The Fast Data Project";
8
9    contact
10        "Hc2vpp Wiki <https://wiki.fd.io/view/Hc2vpp>
11         Mailing List <hc2vpp@lists.fd.io>";
12
13    description
14        "This module contains a collection of YANG definitions
15         that extend hc2vpp-ietf-routing module
16         with VPP FIB table management features.
17
18         Copyright (c) 2018 Bell Canada, Pantheon Technologies and/or its affiliates.
19
20         Licensed under the Apache License, Version 2.0 (the 'License');
21         you may not use this file except in compliance with the License.
22         You may obtain a copy of the License at:
23
24         http://www.apache.org/licenses/LICENSE-2.0
25
26         Unless required by applicable law or agreed to in writing, software
27         distributed under the License is distributed on an 'AS IS' BASIS,
28         WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29         See the License for the specific language governing permissions and
30         limitations under the License.";
31
32    revision 2018-05-21 {
33        description "Initial revision.";
34    }
35
36    /* IDENTITIES */
37    identity address-family-identity {
38        description "Base identity from which identities describing address families are derived.";
39    }
40
41    identity ipv4 {
42        base vpp-fib-table-management:address-family-identity;
43        description "This identity represents an IPv4 address family.";
44    }
45
46    identity ipv6 {
47        base vpp-fib-table-management:address-family-identity;
48        description "This identity represents an IPv6 address family.";
49    }
50
51    /* TYPE DEFINITIONS */
52    typedef vni-reference {
53        type uint32;
54        description "VRF index reference";
55    }
56
57    typedef address-family-type {
58        type identityref {
59            base vpp-fib-table-management:address-family-identity;
60        }
61        description "This type is used to refer to a FIB table type";
62    }
63
64    typedef fib-table-list-ref {
65        type leafref {
66            path "/vpp-fib-table-management:fib-table-management/vpp-fib-table-management:fib-tables/" +
67                 "vpp-fib-table-management:table/vpp-fib-table-management:table-id";
68        }
69        description "This type is used by data models that need to reference a FIB table";
70    }
71
72    /* GROUPINGS */
73    grouping vpp-fib-table-management {
74        container fib-tables {
75            description
76            "The FIB tables that are managed by control-plane-protocol";
77
78            list table {
79                key "table-id address-family";
80
81                description
82                    "FIB table that is represented by VNI index (VRF reference index) and addres-family.
83                     Each FIB table is uniquely identified by its index and addres family (e.g. IPv4 or IPv6).
84                     Table cantains name for easier identification and description for a short summary of its
85                     function.
86                     In VPP this table is mapped to ip_table_add_del VPP API message:
87                     Add/del table request
88                         A table can be added multiple times, but need be deleted only once.
89                         @param is_ipv6 - V4 or V6 table
90                         @param table_id - table ID associated with the route
91                                           This table ID will apply to both the unicats and mlticast FIBs
92                         @param name - A client provided name/tag for the table. If this is
93                                       not set by the client, then VPP will generate something meaningfull";
94                leaf address-family {
95                    type identityref {
96                        base address-family-identity;
97                    }
98                    mandatory true;
99                    description
100                        "A reference to the address-family that the table represents (IPv4 or IPv6).
101                         Mapped to is_ipv6 parameter of ip_table_add_del message.";
102                }
103
104                leaf table-id {
105                    type vni-reference;
106                    mandatory true;
107                    description
108                        "VRF index reference.
109                         Mapped to table_id parameter of ip_table_add_del message.";
110                }
111
112                leaf name {
113                    type string {
114                        length "1..64";
115                    }
116                    description
117                        "Name of FIB table.
118                         Mapped to name parameter of ip_table_add_del message.";
119                }
120
121                leaf description {
122                    type string;
123                    config true;
124                    description "Description of FIB table";
125                }
126            }
127        }
128    }
129
130    /* MAIN CONTAINER */
131    container fib-table-management {
132        description "Configuration parameters for FIB table management";
133
134        uses vpp-fib-table-management;
135    }
136}
137