module ietf-pseudowires { namespace "urn:ietf:params:xml:ns:yang:ietf-pseudowires"; prefix "pw"; import ietf-inet-types { prefix "inet"; } import ietf-routing-types { prefix "rt-types"; } organization "ietf"; contact "ietf"; description "Pseudowire YANG model"; revision "2017-06-26" { description "Initial revision " + " - Created a new model for pseudowires, which used " + " to be defined within the L2VPN model " + ""; reference ""; } /* Typedefs */ typedef pseudowire-ref { type leafref { path "/pw:pseudowires/pw:pseudowire/pw:name"; } description "A type that is a reference to a pseudowire"; } typedef pw-template-ref { type leafref { path "/pw:pseudowires/pw:pw-templates/pw:pw-template/pw:name"; } description "A type that is a reference to a pw-template"; } typedef cw-negotiation-type { type enumeration { enum "non-preferred" { description "No preference for control-word"; } enum "preferred" { description "Prefer to have control-word negotiation"; } } description "control-word negotiation preference type"; } typedef pseudowire-status-type { type bits { bit pseudowire-forwarding { position 0; description "Pseudowire is forwarding"; } bit pseudowire-not-forwarding { position 1; description "Pseudowire is not forwarding"; } bit local-attachment-circuit-receive-fault { position 2; description "Local attachment circuit (ingress) receive " + "fault"; } bit local-attachment-circuit-transmit-fault { position 3; description "Local attachment circuit (egress) transmit " + "fault"; } bit local-PSN-facing-PW-receive-fault { position 4; description "Local PSN-facing PW (ingress) receive fault"; } bit local-PSN-facing-PW-transmit-fault { position 5; description "Local PSN-facing PW (egress) transmit fault"; } bit PW-preferential-forwarding-status { position 6; description "Pseudowire preferential forwarding status"; } bit PW-request-switchover-status { position 7; description "Pseudowire request switchover status"; } } description "Pseudowire status type, as registered in the IANA " + "Pseudowire Status Code Registry"; } /* Groupings */ grouping pw-type-grp { description "pseudowire type grouping"; choice pw-type { description "A choice of pseudowire type"; case ldp-or-static-pw { leaf peer-ip { type inet:ip-address; description "peer IP address"; } leaf pw-id { type uint32; description "pseudowire id"; } leaf icb { type boolean; description "inter-chassis backup"; } leaf transmit-label { type rt-types:mpls-label; description "transmit lable"; } leaf receive-label { type rt-types:mpls-label; description "receive label"; } } case bgp-pw { leaf remote-pe-id { type inet:ip-address; description "remote pe id"; } } case bgp-ad-pw { leaf remote-ve-id { type uint16; description "remote ve id"; } } } } /* Data */ container pseudowires { description "Configuration management of pseudowires"; list pseudowire { key "name"; description "A pseudowire"; leaf name { type string; description "pseudowire name"; } leaf state { type pseudowire-status-type; config false; description "pseudowire operation status"; reference "RFC 4446 and IANA Pseudowire Status Codes " + "Registery"; } leaf template { type pw-template-ref; description "pseudowire template"; } leaf mtu { type uint16; description "PW MTU"; } leaf mac-withdraw { type boolean; default false; description "Enable (true) or disable (false) MAC withdraw"; } leaf cw-negotiation { type cw-negotiation-type; description "cw-negotiation"; } leaf tunnel-policy { type string; description "tunnel policy name"; } choice pw-type { description "A choice of pseudowire type"; case configured-pw { container configured-pw { description "LDP or static pseudowire that requires " + "manual configuration"; leaf peer-ip { type inet:ip-address; description "peer IP address"; } leaf pw-id { type uint32; description "pseudowire id"; } leaf icb { type boolean; description "inter-chassis backup"; } leaf transmit-label { type rt-types:mpls-label; description "transmit lable"; } leaf receive-label { type rt-types:mpls-label; description "receive label"; } } } } } container pw-templates { description "pw-templates"; list pw-template { key "name"; description "pw-template"; leaf name { type string; description "name"; } leaf mtu { type uint16; description "pseudowire mtu"; } leaf cw-negotiation { type cw-negotiation-type; default "preferred"; description "control-word negotiation preference"; } leaf tunnel-policy { type string; description "tunnel policy name"; } } } } }