BUG-2982 : moved path-attributes container to grouping
[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-message { prefix bgp-msg; revision-date 2013-09-19; }
7     import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
8     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
9
10         organization "Cisco Systems, Inc.";
11         contact "Robert Varga <rovarga@cisco.com>";
12
13         description
14                 "This module contains the concept of a Routing Information Base,
15         as defined by RFC4271.
16
17                 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
18
19                 This program and the accompanying materials are made available
20                 under the terms of the Eclipse Public License v1.0 which
21                 accompanies this distribution, and is available at
22                 http://www.eclipse.org/legal/epl-v10.html";
23
24         revision "2013-09-25" {
25                 description
26                         "Initial revision.";
27                 reference "RFC4271";
28         }
29
30     typedef rib-id {
31         type inet:uri;
32     }
33
34     typedef application-rib-id {
35         type inet:uri;
36     }
37
38     typedef peer-id {
39         description
40             "An abstract peer identifier. The protocol part identifies
41             the type of the peer. One well-known protocol is define, which
42             has the following format: bgp://1.2.3.4, where 1.2.3.4 is the
43             peer's BGP Identifier in IPv4 dotted-quad format.";
44         type inet:uri;
45     }
46
47     typedef peer-role {
48         type enumeration {
49             enum ebgp;
50             enum ibgp;
51             enum rr-client;
52         }
53     }
54
55     grouping route {
56         uses bgp-msg:path-attributes;
57     }
58
59     grouping rib {
60         list tables {
61             uses bgp-mp:bgp-table-type;
62             key "afi safi";
63
64             container attributes {
65                 leaf uptodate {
66                     type boolean;
67                     default false;
68                 }
69             }
70
71             choice routes {
72                // to be augmented
73             }
74         }
75     }
76
77     list application-rib {
78         config true;
79
80         leaf id {
81             type application-rib-id;
82         }
83         key id;
84
85         uses rib;
86     }
87
88     container bgp-rib {
89         list rib {
90             config false;
91
92             leaf id {
93                 type rib-id;
94             }
95             key id;
96
97             list peer {
98                 key peer-id;
99                 leaf peer-id {
100                     type peer-id;
101                 }
102                 leaf peer-role {
103                     type peer-role;
104                     mandatory true;
105                 }
106
107                 container adj-rib-in {
108                     description "Routes as we have received them from the peer.";
109                     uses rib;
110                 }
111                 container effective-rib-in {
112                     description "Routes as processed by inbound policy.";
113                     uses rib;
114                 }
115                 container adj-rib-out {
116                     uses rib;
117                 }
118             }
119
120             container loc-rib {
121                 uses rib;
122             }
123         }
124     }
125 }