Thomas Vachuska | 6655bee | 2017-08-24 16:12:59 -0700 | [diff] [blame] | 1 | module openconfig-interfaces { |
| 2 | |
| 3 | yang-version "1"; |
| 4 | |
| 5 | // namespace |
| 6 | namespace "http://openconfig.net/yang/interfaces"; |
| 7 | |
| 8 | prefix "oc-if"; |
| 9 | |
| 10 | // import some basic types |
| 11 | import ietf-interfaces { prefix ietf-if; } |
| 12 | import openconfig-yang-types { prefix oc-yang; } |
| 13 | import openconfig-types { prefix oc-types; } |
| 14 | import openconfig-extensions { prefix oc-ext; } |
| 15 | |
| 16 | // meta |
| 17 | organization "OpenConfig working group"; |
| 18 | |
| 19 | contact |
| 20 | "OpenConfig working group |
| 21 | netopenconfig@googlegroups.com"; |
| 22 | |
| 23 | description |
| 24 | "Model for managing network interfaces and subinterfaces. This |
| 25 | module also defines convenience types / groupings for other |
| 26 | models to create references to interfaces: |
| 27 | |
| 28 | base-interface-ref (type) - reference to a base interface |
| 29 | interface-ref (grouping) - container for reference to a |
| 30 | interface + subinterface |
| 31 | interface-ref-state (grouping) - container for read-only |
| 32 | (opstate) reference to interface + subinterface |
| 33 | |
| 34 | This model reuses data items defined in the IETF YANG model for |
| 35 | interfaces described by RFC 7223 with an alternate structure |
| 36 | (particularly for operational state data) and with |
| 37 | additional configuration items. |
| 38 | |
| 39 | Portions of this code were derived from IETF RFC 7223. |
| 40 | Please reproduce this note if possible. |
| 41 | |
| 42 | IETF code is subject to the following copyright and license: |
| 43 | Copyright (c) IETF Trust and the persons identified as authors of |
| 44 | the code. |
| 45 | All rights reserved. |
| 46 | |
| 47 | Redistribution and use in source and binary forms, with or without |
| 48 | modification, is permitted pursuant to, and subject to the license |
| 49 | terms contained in, the Simplified BSD License set forth in |
| 50 | Section 4.c of the IETF Trust's Legal Provisions Relating |
| 51 | to IETF Documents (http://trustee.ietf.org/license-info)."; |
| 52 | |
| 53 | oc-ext:openconfig-version "2.0.0"; |
| 54 | |
| 55 | revision "2017-07-14" { |
| 56 | description |
| 57 | "Added Ethernet/IP state data; Add dhcp-client; |
| 58 | migrate to OpenConfig types modules; Removed or |
| 59 | renamed opstate values"; |
| 60 | reference "2.0.0"; |
| 61 | } |
| 62 | |
| 63 | revision "2017-04-03" { |
| 64 | description |
| 65 | "Update copyright notice."; |
| 66 | reference "1.1.1"; |
| 67 | } |
| 68 | |
| 69 | revision "2016-12-22" { |
| 70 | description |
| 71 | "Fixes to Ethernet interfaces model"; |
| 72 | reference "1.1.0"; |
| 73 | } |
| 74 | |
| 75 | |
| 76 | // typedef statements |
| 77 | |
| 78 | typedef base-interface-ref { |
| 79 | type leafref { |
| 80 | path "/oc-if:interfaces/oc-if:interface/oc-if:name"; |
| 81 | } |
| 82 | description |
| 83 | "Reusable type for by-name reference to a base interface. |
| 84 | This type may be used in cases where ability to reference |
| 85 | a subinterface is not required."; |
| 86 | } |
| 87 | |
| 88 | typedef interface-id { |
| 89 | type string; |
| 90 | description |
| 91 | "User-defined identifier for an interface, generally used to |
| 92 | name a interface reference. The id can be arbitrary but a |
| 93 | useful convention is to use a combination of base interface |
| 94 | name and subinterface index."; |
| 95 | } |
| 96 | |
| 97 | // grouping statements |
| 98 | |
| 99 | grouping interface-ref-common { |
| 100 | description |
| 101 | "Reference leafrefs to interface / subinterface"; |
| 102 | |
| 103 | leaf interface { |
| 104 | type leafref { |
| 105 | path "/oc-if:interfaces/oc-if:interface/oc-if:name"; |
| 106 | } |
| 107 | description |
| 108 | "Reference to a base interface. If a reference to a |
| 109 | subinterface is required, this leaf must be specified |
| 110 | to indicate the base interface."; |
| 111 | } |
| 112 | |
| 113 | leaf subinterface { |
| 114 | type leafref { |
| 115 | path "/oc-if:interfaces/" + |
| 116 | "oc-if:interface[oc-if:name=current()/../interface]/" + |
| 117 | "oc-if:subinterfaces/oc-if:subinterface/oc-if:index"; |
| 118 | } |
| 119 | description |
| 120 | "Reference to a subinterface -- this requires the base |
| 121 | interface to be specified using the interface leaf in |
| 122 | this container. If only a reference to a base interface |
| 123 | is requuired, this leaf should not be set."; |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | grouping interface-ref-state-container { |
| 128 | description |
| 129 | "Reusable opstate w/container for a reference to an |
| 130 | interface or subinterface"; |
| 131 | |
| 132 | container state { |
| 133 | config false; |
| 134 | description |
| 135 | "Operational state for interface-ref"; |
| 136 | |
| 137 | uses interface-ref-common; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | grouping interface-ref { |
| 142 | description |
| 143 | "Reusable definition for a reference to an interface or |
| 144 | subinterface"; |
| 145 | |
| 146 | container interface-ref { |
| 147 | description |
| 148 | "Reference to an interface or subinterface"; |
| 149 | |
| 150 | container config { |
| 151 | description |
| 152 | "Configured reference to interface / subinterface"; |
| 153 | |
| 154 | uses interface-ref-common; |
| 155 | } |
| 156 | |
| 157 | uses interface-ref-state-container; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | grouping interface-ref-state { |
| 162 | description |
| 163 | "Reusable opstate w/container for a reference to an |
| 164 | interface or subinterface"; |
| 165 | |
| 166 | container interface-ref { |
| 167 | description |
| 168 | "Reference to an interface or subinterface"; |
| 169 | |
| 170 | uses interface-ref-state-container; |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | grouping base-interface-ref-state { |
| 175 | description |
| 176 | "Reusable opstate w/container for a reference to a |
| 177 | base interface (no subinterface)."; |
| 178 | |
| 179 | container state { |
| 180 | config false; |
| 181 | description |
| 182 | "Operational state for base interface reference"; |
| 183 | |
| 184 | leaf interface { |
| 185 | type base-interface-ref; |
| 186 | description |
| 187 | "Reference to a base interface."; |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | |
| 193 | grouping interface-common-config { |
| 194 | description |
| 195 | "Configuration data data nodes common to physical interfaces |
| 196 | and subinterfaces"; |
| 197 | |
| 198 | leaf description { |
| 199 | type string; |
| 200 | description |
| 201 | "A textual description of the interface. |
| 202 | |
| 203 | A server implementation MAY map this leaf to the ifAlias |
| 204 | MIB object. Such an implementation needs to use some |
| 205 | mechanism to handle the differences in size and characters |
| 206 | allowed between this leaf and ifAlias. The definition of |
| 207 | such a mechanism is outside the scope of this document. |
| 208 | |
| 209 | Since ifAlias is defined to be stored in non-volatile |
| 210 | storage, the MIB implementation MUST map ifAlias to the |
| 211 | value of 'description' in the persistently stored |
| 212 | datastore. |
| 213 | |
| 214 | Specifically, if the device supports ':startup', when |
| 215 | ifAlias is read the device MUST return the value of |
| 216 | 'description' in the 'startup' datastore, and when it is |
| 217 | written, it MUST be written to the 'running' and 'startup' |
| 218 | datastores. Note that it is up to the implementation to |
| 219 | |
| 220 | decide whether to modify this single leaf in 'startup' or |
| 221 | perform an implicit copy-config from 'running' to |
| 222 | 'startup'. |
| 223 | |
| 224 | If the device does not support ':startup', ifAlias MUST |
| 225 | be mapped to the 'description' leaf in the 'running' |
| 226 | datastore."; |
| 227 | reference |
| 228 | "RFC 2863: The Interfaces Group MIB - ifAlias"; |
| 229 | } |
| 230 | |
| 231 | leaf enabled { |
| 232 | type boolean; |
| 233 | default "true"; |
| 234 | description |
| 235 | "This leaf contains the configured, desired state of the |
| 236 | interface. |
| 237 | |
| 238 | Systems that implement the IF-MIB use the value of this |
| 239 | leaf in the 'running' datastore to set |
| 240 | IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry |
| 241 | has been initialized, as described in RFC 2863. |
| 242 | |
| 243 | Changes in this leaf in the 'running' datastore are |
| 244 | reflected in ifAdminStatus, but if ifAdminStatus is |
| 245 | changed over SNMP, this leaf is not affected."; |
| 246 | reference |
| 247 | "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; |
| 248 | } |
| 249 | |
| 250 | } |
| 251 | |
| 252 | grouping interface-phys-config { |
| 253 | description |
| 254 | "Configuration data for physical interfaces"; |
| 255 | |
| 256 | leaf name { |
| 257 | type string; |
| 258 | description |
| 259 | "The name of the interface. |
| 260 | |
| 261 | A device MAY restrict the allowed values for this leaf, |
| 262 | possibly depending on the type of the interface. |
| 263 | For system-controlled interfaces, this leaf is the |
| 264 | device-specific name of the interface. The 'config false' |
| 265 | list interfaces/interface[name]/state contains the currently |
| 266 | existing interfaces on the device. |
| 267 | |
| 268 | If a client tries to create configuration for a |
| 269 | system-controlled interface that is not present in the |
| 270 | corresponding state list, the server MAY reject |
| 271 | the request if the implementation does not support |
| 272 | pre-provisioning of interfaces or if the name refers to |
| 273 | an interface that can never exist in the system. A |
| 274 | NETCONF server MUST reply with an rpc-error with the |
| 275 | error-tag 'invalid-value' in this case. |
| 276 | |
| 277 | The IETF model in RFC 7223 provides YANG features for the |
| 278 | following (i.e., pre-provisioning and arbitrary-names), |
| 279 | however they are omitted here: |
| 280 | |
| 281 | If the device supports pre-provisioning of interface |
| 282 | configuration, the 'pre-provisioning' feature is |
| 283 | advertised. |
| 284 | |
| 285 | If the device allows arbitrarily named user-controlled |
| 286 | interfaces, the 'arbitrary-names' feature is advertised. |
| 287 | |
| 288 | When a configured user-controlled interface is created by |
| 289 | the system, it is instantiated with the same name in the |
| 290 | /interfaces/interface[name]/state list."; |
| 291 | } |
| 292 | |
| 293 | leaf type { |
| 294 | type identityref { |
| 295 | base ietf-if:interface-type; |
| 296 | } |
| 297 | mandatory true; |
| 298 | description |
| 299 | "The type of the interface. |
| 300 | |
| 301 | When an interface entry is created, a server MAY |
| 302 | initialize the type leaf with a valid value, e.g., if it |
| 303 | is possible to derive the type from the name of the |
| 304 | interface. |
| 305 | |
| 306 | If a client tries to set the type of an interface to a |
| 307 | value that can never be used by the system, e.g., if the |
| 308 | type is not supported or if the type does not match the |
| 309 | name of the interface, the server MUST reject the request. |
| 310 | A NETCONF server MUST reply with an rpc-error with the |
| 311 | error-tag 'invalid-value' in this case."; |
| 312 | reference |
| 313 | "RFC 2863: The Interfaces Group MIB - ifType"; |
| 314 | } |
| 315 | |
| 316 | leaf mtu { |
| 317 | type uint16; |
| 318 | description |
| 319 | "Set the max transmission unit size in octets |
| 320 | for the physical interface. If this is not set, the mtu is |
| 321 | set to the operational default -- e.g., 1514 bytes on an |
| 322 | Ethernet interface."; |
| 323 | } |
| 324 | |
| 325 | uses interface-common-config; |
| 326 | } |
| 327 | |
| 328 | grouping interface-phys-holdtime-config { |
| 329 | description |
| 330 | "Configuration data for interface hold-time settings -- |
| 331 | applies to physical interfaces."; |
| 332 | |
| 333 | leaf up { |
| 334 | type uint32; |
| 335 | units milliseconds; |
| 336 | default 0; |
| 337 | description |
| 338 | "Dampens advertisement when the interface |
| 339 | transitions from down to up. A zero value means dampening |
| 340 | is turned off, i.e., immediate notification."; |
| 341 | } |
| 342 | |
| 343 | leaf down { |
| 344 | type uint32; |
| 345 | units milliseconds; |
| 346 | default 0; |
| 347 | description |
| 348 | "Dampens advertisement when the interface transitions from |
| 349 | up to down. A zero value means dampening is turned off, |
| 350 | i.e., immediate notification."; |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | grouping interface-phys-holdtime-state { |
| 355 | description |
| 356 | "Operational state data for interface hold-time."; |
| 357 | } |
| 358 | |
| 359 | grouping interface-phys-holdtime-top { |
| 360 | description |
| 361 | "Top-level grouping for setting link transition |
| 362 | dampening on physical and other types of interfaces."; |
| 363 | |
| 364 | container hold-time { |
| 365 | description |
| 366 | "Top-level container for hold-time settings to enable |
| 367 | dampening advertisements of interface transitions."; |
| 368 | |
| 369 | container config { |
| 370 | description |
| 371 | "Configuration data for interface hold-time settings."; |
| 372 | |
| 373 | uses interface-phys-holdtime-config; |
| 374 | } |
| 375 | |
| 376 | container state { |
| 377 | |
| 378 | config false; |
| 379 | |
| 380 | description |
| 381 | "Operational state data for interface hold-time."; |
| 382 | |
| 383 | uses interface-phys-holdtime-config; |
| 384 | uses interface-phys-holdtime-state; |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | grouping interface-common-state { |
| 390 | description |
| 391 | "Operational state data (in addition to intended configuration) |
| 392 | at the global level for this interface"; |
| 393 | |
| 394 | leaf ifindex { |
| 395 | type uint32; |
| 396 | description |
| 397 | "System assigned number for each interface. Corresponds to |
| 398 | ifIndex object in SNMP Interface MIB"; |
| 399 | reference |
| 400 | "RFC 2863 - The Interfaces Group MIB"; |
| 401 | } |
| 402 | |
| 403 | leaf admin-status { |
| 404 | type enumeration { |
| 405 | enum UP { |
| 406 | description |
| 407 | "Ready to pass packets."; |
| 408 | } |
| 409 | enum DOWN { |
| 410 | description |
| 411 | "Not ready to pass packets and not in some test mode."; |
| 412 | } |
| 413 | enum TESTING { |
| 414 | //TODO: This is generally not supported as a configured |
| 415 | //admin state, though it's in the standard interfaces MIB. |
| 416 | //Consider removing it. |
| 417 | description |
| 418 | "In some test mode."; |
| 419 | } |
| 420 | } |
| 421 | //TODO:consider converting to an identity to have the |
| 422 | //flexibility to remove some values defined by RFC 7223 that |
| 423 | //are not used or not implemented consistently. |
| 424 | mandatory true; |
| 425 | description |
| 426 | "The desired state of the interface. In RFC 7223 this leaf |
| 427 | has the same read semantics as ifAdminStatus. Here, it |
| 428 | reflects the administrative state as set by enabling or |
| 429 | disabling the interface."; |
| 430 | reference |
| 431 | "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; |
| 432 | } |
| 433 | |
| 434 | leaf oper-status { |
| 435 | type enumeration { |
| 436 | enum UP { |
| 437 | value 1; |
| 438 | description |
| 439 | "Ready to pass packets."; |
| 440 | } |
| 441 | enum DOWN { |
| 442 | value 2; |
| 443 | description |
| 444 | "The interface does not pass any packets."; |
| 445 | } |
| 446 | enum TESTING { |
| 447 | value 3; |
| 448 | description |
| 449 | "In some test mode. No operational packets can |
| 450 | be passed."; |
| 451 | } |
| 452 | enum UNKNOWN { |
| 453 | value 4; |
| 454 | description |
| 455 | "Status cannot be determined for some reason."; |
| 456 | } |
| 457 | enum DORMANT { |
| 458 | value 5; |
| 459 | description |
| 460 | "Waiting for some external event."; |
| 461 | } |
| 462 | enum NOT_PRESENT { |
| 463 | value 6; |
| 464 | description |
| 465 | "Some component (typically hardware) is missing."; |
| 466 | } |
| 467 | enum LOWER_LAYER_DOWN { |
| 468 | value 7; |
| 469 | description |
| 470 | "Down due to state of lower-layer interface(s)."; |
| 471 | } |
| 472 | } |
| 473 | //TODO:consider converting to an identity to have the |
| 474 | //flexibility to remove some values defined by RFC 7223 that |
| 475 | //are not used or not implemented consistently. |
| 476 | mandatory true; |
| 477 | description |
| 478 | "The current operational state of the interface. |
| 479 | |
| 480 | This leaf has the same semantics as ifOperStatus."; |
| 481 | reference |
| 482 | "RFC 2863: The Interfaces Group MIB - ifOperStatus"; |
| 483 | } |
| 484 | |
| 485 | leaf last-change { |
| 486 | type oc-types:timeticks64; |
| 487 | units nanoseconds; |
| 488 | description |
| 489 | "This timestamp indicates the time of the last state change |
| 490 | of the interface (e.g., up-to-down transition). This |
| 491 | corresponds to the ifLastChange object in the standard |
| 492 | interface MIB. |
| 493 | |
| 494 | The value is the timestamp in nanoseconds relative to |
| 495 | the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; |
| 496 | reference |
| 497 | "RFC 2863: The Interfaces Group MIB - ifLastChange"; |
| 498 | } |
| 499 | |
| 500 | } |
| 501 | |
| 502 | |
| 503 | grouping interface-counters-state { |
| 504 | description |
| 505 | "Operational state representing interface counters |
| 506 | and statistics."; |
| 507 | |
| 508 | //TODO: we may need to break this list of counters into those |
| 509 | //that would appear for physical vs. subinterface or logical |
| 510 | //interfaces. For now, just replicating the full stats |
| 511 | //grouping to both interface and subinterface. |
| 512 | |
| 513 | container counters { |
| 514 | description |
| 515 | "A collection of interface-related statistics objects."; |
| 516 | |
| 517 | leaf in-octets { |
| 518 | type oc-yang:counter64; |
| 519 | description |
| 520 | "The total number of octets received on the interface, |
| 521 | including framing characters. |
| 522 | |
| 523 | Discontinuities in the value of this counter can occur |
| 524 | at re-initialization of the management system, and at |
| 525 | other times as indicated by the value of |
| 526 | 'last-clear'."; |
| 527 | reference |
| 528 | "RFC 2863: The Interfaces Group MIB - ifHCInOctets"; |
| 529 | } |
| 530 | |
| 531 | leaf in-unicast-pkts { |
| 532 | type oc-yang:counter64; |
| 533 | description |
| 534 | "The number of packets, delivered by this sub-layer to a |
| 535 | higher (sub-)layer, that were not addressed to a |
| 536 | multicast or broadcast address at this sub-layer. |
| 537 | |
| 538 | Discontinuities in the value of this counter can occur |
| 539 | at re-initialization of the management system, and at |
| 540 | other times as indicated by the value of |
| 541 | 'last-clear'."; |
| 542 | reference |
| 543 | "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts"; |
| 544 | } |
| 545 | |
| 546 | leaf in-broadcast-pkts { |
| 547 | type oc-yang:counter64; |
| 548 | description |
| 549 | "The number of packets, delivered by this sub-layer to a |
| 550 | higher (sub-)layer, that were addressed to a broadcast |
| 551 | address at this sub-layer. |
| 552 | |
| 553 | Discontinuities in the value of this counter can occur |
| 554 | at re-initialization of the management system, and at |
| 555 | other times as indicated by the value of |
| 556 | 'last-clear'."; |
| 557 | reference |
| 558 | "RFC 2863: The Interfaces Group MIB - |
| 559 | ifHCInBroadcastPkts"; |
| 560 | } |
| 561 | |
| 562 | leaf in-multicast-pkts { |
| 563 | type oc-yang:counter64; |
| 564 | description |
| 565 | "The number of packets, delivered by this sub-layer to a |
| 566 | higher (sub-)layer, that were addressed to a multicast |
| 567 | address at this sub-layer. For a MAC-layer protocol, |
| 568 | this includes both Group and Functional addresses. |
| 569 | |
| 570 | Discontinuities in the value of this counter can occur |
| 571 | at re-initialization of the management system, and at |
| 572 | other times as indicated by the value of |
| 573 | 'last-clear'."; |
| 574 | reference |
| 575 | "RFC 2863: The Interfaces Group MIB - |
| 576 | ifHCInMulticastPkts"; |
| 577 | } |
| 578 | |
| 579 | leaf in-discards { |
| 580 | type oc-yang:counter64; |
| 581 | description |
| 582 | "The number of inbound packets that were chosen to be |
| 583 | discarded even though no errors had been detected to |
| 584 | prevent their being deliverable to a higher-layer |
| 585 | protocol. One possible reason for discarding such a |
| 586 | packet could be to free up buffer space. |
| 587 | |
| 588 | Discontinuities in the value of this counter can occur |
| 589 | at re-initialization of the management system, and at |
| 590 | other times as indicated by the value of |
| 591 | 'last-clear'."; |
| 592 | |
| 593 | |
| 594 | reference |
| 595 | "RFC 2863: The Interfaces Group MIB - ifInDiscards"; |
| 596 | } |
| 597 | |
| 598 | leaf in-errors { |
| 599 | type oc-yang:counter64; |
| 600 | description |
| 601 | "For packet-oriented interfaces, the number of inbound |
| 602 | packets that contained errors preventing them from being |
| 603 | deliverable to a higher-layer protocol. For character- |
| 604 | oriented or fixed-length interfaces, the number of |
| 605 | inbound transmission units that contained errors |
| 606 | preventing them from being deliverable to a higher-layer |
| 607 | protocol. |
| 608 | |
| 609 | Discontinuities in the value of this counter can occur |
| 610 | at re-initialization of the management system, and at |
| 611 | other times as indicated by the value of |
| 612 | 'last-clear'."; |
| 613 | reference |
| 614 | "RFC 2863: The Interfaces Group MIB - ifInErrors"; |
| 615 | } |
| 616 | |
| 617 | leaf in-unknown-protos { |
| 618 | type oc-yang:counter64; |
| 619 | description |
| 620 | "For packet-oriented interfaces, the number of packets |
| 621 | received via the interface that were discarded because |
| 622 | of an unknown or unsupported protocol. For |
| 623 | character-oriented or fixed-length interfaces that |
| 624 | support protocol multiplexing, the number of |
| 625 | transmission units received via the interface that were |
| 626 | discarded because of an unknown or unsupported protocol. |
| 627 | For any interface that does not support protocol |
| 628 | multiplexing, this counter is not present. |
| 629 | |
| 630 | Discontinuities in the value of this counter can occur |
| 631 | at re-initialization of the management system, and at |
| 632 | other times as indicated by the value of |
| 633 | 'last-clear'."; |
| 634 | reference |
| 635 | "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos"; |
| 636 | } |
| 637 | |
| 638 | leaf in-fcs-errors { |
| 639 | type oc-yang:counter64; |
| 640 | description |
| 641 | "Number of received packets which had errors in the |
| 642 | frame check sequence (FCS), i.e., framing errors. |
| 643 | |
| 644 | Discontinuities in the value of this counter can occur |
| 645 | when the device is re-initialization as indicated by the |
| 646 | value of 'last-clear'."; |
| 647 | } |
| 648 | |
| 649 | leaf out-octets { |
| 650 | type oc-yang:counter64; |
| 651 | description |
| 652 | "The total number of octets transmitted out of the |
| 653 | interface, including framing characters. |
| 654 | |
| 655 | Discontinuities in the value of this counter can occur |
| 656 | at re-initialization of the management system, and at |
| 657 | other times as indicated by the value of |
| 658 | 'last-clear'."; |
| 659 | reference |
| 660 | "RFC 2863: The Interfaces Group MIB - ifHCOutOctets"; |
| 661 | } |
| 662 | |
| 663 | leaf out-unicast-pkts { |
| 664 | type oc-yang:counter64; |
| 665 | description |
| 666 | "The total number of packets that higher-level protocols |
| 667 | requested be transmitted, and that were not addressed |
| 668 | to a multicast or broadcast address at this sub-layer, |
| 669 | including those that were discarded or not sent. |
| 670 | |
| 671 | Discontinuities in the value of this counter can occur |
| 672 | at re-initialization of the management system, and at |
| 673 | other times as indicated by the value of |
| 674 | 'last-clear'."; |
| 675 | reference |
| 676 | "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts"; |
| 677 | } |
| 678 | |
| 679 | leaf out-broadcast-pkts { |
| 680 | type oc-yang:counter64; |
| 681 | description |
| 682 | "The total number of packets that higher-level protocols |
| 683 | requested be transmitted, and that were addressed to a |
| 684 | broadcast address at this sub-layer, including those |
| 685 | that were discarded or not sent. |
| 686 | |
| 687 | Discontinuities in the value of this counter can occur |
| 688 | at re-initialization of the management system, and at |
| 689 | other times as indicated by the value of |
| 690 | 'last-clear'."; |
| 691 | reference |
| 692 | "RFC 2863: The Interfaces Group MIB - |
| 693 | ifHCOutBroadcastPkts"; |
| 694 | } |
| 695 | |
| 696 | |
| 697 | leaf out-multicast-pkts { |
| 698 | type oc-yang:counter64; |
| 699 | description |
| 700 | "The total number of packets that higher-level protocols |
| 701 | requested be transmitted, and that were addressed to a |
| 702 | multicast address at this sub-layer, including those |
| 703 | that were discarded or not sent. For a MAC-layer |
| 704 | protocol, this includes both Group and Functional |
| 705 | addresses. |
| 706 | |
| 707 | Discontinuities in the value of this counter can occur |
| 708 | at re-initialization of the management system, and at |
| 709 | other times as indicated by the value of |
| 710 | 'last-clear'."; |
| 711 | reference |
| 712 | "RFC 2863: The Interfaces Group MIB - |
| 713 | ifHCOutMulticastPkts"; |
| 714 | } |
| 715 | |
| 716 | leaf out-discards { |
| 717 | type oc-yang:counter64; |
| 718 | description |
| 719 | "The number of outbound packets that were chosen to be |
| 720 | discarded even though no errors had been detected to |
| 721 | prevent their being transmitted. One possible reason |
| 722 | for discarding such a packet could be to free up buffer |
| 723 | space. |
| 724 | |
| 725 | Discontinuities in the value of this counter can occur |
| 726 | at re-initialization of the management system, and at |
| 727 | other times as indicated by the value of |
| 728 | 'last-clear'."; |
| 729 | reference |
| 730 | "RFC 2863: The Interfaces Group MIB - ifOutDiscards"; |
| 731 | } |
| 732 | |
| 733 | leaf out-errors { |
| 734 | type oc-yang:counter64; |
| 735 | description |
| 736 | "For packet-oriented interfaces, the number of outbound |
| 737 | packets that could not be transmitted because of errors. |
| 738 | For character-oriented or fixed-length interfaces, the |
| 739 | number of outbound transmission units that could not be |
| 740 | transmitted because of errors. |
| 741 | |
| 742 | Discontinuities in the value of this counter can occur |
| 743 | at re-initialization of the management system, and at |
| 744 | other times as indicated by the value of |
| 745 | 'last-clear'."; |
| 746 | reference |
| 747 | "RFC 2863: The Interfaces Group MIB - ifOutErrors"; |
| 748 | } |
| 749 | |
| 750 | leaf carrier-transitions { |
| 751 | type oc-yang:counter64; |
| 752 | description |
| 753 | "Number of times the interface state has transitioned |
| 754 | between up and down since the time the device restarted |
| 755 | or the last-clear time, whichever is most recent."; |
| 756 | } |
| 757 | |
| 758 | leaf last-clear { |
| 759 | type oc-types:timeticks64; |
| 760 | units nanoseconds; |
| 761 | description |
| 762 | "Timestamp of the last time the interface counters were |
| 763 | cleared. |
| 764 | |
| 765 | The value is the timestamp in nanoseconds relative to |
| 766 | the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; |
| 767 | } |
| 768 | } |
| 769 | } |
| 770 | |
| 771 | // data definition statements |
| 772 | |
| 773 | grouping sub-unnumbered-config { |
| 774 | description |
| 775 | "Configuration data for unnumbered subinterfaces"; |
| 776 | |
| 777 | leaf enabled { |
| 778 | type boolean; |
| 779 | default false; |
| 780 | description |
| 781 | "Indicates that the subinterface is unnumbered. By default |
| 782 | the subinterface is numbered, i.e., expected to have an |
| 783 | IP address configuration."; |
| 784 | } |
| 785 | } |
| 786 | |
| 787 | grouping sub-unnumbered-state { |
| 788 | description |
| 789 | "Operational state data unnumbered subinterfaces"; |
| 790 | } |
| 791 | |
| 792 | grouping sub-unnumbered-top { |
| 793 | description |
| 794 | "Top-level grouping unnumbered subinterfaces"; |
| 795 | |
| 796 | container unnumbered { |
| 797 | description |
| 798 | "Top-level container for setting unnumbered interfaces. |
| 799 | Includes reference the interface that provides the |
| 800 | address information"; |
| 801 | |
| 802 | container config { |
| 803 | description |
| 804 | "Configuration data for unnumbered interface"; |
| 805 | |
| 806 | uses sub-unnumbered-config; |
| 807 | } |
| 808 | |
| 809 | container state { |
| 810 | |
| 811 | config false; |
| 812 | |
| 813 | description |
| 814 | "Operational state data for unnumbered interfaces"; |
| 815 | |
| 816 | uses sub-unnumbered-config; |
| 817 | uses sub-unnumbered-state; |
| 818 | } |
| 819 | |
| 820 | uses oc-if:interface-ref; |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | grouping subinterfaces-config { |
| 825 | description |
| 826 | "Configuration data for subinterfaces"; |
| 827 | |
| 828 | leaf index { |
| 829 | type uint32; |
| 830 | default 0; |
| 831 | description |
| 832 | "The index of the subinterface, or logical interface number. |
| 833 | On systems with no support for subinterfaces, or not using |
| 834 | subinterfaces, this value should default to 0, i.e., the |
| 835 | default subinterface."; |
| 836 | } |
| 837 | |
| 838 | uses interface-common-config; |
| 839 | |
| 840 | } |
| 841 | |
| 842 | grouping subinterfaces-state { |
| 843 | description |
| 844 | "Operational state data for subinterfaces"; |
| 845 | |
| 846 | leaf name { |
| 847 | type string; |
| 848 | description |
| 849 | "The system-assigned name for the sub-interface. This MAY |
| 850 | be a combination of the base interface name and the |
| 851 | subinterface index, or some other convention used by the |
| 852 | system."; |
| 853 | } |
| 854 | |
| 855 | uses interface-common-state; |
| 856 | uses interface-counters-state; |
| 857 | } |
| 858 | |
| 859 | grouping subinterfaces-top { |
| 860 | description |
| 861 | "Subinterface data for logical interfaces associated with a |
| 862 | given interface"; |
| 863 | |
| 864 | container subinterfaces { |
| 865 | description |
| 866 | "Enclosing container for the list of subinterfaces associated |
| 867 | with a physical interface"; |
| 868 | |
| 869 | list subinterface { |
| 870 | key "index"; |
| 871 | |
| 872 | description |
| 873 | "The list of subinterfaces (logical interfaces) associated |
| 874 | with a physical interface"; |
| 875 | |
| 876 | leaf index { |
| 877 | type leafref { |
| 878 | path "../config/index"; |
| 879 | } |
| 880 | description |
| 881 | "The index number of the subinterface -- used to address |
| 882 | the logical interface"; |
| 883 | } |
| 884 | |
| 885 | container config { |
| 886 | description |
| 887 | "Configurable items at the subinterface level"; |
| 888 | |
| 889 | uses subinterfaces-config; |
| 890 | } |
| 891 | |
| 892 | container state { |
| 893 | |
| 894 | config false; |
| 895 | description |
| 896 | "Operational state data for logical interfaces"; |
| 897 | |
| 898 | uses subinterfaces-config; |
| 899 | uses subinterfaces-state; |
| 900 | } |
| 901 | } |
| 902 | } |
| 903 | } |
| 904 | |
| 905 | grouping interfaces-top { |
| 906 | description |
| 907 | "Top-level grouping for interface configuration and |
| 908 | operational state data"; |
| 909 | |
| 910 | container interfaces { |
| 911 | description |
| 912 | "Top level container for interfaces, including configuration |
| 913 | and state data."; |
| 914 | |
| 915 | |
| 916 | list interface { |
| 917 | key "name"; |
| 918 | |
| 919 | description |
| 920 | "The list of named interfaces on the device."; |
| 921 | |
| 922 | leaf name { |
| 923 | type leafref { |
| 924 | path "../config/name"; |
| 925 | } |
| 926 | description |
| 927 | "References the configured name of the interface"; |
| 928 | //TODO: need to consider whether this should actually |
| 929 | //reference the name in the state subtree, which |
| 930 | //presumably would be the system-assigned name, or the |
| 931 | //configured name. Points to the config/name now |
| 932 | //because of YANG 1.0 limitation that the list |
| 933 | //key must have the same "config" as the list, and |
| 934 | //also can't point to a non-config node. |
| 935 | } |
| 936 | |
| 937 | container config { |
| 938 | description |
| 939 | "Configurable items at the global, physical interface |
| 940 | level"; |
| 941 | |
| 942 | uses interface-phys-config; |
| 943 | } |
| 944 | |
| 945 | container state { |
| 946 | |
| 947 | config false; |
| 948 | description |
| 949 | "Operational state data at the global interface level"; |
| 950 | |
| 951 | uses interface-phys-config; |
| 952 | uses interface-common-state; |
| 953 | uses interface-counters-state; |
| 954 | } |
| 955 | |
| 956 | uses interface-phys-holdtime-top; |
| 957 | uses subinterfaces-top; |
| 958 | } |
| 959 | } |
| 960 | } |
| 961 | |
| 962 | uses interfaces-top; |
| 963 | |
| 964 | |
| 965 | } |