module ietf-pseudowires {
yang-version 1;
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 "2018-10-22" {
description
"Second revision - Added group-id and attachment identifiers ";
reference
"";
}
revision "2017-06-26" {
description
"Initial revision - Created a new model for pseudowires, which used to be defined within the L2VPN model ";
reference
"";
}
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" {
value 0;
description
"No preference for control-word";
}
enum "preferred" {
value 1;
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";
}
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 pw-loadbalance {
type enumeration {
enum "disabled" {
value 0;
description
"load-balancing disabled";
}
enum "fat-pw" {
value 1;
description
"load-balance using FAT label below PW label";
}
enum "entropy" {
value 2;
description
"load-balance using ELI/EL above PW label";
}
}
description "PW load-balancing";
}
leaf ms-pw-member {
type boolean;
default "false";
description
"Enable (true) or disable (false) not a member of MS-PW";
}
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 {
leaf peer-ip {
type inet:ip-address;
description "peer IP address";
}
leaf pw-id {
type uint32;
description "pseudowire id";
}
leaf group-id {
type uint32;
description "group 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";
}
leaf generalized {
type boolean;
description
"generalized pseudowire id FEC element";
}
leaf agi {
type string;
description
"attachment group identifier";
}
leaf saii {
type string;
description
"source attachment individual identifier";
}
leaf taii {
type string;
description
"target attachment individual identifier";
}
} // case configured-pw
leaf remote-pe-id {
type inet:ip-address;
description "remote pe id";
}
leaf remote-ve-id {
type uint16;
description "remote ve id";
}
} // choice pw-type
} // list pseudowire
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";
}
} // list pw-template
} // container pw-templates
} // container pseudowires
} // module ietf-pseudowires