BUG-46: initial model for RIB
[bgpcep.git] / bgp / rib-api / src / main / yang / bgp-rib.yang
1 module bgp-rib {
2         yang-version 1;
3         namespace "urn:opendaylight:params:xml:ns:yang:bgp-rib";
4         prefix "rib";
5
6         import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
7         import bgp-message { prefix bgp-msg; revision-date 2013-09-18; }
8         import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-18; }
9         import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
10
11         organization "Cisco Systems, Inc.";
12         contact "Robert Varga <rovarga@cisco.com>";
13
14         description
15                 "This module contains the concept of a Routing Information Base,
16                 as defined by RFC4271.
17
18                 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
19
20                 This program and the accompanying materials are made available
21                 under the terms of the Eclipse Public License v1.0 which
22                 accompanies this distribution, and is available at
23                 http://www.eclipse.org/legal/epl-v10.html";
24
25         revision "2013-09-25" {
26                 description
27                         "Initial revision.";
28                 reference "RFC4271";
29         }
30
31         grouping route {
32                 container next-hop {
33                         uses bgp-t:next-hop;
34                 }
35
36                 container attributes {
37                         uses bgp-msg:path-attributes;
38                 }
39         }
40
41         grouping rib {
42                 list tables {
43                         uses bgp-mp:bgp-table-type;
44                         key "afi safi";
45
46                         leaf uptodate {
47                                 type boolean;
48                                 default false;
49                         }
50
51                         choice routes {
52                                 list ipv4-routes {
53                                         when "../../afi = ipv4";
54
55                                         leaf prefix {
56                                                 type inet:ipv4-prefix;
57                                         }
58                                         key prefix;
59
60                                         uses route;
61                                 }
62                                 list ipv6-routes {
63                                         when "../../afi = ipv6";
64
65                                         leaf prefix {
66                                                 type inet:ipv4-prefix;
67                                         }
68                                         key prefix;
69
70                                         uses route;
71                                 }
72                                 case link-state {
73                                         list link-state-links {
74                                                 // FIXME: fill this out
75
76                                                 uses route;
77                                         }
78                                         list link-state-nodes {
79                                                 // FIXME: fill this out
80
81                                                 uses route;
82                                         }
83                                         list link-state-ipv4-prefixes {
84                                                 // FIXME: fill this out
85
86                                                 uses route;
87                                         }
88                                         list link-state-ipv6-prefixes {
89                                                 // FIXME: fill this out
90
91                                                 uses route;
92                                         }
93                                 }
94                         }
95                 }
96         }
97
98         container loc-rib {
99                 config false;
100                 uses rib;
101         }
102 }
103