summaryrefslogtreecommitdiffstats
path: root/fib-management/fib-management-api/src/main/yang/vpp-fib-table-management@2018-05-21.yang
blob: d7d0f0aa17a1205f3938bcd352905a396af2a6d4 (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
module vpp-fib-table-management {
    yang-version "1.1";
    namespace "http://fd.io/hc2vpp/yang/vpp-fib-table-management";
    prefix "vpp-fib-table-management";

    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
         that extend hc2vpp-ietf-routing module
         with VPP FIB table management features.

         Copyright (c) 2018 Bell Canada, Pantheon Technologies 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 2018-05-21 {
        description "Initial revision.";
    }

    /* IDENTITIES */
    identity address-family-identity {
        description "Base identity from which identities describing address families are derived.";
    }

    identity ipv4 {
        base vpp-fib-table-management:address-family-identity;
        description "This identity represents an IPv4 address family.";
    }

    identity ipv6 {
        base vpp-fib-table-management:address-family-identity;
        description "This identity represents an IPv6 address family.";
    }

    /* TYPE DEFINITIONS */
    typedef vni-reference {
        type uint32;
        description "VRF index reference";
    }

    typedef address-family-type {
        type identityref {
            base vpp-fib-table-management:address-family-identity;
        }
        description "This type is used to refer to a FIB table type";
    }

    typedef fib-table-list-ref {
        type leafref {
            path "/vpp-fib-table-management:fib-table-management/vpp-fib-table-management:fib-tables/" +
                 "vpp-fib-table-management:table/vpp-fib-table-management:table-id";
        }
        description "This type is used by data models that need to reference a FIB table";
    }

    /* GROUPINGS */
    grouping vpp-fib-table-management {
        container fib-tables {
            description
            "The FIB tables that are managed by control-plane-protocol";

            list table {
                key "table-id address-family";

                description
                    "FIB table that is represented by VNI index (VRF reference index) and addres-family.
                     Each FIB table is uniquely identified by its index and addres family (e.g. IPv4 or IPv6).
                     Table cantains name for easier identification and description for a short summary of its
                     function.
                     In VPP this table is mapped to ip_table_add_del VPP API message:
                     Add/del table request
                         A table can be added multiple times, but need be deleted only once.
                         @param is_ipv6 - V4 or V6 table
                         @param table_id - table ID associated with the route
                                           This table ID will apply to both the unicats and mlticast FIBs
                         @param name - A client provided name/tag for the table. If this is
                                       not set by the client, then VPP will generate something meaningfull";
                leaf address-family {
                    type identityref {
                        base address-family-identity;
                    }
                    mandatory true;
                    description
                        "A reference to the address-family that the table represents (IPv4 or IPv6).
                         Mapped to is_ipv6 parameter of ip_table_add_del message.";
                }

                leaf table-id {
                    type vni-reference;
                    mandatory true;
                    description
                        "VRF index reference.
                         Mapped to table_id parameter of ip_table_add_del message.";
                }

                leaf name {
                    type string {
                        length "1..64";
                    }
                    description
                        "Name of FIB table.
                         Mapped to name parameter of ip_table_add_del message.";
                }

                leaf description {
                    type string;
                    config true;
                    description "Description of FIB table";
                }
            }
        }
    }

    /* MAIN CONTAINER */
    container fib-table-management {
        description "Configuration parameters for FIB table management";

        uses vpp-fib-table-management;
    }
}