Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 1 | module ieee-types { |
| 2 | |
| 3 | // XXX namespace to be allocated by IANA |
| 4 | |
| 5 | namespace "urn:ietf:params:xml:ns:yang:ieee-types"; |
| 6 | prefix "ieee"; |
| 7 | |
| 8 | import ietf-yang-types { |
| 9 | prefix yang; |
| 10 | } |
| 11 | |
| 12 | organization |
| 13 | "YANG Language Design Team"; |
| 14 | |
| 15 | contact |
| 16 | "Juergen Schoenwaelder (Editor) |
| 17 | <j.schoenwaelder@jacobs-university.de>"; |
| 18 | |
| 19 | description |
| 20 | "This module contains standard derived YANG types |
| 21 | for IEEE 802 addresses and related things."; |
| 22 | |
| 23 | revision 2008-05-22 { |
| 24 | description "Initial revision."; |
| 25 | } |
| 26 | |
| 27 | /* |
| 28 | * collection of IEEE address type definitions |
| 29 | */ |
| 30 | |
| 31 | typedef mac-address { |
| 32 | type yang:phys-address { |
| 33 | pattern '([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}'; |
| 34 | } |
| 35 | description |
| 36 | "The mac-address type represents an 802 MAC address |
| 37 | represented in the `canonical' order defined by |
| 38 | IEEE 802.1a, i.e., as if it were transmitted least |
| 39 | significant bit first, even though 802.5 (in contrast |
| 40 | to other 802.x protocols) requires MAC addresses to |
| 41 | be transmitted most significant bit first."; |
| 42 | reference |
| 43 | "RFC 2579 STD 58"; |
| 44 | } |
| 45 | |
| 46 | /* |
| 47 | * collection of IEEE 802 related identifier types |
| 48 | */ |
| 49 | |
| 50 | typedef bridgeid { |
| 51 | type string { |
| 52 | pattern '[0-9a-fA-F]{4}:' |
| 53 | + '([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}'; |
| 54 | } |
| 55 | description |
| 56 | "The bridgeid type represents identifers that uniquely |
| 57 | identify a bridge. Its first four hexadecimal digits |
| 58 | contain a priority value followed by a colon. The |
| 59 | remaining characters contain the MAC address used to |
| 60 | refer to a bridge in a unique fashion (typically, the |
| 61 | numerically smallest MAC address of all ports on the |
| 62 | bridge)."; |
| 63 | reference |
| 64 | "RFC 4188"; |
| 65 | } |
| 66 | |
| 67 | typedef vlanid { |
| 68 | type uint16 { |
| 69 | range "1..4094"; |
| 70 | } |
| 71 | description |
| 72 | "The vlanid type uniquely identifies a VLAN. This is |
| 73 | the 12-bit VLAN-ID used in the VLAN Tag header. The |
| 74 | range is defined by the referenced specification."; |
| 75 | reference |
| 76 | "IEEE Std 802.1Q 2003 Edition, Virtual Bridged Local |
| 77 | Area Networks."; |
| 78 | } |
| 79 | } |