blob: 1af876b40ad39a6f3a9dfe1fea1d3ee809eae512 [file] [log] [blame]
Thomas Vachuska8ca75a22017-08-24 16:12:59 -07001module openconfig-rib-bgp {
2
3 yang-version "1";
4
5 // namespace
6 namespace "http://openconfig.net/yang/rib/bgp";
7
8 prefix "oc-rib-bgp";
9
10 // import some basic types
11 import openconfig-bgp-types { prefix oc-bgpt; }
12 import openconfig-extensions { prefix oc-ext; }
13
14 // include RIB submodules
15
16 // structure for LOC-RIB and Adj-RIB tables
17 include openconfig-rib-bgp-tables;
18
19 // structure of shared attribute groups
20 include openconfig-rib-bgp-shared-attributes;
21
22 // groupings of attributes in three categories:
23 // - shared across multiple routes
24 // - common to LOC-RIB and Adj-RIB, but not shared across routes
25 // - specific to LOC-RIB or Adj-RIB
26 include openconfig-rib-bgp-attributes;
27
28 // groupings of annotations for each route or table
29 include openconfig-rib-bgp-table-attributes;
30
31 // meta
32 organization "OpenConfig working group";
33
34 contact
35 "OpenConfig working group
36 www.openconfig.net";
37
38 description
39 "Defines a data model for representing BGP routing table (RIB)
40 contents. The model supports 5 logical RIBs per address family:
41
42 loc-rib: This is the main BGP routing table for the local routing
43 instance, containing best-path selections for each prefix. The
44 loc-rib table may contain multiple routes for a given prefix,
45 with an attribute to indicate which was selected as the best
46 path. Note that multiple paths may be used or advertised even if
47 only one path is marked as best, e.g., when using BGP
48 add-paths. An implementation may choose to mark multiple
49 paths in the RIB as best path by setting the flag to true for
50 multiple entries.
51
52 adj-rib-in-pre: This is a per-neighbor table containing the NLRI
53 updates received from the neighbor before any local input policy
54 rules or filters have been applied. This can be considered the
55 'raw' updates from a given neighbor.
56
57 adj-rib-in-post: This is a per-neighbor table containing the
58 routes received from the neighbor that are eligible for
59 best-path selection after local input policy rules have been
60 applied.
61
62 adj-rib-out-pre: This is a per-neighbor table containing routes
63 eligible for sending (advertising) to the neighbor before output
64 policy rules have been applied.
65
66 adj-rib-out-post: This is a per-neighbor table containing routes
67 eligible for sending (advertising) to the neighbor after output
68 policy rules have been applied.";
69
70 oc-ext:openconfig-version "0.3.0";
71
72 revision "2016-10-17" {
73 description
74 "OpenConfig BGP RIB refactor";
75 reference "0.3.0";
76 }
77
78 revision "2016-04-11" {
79 description
80 "OpenConfig public release";
81 reference "0.2.0";
82 }
83
84
85
86 // grouping statements
87
88
89
90 grouping bgp-rib-state {
91 description
92 "Operational state data for the top level BGP RIB";
93
94 leaf afi-safi-name {
95 type identityref {
96 base oc-bgpt:AFI_SAFI_TYPE;
97 }
98 description "AFI,SAFI";
99 }
100 }
101
102 grouping bgp-rib-top {
103 description
104 "Top-level grouping for the BGP RIB";
105
106 container bgp-rib {
107 config false;
108 description
109 "Top level container for BGP RIBs";
110
111 uses attribute-sets-top;
112 uses community-sets-top;
113 uses ext-community-sets-top;
114
115 container afi-safis {
116 config false;
117 description
118 "Enclosing container for address family list";
119
120 list afi-safi {
121 key "afi-safi-name";
122 description
123 "list of afi-safi types";
124
125 leaf afi-safi-name {
126 type leafref {
127 path "../state/afi-safi-name";
128 }
129 description
130 "Reference to the list key";
131 }
132
133 container state {
134 config false;
135 description
136 "Operational state data for the BGP list";
137
138 uses bgp-rib-state;
139 }
140
141 container ipv4-unicast {
142 when "../afi-safi-name = 'oc-bgpt:IPV4_UNICAST'" {
143 description
144 "Include this container for IPv4 unicast RIB";
145 }
146 description
147 "Routing tables for IPv4 unicast -- active when the
148 afi-safi name is ipv4-unicast";
149
150 uses ipv4-loc-rib-top;
151 uses ipv4-adj-rib-top;
152 }
153
154 container ipv6-unicast {
155 when "../afi-safi-name = 'oc-bgpt:IPV6_UNICAST'" {
156 description
157 "Include this container for IPv6 unicast RIB";
158 }
159 description
160 "Routing tables for IPv6 unicast -- active when the
161 afi-safi name is ipv6-unicast";
162
163 uses ipv6-loc-rib-top;
164 uses ipv6-adj-rib-top;
165 }
166 }
167 }
168 }
169 }
170
171
172 // data definition statements
173
174 uses bgp-rib-top;
175
176 // augment statements
177
178
179 // rpc statements
180
181 // notification statements
182
183}