From d387fd92e71a42e243cedef32f0812c72474c418 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 3 Mar 2015 12:17:04 +0900 Subject: [PATCH] tools: remove yang files Instead, use https://github.com/osrg/yang Signed-off-by: FUJITA Tomonori --- tools/yang/bgp-multiprotocol.yang | 400 ------------ tools/yang/bgp-operational.yang | 112 ---- tools/yang/bgp-policy.yang | 801 ------------------------ tools/yang/bgp.yang | 607 ------------------ tools/yang/ietf-inet-types.yang | 457 -------------- tools/yang/ietf-netconf-monitoring.yang | 558 ----------------- tools/yang/ietf-yang-smiv2.yang | 144 ----- tools/yang/ietf-yang-types.yang | 474 -------------- 8 files changed, 3553 deletions(-) delete mode 100644 tools/yang/bgp-multiprotocol.yang delete mode 100644 tools/yang/bgp-operational.yang delete mode 100644 tools/yang/bgp-policy.yang delete mode 100644 tools/yang/bgp.yang delete mode 100644 tools/yang/ietf-inet-types.yang delete mode 100644 tools/yang/ietf-netconf-monitoring.yang delete mode 100644 tools/yang/ietf-yang-smiv2.yang delete mode 100644 tools/yang/ietf-yang-types.yang diff --git a/tools/yang/bgp-multiprotocol.yang b/tools/yang/bgp-multiprotocol.yang deleted file mode 100644 index 2b0a0b29..00000000 --- a/tools/yang/bgp-multiprotocol.yang +++ /dev/null @@ -1,400 +0,0 @@ - module bgp-multiprotocol { - - yang-version "1"; - - // namespace - // TODO: change to an ietf or other more generic namespace - namespace "http://google.com/yang/google-bgp-multiprotocol-cfg"; - - prefix "bgp-mp"; - - // import some basic inet types - import ietf-inet-types { prefix inet; } - import bgp-policy { prefix bgp-pol; } - import bgp-operational { prefix bgp-op; } - - // meta - organization - "Google, AT&T, BT, Microsoft"; - - contact - "Google, Inc. - 1600 Amphitheatre Way - Mountain View, CA 94043 - - AT&T Labs - 200 S. Laurel Avenue - Middletown, NJ 07748 - - BT - pp. C3L, BT Centre - 81, Newgate Street - London EC1A 7AJ - UK - - Microsoft - 205 108th Ave. NE, Suite 400 - Bellevue, WA 98004"; - - description - "This module is part of a YANG model for BGP protocol - configuration, focusing on configuration of multiprotocol - BGP, in particular various relevant address families (AFI) and - sub-address families (SAFI). - Identities (rather than enumerated types) are used to identify - each AFI / SAFI type to make it easier for users to extend to - pre-standard or custom AFI/SAFI types. This module is only - intended to capture the most"; - - revision "2014-10-13" { - description - "Initial revision"; - reference "TBD"; - } - - // extension statements - - // feature statements - - // identity statements - - identity afi-type { - description - "base identity type for BGP address family identifiers (AFI)"; - reference "RFC 4760 - Multiprotocol Extensions for BGP-4"; - } - - identity safi-type { - description - "base identity type for BGP subsequent address family - identifiers (SAFI)"; - reference "RFC 4760 - Multiprotocol Extensions for BGP-4"; - } - - identity ipv4-afi { - base bgp-mp:afi-type; - description - "IPv4 AF identifier (AFI = 1)"; - } - - identity ipv6-afi { - base bgp-mp:afi-type; - description - "IPv6 AF identifier (AFI = 2)"; - } - - identity unicast-safi { - base bgp-mp:safi-type; - description - "unicast SAFI identifier (SAFI = 1)"; - } - identity l3vpn-unicast-safi { - base safi-type; - description - "L3 / MPLS virtual private networks SAFI (SAFI = 128/129)"; - reference "RFC 4364 - BGP/MPLS IP Virtual Private Networks - (VPNs)"; - } - - identity labeled-unicast-safi { - base safi-type; - description - "labeled unicast SAFI identifier (SAFI = 4)"; - reference "RFC 3107 - Carrying Label Information in BGP-4"; - } - - identity l2vpn-vpls-afi { - base afi-type; - description - "AFI for BGP L2 VPN / VPLS (AFI = 25)"; - reference "RFC 4761 - Virtual Private LAN Service (VPLS) - Using BGP for Auto-Discovery and Signaling"; - } - - identity l2vpn-vpls-safi { - base safi-type; - description - "BGP L2 VPN / VPLS service SAFI (SAFI = 65)"; - } - - identity multicast-safi { - base safi-type; - description - "multicast SAFI (SAFI = 2)"; - reference "RFC 4760 - Multiprotocol Extensions for BGP-4"; - } - - identity multicast-vpn-safi { - base safi-type; - description - "Multicast VPN SAFI (SAFI = 5)"; - reference "RFC 6514 - BGP Encodings and Procedures for Multicast - in MPLS/BGP IP VPNs"; - } - - // typedef statements - - // TODO: move this and other commonly types to a common bgp-types - // module - typedef percentage { - type uint8 { - range "0..100"; - } - description - "Integer indicating a percentage value"; - } - - // grouping statements - - grouping address-family-common { - description - "Configuration that is for the address family level, - but applies across AFI/SAFI"; - - container prefix-limit { - description - "Configure the maximum number of prefixes that will be - accepted from a peer."; - - leaf max-prefixes { - type uint32; - description - "Maximum number of prefixes that will be accepted from - the neighbor."; - } - - leaf shutdown-threshold-pct { - type percentage; - description - "Threshold on number of prefixes that can be received - from a neighbor before generation of warning messages - or log entries. Expressed as a percentage of - max-prefixes."; - } - - leaf restart-timer { - type decimal64 { - fraction-digits 2; - } - units "seconds"; - description - "Time interval in seconds after which the BGP session - is reestablished after being torn down due to exceeding - the max-prefixes limit."; - } - } - // policies can be applied at a specific AF level - uses bgp-pol:apply-policy-group; - - } - - grouping ipv4-ipv6-unicast-common { - description - "common configuration for base ipv4 and ipv6 unicast; may - need to be split into separate containers for each of ipv4 - and ipv6"; - - container ipv4-ipv6-unicast { - // YANG uses XPath 1.0 expression syntax - when "(../../afi-name = 'ipv4-afi' or " + - "../../afi-name = 'ipv6-afi') " + - "and ../safi-name = 'unicast-safi'" { - description - "Include this container for unicast ipv4 or ipv6 - AFI-specific configuration"; - } - description "ipv4 unicast config items"; - - leaf send-default-route { - // TODO: consider moving this to policy - type boolean; - default "false"; - description "if set to true, send the default route, i.e., - 0.0.0.0/0 to the neighbor(s)"; - } - } - } - - grouping ipv4-l3vpn-unicast-group { - description - "configuration group for L3 VPN VRFs for IPv4"; - - container ipv4-l3vpn-unicast { - when "../../afi-name = 'bgp-mp:ipv4-afi' and " + - "../safi-name = 'l3vpn-unicast-safi'" { - description - "Include this container when AFI = ipv4 and - SAFI = l3vpn-unicast"; - } - description "ipv4 l3vpn config items"; - list vrfs { - key name; - description "list of configured VRFs"; - - leaf name { - type string; - description "name / identifier of the VRF"; - } - - leaf route-distinguisher { - // TODO: consider expanding to a union type to make it more - // convenient to express as AS:addr or other common formats - type uint64; - description - "route distinguisher value assigned to this VRF"; - } - - uses bgp-pol:apply-policy-group; - - /* additional leafs to consider --- should these be in BGP? - interface-name - retain-local-label-size - advertise-best-external - no-synchronization - */ - - } - } - } - - grouping ipv6-l3vpn-unicast-group { - description - "configuration group for L3 VPN VRFs for IPv6"; - - container ipv6-l3vpn-unicast { - when "../../afi-name = 'bgp-mp:ipv6-afi' and " + - "../safi-name = 'l3vpn-unicast-safi'" { - description - "Include this container only when AFI = ipv6 and - SAFI = l3vpn-unicast"; - } - description "ipv6 l3vpn config items"; - } - } - - grouping ipv4-labeled-unicast-group { - description - "configuration group for IPv4 labeled unicast"; - container ipv4-labeled-unicast { - when "../../afi-name = 'ipv4-afi' and " + - "../safi-name = 'labeled-unicast-safi'" { - description - "Include this container when AFI = ipv4 and - SAFI = labeled-unicast"; - } - description "ipv4 labeled unicast config items"; - } - } - - grouping l2vpn-group { - description - "configuration group for L2 VPN"; - - container l2vpn { - // TODO: confirm that both AFI/SAFI values are set - // for L2 VPNs - when "../../afi-name = 'l2vpn-vpls-afi' and " + - "../safi-name = 'l2vpn-vpls-safi'" { - description - "Include this container when AFI = l2vpn-vpls and - SAFI = l2vpn-vpls"; - } - description "l2vpn config items"; - } - } - - grouping ipv4-multicast-vpn-group { - description - "configuration group for IPv4 multicast VPNs"; - - container ipv4-multicast-vpn { - when "../../afi-name = 'ipv4-afi' and " + - "../safi-name = 'multicast-vpn-safi'" { - description - "Include this container when AFI = ipv4 and - SAFI = multicast-vpn"; - } - description "ipv4 multicast vpn config items"; - } - } - - grouping ipv6-multicast-vpn-group { - description - "configuration group for IPv6 multicast VPNs"; - - container ipv6-multicast-vpn { - when "../../afi-name = 'ipv6-afi' and " + - "../safi-name = 'multicast-vpn-safi'" { - description - "Include this container when AFI = ipv6 and - SAFI = multicast-vpn"; - } - description "ipv6 multicast vpn config items"; - } - } - - grouping address-family-configuration { - description "Configuration options that are applied at the - address family level."; - - list afi { - - key "afi-name"; - description - "Per address-family configuration, uniquely identified by AF - name."; - leaf afi-name { - type identityref { - base "afi-type"; - } - description - "Address family names are drawn from the afi-type base - identity, which has specific address family types as - derived identities."; - } - - list safi { - key "safi-name"; - description - "Per subsequent address family configuration, under a - specific address family."; - - leaf safi-name { - type identityref { - base "safi-type"; - } - description - "Within each address family, subsequent address family - names are drawn from the subsequent-address-family base - identity."; - } - - // these grouping references conditionally add config nodes - // that are specific to each AFI / SAFI combination - uses ipv4-ipv6-unicast-common; - uses ipv4-l3vpn-unicast-group; - uses ipv6-l3vpn-unicast-group; - uses ipv4-labeled-unicast-group; - uses l2vpn-group; - uses ipv4-multicast-vpn-group; - uses ipv6-multicast-vpn-group; - - // this grouping pulls in the config items common across - // AF/SAFI combinations - uses address-family-common; - - } - // operational state common acrossr address families - uses bgp-op:bgp-op-af-group; - } - } - - // data definition statements - - // augment statements - - // rpc statements - - // notification statements - - } \ No newline at end of file diff --git a/tools/yang/bgp-operational.yang b/tools/yang/bgp-operational.yang deleted file mode 100644 index f7e7a5e4..00000000 --- a/tools/yang/bgp-operational.yang +++ /dev/null @@ -1,112 +0,0 @@ - module bgp-operational { - - yang-version "1"; - - // namespace - // TODO: change to an ietf or other more generic namespace - namespace "http://google.com/yang/google-bgp-operational"; - - prefix "bgp-op"; - - // import some basic inet types - import ietf-inet-types { prefix inet; } - // meta - - organization - "Google, AT&T, BT, Microsoft"; - - contact - "Google, Inc. - 1600 Amphitheatre Way - Mountain View, CA 94043 - - AT&T Labs - 200 S. Laurel Avenue - Middletown, NJ 07748 - - BT - pp. C3L, BT Centre - 81, Newgate Street - London EC1A 7AJ - UK - - Microsoft - 205 108th Ave. NE, Suite 400 - Bellevue, WA 98004"; - - description - "This module is part of a YANG model for BGP protocol - configuration, focusing on operational data (i.e., state - variables) related to BGP operations"; - - revision "2014-10-13" { - description - "Initial revision"; - reference "TBD"; - } - - // extension statements - - // feature statements - - // identity statements - - // typedef statements - - // grouping statements - - grouping bgp-op-global-group { - description - "top level container for operational state data"; - - container bgp-global-state { - config false; - description - "data definitions for operational state variables related - to the global BGP instance"; - } - } - - grouping bgp-op-af-group { - description - "top level container for operational state data"; - - container bgp-af-common-state { - config false; - description - "data definitions for operational state variables related - to all BGP address families instance"; - } - } - - grouping bgp-op-peergroup-group { - description - "top level container for operational state data"; - - container bgp-group-common-state { - config false; - description - "data definitions for operational state variables related - to BGP peer groups"; - } - } - - grouping bgp-op-neighbor-group { - description - "top level container for operational state data"; - - container bgp-neighbor-common-state { - config false; - description - "data definitions for operational state variables related - to BGP neighbor sesions"; - } - } - - // data definition statements - // augment statements - - // rpc statements - - // notification statements - } \ No newline at end of file diff --git a/tools/yang/bgp-policy.yang b/tools/yang/bgp-policy.yang deleted file mode 100644 index 8ed3d411..00000000 --- a/tools/yang/bgp-policy.yang +++ /dev/null @@ -1,801 +0,0 @@ - module bgp-policy { - - yang-version "1"; - - // namespace - // TODO: change to an ietf or other generic namespace - namespace "http://google.com/yang/google-bgp-policy-cfg"; - - prefix "bgp-policy"; - - // import some basic types - import ietf-inet-types { prefix inet; } - - // meta - // TODO: add collaborating organizations - organization - "Google, AT&T, BT, Microsoft"; - - contact - "Google, Inc. - 1600 Amphitheatre Way - Mountain View, CA 94043 - - AT&T Labs - 200 S. Laurel Avenue - Middletown, NJ 07748 - - BT - pp. C3L, BT Centre - 81, Newgate Street - London EC1A 7AJ - UK - - Microsoft - 205 108th Ave. NE, Suite 400 - Bellevue, WA 98004"; - - description - "This module describes a YANG model for BGP policy - configuration. It is a limited subset of all of the policy - configuration parameters available in the variety of vendor - implementations, but supports widely used constructs for managing - how BGP routes are imported, exported, and modified. This module - works with the base BGP protocol configuration model defined in - google-bgp. - - Route policy expression: - - Policies are expressed as a set of top-level policy definitions, - each of which consists of a sequence of policy statements. - Policy statements are simple condition-action tuples. Conditions - may include mutiple match or comparison operations, and similarly - actions may be multitude of changes to route attributes and a - final disposition of accepting or> rejecting the route. - - BGP - | - +->policy - +-> policy definitions - +-> policy statements - +-> conditions - +-> [ match conditions / comparison conditions ] - +-> actions - +-> [ set attribute actions / control-flow actions ] - - Route policy evaluation: - - Evaluation of a policy definition is expected to proceed by - evaluating the individual policy statements in the specified - order. When a condition statement in a policy statement is - satisfied, the corresponding action statement is executed. - If the action statement has either accept-route or reject-route - actions, policy evaluation stops. If the condition is not - satisfied, or if the action statement contains goto-next, then - evaluation proceeds to the next policy statement. If none of the - policy statement conditions are satisfied, then the default - action is applied. - - Policy 'subroutines' are supported by allowing condition - statements to reference another policy definition which first - applies conditions from the referenced policy before - proceeding."; - - revision "2014-09-30" { - description - "Initial revision"; - reference "TBD"; - } - - // extension statements - // feature statements - - // identity statements - - identity bgp-attribute-comparison { - description - "base type for supported comparison operators on route - attributes"; - } - - identity attribute-eq { - base bgp-attribute-comparison; - description "== comparison"; - } - - identity attribute-ge { - base bgp-attribute-comparison; - description ">= comparison"; - } - - identity attribute-le { - base bgp-attribute-comparison; - description "<= comparison"; - } - - // typedef statements - - typedef match-set-options-type { - type enumeration { - enum ANY { - description "match is true if given value matches any member - of the defined set"; - } - enum ALL { - description "match is true if each given value matches a - member of the defined set"; - } - enum INVERT { - description "match is true if given value does not match any - member of the defined set"; - } - } - default ANY; - description - "Options that govern the behavior of a match statement. The - default behavior is ANY, i.e., the given value matches any - of the members of the defined set"; - } - - typedef as-path-prepend-option-repeat { - type uint32; - description - "Option for the as-prepend policy action. Prepends the local - AS number repeated n times"; - } - - typedef well-known-community-attr { - type enumeration { - enum INTERNET { - description "entire Internet community (0x00000000)"; - } - enum NO_EXPORT { - // value 0xFFFFFF01; - description "no export"; - } - enum NO_ADVERTISE { - description "no advertise (0xFFFFFF02)"; - } - enum NO_EXPORT_SUBCONFED { - description "no export subconfed, equivalent to - local AS (0xFFFFFF03)"; - } - } - description - "Type definition for well-known IETF community attribute - values"; - reference "RFC 1997 - BGP Communities Attribute"; - } - - typedef std-community-attr-type { - // TODO: further refine restrictions and allowed patterns - // 4-octet value: - // 2 octets - // 2 octets - type union { - type uint32 { - // per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 - - // 0xFFFFFFFF are reserved - range "65536..4294901759"; // 0x00010000..0xFFFEFFFF - } - type string { - pattern '([0-9]+:[0-9]+)'; - } - } - description - "Type definition for standard commmunity attributes"; - reference "RFC 1997 - BGP Communities Attribute"; - } - - typedef ext-community-attr-type { - // TODO: needs more work to make this more precise given the - // variability of extended community attribute specifications - // 8-octet value: - // 2 octects - // 6 octets - type string { - pattern '([0-9\.]+(:[0-9]+)?:[0-9]+)'; - } - description - "Type definition for extended community attributes"; - reference "RFC 4360 - BGP Extended Communities Attribute"; - } - - typedef community-regexp-type { - // TODO: needs more work to decide what format these regexps can - // take. - type string; - description - "Type definition for communities specified as regular - expression patterns"; - } - - typedef bgp-origin-attr-type { - type enumeration { - enum IGP { - value 0; - description "Origin of the NLRI is internal"; - } - enum EGP { - value 1; - description "Origin of the NLRI is EGP"; - } - enum INCOMPLETE { - value 2; - description "Origin of the NLRI is neither IGP or EGP"; - } - } - description - "Type definition for standard BGP origin attribute"; - reference "RFC 4271 - A Border Gateway Protocol 4 (BGP-4), - Sec 4.3"; - } - typedef set-community-option-type { - type enumeration { - enum ADD { - description "add the specified communities to the existing - community attribute"; - } - enum REMOVE { - description "remove the specified communities from the - existing community attribute"; - } - enum REPLACE { - description "replace the existing community attribute with - the specified communities"; - } - enum NULL { - description "set the community attribute to empty / NULL"; - } - } - description - "Type definition for options when setting the community - attribute in a policy action"; - } - - typedef bgp-next-hop-type { - type union { - type inet:ip-address; - type enumeration { - enum SELF { - description "special designation for local router's own - address"; - } - } - } - description "type definition for specifying next-hop in policy - actions"; - } - - // grouping statements - - grouping defined-sets-definitions { - description - "Data definitions for pre-defined sets of attributes used in - policy match conditions"; - - list prefix-set { - key prefix-set-name; - description - "Definitions for prefix sets"; - - leaf prefix-set-name { - type string; - description - "name / label of the prefix set -- this is used to - reference the set in match conditions"; - } - - list prefix { - key "address masklength masklength-range"; - description - "list of prefix expressions that are part of the set"; - - leaf address { - type inet:ip-address; - mandatory true; - description - "address portion of the prefix"; - } - - leaf masklength { - type uint8 { - // simple range covers both ipv4 and ipv6 -- - // could separate this into different types - // for IPv4 and IPv6 prefixes - range 1..128; - } - mandatory true; - description - "masklength for the prefix specification"; - } - - leaf masklength-range { - type string { - // pattern modeled after ietf-inet-types - pattern '(([0-9])|([1-9][0-9])|(1[0-1][0-9])|' - + '(12[0-8]))\.\.' - + '(([0-9])|([1-9][0-9])|(1[0-1][0-9])|' - + '(12[0-8]))'; - } - description - "Defines an optional range for the masklength. Absence - of the masklength-length implies that the prefix has an - exact masklength given by the masklength parameter. - Example: 10.3.192.0/21 through 10.3.192.0/24 would be - expressed as address: 10.3.192.0, masklength: 21, - masklength-range: 21..24"; - } - } - } - - list community-set { - key community-set-name; - description - "Definitions for community sets"; - - leaf community-set-name { - type string; - mandatory true; - description - "name / label of the community set -- this is used to - reference the set in match conditions"; - } - - leaf-list community-members { - type union { - type std-community-attr-type; - type community-regexp-type; - type well-known-community-attr; - } - description - "members of the community set"; - } - - } - - list ext-community-set { - key ext-community-set-name; - description - "Definitions for extended community sets"; - - leaf ext-community-set-name { - type string; - description - "name / label of the extended community set -- this is used - to reference the set in match conditions"; - } - - leaf-list ext-community-members { - type union { - type ext-community-attr-type; - // TODO: is regexp support needed for extended communities? - // TODO: is well-known needed for extended communities? - type community-regexp-type; - } - description - "members of the extended community set"; - } - } - - list as-path-set { - key as-path-set-name; - description - "Definitions for AS path sets"; - - leaf as-path-set-name { - type string; - description - "name of the AS path set -- this is used to reference the - the set in match conditions"; - } - - leaf-list as-path-set-members { - // TODO: need to refine typedef for AS path expressions - type string; - description - "AS path expression -- list of ASes in the set"; - } - - } - } - - grouping condition-set-matches { - description - "Condition statement definitions for checking membership in a - defined set"; - - leaf match-community-set { - type leafref { - path "/bgp/policy/defined-sets/community-set/community-set-name"; - require-instance true; - } - description - "References a defined community set"; - } - - leaf match-ext-community-set { - type leafref { - path "/bgp/policy/defined-sets/ext-community-set" - + "/ext-community-set-name"; - } - description "References a defined extended community set"; - } - leaf match-as-path-set { - type leafref { - path "/bgp/policy/defined-sets/as-path-set/as-path-set-name"; - } - description "References a defined AS path set"; - } - - leaf match-prefix-set { - type leafref { - path "/bgp/policy/defined-sets/prefix-set/prefix-set-name"; - } - description "References a defined prefix set"; - } - - leaf match-set-options { - type match-set-options-type; - description - "Optional parameter that governs the behavior of the match - operation"; - } - } - - grouping condition-attribute-compare-operators { - description "common definitions for comparison operations in - condition statements"; - - leaf operator { - type identityref { - base bgp-attribute-comparison; - } - description - "type of comparison to be performed"; - } - - leaf value { - type uint32; - description - "value to compare with the community count"; - } - } - - grouping condition-attribute-comparisons { - description - "Condition statement definitions for comparing a route - attribute to a specified value"; - - leaf med-eq { - type uint32; - description - "Condition to check if the received MED value is equal to - the specified value"; - } - - leaf origin-eq { - type bgp-origin-attr-type; - description - "Condition to check if the route origin is equal to the - specified value"; - } - - leaf-list next-hop-in { - type inet:ip-address; - description - "List of next hop addresses to check for in the route - update"; - } - - leaf local-pref-eq { - type uint32; - // TODO: add support for other comparisons - description - "Condition to check if the local pref attribute is equal to - the specified value"; - } - - container community-count { - - presence "node is present in the config data to indicate a - community-count condition"; - - description - "Value and comparison operations for conditions based on the - number of communities in the route update"; - - uses condition-attribute-compare-operators; - - } - - container as-path-length { - - presence "node is present in the config data to indicate a - as-path-length condition"; - - description - "Value and comparison operations for conditions based on the - length of the AS path in the route update"; - uses condition-attribute-compare-operators; - } - - leaf route-type { - // TODO: verify extent of vendor support for this comparison - type enumeration { - enum INTERNAL { - description "route type is internal"; - } - enum EXTERNAL { - description "route type is external"; - } - } - description - "Condition to check the route type in the route update"; - } - } - - grouping set-attribute-actions { - description - "Definitions for base set of policy action statements that - change various attributes of the route"; - - container set-as-path-prepend { - - presence "node is present in the config data to use the AS - prepend action"; - description - "action to prepend local AS number to the AS-path a - specified number of times"; - - leaf repeat-n { - type uint8; - description "number of times to prepend the local AS number"; - } - } - - container set-community { - - presence "node is present in the config data when set-community - action is used"; - description - "action to set the community attributes of the route, along - with options to modify how the community is modified"; - - leaf-list communities { - type union { - type std-community-attr-type; - type well-known-community-attr; - } - description - "community values for the update"; - } - - leaf options { - type set-community-option-type; - description - "options for modifying the community attribute with the - specified values"; - } - } - - container set-ext-community { - - presence "node is present in the config data when set-community - action is used"; - description - "action to set the extended community attributes of the - route, along with options to modify how the community is - modified"; - - leaf-list communities { - type union { - type ext-community-attr-type; - type well-known-community-attr; - } - description - "community values for the update"; - } - - leaf options { - type set-community-option-type; - description - "options for modifying the community attribute with the - specified values"; - } - } - - leaf set-route-origin { - type bgp-origin-attr-type; - description "set the origin attribute to the specified value"; - } - - leaf set-local-pref { - type uint32; - description "set the local pref attribute on the route update"; - } - - leaf set-next-hop { - type bgp-next-hop-type; - description "set the next-hop attribute in the route update"; - } - - leaf set-med { - type uint32; - description "set the med metric attribute in the route update"; - } - } - - grouping control-flow-actions { - description - "Definitions for base set of policy action statements that - manage the disposition or control flow of the policy"; - - leaf accept-route { - type empty; - description "accepts the route into the routing table"; - } - - leaf reject-route { - type empty; - description "rejects the route"; - } - - leaf goto-next { - type empty; - description - "proceed to evaluate the next policy statement in the - policy definition"; - } - - leaf goto-policy { - type string; - description - "proceed to the named policy definition and continue - evaluating the policy"; - } - - } - - grouping conditions { - description - "Condition statement definitions for policy statements"; - leaf call-policy { - type string; - description - "Applies the conditions from the specified policy definition - in the current policy statement."; - } - - uses condition-set-matches; - uses condition-attribute-comparisons; - - } - - grouping actions { - description - "Action statement definitions for policy statements"; - - uses set-attribute-actions; - uses control-flow-actions; - - } - - grouping apply-policy-group { - description - "top level configuration for applying policies at various - points in the configuration hierarchy"; - - container apply-policy { - description - "Anchor point for policies in the BGP configuration. Import - and export policies are with respect to the local routing - table, i.e., export (send) and import (receive)."; - - leaf-list import-policies { - type leafref { - path "/bgp/policy/policy-definitions/policy-definition" - + "/name"; - require-instance true; - } - description - "list of policy names in sequence to be applied on - receiving a routing update in the current context, e.g., - for the current peer group, neighbor, address family, - etc."; - } - - leaf-list export-policies { - type leafref { - path "/bgp/policy/policy-definitions/policy-definition" - + "/name"; - require-instance true; - } - description - "list of policy names in sequence to be applied on - sending a routing update in the current context, e.g., - for the current peer group, neighbor, address family, - etc."; - } - } - } - - grouping policy-definition-group { - description - "top level set of policy defined sets and policy definitions"; - - container policy { - description - "Top level container for BGP policy-related configuration - items"; - - container defined-sets { - presence "Container for sets defined for matching in policy - statements"; - description - "Predefined sets of attributes used in policy match - statements"; - - uses defined-sets-definitions; - } - - container policy-definitions { - presence "Container for the set of policy definitions"; - description - "Top level container for policy definitions"; - - list policy-definition { - key name; - ordered-by user; - description - "List of top-level policy definitions, keyed by a unique - name"; - - leaf name { - type string; - description - "Name of the top-level policy definition -- this name - is used in references to the current policy"; - } - - list statements { - key name; - // TODO: names of policy statements withing a policy defn - // should be optional, however, YANG requires a unique id - // for lists; not sure that a compound key works either; - // need to investigate further. - ordered-by user; - description - "Name of this policy statement"; - - leaf name { - type string; - description "name of the policy statement"; - } - - container conditions { - description "Condition statements for this - policy statement"; - - uses conditions; - } - - container actions { - description "Action statements for this policy - statement"; - - uses actions; - } - } - } - } - } - } - - // augment statements - - // rpc statements - - // notification statements - - } \ No newline at end of file diff --git a/tools/yang/bgp.yang b/tools/yang/bgp.yang deleted file mode 100644 index c6257b5e..00000000 --- a/tools/yang/bgp.yang +++ /dev/null @@ -1,607 +0,0 @@ - module bgp { - - yang-version "1"; - - // namespace - // TODO: change to an ietf or other more generic namespace - namespace "http://google.com/yang/google-bgp-protocol-cfg"; - - prefix "bgp"; - - // import some basic inet types - import ietf-inet-types { prefix inet; } - import bgp-multiprotocol { prefix bgp-mp; } - import bgp-policy { prefix bgp-pol; } - import bgp-operational { prefix bgp-op; } - - // meta - organization - "Google, AT&T, BT, Microsoft"; - - contact - "Google, Inc. - 1600 Amphitheatre Way - Mountain View, CA 94043 - - AT&T Labs - 200 S. Laurel Avenue - Middletown, NJ 07748 - - BT - pp. C3L, BT Centre - 81, Newgate Street - London EC1A 7AJ - UK - - Microsoft - 205 108th Ave. NE, Suite 400 - Bellevue, WA 98004"; - - description - "This module describes a YANG model for BGP protocol - configuration.It is a limited subset of all of the configuration - parameters available in the variety of vendor implementations, - hence it is expected that it would be augmented with vendor- - specific configuration data as needed.Additional modules or - submodules to handle other aspects of BGP configuration, - including policy, VRFs, VPNs, and additional address families - are also expected. - - This model supports the following BGP configuration level - hierarchy: - - BGP - | - +-> [ global BGP configuration ] - +-> AFI / SAFI (address family) - +-> [AFI-specific config ] - +-> peer group - +-> [ peer group config ] - +-> AFI / SAFI [ per-AFI overrides ] - +-> neighbor - +-> [ per-neighbor overrides ] - +-> AFI / SAFI [ per-AFI overrides ] - +-> neighbor - +-> [ neighbor config ] - +-> AFI / SAFI [ per-AFI overrides ]"; - - revision "2014-09-30" { - description - "Initial revision"; - reference "TBD"; - } - - typedef peer-type { - type enumeration { - enum INTERNAL { - description "internal (iBGP) peer"; - } - enum EXTERNAL { - description "external (eBGP) peer"; - } - } - description - "labels a peer or peer group as explicitly internal or - external"; - } - - typedef remove-private-as-option { - type enumeration { - enum ALL { - description "remove all private ASes in the path"; - } - enum REPLACE { - description "replace private ASes with local AS"; - } - } - description - "set of options for configuring how private AS path numbers - are removed from advertisements"; - } - - typedef percentage { - type uint8 { - range "0..100"; - } - description - "Integer indicating a percentage value"; - } - - typedef rr-cluster-id-type { - type union { - type uint32; - type inet:ipv4-address; - } - description - "union type for route reflector cluster ids: - option 1: 4-byte number - option 2: IP address"; - } - - grouping bgp-common-configuration { - description "Common configuration available at all hierarchy - levels, global, AFI, groups, neighbors, etc."; - - leaf description { - type string; - description - "An optional textual description (intended primarily for use - with a peer or group"; - } - - container route-selection-options { - // TODO: consider moving this container to AFI/SAFI level - // config - description - "Set of configuration options that govern best - path selection."; - leaf always-compare-med { - type boolean; - default "false"; - description - "Compare multi-exit discriminator (MED) value from - different ASes when selecting the best route. The - default behavior is to only compare MEDs for paths - received from the same AS."; - } - - leaf ignore-as-path-length { - type boolean; - default "false"; - description - "Ignore the AS path length when selecting the best path. - The default is to use the AS path length and prefer paths - with shorter length."; - } - - leaf external-compare-router-id { - type boolean; - default "true"; - description - "When comparing similar routes received from external - BGP peers, use the router-id as a criterion to select - the active path."; - } - - leaf advertise-inactive-routes { - type boolean; - default "false"; - description - "Advertise inactive routes to external peers. The - default is to only advertise active routes."; - } - - leaf enable-aigp { - type empty; - description - "Flag to enable sending / receiving accumulated IGP - attribute in routing updates"; - } - } - - container use-multiple-paths { - - presence - "Presence of this container indicates that multipath - is enabled for both eBGP and iBGP, absence indicates - that multi-path is not used"; - - description - "Configuration of BGP multi-path for iBGP and eBGP"; - - container ebgp { - description - "Configuration of BGP multipath to enable load sharing - across multiple paths to eBGP peers"; - - leaf allow-multiple-as { - type boolean; - default "false"; - description - "Allow multipath to use paths from different neighbouring - ASes. The default is to only consider multiple paths from - the same neighbouring AS."; - } - - leaf maximum-paths { - type uint32; - default 1; - description - "Maximum number of parallel paths to consider when using - BGP multipath. The default is use a single path."; - } - } - - container ibgp { - description - "Configuration of BGP multipath to enable load-sharing - across multiple paths to iBGP peers"; - - leaf maximum-paths { - type uint32; - default 1; - description - "Maximum number of parallel paths to consider when using - iBGP multipath. The default is to use a single path"; - } - } - - container eibgp { - description - "Configuration of BGP multipath to enable load-sharing - across multiple paths to external confederation sub-ASes"; - leaf maximum-paths { - type uint32; - default 1; - description - "Maximum number of parallel paths to consider when using - eiBGP multipath. The default is to use a single path"; - } - - } - } - - container graceful-restart { - // TODO: most impls seem to require this at the global level - // in order to specify at neighbor or other levels - presence "Presence of this item indicates that BGP graceful - restart is enabled."; - - description - "Configures BGP graceful restart, which is a negotiated - option that indicates that a BGP speaker is able to retain - forwarding state when a BGP session restarts"; - - reference "RFC 4724: Graceful Restart Mechanism for BGP"; - - leaf restart-time { - type uint16 { - range 0..4096; - } - description - "Estimated time in seconds for the BGP session to be - re-established after a restart. This is a 12-bit value - advertised by the router to peers. Per RFC 4724, the - suggested default value is <= the hold-time value"; - } - - leaf stale-routes-time { - type decimal64 { - fraction-digits 2; - } - description - "Sets an upper bound on the time in seconds that stale - routes will be retained by the router after a session is - restarted"; - } - } - - uses bgp-pol:apply-policy-group; - } - - grouping bgp-global-configuration { - description - "Grouping for global level configuration items"; - - leaf as { - type inet:as-number; - mandatory "true"; - description - "Local autonomous system number of the router. Uses - the 32-bit as-number type from the model in RFC 6991"; - } - leaf router-id { - type inet:ipv4-address; - description - "Router id of the router, expressed as an - 32-bit value, IPv4 address."; - } - - container default-route-distance { - description - "Administrative distance (or preference) assigned to - routes received from different sources - (external, internal, and local)."; - leaf external-route-distance { - type uint8 { - range "1..255"; - } - description - "Administrative distance for routes learned from external - BGP (eBGP)."; - } - leaf internal-route-distance { - type uint8 { - range "1..255"; - } - description - "Administrative distance for routes learned from internal - BGP (iBGP)."; - } - } - - container confederation { - - presence "Presence of this node indicates that the local AS - is part of a confederation"; - description - "Configuration for a BGP confederation consisting of a - confed id and member sub-AS list"; - - leaf identifier { - type inet:as-number; - description - "Confederation identifier for the autonomous system"; - } - - leaf-list member-as { - type inet:as-number; - description - "Remote autonomous systems that are to be treated - as part of the local confederation."; - } - } - - } - - grouping bgp-group-common-configuration { - description "Configuration items that are applied at the peer - group level"; - - // currently a placeholder in case we identify config that is - // really only applicable at the group level - } - - grouping bgp-group-neighbor-common-configuration { - description "Configuration items that are applied at the peer - or peer group levels"; - - leaf auth-password { - type string; - description - "Configures an MD5 authentication password for use with - neighboring devices."; - } - - leaf peer-type { - type peer-type; - description - "Explicitly designate the peer or peer group as internal - (iBGP) or external (eBGP)."; - } - - container timers { - description "Configuration of various BGP timers"; - leaf connect-retry { - type decimal64 { - fraction-digits 2; - } - default 30; - description - "Time interval in seconds between attempts to establish a - session with the peer."; - } - - leaf hold-time { - type decimal64 { - fraction-digits 2; - } - default 90; - description - "Time interval in seconds that a BGP session will be - considered active in the absence of keepalive or other - messages from the peer. The hold-time is typically - set to 3x the keepalive-interval."; - reference - "RFC 4271 - A Border Gateway Protocol 4, Sec. 10"; - } - - leaf keepalive-interval { - type decimal64 { - fraction-digits 2; - } - default 30; - description - "Time interval in seconds between transmission of keepalive - messages to the neighbor. Typically set to 1/3 the - hold-time."; - } - - leaf minimum-advertisement-interval { - type decimal64 { - fraction-digits 2; - } - default 30; - description - "Mininum time interval in seconds between transmission - of BGP updates to neighbors"; - reference - "RFC 4271 - A Border Gateway Protocol 4, Sec 10"; - } - - leaf send-update-delay { - type decimal64 { - fraction-digits 2; - } - description - "Time interval between routes changing in the routing - table and corresponding updates sent to neighbors -- - serves to batch updates"; - } - - } - - container ebgp-multihop { - description - "Configure multihop BGP for peers that are not directly - connected"; - - leaf multihop-ttl { - type uint8; - default 1; - description - "Time-to-live for multihop BGP sessions. The default - value of 1 is for directly connected peers (i.e., - multihop disabled"; - - } - - } - - container route-reflector { - description - "Configure the local router as a route-reflector - server"; - - leaf route-reflector-cluster-id { - type rr-cluster-id-type; - description - "route-reflector cluster id to use when local router is - configured as a route reflector. Commonly set at the group - level, but allows a different cluster - id to be set for each neighbor."; - } - - leaf route-reflector-client { - type boolean; - default "false"; - description - "Configure the neighbor as a route reflector client."; - } - } - - leaf remove-private-as { - // could also make this a container with a flag to enable - // remove-private and separate option. here, option implies - // remove-private is enabled. - type remove-private-as-option; - description - "Remove private AS numbers from updates sent to peers."; - } - - container bgp-logging-options { - description - "Configure various tracing/logging options for BGP peers - or groups. Expected that additional vendor-specific log - options would augment this container."; - - leaf log-neighbor-state-changes { - type boolean; - default "true"; - description - "Configure logging of peer state changes. Default is - to enable logging of peer state changes."; - } - } - - container transport-options { - description - "Transport protocol options for BGP sessions"; - - leaf tcp-mss { - type uint16; - description - "Sets the max segment size for BGP TCP sessions."; - } - - leaf mtu-discovery { - type boolean; - description - "Turns path mtu discovery for BGP TCP sessions on (true) - or off (false)"; - } - - leaf passive-mode { - type boolean; - description - "Wait for peers to issue requests to open a BGP session, - rather than initiating sessions from the local router."; - } - } - - leaf local-address { - type inet:ip-address; - description - "Set the local IP (either IPv4 or IPv6) address to use for - the session when sending BGP update messages."; - } - - leaf route-flap-damping { - type boolean; - description - "Enable route flap damping."; - } - } - - grouping bgp-neighbor-configuration { - description - "Neighbor-level configuration items"; - - list neighbor { - key "neighbor-address"; - description - "List of BGP peers, uniquely identified by neighbor - address."; - leaf neighbor-address { - type inet:ip-address; - description - "Address of the BGP peer, either IPv4 or IPv6."; - } - - leaf peer-as { - type inet:as-number; - mandatory "true"; - description - "AS number of the peer."; - - } - uses bgp-common-configuration; - uses bgp-mp:address-family-configuration; - uses bgp-group-neighbor-common-configuration; - uses bgp-op:bgp-op-neighbor-group; - } - } - - container bgp { - description "Top-level configuration data for the BGP router"; - - container global { - description - "Top-level bgp protocol options applied at the global level - in the hierarchy -- these apply across peer-groups, - neighbors, and address families"; - - uses bgp-global-configuration; - - // attach global level operational data - uses bgp-op:bgp-op-global-group; - } - - // top level AF configuration - uses bgp-mp:address-family-configuration; - - list peer-group { - key "group-name"; - description - "List of peer-groups, uniquely identified by the peer group - name."; - leaf group-name { - type string; - description "Name of the peer group."; - } - uses bgp-op:bgp-op-peergroup-group; - uses bgp-common-configuration; - uses bgp-mp:address-family-configuration; - uses bgp-group-neighbor-common-configuration; - - // list of configurations for neighbors in this peer group - uses bgp-neighbor-configuration; - } - - // top level neighbor configuration - uses bgp-neighbor-configuration; - - // hook for top-level policy definitions - uses bgp-pol:policy-definition-group; - } - } \ No newline at end of file diff --git a/tools/yang/ietf-inet-types.yang b/tools/yang/ietf-inet-types.yang deleted file mode 100644 index 5c6f139a..00000000 --- a/tools/yang/ietf-inet-types.yang +++ /dev/null @@ -1,457 +0,0 @@ -module ietf-inet-types { - - namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; - prefix "inet"; - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: David Kessens - - - WG Chair: Juergen Schoenwaelder - - - Editor: Juergen Schoenwaelder - "; - - description - "This module contains a collection of generally useful derived - YANG data types for Internet addresses and related things. - - Copyright (c) 2013 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD License - set forth in Section 4.c of the IETF Trust's Legal Provisions - Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 6991; see - the RFC itself for full legal notices."; - - revision 2013-07-15 { - description - "This revision adds the following new data types: - - ip-address-no-zone - - ipv4-address-no-zone - - ipv6-address-no-zone"; - reference - "RFC 6991: Common YANG Data Types"; - } - - revision 2010-09-24 { - description - "Initial revision."; - reference - "RFC 6021: Common YANG Data Types"; - } - - /*** collection of types related to protocol fields ***/ - - typedef ip-version { - type enumeration { - enum unknown { - value "0"; - description - "An unknown or unspecified version of the Internet - protocol."; - } - enum ipv4 { - value "1"; - description - "The IPv4 protocol as defined in RFC 791."; - } - enum ipv6 { - value "2"; - description - "The IPv6 protocol as defined in RFC 2460."; - } - } - description - "This value represents the version of the IP protocol. - - In the value set and its semantics, this type is equivalent - to the InetVersion textual convention of the SMIv2."; - reference - "RFC 791: Internet Protocol - RFC 2460: Internet Protocol, Version 6 (IPv6) Specification - RFC 4001: Textual Conventions for Internet Network Addresses"; - } - - typedef dscp { - type uint8 { - range "0..63"; - } - description - "The dscp type represents a Differentiated Services Code Point - that may be used for marking packets in a traffic stream. - In the value set and its semantics, this type is equivalent - to the Dscp textual convention of the SMIv2."; - reference - "RFC 3289: Management Information Base for the Differentiated - Services Architecture - RFC 2474: Definition of the Differentiated Services Field - (DS Field) in the IPv4 and IPv6 Headers - RFC 2780: IANA Allocation Guidelines For Values In - the Internet Protocol and Related Headers"; - } - - typedef ipv6-flow-label { - type uint32 { - range "0..1048575"; - } - description - "The ipv6-flow-label type represents the flow identifier or Flow - Label in an IPv6 packet header that may be used to - discriminate traffic flows. - - In the value set and its semantics, this type is equivalent - to the IPv6FlowLabel textual convention of the SMIv2."; - reference - "RFC 3595: Textual Conventions for IPv6 Flow Label - RFC 2460: Internet Protocol, Version 6 (IPv6) Specification"; - } - - typedef port-number { - type uint16 { - range "0..65535"; - } - description - "The port-number type represents a 16-bit port number of an - Internet transport-layer protocol such as UDP, TCP, DCCP, or - SCTP. Port numbers are assigned by IANA. A current list of - all assignments is available from . - - Note that the port number value zero is reserved by IANA. In - situations where the value zero does not make sense, it can - be excluded by subtyping the port-number type. - In the value set and its semantics, this type is equivalent - to the InetPortNumber textual convention of the SMIv2."; - reference - "RFC 768: User Datagram Protocol - RFC 793: Transmission Control Protocol - RFC 4960: Stream Control Transmission Protocol - RFC 4340: Datagram Congestion Control Protocol (DCCP) - RFC 4001: Textual Conventions for Internet Network Addresses"; - } - - /*** collection of types related to autonomous systems ***/ - - typedef as-number { - type uint32; - description - "The as-number type represents autonomous system numbers - which identify an Autonomous System (AS). An AS is a set - of routers under a single technical administration, using - an interior gateway protocol and common metrics to route - packets within the AS, and using an exterior gateway - protocol to route packets to other ASes. IANA maintains - the AS number space and has delegated large parts to the - regional registries. - - Autonomous system numbers were originally limited to 16 - bits. BGP extensions have enlarged the autonomous system - number space to 32 bits. This type therefore uses an uint32 - base type without a range restriction in order to support - a larger autonomous system number space. - - In the value set and its semantics, this type is equivalent - to the InetAutonomousSystemNumber textual convention of - the SMIv2."; - reference - "RFC 1930: Guidelines for creation, selection, and registration - of an Autonomous System (AS) - RFC 4271: A Border Gateway Protocol 4 (BGP-4) - RFC 4001: Textual Conventions for Internet Network Addresses - RFC 6793: BGP Support for Four-Octet Autonomous System (AS) - Number Space"; - } - - /*** collection of types related to IP addresses and hostnames ***/ - - typedef ip-address { - type union { - type inet:ipv4-address; - type inet:ipv6-address; - } - description - "The ip-address type represents an IP address and is IP - version neutral. The format of the textual representation - implies the IP version. This type supports scoped addresses - by allowing zone identifiers in the address format."; - reference - "RFC 4007: IPv6 Scoped Address Architecture"; - } - - typedef ipv4-address { - type string { - pattern - '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' - + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' - + '(%[\p{N}\p{L}]+)?'; - } - description - "The ipv4-address type represents an IPv4 address in - dotted-quad notation. The IPv4 address may include a zone - index, separated by a % sign. - - The zone index is used to disambiguate identical address - values. For link-local addresses, the zone index will - typically be the interface index number or the name of an - interface. If the zone index is not present, the default - zone of the device will be used. - - The canonical format for the zone index is the numerical - format"; - } - - typedef ipv6-address { - type string { - pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' - + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' - + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}' - + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))' - + '(%[\p{N}\p{L}]+)?'; - pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' - + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' - + '(%.+)?'; - } - description - "The ipv6-address type represents an IPv6 address in full, - mixed, shortened, and shortened-mixed notation. The IPv6 - address may include a zone index, separated by a % sign. - - The zone index is used to disambiguate identical address - values. For link-local addresses, the zone index will - typically be the interface index number or the name of an - interface. If the zone index is not present, the default - zone of the device will be used. - - The canonical format of IPv6 addresses uses the textual - representation defined in Section 4 of RFC 5952. The - canonical format for the zone index is the numerical - format as described in Section 11.2 of RFC 4007."; - reference - "RFC 4291: IP Version 6 Addressing Architecture - RFC 4007: IPv6 Scoped Address Architecture - RFC 5952: A Recommendation for IPv6 Address Text - Representation"; - } - - typedef ip-address-no-zone { - type union { - type inet:ipv4-address-no-zone; - type inet:ipv6-address-no-zone; - } - description - "The ip-address-no-zone type represents an IP address and is - IP version neutral. The format of the textual representation - implies the IP version. This type does not support scoped - addresses since it does not allow zone identifiers in the - address format."; - reference - "RFC 4007: IPv6 Scoped Address Architecture"; - } - - typedef ipv4-address-no-zone { - type inet:ipv4-address { - pattern '[0-9\.]*'; - } - description - "An IPv4 address without a zone index. This type, derived from - ipv4-address, may be used in situations where the zone is - known from the context and hence no zone index is needed."; - } - - typedef ipv6-address-no-zone { - type inet:ipv6-address { - pattern '[0-9a-fA-F:\.]*'; - } - description - "An IPv6 address without a zone index. This type, derived from - ipv6-address, may be used in situations where the zone is - known from the context and hence no zone index is needed."; - reference - "RFC 4291: IP Version 6 Addressing Architecture - RFC 4007: IPv6 Scoped Address Architecture - RFC 5952: A Recommendation for IPv6 Address Text - Representation"; - } - - typedef ip-prefix { - type union { - type inet:ipv4-prefix; - type inet:ipv6-prefix; - } - description - "The ip-prefix type represents an IP prefix and is IP - version neutral. The format of the textual representations - implies the IP version."; - } - - typedef ipv4-prefix { - type string { - pattern - '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' - + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' - + '/(([0-9])|([1-2][0-9])|(3[0-2]))'; - } - description - "The ipv4-prefix type represents an IPv4 address prefix. - The prefix length is given by the number following the - slash character and must be less than or equal to 32. - - A prefix length value of n corresponds to an IP address - mask that has n contiguous 1-bits from the most - significant bit (MSB) and all other bits set to 0. - - The canonical format of an IPv4 prefix has all bits of - the IPv4 address set to zero that are not part of the - IPv4 prefix."; - } - - typedef ipv6-prefix { - type string { - pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' - + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' - + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}' - + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))' - + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'; - pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' - + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)' - + '(/.+)'; - } - description - "The ipv6-prefix type represents an IPv6 address prefix. - The prefix length is given by the number following the - slash character and must be less than or equal to 128. - - A prefix length value of n corresponds to an IP address - mask that has n contiguous 1-bits from the most - significant bit (MSB) and all other bits set to 0. - - The IPv6 address should have all bits that do not belong - to the prefix set to zero. - - The canonical format of an IPv6 prefix has all bits of - the IPv6 address set to zero that are not part of the - IPv6 prefix. Furthermore, the IPv6 address is represented - as defined in Section 4 of RFC 5952."; - reference - "RFC 5952: A Recommendation for IPv6 Address Text - Representation"; - } - - /*** collection of domain name and URI types ***/ - - typedef domain-name { - type string { - pattern - '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' - + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' - + '|\.'; - length "1..253"; - } - description - "The domain-name type represents a DNS domain name. The - name SHOULD be fully qualified whenever possible. - - Internet domain names are only loosely specified. Section - 3.5 of RFC 1034 recommends a syntax (modified in Section - 2.1 of RFC 1123). The pattern above is intended to allow - for current practice in domain name use, and some possible - future expansion. It is designed to hold various types of - domain names, including names used for A or AAAA records - (host names) and other records, such as SRV records. Note - that Internet host names have a stricter syntax (described - in RFC 952) than the DNS recommendations in RFCs 1034 and - 1123, and that systems that want to store host names in - schema nodes using the domain-name type are recommended to - adhere to this stricter standard to ensure interoperability. - - The encoding of DNS names in the DNS protocol is limited - to 255 characters. Since the encoding consists of labels - prefixed by a length bytes and there is a trailing NULL - byte, only 253 characters can appear in the textual dotted - notation. - - The description clause of schema nodes using the domain-name - type MUST describe when and how these names are resolved to - IP addresses. Note that the resolution of a domain-name value - may require to query multiple DNS records (e.g., A for IPv4 - and AAAA for IPv6). The order of the resolution process and - which DNS record takes precedence can either be defined - explicitly or may depend on the configuration of the - resolver. - - Domain-name values use the US-ASCII encoding. Their canonical - format uses lowercase US-ASCII characters. Internationalized - domain names MUST be A-labels as per RFC 5890."; - reference - "RFC 952: DoD Internet Host Table Specification - RFC 1034: Domain Names - Concepts and Facilities - RFC 1123: Requirements for Internet Hosts -- Application - and Support - RFC 2782: A DNS RR for specifying the location of services - (DNS SRV) - RFC 5890: Internationalized Domain Names in Applications - (IDNA): Definitions and Document Framework"; - } - - typedef host { - type union { - type inet:ip-address; - type inet:domain-name; - } - description - "The host type represents either an IP address or a DNS - domain name."; - } - - typedef uri { - type string; - description - "The uri type represents a Uniform Resource Identifier - (URI) as defined by STD 66. - - Objects using the uri type MUST be in US-ASCII encoding, - and MUST be normalized as described by RFC 3986 Sections - 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary - percent-encoding is removed, and all case-insensitive - characters are set to lowercase except for hexadecimal - digits, which are normalized to uppercase as described in - Section 6.2.2.1. - - The purpose of this normalization is to help provide - unique URIs. Note that this normalization is not - sufficient to provide uniqueness. Two URIs that are - textually distinct after this normalization may still be - equivalent. - - Objects using the uri type may restrict the schemes that - they permit. For example, 'data:' and 'urn:' schemes - might not be appropriate. - - A zero-length URI is not a valid URI. This can be used to - express 'URI absent' where required. - - In the value set and its semantics, this type is equivalent - to the Uri SMIv2 textual convention defined in RFC 5017."; - reference - "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax - RFC 3305: Report from the Joint W3C/IETF URI Planning Interest - Group: Uniform Resource Identifiers (URIs), URLs, - and Uniform Resource Names (URNs): Clarifications - and Recommendations - RFC 5017: MIB Textual Conventions for Uniform Resource - Identifiers (URIs)"; - } - -} diff --git a/tools/yang/ietf-netconf-monitoring.yang b/tools/yang/ietf-netconf-monitoring.yang deleted file mode 100644 index 8d2380e7..00000000 --- a/tools/yang/ietf-netconf-monitoring.yang +++ /dev/null @@ -1,558 +0,0 @@ -module ietf-netconf-monitoring { - - namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"; - prefix "ncm"; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Mehmet Ersue - - - WG Chair: Bert Wijnen - - - Editor: Mark Scott - - - Editor: Martin Bjorklund - "; - - description - "NETCONF Monitoring Module. - All elements in this module are read-only. - - Copyright (c) 2010 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD - License set forth in Section 4.c of the IETF Trust's - Legal Provisions Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 6022; see - the RFC itself for full legal notices."; - - revision 2010-10-04 { - description - "Initial revision."; - reference - "RFC 6022: YANG Module for NETCONF Monitoring"; - } - - typedef netconf-datastore-type { - type enumeration { - enum running; - enum candidate; - enum startup; - } - description - "Enumeration of possible NETCONF datastore types."; - reference - "RFC 4741: NETCONF Configuration Protocol"; - } - - identity transport { - description - "Base identity for NETCONF transport types."; - } - - identity netconf-ssh { - base transport; - description - "NETCONF over Secure Shell (SSH)."; - reference - "RFC 4742: Using the NETCONF Configuration Protocol - over Secure SHell (SSH)"; - } - - identity netconf-soap-over-beep { - base transport; - description - "NETCONF over Simple Object Access Protocol (SOAP) over - Blocks Extensible Exchange Protocol (BEEP)."; - reference - "RFC 4743: Using NETCONF over the Simple Object - Access Protocol (SOAP)"; - } - - identity netconf-soap-over-https { - base transport; - description - "NETCONF over Simple Object Access Protocol (SOAP) - over Hypertext Transfer Protocol Secure (HTTPS)."; - reference - "RFC 4743: Using NETCONF over the Simple Object - Access Protocol (SOAP)"; - } - - identity netconf-beep { - base transport; - description - "NETCONF over Blocks Extensible Exchange Protocol (BEEP)."; - reference - "RFC 4744: Using the NETCONF Protocol over the - Blocks Extensible Exchange Protocol (BEEP)"; - } - - identity netconf-tls { - base transport; - description - "NETCONF over Transport Layer Security (TLS)."; - reference - "RFC 5539: NETCONF over Transport Layer Security (TLS)"; - } - - identity schema-format { - description - "Base identity for data model schema languages."; - } - - identity xsd { - base schema-format; - description - "W3C XML Schema Definition."; - reference - "W3C REC REC-xmlschema-1-20041028: - XML Schema Part 1: Structures"; - } - - identity yang { - base schema-format; - description - "The YANG data modeling language for NETCONF."; - reference - "RFC 6020: YANG - A Data Modeling Language for the - Network Configuration Protocol (NETCONF)"; - } - - identity yin { - base schema-format; - description - "The YIN syntax for YANG."; - reference - "RFC 6020: YANG - A Data Modeling Language for the - Network Configuration Protocol (NETCONF)"; - } - - identity rng { - base schema-format; - description - "Regular Language for XML Next Generation (RELAX NG)."; - reference - "ISO/IEC 19757-2:2008: RELAX NG"; - } - - identity rnc { - base schema-format; - description - "Relax NG Compact Syntax"; - reference - "ISO/IEC 19757-2:2008: RELAX NG"; - } - - grouping common-counters { - description - "Counters that exist both per session, and also globally, - accumulated from all sessions."; - - leaf in-rpcs { - type yang:zero-based-counter32; - description - "Number of correct messages received."; - } - leaf in-bad-rpcs { - type yang:zero-based-counter32; - description - "Number of messages received when an message was expected, - that were not correct messages. This includes XML parse - errors and errors on the rpc layer."; - } - leaf out-rpc-errors { - type yang:zero-based-counter32; - description - "Number of messages sent that contained an - element."; - } - leaf out-notifications { - type yang:zero-based-counter32; - description - "Number of messages sent."; - } - } - - container netconf-state { - config false; - description - "The netconf-state container is the root of the monitoring - data model."; - - container capabilities { - description - "Contains the list of NETCONF capabilities supported by the - server."; - - leaf-list capability { - type inet:uri; - description - "List of NETCONF capabilities supported by the server."; - } - } - - container datastores { - description - "Contains the list of NETCONF configuration datastores."; - - list datastore { - key name; - description - "List of NETCONF configuration datastores supported by - the NETCONF server and related information."; - - leaf name { - type netconf-datastore-type; - description - "Name of the datastore associated with this list entry."; - } - container locks { - presence - "This container is present only if the datastore - is locked."; - description - "The NETCONF and operations allow - a client to lock specific resources in a datastore. The - NETCONF server will prevent changes to the locked - resources by all sessions except the one that acquired - the lock(s). - - Monitoring information is provided for each datastore - entry including details such as the session that acquired - the lock, the type of lock (global or partial) and the - list of locked resources. Multiple locks per datastore - are supported."; - - grouping lock-info { - description - "Lock related parameters, common to both global and - partial locks."; - - leaf locked-by-session { - type uint32; - mandatory true; - description - "The session ID of the session that has locked - this resource. Both a global lock and a partial - lock MUST contain the NETCONF session-id. - - If the lock is held by a session that is not managed - by the NETCONF server (e.g., a CLI session), a session - id of 0 (zero) is reported."; - reference - "RFC 4741: NETCONF Configuration Protocol"; - } - leaf locked-time { - type yang:date-and-time; - mandatory true; - description - "The date and time of when the resource was - locked."; - } - } - - choice lock-type { - description - "Indicates if a global lock or a set of partial locks - are set."; - - container global-lock { - description - "Present if the global lock is set."; - uses lock-info; - } - - list partial-lock { - key lock-id; - description - "List of partial locks."; - reference - "RFC 5717: Partial Lock Remote Procedure Call (RPC) for - NETCONF"; - - leaf lock-id { - type uint32; - description - "This is the lock id returned in the - response."; - } - uses lock-info; - leaf-list select { - type yang:xpath1.0; - min-elements 1; - description - "The xpath expression that was used to request - the lock. The select expression indicates the - original intended scope of the lock."; - } - leaf-list locked-node { - type instance-identifier; - description - "The list of instance-identifiers (i.e., the - locked nodes). - - The scope of the partial lock is defined by the list - of locked nodes."; - } - } - } - } - } - } - - container schemas { - description - "Contains the list of data model schemas supported by the - server."; - - list schema { - key "identifier version format"; - - description - "List of data model schemas supported by the server."; - - leaf identifier { - type string; - description - "Identifier to uniquely reference the schema. The - identifier is used in the operation and may - be used for other purposes such as file retrieval. - - For modeling languages that support or require a data - model name (e.g., YANG module name) the identifier MUST - match that name. For YANG data models, the identifier is - the name of the module or submodule. In other cases, an - identifier such as a filename MAY be used instead."; - } - leaf version { - type string; - description - "Version of the schema supported. Multiple versions MAY be - supported simultaneously by a NETCONF server. Each - version MUST be reported individually in the schema list, - i.e., with same identifier, possibly different location, - but different version. - - For YANG data models, version is the value of the most - recent YANG 'revision' statement in the module or - submodule, or the empty string if no 'revision' statement - is present."; - } - leaf format { - type identityref { - base schema-format; - } - description - "The data modeling language the schema is written - in (currently xsd, yang, yin, rng, or rnc). - For YANG data models, 'yang' format MUST be supported and - 'yin' format MAY also be provided."; - } - leaf namespace { - type inet:uri; - mandatory true; - description - "The XML namespace defined by the data model. - - For YANG data models, this is the module's namespace. - If the list entry describes a submodule, this field - contains the namespace of the module to which the - submodule belongs."; - } - leaf-list location { - type union { - type enumeration { - enum "NETCONF"; - } - type inet:uri; - } - description - "One or more locations from which the schema can be - retrieved. This list SHOULD contain at least one - entry per schema. - - A schema entry may be located on a remote file system - (e.g., reference to file system for ftp retrieval) or - retrieved directly from a server supporting the - operation (denoted by the value 'NETCONF')."; - } - } - } - - container sessions { - description - "The sessions container includes session-specific data for - NETCONF management sessions. The session list MUST include - all currently active NETCONF sessions."; - - list session { - key session-id; - description - "All NETCONF sessions managed by the NETCONF server - MUST be reported in this list."; - - leaf session-id { - type uint32 { - range "1..max"; - } - description - "Unique identifier for the session. This value is the - NETCONF session identifier, as defined in RFC 4741."; - reference - "RFC 4741: NETCONF Configuration Protocol"; - } - leaf transport { - type identityref { - base transport; - } - mandatory true; - description - "Identifies the transport for each session, e.g., - 'netconf-ssh', 'netconf-soap', etc."; - } - leaf username { - type string; - mandatory true; - description - "The username is the client identity that was authenticated - by the NETCONF transport protocol. The algorithm used to - derive the username is NETCONF transport protocol specific - and in addition specific to the authentication mechanism - used by the NETCONF transport protocol."; - } - leaf source-host { - type inet:host; - description - "Host identifier of the NETCONF client. The value - returned is implementation specific (e.g., hostname, - IPv4 address, IPv6 address)"; - } - leaf login-time { - type yang:date-and-time; - mandatory true; - description - "Time at the server at which the session was established."; - } - uses common-counters { - description - "Per-session counters. Zero based with following reset - behaviour: - - at start of a session - - when max value is reached"; - } - } - } - - container statistics { - description - "Statistical data pertaining to the NETCONF server."; - - leaf netconf-start-time { - type yang:date-and-time; - description - "Date and time at which the management subsystem was - started."; - } - leaf in-bad-hellos { - type yang:zero-based-counter32; - description - "Number of sessions silently dropped because an - invalid message was received. This includes - messages with a 'session-id' attribute, bad namespace, and - bad capability declarations."; - } - leaf in-sessions { - type yang:zero-based-counter32; - description - "Number of sessions started. This counter is incremented - when a message with a is sent. - - 'in-sessions' - 'in-bad-hellos' = - 'number of correctly started netconf sessions'"; - } - leaf dropped-sessions { - type yang:zero-based-counter32; - description - "Number of sessions that were abnormally terminated, e.g., - due to idle timeout or transport close. This counter is not - incremented when a session is properly closed by a - operation, or killed by a - operation."; - } - uses common-counters { - description - "Global counters, accumulated from all sessions. - Zero based with following reset behaviour: - - re-initialization of NETCONF server - - when max value is reached"; - } - } - } - - rpc get-schema { - description - "This operation is used to retrieve a schema from the - NETCONF server. - - Positive Response: - The NETCONF server returns the requested schema. - - Negative Response: - If requested schema does not exist, the is - 'invalid-value'. - - If more than one schema matches the requested parameters, the - is 'operation-failed', and is - 'data-not-unique'."; - - input { - leaf identifier { - type string; - mandatory true; - description - "Identifier for the schema list entry."; - } - leaf version { - type string; - description - "Version of the schema requested. If this parameter is not - present, and more than one version of the schema exists on - the server, a 'data-not-unique' error is returned, as - described above."; - } - leaf format { - type identityref { - base schema-format; - } - description - "The data modeling language of the schema. If this - parameter is not present, and more than one formats of - the schema exists on the server, a 'data-not-unique' error - is returned, as described above."; - } - } - output { - anyxml data { - description - "Contains the schema content."; - } - } - } -} diff --git a/tools/yang/ietf-yang-smiv2.yang b/tools/yang/ietf-yang-smiv2.yang deleted file mode 100644 index b06afc7a..00000000 --- a/tools/yang/ietf-yang-smiv2.yang +++ /dev/null @@ -1,144 +0,0 @@ -module ietf-yang-smiv2 { - - namespace "urn:ietf:params:xml:ns:yang:ietf-yang-smiv2"; - prefix "smiv2"; - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: David Kessens - - - WG Chair: Juergen Schoenwaelder - - - Editor: Juergen Schoenwaelder - "; - - description - "This module defines YANG extensions that are used to translate - SMIv2 concepts into YANG. - - Copyright (c) 2011 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD License - set forth in Section 4.c of the IETF Trust's Legal Provisions - Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - // RFC Ed.: replace XXXX with actual RFC number and remove this note - - // RFC Ed.: please update the date to the date of publication - revision 2011-11-25 { - description - "Initial revision."; - reference - "RFC XXXX: Translation of SMIv2 MIB Modules to YANG Modules"; - // RFC Ed.: replace XXXX with actual RFC number and remove this note - } - - identity object-identity { - description - "Base identity for all SMIv2 OBJECT-IDENTITYs."; - } - - typedef opaque { - type binary; - description - "The Opaque type supports the capability to pass arbitrary ASN.1 - syntax. A value is encoded using the ASN.1 Basic Encoding Rules - into a string of octets. This, in turn, is encoded as an OCTET - STRING, in effect 'double-wrapping' the original ASN.1 value. - - In the value set and its semantics, this type is equivalent to - the Opaque type of the SMIv2. This type exists in the SMIv2 - solely for backward-compatibility reasons and this is also - true for this YANG data type."; - reference - "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension display-hint { - argument "format"; - description - "The display-hint statement takes as an argument the DISPLAY-HINT - assigned to an SMIv2 textual convention."; - reference - "RFC2579: Textual Conventions for SMIv2"; - } - - extension max-access { - argument "access"; - description - "The max-access statement takes as an argument the MAX-ACCESS - assigned to an SMIv2 object definition"; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension defval { - argument "value"; - description - "The defval statement takes as an argument a default value - defined by an SMIv2 DEFVAL clause. Note that the value is in - the SMIv2 value space defined by the SMIv2 syntax of the - corresponding object and not in the YANG value space - defined by the corresponding YANG data type."; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension implied { - argument "index"; - description - "If an SMIv2 INDEX object is preceded by the IMPLIED keyword, then - the implied statement is present in the yang module and takes as - an argument the name of the IMPLIED index object."; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension alias { - argument "descriptor"; - description - "The alias statement introduces an SMIv2 descriptor. The body of - the alias statement is expected to contain an oid statement that - provides the numeric OID associated with the descriptor."; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension oid { - argument "value"; - description - "The oid statement takes as an argument the object identifier - assigned to an SMIv2 definition. The object identifier value - is written in decimal dotted notation."; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension subid { - argument "value"; - description - "The subid statement takes as an argument the last sub-identifier - of the object identifier assigned to an SMIv2 definition. The - sub-identifier value is a single positive decimal natural number. - The subid statement may not be used as a substatement to any - top-level node in a YANG document. The subid substatement may - be used only as a substatement to a node having a parent node - defined with either a smiv2:oid or smiv2:subid substatement."; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - -} diff --git a/tools/yang/ietf-yang-types.yang b/tools/yang/ietf-yang-types.yang deleted file mode 100644 index ee58fa3a..00000000 --- a/tools/yang/ietf-yang-types.yang +++ /dev/null @@ -1,474 +0,0 @@ -module ietf-yang-types { - - namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types"; - prefix "yang"; - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: David Kessens - - - WG Chair: Juergen Schoenwaelder - - - Editor: Juergen Schoenwaelder - "; - - description - "This module contains a collection of generally useful derived - YANG data types. - - Copyright (c) 2013 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD License - set forth in Section 4.c of the IETF Trust's Legal Provisions - Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 6991; see - the RFC itself for full legal notices."; - - revision 2013-07-15 { - description - "This revision adds the following new data types: - - yang-identifier - - hex-string - - uuid - - dotted-quad"; - reference - "RFC 6991: Common YANG Data Types"; - } - - revision 2010-09-24 { - description - "Initial revision."; - reference - "RFC 6021: Common YANG Data Types"; - } - - /*** collection of counter and gauge types ***/ - - typedef counter32 { - type uint32; - description - "The counter32 type represents a non-negative integer - that monotonically increases until it reaches a - maximum value of 2^32-1 (4294967295 decimal), when it - wraps around and starts increasing again from zero. - - Counters have no defined 'initial' value, and thus, a - single value of a counter has (in general) no information - content. Discontinuities in the monotonically increasing - value normally occur at re-initialization of the - management system, and at other times as specified in the - description of a schema node using this type. If such - other times can occur, for example, the creation of - a schema node of type counter32 at times other than - re-initialization, then a corresponding schema node - should be defined, with an appropriate type, to indicate - the last discontinuity. - - The counter32 type should not be used for configuration - schema nodes. A default statement SHOULD NOT be used in - combination with the type counter32. - - In the value set and its semantics, this type is equivalent - to the Counter32 type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 - (SMIv2)"; - } - - typedef zero-based-counter32 { - type yang:counter32; - default "0"; - description - "The zero-based-counter32 type represents a counter32 - that has the defined 'initial' value zero. - - A schema node of this type will be set to zero (0) on creation - and will thereafter increase monotonically until it reaches - a maximum value of 2^32-1 (4294967295 decimal), when it - wraps around and starts increasing again from zero. - - Provided that an application discovers a new schema node - of this type within the minimum time to wrap, it can use the - 'initial' value as a delta. It is important for a management - station to be aware of this minimum time and the actual time - between polls, and to discard data if the actual time is too - long or there is no defined minimum time. - - In the value set and its semantics, this type is equivalent - to the ZeroBasedCounter32 textual convention of the SMIv2."; - reference - "RFC 4502: Remote Network Monitoring Management Information - Base Version 2"; - } - - typedef counter64 { - type uint64; - description - "The counter64 type represents a non-negative integer - that monotonically increases until it reaches a - maximum value of 2^64-1 (18446744073709551615 decimal), - when it wraps around and starts increasing again from zero. - - Counters have no defined 'initial' value, and thus, a - single value of a counter has (in general) no information - content. Discontinuities in the monotonically increasing - value normally occur at re-initialization of the - management system, and at other times as specified in the - description of a schema node using this type. If such - other times can occur, for example, the creation of - a schema node of type counter64 at times other than - re-initialization, then a corresponding schema node - should be defined, with an appropriate type, to indicate - the last discontinuity. - - The counter64 type should not be used for configuration - schema nodes. A default statement SHOULD NOT be used in - combination with the type counter64. - - In the value set and its semantics, this type is equivalent - to the Counter64 type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 - (SMIv2)"; - } - - typedef zero-based-counter64 { - type yang:counter64; - default "0"; - description - "The zero-based-counter64 type represents a counter64 that - has the defined 'initial' value zero. - - A schema node of this type will be set to zero (0) on creation - and will thereafter increase monotonically until it reaches - a maximum value of 2^64-1 (18446744073709551615 decimal), - when it wraps around and starts increasing again from zero. - - Provided that an application discovers a new schema node - of this type within the minimum time to wrap, it can use the - 'initial' value as a delta. It is important for a management - station to be aware of this minimum time and the actual time - between polls, and to discard data if the actual time is too - long or there is no defined minimum time. - - In the value set and its semantics, this type is equivalent - to the ZeroBasedCounter64 textual convention of the SMIv2."; - reference - "RFC 2856: Textual Conventions for Additional High Capacity - Data Types"; - } - - typedef gauge32 { - type uint32; - description - "The gauge32 type represents a non-negative integer, which - may increase or decrease, but shall never exceed a maximum - value, nor fall below a minimum value. The maximum value - cannot be greater than 2^32-1 (4294967295 decimal), and - the minimum value cannot be smaller than 0. The value of - a gauge32 has its maximum value whenever the information - being modeled is greater than or equal to its maximum - value, and has its minimum value whenever the information - being modeled is smaller than or equal to its minimum value. - If the information being modeled subsequently decreases - below (increases above) the maximum (minimum) value, the - gauge32 also decreases (increases). - - In the value set and its semantics, this type is equivalent - to the Gauge32 type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 - (SMIv2)"; - } - - typedef gauge64 { - type uint64; - description - "The gauge64 type represents a non-negative integer, which - may increase or decrease, but shall never exceed a maximum - value, nor fall below a minimum value. The maximum value - cannot be greater than 2^64-1 (18446744073709551615), and - the minimum value cannot be smaller than 0. The value of - a gauge64 has its maximum value whenever the information - being modeled is greater than or equal to its maximum - value, and has its minimum value whenever the information - being modeled is smaller than or equal to its minimum value. - If the information being modeled subsequently decreases - below (increases above) the maximum (minimum) value, the - gauge64 also decreases (increases). - - In the value set and its semantics, this type is equivalent - to the CounterBasedGauge64 SMIv2 textual convention defined - in RFC 2856"; - reference - "RFC 2856: Textual Conventions for Additional High Capacity - Data Types"; - } - - /*** collection of identifier-related types ***/ - - typedef object-identifier { - type string { - pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))' - + '(\.(0|([1-9]\d*)))*'; - } - description - "The object-identifier type represents administratively - assigned names in a registration-hierarchical-name tree. - - Values of this type are denoted as a sequence of numerical - non-negative sub-identifier values. Each sub-identifier - value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers - are separated by single dots and without any intermediate - whitespace. - - The ASN.1 standard restricts the value space of the first - sub-identifier to 0, 1, or 2. Furthermore, the value space - of the second sub-identifier is restricted to the range - 0 to 39 if the first sub-identifier is 0 or 1. Finally, - the ASN.1 standard requires that an object identifier - has always at least two sub-identifiers. The pattern - captures these restrictions. - - Although the number of sub-identifiers is not limited, - module designers should realize that there may be - implementations that stick with the SMIv2 limit of 128 - sub-identifiers. - - This type is a superset of the SMIv2 OBJECT IDENTIFIER type - since it is not restricted to 128 sub-identifiers. Hence, - this type SHOULD NOT be used to represent the SMIv2 OBJECT - IDENTIFIER type; the object-identifier-128 type SHOULD be - used instead."; - reference - "ISO9834-1: Information technology -- Open Systems - Interconnection -- Procedures for the operation of OSI - Registration Authorities: General procedures and top - arcs of the ASN.1 Object Identifier tree"; - } - - typedef object-identifier-128 { - type object-identifier { - pattern '\d*(\.\d*){1,127}'; - } - description - "This type represents object-identifiers restricted to 128 - sub-identifiers. - - In the value set and its semantics, this type is equivalent - to the OBJECT IDENTIFIER type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 - (SMIv2)"; - } - - typedef yang-identifier { - type string { - length "1..max"; - pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*'; - pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*'; - } - description - "A YANG identifier string as defined by the 'identifier' - rule in Section 12 of RFC 6020. An identifier must - start with an alphabetic character or an underscore - followed by an arbitrary sequence of alphabetic or - numeric characters, underscores, hyphens, or dots. - - A YANG identifier MUST NOT start with any possible - combination of the lowercase or uppercase character - sequence 'xml'."; - reference - "RFC 6020: YANG - A Data Modeling Language for the Network - Configuration Protocol (NETCONF)"; - } - - /*** collection of types related to date and time***/ - - typedef date-and-time { - type string { - pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' - + '(Z|[\+\-]\d{2}:\d{2})'; - } - description - "The date-and-time type is a profile of the ISO 8601 - standard for representation of dates and times using the - Gregorian calendar. The profile is defined by the - date-time production in Section 5.6 of RFC 3339. - - The date-and-time type is compatible with the dateTime XML - schema type with the following notable exceptions: - - (a) The date-and-time type does not allow negative years. - - (b) The date-and-time time-offset -00:00 indicates an unknown - time zone (see RFC 3339) while -00:00 and +00:00 and Z - all represent the same time zone in dateTime. - - (c) The canonical format (see below) of data-and-time values - differs from the canonical format used by the dateTime XML - schema type, which requires all times to be in UTC using - the time-offset 'Z'. - - This type is not equivalent to the DateAndTime textual - convention of the SMIv2 since RFC 3339 uses a different - separator between full-date and full-time and provides - higher resolution of time-secfrac. - - The canonical format for date-and-time values with a known time - zone uses a numeric time zone offset that is calculated using - the device's configured known offset to UTC time. A change of - the device's offset to UTC time will cause date-and-time values - to change accordingly. Such changes might happen periodically - in case a server follows automatically daylight saving time - (DST) time zone offset changes. The canonical format for - date-and-time values with an unknown time zone (usually - referring to the notion of local time) uses the time-offset - -00:00."; - reference - "RFC 3339: Date and Time on the Internet: Timestamps - RFC 2579: Textual Conventions for SMIv2 - XSD-TYPES: XML Schema Part 2: Datatypes Second Edition"; - } - - typedef timeticks { - type uint32; - description - "The timeticks type represents a non-negative integer that - represents the time, modulo 2^32 (4294967296 decimal), in - hundredths of a second between two epochs. When a schema - node is defined that uses this type, the description of - the schema node identifies both of the reference epochs. - - In the value set and its semantics, this type is equivalent - to the TimeTicks type of the SMIv2."; - reference - "RFC 2578: Structure of Management Information Version 2 - (SMIv2)"; - } - - typedef timestamp { - type yang:timeticks; - description - "The timestamp type represents the value of an associated - timeticks schema node at which a specific occurrence - happened. The specific occurrence must be defined in the - description of any schema node defined using this type. When - the specific occurrence occurred prior to the last time the - associated timeticks attribute was zero, then the timestamp - value is zero. Note that this requires all timestamp values - to be reset to zero when the value of the associated timeticks - attribute reaches 497+ days and wraps around to zero. - - The associated timeticks schema node must be specified - in the description of any schema node using this type. - - In the value set and its semantics, this type is equivalent - to the TimeStamp textual convention of the SMIv2."; - reference - "RFC 2579: Textual Conventions for SMIv2"; - } - - /*** collection of generic address types ***/ - - typedef phys-address { - type string { - pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; - } - - description - "Represents media- or physical-level addresses represented - as a sequence octets, each octet represented by two hexadecimal - numbers. Octets are separated by colons. The canonical - representation uses lowercase characters. - - In the value set and its semantics, this type is equivalent - to the PhysAddress textual convention of the SMIv2."; - reference - "RFC 2579: Textual Conventions for SMIv2"; - } - - typedef mac-address { - type string { - pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'; - } - description - "The mac-address type represents an IEEE 802 MAC address. - The canonical representation uses lowercase characters. - - In the value set and its semantics, this type is equivalent - to the MacAddress textual convention of the SMIv2."; - reference - "IEEE 802: IEEE Standard for Local and Metropolitan Area - Networks: Overview and Architecture - RFC 2579: Textual Conventions for SMIv2"; - } - - /*** collection of XML-specific types ***/ - - typedef xpath1.0 { - type string; - description - "This type represents an XPATH 1.0 expression. - - When a schema node is defined that uses this type, the - description of the schema node MUST specify the XPath - context in which the XPath expression is evaluated."; - reference - "XPATH: XML Path Language (XPath) Version 1.0"; - } - - /*** collection of string types ***/ - - typedef hex-string { - type string { - pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?'; - } - description - "A hexadecimal string with octets represented as hex digits - separated by colons. The canonical representation uses - lowercase characters."; - } - - typedef uuid { - type string { - pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' - + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'; - } - description - "A Universally Unique IDentifier in the string representation - defined in RFC 4122. The canonical representation uses - lowercase characters. - - The following is an example of a UUID in string representation: - f81d4fae-7dec-11d0-a765-00a0c91e6bf6 - "; - reference - "RFC 4122: A Universally Unique IDentifier (UUID) URN - Namespace"; - } - - typedef dotted-quad { - type string { - pattern - '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' - + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'; - } - description - "An unsigned 32-bit number expressed in the dotted-quad - notation, i.e., four octets written as decimal numbers - and separated with the '.' (full stop) character."; - } -}