module l3vpn-instances-interfaces { namespace "urn:opendaylight:netvirt:neutronvpn:l3vpn"; prefix l3vpn-instances-interfaces; import ietf-yang-types { prefix yang; revision-date "2013-07-15";} import ietf-interfaces { prefix if; //rfc7223-YANG Interface Management } import yang-ext {prefix ext; revision-date "2013-07-09";} import neutronvpn { prefix nvpn; revision-date "2015-06-02"; } revision "2020-02-04" { description "This YANG module defines the generic configuration data for L3VPN service. This has been adapted from l3vpn.yang"; } /* * VPN instance view. */ container vpn-instances { list vpn-instance { max-elements "unbounded"; min-elements "0"; key "vpn-instance-name"; leaf vpn-instance-name { mandatory "true"; type string; description "The name of the vpn-instance."; } leaf-list route-distinguisher { description "A set of configuration parameters that is applicable to both IPv4 and IPv6 address family for a VPN instance. Format is ASN:nn or IP-address:nn."; config "true"; type string { length "3..21"; } } container vpnTargets { description "The vpn-target command configures the export or import VPN target extended community attribute for the VPN instance IPv4/IPv6 address family. Format is ASN:nn or IP-address:nn."; list vpnTarget { key "vrfRTValue"; max-elements "unbounded"; min-elements "0"; description "L3vpn vpntarget configure class"; leaf vrfRTValue { description "Vpn-target: adds VPN target extended community attribute to the export or import VPN target extended community list. The vpn-target can be expressed in either of the following formats: (1)16-bit AS number:32-bit user-defined number For example, 1:3. The AS number ranges from 0 to 65535. The user-defined number ranges from 0 to 4294967295. The AS number and the user-defined number cannot be 0s at the same time. That is, a VPN target cannot be 0:0. (2)32-bit IP address:16-bit user-defined number For example, 192.168.122.15:1. The IP address ranges from 0.0.0.0 to 255.255.255.255. The user-defined number ranges from 0 to 65535. (3)32-bit IP address:16-bit user-defined number For example, 192.168.122.15:1. An IP address ranges from 0.0.0.0 to 255.255.255.255. A user-defined number ranges from 0 to 65535."; config "true"; mandatory "true"; type string { length "3..21"; } } leaf vrfRTType { description "Specifies the vpn target type, export-extcommunity: specifies the extended community attributes carried in routing information to be sent. import-extcommunity: receives routing information carrying specified extended community attributes."; mandatory "true"; type enumeration { enum export_extcommunity { value "0"; description "export-extcommunity:"; } enum import_extcommunity { value "1"; description "import-extcommunity:"; } enum both { value "2"; description "export-extcommunity & import-extcommunity:"; } } } } } leaf l2vpn { type boolean; default false; description "The type of the VPN Instance. false indicates it is an L3VPN. true indicates it is an EVPN"; } leaf bgpvpn-type { type enumeration { enum InternetBGPVPN { value "0"; description "Internet BGPVPN"; } enum BGPVPN { value "1"; description "BGPVPN"; } enum InternalVPN { value "2"; description "InternalVPN"; } } default BGPVPN; } leaf ip-address-family-configured { type enumeration { enum "undefined" { value "0"; } enum "ipv4" { value "4"; } enum "ipv6" { value "6"; } enum "ipv4-and-ipv6" { value "10"; } } default "undefined"; } leaf l3vni { type uint32; } } } augment "/vpn-interfaces/vpn-interface" { ext:augment-identifier "adjacencies"; uses adjacency-list; } grouping adjacency-list{ list adjacency{ key "ip_address"; leaf-list next-hop-ip-list { type string; } leaf ip_address {type string;} leaf adjacency_type { description "The type of adjacency"; type enumeration { enum "primary-adjacency" { value 1; description "Primary adjacency type."; } enum "learnt-ip" { value 2; description "Learnt ip adjacency type."; } enum "extra-route" { value 3; description "Extra route adjacency type."; } } default "extra-route"; } leaf mac_address {type string;} /* optional */ leaf subnet_id {type yang:uuid;} /* optional */ leaf subnet_gateway_ip {type string;} /* optional */ leaf phys-network-func { type boolean; default false; description "Value of True indicates this is an adjacency of a device in a provider network"; } uses adjacency-op-data; } } grouping adjacency-op-data{ leaf label { type uint32; config "false"; } /* optional */ leaf subnet_gateway_mac_address {type string; config "false";} /* optional */ leaf vrf-id { type string; config "false"; } leaf marked_for_deletion { config "false"; type boolean; description "This flag if true suggest this adjancency has been marked for deletion"; } } /* * Binding Interfaces to a VPN Instance. */ container vpn-interfaces { description "VPN is enabled on interfaces."; list vpn-interface { key "name"; max-elements "unbounded"; min-elements "0"; leaf name { type leafref { path "/if:interfaces/if:interface/if:name"; } } list vpn-instance-names { key "vpn-name"; leaf vpn-name { type string { length "1..40"; } } leaf associated-subnet-type { type enumeration { enum V4Subnet { value "0"; description "V4 Router Internal VPN"; } enum V6Subnet { value "1"; description "V6 Router Internal VPN"; } enum V6InternetVPN { value "2"; description "BGPVPN Internet"; } enum V4AndV6Subnets { value "3"; description "BGPVPN dual stack or V6/V4 Router or undefined"; } } } } leaf dpn-id { type uint64; } leaf router-interface { type boolean; } uses nvpn:network-attributes; } } }