From d3b4e3a4e8c1c1d72eb42972a2620a4a7b890fc2 Mon Sep 17 00:00:00 2001 From: Deepthi V V Date: Thu, 19 Mar 2015 23:28:37 +0530 Subject: [PATCH] Vpnservice models Added models for fib, bgp and interfaces. Signed-off-by: Deepthi V V Change-Id: I602cc5bd3ae774950704411b41646d94792e9f3c --- features/pom.xml | 7 ++ features/src/main/features/features.xml | 2 + vpnmanager-api/pom.xml | 11 ++ vpnmanager-api/src/main/yang/bgp-l3vpn.yang | 38 ++++++ vpnmanager-api/src/main/yang/odl-l3vpn.yang | 123 ++++++++++++++++---- 5 files changed, 158 insertions(+), 23 deletions(-) create mode 100644 vpnmanager-api/src/main/yang/bgp-l3vpn.yang diff --git a/features/pom.xml b/features/pom.xml index 39c04599..1acacbf9 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -53,6 +53,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL xml runtime + + org.opendaylight.controller + features-flow + features + xml + runtime + org.opendaylight.controller features-restconf diff --git a/features/src/main/features/features.xml b/features/src/main/features/features.xml index 7861e457..e56a1b28 100644 --- a/features/src/main/features/features.xml +++ b/features/src/main/features/features.xml @@ -12,9 +12,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0"> mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features + mvn:org.opendaylight.controller/features-flow/${mdsal.version}/xml/features mvn:org.opendaylight.controller/features-restconf/${mdsal.version}/xml/features odl-yangtools-models + odl-flow-model mvn:org.opendaylight.vpnservice/model-bgp/2013.07.15.7-SNAPSHOT mvn:org.opendaylight.vpnservice/vpnmanager-api/${project.version} diff --git a/vpnmanager-api/pom.xml b/vpnmanager-api/pom.xml index e849eee1..89dac84c 100644 --- a/vpnmanager-api/pom.xml +++ b/vpnmanager-api/pom.xml @@ -26,6 +26,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html 2010.09.24.7-SNAPSHOT 2013.09.07.7-SNAPSHOT 0.7.0-SNAPSHOT + 1.2.0-SNAPSHOT @@ -54,6 +55,16 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ietf-interfaces 2014.05.08.7-SNAPSHOT + + org.opendaylight.yangtools.model + iana-if-type-2014-05-08 + 2014.05.08.7-SNAPSHOT + + + org.opendaylight.controller.model + model-inventory + ${mdsal.version} + org.opendaylight.vpnservice model-bgp diff --git a/vpnmanager-api/src/main/yang/bgp-l3vpn.yang b/vpnmanager-api/src/main/yang/bgp-l3vpn.yang new file mode 100644 index 00000000..423523f1 --- /dev/null +++ b/vpnmanager-api/src/main/yang/bgp-l3vpn.yang @@ -0,0 +1,38 @@ +module bgp-l3vpn { + namespace "urn:opendaylight:l3vpn:bgp"; + prefix bgp-l3vpn; + + import l3vpn { prefix l3vpn; revision-date "2014-08-15";} + + revision "2013-09-11" { + description "L3 VPN Service module"; + } + + grouping bgp-neighbors { + description + "The top level container for the list of neighbours of the BGP router."; + list bgp-neighbor { + key "ip-address"; + leaf as-number { type uint32; } + leaf ip-address { type string; mandatory true; } + } + } + + grouping bgp-config { + description + "The top level container for BGP configuration"; + leaf bgp-ip-address { type string; } + leaf bgp-router-id { type string; } + leaf bgp-as { type uint32; mandatory true; } + } + + augment "/l3vpn:vpn-instances" { + container bgp-config { + uses bgp-config; + } + container bgp-neighbors { + uses bgp-neighbors; + } + } +} + diff --git a/vpnmanager-api/src/main/yang/odl-l3vpn.yang b/vpnmanager-api/src/main/yang/odl-l3vpn.yang index 1703bbe6..5d329a0b 100644 --- a/vpnmanager-api/src/main/yang/odl-l3vpn.yang +++ b/vpnmanager-api/src/main/yang/odl-l3vpn.yang @@ -1,25 +1,102 @@ - module odl-l3vpn { - namespace "urn:opendaylight:l3vpn"; - prefix odl-l3vpn; - - import l3vpn { prefix l3vpn; revision-date "2014-08-15";} - - revision "2013-09-11" { - description "L3 VPN Service module"; - } - - grouping next-hop-list{ - list l3-next-hops{ - key "ip_address"; - leaf nextHopId { type uint32;} - leaf ip_address {type string;} - leaf label {type uint32;} /* optional */ - leaf mac_address {type string;} /* optional */ - } - } - - augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" { - uses next-hop-list; - } + namespace "urn:opendaylight:l3vpn"; + prefix odl-l3vpn; + + import l3vpn { prefix l3vpn; revision-date "2014-08-15"; } + import ietf-interfaces { prefix if; } + import iana-if-type { prefix ianaift; } + import ietf-inet-types { prefix inet; } + import opendaylight-inventory { prefix inv; revision-date "2013-08-19"; } + + revision "2013-09-11" { + description "L3 VPN Service module"; + } + + grouping next-hop-list{ + list l3-next-hops{ + key "ip_address"; + leaf nextHopId { type uint32;} + leaf ip_address {type string;} + leaf label {type uint32;} /* optional */ + leaf mac_address {type string;} /* optional */ + } + } + + grouping fib-list{ + list fib-entry{ + key "dst_prefix"; + leaf nextHopId { type uint32;} + leaf dst_prefix {type inet:ipv4-prefix;} + leaf label {type uint32;} /* optional */ + } + } + + augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" { + uses next-hop-list; + } + + augment "/l3vpn:vpn-instances/l3vpn:vpn-instance" { + uses fib-list; + } + + augment "/if:interfaces/if:interface" { + leaf portId { type inv:node-connector-id; } + } + + identity tunnel-type-base { + description "Base identity for all tunnel-types"; + } + + identity tunnel-type-vxlan { + description "Tunnel type for vxlan tunnels"; + base tunnel-type-base; + } + + identity tunnel-type-gre { + description "Tunnel type for gre tunnels"; + base tunnel-type-base; + } + + grouping tunnel-type-attributes { + description "Common leaf for expressing tunnel-type"; + leaf tunnel-type { + type identityref { + base tunnel-type-base; + } + } + } + + grouping tunnel-endpoint { + description + "Tunnel Endpoint: IP address and L4 port"; + leaf local-ip { + type inet:ip-address; + description "Local Endpoint IP address"; + } + leaf remote-ip { + type inet:ip-address; + description "Remote Endpoint IP address"; + } + leaf port { + type inet:port-number; + description "Data-plane port number"; + } + } + + augment "/if:interfaces/if:interface" { + when "if:type = ianaift:tunnel"; + uses tunnel-type-attributes; + uses tunnel-endpoint; + } + + augment "/if:interfaces/if:interface" { + when "if:type = ianaift:l2vlan"; + leaf vlan-id { + type uint16 { + range "1..4094"; + } + description "VLAN Id to be used in VLAN Tag"; + } + } + } \ No newline at end of file -- 2.36.6