Tomáš Pecka | 2a4ea7b | 2021-03-30 17:01:37 +0200 | [diff] [blame] | 1 | module ietf-ipv4-unicast-routing { |
| 2 | yang-version "1.1"; |
| 3 | namespace |
| 4 | "urn:ietf:params:xml:ns:yang:ietf-ipv4-unicast-routing"; |
| 5 | prefix "v4ur"; |
| 6 | |
| 7 | import ietf-routing { |
| 8 | prefix "rt"; |
| 9 | description |
| 10 | "An 'ietf-routing' module version that is compatible with |
| 11 | the Network Management Datastore Architecture (NMDA) |
| 12 | is required."; |
| 13 | } |
| 14 | |
| 15 | import ietf-inet-types { |
| 16 | prefix "inet"; |
| 17 | } |
| 18 | organization |
| 19 | "IETF NETMOD (Network Modeling) Working Group"; |
| 20 | contact |
| 21 | "WG Web: <https://datatracker.ietf.org/wg/netmod/> |
| 22 | WG List: <mailto:rtgwg@ietf.org> |
| 23 | |
| 24 | Editor: Ladislav Lhotka |
| 25 | <mailto:lhotka@nic.cz> |
| 26 | Acee Lindem |
| 27 | <mailto:acee@cisco.com> |
| 28 | Yingzhen Qu |
| 29 | <mailto:yingzhen.qu@huawei.com>"; |
| 30 | |
| 31 | description |
| 32 | "This YANG module augments the 'ietf-routing' module with basic |
| 33 | parameters for IPv4 unicast routing. The model fully conforms |
| 34 | to the Network Management Datastore Architecture (NMDA). |
| 35 | |
| 36 | Copyright (c) 2018 IETF Trust and the persons |
| 37 | identified as authors of the code. All rights reserved. |
| 38 | |
| 39 | Redistribution and use in source and binary forms, with or |
| 40 | without modification, is permitted pursuant to, and subject |
| 41 | to the license terms contained in, the Simplified BSD License |
| 42 | set forth in Section 4.c of the IETF Trust's Legal Provisions |
| 43 | Relating to IETF Documents |
| 44 | (https://trustee.ietf.org/license-info). |
| 45 | |
| 46 | This version of this YANG module is part of RFC 8349; see |
| 47 | the RFC itself for full legal notices."; |
| 48 | |
| 49 | revision 2018-03-13 { |
| 50 | description |
| 51 | "Network Management Datastore Architecture (NMDA) revision."; |
| 52 | reference |
| 53 | "RFC 8349: A YANG Data Model for Routing Management |
| 54 | (NMDA Version)"; |
| 55 | } |
| 56 | |
| 57 | revision 2016-11-04 { |
| 58 | description |
| 59 | "Initial revision."; |
| 60 | reference |
| 61 | "RFC 8022: A YANG Data Model for Routing Management"; |
| 62 | } |
| 63 | |
| 64 | /* Identities */ |
| 65 | |
| 66 | identity ipv4-unicast { |
| 67 | base rt:ipv4; |
| 68 | description |
| 69 | "This identity represents the IPv4 unicast address family."; |
| 70 | } |
| 71 | |
| 72 | augment "/rt:routing/rt:ribs/rt:rib/rt:routes/rt:route" { |
| 73 | when "derived-from-or-self(../../rt:address-family, " |
| 74 | + "'v4ur:ipv4-unicast')" { |
| 75 | description |
| 76 | "This augment is valid only for IPv4 unicast."; |
| 77 | } |
| 78 | description |
| 79 | "This leaf augments an IPv4 unicast route."; |
| 80 | leaf destination-prefix { |
| 81 | type inet:ipv4-prefix; |
| 82 | description |
| 83 | "IPv4 destination prefix."; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | augment "/rt:routing/rt:ribs/rt:rib/rt:routes/rt:route/" |
| 88 | + "rt:next-hop/rt:next-hop-options/rt:simple-next-hop" { |
| 89 | when "derived-from-or-self(../../../rt:address-family, " |
| 90 | + "'v4ur:ipv4-unicast')" { |
| 91 | description |
| 92 | "This augment is valid only for IPv4 unicast."; |
| 93 | } |
| 94 | description |
| 95 | "Augments the 'simple-next-hop' case in IPv4 unicast routes."; |
| 96 | leaf next-hop-address { |
| 97 | type inet:ipv4-address; |
| 98 | description |
| 99 | "IPv4 address of the next hop."; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | augment "/rt:routing/rt:ribs/rt:rib/rt:routes/rt:route/" |
| 104 | + "rt:next-hop/rt:next-hop-options/rt:next-hop-list/" |
| 105 | + "rt:next-hop-list/rt:next-hop" { |
| 106 | when "derived-from-or-self(../../../../../rt:address-family, " |
| 107 | + "'v4ur:ipv4-unicast')" { |
| 108 | description |
| 109 | "This augment is valid only for IPv4 unicast."; |
| 110 | } |
| 111 | description |
| 112 | "This leaf augments the 'next-hop-list' case of IPv4 unicast |
| 113 | routes."; |
| 114 | leaf address { |
| 115 | type inet:ipv4-address; |
| 116 | description |
| 117 | "IPv4 address of the next hop."; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | augment |
| 122 | "/rt:routing/rt:ribs/rt:rib/rt:active-route/rt:input" { |
| 123 | when "derived-from-or-self(../rt:address-family, " |
| 124 | + "'v4ur:ipv4-unicast')" { |
| 125 | description |
| 126 | "This augment is valid only for IPv4 unicast RIBs."; |
| 127 | } |
| 128 | description |
| 129 | "This augment adds the input parameter of the 'active-route' |
| 130 | action."; |
| 131 | leaf destination-address { |
| 132 | type inet:ipv4-address; |
| 133 | description |
| 134 | "IPv4 destination address."; |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | augment "/rt:routing/rt:ribs/rt:rib/rt:active-route/" |
| 139 | + "rt:output/rt:route" { |
| 140 | when "derived-from-or-self(../../rt:address-family, " |
| 141 | + "'v4ur:ipv4-unicast')" { |
| 142 | description |
| 143 | "This augment is valid only for IPv4 unicast."; |
| 144 | } |
| 145 | description |
| 146 | "This augment adds the destination prefix to the reply of the |
| 147 | 'active-route' action."; |
| 148 | leaf destination-prefix { |
| 149 | type inet:ipv4-prefix; |
| 150 | description |
| 151 | "IPv4 destination prefix."; |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | augment "/rt:routing/rt:ribs/rt:rib/rt:active-route/" |
| 156 | + "rt:output/rt:route/rt:next-hop/rt:next-hop-options/" |
| 157 | + "rt:simple-next-hop" { |
| 158 | when "derived-from-or-self(../../../rt:address-family, " |
| 159 | + "'v4ur:ipv4-unicast')" { |
| 160 | description |
| 161 | "This augment is valid only for IPv4 unicast."; |
| 162 | } |
| 163 | description |
| 164 | "Augments the 'simple-next-hop' case in the reply to the |
| 165 | 'active-route' action."; |
| 166 | leaf next-hop-address { |
| 167 | type inet:ipv4-address; |
| 168 | description |
| 169 | "IPv4 address of the next hop."; |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | augment "/rt:routing/rt:ribs/rt:rib/rt:active-route/" |
| 174 | + "rt:output/rt:route/rt:next-hop/rt:next-hop-options/" |
| 175 | + "rt:next-hop-list/rt:next-hop-list/rt:next-hop" { |
| 176 | when "derived-from-or-self(../../../../../rt:address-family, " |
| 177 | + "'v4ur:ipv4-unicast')" { |
| 178 | description |
| 179 | "This augment is valid only for IPv4 unicast."; |
| 180 | } |
| 181 | description |
| 182 | "Augments the 'next-hop-list' case in the reply to the |
| 183 | 'active-route' action."; |
| 184 | leaf next-hop-address { |
| 185 | type inet:ipv4-address; |
| 186 | description |
| 187 | "IPv4 address of the next hop."; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | augment "/rt:routing/rt:control-plane-protocols/" |
| 192 | + "rt:control-plane-protocol/rt:static-routes" { |
| 193 | description |
| 194 | "This augment defines the 'static' pseudo-protocol |
| 195 | with data specific to IPv4 unicast."; |
| 196 | container ipv4 { |
| 197 | description |
| 198 | "Support for a 'static' pseudo-protocol instance |
| 199 | consists of a list of routes."; |
| 200 | list route { |
| 201 | key "destination-prefix"; |
| 202 | description |
| 203 | "A list of static routes."; |
| 204 | leaf destination-prefix { |
| 205 | type inet:ipv4-prefix; |
| 206 | mandatory true; |
| 207 | description |
| 208 | "IPv4 destination prefix."; |
| 209 | } |
| 210 | leaf description { |
| 211 | type string; |
| 212 | description |
| 213 | "Textual description of the route."; |
| 214 | } |
| 215 | container next-hop { |
| 216 | description |
| 217 | "Support for next-hop."; |
| 218 | uses rt:next-hop-content { |
| 219 | augment "next-hop-options/simple-next-hop" { |
| 220 | description |
| 221 | "Augments the 'simple-next-hop' case in IPv4 static |
| 222 | routes."; |
| 223 | leaf next-hop-address { |
| 224 | type inet:ipv4-address; |
| 225 | description |
| 226 | "IPv4 address of the next hop."; |
| 227 | } |
| 228 | } |
| 229 | augment "next-hop-options/next-hop-list/next-hop-list/" |
| 230 | + "next-hop" { |
| 231 | description |
| 232 | "Augments the 'next-hop-list' case in IPv4 static |
| 233 | routes."; |
| 234 | leaf next-hop-address { |
| 235 | type inet:ipv4-address; |
| 236 | description |
| 237 | "IPv4 address of the next hop."; |
| 238 | } |
| 239 | } |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | /* |
| 247 | * The subsequent data nodes are obviated and obsoleted |
| 248 | * by the Network Management Datastore Architecture |
| 249 | * as described in RFC 8342. |
| 250 | */ |
| 251 | augment "/rt:routing-state/rt:ribs/rt:rib/rt:routes/rt:route" { |
| 252 | when "derived-from-or-self(../../rt:address-family, " |
| 253 | + "'v4ur:ipv4-unicast')" { |
| 254 | description |
| 255 | "This augment is valid only for IPv4 unicast."; |
| 256 | } |
| 257 | status obsolete; |
| 258 | description |
| 259 | "This leaf augments an IPv4 unicast route."; |
| 260 | leaf destination-prefix { |
| 261 | type inet:ipv4-prefix; |
| 262 | status obsolete; |
| 263 | description |
| 264 | "IPv4 destination prefix."; |
| 265 | } |
| 266 | } |
| 267 | augment "/rt:routing-state/rt:ribs/rt:rib/rt:routes/rt:route/" |
| 268 | + "rt:next-hop/rt:next-hop-options/rt:simple-next-hop" { |
| 269 | when "derived-from-or-self( |
| 270 | ../../../rt:address-family, 'v4ur:ipv4-unicast')" { |
| 271 | description |
| 272 | "This augment is valid only for IPv4 unicast."; |
| 273 | } |
| 274 | status obsolete; |
| 275 | description |
| 276 | "Augments the 'simple-next-hop' case in IPv4 unicast routes."; |
| 277 | leaf next-hop-address { |
| 278 | type inet:ipv4-address; |
| 279 | status obsolete; |
| 280 | description |
| 281 | "IPv4 address of the next hop."; |
| 282 | } |
| 283 | } |
| 284 | augment "/rt:routing-state/rt:ribs/rt:rib/rt:routes/rt:route/" |
| 285 | + "rt:next-hop/rt:next-hop-options/rt:next-hop-list/" |
| 286 | + "rt:next-hop-list/rt:next-hop" { |
| 287 | when "derived-from-or-self(../../../../../rt:address-family, |
| 288 | 'v4ur:ipv4-unicast')" { |
| 289 | description |
| 290 | "This augment is valid only for IPv4 unicast."; |
| 291 | } |
| 292 | status obsolete; |
| 293 | description |
| 294 | "This leaf augments the 'next-hop-list' case of IPv4 unicast |
| 295 | routes."; |
| 296 | leaf address { |
| 297 | type inet:ipv4-address; |
| 298 | status obsolete; |
| 299 | description |
| 300 | "IPv4 address of the next hop."; |
| 301 | } |
| 302 | } |
| 303 | augment "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/" |
| 304 | + "rt:input" { |
| 305 | when "derived-from-or-self(../rt:address-family, |
| 306 | 'v4ur:ipv4-unicast')" { |
| 307 | description |
| 308 | "This augment is valid only for IPv4 unicast RIBs."; |
| 309 | } |
| 310 | status obsolete; |
| 311 | description |
| 312 | "This augment adds the input parameter of the 'active-route' |
| 313 | action."; |
| 314 | leaf destination-address { |
| 315 | type inet:ipv4-address; |
| 316 | status obsolete; |
| 317 | description |
| 318 | "IPv4 destination address."; |
| 319 | } |
| 320 | } |
| 321 | augment "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/" |
| 322 | + "rt:output/rt:route" { |
| 323 | when "derived-from-or-self(../../rt:address-family, |
| 324 | 'v4ur:ipv4-unicast')" { |
| 325 | description |
| 326 | "This augment is valid only for IPv4 unicast."; |
| 327 | } |
| 328 | status obsolete; |
| 329 | description |
| 330 | "This augment adds the destination prefix to the reply of the |
| 331 | 'active-route' action."; |
| 332 | leaf destination-prefix { |
| 333 | type inet:ipv4-prefix; |
| 334 | status obsolete; |
| 335 | description |
| 336 | "IPv4 destination prefix."; |
| 337 | } |
| 338 | } |
| 339 | augment "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/" |
| 340 | + "rt:output/rt:route/rt:next-hop/rt:next-hop-options/" |
| 341 | + "rt:simple-next-hop" { |
| 342 | when "derived-from-or-self(../../../rt:address-family, |
| 343 | 'v4ur:ipv4-unicast')" { |
| 344 | description |
| 345 | "This augment is valid only for IPv4 unicast."; |
| 346 | } |
| 347 | status obsolete; |
| 348 | description |
| 349 | "Augments the 'simple-next-hop' case in the reply to the |
| 350 | 'active-route' action."; |
| 351 | leaf next-hop-address { |
| 352 | type inet:ipv4-address; |
| 353 | status obsolete; |
| 354 | description |
| 355 | "IPv4 address of the next hop."; |
| 356 | } |
| 357 | } |
| 358 | augment "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/" |
| 359 | + "rt:output/rt:route/rt:next-hop/rt:next-hop-options/" |
| 360 | + "rt:next-hop-list/rt:next-hop-list/rt:next-hop" { |
| 361 | when "derived-from-or-self(../../../../../rt:address-family, |
| 362 | 'v4ur:ipv4-unicast')" { |
| 363 | description |
| 364 | "This augment is valid only for IPv4 unicast."; |
| 365 | } |
| 366 | status obsolete; |
| 367 | description |
| 368 | "Augments the 'next-hop-list' case in the reply to the |
| 369 | 'active-route' action."; |
| 370 | leaf next-hop-address { |
| 371 | type inet:ipv4-address; |
| 372 | status obsolete; |
| 373 | description |
| 374 | "IPv4 address of the next hop."; |
| 375 | } |
| 376 | } |
| 377 | } |