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