- commons
+-- parent : Contains Parent pom.xml for all the ovsdb modules.
-- distribution : Builds a working controller distribution based on the controller + ovsdb modules and other
- dependant modules such as openflowplugin
- +-- opendaylight : older, OSGi-based distribution
- +-- opendaylight-karaf : karaf-based distribution
-
- features : This folder contains all the Karaf related files.
-- library : Contains Schema-independent library that is a reference implementation for RFC 7047.
- This module doesn't depend on any of the Opendaylight components.
- This library module can also be used independently in a non-OSGi environment.
+- karaf : Builds a working controller distribution based on the controller + ovsdb modules and other
+ dependant modules such as openflowplugin
- openstack
+-- net-virt : Handles the Openstack Neutron ML2 and Network Service calls and performs all the logic required
for Network Virtualization.
+-- net-virt-providers : Mostly contains data-path programming functionality via OpenFlow or potentially
other protocols.
+ +-- net-virt-sfc : SFC implementation using the OVSDB project.
-- ovs-sfc : SFC implementation using the OVSDB project. Currently it is just a shell.
-
-- plugin : Contains Opendaylight Southbound Plugin APIs and provides a simpler API interface on top of library layer.
- Ideally, this module should also be schema independent. But due to legacy reasons this layer contains some
- deprecated functionality that assumes openvswitch schema.
-
-- plugin-mdsal-adapter : Adds an MD-SAL Adapter for the OVSDB Plugin. The adapter updates the MD-SAL with nodes
- as they are added and removed from the inventory. The Yang model provides a reference
- between OVSDB nodes and the OpenFlow nodes (bridges) that they manage.
-
-- plugin-shell : Contains a Karaf shell framework for OVSDB plugin and printCache command-line.
+- ovsdb-ui : Contains the DLUX implementation for displaying network virtualization
- resources : Contains some useful resources such as scripts, testing utilities and tools used for deployment
or testing the binaries generated from the OVSDB project.
-- schemas :
- +-- openvswitch : Schema wrapper that represents http://openvswitch.org/ovs-vswitchd.conf.db.5.pdf
- +-- hardwarevtep: Schema wrapper that represents http://openvswitch.org/docs/vtep.5.pdf
-
- utils : MD-SAL OpenFlow and OVSDB common utilities.
HOW TO BUILD & RUN
Pre-requisites : JDK 1.7+, Maven 3+
1. Building a Karaf Feature and deploying it in an Opendaylight Karaf distribution :
- 1. This is a new method for Opendaylight distribution wherein there is no defined editions such
- as Base, Virtualization or SP editions. The end-customer can choose to deploy the required feature
- based on his/her deployment needs.
-
- 2. From the root ovsdb/ directory, execute "mvn clean install"
+ 1. From the root ovsdb/ directory, execute "mvn clean install"
- 3. Next unzip the distribution-karaf-<VERSION_NUMBER>-SNAPSHOT.zip file created from step #2 in
- the directory ovsdb/distribution/opendaylight-karaf/target like so:
- "unzip distribution-karaf-<VERSION_NUMBER>-SNAPSHOT.zip"
+ 2. Unzip the karaf-<VERSION_NUMBER>-SNAPSHOT.zip file created from step 1 in the directory ovsdb/karaf/target/:
+ "unzip karaf-<VERSION_NUMBER>-SNAPSHOT.zip"
- 4. Once karaf has started and you see the Opendaylight ascii art in the console, the last step
+ 3. Once karaf has started and you see the Opendaylight ascii art in the console, the last step
is to start the OVSDB plugin framework with the following command in the karaf console:
"feature:install odl-ovsdb-openstack" (without quotation marks).
Sample output from Karaf console :
- opendaylight-user@root>feature:list | grep -i ovsdb
- odl-ovsdb-library | 1.0.0-SNAPSHOT | x | ovsdb-1.0.0-SNAPSHOT | OVSDB :: Library
- odl-ovsdb-schema-openvswitch | 1.0.0-SNAPSHOT | x | ovsdb-1.0.0-SNAPSHOT | OVSDB :: Schema :: Open_vSwitch
- odl-ovsdb-schema-hardwarevtep | 1.0.0-SNAPSHOT | x | ovsdb-1.0.0-SNAPSHOT | OVSDB :: Schema :: hardware_vtep
- odl-ovsdb-openstack | 1.0.0-SNAPSHOT | x | ovsdb-1.0.0-SNAPSHOT | OpenDaylight :: OVSDB :: OpenStack Network Virtual
- odl-ovsdb-ovssfc | 0.0.1-SNAPSHOT | | ovsdb-0.0.1-SNAPSHOT | OpenDaylight :: OVSDB :: OVS Service Function Chai
-
+ opendaylight-user@root>feature:list -i | grep ovsdb
+ odl-ovsdb-southbound-api | 1.2.1-SNAPSHOT | x | odl-ovsdb-southbound-1.2.1-SNAPSHOT | OpenDaylight :: southbound :: api
+ odl-ovsdb-southbound-impl | 1.2.1-SNAPSHOT | x | odl-ovsdb-southbound-1.2.1-SNAPSHOT | OpenDaylight :: southbound :: impl
+ odl-ovsdb-southbound-impl-rest | 1.2.1-SNAPSHOT | x | odl-ovsdb-southbound-1.2.1-SNAPSHOT | OpenDaylight :: southbound :: impl :: REST
+ odl-ovsdb-southbound-impl-ui | 1.2.1-SNAPSHOT | x | odl-ovsdb-southbound-1.2.1-SNAPSHOT | OpenDaylight :: southbound :: impl :: UI
+ odl-ovsdb-library | 1.2.1-SNAPSHOT | x | odl-ovsdb-library-1.2.1-SNAPSHOT | OpenDaylight :: library
+ odl-ovsdb-openstack | 1.2.1-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OpenDaylight :: OVSDB :: OpenStack Network Virtual
2. Building a bundle and deploying it in an Opendaylight Karaf distribution :
This method can be used to update and test new code in a bundle. If the bundle of interest is rebuilt as a
4. karaf will see the changed bundle and reload it.
-
-3. Building an OVSDB based Opendaylight Virtualization edition:
- 1. This is the legacy way to build and distribute Opendaylight archives. This method was
- followed in Hydrogen. It might still work in Helium but it is best effort for support.
- The preferred method for Helium and later is to use karaf.
-
- 2. From the root folder(that hosts this README), execute "mvn clean install"
- That should build a full distribution archive and distribution directory that will contain
- Opendaylight Controller + OVSDB bundles + Openflow Plugins under
- distribution/opendaylight/target/distribution.ovsdb-X.X.X-osgipackage
-
- 3. Upon successful completion of a build, the Controller with OVSDB can be executed by :
- cd distribution/opendaylight/target/distribution.ovsdb-X.X.X-osgipackage/opendaylight/
- ./run.sh -virt ovsdb
-
-4. Building a Karaf Feature and deploying it in an Opendaylight Karaf distribution :
-*** This method is deprecated.
- 1. This is a new method for Opendaylight distribution wherein there is no defined editions such
- as Base, Virtualization or SP editions. Rather each of the projects will generate features in
- form of .kar files. The end-customer can choose to deploy the required feature based on his/her
- deployment needs.
-
- 2. From the features/ directory, execute "mvn clean install"
- This will generate a kar file such as "features/target/ovsdb-features-1.2.1-SNAPSHOT.kar"
-
- 3. Download (or build from controller project) the Karaf distribution :
- http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/controller/distribution.opendaylight-karaf/
- Sample zip file :
- http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/controller/distribution.opendaylight-karaf/1.4.2-SNAPSHOT/distribution.opendaylight-karaf-1.4.2-20140718.075612-407.zip
-
- 4. unzip the downloaded (or built) distribution and copy the ovsdb-features-x.x.x.kar file (from step 2) into
- the unzipped distribution.opendaylight-karaf-X.X.X/deploy/ directory.
-
- 5. run Karaf from within the distribution.opendaylight-karaf-X.X.X/ directory using "bin/karaf"
-
- Sample output from Karaf console :
-
- opendaylight-user@root>kar:list
- KAR Name
- -----------------------------
- ovsdb-features-1.2.1-SNAPSHOT
-
- opendaylight-user@root>feature:list | grep ovsdb
- odl-ovsdb-library | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OVSDB :: Library
- odl-ovsdb-schema-openvswitch | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OVSDB :: Schema :: Open_vSwitch
- odl-ovsdb-schema-hardwarevtep | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OVSDB :: Schema :: hardware_vtep
- odl-ovsdb-plugin | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OpenDaylight :: OVSDB :: Plugin
-
- opendaylight-user@root>bundle:list | grep OVSDB
- 186 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB Library
- 199 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB Open_vSwitch Schema
- 200 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB hardware_vtep Schema
- 201 | Active | 80 | 1.0.0.SNAPSHOT | OpenDaylight OVSDB Plugin
-
Running The Integration Tests
=============================
To run the integration tests locally the following components are required:
- Docker
- - Fig or Docker Compose
+ - Docker Compose
To install docker, follow the installation guide for your platform:
http://docs.docker.com/installation/
-To install fig:
- http://www.fig.sh/install.html
-
To install Docker Compose:
http://docs.docker.com/compose/install/
mvn clean install
# The first time you need to set everything up
- fig up -d
+ docker-compose up -d
# Later runs only need the containers to be started
- fig start
+ docker-compose start
# OSX
mvn verify -Pintegrationtest -Dovsdbserver.ipaddress=$(boot2docker ip 2>/dev/null) -Dovsdbserver.port=6640
# Linux
- mvn verify -Pintegrationtest -Dovsdbserver.ipaddress=127.0.0.1 -Dovsdbserver.port=6640
- fig stop
+ mvn verify -Pintegrationtest -Dovsdbserver.ipaddress=127.0.0.1 -Dovsdbserver.port=6640 -Dovsdb.controller.address=<addr of docker interface> -Dovsdb.userspace.enabled=yes
+ docker-compose stop
On Linux you'll generally need to run fig as root (sudo fig ...).
-If you're using Docker Compose, replace "fig" above with "docker-compose" and ignore the warnings.
+Running the docker image manually:
+ sudo docker run -itd --cap-add NET_ADMIN -p 6640:6640 jhershbe/centos7-ovs:latest
Skipping unit tests and karaf tests
====================
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>it</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>parents</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
ovs:
- image: davetucker/docker-ovs:2.1.2
- ports:
+ image: jhershbe/centos7-ovs:2.5.1
+ ports:
- "6640:6640"
command: "/usr/bin/supervisord -n"
privileged: true
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>features-ovsdb</artifactId>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>features-netvirt</artifactId>
<version>1.3.0-SNAPSHOT</version>
- <packaging>pom</packaging>
+ <packaging>jar</packaging>
<description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
<licenses>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<properties>
- <odl.karaf.base.version>1.7.0-SNAPSHOT</odl.karaf.base.version>
+ <dlux.version>0.4.0-SNAPSHOT</dlux.version>
<controller.mdsal.version>1.4.0-SNAPSHOT</controller.mdsal.version>
<mdsal.model.version>0.9.0-SNAPSHOT</mdsal.model.version>
- <restconf.version>1.4.0-SNAPSHOT</restconf.version>
<neutron.version>0.7.0-SNAPSHOT</neutron.version>
+ <odl.karaf.base.version>1.7.0-SNAPSHOT</odl.karaf.base.version>
<openflowplugin.version>0.3.0-SNAPSHOT</openflowplugin.version>
+ <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
+ <restconf.version>1.4.0-SNAPSHOT</restconf.version>
<yangtools.version>1.0.0-SNAPSHOT</yangtools.version>
- <dlux.version>0.4.0-SNAPSHOT</dlux.version>
</properties>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yangtools-artifacts</artifactId>
- <version>${yangtools.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>mdsal-artifacts</artifactId>
- <version>${controller.mdsal.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
<dependencies>
- <!-- controller dependencies -->
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>features-mdsal</artifactId>
+ <version>${controller.mdsal.version}</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<version>${mdsal.model.version}</version>
<classifier>features</classifier>
<type>xml</type>
- <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<version>${restconf.version}</version>
<classifier>features</classifier>
<type>xml</type>
- <scope>runtime</scope>
</dependency>
- <!-- external dependencies -->
<!-- TODO clean up based on what is provided by odlparent -->
<dependency>
<groupId>org.osgi</groupId>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
- <!-- neutron dependencies -->
<dependency>
<groupId>org.opendaylight.neutron</groupId>
<artifactId>features-neutron</artifactId>
<classifier>features</classifier>
<type>xml</type>
</dependency>
- <!-- openflowplugin dependencies -->
<dependency>
<groupId>org.opendaylight.openflowplugin</groupId>
<artifactId>features-openflowplugin</artifactId>
<classifier>features</classifier>
<type>xml</type>
</dependency>
-
- <!-- openflowplugin dependencies for net-virt clustering-->
<dependency>
<groupId>org.opendaylight.openflowplugin</groupId>
<artifactId>features-openflowplugin-li</artifactId>
<classifier>features</classifier>
<type>xml</type>
</dependency>
-
- <!-- project specific dependencies -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>openstack.net-virt</artifactId>
<classifier>config</classifier>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.ovsdb</groupId>
<artifactId>schema.openvswitch</artifactId>
- <version>${project.version}</version>
+ <version>${ovsdb.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.ovsdb</groupId>
<artifactId>schema.hardwarevtep</artifactId>
- <version>${project.version}</version>
+ <version>${ovsdb.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>ovsdb-ui-bundle</artifactId>
- <version>${project.version}</version>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${ovsdb.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>southbound-features</artifactId>
+ <artifactId>utils.it-utils</artifactId>
<version>${project.version}</version>
- <type>xml</type>
- <classifier>features</classifier>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>library-features</artifactId>
+ <artifactId>ovsdb-ui-bundle</artifactId>
<version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>southbound-features</artifactId>
+ <version>${ovsdb.version}</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>hwvtepsouthbound-features</artifactId>
+ <artifactId>hwgw</artifactId>
<version>${project.version}</version>
<type>xml</type>
+ <classifier>config</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>hwvtepsouthbound-features</artifactId>
+ <version>${ovsdb.version}</version>
+ <type>xml</type>
<classifier>features</classifier>
</dependency>
- <!-- DLUX dependency for the UI -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>neutron</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>neutron</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>config</classifier>
+ </dependency>
<dependency>
<groupId>org.opendaylight.dlux</groupId>
<artifactId>features-dlux</artifactId>
<features name="ovsdb-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+ <repository>mvn:org.opendaylight.controller/features-mdsal/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.dlux/features-dlux/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.netconf/features-restconf/{{VERSION}}/xml/features</repository>
<repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin-extension/{{VERSION}}/xml/features</repository>
<repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin/{{VERSION}}/xml/features</repository>
<repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin-extension-li/{{VERSION}}/xml/features</repository>
<repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin-li/{{VERSION}}/xml/features</repository>
<repository>mvn:org.opendaylight.neutron/features-neutron/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.ovsdb/southbound-features/1.3.0-SNAPSHOT/xml/features</repository>
- <repository>mvn:org.opendaylight.controller/features-mdsal/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.ovsdb/library-features/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.dlux/features-dlux/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.netconf/features-restconf/{{VERSION}}/xml/features</repository>
<repository>mvn:org.opendaylight.ovsdb/hwvtepsouthbound-features/{{VERSION}}/xml/features</repository>
-
- <feature name="odl-ovsdb-schema-openvswitch" description="OVSDB :: Schema :: Open_vSwitch"
- version='${project.version}'>
- <feature version="${project.version}">odl-ovsdb-library</feature>
- <bundle>mvn:org.opendaylight.ovsdb/schema.openvswitch/{{VERSION}}</bundle>
- </feature>
-
- <feature name="odl-ovsdb-schema-hardwarevtep" description="OVSDB :: Schema :: hardware_vtep"
- version='${project.version}'>
- <feature version="${project.version}">odl-ovsdb-library</feature>
- <bundle>mvn:org.opendaylight.ovsdb/schema.hardwarevtep/{{VERSION}}</bundle>
- </feature>
+ <repository>mvn:org.opendaylight.ovsdb/southbound-features/{{VERSION}}/xml/features</repository>
<feature name="odl-ovsdb-openstack" description="OpenDaylight :: OVSDB :: OpenStack Network Virtualization"
version='${project.version}'>
<feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
<feature version="${openflowplugin.version}">odl-openflowplugin-nsf-model</feature>
<feature version="${neutron.version}">odl-neutron-service</feature>
- <feature version="${project.version}">odl-ovsdb-southbound-impl-ui</feature>
+ <feature version="${ovsdb.version}">odl-ovsdb-southbound-impl</feature>
<feature version="${openflowplugin.version}">odl-openflowplugin-southbound</feature>
<feature version="${openflowplugin.version}">odl-openflowplugin-nsf-services</feature>
<feature version="${openflowplugin.version}">odl-openflowplugin-nxm-extensions</feature>
- <bundle>mvn:org.opendaylight.ovsdb/utils.servicehelper/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.ovsdb/utils.neutron-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.servicehelper/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.neutron-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.mdsal-utils/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt-providers/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/openstack.net-virt/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/openstack.net-virt-providers/{{VERSION}}</bundle>
<bundle>mvn:commons-net/commons-net/{{VERSION}}</bundle>
- <configfile finalname="etc/opendaylight/karaf/netvirt-impl-default-config.xml">mvn:org.opendaylight.ovsdb/openstack.net-virt/{{VERSION}}/xml/config</configfile>
- <configfile finalname="etc/opendaylight/karaf/netvirt-providers-impl-default-config.xml">mvn:org.opendaylight.ovsdb/openstack.net-virt-providers/{{VERSION}}/xml/config</configfile>
+ <configfile finalname="etc/opendaylight/karaf/netvirt-impl-default-config.xml">mvn:org.opendaylight.netvirt/openstack.net-virt/{{VERSION}}/xml/config</configfile>
+ <configfile finalname="etc/opendaylight/karaf/netvirt-providers-impl-default-config.xml">mvn:org.opendaylight.netvirt/openstack.net-virt-providers/{{VERSION}}/xml/config</configfile>
+ </feature>
+
+ <feature name="odl-ovsdb-openstack-it" description="OpenDaylight :: OVSDB :: OpenStack Network Virtualization IT"
+ version='${project.version}'>
+ <feature version="${project.version}">odl-ovsdb-openstack</feature>
+ <bundle>mvn:org.opendaylight.netvirt/utils.it-utils/{{VERSION}}</bundle>
</feature>
<feature name="odl-ovsdb-openstack-clusteraware" description="OpenDaylight :: OVSDB :: OpenStack Network Virtualization - Cluster Aware"
<feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
<feature version="${openflowplugin.version}">odl-openflowplugin-nsf-model-li</feature>
<feature version="${neutron.version}">odl-neutron-service</feature>
- <feature version="${project.version}">odl-ovsdb-southbound-impl-ui</feature>
+ <feature version="${ovsdb.version}">odl-ovsdb-southbound-impl</feature>
<feature version="${openflowplugin.version}">odl-openflowplugin-flow-services-li</feature>
<feature version="${openflowplugin.version}">odl-openflowplugin-nxm-extensions-li</feature>
- <bundle>mvn:org.opendaylight.ovsdb/utils.servicehelper/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.ovsdb/utils.neutron-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.servicehelper/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.neutron-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.mdsal-utils/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
<bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt-providers/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/openstack.net-virt/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/openstack.net-virt-providers/{{VERSION}}</bundle>
<bundle>mvn:commons-net/commons-net/{{VERSION}}</bundle>
- <configfile finalname="etc/opendaylight/karaf/netvirt-impl-default-config.xml">mvn:org.opendaylight.ovsdb/openstack.net-virt/{{VERSION}}/xml/config</configfile>
- <configfile finalname="etc/opendaylight/karaf/netvirt-providers-impl-default-config.xml">mvn:org.opendaylight.ovsdb/openstack.net-virt-providers/{{VERSION}}/xml/config</configfile>
+ <configfile finalname="etc/opendaylight/karaf/netvirt-impl-default-config.xml">mvn:org.opendaylight.netvirt/openstack.net-virt/{{VERSION}}/xml/config</configfile>
+ <configfile finalname="etc/opendaylight/karaf/netvirt-providers-impl-default-config.xml">mvn:org.opendaylight.netvirt/openstack.net-virt-providers/{{VERSION}}/xml/config</configfile>
</feature>
<feature name="odl-ovsdb-ui" description="OpenDaylight :: OVSDB :: DLUX Integration Plugin" version='${project.version}'>
<feature version="${dlux.version}">odl-dlux-core</feature>
- <bundle>mvn:org.opendaylight.ovsdb/ovsdb-ui-bundle/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/ovsdb-ui-bundle/{{VERSION}}</bundle>
</feature>
+
<feature name='odl-netvirt-api' version='${project.version}' description='OpenDaylight :: netvirt :: api'>
<feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
- <bundle>mvn:org.opendaylight.ovsdb/netvirt-api/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/netvirt-api/{{VERSION}}</bundle>
</feature>
+
<feature name='odl-netvirt-rest' version='${project.version}' description='OpenDaylight :: netvirt :: REST'>
<feature version="${project.version}">odl-netvirt-api</feature>
<feature version="${restconf.version}">odl-restconf</feature>
</feature>
+
<feature name='odl-netvirt-ui' version='${project.version}' description='OpenDaylight :: netvirt :: UI'>
<feature version="${project.version}">odl-netvirt-rest</feature>
<feature version="${restconf.version}">odl-mdsal-apidocs</feature>
<feature version="${controller.mdsal.version}">odl-mdsal-xsql</feature>
</feature>
+
<feature name='odl-netvirt-hwgw' version='${project.version}' description='OpenDaylight :: netvirt :: Hardware Gateway'>
<feature version="${project.version}">odl-netvirt-api</feature>
- <feature version='${project.version}'>odl-ovsdb-hwvtepsouthbound</feature>
- <bundle>mvn:org.opendaylight.ovsdb/hwgw/{{VERSION}}</bundle>
+ <feature version='${ovsdb.version}'>odl-ovsdb-hwvtepsouthbound</feature>
+ <bundle>mvn:org.opendaylight.netvirt/hwgw/{{VERSION}}</bundle>
+ <configfile finalname="etc/opendaylight/karaf/hwgw-default-config.xml">mvn:org.opendaylight.netvirt/hwgw/{{VERSION}}/xml/config</configfile>
+ </feature>
+
+ <feature name='odl-netvirt-neutron' version='${project.version}' description='OpenDaylight :: netvirt :: Neutron Renderer'>
+ <feature version="${neutron.version}">odl-neutron-service</feature>
+ <feature version="${project.version}">odl-netvirt-ui</feature>
+ <bundle>mvn:org.opendaylight.netvirt/neutron/{{VERSION}}</bundle>
+ <configfile finalname="etc/opendaylight/karaf/netvirt-neutron-default-config.xml">mvn:org.opendaylight.netvirt/neutron/{{VERSION}}/xml/config</configfile>
</feature>
+ <feature name='odl-netvirt-it' version='${project.version}' description='OpenDaylight :: netvirt :: IT'>
+ <feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
+ <feature version="${neutron.version}">odl-neutron-service</feature>
+ <feature version="${project.version}">odl-netvirt-neutron</feature>
+ <feature version="${ovsdb.version}">odl-ovsdb-southbound-api</feature>
+ <bundle>mvn:org.opendaylight.netvirt/utils.it-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.mdsal-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.neutron-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.servicehelper/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/{{VERSION}}</bundle>
+ </feature>
</features>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>karaf</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>ovsdb-artifacts</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>southbound-artifacts</artifactId>
+ <artifactId>netvirt-artifacts</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>features-ovsdb</artifactId>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>southbound-features</artifactId>
+ <artifactId>features-netvirt</artifactId>
+ <version>${project.version}</version>
<classifier>features</classifier>
<type>xml</type>
<scope>runtime</scope>
<scope>runtime</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <!-- DO NOT deploy the karaf artifact -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>ovsdb-artifacts</artifactId>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>netvirt-artifacts</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>features-ovsdb</artifactId>
+ <artifactId>features-netvirt</artifactId>
<version>${project.version}</version>
<classifier>features</classifier>
<type>xml</type>
<relativePath/>
</parent>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types-20130715</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>opendaylight-l2-types</artifactId>
+ </dependency>
+ </dependencies>
+
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>netvirt-api</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
--- /dev/null
+module netvirt-common {
+ yang-version 1;
+ namespace "urn:opendaylight:netvirt:common";
+ prefix "common";
+
+ revision "2015-12-27" {
+ description "Initial revision of netvirt common attributes";
+ }
+
+ import ietf-yang-types { prefix yang; }
+
+ identity network-type-base {
+ description "Base network type";
+ }
+
+ identity network-type-flat {
+ base network-type-base;
+ description "network type flat";
+ }
+
+ identity network-type-gre {
+ base network-type-base;
+ description "network type gre";
+ }
+
+ identity network-type-vlan {
+ base network-type-base;
+ description "network type vlan";
+ }
+
+ identity network-type-vxlan {
+ base network-type-base;
+ description "network type vxlan";
+ }
+
+ identity network-type-vxlan-gpe {
+ base network-type-base;
+ description "network type vxlan-gpe";
+ }
+
+ typedef network-type {
+ type identityref {
+ base network-type-base;
+ }
+ description "This type is used to refer to a network Type.";
+ }
+
+ grouping base-attributes {
+ leaf uuid {
+ type yang:uuid;
+ description "UUID to index this object.";
+ }
+
+ leaf name {
+ type string;
+ description "Optional human-readable name for the item. Might not be unique.";
+ }
+
+ leaf description {
+ type string;
+ description "Optional human-readable description for the item. Might not be unique.";
+ }
+
+ list other-config {
+ description "This is used to store information needed by the renderer(s). In general,
+ it might be used as a cookie to relate external objects or configuration with
+ the given NetVirt objed. For example, we may store neutron logical port
+ information here so that the OVS southbound renderer can match up the port
+ reported by OVSDB with the Neutron port configured by Neutron.";
+ key config-key;
+ leaf config-key {
+ description "Key to identify the piece of config info.
+ This needs to be unique both within and between renderers.
+ Format: <renderer-name>:<renderer-unique-key>";
+ type string;
+ }
+ leaf config-value {
+ type string;
+ }
+ }
+ }
+
+ grouping admin-attributes {
+ leaf admin-state-up {
+ type boolean;
+ description "The administrative state of the object, which is up (true) or down (false).";
+ }
+ leaf status {
+ type string;
+ description "The object status.";
+ }
+ }
+
+ grouping device-locator-ref {
+ leaf device-uuid {
+ type yang:uuid;
+ description "Reference to the the device for this port";
+ }
+
+ leaf device-locator-uuid {
+ type yang:uuid;
+ description "Reference to the the device locator for this port";
+ }
+ }
+}
--- /dev/null
+module netvirt-devices {
+ yang-version 1;
+ namespace "urn:opendaylight:netvirt:devices";
+ prefix "devices";
+
+ revision "2015-12-27" {
+ description "Initial revision of netvirt devices definition";
+ }
+
+ import ietf-yang-types { prefix yang; }
+ import ietf-inet-types { prefix inet; }
+ import netvirt-common { prefix "common"; }
+ import opendaylight-l2-types { prefix l2types; }
+
+
+
+ grouping flat-attributes {
+ }
+
+ grouping vlan-attributes {
+ }
+
+ grouping gre-attributes {
+ leaf ip-addr {
+ type inet:ip-address;
+ }
+ leaf port {
+ type inet:port-number;
+ }
+ }
+
+ grouping vxlan-attributes {
+ leaf ip-addr {
+ type inet:ip-address;
+ }
+ leaf port {
+ type inet:port-number;
+ }
+ }
+
+ grouping vxlan-gpe-attributes {
+ leaf ip-addr {
+ type inet:ip-address;
+ }
+ leaf port {
+ type inet:port-number;
+ }
+ }
+
+ grouping device-locator {
+ uses common:base-attributes;
+
+ leaf locator-type {
+ type common:network-type;
+ }
+
+ choice locator-attr {
+ case flat {
+ uses flat-attributes;
+ }
+ case vlan {
+ uses vlan-attributes;
+ }
+ case gre {
+ uses gre-attributes;
+ }
+ case vxlan {
+ uses vxlan-attributes;
+ }
+ case vxlan-gpe {
+ uses vxlan-gpe-attributes;
+ }
+ }
+ }
+
+ grouping device {
+ uses common:base-attributes;
+
+ leaf device-type {
+ type enumeration {
+ enum ovs;
+ enum hwgw;
+ }
+ }
+
+ // TODO: Need to look at info needed per bridge.
+ list bridges {
+ leaf name {
+ type string;
+ }
+ }
+
+ list device-locators {
+ key uuid;
+ uses device-locator;
+ }
+ }
+
+ container devices {
+ list device {
+ key uuid;
+ uses device;
+ }
+ }
+}
--- /dev/null
+module netvirt-l2-networks {
+ yang-version 1;
+ namespace "urn:opendaylight:netvirt:l2-networks";
+ prefix "l2-networks";
+
+ revision "2015-12-27" {
+ description "Initial revision of netvirt l2-networks definition";
+ }
+
+ import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+ import ietf-yang-types { prefix yang; }
+ import netvirt-common { prefix "common"; }
+
+ container l2-networks {
+ list l2-network {
+ uses common:base-attributes;
+ uses common:admin-attributes;
+
+ description "Description: Logical Layer 2 Networks. E.g., a Neutron Network. Typically, an l2-network
+ defines an L2 broadcast domain and, unless otherwise prohibited, endpoints attached to ports
+ on an l2-network can communicate with each other. All l2-network are independent, and
+ communication between l2-network is only allowed via other means, such as through an
+ l3-router.";
+
+ key uuid;
+
+ leaf network-type {
+ type common:network-type;
+ description "The type of physical network that maps to this network resource.";
+ }
+
+ leaf segmentation-id {
+ type string;
+ description "An isolated segment on the physical network. The network-type
+ attribute defines the segmentation model. For example, if network-type
+ is vlan, this ID is a vlan identifier. If network-type is gre,
+ this ID is a gre key.";
+ }
+
+ leaf shared {
+ type boolean;
+ default "false";
+ description "Indicates whether this network or subnet is shared across all
+ tenants. By default, only administrative users can change this
+ value.";
+ }
+
+ list device-locators {
+ uses common:device-locator-ref;
+ }
+ }
+ }
+}
--- /dev/null
+module netvirt-ports {
+ yang-version 1;
+ namespace "urn:opendaylight:netvirt:ports";
+ prefix "ports";
+
+ revision "2015-12-27" {
+ description "Initial revision of netvirt ports definition";
+ }
+
+ import ietf-inet-types { prefix inet; }
+ import ietf-yang-types { prefix yang; }
+ import netvirt-common { prefix "common"; }
+
+
+ identity port-type-base {
+ description "Base port type";
+ }
+
+ identity port-type-l2-network {
+ base port-type-base;
+ description "port type l2-network";
+ }
+
+ identity port-type-router {
+ base port-type-base;
+ description "port type router";
+ }
+
+ typedef port-type {
+ type identityref {
+ base port-type-base;
+ }
+ description "This type is used to refer to an port Type.";
+ }
+
+ identity port-binding-type-base {
+ description "Base port-binding type";
+ }
+
+ identity port-binding-type-vlan {
+ base port-binding-type-base;
+ description "port-binding type vlan";
+ }
+
+ identity port-binding-type-vxlan {
+ base port-binding-type-base;
+ description "port-binding type vxlan";
+ }
+
+ typedef port-binding-type {
+ type identityref {
+ base port-binding-type-base;
+ }
+ description "The port binding is used to bind one port to another in a hierarchical.";
+ }
+
+ grouping end-point {
+ uses common:base-attributes;
+
+ leaf macaddr {
+ type yang:mac-address;
+ description "MAC address entry";
+ }
+
+ leaf-list ipaddrs {
+ description "Mechanism used to bind ports.";
+ type inet:ip-address;
+ }
+ }
+
+ grouping parent-port-binding {
+ description "Optional. Used to bind one port to another hierarchically. For example, a port
+ binding may be used to support multiple containers in a single VM. In this model
+ each container could use a VLAN-based sub-port on a single tap port.";
+
+ leaf type {
+ description "How is this port bound to the other. E.g., VLAN";
+ type port-binding-type;
+ }
+
+ leaf id {
+ description "Depends on binding type. E.g., if the type is VLAN, this would be the VLAN ID";
+ type string;
+ }
+
+ leaf parent-port {
+ description "Must be the UUID of another port.";
+ type yang:uuid;
+ }
+ }
+
+ grouping port {
+ uses common:base-attributes;
+ uses common:admin-attributes;
+
+ leaf port-type {
+ type port-type;
+ description "The type of port.";
+ }
+
+ leaf parent {
+ type yang:uuid;
+ description "The UUID of the object this port is a member of. For example, if the type is
+ port-type-l2-network, this will be the UUID of the l2-network";
+ }
+
+ uses parent-port-binding;
+
+ // TODO: Can we use a leafref for the device locator?
+ leaf device-uuid {
+ type yang:uuid;
+ description "Reference to the the device for this port";
+ }
+
+ leaf device-locator-uuid {
+ type yang:uuid;
+ description "Reference to the the device locator for this port";
+ }
+
+ list end-points {
+
+ key macaddr;
+
+ uses end-point;
+ }
+ }
+
+ container ports {
+ list port {
+ description "List of ports. Each port entry contains both logical and physical information.";
+
+ key uuid;
+ uses port;
+ }
+ }
+}
module netvirt {
yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:netvirt";
+ namespace "urn:opendaylight:netvirt";
prefix "netvirt";
revision "2015-12-27" {
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2016 Red Hat, Inc. and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>it</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ <relativePath>../../commons/it</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>netvirt-it</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <properties>
+ <controller.mdsal.version>1.4.0-SNAPSHOT</controller.mdsal.version>
+ <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
+ <karaf.distro.groupId>org.opendaylight.ovsdb</karaf.distro.groupId>
+ <karaf.distro.artifactId>karaf</karaf.distro.artifactId>
+ <karaf.distro.version>${project.version}</karaf.distro.version>
+ <karaf.distro.type>zip</karaf.distro.type>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-common-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>features-netvirt</artifactId>
+ <version>${project.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>southbound-api</artifactId>
+ <version>${ovsdb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.it-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.neutron-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${ovsdb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>utils.southbound-utils</artifactId>
+ <version>${ovsdb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.sonar-plugins.java</groupId>
+ <artifactId>sonar-jacoco-listeners</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <!--<excludes>
+ <exclude>**/NetvirtIT.java</exclude>
+ </excludes>-->
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
--- /dev/null
+/*
+ * Copyright © 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.netvirt.it;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.propagateSystemProperties;
+import static org.ops4j.pax.exam.CoreOptions.vmOption;
+import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
+import static org.ops4j.pax.exam.MavenUtils.asInProject;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.neutron.spi.NeutronNetwork;
+import org.opendaylight.netvirt.utils.it.utils.ItConstants;
+import org.opendaylight.netvirt.utils.it.utils.ItUtils;
+import org.opendaylight.netvirt.utils.neutron.utils.NeutronModelsDataStoreHelper;
+import org.opendaylight.netvirt.utils.neutron.utils.NeutronUtils;
+import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener;
+import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.karaf.options.LogLevelOption;
+import org.ops4j.pax.exam.options.MavenUrlReference;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class NetvirtIT extends AbstractMdsalTestBase {
+ private static final Logger LOG = LoggerFactory.getLogger(NetvirtIT.class);
+ private static final String FEATURE = "odl-netvirt-it";
+ private static DataBroker dataBroker = null;
+ private static ItUtils itUtils;
+ private static String addressStr;
+ private static String portStr;
+ private static String connectionType;
+ private static String controllerStr;
+ private static AtomicBoolean setup = new AtomicBoolean(false);
+ private static MdsalUtils mdsalUtils = null;
+ private static SouthboundUtils southboundUtils;
+ private static NeutronUtils neutronUtils = new NeutronUtils();
+ private static NeutronModelsDataStoreHelper neutronModelsDataStoreHelper;
+ private static final String NETWORK_TYPE_VXLAN = "vxlan";
+
+ @Override
+ public String getModuleName() {
+ return "netvirt-neutron";
+ }
+
+ @Override
+ public String getInstanceName() {
+ return "netvirt-neutron-default";
+ }
+
+ @Override
+ public MavenUrlReference getFeatureRepo() {
+ return maven()
+ .groupId("org.opendaylight.netvirt")
+ .artifactId("features-netvirt")
+ .classifier("features")
+ .type("xml")
+ .versionAsInProject();
+ }
+
+ @Override
+ public String getFeatureName() {
+ return FEATURE;
+ }
+
+ @Configuration
+ @Override
+ public Option[] config() {
+ Option[] parentOptions = super.config();
+ Option[] propertiesOptions = getPropertiesOptions();
+ Option[] otherOptions = getOtherOptions();
+ Option[] options = new Option[parentOptions.length + propertiesOptions.length + otherOptions.length];
+ System.arraycopy(parentOptions, 0, options, 0, parentOptions.length);
+ System.arraycopy(propertiesOptions, 0, options, parentOptions.length, propertiesOptions.length);
+ System.arraycopy(otherOptions, 0, options, parentOptions.length + propertiesOptions.length,
+ otherOptions.length);
+ return options;
+ }
+
+ private Option[] getOtherOptions() {
+ return new Option[] {
+ wrappedBundle(
+ mavenBundle("org.opendaylight.netvirt", "utils.mdsal-openflow")
+ .version(asInProject())
+ .type("jar")),
+ configureConsole().startLocalConsole(),
+ //vmOption("-verbose:class"),
+ vmOption("-javaagent:../jars/org.jacoco.agent.jar=destfile=../../jacoco-it.exec"),
+ keepRuntimeFolder()
+ };
+ }
+
+ private Option[] getPropertiesOptions() {
+ return new Option[] {
+ propagateSystemProperties(ItConstants.SERVER_IPADDRESS, ItConstants.SERVER_PORT,
+ ItConstants.CONNECTION_TYPE, ItConstants.CONTROLLER_IPADDRESS,
+ ItConstants.USERSPACE_ENABLED),
+ };
+ }
+
+ @Override
+ public Option getLoggingOption() {
+ return composite(
+ editConfigurationFilePut(ItConstants.ORG_OPS4J_PAX_LOGGING_CFG,
+ "log4j.logger.org.opendaylight.ovsdb",
+ LogLevelOption.LogLevel.TRACE.name()),
+ editConfigurationFilePut(ItConstants.ORG_OPS4J_PAX_LOGGING_CFG,
+ logConfiguration(NetvirtIT.class),
+ LogLevelOption.LogLevel.INFO.name()),
+ editConfigurationFilePut(ItConstants.ORG_OPS4J_PAX_LOGGING_CFG,
+ "log4j.logger.org.opendaylight.neutron",
+ LogLevelOption.LogLevel.TRACE.name()),
+ super.getLoggingOption());
+ }
+
+ protected String usage() {
+ return "Integration Test needs a valid connection configuration as follows :\n"
+ + "active connection : mvn -Dovsdbserver.ipaddress=x.x.x.x -Dovsdbserver.port=yyyy verify\n"
+ + "passive connection : mvn -Dovsdbserver.connection=passive verify\n";
+ }
+
+ private void getProperties() {
+ Properties props = System.getProperties();
+ addressStr = props.getProperty(ItConstants.SERVER_IPADDRESS);
+ portStr = props.getProperty(ItConstants.SERVER_PORT, ItConstants.DEFAULT_SERVER_PORT);
+ connectionType = props.getProperty(ItConstants.CONNECTION_TYPE, "active");
+ controllerStr = props.getProperty(ItConstants.CONTROLLER_IPADDRESS, "0.0.0.0");
+ String userSpaceEnabled = props.getProperty(ItConstants.USERSPACE_ENABLED, "no");
+ LOG.info("setUp: Using the following properties: mode= {}, ip:port= {}:{}, controller ip: {}, " +
+ "userspace.enabled: {}",
+ connectionType, addressStr, portStr, controllerStr, userSpaceEnabled);
+ if (connectionType.equalsIgnoreCase(ItConstants.CONNECTION_TYPE_ACTIVE)) {
+ if (addressStr == null) {
+ fail(usage());
+ }
+ }
+ }
+
+ @After
+ public void teardown() {
+ closeWaitFors();
+ }
+
+ @Before
+ @Override
+ public void setup() throws InterruptedException {
+ if (setup.get()) {
+ LOG.info("Skipping setUp, already initialized");
+ return;
+ }
+
+ try {
+ super.setup();
+ } catch (Exception e) {
+ LOG.warn("Failed to setup test", e);
+ fail("Failed to setup test: " + e);
+ }
+
+ getProperties();
+
+ if (connectionType.equalsIgnoreCase(ItConstants.CONNECTION_TYPE_ACTIVE)) {
+ if (addressStr == null) {
+ fail(usage());
+ }
+ }
+
+ dataBroker = ItUtils.getDatabroker(getProviderContext());
+ itUtils = new ItUtils(dataBroker);
+ mdsalUtils = new MdsalUtils(dataBroker);
+ assertNotNull("mdsalUtils should not be null", mdsalUtils);
+ // TODO: Not used yet since openstack is not running to write the netvirt:1 to mdsal
+ // Only need neutron northbound right now
+ //assertTrue("Did not find " + ItConstants.NETVIRT_TOPOLOGY_ID, itUtils.getNetvirtTopology());
+ southboundUtils = new SouthboundUtils(mdsalUtils);
+ neutronModelsDataStoreHelper = new NeutronModelsDataStoreHelper(dataBroker);
+ setup.set(true);
+ }
+
+ private BindingAwareBroker.ProviderContext getProviderContext() {
+ BindingAwareBroker.ProviderContext providerContext = null;
+ for (int i=0; i < 60; i++) {
+ providerContext = getSession();
+ if (providerContext != null) {
+ break;
+ } else {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ LOG.warn("Interrupted while waiting for provider context", e);
+ }
+ }
+ }
+ assertNotNull("providercontext should not be null", providerContext);
+ /* One more second to let the provider finish initialization */
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ LOG.warn("Interrupted while waiting for other provider", e);
+ }
+ return providerContext;
+ }
+
+ @Test
+ public void testNetvirtFeatureLoad() {
+ assertTrue("Feature " + FEATURE + " was not loaded", true);
+ }
+
+ private List<NotifyingDataChangeListener> waitList = new ArrayList<>();
+ private void closeWaitFors() {
+ for (Iterator<NotifyingDataChangeListener> iterator = waitList.iterator(); iterator.hasNext();) {
+ NotifyingDataChangeListener listener = iterator.next();
+ iterator.remove();
+ try {
+ listener.close();
+ } catch (Exception ex) {
+ LOG.warn("Failed to close registration {}", listener, ex);
+ }
+ }
+ LOG.info("waitList size {}", waitList.size());
+ }
+
+ @Test
+ public void testNetvirtNeutron() throws InterruptedException {
+ final String networkId = "521e29d6-67b8-4b3c-8633-027d21195111";
+ final String tenantId = "521e29d6-67b8-4b3c-8633-027d21195100";
+
+ InstanceIdentifier<Network> path = neutronModelsDataStoreHelper.getNeutronNetworkPath(new Uuid(networkId));
+ final NotifyingDataChangeListener networkOperationalListener =
+ new NotifyingDataChangeListener(LogicalDatastoreType.CONFIGURATION, path, waitList);
+ networkOperationalListener.registerDataChangeListener(dataBroker);
+
+ NeutronNetwork nn = neutronUtils.createNeutronNetwork(networkId, tenantId,
+ NETWORK_TYPE_VXLAN, "100");
+
+ networkOperationalListener.waitForCreation();
+
+ Network network = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path);
+ assertNotNull("the network was not found in mdsal", network);
+ }
+}
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>netvirt-aggregator</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>netvirt</name>
</build>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>hwgw</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
-->
<snapshot>
<required-capabilities>
- <capability>urn:opendaylight:params:xml:ns:yang:hwgw?module=hwgw&revision=2015-12-27</capability>
+ <capability>urn:opendaylight:params:xml:ns:yang:netvirt:hwgw?module=hwgw&revision=2015-12-27</capability>
<capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28</capability>
</required-capabilities>
<configuration>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:hwgw">prefix:hwgw</type>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:netvirt:hwgw">prefix:hwgw</type>
<name>hwgw-default</name>
<broker>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.netvirt.renderers.hwgw;
+package org.opendaylight.netvirt.netvirt.renderers.hwgw;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
*/
package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.hwgw.rev151227;
-import org.opendaylight.ovsdb.netvirt.renderers.hwgw.HwgwProvider;
+import org.opendaylight.netvirt.netvirt.renderers.hwgw.HwgwProvider;
public class HwgwModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.hwgw.rev151227.AbstractHwgwModule {
public HwgwModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.netvirt.renderers.hwgw;
+package org.opendaylight.netvirt.netvirt.renderers.hwgw;
import org.junit.Test;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.controller.config.api.JmxAttribute;
import org.opendaylight.controller.config.api.ModuleIdentifier;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.ovsdb.netvirt.renderers.hwgw.HwgwProvider;
+import org.opendaylight.netvirt.netvirt.renderers.hwgw.HwgwProvider;
import javax.management.ObjectName;
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: --><!--
+Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-parent</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>neutron</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <properties>
+ <neutron.model.version>0.7.0-SNAPSHOT</neutron.model.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.neutron</groupId>
+ <artifactId>model</artifactId>
+ <version>${neutron.model.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<snapshot>
+ <required-capabilities>
+ <capability>urn:opendaylight:params:xml:ns:yang:netvirt:neutron?module=netvirt-neutron&revision=2016-03-08</capability>
+ <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28</capability>
+ </required-capabilities>
+ <configuration>
+
+ <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <module>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:netvirt:neutron">prefix:netvirt-neutron</type>
+ <name>netvirt-neutron-default</name>
+ <broker>
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
+ <name>binding-osgi-broker</name>
+ </broker>
+ </module>
+ </modules>
+ </data>
+ </configuration>
+</snapshot>
--- /dev/null
+/*
+ * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netvirt.netvirt.renderers.neutron;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class NeutronProvider implements BindingAwareProvider, AutoCloseable {
+
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronProvider.class);
+
+ @Override
+ public void onSessionInitiated(ProviderContext session) {
+ LOG.info("NeutronProvider Session Initiated");
+ }
+
+ @Override
+ public void close() throws Exception {
+ LOG.info("NeutronProvider Closed");
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.neutron.rev160308;
+
+import org.opendaylight.netvirt.netvirt.renderers.neutron.NeutronProvider;
+
+public class NeutronModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.neutron.rev160308.AbstractNeutronModule {
+ public NeutronModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ super(identifier, dependencyResolver);
+ }
+
+ public NeutronModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.neutron.rev160308.NeutronModule oldModule, java.lang.AutoCloseable oldInstance) {
+ super(identifier, dependencyResolver, oldModule, oldInstance);
+ }
+
+ @Override
+ public void customValidation() {
+ // add custom validation form module attributes here.
+ }
+
+ @Override
+ public java.lang.AutoCloseable createInstance() {
+ NeutronProvider provider = new NeutronProvider();
+ getBrokerDependency().registerProvider(provider);
+ return provider;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+/*
+* Generated file
+*
+* Generated from: yang module name: neutron yang module local name: neutron
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.neutron.rev160308;
+public class NeutronModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.neutron.rev160308.AbstractNeutronModuleFactory {
+
+}
--- /dev/null
+module netvirt-neutron {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:netvirt:neutron";
+ prefix "neutron";
+
+ import config { prefix config; revision-date 2013-04-05; }
+ import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
+
+ description
+ "Service definition for NetVirt Neutron renderer";
+
+ revision "2016-03-08" {
+ description
+ "Initial revision";
+ }
+
+ identity netvirt-neutron {
+ base config:module-type;
+ config:java-name-prefix Neutron;
+ }
+
+ augment "/config:modules/config:module/config:configuration" {
+ case netvirt-neutron {
+ when "/config:modules/config:module/config:type = 'netvirt-neutron'";
+ container broker {
+ uses config:service-ref {
+ refine type {
+ mandatory true;
+ config:required-identity md-sal-binding:binding-broker-osgi-registry;
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netvirt.netvirt.renderers.neutron;
+
+import org.junit.Test;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+
+import static org.mockito.Mockito.mock;
+
+public class NeutronProviderTest {
+ @Test
+ public void testOnSessionInitiated() {
+ NeutronProvider provider = new NeutronProvider();
+
+ // ensure no exceptions
+ // currently this method is empty
+ provider.onSessionInitiated(mock(BindingAwareBroker.ProviderContext.class));
+ }
+
+ @Test
+ public void testClose() throws Exception {
+ NeutronProvider provider = new NeutronProvider();
+
+ // ensure no exceptions
+ // currently this method is empty
+ provider.close();
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.neutron.rev160308;
+
+import org.junit.Test;
+
+public class NeutronModuleFactoryTest {
+ @Test
+ public void testFactoryConstructor() {
+ // ensure no exceptions on construction
+ new NeutronModuleFactory();
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.neutron.rev160308;
+
+import org.junit.Test;
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.opendaylight.controller.config.api.JmxAttribute;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.netvirt.netvirt.renderers.neutron.NeutronProvider;
+
+import javax.management.ObjectName;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class NeutronModuleTest {
+ @Test
+ public void testCustomValidation() {
+ NeutronModule module = new NeutronModule(mock(ModuleIdentifier.class), mock(DependencyResolver.class));
+
+ // ensure no exceptions on validation
+ // currently this method is empty
+ module.customValidation();
+ }
+
+ @Test
+ public void testCreateInstance() throws Exception {
+ // configure mocks
+ DependencyResolver dependencyResolver = mock(DependencyResolver.class);
+ BindingAwareBroker broker = mock(BindingAwareBroker.class);
+ when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);
+
+ // create instance of module with injected mocks
+ NeutronModule module = new NeutronModule(mock(ModuleIdentifier.class), dependencyResolver);
+
+ // getInstance calls resolveInstance to get the broker dependency and then calls createInstance
+ AutoCloseable closeable = module.getInstance();
+
+ // verify that the module registered the returned provider with the broker
+ verify(broker).registerProvider((NeutronProvider)closeable);
+
+ // ensure no exceptions on close
+ closeable.close();
+ }
+}
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>renderers-aggregator</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>renderers</name>
</prerequisites>
<modules>
<module>hwgw</module>
+ <module>neutron</module>
</modules>
<!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
<build>
</build>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>it</artifactId>
<version>1.3.0-SNAPSHOT</version>
<relativePath>../../commons/it</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack.net-virt-it</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>jar</packaging>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<properties>
<controller.mdsal.version>1.4.0-SNAPSHOT</controller.mdsal.version>
- <karaf.distro.groupId>org.opendaylight.ovsdb</karaf.distro.groupId>
+ <karaf.distro.groupId>org.opendaylight.netvirt</karaf.distro.groupId>
<karaf.distro.artifactId>karaf</karaf.distro.artifactId>
<karaf.distro.version>${project.version}</karaf.distro.version>
<karaf.distro.type>zip</karaf.distro.type>
+ <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
</properties>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>ovsdb-artifacts</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-artifacts</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>mdsal-artifacts</artifactId>
- <version>${controller.mdsal.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
<dependencies>
<dependency>
<groupId>org.opendaylight.controller</groupId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>features-ovsdb</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <artifactId>features-netvirt</artifactId>
+ <version>${project.version}</version>
<classifier>features</classifier>
<type>xml</type>
</dependency>
<artifactId>sonar-jacoco-listeners</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.it-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
+
<build>
<plugins>
<plugin>
/*
- * Copyright (c) 2015 Red Hat, Inc. and others. All rights reserved.
+ * Copyright (c) 2015 - 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.it;
+package org.opendaylight.netvirt.openstack.netvirt.it;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import org.opendaylight.neutron.spi.NeutronNetwork;
import org.opendaylight.neutron.spi.NeutronSubnet;
import org.opendaylight.ovsdb.lib.notation.Version;
-import org.opendaylight.ovsdb.openstack.netvirt.NetworkHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.openstack.netvirt.NetworkHandler;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.utils.it.utils.ItUtils;
+import org.opendaylight.netvirt.utils.it.utils.NodeInfo;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.*;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchOtherConfigs;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
public class NetvirtIT extends AbstractMdsalTestBase {
private static final Logger LOG = LoggerFactory.getLogger(NetvirtIT.class);
private static DataBroker dataBroker = null;
+ private static ItUtils itUtils;
private static String addressStr;
private static String portStr;
private static String connectionType;
@Override
public MavenUrlReference getFeatureRepo() {
return maven()
- .groupId("org.opendaylight.ovsdb")
- .artifactId("features-ovsdb")
+ .groupId("org.opendaylight.netvirt")
+ .artifactId("features-netvirt")
.classifier("features")
.type("xml")
.versionAsInProject();
@Override
public String getFeatureName() {
- return "odl-ovsdb-openstack";
+ return "odl-ovsdb-openstack-it";
}
@Configuration
private Option[] getOtherOptions() {
return new Option[] {
wrappedBundle(
- mavenBundle("org.opendaylight.ovsdb", "utils.mdsal-openflow")
+ mavenBundle("org.opendaylight.netvirt", "utils.mdsal-openflow")
.version(asInProject())
.type("jar")),
wrappedBundle(
- mavenBundle("org.opendaylight.ovsdb", "utils.config")
+ mavenBundle("org.opendaylight.netvirt", "utils.config")
.version(asInProject())
.type("jar")),
configureConsole().startLocalConsole(),
try {
super.setup();
} catch (Exception e) {
- e.printStackTrace();
+ LOG.warn("Failed to setup test", e);
+ fail("Failed to setup test: " + e);
}
getProperties();
}
dataBroker = getDatabroker(getProviderContext());
+ itUtils = new ItUtils(dataBroker);
mdsalUtils = new MdsalUtils(dataBroker);
assertNotNull("mdsalUtils should not be null", mdsalUtils);
assertTrue("Did not find " + NETVIRT_TOPOLOGY_ID, getNetvirtTopology());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
- e.printStackTrace();
+ LOG.warn("Interrupted while waiting for provider context", e);
}
}
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
- e.printStackTrace();
+ LOG.warn("Interrupted while waiting for other provider", e);
}
return providerContext;
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
- e.printStackTrace();
+ LOG.warn("Interrupted while waiting for {}", NETVIRT_TOPOLOGY_ID, e);
}
}
}
LOG.info("testNetVirt: should be connected: {}", ovsdbNode.getNodeId());
assertTrue("Controller " + SouthboundUtils.connectionInfoToString(connectionInfo)
- + " is not connected", isControllerConnected(connectionInfo));
+ + " is not connected", itUtils.isControllerConnected(connectionInfo));
Assert.assertTrue(southboundUtils.deleteBridge(connectionInfo, NetvirtITConstants.INTEGRATION_BRIDGE_NAME));
Thread.sleep(1000);
LOG.info("testNetVirt: should be connected: {}", ovsdbNode.getNodeId());
assertTrue("Controller " + SouthboundUtils.connectionInfoToString(connectionInfo)
- + " is not connected", isControllerConnected(connectionInfo));
+ + " is not connected", itUtils.isControllerConnected(connectionInfo));
// Verify the pipeline flows were installed
Node bridgeNode = southbound.getBridgeNode(ovsdbNode, NetvirtITConstants.INTEGRATION_BRIDGE_NAME);
LOG.info("testAddDeleteOvsdbNodeWithTableOffset exit");
}
- private boolean isControllerConnected(ConnectionInfo connectionInfo) throws InterruptedException {
- LOG.info("isControllerConnected enter");
- Boolean connected = false;
- ControllerEntry controllerEntry;
- Node ovsdbNode = southboundUtils.getOvsdbNode(connectionInfo);
- assertNotNull("ovsdb node not found", ovsdbNode);
-
- BridgeConfigurationManager bridgeConfigurationManager =
- (BridgeConfigurationManager) ServiceHelper.getGlobalInstance(BridgeConfigurationManager.class, this);
- assertNotNull("Could not find BridgeConfigurationManager Service", bridgeConfigurationManager);
- String controllerTarget = bridgeConfigurationManager.getControllersFromOvsdbNode(ovsdbNode).get(0);
- Assert.assertNotNull("Failed to get controller target", controllerTarget);
-
- for (int i = 0; i < 10; i++) {
- LOG.info("isControllerConnected try {}: looking for controller: {}", i, controllerTarget);
- OvsdbBridgeAugmentation bridge =
- southboundUtils.getBridge(connectionInfo, NetvirtITConstants.INTEGRATION_BRIDGE_NAME);
- Assert.assertNotNull(bridge);
- Assert.assertNotNull(bridge.getControllerEntry());
- controllerEntry = bridge.getControllerEntry().iterator().next();
- Assert.assertEquals(controllerTarget, controllerEntry.getTarget().getValue());
- if (controllerEntry.isIsConnected()) {
- Assert.assertTrue("Controller is not connected", controllerEntry.isIsConnected());
- connected = true;
- break;
- }
- Thread.sleep(1000);
- }
- LOG.info("isControllerConnected exit: {} - {}", connected, controllerTarget);
- return connected;
- }
-
@Ignore
@Test
public void testOpenVSwitchOtherConfig() throws InterruptedException {
public void testNetVirt() throws InterruptedException {
LOG.info("testNetVirt: starting test");
ConnectionInfo connectionInfo = SouthboundUtils.getConnectionInfo(addressStr, portStr);
- Node ovsdbNode = connectOvsdbNode(connectionInfo);
- assertNotNull("connection failed", ovsdbNode);
- LOG.info("testNetVirt: should be connected: {}", ovsdbNode.getNodeId());
-
- //TODO use controller value rather that ovsdb connectionInfo or change log
- assertTrue("Controller " + SouthboundUtils.connectionInfoToString(connectionInfo)
- + " is not connected", isControllerConnected(connectionInfo));
-
- // Verify the pipeline flows were installed
- Node bridgeNode = southbound.getBridgeNode(ovsdbNode, NetvirtITConstants.INTEGRATION_BRIDGE_NAME);
- assertNotNull("bridge " + NetvirtITConstants.INTEGRATION_BRIDGE_NAME + " was not found", bridgeNode);
- long datapathId = southbound.getDataPathId(bridgeNode);
- String datapathIdString = southbound.getDatapathId(bridgeNode);
- LOG.info("testNetVirt: bridgeNode: {}, datapathId: {} - {}", bridgeNode, datapathIdString, datapathId);
- assertNotEquals("datapathId was not found", datapathId, 0);
+ NodeInfo nodeInfo = itUtils.createNodeInfo(connectionInfo, null);
+ nodeInfo.connect();
+ LOG.info("testNetVirt: should be connected: {}", nodeInfo.ovsdbNode.getNodeId());
List<Service> staticPipeline = pipelineOrchestrator.getStaticPipeline();
List<Service> staticPipelineFound = Lists.newArrayList();
staticPipelineFound.add(service);
}
String flowId = "DEFAULT_PIPELINE_FLOW_" + pipelineOrchestrator.getTable(service);
- verifyFlow(datapathId, flowId, service);
+ verifyFlow(nodeInfo.datapathId, flowId, service);
}
assertEquals("did not find all expected flows in static pipeline",
staticPipeline.size(), staticPipelineFound.size());
- southboundUtils.addTerminationPoint(bridgeNode, NetvirtITConstants.PORT_NAME, "internal", null, null, 0L);
+ southboundUtils.addTerminationPoint(nodeInfo.bridgeNode, NetvirtITConstants.PORT_NAME, "internal", null, null, 0L);
Thread.sleep(1000);
OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
- southbound.getTerminationPointOfBridge(bridgeNode, NetvirtITConstants.PORT_NAME);
+ southbound.getTerminationPointOfBridge(nodeInfo.bridgeNode, NetvirtITConstants.PORT_NAME);
Assert.assertNotNull("Did not find " + NetvirtITConstants.PORT_NAME, ovsdbTerminationPointAugmentation);
- Assert.assertTrue(southboundUtils.deleteBridge(connectionInfo, NetvirtITConstants.INTEGRATION_BRIDGE_NAME));
- Thread.sleep(1000);
- Assert.assertTrue(disconnectOvsdbNode(connectionInfo));
+
+ nodeInfo.disconnect();
}
@Test
final String dhcpPortId ="521e29d6-67b8-4b3c-8633-027d21195115";
ConnectionInfo connectionInfo = SouthboundUtils.getConnectionInfo(addressStr, portStr);
- Node ovsdbNode = connectOvsdbNode(connectionInfo);
- assertNotNull("connection failed", ovsdbNode);
- LOG.info("testNetVirtFixedSG: should be connected: {}", ovsdbNode.getNodeId());
+ NodeInfo nodeInfo = itUtils.createNodeInfo(connectionInfo, null);
+ nodeInfo.connect();
+ LOG.info("testNetVirtFixedSG: should be connected: {}", nodeInfo.ovsdbNode.getNodeId());
// Verify the minimum version required for this test
- OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
+ OvsdbNodeAugmentation ovsdbNodeAugmentation = nodeInfo.ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
Assert.assertNotNull(ovsdbNodeAugmentation);
assertNotNull(ovsdbNodeAugmentation.getOvsVersion());
String ovsVersion = ovsdbNodeAugmentation.getOvsVersion();
return;
}
- assertTrue("Controller " + SouthboundUtils.connectionInfoToString(connectionInfo)
- + " is not connected", isControllerConnected(connectionInfo));
-
- Node bridgeNode = southbound.getBridgeNode(ovsdbNode, NetvirtITConstants.INTEGRATION_BRIDGE_NAME);
- assertNotNull("bridge " + NetvirtITConstants.INTEGRATION_BRIDGE_NAME + " was not found", bridgeNode);
- long datapathId = southbound.getDataPathId(bridgeNode);
- String datapathIdString = southbound.getDatapathId(bridgeNode);
- LOG.info("testNetVirtFixedSG: bridgeNode: {}, datapathId: {} - {}", bridgeNode, datapathIdString, datapathId);
- assertNotEquals("datapathId was not found", datapathId, 0);
-
NeutronNetwork nn = neutronUtils.createNeutronNetwork(networkId, tenantId,
NetworkHandler.NETWORK_TYPE_VXLAN, "100");
NeutronSubnet ns = neutronUtils.createNeutronSubnet(subnetId, tenantId, networkId, "10.0.0.0/24");
Map<String, String> externalIds = Maps.newHashMap();
externalIds.put("attached-mac", "f6:00:00:0f:00:01");
externalIds.put("iface-id", portId);
- southboundUtils.addTerminationPoint(bridgeNode, portName, "internal", null, externalIds, 3L);
- southboundUtils.addTerminationPoint(bridgeNode, "vm1", "internal", null, null, 0L);
- southboundUtils.addTerminationPoint(bridgeNode, "vm2", "internal", null, null, 0L);
+ southboundUtils.addTerminationPoint(nodeInfo.bridgeNode, portName, "internal", null, externalIds, 3L);
+ southboundUtils.addTerminationPoint(nodeInfo.bridgeNode, "vm1", "internal", null, null, 0L);
+ southboundUtils.addTerminationPoint(nodeInfo.bridgeNode, "vm2", "internal", null, null, 0L);
Map<String, String> options = Maps.newHashMap();
options.put("key", "flow");
options.put("remote_ip", "192.168.120.32");
- southboundUtils.addTerminationPoint(bridgeNode, "vx", "vxlan", options, null, 4L);
+ southboundUtils.addTerminationPoint(nodeInfo.bridgeNode, "vx", "vxlan", options, null, 4L);
Thread.sleep(1000);
String flowId = "Egress_DHCP_Client" + "_Permit_";
- verifyFlow(datapathId, flowId, Service.EGRESS_ACL);
+ verifyFlow(nodeInfo.datapathId, flowId, Service.EGRESS_ACL);
- testDefaultSG(nport, datapathId, nn, tenantId, portId);
- Thread.sleep(1000);
- Assert.assertTrue(southboundUtils.deleteBridge(connectionInfo, NetvirtITConstants.INTEGRATION_BRIDGE_NAME));
+ testDefaultSG(nport, nodeInfo.datapathId, nn, tenantId, portId);
Thread.sleep(1000);
- Assert.assertTrue(disconnectOvsdbNode(connectionInfo));
+
+ nodeInfo.disconnect();
}
private void testDefaultSG(NeutronPort nport, long datapathId, NeutronNetwork nn, String tenantId, String portId)
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.it;
+package org.opendaylight.netvirt.openstack.netvirt.it;
/**
* Constants for SouthboundIT
-package org.opendaylight.ovsdb.openstack.netvirt.it;
+package org.opendaylight.netvirt.openstack.netvirt.it;
import java.util.ArrayList;
import java.util.List;
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack.net-virt-providers</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<properties>
<liblldp.version>0.11.0-SNAPSHOT</liblldp.version>
<openflowplugin.version>0.3.0-SNAPSHOT</openflowplugin.version>
- <powermock.version>1.6.4</powermock.version>
+ <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
<sonar.jacoco.itReportPath>../net-virt-it/target/jacoco-it.exec</sonar.jacoco.itReportPath>
</properties>
<dependencies>
- <!-- project specific dependencies -->
<dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack.net-virt</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>utils.mdsal-openflow</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.opendaylight.ovsdb</groupId>
<artifactId>southbound-api</artifactId>
- <version>${project.version}</version>
+ <version>${ovsdb.version}</version>
</dependency>
<dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>utils.servicehelper</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- openflowplugin dependencies -->
<dependency>
<groupId>org.opendaylight.openflowplugin.model</groupId>
<artifactId>model-flow-base</artifactId>
<artifactId>openflowplugin-api</artifactId>
<version>${openflowplugin.version}</version>
</dependency>
- <!-- mdsal dependencies -->
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-inet-types</artifactId>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-topology</artifactId>
</dependency>
- <!-- controller dependencies -->
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>liblldp</artifactId>
<version>${liblldp.version}</version>
</dependency>
- <!-- external dependencies -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
- <!-- testing dependencies -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-support</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-reflect</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<Embed-Dependency>utils.config,utils.mdsal-openflow;type=!pom;inline=false</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Export-Package>
- org.opendaylight.ovsdb.openstack.netvirt.providers,
- org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13,
+ org.opendaylight.netvirt.openstack.netvirt.providers,
+ org.opendaylight.netvirt.openstack.netvirt.providers.openflow13,
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.providers.config.rev160109
</Export-Package>
</instructions>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <excludes>
+ <excludes>
<exclude>**/services/*Test.java</exclude>
</excludes>
<properties>
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers;
+package org.opendaylight.netvirt.openstack.netvirt.providers;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ClassifierProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EgressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.GatewayMacResolver;
-import org.opendaylight.ovsdb.openstack.netvirt.api.IcmpEchoProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.InboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.IngressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L2ForwardingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L2RewriteProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L3ForwardingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheListener;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OutboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.RoutingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.OF13Provider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestratorImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.ArpResponderService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.ClassifierService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.EgressAclService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.IcmpEchoResponderService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.InboundNatService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.IngressAclService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.L2ForwardingService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.L2RewriteService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.L3ForwardingService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.LoadBalancerService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.OutboundNatService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.RoutingService;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp.GatewayMacResolverService;
+import org.opendaylight.netvirt.openstack.netvirt.api.ArpProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.ClassifierProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.EgressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.IcmpEchoProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.IngressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.L2ForwardingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.L2RewriteProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.L3ForwardingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.OutboundNatProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.RoutingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.OF13Provider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.ArpResponderService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.ClassifierService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.EgressAclService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.IcmpEchoResponderService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.InboundNatService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.IngressAclService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.L2ForwardingService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.L2RewriteService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.L3ForwardingService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.LoadBalancerService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.OutboundNatService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.RoutingService;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.arp.GatewayMacResolverService;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.GatewayMacResolver;
+import org.opendaylight.netvirt.openstack.netvirt.api.InboundNatProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheListener;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestratorImpl;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers;
+package org.opendaylight.netvirt.openstack.netvirt.providers;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers;
+package org.opendaylight.netvirt.openstack.netvirt.providers;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.providers.config.rev160109.*;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers;
+package org.opendaylight.netvirt.openstack.netvirt.providers;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
commitFuture.checkedGet(); // TODO: Make it async (See bug 1362)
LOG.debug("Transaction success for write of Flow {}", flowBuilder.getFlowName());
} catch (Exception e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Failed to write flow {}", flowBuilder.getFlowName(), e);
modification.cancel();
}
}
commitFuture.get(); // TODO: Make it async (See bug 1362)
LOG.debug("Transaction success for deletion of Flow {}", flowBuilder.getFlowName());
} catch (Exception e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Failed to remove flow {}", flowBuilder.getFlowName(), e);
modification.cancel();
}
}
return data.get();
}
} catch (InterruptedException|ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Failed to get flow {}", flowBuilder.getFlowName(), e);
}
LOG.debug("Cannot find data for Flow {}", flowBuilder.getFlowName());
return data.get();
}
} catch (InterruptedException|ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Failed to get openflow node {}", nodeId, e);
}
LOG.debug("Cannot find data for Node {}", nodeId);
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13;
import java.net.InetAddress;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.MdsalHelper;
-import org.opendaylight.ovsdb.openstack.netvirt.NetworkHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ClassifierProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EgressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.IngressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L2ForwardingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.MdsalHelper;
+import org.opendaylight.netvirt.openstack.netvirt.NetworkHandler;
+import org.opendaylight.netvirt.openstack.netvirt.api.BridgeConfigurationManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.ClassifierProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.EgressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.IngressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.L2ForwardingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.GroupActionCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
private volatile BundleContext bundleContext;
private volatile Southbound southbound;
+ private Set<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId>
+ intBridgesWithoutVmPorts = new HashSet<>();
+
public OF13Provider() {
this.dataBroker = NetvirtProvidersProvider.getDataBroker();
}
programLocalBridgeRules(node, dpid, segmentationId, attachedMac, localPort);
}
} catch (Exception e) {
- LOG.error("Exception in programming Local Rules for " + intf + " on " + node, e);
+ LOG.error("Exception in programming Local Rules for {} on {}", intf, node, e);
}
}
programLocalSecurityGroupRules(attachedMac, node, intf, dpid, localPort, segmentationId, false);
}
} catch (Exception e) {
- LOG.error("Exception in removing Local Rules for " + intf + " on " + node, e);
+ LOG.error("Exception in removing Local Rules for {} on {}", intf, node, e);
}
}
- // TODO SB_MIGRATION
- // Need to handle case where a node comes online after a network and tunnels have
- // already been created. The interface update is what triggers creating the l2 forwarding flows
- // so we don't see those updates in this case - we only see the new nodes interface updates.
private void programTunnelRules (String tunnelType, String segmentationId, InetAddress dst, Node node,
OvsdbTerminationPointAugmentation intf, boolean local) {
LOG.debug("programTunnelRules: node: {}, intf: {}, local: {}, tunnelType: {}, "
}
OvsdbTerminationPointAugmentation tunnelPort= southbound.getTerminationPointOfBridge(node, getTunnelName(tunnelType, dst));
- if(tunnelPort != null){
+ if (tunnelPort != null){
long tunnelOFPort = southbound.getOFPort(tunnelPort);
if (tunnelOFPort == 0) {
LOG.error("programTunnelRules: Could not Identify Tunnel port {} -> OF ({}) on {}",
}
}
} catch (Exception e) {
- LOG.trace("", e);
+ LOG.warn("Failed to program tunnel rules, node {}, intf {}", node, intf, e);
}
}
}
}
} catch (Exception e) {
- LOG.error("", e);
+ LOG.error("Failed to remove tunnel rules, node {}, intf {}", node, intf, e);
}
}
InetAddress src, InetAddress dst,
Node srcBridgeNode, Node dstBridgeNode,
OvsdbTerminationPointAugmentation intf){
+ LOG.debug("programTunnelRulesInNewNode: network {} networkType {} segId {} src {} dst {} srcBridgeNode {} dstBridgeNode {} intf {}",
+ network.getNetworkName(), networkType, segmentationId, src.getHostAddress(),
+ dst.getHostAddress(), srcBridgeNode, dstBridgeNode, intf);
try {
long localPort = southbound.getOFPort(intf);
- if(localPort != 0)
+ if (localPort != 0)
{
LOG.debug("Interface update details {}", intf);
* VM, the tunnelin and broadcast rule will not be present in C1.
* So, handling it in the case below to make ping work.
*/
- if(securityServicesManager.getNeutronPortFromDhcpIntf(intf) == null){
+ if (securityServicesManager.getNeutronPortFromDhcpIntf(intf) == null){
programTunnelRules(networkType, segmentationId, src, dstBridgeNode, intf, true);
}
*/
List<OvsdbTerminationPointAugmentation> ports = southbound.getTerminationPointsOfBridge(dstBridgeNode);
for (OvsdbTerminationPointAugmentation port : ports) {
- if(network == tenantNetworkManager.getTenantNetwork(port)){
+
+ NeutronNetwork neutronNetwork = tenantNetworkManager.getTenantNetwork(port);
+ if (neutronNetwork != null) {
+ String netType = neutronNetwork.getProviderNetworkType();
+ String segId = neutronNetwork.getProviderSegmentationID();
+ InetAddress dstAddr = configurationService.getTunnelEndPoint(dstBridgeNode);
+
+ if (segId != null && netType != null && dstAddr != null) {
+ programTunnelRules(netType, segId, dstAddr, srcBridgeNode, port, false);
+ }
+ }
+
+ if (network == tenantNetworkManager.getTenantNetwork(port)){
programTunnelRules(networkType, segmentationId, dst, srcBridgeNode, port, false);
}
else{
}
}
+ private boolean bridgeHasVmPort(Node bridgeNode) {
+ String intBridgeName = configurationService.getIntegrationBridgeName();
+ String extBridgeName = configurationService.getExternalBridgeName();
+ List<TerminationPoint> terminationPoints = bridgeNode.getTerminationPoint();
+ if (terminationPoints == null) return false;
+
+ for (TerminationPoint tp : terminationPoints) {
+ String tpName = tp.getTpId().getValue();
+ if (tpName != null && !tpName.equals(intBridgeName) && !tpName.equals(extBridgeName)) {
+ OvsdbTerminationPointAugmentation tpAug = tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ if (tpAug != null && southbound.getOFPort(tpAug) != 0) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
@Override
- public boolean handleInterfaceUpdate(NeutronNetwork network, Node srcNode,
- OvsdbTerminationPointAugmentation intf) {
+ public boolean handleInterfaceUpdate(NeutronNetwork network, Node srcNode, OvsdbTerminationPointAugmentation intf) {
+ LOG.debug("handleInterfaceUpdate: network: {} srcNode: {}, intf: {}",
+ network.getProviderSegmentationID(), srcNode.getNodeId(), intf.getName());
Preconditions.checkNotNull(nodeCacheManager);
+
+ org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId srcNodeId =
+ srcNode.getNodeId();
Map<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId,Node> nodes =
nodeCacheManager.getOvsdbNodes();
+
nodes.remove(southbound.extractBridgeOvsdbNodeId(srcNode));
String networkType = network.getProviderNetworkType();
String segmentationId = network.getProviderSegmentationID();
Node srcBridgeNode = southbound.getBridgeNode(srcNode, configurationService.getIntegrationBridgeName());
+
programLocalRules(networkType, network.getProviderSegmentationID(), srcBridgeNode, intf);
if (isVlan(networkType)) {
Node dstBridgeNode = southbound.getBridgeNode(dstNode,
configurationService.getIntegrationBridgeName());
- if(dstBridgeNode != null){
+ if (dstBridgeNode != null){
destTunnelStatus = addTunnelPort(dstBridgeNode, networkType, dst, src);
}
}
if (destTunnelStatus) {
programTunnelRules(networkType, segmentationId, src, dstBridgeNode, intf, false);
- programTunnelRulesInNewNode(network, networkType, segmentationId, src, dst,
- srcBridgeNode, dstBridgeNode, intf);
+
+ if (srcNodeId != null && intBridgesWithoutVmPorts.contains(srcNodeId)) {
+ programTunnelRulesInNewNode(network, networkType, segmentationId, src, dst,
+ srcBridgeNode, dstBridgeNode, intf);
+ intBridgesWithoutVmPorts.remove(srcNodeId);
+ }
}
} else {
LOG.warn("Tunnel end-point configuration missing. Please configure it in OpenVSwitch Table. "
}
}
+ if (srcNodeId != null && !bridgeHasVmPort(srcNode)) {
+ intBridgesWithoutVmPorts.add(srcNodeId);
+ }
+
return true;
}
MdsalHelper.createOvsdbInterfaceType(intf.getInterfaceType()),
src, dst);
} catch (Exception e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("handleInterfaceDelete: failed to delete tunnel port", e);
}
} else if (phyIfName.contains(intf.getName())) {
deletePhysicalPort(srcNode, intf.getName());
removeTunnelRules(tunnelType, network.getProviderSegmentationID(),
dst, srcNode, intf, true, isLastInstanceOnNode);
Node dstBridgeNode = southbound.getBridgeNode(dstNode, Constants.INTEGRATION_BRIDGE);
- if(dstBridgeNode != null){
+ if (dstBridgeNode != null){
LOG.info("Remove tunnel rules for interface "
+ intf.getName() + " on dstNode " + dstNode.getNodeId().getValue());
removeTunnelRules(tunnelType, network.getProviderSegmentationID(),
return data.get();
}
} catch (InterruptedException|ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Failed to get group {}", groupBuilder.getGroupName(), e);
}
- LOG.debug("Cannot find data for Group " + groupBuilder.getGroupName());
+ LOG.debug("Cannot find data for Group {}", groupBuilder.getGroupName());
return null;
}
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
try {
commitFuture.get(); // TODO: Make it async (See bug 1362)
- LOG.debug("Transaction success for write of Group " + groupBuilder.getGroupName());
+ LOG.debug("Transaction success for write of Group {}", groupBuilder.getGroupName());
} catch (InterruptedException|ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Failed to write group {}", groupBuilder.getGroupName(), e);
}
}
}
try {
commitFuture.get(); // TODO: Make it async (See bug 1362)
- LOG.debug("Transaction success for deletion of Group " + groupBuilder.getGroupName());
+ LOG.debug("Transaction success for deletion of Group {}", groupBuilder.getGroupName());
} catch (InterruptedException|ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Failed to remove group {}", groupBuilder.getGroupName(), e);
}
}
}
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
try {
commitFuture.get(); // TODO: Make it async (See bug 1362)
- LOG.debug("Transaction success for write of Flow " + flowBuilder.getFlowName());
+ LOG.debug("Transaction success for write of Flow {}", flowBuilder.getFlowName());
} catch (InterruptedException|ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Failed to write flows {}", flowBuilder.getFlowName(), e);
}
}
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13;
import java.util.List;
import java.util.Map;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheListener;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13;
import java.util.Comparator;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import java.math.BigInteger;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.ArpProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import java.math.BigInteger;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ClassifierProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.ClassifierProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
/*
- * Copyright (c) 2014, 2015 Red Hat, Inc. and others. All rights reserved.
+ * Copyright (c) 2014 - 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import com.google.common.collect.Lists;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EgressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityGroupCacheManger;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.EgressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityGroupCacheManger;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
*
*/
- if (portSecurityRule == null ||
- portSecurityRule.getSecurityRuleEthertype() == null ||
- portSecurityRule.getSecurityRuleDirection() == null) {
+ if (portSecurityRule == null
+ || portSecurityRule.getSecurityRuleEthertype() == null
+ || portSecurityRule.getSecurityRuleDirection() == null) {
continue;
}
String securityRuleEtherType = portSecurityRule.getSecurityRuleEthertype();
boolean isIpv6 = NeutronSecurityRule.ETHERTYPE_IPV6.equals(securityRuleEtherType);
if (!isIpv6 && !NeutronSecurityRule.ETHERTYPE_IPV4.equals(securityRuleEtherType)) {
- LOG.debug("programPortSecurityRule: SecurityRuleEthertype {} does not match IPv4/v6.", securityRuleEtherType);
+ LOG.debug("programPortSecurityRule: SecurityRuleEthertype {} does not match IPv4/v6.",
+ securityRuleEtherType);
return;
}
if (null == portSecurityRule.getSecurityRuleProtocol()) {
/* TODO Rework on the priority values */
- egressAclIP(dpid, isIpv6, segmentationId, attachedMac,
+ egressAclIp(dpid, isIpv6, segmentationId, attachedMac,
write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
} else {
String ipaddress = null;
try {
InetAddress address = InetAddress.getByName(ipaddress);
if ((isIpv6 && (address instanceof Inet4Address)) || (!isIpv6 && address instanceof Inet6Address)) {
- LOG.debug("programPortSecurityRule: Remote vmIP {} does not match with SecurityRuleEthertype {}.", ipaddress, securityRuleEtherType);
+ LOG.debug("programPortSecurityRule: Remote vmIP {} does not match with "
+ + "SecurityRuleEthertype {}.", ipaddress, securityRuleEtherType);
return;
}
} catch (UnknownHostException e) {
- LOG.warn("Invalid IP address {}", ipaddress);
+ LOG.warn("Invalid IP address {}", ipaddress, e);
return;
}
}
switch (portSecurityRule.getSecurityRuleProtocol()) {
- case MatchUtils.TCP:
- LOG.debug("programPortSecurityRule: Rule matching TCP", portSecurityRule);
- egressAclTcp(dpid, segmentationId, attachedMac,
- portSecurityRule,ipaddress, write,
- Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
- break;
- case MatchUtils.UDP:
- LOG.debug("programPortSecurityRule: Rule matching UDP", portSecurityRule);
- egressAclUdp(dpid, segmentationId, attachedMac,
- portSecurityRule, ipaddress, write,
- Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
- break;
- case MatchUtils.ICMP:
- case MatchUtils.ICMPV6:
- LOG.debug("programPortSecurityRule: Rule matching ICMP", portSecurityRule);
- egressAclIcmp(dpid, segmentationId, attachedMac,
- portSecurityRule, ipaddress,write,
- Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
- break;
- default:
- LOG.info("programPortSecurityAcl: Protocol is not TCP/UDP/ICMP but other " +
- "protocol = ", portSecurityRule.getSecurityRuleProtocol());
- egressOtherProtocolAclHandler(dpid, segmentationId, attachedMac,
- portSecurityRule, ipaddress, write,
- Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
- break;
+ case MatchUtils.TCP:
+ LOG.debug("programPortSecurityRule: Rule matching TCP", portSecurityRule);
+ egressAclTcp(dpid, segmentationId, attachedMac,
+ portSecurityRule,ipaddress, write,
+ Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
+ break;
+ case MatchUtils.UDP:
+ LOG.debug("programPortSecurityRule: Rule matching UDP", portSecurityRule);
+ egressAclUdp(dpid, segmentationId, attachedMac,
+ portSecurityRule, ipaddress, write,
+ Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
+ break;
+ case MatchUtils.ICMP:
+ case MatchUtils.ICMPV6:
+ LOG.debug("programPortSecurityRule: Rule matching ICMP", portSecurityRule);
+ egressAclIcmp(dpid, segmentationId, attachedMac,
+ portSecurityRule, ipaddress,write,
+ Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
+ break;
+ default:
+ LOG.info("programPortSecurityAcl: Protocol is not TCP/UDP/ICMP but other "
+ + "protocol = ", portSecurityRule.getSecurityRuleProtocol());
+ egressOtherProtocolAclHandler(dpid, segmentationId, attachedMac,
+ portSecurityRule, ipaddress, write,
+ Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
+ break;
}
}
}
boolean write, Integer priority) {
MatchBuilder matchBuilder = new MatchBuilder();
String flowId = "Egress_Other_" + segmentationId + "_" + srcMac + "_";
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,srcMac,null);
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,srcMac,null,MatchUtils.ETHERTYPE_IPV4);
short proto = 0;
try {
}
flowId = flowId + "_Permit";
NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
- syncFlow(flowId, nodeBuilder, matchBuilder, priority, write, false, securityServicesManager.isConntrackEnabled());
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, priority, matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
@Override
boolean isLastPortinBridge, boolean isComputePort ,boolean write) {
// If it is the only port in the bridge add the rule to allow any DHCP client traffic
//if (isLastPortinBridge) {
- egressAclDhcpAllowClientTrafficFromVm(dpid, write, Constants.PROTO_DHCP_CLIENT_TRAFFIC_MATCH_PRIORITY);
- egressAclDhcpv6AllowClientTrafficFromVm(dpid, write, Constants.PROTO_DHCP_CLIENT_TRAFFIC_MATCH_PRIORITY);
- // }
+ egressAclDhcpAllowClientTrafficFromVm(dpid, write, Constants.PROTO_DHCP_CLIENT_TRAFFIC_MATCH_PRIORITY);
+ egressAclDhcpv6AllowClientTrafficFromVm(dpid, write, Constants.PROTO_DHCP_CLIENT_TRAFFIC_MATCH_PRIORITY);
+ // }
if (isComputePort) {
programArpRule(dpid, segmentationId, localPort, attachedMac, write);
if (securityServicesManager.isConntrackEnabled()) {
egressAclAllowTrafficFromVmIpV6MacPair(dpid, localPort, attachedMac, addressWithPrefix,
Constants.PROTO_VM_IP_MAC_MATCH_PRIORITY,write);
}
- } catch(UnknownHostException e) {
- LOG.warn("Invalid IP address {}", srcAddress.getIpAddress());
+ } catch (UnknownHostException e) {
+ LOG.warn("Invalid IP address {}", srcAddress.getIpAddress(), e);
}
}
}
}
private void programArpRule(Long dpid, String segmentationId, long localPort, String attachedMac, boolean write) {
- String nodeName = Constants.OPENFLOW_NODE_PREFIX + dpid;
MatchBuilder matchBuilder = new MatchBuilder();
- NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
String flowId = "Egress_ARP_" + segmentationId + "_" + localPort + "_";
+ MatchUtils.createV4EtherMatchWithType(matchBuilder,null,null,MatchUtils.ETHERTYPE_ARP);
+ MatchUtils.addArpMacMatch(matchBuilder, attachedMac, null);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, Constants.PROTO_MATCH_PRIORITY,
+ matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpid);
+ syncFlow(flowBuilder ,nodeBuilder, write);
+ }
- EthernetMatchBuilder ethernetType = new EthernetMatchBuilder();
- EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
- ethTypeBuilder.setType(new EtherType(0x0806L));
- ethernetType.setEthernetType(ethTypeBuilder.build());
- matchBuilder.setEthernetMatch(ethernetType.build());
+ private void programEgressAclFixedConntrackRule(Long dpid,
+ String segmentationId, long localPort, String attachMac, boolean write) {
+ try {
+ programConntrackUntrackRule(dpid, segmentationId, localPort,attachMac,
+ Constants.CT_STATE_UNTRACKED_PRIORITY, write );
+ programConntrackTrackedPlusEstRule(dpid, segmentationId, localPort,
+ Constants.CT_STATE_TRACKED_EXIST_PRIORITY, write );
+ programConntrackTrackedPlusRelRule(dpid, segmentationId, localPort,
+ Constants.CT_STATE_TRACKED_EXIST_PRIORITY, write );
+ programConntrackNewDropRule(dpid, segmentationId, localPort,
+ Constants.CT_STATE_NEW_PRIORITY_DROP, write );
+ programConntrackInvDropRule(dpid, segmentationId, localPort,
+ Constants.CT_STATE_NEW_PRIORITY_DROP, write );
+ LOG.info("programEgressAclFixedConntrackRule : default connection tracking rule are added.");
+ } catch (Exception e) {
+ LOG.error("Failed to add default conntrack rules : " , e);
+ }
+ }
+
+ private void programConntrackUntrackRule(Long dpidLong, String segmentationId,
+ long localPort, String attachMac, Integer priority, boolean write) {
+ MatchBuilder matchBuilder = new MatchBuilder();
+ String flowName = "Egress_Fixed_Conntrk_Untrk_" + segmentationId + "_" + localPort + "_";
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder, attachMac, null,MatchUtils.ETHERTYPE_IPV4);
+ matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.UNTRACKED_CT_STATE,
+ MatchUtils.UNTRACKED_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addInstructionWithConntrackRecirc(flowBuilder);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
+ }
- ArpMatchBuilder arpDstMatch = new ArpMatchBuilder();
- ArpSourceHardwareAddressBuilder arpSrc = new ArpSourceHardwareAddressBuilder();
- arpSrc.setAddress(new MacAddress(attachedMac));
- arpDstMatch.setArpSourceHardwareAddress(arpSrc.build());
- matchBuilder.setLayer3Match(arpDstMatch.build());
+ private void programConntrackTrackedPlusEstRule(Long dpidLong, String segmentationId,
+ long localPort,Integer priority, boolean write) {
+ MatchBuilder matchBuilder = new MatchBuilder();
+ String flowName = "Egress_Fixed_Conntrk_TrkEst_" + segmentationId + "_" + localPort + "_";
+ matchBuilder = MatchUtils.createInPortMatch(matchBuilder, dpidLong, localPort);
+ matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_EST_CT_STATE,
+ MatchUtils.TRACKED_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
+ }
- syncFlow(flowId, nodeBuilder, matchBuilder, Constants.PROTO_MATCH_PRIORITY, write, false, false);
+ private void programConntrackTrackedPlusRelRule(Long dpidLong, String segmentationId,
+ long localPort,Integer priority, boolean write) {
+ MatchBuilder matchBuilder = new MatchBuilder();
+ String flowName = "Egress_Fixed_Conntrk_TrkRel_" + segmentationId + "_" + localPort + "_";
+ matchBuilder = MatchUtils.createInPortMatch(matchBuilder, dpidLong, localPort);
+ matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_REL_CT_STATE,
+ MatchUtils.TRACKED_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
- private void programEgressAclFixedConntrackRule(Long dpid,
- String segmentationId, long localPort, String attachMac, boolean write) {
- try {
- String nodeName = Constants.OPENFLOW_NODE_PREFIX + dpid;
- programConntrackUntrackRule(nodeName, segmentationId, localPort,attachMac,
- Constants.CT_STATE_UNTRACKED_PRIORITY, write );
- programConntrackTrackedPlusEstRule(nodeName, dpid, segmentationId, localPort,
- Constants.CT_STATE_TRACKED_EST_PRIORITY, write );
- programConntrackNewDropRule(nodeName, dpid, segmentationId, localPort,
- Constants.CT_STATE_NEW_PRIORITY_DROP, write );
- LOG.info("programEgressAclFixedConntrackRule : default connection tracking rule are added.");
- } catch (Exception e) {
- LOG.error("Failed to add default conntrack rules : " , e);
- }
- }
-
- private void programConntrackUntrackRule(String nodeName, String segmentationId,
- long localPort, String attachMac, Integer priority, boolean write) {
- MatchBuilder matchBuilder = new MatchBuilder();
- NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
- String flowName = "Egress_Fixed_Conntrk_Untrk_" + segmentationId + "_" + localPort + "_";
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder, attachMac, null);
- matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.UNTRACKED_CT_STATE,
- MatchUtils.UNTRACKED_CT_STATE_MASK);
- FlowBuilder flowBuilder = new FlowBuilder();
- flowBuilder.setMatch(matchBuilder.build());
- FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
- if (write) {
- InstructionBuilder ib = new InstructionBuilder();
- List<Instruction> instructionsList = Lists.newArrayList();
- InstructionsBuilder isb = new InstructionsBuilder();
- ActionBuilder ab = new ActionBuilder();
- ab.setAction(ActionUtils.nxConntrackAction(0, 0L, 0, (short)0x0));
- // 0xff means no table, 0x0 is table = 0
- ab.setOrder(0);
- ab.setKey(new ActionKey(0));
- List<Action> actionList = Lists.newArrayList();
- actionList.add(ab.build());
- ApplyActionsBuilder aab = new ApplyActionsBuilder();
- aab.setAction(actionList);
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
- ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- instructionsList.add(ib.build());
- isb.setInstruction(instructionsList);
- flowBuilder.setInstructions(isb.build());
- writeFlow(flowBuilder, nodeBuilder);
- LOG.info("EGRESS:default programConntrackUntrackRule() flows are written");
- } else {
- removeFlow(flowBuilder, nodeBuilder);
- }
- }
-
- private void programConntrackTrackedPlusEstRule(String nodeName, Long dpid, String segmentationId,
- long localPort,Integer priority, boolean write) {
- MatchBuilder matchBuilder = new MatchBuilder();
- NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
- String flowName = "Egress_Fixed_Conntrk_TrkEst_" + segmentationId + "_" + localPort + "_";
- matchBuilder = MatchUtils.createInPortMatch(matchBuilder, dpid, localPort);
- matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_EST_CT_STATE,
- MatchUtils.TRACKED_EST_CT_STATE_MASK);
- FlowBuilder flowBuilder = new FlowBuilder();
- flowBuilder.setMatch(matchBuilder.build());
- FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
- if (write) {
- InstructionBuilder ib = new InstructionBuilder();
- List<Instruction> instructionsList = Lists.newArrayList();
- InstructionsBuilder isb = new InstructionsBuilder();
- // got to next table instruction
- ib = this.getMutablePipelineInstructionBuilder();
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
- instructionsList.add(ib.build());
- isb.setInstruction(instructionsList);
- flowBuilder.setInstructions(isb.build());
- writeFlow(flowBuilder, nodeBuilder);
- LOG.info("EGRESS:default programConntrackTrackedPlusEstRule() flows are written");
- } else {
- removeFlow(flowBuilder, nodeBuilder);
- }
- }
-
- private void programConntrackNewDropRule(String nodeName, Long dpid, String segmentationId,
- long localPort, Integer priority, boolean write) {
- MatchBuilder matchBuilder = new MatchBuilder();
- NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
- String flowName = "Egress_Fixed_Conntrk_NewDrop_" + segmentationId + "_" + localPort + "_";
- matchBuilder = MatchUtils.createInPortMatch(matchBuilder, dpid, localPort);
- matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.NEW_CT_STATE, MatchUtils.NEW_CT_STATE_MASK);
- FlowBuilder flowBuilder = new FlowBuilder();
- flowBuilder.setMatch(matchBuilder.build());
- FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
- if (write) {
- InstructionBuilder ib = new InstructionBuilder();
- InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = Lists.newArrayList();
- InstructionUtils.createDropInstructions(ib);
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
- instructions.add(ib.build());
- isb.setInstruction(instructions);
- LOG.debug("Instructions contain: {}", ib.getInstruction());
- flowBuilder.setInstructions(isb.build());
- writeFlow(flowBuilder, nodeBuilder);
- LOG.info("EGRESS:default programConntrackNewDropRule() flows are written");
- } else {
- removeFlow(flowBuilder, nodeBuilder);
- }
- }
+ private void programConntrackNewDropRule(Long dpidLong, String segmentationId,
+ long localPort, Integer priority, boolean write) {
+ MatchBuilder matchBuilder = new MatchBuilder();
+
+ String flowName = "Egress_Fixed_Conntrk_NewDrop_" + segmentationId + "_" + localPort + "_";
+ matchBuilder = MatchUtils.createInPortMatch(matchBuilder, dpidLong, localPort);
+ matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_NEW_CT_STATE,
+ MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, true);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
+ }
+
+ private void programConntrackInvDropRule(Long dpidLong, String segmentationId,
+ long localPort, Integer priority, boolean write) {
+ MatchBuilder matchBuilder = new MatchBuilder();
+ String flowName = "Egress_Fixed_Conntrk_InvDrop_" + segmentationId + "_" + localPort + "_";
+ matchBuilder = MatchUtils.createInPortMatch(matchBuilder, dpidLong, localPort);
+ matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_INV_CT_STATE,
+ MatchUtils.TRACKED_INV_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, true);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
+ }
/**
* Allows IPv4/v6 packet egress from the src mac address.
* @param dpidLong the dpid
+ * @param isIpv6 whether the rule is for ipv6
* @param segmentationId the segementation id
* @param srcMac the src mac address
* @param write add or remove
* @param protoPortMatchPriority the protocol match priority.
*/
- private void egressAclIP(Long dpidLong, boolean isIpv6, String segmentationId, String srcMac,
+ private void egressAclIp(Long dpidLong, boolean isIpv6, String segmentationId, String srcMac,
boolean write, Integer protoPortMatchPriority ) {
- NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
MatchBuilder matchBuilder = new MatchBuilder();
String flowId = "Egress_IP" + segmentationId + "_" + srcMac + "_Permit_";
if (isIpv6) {
matchBuilder = MatchUtils.createV6EtherMatchWithType(matchBuilder,srcMac,null);
} else {
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,srcMac,null);
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,srcMac,null,MatchUtils.ETHERTYPE_IPV4);
}
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, false);
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority, matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
if (isIpv6) {
matchBuilder = MatchUtils.createV6EtherMatchWithType(matchBuilder,srcMac,null);
} else {
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,srcMac,null);
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,srcMac,null,MatchUtils.ETHERTYPE_IPV4);
}
/* Custom TCP Match */
rangeflowId = rangeflowId + "_Permit";
MatchUtils.addLayer4MatchWithMask(matchBuilder, MatchUtils.TCP_SHORT,
0, port, portMaskMap.get(port));
- syncFlow(rangeflowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(rangeflowId, protoPortMatchPriority,
+ matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
} else {
flowId = flowId + "_Permit";
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority,
+ matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
}
boolean isIpv6 = NeutronSecurityRule.ETHERTYPE_IPV6.equals(portSecurityRule.getSecurityRuleEthertype());
if (isIpv6) {
- egressAclIcmpV6(dpidLong, segmentationId, srcMac, portSecurityRule, dstAddress, write, protoPortMatchPriority);
+ egressAclIcmpV6(dpidLong, segmentationId, srcMac, portSecurityRule, dstAddress, write,
+ protoPortMatchPriority);
} else {
- egressAclIcmpV4(dpidLong, segmentationId, srcMac, portSecurityRule, dstAddress, write, protoPortMatchPriority);
+ egressAclIcmpV4(dpidLong, segmentationId, srcMac, portSecurityRule, dstAddress, write,
+ protoPortMatchPriority);
}
}
MatchBuilder matchBuilder = new MatchBuilder();
String flowId = "Egress_ICMP_" + segmentationId + "_" + srcMac + "_";
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,srcMac,null);
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,srcMac,null,MatchUtils.ETHERTYPE_IPV4);
/*Custom ICMP Match */
- if (portSecurityRule.getSecurityRulePortMin() != null &&
- portSecurityRule.getSecurityRulePortMax() != null) {
+ if (portSecurityRule.getSecurityRulePortMin() != null
+ && portSecurityRule.getSecurityRulePortMax() != null) {
flowId = flowId + portSecurityRule.getSecurityRulePortMin().shortValue() + "_"
+ portSecurityRule.getSecurityRulePortMax().shortValue() + "_";
matchBuilder = MatchUtils.createICMPv4Match(matchBuilder,
}
}
flowId = flowId + "_Permit";
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority, matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
matchBuilder = MatchUtils.createV6EtherMatchWithType(matchBuilder,srcMac,null);
/*Custom ICMP Match */
- if (portSecurityRule.getSecurityRulePortMin() != null &&
- portSecurityRule.getSecurityRulePortMax() != null) {
+ if (portSecurityRule.getSecurityRulePortMin() != null
+ && portSecurityRule.getSecurityRulePortMax() != null) {
flowId = flowId + portSecurityRule.getSecurityRulePortMin().shortValue() + "_"
+ portSecurityRule.getSecurityRulePortMax().shortValue() + "_";
matchBuilder = MatchUtils.createICMPv6Match(matchBuilder,
new Ipv6Prefix(portSecurityRule.getSecurityRuleRemoteIpPrefix()));
}
flowId = flowId + "_Permit";
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, false);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority, matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
if (isIpv6) {
matchBuilder = MatchUtils.createV6EtherMatchWithType(matchBuilder,srcMac,null);
} else {
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,srcMac,null);
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,srcMac,null,MatchUtils.ETHERTYPE_IPV4);
}
/* Custom UDP Match */
rangeflowId = rangeflowId + "_Permit";
MatchUtils.addLayer4MatchWithMask(matchBuilder, MatchUtils.UDP_SHORT,
0, port, portMaskMap.get(port));
- syncFlow(rangeflowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(rangeflowId, protoPortMatchPriority,
+ matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
} else {
flowId = flowId + "_Permit";
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority,
+ matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
}
String flowName = "Egress_DHCP_Client" + "_Permit_";
MatchBuilder matchBuilder = new MatchBuilder();
MatchUtils.createDhcpMatch(matchBuilder, DHCP_DESTINATION_PORT, DHCP_SOURCE_PORT);
- syncFlow(flowName, nodeBuilder, matchBuilder, priority, write, false, false);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
String flowName = "Egress_DHCPv6_Client" + "_Permit_";
MatchBuilder matchBuilder = new MatchBuilder();
MatchUtils.createDhcpv6Match(matchBuilder, DHCPV6_DESTINATION_PORT, DHCPV6_SOURCE_PORT);
- syncFlow(flowName, nodeBuilder, matchBuilder, priority, write, false, false);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
*/
private void egressAclDhcpDropServerTrafficfromVm(Long dpidLong, long localPort,
boolean write, Integer priority) {
-
- NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
String flowName = "Egress_DHCP_Server" + "_" + localPort + "_DROP_";
MatchBuilder matchBuilder = new MatchBuilder();
MatchUtils.createInPortMatch(matchBuilder, dpidLong, localPort);
MatchUtils.createDhcpMatch(matchBuilder, DHCP_SOURCE_PORT, DHCP_DESTINATION_PORT);
- syncFlow(flowName, nodeBuilder, matchBuilder, priority, write, true, false);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, true);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
private void egressAclDhcpv6DropServerTrafficfromVm(Long dpidLong, long localPort,
boolean write, Integer priority) {
- NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
String flowName = "Egress_DHCPv6_Server" + "_" + localPort + "_DROP_";
MatchBuilder matchBuilder = new MatchBuilder();
MatchUtils.createInPortMatch(matchBuilder, dpidLong, localPort);
MatchUtils.createDhcpv6Match(matchBuilder, DHCPV6_SOURCE_PORT, DHCPV6_DESTINATION_PORT);
- syncFlow(flowName, nodeBuilder, matchBuilder, priority, write, true, false);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, true);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
private void egressAclAllowTrafficFromVmIpMacPair(Long dpidLong, long localPort,
String attachedMac, String srcIp,
Integer priority, boolean write) {
- NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
- String flowName = "Egress_Allow_VM_IP_MAC" + "_" + localPort + attachedMac + "_Permit_";
MatchBuilder matchBuilder = new MatchBuilder();
MatchUtils.createSrcL3Ipv4MatchWithMac(matchBuilder, new Ipv4Prefix(srcIp),new MacAddress(attachedMac));
MatchUtils.createInPortMatch(matchBuilder, dpidLong, localPort);
LOG.debug("egressAclAllowTrafficFromVmIpMacPair: MatchBuilder contains: {}", matchBuilder);
- syncFlow(flowName, nodeBuilder, matchBuilder, priority, write, false, false);
+ String flowName = "Egress_Allow_VM_IP_MAC" + "_" + localPort + attachedMac + "_Permit_";
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
private void egressAclAllowTrafficFromVmIpV6MacPair(Long dpidLong, long localPort,
String attachedMac, String srcIp,
Integer priority, boolean write) {
- NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
- String flowName = "Egress_Allow_VM_IPv6_MAC" + "_" + localPort + attachedMac + "_Permit_";
MatchBuilder matchBuilder = new MatchBuilder();
MatchUtils.createSrcL3Ipv6MatchWithMac(matchBuilder, new Ipv6Prefix(srcIp),new MacAddress(attachedMac));
MatchUtils.createInPortMatch(matchBuilder, dpidLong, localPort);
LOG.debug("egressAclAllowTrafficFromVmIpMacPair: MatchBuilder contains: {}", matchBuilder);
- syncFlow(flowName, nodeBuilder, matchBuilder, priority, write, false, false);
+ String flowName = "Egress_Allow_VM_IPv6_MAC" + "_" + localPort + attachedMac + "_Permit_";
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
+ }
+
+ private void addConntrackMatch(MatchBuilder matchBuilder, int state, int mask) {
+ if (securityServicesManager.isConntrackEnabled()) {
+ MatchUtils.addCtState(matchBuilder, state, mask );
+ }
+
+ }
+
+ private FlowBuilder addInstructionWithConntrackCommit( FlowBuilder flowBuilder , boolean isDrop) {
+ InstructionBuilder instructionBuilder = null;
+ if (securityServicesManager.isConntrackEnabled()) {
+ Action conntrackAction = ActionUtils.nxConntrackAction(1, 0L, 0, (short)0xff);
+ instructionBuilder = InstructionUtils
+ .createInstructionBuilder(ActionUtils.conntrackActionBuilder(conntrackAction), 1, false);
+ }
+ return addPipelineInstruction(flowBuilder,instructionBuilder, isDrop);
+ }
+
+ private FlowBuilder addInstructionWithConntrackRecirc( FlowBuilder flowBuilder) {
+ InstructionBuilder instructionBuilder = null;
+ if (securityServicesManager.isConntrackEnabled()) {
+ Action conntrackAction = ActionUtils.nxConntrackAction(0, 0L, 0, (short)0x0);
+
+ instructionBuilder = InstructionUtils
+ .createInstructionBuilder(ActionUtils.conntrackActionBuilder(conntrackAction), 1, false);
+ List<Instruction> instructionsList = Lists.newArrayList();
+ instructionsList.add(instructionBuilder.build());
+ InstructionsBuilder isb = new InstructionsBuilder();
+ isb.setInstruction(instructionsList);
+ flowBuilder.setInstructions(isb.build());
+ }
+ return flowBuilder;
+ }
+
+ private FlowBuilder addPipelineInstruction( FlowBuilder flowBuilder ,
+ InstructionBuilder instructionBuilder,boolean isDrop) {
+ InstructionBuilder pipeLineIndstructionBuilder = createPipleLineInstructionBuilder(isDrop);
+ List<Instruction> instructionsList = Lists.newArrayList();
+ instructionsList.add(pipeLineIndstructionBuilder.build());
+ if (null != instructionBuilder) {
+ instructionsList.add(instructionBuilder.build());
+ }
+ InstructionsBuilder isb = new InstructionsBuilder();
+ isb.setInstruction(instructionsList);
+ flowBuilder.setInstructions(isb.build());
+ return flowBuilder;
}
+ private InstructionBuilder createPipleLineInstructionBuilder(boolean drop) {
+ InstructionBuilder ib = this.getMutablePipelineInstructionBuilder();
+ if (drop) {
+ InstructionUtils.createDropInstructions(ib);
+ }
+ ib.setOrder(0);
+ List<Instruction> instructionsList = Lists.newArrayList();
+ ib.setKey(new InstructionKey(0));
+ instructionsList.add(ib.build());
+ return ib;
+ }
/**
* Add or remove flow to the node.
- *
- * @param flowName the the flow id
+ * @param flowBuilder the flow builder
* @param nodeBuilder the node builder
- * @param matchBuilder the matchbuilder
- * @param priority the protocol priority
* @param write whether it is a write
- * @param drop whether it is a drop or forward
- * @param isCtCommit commit the connection or CT to track
*/
- private void syncFlow(String flowName, NodeBuilder nodeBuilder,
- MatchBuilder matchBuilder, Integer priority,
- boolean write, boolean drop, boolean isCtCommit) {
- MatchBuilder matchBuilder1 = matchBuilder;
- if (isCtCommit) {
- matchBuilder1 = MatchUtils.addCtState(matchBuilder1, MatchUtils.TRACKED_NEW_CT_STATE,
- MatchUtils.TRACKED_NEW_CT_STATE_MASK);
- }
- FlowBuilder flowBuilder = new FlowBuilder();
- flowBuilder.setMatch(matchBuilder1.build());
- FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
-
+ private void syncFlow(FlowBuilder flowBuilder, NodeBuilder nodeBuilder,
+ boolean write) {
if (write) {
- InstructionBuilder ib = this.getMutablePipelineInstructionBuilder();
- InstructionBuilder ib1 = new InstructionBuilder();
- ActionBuilder ab = new ActionBuilder();
- ApplyActionsBuilder aab = new ApplyActionsBuilder();
- if (drop) {
- InstructionUtils.createDropInstructions(ib);
- }
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
- InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructionsList = Lists.newArrayList();
- instructionsList.add(ib.build());
- if (isCtCommit) {
- LOG.info("Adding Conntarck rule, flowname = " + flowName);
- ab.setAction(ActionUtils.nxConntrackAction(1, 0L, 0, (short)0xff));
- ab.setOrder(0);
- ab.setKey(new ActionKey(0));
- List<Action> actionList = Lists.newArrayList();
- actionList.add(ab.build());
- aab.setAction(actionList);
- ib1.setOrder(1);
- ib1.setKey(new InstructionKey(1));
- ib1.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- instructionsList.add(ib1.build());
- }
- isb.setInstruction(instructionsList);
- flowBuilder.setInstructions(isb.build());
writeFlow(flowBuilder, nodeBuilder);
} else {
removeFlow(flowBuilder, nodeBuilder);
}
}
+
@Override
public void setDependencies(BundleContext bundleContext, ServiceReference serviceReference) {
super.setDependencies(bundleContext.getServiceReference(EgressAclProvider.class.getName()), this);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import com.google.common.collect.Lists;
-import org.opendaylight.ovsdb.openstack.netvirt.api.*;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.IcmpEchoProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.InboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.InboundNatProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
/*
- * Copyright (c) 2014, 2015 Red Hat, Inc. and others. All rights reserved.
+ * Copyright (c) 2014 - 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import com.google.common.collect.Lists;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.IngressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityGroupCacheManger;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefixBuilder;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.IngressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityGroupCacheManger;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.math.BigInteger;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
*
*/
- if (portSecurityRule == null ||
- portSecurityRule.getSecurityRuleEthertype() == null ||
- portSecurityRule.getSecurityRuleDirection() == null) {
+ if (portSecurityRule == null
+ || portSecurityRule.getSecurityRuleEthertype() == null
+ || portSecurityRule.getSecurityRuleDirection() == null) {
continue;
}
String securityRuleEtherType = portSecurityRule.getSecurityRuleEthertype();
boolean isIpv6 = NeutronSecurityRule.ETHERTYPE_IPV6.equals(securityRuleEtherType);
if (!isIpv6 && !NeutronSecurityRule.ETHERTYPE_IPV4.equals(securityRuleEtherType)) {
- LOG.debug("programPortSecurityRule: SecurityRuleEthertype {} does not match IPv4/v6.", securityRuleEtherType);
+ LOG.debug("programPortSecurityRule: SecurityRuleEthertype {} does not match IPv4/v6.",
+ securityRuleEtherType);
return;
}
if (null == portSecurityRule.getSecurityRuleProtocol()) {
- ingressAclIP(dpid, isIpv6, segmentationId, attachedMac,
+ ingressAclIp(dpid, isIpv6, segmentationId, attachedMac,
write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
} else {
String ipaddress = null;
try {
InetAddress address = InetAddress.getByName(vmIp.getIpAddress());
if ((isIpv6 && (address instanceof Inet4Address)) || (!isIpv6 && address instanceof Inet6Address)) {
- LOG.debug("programPortSecurityRule: Remote vmIP {} does not match with SecurityRuleEthertype {}.", ipaddress, securityRuleEtherType);
+ LOG.debug("programPortSecurityRule: Remote vmIP {} does not match "
+ + "with SecurityRuleEthertype {}.", ipaddress, securityRuleEtherType);
return;
}
- } catch(UnknownHostException e) {
- LOG.warn("Invalid IP address {}", ipaddress);
+ } catch (UnknownHostException e) {
+ LOG.warn("Invalid IP address {}", ipaddress, e);
return;
}
}
switch (portSecurityRule.getSecurityRuleProtocol()) {
- case MatchUtils.TCP:
- LOG.debug("programPortSecurityRule: Rule matching TCP", portSecurityRule);
- ingressAclTcp(dpid, segmentationId, attachedMac, portSecurityRule, ipaddress,
+ case MatchUtils.TCP:
+ LOG.debug("programPortSecurityRule: Rule matching TCP", portSecurityRule);
+ ingressAclTcp(dpid, segmentationId, attachedMac, portSecurityRule, ipaddress,
write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
- break;
- case MatchUtils.UDP:
- LOG.debug("programPortSecurityRule: Rule matching UDP", portSecurityRule);
- ingressAclUdp(dpid, segmentationId, attachedMac, portSecurityRule, ipaddress,
+ break;
+ case MatchUtils.UDP:
+ LOG.debug("programPortSecurityRule: Rule matching UDP", portSecurityRule);
+ ingressAclUdp(dpid, segmentationId, attachedMac, portSecurityRule, ipaddress,
write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
- break;
- case MatchUtils.ICMP:
- case MatchUtils.ICMPV6:
- LOG.debug("programPortSecurityRule: Rule matching ICMP", portSecurityRule);
- ingressAclIcmp(dpid, segmentationId, attachedMac, portSecurityRule, ipaddress,
+ break;
+ case MatchUtils.ICMP:
+ case MatchUtils.ICMPV6:
+ LOG.debug("programPortSecurityRule: Rule matching ICMP", portSecurityRule);
+ ingressAclIcmp(dpid, segmentationId, attachedMac, portSecurityRule, ipaddress,
write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
- break;
- default:
- LOG.info("programPortSecurityAcl: Protocol is not TCP/UDP/ICMP but other " +
- "protocol = ", portSecurityRule.getSecurityRuleProtocol());
- ingressOtherProtocolAclHandler(dpid, segmentationId, attachedMac, portSecurityRule,
+ break;
+ default:
+ LOG.info("programPortSecurityAcl: Protocol is not TCP/UDP/ICMP but other "
+ + "protocol = ", portSecurityRule.getSecurityRuleProtocol());
+ ingressOtherProtocolAclHandler(dpid, segmentationId, attachedMac, portSecurityRule,
null, write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
- break;
+ break;
}
}
}
private void ingressOtherProtocolAclHandler(Long dpidLong, String segmentationId, String dstMac,
NeutronSecurityRule portSecurityRule, String srcAddress,
boolean write, Integer protoPortMatchPriority) {
-
- MatchBuilder matchBuilder = new MatchBuilder();
- String flowId = "Ingress_Other_" + segmentationId + "_" + dstMac + "_";
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,dstMac);
- short proto = 0;
- try {
- Integer protocol = new Integer(portSecurityRule.getSecurityRuleProtocol());
- proto = protocol.shortValue();
- flowId = flowId + proto;
- } catch (NumberFormatException e) {
- LOG.error("Protocol vlaue conversion failure", e);
- }
- matchBuilder = MatchUtils.createIpProtocolMatch(matchBuilder, proto);
- if (null != srcAddress) {
- flowId = flowId + srcAddress;
- matchBuilder = MatchUtils.addRemoteIpPrefix(matchBuilder,
- MatchUtils.iPv4PrefixFromIPv4Address(srcAddress), null);
- } else if (null != portSecurityRule.getSecurityRuleRemoteIpPrefix()) {
- flowId = flowId + portSecurityRule.getSecurityRuleRemoteIpPrefix();
- matchBuilder = MatchUtils.addRemoteIpPrefix(matchBuilder,
- new Ipv4Prefix(portSecurityRule.getSecurityRuleRemoteIpPrefix()),null);
- }
- NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
- flowId = flowId + "_Permit";
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ MatchBuilder matchBuilder = new MatchBuilder();
+ String flowId = "Ingress_Other_" + segmentationId + "_" + dstMac + "_";
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,dstMac,MatchUtils.ETHERTYPE_IPV4);
+ short proto = 0;
+ try {
+ Integer protocol = new Integer(portSecurityRule.getSecurityRuleProtocol());
+ proto = protocol.shortValue();
+ flowId = flowId + proto;
+ } catch (NumberFormatException e) {
+ LOG.error("Protocol vlaue conversion failure", e);
+ }
+ matchBuilder = MatchUtils.createIpProtocolMatch(matchBuilder, proto);
+ if (null != srcAddress) {
+ flowId = flowId + srcAddress;
+ matchBuilder = MatchUtils.addRemoteIpPrefix(matchBuilder,
+ MatchUtils.iPv4PrefixFromIPv4Address(srcAddress), null);
+ } else if (null != portSecurityRule.getSecurityRuleRemoteIpPrefix()) {
+ flowId = flowId + portSecurityRule.getSecurityRuleRemoteIpPrefix();
+ matchBuilder = MatchUtils.addRemoteIpPrefix(matchBuilder,
+ new Ipv4Prefix(portSecurityRule.getSecurityRuleRemoteIpPrefix()),null);
+ }
+ flowId = flowId + "_Permit";
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority,
+ matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
@Override
}
private void programArpRule(Long dpid, String segmentationId, long localPort, String attachMac, boolean write) {
- String nodeName = Constants.OPENFLOW_NODE_PREFIX + dpid;
MatchBuilder matchBuilder = new MatchBuilder();
- NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
String flowId = "Ingress_ARP_" + segmentationId + "_" + localPort + "_";
- EthernetMatchBuilder ethernetType = new EthernetMatchBuilder();
- EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
- ethTypeBuilder.setType(new EtherType(0x0806L));
- ethernetType.setEthernetType(ethTypeBuilder.build());
- matchBuilder.setEthernetMatch(ethernetType.build());
-
- ArpMatchBuilder arpDstMatch = new ArpMatchBuilder();
- ArpTargetHardwareAddressBuilder arpDst = new ArpTargetHardwareAddressBuilder();
- arpDst.setAddress(new MacAddress(attachMac));
- arpDstMatch.setArpTargetHardwareAddress(arpDst.build());
- matchBuilder.setLayer3Match(arpDstMatch.build());
- syncFlow(flowId, nodeBuilder, matchBuilder, Constants.PROTO_MATCH_PRIORITY, write, false, securityServicesManager.isConntrackEnabled());
+ MatchUtils.createV4EtherMatchWithType(matchBuilder,null,null,MatchUtils.ETHERTYPE_ARP);
+ MatchUtils.addArpMacMatch(matchBuilder, null, attachMac);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, Constants.PROTO_MATCH_PRIORITY,
+ matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpid);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
private void programIngressAclFixedConntrackRule(Long dpid,
String segmentationId, String attachMac, long localPort, boolean write) {
try {
String nodeName = Constants.OPENFLOW_NODE_PREFIX + dpid;
- programConntrackUntrackRule(nodeName, segmentationId, localPort, attachMac,
+ programConntrackUntrackRule(dpid, segmentationId, localPort, attachMac,
Constants.CT_STATE_UNTRACKED_PRIORITY, write );
- programConntrackTrackedPlusEstRule(nodeName, segmentationId, localPort, attachMac,
- Constants.CT_STATE_TRACKED_EST_PRIORITY, write );
- programConntrackNewDropRule(nodeName, segmentationId, localPort, attachMac,
+ programConntrackTrackedPlusEstRule(dpid, segmentationId, localPort, attachMac,
+ Constants.CT_STATE_TRACKED_EXIST_PRIORITY, write );
+ programConntrackTrackedPlusRelRule(dpid, segmentationId, localPort, attachMac,
+ Constants.CT_STATE_TRACKED_EXIST_PRIORITY, write );
+ programConntrackInvDropRule(dpid, segmentationId, localPort, attachMac,
+ Constants.CT_STATE_NEW_PRIORITY_DROP, write );
+ programConntrackNewDropRule(dpid, segmentationId, localPort, attachMac,
Constants.CT_STATE_NEW_PRIORITY_DROP, write );
LOG.info("programIngressAclFixedConntrackRule : default connection tracking rule are added.");
} catch (Exception e) {
}
}
- private void programConntrackUntrackRule(String nodeName, String segmentationId,
+ private void programConntrackUntrackRule(Long dpidLong, String segmentationId,
long localPort, String attachMac, Integer priority, boolean write) {
MatchBuilder matchBuilder = new MatchBuilder();
- NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
String flowName = "Ingress_Fixed_Conntrk_Untrk_" + segmentationId + "_" + localPort + "_";
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac);
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac,MatchUtils.ETHERTYPE_IPV4);
matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.UNTRACKED_CT_STATE,
MatchUtils.UNTRACKED_CT_STATE_MASK);
- FlowBuilder flowBuilder = new FlowBuilder();
- flowBuilder.setMatch(matchBuilder.build());
- FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
- if (write) {
- InstructionBuilder ib = new InstructionBuilder();
- List<Instruction> instructionsList = Lists.newArrayList();
- InstructionsBuilder isb = new InstructionsBuilder();
- ActionBuilder ab = new ActionBuilder();
- ab.setAction(ActionUtils.nxConntrackAction(0, 0L, 0, (short)0x0));
- // 0xff means no table, 0x0 is table = 0
- // nxConntrackAction(Integer flags, Long zoneSrc,Integer conntrackZone, Short recircTable)
- ab.setOrder(0);
- ab.setKey(new ActionKey(0));
- List<Action> actionList = Lists.newArrayList();
- actionList.add(ab.build());
- ApplyActionsBuilder aab = new ApplyActionsBuilder();
- aab.setAction(actionList);
-
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
- ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- instructionsList.add(ib.build());
- isb.setInstruction(instructionsList);
- flowBuilder.setInstructions(isb.build());
- writeFlow(flowBuilder, nodeBuilder);
- LOG.info("INGRESS:default programConntrackUntrackRule() flows are written");
- } else {
- removeFlow(flowBuilder, nodeBuilder);
- }
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addInstructionWithConntrackRecirc(flowBuilder);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
- private void programConntrackTrackedPlusEstRule(String nodeName, String segmentationId,
+ private void programConntrackTrackedPlusEstRule(Long dpidLong, String segmentationId,
long localPort, String attachMac,Integer priority, boolean write) {
MatchBuilder matchBuilder = new MatchBuilder();
- NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
String flowName = "Ingress_Fixed_Conntrk_TrkEst_" + segmentationId + "_" + localPort + "_";
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac);
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac,MatchUtils.ETHERTYPE_IPV4);
matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_EST_CT_STATE,
- MatchUtils.TRACKED_EST_CT_STATE_MASK);
- FlowBuilder flowBuilder = new FlowBuilder();
- flowBuilder.setMatch(matchBuilder.build());
- FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
- if (write) {
- InstructionBuilder ib = new InstructionBuilder();
- List<Instruction> instructionsList = Lists.newArrayList();
- InstructionsBuilder isb = new InstructionsBuilder();
+ MatchUtils.TRACKED_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
+ }
- ib = this.getMutablePipelineInstructionBuilder();
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
- instructionsList.add(ib.build());
- isb.setInstruction(instructionsList);
- flowBuilder.setInstructions(isb.build());
- writeFlow(flowBuilder, nodeBuilder);
- LOG.info("INGRESS:default programConntrackTrackedPlusEstRule() flows are written");
- } else {
- removeFlow(flowBuilder, nodeBuilder);
- }
+ private void programConntrackTrackedPlusRelRule(Long dpidLong, String segmentationId,
+ long localPort, String attachMac,Integer priority, boolean write) {
+ MatchBuilder matchBuilder = new MatchBuilder();
+ String flowName = "Ingress_Fixed_Conntrk_TrkRel_" + segmentationId + "_" + localPort + "_";
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac,MatchUtils.ETHERTYPE_IPV4);
+ matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_REL_CT_STATE,
+ MatchUtils.TRACKED_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
- private void programConntrackNewDropRule(String nodeName, String segmentationId,
+ private void programConntrackNewDropRule(Long dpidLong, String segmentationId,
long localPort, String attachMac, Integer priority, boolean write) {
MatchBuilder matchBuilder = new MatchBuilder();
- NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
- String flowName = "Ingress_Fixed_Conntrk_NewDrop_" + segmentationId + "_" + localPort + "_";
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac);
- matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.NEW_CT_STATE, MatchUtils.NEW_CT_STATE_MASK);
- FlowBuilder flowBuilder = new FlowBuilder();
- flowBuilder.setMatch(matchBuilder.build());
- FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
- if (write) {
- // Instantiate the Builders for the OF Actions and Instructions
- InstructionBuilder ib = new InstructionBuilder();
- InstructionsBuilder isb = new InstructionsBuilder();
- // Instructions List Stores Individual Instructions
- List<Instruction> instructions = Lists.newArrayList();
+ String flowName = "Ingress_Fixed_Conntrk_NewDrop_" + segmentationId + "_" + localPort + "_";
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac,0x0800L);
+ matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_NEW_CT_STATE,
+ MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, true);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
+ }
- // Set the Output Port/Iface
- InstructionUtils.createDropInstructions(ib);
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
- instructions.add(ib.build());
-
- // Add InstructionBuilder to the Instruction(s)Builder List
- isb.setInstruction(instructions);
- LOG.debug("Instructions contain: {}", ib.getInstruction());
- // Add InstructionsBuilder to FlowBuilder
- flowBuilder.setInstructions(isb.build());
- writeFlow(flowBuilder, nodeBuilder);
- LOG.info("INGRESS:default programConntrackNewDropRule flows are written");
- } else {
- removeFlow(flowBuilder, nodeBuilder);
- }
+ private void programConntrackInvDropRule(Long dpidLong, String segmentationId,
+ long localPort, String attachMac, Integer priority, boolean write) {
+ MatchBuilder matchBuilder = new MatchBuilder();
+ String flowName = "Ingress_Fixed_Conntrk_InvDrop_" + segmentationId + "_" + localPort + "_";
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac, MatchUtils.ETHERTYPE_IPV4);
+ matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_INV_CT_STATE,
+ MatchUtils.TRACKED_INV_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowName, priority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, true);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
* Allows an IPv4/v6 packet ingress to the destination mac address.
* @param dpidLong the dpid
+ * @param isIpv6 indicates whether this is an Ipv
* @param segmentationId the segementation id
* @param dstMac the destination mac address
* @param write add or remove
* @param protoPortMatchPriority the protocol match priority.
*/
- private void ingressAclIP(Long dpidLong, boolean isIpv6, String segmentationId, String dstMac,
+ private void ingressAclIp(Long dpidLong, boolean isIpv6, String segmentationId, String dstMac,
boolean write, Integer protoPortMatchPriority ) {
- NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
MatchBuilder matchBuilder = new MatchBuilder();
String flowId = "Ingress_IP" + segmentationId + "_" + dstMac + "_Permit_";
if (isIpv6) {
matchBuilder = MatchUtils.createV6EtherMatchWithType(matchBuilder,null,dstMac);
- }else {
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,dstMac);
+ } else {
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,dstMac,MatchUtils.ETHERTYPE_IPV4);
}
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority, matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
if (isIpv6) {
matchBuilder = MatchUtils.createV6EtherMatchWithType(matchBuilder,null,dstMac);
} else {
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,dstMac);
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,dstMac,MatchUtils.ETHERTYPE_IPV4);
}
/* Custom TCP Match*/
rangeflowId = rangeflowId + "_Permit";
MatchUtils.addLayer4MatchWithMask(matchBuilder, MatchUtils.TCP_SHORT,
0, port, portMaskMap.get(port));
- syncFlow(rangeflowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(rangeflowId, protoPortMatchPriority,
+ matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
} else {
flowId = flowId + "_Permit";
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority,
+ matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
}
String flowId = "Ingress_UDP_" + segmentationId + "_" + dstMac + "_";
if (isIpv6) {
matchBuilder = MatchUtils.createV6EtherMatchWithType(matchBuilder,null,dstMac);
- }else {
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,dstMac);
+ } else {
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,dstMac,MatchUtils.ETHERTYPE_IPV4);
}
/* Custom UDP Match */
rangeflowId = rangeflowId + "_Permit";
MatchUtils.addLayer4MatchWithMask(matchBuilder, MatchUtils.UDP_SHORT,
0, port, portMaskMap.get(port));
- syncFlow(rangeflowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(rangeflowId, protoPortMatchPriority,
+ matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
} else {
flowId = flowId + "_Permit";
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority,
+ matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
}
boolean isIpv6 = NeutronSecurityRule.ETHERTYPE_IPV6.equals(portSecurityRule.getSecurityRuleEthertype());
if (isIpv6) {
- ingressAclIcmpV6(dpidLong, segmentationId, dstMac, portSecurityRule, srcAddress, write, protoPortMatchPriority);
+ ingressAclIcmpV6(dpidLong, segmentationId, dstMac, portSecurityRule, srcAddress,
+ write, protoPortMatchPriority);
} else {
- ingressAclIcmpV4(dpidLong, segmentationId, dstMac, portSecurityRule, srcAddress, write, protoPortMatchPriority);
+ ingressAclIcmpV4(dpidLong, segmentationId, dstMac, portSecurityRule, srcAddress,
+ write, protoPortMatchPriority);
}
}
MatchBuilder matchBuilder = new MatchBuilder();
String flowId = "Ingress_ICMP_" + segmentationId + "_" + dstMac + "_";
- matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,dstMac);
+ matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,dstMac,MatchUtils.ETHERTYPE_IPV4);
/* Custom ICMP Match */
- if (portSecurityRule.getSecurityRulePortMin() != null &&
- portSecurityRule.getSecurityRulePortMax() != null) {
+ if (portSecurityRule.getSecurityRulePortMin() != null
+ && portSecurityRule.getSecurityRulePortMax() != null) {
flowId = flowId + portSecurityRule.getSecurityRulePortMin().shortValue() + "_"
+ portSecurityRule.getSecurityRulePortMax().shortValue() + "_";
matchBuilder = MatchUtils.createICMPv4Match(matchBuilder,
new Ipv4Prefix(portSecurityRule.getSecurityRuleRemoteIpPrefix()),null);
}
}
- NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
flowId = flowId + "_Permit";
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, securityServicesManager.isConntrackEnabled());
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority, matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
matchBuilder = MatchUtils.createV6EtherMatchWithType(matchBuilder,null,dstMac);
/* Custom ICMP Match */
- if (portSecurityRule.getSecurityRulePortMin() != null &&
- portSecurityRule.getSecurityRulePortMax() != null) {
+ if (portSecurityRule.getSecurityRulePortMin() != null
+ && portSecurityRule.getSecurityRulePortMax() != null) {
flowId = flowId + portSecurityRule.getSecurityRulePortMin().shortValue() + "_"
+ portSecurityRule.getSecurityRulePortMax().shortValue() + "_";
matchBuilder = MatchUtils.createICMPv6Match(matchBuilder,
new Ipv6Prefix(portSecurityRule
.getSecurityRuleRemoteIpPrefix()),null);
}
+ addConntrackMatch(matchBuilder, MatchUtils.TRACKED_NEW_CT_STATE,MatchUtils.TRACKED_NEW_CT_STATE_MASK);
NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dpidLong);
flowId = flowId + "_Permit";
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, false);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority, matchBuilder, getTable());
+ addInstructionWithConntrackCommit(flowBuilder, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
MatchBuilder matchBuilder = new MatchBuilder();
MatchUtils.createDhcpServerMatch(matchBuilder, dhcpMacAddress, 67, 68).build();
String flowId = "Ingress_DHCP_Server" + segmentationId + "_" + dhcpMacAddress + "_Permit_";
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, false);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
}
/**
MatchBuilder matchBuilder = new MatchBuilder();
MatchUtils.createDhcpv6ServerMatch(matchBuilder, dhcpMacAddress, 547, 546).build();
String flowId = "Ingress_DHCPv6_Server" + segmentationId + "_" + dhcpMacAddress + "_Permit_";
- syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false, false);
+ FlowBuilder flowBuilder = FlowUtils.createFlowBuilder(flowId, protoPortMatchPriority, matchBuilder, getTable());
+ addPipelineInstruction(flowBuilder, null, false);
+ syncFlow(flowBuilder ,nodeBuilder, write);
+ }
+
+ private void addConntrackMatch(MatchBuilder matchBuilder, int state, int mask) {
+ if (securityServicesManager.isConntrackEnabled()) {
+ MatchUtils.addCtState(matchBuilder, state, mask );
+ }
+
+ }
+
+ private FlowBuilder addInstructionWithConntrackCommit( FlowBuilder flowBuilder , boolean isDrop) {
+ InstructionBuilder instructionBuilder = null;
+ if (securityServicesManager.isConntrackEnabled()) {
+ Action conntrackAction = ActionUtils.nxConntrackAction(1, 0L, 0, (short)0xff);
+ instructionBuilder = InstructionUtils
+ .createInstructionBuilder(ActionUtils.conntrackActionBuilder(conntrackAction), 1, false);
+ }
+ return addPipelineInstruction(flowBuilder,instructionBuilder, isDrop);
+ }
+
+ private FlowBuilder addInstructionWithConntrackRecirc( FlowBuilder flowBuilder) {
+ InstructionBuilder instructionBuilder = null;
+ if (securityServicesManager.isConntrackEnabled()) {
+ Action conntrackAction = ActionUtils.nxConntrackAction(0, 0L, 0, (short)0x0);
+ instructionBuilder = InstructionUtils
+ .createInstructionBuilder(ActionUtils.conntrackActionBuilder(conntrackAction), 1, false);
+ List<Instruction> instructionsList = Lists.newArrayList();
+ instructionsList.add(instructionBuilder.build());
+ InstructionsBuilder isb = new InstructionsBuilder();
+ isb.setInstruction(instructionsList);
+ flowBuilder.setInstructions(isb.build());
+ }
+ return flowBuilder;
}
+ private FlowBuilder addPipelineInstruction( FlowBuilder flowBuilder , InstructionBuilder instructionBuilder,
+ boolean isDrop) {
+ InstructionBuilder pipeLineIndstructionBuilder = createPipleLineInstructionBuilder(isDrop);
+ List<Instruction> instructionsList = Lists.newArrayList();
+ instructionsList.add(pipeLineIndstructionBuilder.build());
+ if (null != instructionBuilder) {
+ instructionsList.add(instructionBuilder.build());
+ }
+ InstructionsBuilder isb = new InstructionsBuilder();
+ isb.setInstruction(instructionsList);
+ flowBuilder.setInstructions(isb.build());
+ return flowBuilder;
+ }
+
+ private InstructionBuilder createPipleLineInstructionBuilder(boolean drop) {
+ InstructionBuilder ib = this.getMutablePipelineInstructionBuilder();
+ if (drop) {
+ InstructionUtils.createDropInstructions(ib);
+ }
+ ib.setOrder(0);
+ List<Instruction> instructionsList = Lists.newArrayList();
+ ib.setKey(new InstructionKey(0));
+ instructionsList.add(ib.build());
+ return ib;
+ }
/**
* Add or remove flow to the node.
- *
- * @param flowName the the flow id
+ * @param flowBuilder the flow builder
* @param nodeBuilder the node builder
- * @param matchBuilder the matchbuilder
- * @param priority the protocol priority
* @param write whether it is a write
- * @param drop whether it is a drop or forward
- * @param isCtCommit commit the connection or CT to track
*/
- private void syncFlow(String flowName, NodeBuilder nodeBuilder,
- MatchBuilder matchBuilder, Integer priority,
- boolean write, boolean drop, boolean isCtCommit) {
- MatchBuilder matchBuilder1 = matchBuilder;
- if (isCtCommit) {
- matchBuilder1 = MatchUtils.addCtState(matchBuilder1,MatchUtils.TRACKED_NEW_CT_STATE,
- MatchUtils.TRACKED_NEW_CT_STATE_MASK);
- }
- FlowBuilder flowBuilder = new FlowBuilder();
- flowBuilder.setMatch(matchBuilder1.build());
- FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
-
+ private void syncFlow(FlowBuilder flowBuilder, NodeBuilder nodeBuilder,
+ boolean write) {
if (write) {
- InstructionBuilder ib = this.getMutablePipelineInstructionBuilder();
- InstructionBuilder ib1 = new InstructionBuilder();
- ActionBuilder ab = new ActionBuilder();
- ApplyActionsBuilder aab = new ApplyActionsBuilder();
- if (drop) {
- InstructionUtils.createDropInstructions(ib);
- }
- ib.setOrder(0);
- InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructionsList = Lists.newArrayList();
- ib.setKey(new InstructionKey(0));
- instructionsList.add(ib.build());
- if (isCtCommit) {
- LOG.info("Adding Conntarck rule, flowname = " + flowName);
- ab.setAction(ActionUtils.nxConntrackAction(1, 0L, 0, (short)0xff));
- ab.setOrder(0);
- ab.setKey(new ActionKey(0));
- List<Action> actionList = Lists.newArrayList();
- actionList.add(ab.build());
- aab.setAction(actionList);
- ib1.setOrder(1);
- ib1.setKey(new InstructionKey(1));
- ib1.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- instructionsList.add(ib1.build());
- }
- isb.setInstruction(instructionsList);
- flowBuilder.setInstructions(isb.build());
writeFlow(flowBuilder, nodeBuilder);
} else {
removeFlow(flowBuilder, nodeBuilder);
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L2ForwardingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.L2ForwardingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L2RewriteProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.L2RewriteProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import java.math.BigInteger;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L3ForwardingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.L3ForwardingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
-import org.opendaylight.ovsdb.openstack.netvirt.NetworkHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration.LoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.NetworkHandler;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration.LoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
@Override
public Status programLoadBalancerPoolMemberRules(Node node,
LoadBalancerConfiguration lbConfig, LoadBalancerPoolMember member,
- org.opendaylight.ovsdb.openstack.netvirt.api.Action action) {
+ org.opendaylight.netvirt.openstack.netvirt.api.Action action) {
if (lbConfig == null || member == null) {
LOG.error("Null value for LB config {} or Member {}", lbConfig, member);
return new Status(StatusCode.BADREQUEST);
//Update the multipath rule
manageLoadBalancerVIPRulesFirstPass(nodeBuilder, lbConfig, true);
- if (action.equals(org.opendaylight.ovsdb.openstack.netvirt.api.Action.ADD)) {
+ if (action.equals(org.opendaylight.netvirt.openstack.netvirt.api.Action.ADD)) {
manageLoadBalancerMemberVIPRulesSecondPass(nodeBuilder, lbConfig, member, true);
manageLoadBalancerMemberReverseRules(nodeBuilder, lbConfig, member, true);
return new Status(StatusCode.SUCCESS);
*/
@Override
public Status programLoadBalancerRules(Node node, LoadBalancerConfiguration lbConfig,
- org.opendaylight.ovsdb.openstack.netvirt.api.Action action) {
+ org.opendaylight.netvirt.openstack.netvirt.api.Action action) {
if (lbConfig == null || !lbConfig.isValid()) {
LOG.error("LB config is invalid: {}", lbConfig);
return new Status(StatusCode.BADREQUEST);
nodeBuilder.setId(new NodeId(Constants.OPENFLOW_NODE_PREFIX + getDpid(node)));
nodeBuilder.setKey(new NodeKey(nodeBuilder.getId()));
- if (action.equals(org.opendaylight.ovsdb.openstack.netvirt.api.Action.ADD)) {
+ if (action.equals(org.opendaylight.netvirt.openstack.netvirt.api.Action.ADD)) {
manageLoadBalancerVIPRulesFirstPass(nodeBuilder, lbConfig, true);
manageLoadBalancerVIPRulesSecondPass(nodeBuilder, lbConfig, true);
manageLoadBalancerReverseRules(nodeBuilder, lbConfig, true);
return new Status(StatusCode.SUCCESS);
}
- else if (action.equals(org.opendaylight.ovsdb.openstack.netvirt.api.Action.DELETE)) {
+ else if (action.equals(org.opendaylight.netvirt.openstack.netvirt.api.Action.DELETE)) {
manageLoadBalancerVIPRulesFirstPass(nodeBuilder, lbConfig, false);
manageLoadBalancerVIPRulesSecondPass(nodeBuilder, lbConfig, false);
manageLoadBalancerReverseRules(nodeBuilder, lbConfig, false);
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OutboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.OutboundNatProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import java.math.BigInteger;
import java.net.Inet6Address;
import java.util.List;
import org.apache.commons.net.util.SubnetUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.RoutingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.RoutingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
import com.google.common.collect.Lists;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg4;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg5;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxRegCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcOfEthSrcCaseBuilder;
import org.osgi.framework.BundleContext;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.arp;
import static com.google.common.base.Preconditions.checkNotNull;
import io.netty.buffer.Unpooled;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.arp;
import org.opendaylight.controller.liblldp.EtherTypes;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.arp;
import static com.google.common.base.Preconditions.checkNotNull;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.arp;
import javax.annotation.Nullable;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.arp;
import org.opendaylight.controller.liblldp.NetUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.api.GatewayMacResolverListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.GatewayMacResolverListener;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.arp;
import org.opendaylight.controller.liblldp.EtherTypes;
import org.opendaylight.controller.liblldp.Ethernet;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.arp;
import static com.google.common.base.Preconditions.checkNotNull;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.arp;
import java.net.InetAddress;
import java.net.UnknownHostException;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services.arp;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services.arp;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
import org.opendaylight.openflowplugin.api.OFConstants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.GatewayMacResolver;
-import org.opendaylight.ovsdb.openstack.netvirt.api.GatewayMacResolverListener;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.GatewayMacResolver;
+import org.opendaylight.netvirt.openstack.netvirt.api.GatewayMacResolverListener;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.providers.impl.rev150513;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
import org.osgi.framework.BundleContext;
public class NetvirtProvidersImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.providers.impl.rev150513.AbstractNetvirtProvidersImplModule {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers;
+package org.opendaylight.netvirt.openstack.netvirt.providers;
import static org.junit.Assert.assertEquals;
-import org.junit.Before;
import org.junit.Test;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestratorImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.osgi.framework.BundleContext;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
/**
* Unit tests for {@link NetvirtProvidersProvider}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.MdsalHelper;
-import org.opendaylight.ovsdb.openstack.netvirt.NetworkHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ClassifierProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EgressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.IngressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L2ForwardingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.NetworkHandler;
+import org.opendaylight.netvirt.openstack.netvirt.api.ClassifierProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.L2ForwardingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.MdsalHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.BridgeConfigurationManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.EgressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.IngressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/*
- * Copyright (c) 2015 Inocybe and others. All rights reserved.
+ * Copyright (c) 2015 - 2016 Inocybe and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityGroupCacheManger;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityGroupCacheManger;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
/**
* Test method {@link EgressAclService#programPortSecurityGroup(java.lang.Long, java.lang.String,
- * java.lang.String, long, org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup,
+ * java.lang.String, long, NeutronSecurityGroup,
* java.lang.String, boolean)} when portSecurityRule is incomplete
*/
@Test
egressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 1, neutronDestIpList, false, true, true);
- verify(writeTransaction, times(12)).put(any(LogicalDatastoreType.class),
+ verify(writeTransaction, times(14)).put(any(LogicalDatastoreType.class),
any(InstanceIdentifier.class), any(Node.class), eq(true));
- verify(writeTransaction, times(12)).submit();
- verify(commitFuture, times(12)).checkedGet();
+ verify(writeTransaction, times(14)).submit();
+ verify(commitFuture, times(14)).checkedGet();
}
/**
egressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 1, neutronDestIpList, false, true, false);
- verify(writeTransaction, times(12)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
- verify(writeTransaction, times(12)).submit();
- verify(commitFuture, times(12)).get();
+ verify(writeTransaction, times(14)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
+ verify(writeTransaction, times(14)).submit();
+ verify(commitFuture, times(14)).get();
}
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.powermock.api.support.membermodification.MemberModifier;
/*
- * Copyright (c) 2015 Inocybe and others. All rights reserved.
+ * Copyright (c) 2015 - 2016 Inocybe and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityGroupCacheManger;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityGroupCacheManger;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
}
/**
* Test method {@link EgressAclService#programPortSecurityGroup(java.lang.Long, java.lang.String,
- * java.lang.String, long, org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup,
+ * java.lang.String, long, NeutronSecurityGroup,
* java.lang.String, boolean)} when portSecurityRule is incomplete
*/
@Test
ingressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", DHCP_MAC_ADDRESS, 1, false, true, MAC_ADDRESS, true);
- verify(writeTransaction, times(4)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
- verify(writeTransaction, times(4)).submit();
- verify(commitFuture, times(4)).checkedGet();
+ verify(writeTransaction, times(6)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
+ verify(writeTransaction, times(6)).submit();
+ verify(commitFuture, times(6)).checkedGet();
}
/**
* Test With isConntrackEnabled true isComputeNode true
ingressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", DHCP_MAC_ADDRESS, 1, false, true, MAC_ADDRESS, false);
- verify(writeTransaction, times(4)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
- verify(writeTransaction, times(4)).submit();
- verify(commitFuture, times(4)).get();
+ verify(writeTransaction, times(6)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
+ verify(writeTransaction, times(6)).submit();
+ verify(commitFuture, times(6)).get();
}
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import org.junit.Test;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.NetvirtProvidersProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.providers.NetvirtProvidersProvider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.powermock.api.support.membermodification.MemberModifier;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import java.util.HashMap;
import java.util.Map;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.NetworkHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration.LoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.NetworkHandler;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@Mock private CheckedFuture<Void, TransactionCommitFailedException> commitFuture;
@Mock private LoadBalancerConfiguration lbConfig;
- @Mock private LoadBalancerPoolMember member;
+ @Mock private LoadBalancerConfiguration.LoadBalancerPoolMember member;
@Mock private Node node;
private static final String SEGMENTATION_ID = "2";
when(orchestrator.getNextServiceInPipeline(any(Service.class))).thenReturn(Service.ARP_RESPONDER);
- Map<String, LoadBalancerPoolMember> members = new HashMap<>();
+ Map<String, LoadBalancerConfiguration.LoadBalancerPoolMember> members = new HashMap<>();
members.put("key", member);
when(lbConfig.isValid()).thenReturn(true);
MemberModifier.field(LoadBalancerService.class, "southbound").set(loadBalancerService, southbound);
}
/**
- * Test method {@link LoadBalancerService#programLoadBalancerPoolMemberRules(Node, LoadBalancerConfiguration, LoadBalancerPoolMember, Action)}
+ * Test method {@link LoadBalancerService#programLoadBalancerPoolMemberRules(Node, LoadBalancerConfiguration, LoadBalancerConfiguration.LoadBalancerPoolMember, Action)}
*/
@Test
public void testprogramLoadBalancerPoolMemberRules() throws Exception {
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.BADREQUEST), loadBalancerService.programLoadBalancerPoolMemberRules(node, null, null, Action.ADD));
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.BADREQUEST), loadBalancerService.programLoadBalancerPoolMemberRules(node, null, null, Action.ADD));
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.NOTIMPLEMENTED), loadBalancerService.programLoadBalancerPoolMemberRules(node, lbConfig, member, Action.DELETE));
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.NOTIMPLEMENTED), loadBalancerService.programLoadBalancerPoolMemberRules(node, lbConfig, member, Action.DELETE));
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), loadBalancerService.programLoadBalancerPoolMemberRules(node, lbConfig, member, Action.ADD));
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), loadBalancerService.programLoadBalancerPoolMemberRules(node, lbConfig, member, Action.ADD));
verify(writeTransaction, times(8)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(4)).submit();
verify(commitFuture, times(4)).get();
*/
@Test
public void testProgramLoadBalancerRules() throws Exception {
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.BADREQUEST), loadBalancerService.programLoadBalancerRules(node, null, Action.ADD));
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.BADREQUEST), loadBalancerService.programLoadBalancerRules(node, null, Action.ADD));
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.NOTIMPLEMENTED), loadBalancerService.programLoadBalancerRules(node, lbConfig, Action.UPDATE));
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.NOTIMPLEMENTED), loadBalancerService.programLoadBalancerRules(node, lbConfig, Action.UPDATE));
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), loadBalancerService.programLoadBalancerRules(node, lbConfig, Action.ADD));
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), loadBalancerService.programLoadBalancerRules(node, lbConfig, Action.ADD));
verify(writeTransaction, times(6)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(3)).submit();
verify(commitFuture, times(3)).get();
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), loadBalancerService.programLoadBalancerRules(node, lbConfig, Action.DELETE));
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), loadBalancerService.programLoadBalancerRules(node, lbConfig, Action.DELETE));
verify(writeTransaction, times(3)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(6)).submit();
verify(commitFuture, times(6)).get(); // 3 + 3 before
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import java.net.InetAddress;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
InetAddress address = mock(InetAddress.class);
when(address.getHostAddress()).thenReturn(HOST_ADDRESS);
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS),
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS),
outboundNatService.programIpRewriteRule(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, address,
MAC_ADDRESS, MAC_ADDRESS, address,
Long.valueOf(10), Action.ADD));
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS),
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS),
outboundNatService.programIpRewriteRule(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, address,
MAC_ADDRESS, MAC_ADDRESS, address,
Long.valueOf(10), Action.DELETE));
*/
@Test
public void testProgramIpRewriteExclusion() throws Exception {
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), outboundNatService.programIpRewriteExclusion(Long.valueOf(123), SEGMENTATION_ID, HOST_ADDRESS_PREFIX, Action.ADD));
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), outboundNatService.programIpRewriteExclusion(Long.valueOf(123), SEGMENTATION_ID, HOST_ADDRESS_PREFIX, Action.ADD));
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), outboundNatService.programIpRewriteExclusion(Long.valueOf(123), SEGMENTATION_ID, HOST_ADDRESS_PREFIX, Action.DELETE));
+ Assert.assertEquals("Error, did not return the expected StatusCode", new Status(StatusCode.SUCCESS), outboundNatService.programIpRewriteExclusion(Long.valueOf(123), SEGMENTATION_ID, HOST_ADDRESS_PREFIX, Action.DELETE));
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.services;
+package org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.services;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack.net-virt-sfc-api</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
org.opendaylight.yang.gen.v1.*,
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.acl.rev150105,
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105,
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.Classifiers,
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev150105,
</Export-Package>
</instructions>
+++ /dev/null
-module ietf-acl {
- yang-version 1;
-
- namespace "urn:ietf:params:xml:ns:yang:ietf-acl";
-
- prefix acl;
-
- import ietf-yang-types {
- prefix "ietf";
- }
-
- import packet-fields {
- prefix "packet-fields";
- }
-
- organization
- "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
-
- contact
- "WG Web: http://tools.ietf.org/wg/netmod/
- WG List: netmod@ietf.org
-
- WG Chair: Juergen Schoenwaelder
- j.schoenwaelder@jacobs-university.de
-
- WG Chair: Tom Nadeau
- tnadeau@lucidvision.com
-
- Editor: Dean Bogdanovic
- deanb@juniper.net
-
- Editor: Kiran Agrahara Sreenivasa
- kkoushik@brocade.com
-
- Editor: Lisa Huang
- yihuan@cisco.com
-
- Editor: Dana Blair
- dblair@cisco.com";
-
- description
- "This YANG module defines a component that describing the
- configuration of Access Control Lists (ACLs).";
-
- revision 2014-10-10 {
- description "Creating base model for netmod.";
- reference
- "RFC 6020: YANG - A Data Modeling Language for the
- Network Configuration Protocol (NETCONF)";
- }
-
- identity acl-base {
- description "Base acl type for all ACL type identifiers.";
- }
-
- identity ip-acl {
- base "acl:acl-base";
- description "layer 3 ACL type";
- }
- identity eth-acl {
- base "acl:acl-base";
- description "layer 2 ACL type";
- }
-
- typedef acl-type {
- type identityref {
- base "acl-base";
- }
- description
- "This type is used to refer to an Access Control List
- (ACL) type";
- }
-
- typedef acl-ref {
- type leafref {
- path "/acl:access-lists/acl:access-list/acl:acl-name";
- }
- description "This type is used by data models that
- need to referenced an acl";
- }
-
- container access-lists {
- description
- "Access control lists.";
-
- list access-list {
- key acl-name;
- description "
- An access list (acl) is an ordered list of
- access list entries (ace). Each ace has a
- sequence number to define the order, list
- of match criteria, and a list of actions.
- Since there are several kinds of acls
- implementeded with different attributes for
- each and different for each vendor, this
- model accomodates customizing acls for
- each kind and for each vendor.
- ";
-
- leaf acl-name {
- type string;
- description "The name of access-list.
- A device MAY restrict the length and value of
- this name, possibly space and special
- characters are not allowed.";
- }
-
- leaf acl-type {
- type acl-type;
- description "Type of ACL";
- }
-
- container acl-oper-data {
- config false;
-
- description "Overall ACL operational data";
- leaf match-counter {
- type ietf:counter64;
- description "Total match count for ACL";
- }
-
- leaf-list targets {
- type string;
- description "List of targets where ACL is applied";
- }
- }
-
- container access-list-entries {
- description "The access-list-entries container contains
- a list of access-list-entry(ACE).";
-
- list access-list-entry {
- key rule-name;
- ordered-by user;
-
- description "List of access list entries(ACE)";
- leaf rule-name {
- type string;
- description "Entry name.";
- }
-
- container matches {
- description "Define match criteria";
- choice ace-type {
- description "Type of ace.";
- case ace-ip {
- uses packet-fields:acl-ip-header-fields;
- choice ace-ip-version {
- description "Choice of IP version.";
- case ace-ipv4 {
- uses packet-fields:acl-ipv4-header-fields;
- }
- case ace-ipv6 {
- uses packet-fields:acl-ipv6-header-fields;
- }
- }
- }
- case ace-eth {
- uses packet-fields:acl-eth-header-fields;
- }
- }
- uses packet-fields:metadata;
- }
-
- container actions {
- description "Define action criteria";
- choice packet-handling {
- default deny;
-
- description "Packet handling action.";
- case deny {
- leaf deny {
- type empty;
- description "Deny action.";
- }
- }
- case permit {
- leaf permit {
- type empty;
- description "Permit action.";
- }
- }
- }
- }
-
- container ace-oper-data {
- config false;
-
- description "Per ace operational data";
- leaf match-counter {
- type ietf:counter64;
- description "Number of matches for an ace";
- }
- }
- }
- }
- }
- }
-}
+++ /dev/null
-module packet-fields {
- yang-version 1;
-
- namespace "urn:ietf:params:xml:ns:yang:packet-fields";
-
- prefix packet-fields;
-
- import ietf-inet-types {
- prefix "inet";
- }
-
- import ietf-yang-types {
- prefix "yang";
- }
-
- revision 2014-06-25 {
- description "Initial version of packet fields used by access-lists";
- }
-
- grouping acl-transport-header-fields {
- description "Transport header fields";
-
- container source-port-range {
- description "inclusive range of source ports";
- leaf lower-port {
- mandatory true;
- type inet:port-number;
- }
- leaf upper-port {
- type inet:port-number;
- }
- }
-
- container destination-port-range {
- description "inclusive range of destination ports";
- leaf lower-port {
- mandatory true;
- type inet:port-number;
- }
- leaf upper-port {
- type inet:port-number;
- }
- }
- }
-
- grouping acl-ip-header-fields {
- description "Header fields common to ipv4 and ipv6";
-
- uses acl-transport-header-fields;
-
- leaf dscp {
- type inet:dscp;
- }
-
- leaf ip-protocol {
- type uint8;
- }
-
- }
-
- grouping acl-ipv4-header-fields {
- description "fields in IPv4 header";
-
- leaf destination-ipv4-address {
- type inet:ipv4-prefix;
- }
-
- leaf source-ipv4-address {
- type inet:ipv4-prefix;
- }
-
- }
-
- grouping acl-ipv6-header-fields {
- description "fields in IPv6 header";
-
- leaf destination-ipv6-address {
- type inet:ipv6-prefix;
- }
-
- leaf source-ipv6-address {
- type inet:ipv6-prefix;
- }
-
- leaf flow-label {
- type inet:ipv6-flow-label;
- }
-
- }
-
- grouping acl-eth-header-fields {
- description "fields in ethernet header";
-
- leaf destination-mac-address {
- type yang:mac-address;
- }
-
- leaf destination-mac-address-mask {
- type yang:mac-address;
- }
-
- leaf source-mac-address {
- type yang:mac-address;
- }
-
- leaf source-mac-address-mask {
- type yang:mac-address;
- }
- }
-
- grouping timerange {
- description "Define time range entries to restrict
- the access. The time range is identified by a name
- and then referenced by a function, so that those
- time restrictions are imposed on the function itself.";
-
- container absolute {
- description
- "Absolute time and date that
- the associated function starts
- going into effect.";
-
- leaf start {
- type yang:date-and-time;
- description
- "Start time and date";
- }
- leaf end {
- type yang:date-and-time;
- description "Absolute end time and date";
- }
- leaf active {
- type boolean;
- default "true";
- description
- "Specify the associated function
- active or inactive state when
- starts going into effect";
- }
- } // container absolute
- } //grouping timerange
-
- grouping metadata {
- description "Fields associated with a packet but not in the header";
-
- leaf input-interface {
- description "Packet was received on this interface";
- type string;
- }
- uses timerange;
- }
-}
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack.net-virt-sfc-artifacts</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
+
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.opendaylight.odlparent</groupId>
- <artifactId>odlparent-lite</artifactId>
+ <artifactId>features-parent</artifactId>
<version>1.7.0-SNAPSHOT</version>
<relativePath/>
</parent>
-
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>openstack.net-virt-sfc-features-aggregator</artifactId>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>openstack.net-virt-sfc-features</artifactId>
<version>1.3.0-SNAPSHOT</version>
- <packaging>pom</packaging>
+ <name>${project.artifactId}</name>
<modelVersion>4.0.0</modelVersion>
<prerequisites>
<maven>3.1.1</maven>
</prerequisites>
- <modules>
- <module>production</module>
- <module>test</module>
- </modules>
- <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-install-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
- <tag>HEAD</tag>
- <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
- </scm>
+ <properties>
+ <configfile.directory>etc/opendaylight/karaf</configfile.directory>
+ <controller.mdsal.version>1.4.0-SNAPSHOT</controller.mdsal.version>
+ <dlux.version>0.4.0-SNAPSHOT</dlux.version>
+ <mdsal.model.version>0.9.0-SNAPSHOT</mdsal.model.version>
+ <openflowplugin.version>0.3.0-SNAPSHOT</openflowplugin.version>
+ <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
+ <restconf.version>1.4.0-SNAPSHOT</restconf.version>
+ <sfc.version>0.3.0-SNAPSHOT</sfc.version>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>features-dlux</artifactId>
+ <classifier>features</classifier>
+ <version>${dlux.version}</version>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>features-mdsal</artifactId>
+ <version>${controller.mdsal.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>features-mdsal-model</artifactId>
+ <version>${mdsal.model.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>features-restconf</artifactId>
+ <version>${restconf.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.openflowplugin</groupId>
+ <artifactId>features-openflowplugin</artifactId>
+ <version>${openflowplugin.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>features-netvirt</artifactId>
+ <version>${project.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>southbound-features</artifactId>
+ <version>${ovsdb.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.openflowplugin</groupId>
+ <artifactId>features-openflowplugin-extension</artifactId>
+ <version>${openflowplugin.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.sfc</groupId>
+ <artifactId>features-sfc</artifactId>
+ <version>${sfc.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-sfc-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-sfc-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.servicehelper</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-sfc-impl</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>config</classifier>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.it-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${ovsdb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>utils.southbound-utils</artifactId>
+ <version>${ovsdb.version}</version>
+ </dependency>
+ </dependencies>
</project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
-
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>features-parent</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- <relativePath/>
- </parent>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>openstack.net-virt-sfc-features</artifactId>
- <version>1.3.0-SNAPSHOT</version>
- <name>${project.artifactId}</name>
- <modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>3.1.1</maven>
- </prerequisites>
- <properties>
- <configfile.directory>etc/opendaylight/karaf</configfile.directory>
- <dlux.version>0.4.0-SNAPSHOT</dlux.version>
- <mdsal.model.version>0.9.0-SNAPSHOT</mdsal.model.version>
- <controller.mdsal.version>1.4.0-SNAPSHOT</controller.mdsal.version>
- <openflowplugin.version>0.3.0-SNAPSHOT</openflowplugin.version>
- <restconf.version>1.4.0-SNAPSHOT</restconf.version>
- <sfc.version>0.3.0-SNAPSHOT</sfc.version>
- <yangtools.version>1.0.0-SNAPSHOT</yangtools.version>
- </properties>
- <dependencyManagement>
- <dependencies>
- <!-- project specific dependencies -->
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>mdsal-artifacts</artifactId>
- <version>${controller.mdsal.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.netconf</groupId>
- <artifactId>restconf-artifacts</artifactId>
- <version>${restconf.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>ovsdb-artifacts</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>features-yangtools</artifactId>
- <classifier>features</classifier>
- <version>${yangtools.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>features-mdsal-model</artifactId>
- <version>${mdsal.model.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>features-mdsal</artifactId>
- <classifier>features</classifier>
- <version>${controller.mdsal.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.netconf</groupId>
- <artifactId>features-restconf</artifactId>
- <classifier>features</classifier>
- <version>${restconf.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.dlux</groupId>
- <artifactId>features-dlux</artifactId>
- <classifier>features</classifier>
- <version>${dlux.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>features-ovsdb</artifactId>
- <classifier>features</classifier>
- <version>${project.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.openflowplugin</groupId>
- <artifactId>features-openflowplugin</artifactId>
- <version>${openflowplugin.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.openflowplugin</groupId>
- <artifactId>features-openflowplugin-extension</artifactId>
- <version>${openflowplugin.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.sfc</groupId>
- <artifactId>features-sfc</artifactId>
- <version>${sfc.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-impl</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>southbound-features</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>features</classifier>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>utils.mdsal-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>utils.servicehelper</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
-
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html
--->
-<features name="odl-ovsdb-sfc-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
- <repository>mvn:org.opendaylight.controller/features-mdsal/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.dlux/features-dlux/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.netconf/features-restconf/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin-extension/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.ovsdb/features-ovsdb/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.ovsdb/southbound-features/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.sfc/features-sfc/{{VERSION}}/xml/features</repository>
- <repository>mvn:org.opendaylight.yangtools/features-yangtools/{{VERSION}}/xml/features</repository>
- <feature name='odl-ovsdb-sfc-api' version='${project.version}' description='OpenDaylight :: ovsdb-sfc :: api'>
- <feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
- <bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-api/{{VERSION}}</bundle>
- </feature>
- <feature name='odl-ovsdb-sfc' version='${project.version}' description='OpenDaylight :: ovsdb-sfc'>
- <feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
- <feature version="${openflowplugin.version}">odl-openflowplugin-nsf-model</feature>
- <feature version="${openflowplugin.version}">odl-openflowplugin-flow-services</feature>
- <feature version='${openflowplugin.version}'>odl-openflowplugin-nxm-extensions</feature>
- <feature version='${project.version}'>odl-ovsdb-southbound-impl</feature>
- <feature version='${project.version}'>odl-ovsdb-openstack</feature>
- <feature version='${sfc.version}'>odl-sfc-provider</feature>
- <feature version='${sfc.version}'>odl-sfcofl2</feature>
- <feature version='${project.version}'>odl-ovsdb-sfc-api</feature>
- <bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.ovsdb/utils.servicehelper/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-impl/{{VERSION}}</bundle>
- <configfile finalname="${configfile.directory}/openstack.net-virt-sfc.xml">mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-impl/{{VERSION}}/xml/config</configfile>
- </feature>
- <feature name='odl-ovsdb-sfc-rest' version='${project.version}' description='OpenDaylight :: ovsdb-sfc :: REST'>
- <feature version="${project.version}">odl-ovsdb-sfc</feature>
- <feature version="${restconf.version}">odl-restconf</feature>
- </feature>
- <feature name='odl-ovsdb-sfc-ui' version='${project.version}' description='OpenDaylight :: ovsdb-sfc :: UI'>
- <feature version="${project.version}">odl-ovsdb-sfc-rest</feature>
- <feature version="${restconf.version}">odl-mdsal-apidocs</feature>
- <feature version="${controller.mdsal.version}">odl-mdsal-xsql</feature>
- <feature version="${dlux.version}">odl-dlux-yangui</feature>
- </feature>
-
-</features>
<features name="odl-ovsdb-sfc-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
- <repository>mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.controller/features-mdsal/${controller.mdsal.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.dlux/features-dlux/${dlux.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.controller/features-mdsal/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.dlux/features-dlux/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.netconf/features-restconf/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.netvirt/features-netvirt/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin-extension/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.ovsdb/southbound-features/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.sfc/features-sfc/{{VERSION}}/xml/features</repository>
<feature name='odl-ovsdb-sfc-api' version='${project.version}' description='OpenDaylight :: ovsdb-sfc :: api'>
<feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
- <bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-api/${project.version}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/openstack.net-virt-sfc-api/{{VERSION}}</bundle>
</feature>
<feature name='odl-ovsdb-sfc' version='${project.version}' description='OpenDaylight :: ovsdb-sfc'>
<feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
+ <feature version="${openflowplugin.version}">odl-openflowplugin-flow-services</feature>
+ <feature version='${openflowplugin.version}'>odl-openflowplugin-nxm-extensions</feature>
+ <feature version='${ovsdb.version}'>odl-ovsdb-southbound-impl</feature>
+ <feature version='${project.version}'>odl-ovsdb-openstack</feature>
+ <feature version='${sfc.version}'>odl-sfcofl2</feature>
<feature version='${project.version}'>odl-ovsdb-sfc-api</feature>
- <bundle>mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-impl/${project.version}</bundle>
- <configfile finalname="${configfile.directory}/openstack.net-virt-sfc.xml">mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-impl/${project.version}/xml/config</configfile>
+ <bundle>mvn:org.opendaylight.netvirt/utils.servicehelper/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.mdsal-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/openstack.net-virt-sfc-impl/{{VERSION}}</bundle>
+ <configfile finalname="${configfile.directory}/openstack.net-virt-sfc.xml">mvn:org.opendaylight.netvirt/openstack.net-virt-sfc-impl/{{VERSION}}/xml/config</configfile>
</feature>
<feature name='odl-ovsdb-sfc-rest' version='${project.version}' description='OpenDaylight :: ovsdb-sfc :: REST'>
<feature version="${project.version}">odl-ovsdb-sfc</feature>
<feature version="${controller.mdsal.version}">odl-mdsal-xsql</feature>
<feature version="${dlux.version}">odl-dlux-yangui</feature>
</feature>
-
+ <feature name='odl-ovsdb-sfc-test' version='${project.version}' description='OpenDaylight :: ovsdb-sfc-test'>
+ <bundle>mvn:org.opendaylight.netvirt/utils.it-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.netvirt/utils.mdsal-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
+ <bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/{{VERSION}}</bundle>
+ <feature version='${project.version}'>odl-ovsdb-sfc-ui</feature>
+ </feature>
</features>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
-
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.opendaylight.odlparent</groupId>
- <artifactId>features-parent</artifactId>
- <version>1.7.0-SNAPSHOT</version>
- <relativePath/>
- </parent>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>openstack.net-virt-sfc-features-test</artifactId>
- <version>1.3.0-SNAPSHOT</version>
- <name>${project.artifactId}</name>
- <modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>3.1.1</maven>
- </prerequisites>
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-features</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>features</classifier>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>utils.mdsal-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>utils.southbound-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
-
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html
--->
-<features name="odl-ovsdb-sfc-test${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
- <repository>mvn:org.opendaylight.ovsdb/openstack.net-virt-sfc-features/1.3.0-SNAPSHOT/xml/features</repository>
- <feature name='odl-ovsdb-sfc-test' version='${project.version}' description='OpenDaylight :: ovsdb-sfc-test'>
- <bundle>mvn:org.opendaylight.ovsdb/utils.mdsal-utils/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.ovsdb/utils.southbound-utils/{{VERSION}}</bundle>
- <feature version='${project.version}'>odl-ovsdb-sfc-ui</feature>
- </feature>
-</features>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack.net-virt-sfc-impl</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<openflowplugin.version>0.3.0-SNAPSHOT</openflowplugin.version>
+ <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
<sfc.version>0.3.0-SNAPSHOT</sfc.version>
<sonar.jacoco.itReportPath>../it/target/jacoco-it.exec</sonar.jacoco.itReportPath>
</properties>
<dependencies>
- <!-- project specific dependencies -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-api</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>openstack.net-virt</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.ovsdb</groupId>
<artifactId>southbound-api</artifactId>
- <version>${project.version}</version>
+ <version>${ovsdb.version}</version>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.ovsdb</groupId>
<artifactId>southbound-impl</artifactId>
- <version>${project.version}</version>
+ <version>${ovsdb.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>utils.servicehelper</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- openflowplugin dependencies -->
<dependency>
<groupId>org.opendaylight.openflowplugin</groupId>
<artifactId>openflowplugin-extension-nicira</artifactId>
<artifactId>model-flow-service</artifactId>
<version>${openflowplugin.version}</version>
</dependency>
- <!-- mdsal dependencies -->
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-topology</artifactId>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>iana-if-type-2014-05-08</artifactId>
</dependency>
- <!-- sfc dependencies -->
<dependency>
<groupId>org.opendaylight.sfc</groupId>
<artifactId>sfc-model</artifactId>
<artifactId>sfc-provider</artifactId>
<version>${sfc.version}</version>
</dependency>
- <!-- external dependencies -->
<dependency>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>sonar-jacoco-listeners</artifactId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
- <!-- testing dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-sfc-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<build>
<Embed-Dependency>utils.mdsal-openflow;type=!pom;inline=false</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Export-Package>
- org.opendaylight.ovsdb.openstack.netvirt.sfc,
- org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services
+ org.opendaylight.netvirt.openstack.netvirt.sfc,
+ org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services
</Export-Package>
</instructions>
</configuration>
-->
<snapshot>
<required-capabilities>
- <capability>urn:opendaylight:params:xml:ns:yang:netvirt:sfc?module=netvirt-sfc&revision=2014-12-10</capability>
+ <capability>urn:opendaylight:params:xml:ns:yang:netvirt:sfc:impl?module=netvirt-sfc-impl&revision=2014-12-10</capability>
<capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28</capability>
<capability>urn:opendaylight:params:xml:ns:yang:southbound:impl?module=southbound-impl&revision=2014-12-10</capability>
<capability>urn:opendaylight:params:xml:ns:yang:netvirt:impl?module=netvirt-impl&revision=2015-05-13</capability>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:netvirt:sfc">prefix:netvirt-sfc</type>
- <name>netvirt-sfc-default</name>
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:netvirt:sfc:impl">prefix:netvirt-sfc-impl</type>
+ <name>netvirt-sfc-impl</name>
<of13provider>workaround</of13provider>
+ <addsfflows>false</addsfflows>
<broker>
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
<name>binding-osgi-broker</name>
--- /dev/null
+/*
+ * Copyright (c) 2013, 2016 Dell, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
+
+import java.util.Collection;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import javax.annotation.Nonnull;
+
+import com.google.common.base.Preconditions;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Data-tree listener which delegates data processing to a {@link INetvirtSfcDataProcessor}.
+ */
+public class DelegatingDataTreeListener<T extends DataObject> implements AutoCloseable, DataTreeChangeListener<T> {
+ private static final Logger LOG = LoggerFactory.getLogger(DelegatingDataTreeListener.class);
+ protected INetvirtSfcOF13Provider provider;
+ private final ExecutorService executorService = Executors.newFixedThreadPool(1);
+ private final INetvirtSfcDataProcessor<T> dataProcessor;
+ private ListenerRegistration<DelegatingDataTreeListener<T>> listenerRegistration;
+
+ public DelegatingDataTreeListener(INetvirtSfcOF13Provider provider, INetvirtSfcDataProcessor<T> dataProcessor,
+ DataBroker db, DataTreeIdentifier<T> treeId) {
+ this.provider = Preconditions.checkNotNull(provider, "provider can not be null!");
+ this.dataProcessor = Preconditions.checkNotNull(dataProcessor, "Data processor can not be null!");
+ registerListener(Preconditions.checkNotNull(db, "Data broker can not be null!"),
+ Preconditions.checkNotNull(treeId, "Tree identifier can not be null!"));
+ }
+
+ private void registerListener(final DataBroker db, DataTreeIdentifier<T> treeId) {
+ try {
+ LOG.info("Registering Data Change Listener for {}", getClass().getSimpleName());
+ listenerRegistration = db.registerDataTreeChangeListener(treeId, this);
+ } catch (final Exception e) {
+ LOG.warn("{} DataChange listener registration fail!", getClass().getSimpleName(), e);
+ throw new IllegalStateException("DataTreeListener startup fail! System needs restart.", e);
+ }
+ }
+
+ private void processChanges(Collection<DataTreeModification<T>> changes) {
+ LOG.info("onDataTreeChanged: Received Data Tree Changed ...", changes);
+ for (DataTreeModification<T> change : changes) {
+ final InstanceIdentifier<T> key = change.getRootPath().getRootIdentifier();
+ final DataObjectModification<T> mod = change.getRootNode();
+ LOG.info("onDataTreeChanged: Received Data Tree Changed Update of Type={} for Key={}",
+ mod.getModificationType(), key);
+ switch (mod.getModificationType()) {
+ case DELETE:
+ dataProcessor.remove(key, mod.getDataBefore());
+ break;
+ case SUBTREE_MODIFIED:
+ dataProcessor.update(key, mod.getDataBefore(), mod.getDataAfter());
+ break;
+ case WRITE:
+ if (mod.getDataBefore() == null) {
+ dataProcessor.add(key, mod.getDataAfter());
+ } else {
+ dataProcessor.update(key, mod.getDataBefore(), mod.getDataAfter());
+ }
+ break;
+ default:
+ throw new IllegalArgumentException("Unhandled modification type " + mod.getModificationType());
+ }
+ }
+ }
+
+ @Override
+ public void onDataTreeChanged(@Nonnull final Collection<DataTreeModification<T>> changes) {
+ Preconditions.checkNotNull(changes, "Changes may not be null!");
+ executorService.submit(new Runnable() {
+ @Override
+ public void run() {
+ processChanges(changes);
+ }
+ });
+ }
+
+ @Override
+ public void close() {
+ if (listenerRegistration != null) {
+ listenerRegistration.close();
+ listenerRegistration = null;
+ }
+ }
+}
/*
- * Copyright (c) 2013, 2015 Dell, Inc. and others. All rights reserved.
+ * Copyright (c) 2013, 2016 Dell, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* netvirt-sfc-dcl processor
* org.opendaylight.ovsdb.openstack.netvirt.sfc
*/
-public interface INetvirtSfcDataProcessor<D extends DataObject> extends AutoCloseable, DataTreeChangeListener<D> {
+public interface INetvirtSfcDataProcessor<D extends DataObject> {
/**
* Method removes DataObject which is identified by InstanceIdentifier.
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePath;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
-import java.net.InetAddress;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.Matches;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
public interface ISfcClassifierService {
void programIngressClassifier(long dataPathId, String ruleName, Matches matches, long nsp, short nsi,
void programEgressClassifierBypass(long dataPathId, long vxGpeOfPort, long nsp, short nsi,
long sfOfPort, int tunnelId, String rspName, boolean write);
- void program_sfEgress(long dataPathId, int dstPort, boolean write);
+ void program_sfEgress(long dataPathId, int dstPort, String rspName, boolean write);
void program_sfIngress(long dataPathId, int dstPort, long sfOfPort,
- String ipAddress, String sfDplName, boolean write);
+ String ipAddress, String sfDplName, String rspName, boolean write);
void programStaticArpEntry(long dataPathId, long ofPort, String macAddressStr,
String ipAddress, String rspName, boolean write);
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.Matches;
--- /dev/null
+/*
+ * Copyright © 2015, 2016 Dell, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
+
+import com.google.common.base.Preconditions;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Data processor for AccessList.
+ */
+public class NetvirtSfcAclDataProcessor implements INetvirtSfcDataProcessor<Acl> {
+ private final INetvirtSfcOF13Provider provider;
+
+ /**
+ * {@link NetvirtSfcAclDataProcessor} constructor.
+ * @param provider OpenFlow 1.3 Provider
+ */
+ public NetvirtSfcAclDataProcessor(final INetvirtSfcOF13Provider provider) {
+ this.provider = Preconditions.checkNotNull(provider, "Provider can not be null!");
+ }
+
+ @Override
+ public void remove(final InstanceIdentifier<Acl> identifier,
+ final Acl change) {
+ Preconditions.checkNotNull(change, "Removed object can not be null!");
+ provider.removeClassifierRules(change);
+ }
+
+ @Override
+ public void update(final InstanceIdentifier<Acl> identifier,
+ final Acl original, final Acl change) {
+ Preconditions.checkNotNull(original, "Updated original object can not be null!");
+ Preconditions.checkNotNull(original, "Updated update object can not be null!");
+ remove(identifier, original);
+ provider.addClassifierRules(change);
+ }
+
+ @Override
+ public void add(final InstanceIdentifier<Acl> identifier,
+ final Acl change) {
+ Preconditions.checkNotNull(change, "Added object can not be null!");
+ provider.addClassifierRules(change);
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2015, 2016 Dell, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.AccessLists;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Data tree listener for AccessList.
+ */
+public class NetvirtSfcAclListener extends DelegatingDataTreeListener<Acl> {
+ /**
+ * {@link NetvirtSfcAclListener} constructor.
+ * @param provider OpenFlow 1.3 Provider
+ * @param db MdSal {@link DataBroker}
+ */
+ public NetvirtSfcAclListener(final INetvirtSfcOF13Provider provider, final DataBroker db) {
+ super(provider, new NetvirtSfcAclDataProcessor(provider), db,
+ new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
+ InstanceIdentifier.create(AccessLists.class).child(Acl.class)));
+ }
+}
/*
- * Copyright © 2015 Dell, Inc. and others. All rights reserved.
+ * Copyright © 2015, 2016 Dell, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
import com.google.common.base.Preconditions;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.AccessLists;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.AclKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.Classifiers;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.Classifier;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.classifier.sffs.Sff;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers
+ .Classifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Data tree listener for Classifier.
- *
- * @author Arun Yerra
+ * Data processor for Classifier.
*/
-public class NetvirtSfcClassifierListener extends AbstractDataTreeListener<Classifier> {
- private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcClassifierListener.class);
- private MdsalUtils mdsalUtils;
- private ListenerRegistration<NetvirtSfcClassifierListener> listenerRegistration;
+public class NetvirtSfcClassifierDataProcessor implements INetvirtSfcDataProcessor<Classifier> {
+ private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcClassifierDataProcessor.class);
+ private final MdsalUtils mdsalUtils;
+ private final INetvirtSfcOF13Provider provider;
/**
- * {@link NetvirtSfcClassifierListener} constructor.
+ * {@link NetvirtSfcClassifierDataProcessor} constructor.
* @param provider OpenFlow 1.3 Provider
* @param db MdSal {@link DataBroker}
*/
- public NetvirtSfcClassifierListener(final INetvirtSfcOF13Provider provider, final DataBroker db) {
- super(provider, Classifier.class);
+ public NetvirtSfcClassifierDataProcessor(final INetvirtSfcOF13Provider provider, final DataBroker db) {
+ this.provider = Preconditions.checkNotNull(provider, "Provider can not be null!");
Preconditions.checkNotNull(db, "DataBroker can not be null!");
mdsalUtils = new MdsalUtils(db);
- registrationListener(db);
- }
-
- private void registrationListener(final DataBroker db) {
- final DataTreeIdentifier<Classifier> treeId =
- new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, getClassifierIid());
- try {
- LOG.info("Registering Data Change Listener for NetvirtSfc Classifier configuration.");
- listenerRegistration = db.registerDataTreeChangeListener(treeId, this);
- } catch (final Exception e) {
- LOG.warn("Netvirt Classifier DataChange listener registration fail!");
- throw new IllegalStateException("NetvirtSfcClassifierListener startup fail! System needs restart.", e);
- }
- }
-
- @Override
- public void close() {
- if (listenerRegistration != null) {
- try {
- listenerRegistration.close();
- } catch (final Exception e) {
- LOG.warn("Error to stop Netvirt Classifier DataChange listener: {}", e.getMessage());
- }
- listenerRegistration = null;
- }
}
@Override
provider.addClassifierRules(acl);
}
- public InstanceIdentifier<Classifier> getClassifierIid() {
- return InstanceIdentifier.create(Classifiers.class).child(Classifier.class);
- }
-
private InstanceIdentifier<Acl> getIetfAclIid(String aclName) {
return InstanceIdentifier.create(AccessLists.class).child(Acl.class, new AclKey(aclName));
}
--- /dev/null
+/*
+ * Copyright © 2015, 2016 Dell, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.Classifiers;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.Classifier;
+
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Data tree listener for Classifier.
+ *
+ * @author Arun Yerra
+ */
+public class NetvirtSfcClassifierListener extends DelegatingDataTreeListener<Classifier> {
+ /**
+ * {@link NetvirtSfcClassifierListener} constructor.
+ * @param provider OpenFlow 1.3 Provider
+ * @param db MdSal {@link DataBroker}
+ */
+ public NetvirtSfcClassifierListener(final INetvirtSfcOF13Provider provider, final DataBroker db) {
+ super(provider, new NetvirtSfcClassifierDataProcessor(provider, db), db,
+ new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
+ InstanceIdentifier.create(Classifiers.class).child(Classifier.class)));
+ }
+}
/*
- * Copyright © 2015 Dell, Inc. and others. All rights reserved.
+ * Copyright © 2015, 2016 Dell, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
import java.util.Dictionary;
import java.util.Hashtable;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.OF13Provider;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.standalone.openflow13.NetvirtSfcStandaloneOF13Provider;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.standalone.openflow13.services.SfcClassifierService;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.NetvirtSfcWorkaroundOF13Provider;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.OF13Provider;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.standalone.openflow13.NetvirtSfcStandaloneOF13Provider;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.standalone.openflow13.services.SfcClassifierService;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.NetvirtSfcWorkaroundOF13Provider;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.slf4j.Logger;
public class NetvirtSfcProvider implements BindingAwareProvider, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcProvider.class);
- private NetvirtSfcAclListener aclListener;
- private NetvirtSfcClassifierListener classifierListener;
- private RspListener rspListener;
+ private AutoCloseable aclListener;
+ private AutoCloseable classifierListener;
+ private AutoCloseable rspListener;
+ private Boolean addSfFlows;
public void setOf13Provider(String of13Provider) {
LOG.info("of13Provider is: {}", of13Provider);
if (of13Provider.equals("standalone")) {
provider = new NetvirtSfcStandaloneOF13Provider(dataBroker);
} else {
- provider = new NetvirtSfcWorkaroundOF13Provider(dataBroker, mdsalUtils, sfcUtils);
+ provider = new NetvirtSfcWorkaroundOF13Provider(dataBroker, mdsalUtils, sfcUtils, addSfFlows);
}
aclListener = new NetvirtSfcAclListener(provider, dataBroker);
classifierListener = new NetvirtSfcClassifierListener(provider, dataBroker);
private void addToPipeline(INetvirtSfcOF13Provider provider) {
if (provider instanceof NetvirtSfcStandaloneOF13Provider) {
SfcClassifierService sfcClassifierService =
- new org.opendaylight.ovsdb.openstack.netvirt.sfc.standalone.openflow13.services.SfcClassifierService();
+ new SfcClassifierService();
registerService(bundleContext, ISfcClassifierService.class.getName(),
sfcClassifierService, Service.SFC_CLASSIFIER);
sfcClassifierService.setDependencies(bundleContext, null);
} else {
- org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services.SfcClassifierService sfcClassifierService =
- new org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services.SfcClassifierService();
+ org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services.SfcClassifierService sfcClassifierService =
+ new org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services.SfcClassifierService();
registerService(bundleContext, ISfcClassifierService.class.getName(),
sfcClassifierService, Service.SFC_CLASSIFIER);
sfcClassifierService.setDependencies(bundleContext, null);
new String[] {AbstractServiceInstance.class.getName(),interfaceClassName},
properties, impl);
}
+
+ public void setAddSfFlows(Boolean addSfFlows) {
+ LOG.info("setAddSfFlows: addSfFlows is {}", addSfFlows);
+ this.addSfFlows = addSfFlows;
+ }
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
import com.google.common.net.InetAddresses;
--- /dev/null
+/*
+ * Copyright © 2015, 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
+
+import com.google.common.base.Preconditions;
+import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePath;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Data processor for {@link RenderedServicePath}
+ */
+public class RspDataProcessor implements INetvirtSfcDataProcessor<RenderedServicePath> {
+ private final INetvirtSfcOF13Provider provider;
+
+ public RspDataProcessor(final INetvirtSfcOF13Provider provider) {
+ this.provider = Preconditions.checkNotNull(provider, "Provider can not be null!");
+ }
+
+ @Override
+ public void remove(final InstanceIdentifier<RenderedServicePath> identifier, final RenderedServicePath change) {
+ Preconditions.checkNotNull(change, "Removed object can not be null!");
+ provider.removeRsp(change);
+ }
+
+ @Override
+ public void update(final InstanceIdentifier<RenderedServicePath> identifier, final RenderedServicePath original,
+ RenderedServicePath change) {
+ Preconditions.checkNotNull(original, "Updated original object can not be null!");
+ Preconditions.checkNotNull(original, "Updated update object can not be null!");
+ remove(identifier, original);
+ provider.addRsp(change);
+ }
+
+ @Override
+ public void add(final InstanceIdentifier<RenderedServicePath> identifier, final RenderedServicePath change) {
+ Preconditions.checkNotNull(change, "Created object can not be null!");
+ provider.addRsp(change);
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2015, 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.RenderedServicePaths;
+import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePath;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Data tree listener for {@link RenderedServicePath}
+ */
+public class RspListener extends DelegatingDataTreeListener<RenderedServicePath> {
+ public RspListener(final INetvirtSfcOF13Provider provider, final DataBroker db) {
+ super(provider, new RspDataProcessor(provider), db, new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL,
+ InstanceIdentifier.create(RenderedServicePaths.class).child(RenderedServicePath.class)));
+ }
+}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
+package org.opendaylight.netvirt.openstack.netvirt.sfc;
import java.util.List;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.sfc.provider.api.SfcProviderAclAPI;
-import org.opendaylight.sfc.provider.api.SfcProviderRenderedPathAPI;
+import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.sfc.provider.api.SfcProviderServiceForwarderAPI;
import org.opendaylight.sfc.provider.api.SfcProviderServiceFunctionAPI;
import org.opendaylight.sfc.provider.api.SfcProviderServicePathAPI;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.RspName;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfName;
+import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffName;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.RenderedServicePaths;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.path.first.hop.info.RenderedServicePathFirstHop;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePath;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePathKey;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.rendered.service.path.RenderedServicePathHop;
}
// TODO: optimize this by adding a ACL to RSP mapping in the netvirt-classifier when the ACL is processed
+ @SuppressWarnings("unchecked")
public Ace getAce(String rspName, String sfpName, String sfcName) {
Ace aceFound = null;
AccessLists accessLists = readAccessLists();
RedirectToSfc sfcRedirect = ace.getActions().getAugmentation(RedirectToSfc.class);
if (sfcRedirect != null) {
if ((sfcRedirect.getRspName() != null && sfcRedirect.getRspName().equals(rspName)) ||
- (sfcRedirect.getSfcName() != null && sfcRedirect.getSfcName().equals(sfcName)) ||
- (sfcRedirect.getSfpName() != null && sfcRedirect.getSfpName().equals(sfpName))) {
+ (sfcRedirect.getSfcName() != null && sfcRedirect.getSfcName().equals(sfcName)) ||
+ (sfcRedirect.getSfpName() != null && sfcRedirect.getSfpName().equals(sfpName))) {
aceFound = ace;
break;
}
}
public Ip getSffIp(ServiceFunctionForwarder serviceFunctionForwarder) {
- if (serviceFunctionForwarder == null) {
- LOG.info("getSfIp: ServicefunctionForwarder is null");
+ if (serviceFunctionForwarder != null &&
+ serviceFunctionForwarder.getSffDataPlaneLocator() != null &&
+ serviceFunctionForwarder.getSffDataPlaneLocator().get(0) != null &&
+ serviceFunctionForwarder.getSffDataPlaneLocator().get(0).getDataPlaneLocator() != null) {
+ return (Ip)serviceFunctionForwarder.getSffDataPlaneLocator().get(0)
+ .getDataPlaneLocator().getLocatorType();
+ } else {
+ LOG.info("getSffIp: ServiceFunctionForwarder is null");
return null;
}
+ }
- return (Ip)serviceFunctionForwarder.getSffDataPlaneLocator().get(0).getDataPlaneLocator().getLocatorType();
+ public Ip getSffIp(SffName sffName) {
+ ServiceFunctionForwarder serviceFunctionForwarder =
+ SfcProviderServiceForwarderAPI.readServiceFunctionForwarder(sffName);
+ return getSffIp(serviceFunctionForwarder);
}
public RenderedServicePathHop getFirstHop(RenderedServicePath rsp) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.standalone.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.standalone.openflow13;
import com.google.common.base.Preconditions;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.INetvirtSfcOF13Provider;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.ISfcClassifierService;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.NshUtils;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.NshUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.INetvirtSfcOF13Provider;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.ISfcClassifierService;
+import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.sfc.provider.api.SfcProviderRenderedPathAPI;
import org.opendaylight.sfc.provider.api.SfcProviderServicePathAPI;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.RspName;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.standalone.openflow13;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.standalone.openflow13;
import com.google.common.collect.Lists;
import java.math.BigInteger;
import java.util.List;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.NshUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.NshUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.Matches;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.AceEth;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.standalone.openflow13.services;
-
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.ISfcClassifierService;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.ISfcStandaloneClassifierService;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.NshUtils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.standalone.openflow13.services;
+
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.ISfcStandaloneClassifierService;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.NshUtils;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.ISfcClassifierService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.Matches;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.workaround;
import com.google.common.base.Preconditions;
import java.util.List;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbTables;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.INetvirtSfcOF13Provider;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.ISfcClassifierService;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.NshUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.SfcUtils;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbTables;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.INetvirtSfcOF13Provider;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.ISfcClassifierService;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.NshUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.SfcUtils;
+import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.sfc.provider.api.SfcProviderRenderedPathAPI;
import org.opendaylight.sfc.provider.api.SfcProviderServiceForwarderAPI;
import org.opendaylight.sfc.provider.api.SfcProviderServiceFunctionAPI;
private DataBroker dataBroker;
private static final String VXGPE = "vxgpe";
public static final String TUNNEL_ENDPOINT_KEY = "local_ip";
+ private Boolean addSfFlows;
- public NetvirtSfcWorkaroundOF13Provider(final DataBroker dataBroker, MdsalUtils mdsalUtils, SfcUtils sfcUtils) {
+ public NetvirtSfcWorkaroundOF13Provider(final DataBroker dataBroker, MdsalUtils mdsalUtils,
+ SfcUtils sfcUtils, Boolean addSfFlows) {
Preconditions.checkNotNull(dataBroker, "Input dataBroker cannot be NULL!");
Preconditions.checkNotNull(mdsalUtils, "Input mdsalUtils cannot be NULL!");
Preconditions.checkNotNull(sfcUtils, "Input sfcUtils cannot be NULL!");
this.dataBroker = dataBroker;
this.mdsalUtils = mdsalUtils;
this.sfcUtils = sfcUtils;
+ this.addSfFlows = addSfFlows;
}
public void setSfcClassifierService(ISfcClassifierService sfcClassifierService) {
NshUtils nshHeader = new NshUtils();
nshHeader.setNshNsp(rsp.getPathId());
nshHeader.setNshNsi(firstHop.getServiceIndex());
+ Ip sffIp = sfcUtils.getSffIp(lastHop.getServiceFunctionForwarder());
+ nshHeader.setNshMetaC1(NshUtils.convertIpAddressToLong(sffIp.getIp().getIpv4Address()));
if (isSffOnBridge(bridgeNode, serviceFunctionForwarder)) {
LOG.info("handleSff: sff and bridge are the same: {} - {}, skipping first sff",
bridgeNode.getNodeId().getValue(), serviceFunctionForwarder.getName().getValue());
Ip ip = sfcUtils.getSfIp(serviceFunction);
nshHeader.setNshTunIpDst(ip.getIp().getIpv4Address());
nshHeader.setNshTunUdpPort(ip.getPort());
+ sfcClassifierService.programIngressClassifier(dataPathId, ruleName, matches,
+ rsp.getPathId(), rsp.getStartingIndex(),
+ nshHeader, 0, rsp.getName().getValue(), true);
} else {
LOG.info("handleSff: sff and bridge are not the same: {} - {}, sending to first sff",
bridgeNode.getNodeId().getValue(), serviceFunctionForwarder.getName().getValue());
Ip ip = sfcUtils.getSffIp(serviceFunctionForwarder);
nshHeader.setNshTunIpDst(ip.getIp().getIpv4Address());
nshHeader.setNshTunUdpPort(ip.getPort());
+ sfcClassifierService.programIngressClassifier(dataPathId, ruleName, matches,
+ rsp.getPathId(), rsp.getStartingIndex(),
+ nshHeader, vxGpeOfPort, rsp.getName().getValue(), true);
}
- sfcClassifierService.programIngressClassifier(dataPathId, ruleName, matches,
- rsp.getPathId(), rsp.getStartingIndex(),
- nshHeader, vxGpeOfPort, rsp.getName().getValue(), true);
} else if (hop == lastHop) {
LOG.info("handleSff: last hop processing {} - {}",
bridgeNode.getNodeId().getValue(), serviceFunctionForwarder.getName().getValue());
}
//should be sffdplport, but they should all be the same 6633/4790
// TODO: Coexistence: SFC flows should take this using new sf dpl augmentation
- //sfcClassifierService.program_sfEgress(dataPathId, sfIpPort, true);
- //sfcClassifierService.program_sfIngress(dataPathId, sfIpPort, sfOfPort, sfIpAddr, sfDplName, true);
+ if (addSfFlows == true) {
+ sfcClassifierService.program_sfEgress(dataPathId, sfIpPort, rsp.getName().getValue(), true);
+ sfcClassifierService.program_sfIngress(dataPathId, sfIpPort, sfOfPort, sfIpAddr, sfDplName,
+ rsp.getName().getValue(), true);
+ }
sfcClassifierService.programStaticArpEntry(dataPathId, 0L, sfMac, sfIpAddr,
rsp.getName().getValue(), true);
} else {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.Matches;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.AceEth;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIp;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services;
import java.util.ArrayList;
import java.util.List;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services;
import java.util.HashMap;
import java.util.Map;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services;
public class FlowNames {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.CheckedFuture;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.ISfcClassifierService;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.NshUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.InstructionUtils;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.NshUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.providers.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.ISfcClassifierService;
+import org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.InstructionUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.Matches;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.AceEth;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIp;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.ace.ip.ace.ip.version.AceIpv4;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
getNshAction(nshHeader, actionList);
- ab.setAction(ActionUtils.outputAction(FlowUtils.getNodeConnectorId(dataPathId, vxGpeOfPort)));
- ab.setOrder(actionList.size());
- ab.setKey(new ActionKey(actionList.size()));
- actionList.add(ab.build());
+ if (vxGpeOfPort != 0) {
+ ab.setAction(ActionUtils.outputAction(FlowUtils.getNodeConnectorId(dataPathId, vxGpeOfPort)));
+ ab.setOrder(actionList.size());
+ ab.setKey(new ActionKey(actionList.size()));
+ actionList.add(ab.build());
+ } else {
+ ab.setAction(ActionUtils.nxResubmitAction(null, Service.CLASSIFIER.getTable()));
+ ab.setOrder(actionList.size());
+ ab.setKey(new ActionKey(actionList.size()));
+ actionList.add(ab.build());
+ }
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// packet from sf to sff that need to go out local
@Override
- public void program_sfEgress(long dataPathId, int dstPort, boolean write) {
+ public void program_sfEgress(long dataPathId, int dstPort, String rspName, boolean write) {
NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dataPathId);
FlowBuilder flowBuilder = new FlowBuilder();
String flowName = FlowNames.getSfEgress(dstPort);
isb.setInstruction(instructions);
flowBuilder.setInstructions(isb.build());
- writeFlow(flowBuilder, nodeBuilder);
+ writeFlow(flowBuilder, nodeBuilder, rspName, FlowID.FLOW_SFEGRESS);
} else {
- removeFlow(flowBuilder, nodeBuilder);
+ removeFlow(flowBuilder, nodeBuilder, rspName, FlowID.FLOW_SFEGRESS);
}
}
// looped back sff to sf packets
@Override
public void program_sfIngress(long dataPathId, int dstPort, long sfOfPort,
- String ipAddress, String sfDplName, boolean write) {
+ String ipAddress, String sfDplName, String rspName, boolean write) {
NodeBuilder nodeBuilder = FlowUtils.createNodeBuilder(dataPathId);
FlowBuilder flowBuilder = new FlowBuilder();
String flowName = FlowNames.getSfIngress(dstPort, ipAddress);
isb.setInstruction(instructions);
flowBuilder.setInstructions(isb.build());
- writeFlow(flowBuilder, nodeBuilder);
+ writeFlow(flowBuilder, nodeBuilder, rspName, FlowID.FLOW_SFINGRESS);
} else {
- removeFlow(flowBuilder, nodeBuilder);
+ removeFlow(flowBuilder, nodeBuilder, rspName, FlowID.FLOW_SFINGRESS);
}
}
}
private static FlowID flowSet[] = {FlowID.FLOW_INGRESSCLASS, FlowID.FLOW_EGRESSCLASS,
- FlowID.FLOW_EGRESSCLASSBYPASS, FlowID.FLOW_SFARP};
+ FlowID.FLOW_EGRESSCLASSBYPASS, FlowID.FLOW_SFARP, FlowID.FLOW_SFINGRESS, FlowID.FLOW_SFEGRESS};
@Override
public void clearFlows(DataBroker dataBroker, String rspName) {
commitFuture.get(); // TODO: Make it async (See bug 1362)
LOG.debug("Transaction success for deletion of Flow {}", path);
} catch (Exception e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Failed to remove flow {}", path, e);
modification.cancel();
}
}
+++ /dev/null
-/*
- * Copyright (c) 2013, 2015 Dell, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
-
-import java.util.Collection;
-
-import com.google.common.base.Preconditions;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * AbstractChangeListner implemented basic {@link AsyncDataChangeEvent} processing for
- * netvirt-sfc data change listener.
- */
-public abstract class AbstractDataTreeListener<T extends DataObject> implements INetvirtSfcDataProcessor<T> {
- private static final Logger LOG = LoggerFactory.getLogger(AbstractDataTreeListener.class);
- protected INetvirtSfcOF13Provider provider;
- protected final Class<T> clazz;
- private final ExecutorService executorService = Executors.newFixedThreadPool(1);
-
- public AbstractDataTreeListener(INetvirtSfcOF13Provider provider, Class<T> clazz) {
- this.provider = Preconditions.checkNotNull(provider, "provider can not be null!");
- this.clazz = Preconditions.checkNotNull(clazz, "Class can not be null!");
- }
-
- private void processChanges(Collection<DataTreeModification<T>> changes) {
- LOG.info("onDataTreeChanged: Received Data Tree Changed ...", changes);
- for (DataTreeModification<T> change : changes) {
- final InstanceIdentifier<T> key = change.getRootPath().getRootIdentifier();
- final DataObjectModification<T> mod = change.getRootNode();
- LOG.info("onDataTreeChanged: Received Data Tree Changed Update of Type={} for Key={}",
- mod.getModificationType(), key);
- switch (mod.getModificationType()) {
- case DELETE:
- remove(key, mod.getDataBefore());
- break;
- case SUBTREE_MODIFIED:
- update(key, mod.getDataBefore(), mod.getDataAfter());
- break;
- case WRITE:
- if (mod.getDataBefore() == null) {
- add(key, mod.getDataAfter());
- } else {
- update(key, mod.getDataBefore(), mod.getDataAfter());
- }
- break;
- default:
- throw new IllegalArgumentException("Unhandled modification type " + mod.getModificationType());
- }
- }
- }
-
- @Override
- public void onDataTreeChanged(final Collection<DataTreeModification<T>> changes) {
- Preconditions.checkNotNull(changes, "Changes may not be null!");
- executorService.submit(new Runnable() {
- @Override
- public void run() {
- processChanges(changes);
- }
- });
- }
-}
+++ /dev/null
-/*
- * Copyright © 2015 Dell, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
-
-import com.google.common.base.Preconditions;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.AccessLists;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Data tree listener for AccessList.
- */
-public class NetvirtSfcAclListener extends AbstractDataTreeListener<Acl> {
- private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcAclListener.class);
- private ListenerRegistration<NetvirtSfcAclListener> listenerRegistration;
-
- /**
- * {@link NetvirtSfcAclListener} constructor.
- * @param provider OpenFlow 1.3 Provider
- * @param db MdSal {@link DataBroker}
- */
- public NetvirtSfcAclListener(final INetvirtSfcOF13Provider provider, final DataBroker db) {
- super(provider, Acl.class);
- Preconditions.checkNotNull(db, "DataBroker can not be null!");
-
- registrationListener(db);
- }
-
- private void registrationListener(final DataBroker db) {
- final DataTreeIdentifier<Acl> treeId =
- new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, getIetfAclIid());
- try {
- LOG.info("Registering Data Change Listener for NetvirtSfc AccessList configuration.");
- listenerRegistration = db.registerDataTreeChangeListener(treeId, this);
- } catch (final Exception e) {
- LOG.warn("Netvirt AccessList DataChange listener registration fail!");
- throw new IllegalStateException("NetvirtSfcAccessListListener startup fail! System needs restart.", e);
- }
- }
-
- @Override
- public void close() {
- if (listenerRegistration != null) {
- try {
- listenerRegistration.close();
- } catch (final Exception e) {
- LOG.warn("Error while stopping IETF ACL ChangeListener", e);
- }
- listenerRegistration = null;
- }
- }
-
- @Override
- public void remove(final InstanceIdentifier<Acl> identifier,
- final Acl change) {
- Preconditions.checkNotNull(change, "Removed object can not be null!");
- provider.removeClassifierRules(change);
- }
-
- @Override
- public void update(final InstanceIdentifier<Acl> identifier,
- final Acl original, final Acl change) {
- Preconditions.checkNotNull(original, "Updated original object can not be null!");
- Preconditions.checkNotNull(original, "Updated update object can not be null!");
- remove(identifier, original);
- provider.addClassifierRules(change);
- }
-
- @Override
- public void add(final InstanceIdentifier<Acl> identifier,
- final Acl change) {
- Preconditions.checkNotNull(change, "Added object can not be null!");
- provider.addClassifierRules(change);
- }
-
- public InstanceIdentifier<Acl> getIetfAclIid() {
- return InstanceIdentifier.create(AccessLists.class).child(Acl.class);
- }
-}
+++ /dev/null
-/*
- * Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.ovsdb.openstack.netvirt.sfc;
-
-import com.google.common.base.Preconditions;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.RenderedServicePaths;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePath;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Data tree listener for {@link RenderedServicePath}
- */
-public class RspListener extends AbstractDataTreeListener<RenderedServicePath> {
- private static final Logger LOG = LoggerFactory.getLogger(RspListener.class);
- private ListenerRegistration<RspListener> listenerRegistration;
-
- public RspListener(final INetvirtSfcOF13Provider provider, final DataBroker db) {
- super(provider, RenderedServicePath.class);
- Preconditions.checkNotNull(db, "DataBroker can not be null!");
-
- registrationListener(db);
- }
-
- public InstanceIdentifier<RenderedServicePath> getRspIid() {
- return InstanceIdentifier.create(RenderedServicePaths.class).child(RenderedServicePath.class);
- }
-
- private void registrationListener(final DataBroker db) {
- final DataTreeIdentifier<RenderedServicePath> treeId =
- new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, getRspIid());
- try {
- LOG.info("Registering Data Change Listener for NetvirtSfc RenderedServicePath configuration.");
- listenerRegistration = db.registerDataTreeChangeListener(treeId, this);
- } catch (final Exception e) {
- LOG.warn("Netvirt RenderedServicePath DataChange listener registration failed!");
- throw new IllegalStateException("RspListener startup failed! System needs restart.", e);
- }
- }
-
- @Override
- public void remove(final InstanceIdentifier<RenderedServicePath> identifier, final RenderedServicePath change) {
- Preconditions.checkNotNull(change, "Removed object can not be null!");
- provider.removeRsp(change);
- }
-
- @Override
- public void update(final InstanceIdentifier<RenderedServicePath> identifier, final RenderedServicePath original,
- RenderedServicePath change) {
- Preconditions.checkNotNull(original, "Updated original object can not be null!");
- Preconditions.checkNotNull(original, "Updated update object can not be null!");
- remove(identifier, original);
- provider.addRsp(change);
- }
-
- @Override
- public void add(final InstanceIdentifier<RenderedServicePath> identifier, final RenderedServicePath change) {
- Preconditions.checkNotNull(change, "Created object can not be null!");
- provider.addRsp(change);
- }
-
- @Override
- public void close() throws Exception {
-
- }
-}
/*
- * Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
+ * Copyright © 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210;
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.impl.rev141210;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.NetvirtSfcProvider;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.NetvirtSfcProvider;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class NetvirtSfcModule extends AbstractNetvirtSfcModule {
- private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcModule.class);
+public class NetvirtSfcImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.impl.rev141210.AbstractNetvirtSfcImplModule {
+ private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcImplModule.class);
private BundleContext bundleContext;
- public NetvirtSfcModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
+ public NetvirtSfcImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
- public NetvirtSfcModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver,
- NetvirtSfcModule oldModule, java.lang.AutoCloseable oldInstance) {
+ public NetvirtSfcImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.impl.rev141210.NetvirtSfcImplModule oldModule, java.lang.AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
LOG.info("Netvirt SFC module initialization.");
NetvirtSfcProvider sfcProvider = new NetvirtSfcProvider(bundleContext);
sfcProvider.setOf13Provider(getOf13provider());
+ sfcProvider.setAddSfFlows(getAddsfflows());
getBrokerDependency().registerProvider(sfcProvider);
return sfcProvider;
}
--- /dev/null
+/*
+ * Copyright © 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.impl.rev141210;
+
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.osgi.framework.BundleContext;
+
+public class NetvirtSfcImplModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.impl.rev141210.AbstractNetvirtSfcImplModuleFactory {
+
+ @Override
+ public NetvirtSfcImplModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
+ BundleContext bundleContext) {
+ NetvirtSfcImplModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
+ module.setBundleContext(bundleContext);
+ return module;
+ }
+
+ @Override
+ public NetvirtSfcImplModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
+ NetvirtSfcImplModule oldModule, AutoCloseable oldInstance,
+ BundleContext bundleContext) {
+ NetvirtSfcImplModule module = super.instantiateModule(instanceName, dependencyResolver,
+ oldModule, oldInstance, bundleContext);
+ module.setBundleContext(bundleContext);
+ return module;
+ }
+}
+++ /dev/null
-/*
- * Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210;
-
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.osgi.framework.BundleContext;
-
-public class NetvirtSfcModuleFactory extends AbstractNetvirtSfcModuleFactory {
- @Override
- public NetvirtSfcModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
- BundleContext bundleContext) {
- NetvirtSfcModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
-
- @Override
- public NetvirtSfcModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
- NetvirtSfcModule oldModule, AutoCloseable oldInstance,
- BundleContext bundleContext) {
- NetvirtSfcModule module = super.instantiateModule(instanceName, dependencyResolver,
- oldModule, oldInstance, bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
-}
-module netvirt-sfc {
+module netvirt-sfc-impl {
yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:netvirt:sfc";
- prefix "netvirt-sfc";
+ namespace "urn:opendaylight:params:xml:ns:yang:netvirt:sfc:impl";
+ prefix "netvirt-sfc-impl";
import config { prefix config; revision-date 2013-04-05; }
import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28;}
"Initial revision";
}
- identity netvirt-sfc {
+ identity netvirt-sfc-impl {
base config:module-type;
- config:java-name-prefix NetvirtSfc;
+ config:java-name-prefix NetvirtSfcImpl;
}
augment "/config:modules/config:module/config:configuration" {
- case netvirt-sfc {
- when "/config:modules/config:module/config:type = 'netvirt-sfc'";
+ case netvirt-sfc-impl {
+ when "/config:modules/config:module/config:type = 'netvirt-sfc-impl'";
container broker {
uses config:service-ref {
refine type {
leaf of13provider {
type string;
}
+
+ leaf addsfflows {
+ type boolean;
+ }
}
}
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.MatchUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.MatchUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.MatchesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
public class AclMatchesTest {
@Test
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210;
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.impl.rev141210;
import org.junit.Test;
-public class NetvirtSfcModuleFactoryTest {
+public class NetvirtSfcImplModuleFactoryTest {
@Test
public void testFactoryConstructor() {
// ensure no exceptions on construction
- new NetvirtSfcModuleFactory();
+ new NetvirtSfcImplModuleFactory();
}
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev141210;
+package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.impl.rev141210;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.NetvirtSfcProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.standalone.openflow13.services.SfcClassifierService;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.NetvirtSfcProvider;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.standalone.openflow13.services.SfcClassifierService;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
-public class NetvirtSfcModuleTest {
+public class NetvirtSfcImplModuleTest {
@Test
public void testCustomValidation() {
- NetvirtSfcModule module = new NetvirtSfcModule(mock(ModuleIdentifier.class), mock(DependencyResolver.class));
+ NetvirtSfcImplModule module = new NetvirtSfcImplModule(mock(ModuleIdentifier.class), mock(DependencyResolver.class));
// ensure no exceptions on validation
// currently this method is empty
module.customValidation();
when(session.getSALService(eq(DataBroker.class))).thenReturn(dataBroker);
// create instance of module with injected mocks
- NetvirtSfcModule module = new NetvirtSfcModule(mock(ModuleIdentifier.class), dependencyResolver);
+ NetvirtSfcImplModule module = new NetvirtSfcImplModule(mock(ModuleIdentifier.class), dependencyResolver);
// getInstance calls resolveInstance to get the broker dependency and then calls createInstance
BundleContext bundleContext = mock(BundleContext.class);
PipelineOrchestrator pipelineOrchestrator = mock(PipelineOrchestrator.class);
AutoCloseable closeable = module.getInstance();
((NetvirtSfcProvider)closeable).setBundleContext(bundleContext);
((NetvirtSfcProvider)closeable).setOf13Provider("standalone");
+ ((NetvirtSfcProvider)closeable).setAddSfFlows(false);
((NetvirtSfcProvider)closeable).onSessionInitiated(session);
// verify that the module registered the returned provider with the broker
verify(broker).registerProvider((NetvirtSfcProvider)closeable);
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>it</artifactId>
<version>1.3.0-SNAPSHOT</version>
<relativePath>../../../commons/it</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack.net-virt-sfc-it</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
- <karaf.distro.groupId>org.opendaylight.ovsdb</karaf.distro.groupId>
+ <karaf.distro.groupId>org.opendaylight.netvirt</karaf.distro.groupId>
<karaf.distro.artifactId>openstack.net-virt-sfc-karaf</karaf.distro.artifactId>
<karaf.distro.version>${project.version}</karaf.distro.version>
<karaf.distro.type>zip</karaf.distro.type>
+ <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-features-test</artifactId>
+ <artifactId>openstack.net-virt-sfc-features</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-sfc-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-sfc-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openstack.net-virt-providers</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${ovsdb.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
<artifactId>utils.southbound-utils</artifactId>
+ <version>${ovsdb.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.it-utils</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.NshUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.SfcUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils.RenderedServicePathUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.standalone.openflow13.SfcClassifier;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils.AclUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils.ClassifierUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils.NetvirtConfigUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils.ServiceFunctionChainUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils.ServiceFunctionForwarderUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils.ServiceFunctionPathUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils.ServiceFunctionUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils.SfcConfigUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils.NetvirtSfcUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.sfc.workaround.services.FlowNames;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.AclUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.ClassifierUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.RenderedServicePathUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.ServiceFunctionChainUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.ServiceFunctionPathUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.ServiceFunctionUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.SfcConfigUtils;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
+import org.opendaylight.netvirt.openstack.netvirt.providers.openflow13.Service;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.NshUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.SfcUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.standalone.openflow13.SfcClassifier;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.NetvirtConfigUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.ServiceFunctionForwarderUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils.NetvirtSfcUtils;
+import org.opendaylight.netvirt.openstack.netvirt.sfc.workaround.services.FlowNames;
import org.opendaylight.ovsdb.southbound.SouthboundConstants;
-import org.opendaylight.ovsdb.utils.mdsal.openflow.FlowUtils;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.utils.it.utils.ItUtils;
+import org.opendaylight.netvirt.utils.mdsal.openflow.FlowUtils;
+import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.utils.it.utils.NodeInfo;
+import org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener;
import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
import org.opendaylight.sfc.provider.api.SfcProviderRenderedPathAPI;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.RspName;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev150105.Sfc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev150105.SfcBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
import org.opendaylight.yangtools.concepts.Builder;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.ops4j.pax.exam.Configuration;
@ExamReactorStrategy(PerClass.class)
public class NetvirtSfcIT extends AbstractMdsalTestBase {
private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcIT.class);
- private static final int MDSAL_TIMEOUT = 10000;
- private static final int NO_MDSAL_TIMEOUT = 0;
private static AclUtils aclUtils = new AclUtils();
private static ClassifierUtils classifierUtils = new ClassifierUtils();
private static NetvirtSfcUtils netvirtSfcUtils = new NetvirtSfcUtils();
private static PipelineOrchestrator pipelineOrchestrator;
private static Southbound southbound;
private static DataBroker dataBroker;
+ private static ItUtils itUtils;
public static final String CONTROLLER_IPADDRESS = "ovsdb.controller.address";
public static final String SERVER_IPADDRESS = "ovsdbserver.ipaddress";
public static final String SERVER_PORT = "ovsdbserver.port";
private static final String SF2IP = "10.2.1.2";
private static final String SF1DPLNAME = "sf1";
private static final String SF2DPLNAME = "sf2";
- // Use 192.168.50.70 when running against vagrant vm for workaround testing, eg. netvirtsfc-env
- // Use 192.168.1.129 (or whatever address is dhcp'ed) for tacker-vm
+ // Use 192.168.50.70 when running against vagrant vm for workaround testing, eg. netvirtsfc-env.
+ // Use 192.168.1.129 (or whatever address is dhcp'ed) for tacker-vm.
// "192.168.50.70"; "127.0.0.1"; "192.168.1.129";
private static final String SFF1IP = "192.168.50.70";
private static final String SFF2IP = "127.0.0.1";
@Override
public String getModuleName() {
- return "netvirt-sfc";
+ return "netvirt-sfc-impl";
}
@Override
public String getInstanceName() {
- return "netvirt-sfc-default";
+ return "netvirt-sfc-impl";
}
@Override
public MavenUrlReference getFeatureRepo() {
return maven()
- .groupId("org.opendaylight.ovsdb")
- .artifactId("openstack.net-virt-sfc-features-test")
+ .groupId("org.opendaylight.netvirt")
+ .artifactId("openstack.net-virt-sfc-features")
.classifier("features")
.type("xml")
.versionAsInProject();
private Option[] getOtherOptions() {
return new Option[] {
wrappedBundle(
- mavenBundle("org.opendaylight.ovsdb", "utils.mdsal-openflow")
+ mavenBundle("org.opendaylight.netvirt", "utils.mdsal-openflow")
.version(asInProject())
.type("jar")),
configureConsole().startLocalConsole(),
logConfiguration(NetvirtSfcIT.class),
LogLevel.INFO.name()),
editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
- "log4j.logger.org.opendaylight.ovsdb.openstack.netvirt.sfc",
+ "log4j.logger.org.opendaylight.netvirt.openstack.netvirt.sfc",
LogLevel.TRACE.name()),
editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
- "log4j.logger.org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13",
+ "log4j.logger.org.opendaylight.netvirt.openstack.netvirt.providers.openflow13",
LogLevel.TRACE.name()),
editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
"log4j.logger.org.opendaylight.sfc",
Thread.sleep(1000);
super.setup();
} catch (Exception e) {
- e.printStackTrace();
+ LOG.warn("Failed to setup test", e);
+ fail("Failed to setup test: " + e);
}
getProperties();
dataBroker = getDatabroker(getProviderContext());
+ itUtils = new ItUtils(dataBroker);
mdsalUtils = new MdsalUtils(dataBroker);
+ org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils sbMdsalUtils =
+ new org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils(dataBroker);
assertNotNull("mdsalUtils should not be null", mdsalUtils);
- southboundUtils = new SouthboundUtils(mdsalUtils);
+ southboundUtils = new SouthboundUtils(sbMdsalUtils);
sfcUtils = new SfcUtils(mdsalUtils);
assertTrue("Did not find " + NETVIRT_TOPOLOGY_ID, getNetvirtTopology());
southbound = (Southbound) ServiceHelper.getGlobalInstance(Southbound.class, this);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
- e.printStackTrace();
+ LOG.warn("Interrupted while waiting for provider context", e);
}
}
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
- e.printStackTrace();
+ LOG.warn("Interrupted while waiting for other provider", e);
}
return providerContext;
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
- e.printStackTrace();
+ LOG.warn("Interrupted while waiting for {}", NETVIRT_TOPOLOGY_ID, e);
}
}
}
}
private ServiceFunctionForwardersBuilder serviceFunctionForwardersBuilder() {
+ return serviceFunctionForwardersBuilder(null);
+ }
+
+ private ServiceFunctionForwardersBuilder serviceFunctionForwardersBuilder(OvsdbNodeRef ovsdbNodeRef) {
String sf1Name = SF1NAME;
String sf1Ip = SF1IP;
String sf1DplName = SF1DPLNAME;
ServiceFunctionForwarderBuilder serviceFunctionForwarderBuilder =
serviceFunctionForwarderUtils.serviceFunctionForwarderBuilder(
- sff1Name, sff1Ip, port, sffDpl1Name, sf1Ip, sn1Name, bridge1Name, sf1Name, sf1DplName);
+ sff1Name, sff1Ip, port, sffDpl1Name, sf1Ip, sn1Name, bridge1Name, sf1Name, sf1DplName,
+ ovsdbNodeRef);
List<ServiceFunctionForwarder> serviceFunctionForwarderList = serviceFunctionForwarderUtils.list(
new ArrayList<ServiceFunctionForwarder>(), serviceFunctionForwarderBuilder);
testModel(classifiersBuilder(), Classifiers.class);
}
- private class NodeInfo {
- private ConnectionInfo connectionInfo;
- private InstanceIdentifier<Node> ovsdbIid;
- private String bridgeName = INTEGRATION_BRIDGE_NAME;
- InstanceIdentifier<Node> bridgeIid;
- NotifyingDataChangeListener ovsdbOperationalListener;
- NotifyingDataChangeListener bridgeOperationalListener;
- long datapathId;
- Node ovsdbNode;
- Node bridgeNode;
-
- NodeInfo(ConnectionInfo connectionInfo) {
- this.connectionInfo = connectionInfo;
- ovsdbIid = SouthboundUtils.createInstanceIdentifier(connectionInfo);
- bridgeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo, bridgeName);
- }
-
- private void connect() throws InterruptedException {
- ovsdbOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, ovsdbIid);
- ovsdbOperationalListener.registerDataChangeListener();
- bridgeOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, bridgeIid);
- bridgeOperationalListener.registerDataChangeListener();
- assertNotNull("connection failed", southboundUtils.addOvsdbNode(connectionInfo, NO_MDSAL_TIMEOUT));
-
- ovsdbOperationalListener.waitForCreation();
- ovsdbNode = southboundUtils.getOvsdbNode(connectionInfo);
- assertNotNull("node is not connected", ovsdbNode);
-
- bridgeOperationalListener.waitForCreation();
- assertTrue("Controller " + SouthboundUtils.connectionInfoToString(connectionInfo)
- + " is not connected", isControllerConnected(connectionInfo));
-
- bridgeNode = southbound.getBridgeNode(ovsdbNode, bridgeName);
- assertNotNull("bridge " + bridgeName + " was not found", bridgeNode);
- datapathId = southbound.getDataPathId(bridgeNode);
- String datapathIdString = southbound.getDatapathId(bridgeNode);
- LOG.info("testNetVirt: bridgeNode: {}, datapathId: {} - {}", bridgeNode, datapathIdString, datapathId);
- assertNotEquals("datapathId was not found", datapathId, 0);
- }
-
- void disconnect() throws InterruptedException {
- assertTrue(southboundUtils.deleteBridge(connectionInfo, bridgeName, NO_MDSAL_TIMEOUT));
- bridgeOperationalListener.waitForDeletion();
- Node bridgeNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, bridgeIid);
- assertNull("Bridge should not be found", bridgeNode);
- assertTrue(southboundUtils.disconnectOvsdbNode(connectionInfo, NO_MDSAL_TIMEOUT));
- ovsdbOperationalListener.waitForDeletion();
- Node ovsdbNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, ovsdbIid);
- assertNull("Ovsdb node should not be found", ovsdbNode);
- }
- }
-
/**
* Test that the NetvirtSfc SfcClassifierService is added to the Netvirt pipeline. The test
* sets the table offset and verifies the correct flow is programmed with the offset.
short netvirtTableOffset = 1;
testModelPut(netvirtProvidersConfigBuilder(netvirtTableOffset), NetvirtProvidersConfig.class);
- NodeInfo nodeInfo = new NodeInfo(SouthboundUtils.getConnectionInfo(addressStr, portStr));
+ NodeInfo nodeInfo = itUtils.createNodeInfo(SouthboundUtils.getConnectionInfo(addressStr, portStr), waitList);
nodeInfo.connect();
String flowId = "DEFAULT_PIPELINE_FLOW_" + pipelineOrchestrator.getTable(Service.SFC_CLASSIFIER);
short egressTable = pipelineOrchestrator.getTable(Service.SFC_CLASSIFIER);
testModelPut(sfcOfRendererConfigBuilder(sfcTableoffset, egressTable), SfcOfRendererConfig.class);
- NodeInfo nodeInfo = new NodeInfo(SouthboundUtils.getConnectionInfo(addressStr, portStr));
+ NodeInfo nodeInfo = itUtils.createNodeInfo(SouthboundUtils.getConnectionInfo(addressStr, portStr), waitList);
nodeInfo.connect();
String flowId = "DEFAULT_PIPELINE_FLOW_" + pipelineOrchestrator.getTable(Service.SFC_CLASSIFIER);
InstanceIdentifier<TerminationPoint> tpIid =
southboundUtils.createTerminationPointInstanceIdentifier(nodeInfo.bridgeNode, SFFDPL1NAME);
final NotifyingDataChangeListener portOperationalListener =
- new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, tpIid);
- portOperationalListener.registerDataChangeListener();
+ new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, tpIid, waitList);
+ portOperationalListener.registerDataChangeListener(dataBroker);
InstanceIdentifier<RenderedServicePath> rspIid = sfcUtils.getRspId(RSPNAME);
final NotifyingDataChangeListener rspOperationalListener =
- new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, rspIid);
- rspOperationalListener.registerDataChangeListener();
+ new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, rspIid, waitList);
+ rspOperationalListener.registerDataChangeListener(dataBroker);
+
+ OvsdbBridgeAugmentation bridgeAugmentation = southbound.extractBridgeAugmentation(nodeInfo.bridgeNode);
+ OvsdbNodeRef ovsdbNodeRef = null;
+ if (bridgeAugmentation != null) {
+ ovsdbNodeRef = bridgeAugmentation.getManagedBy();
+ }
testModelPut(serviceFunctionsBuilder(), ServiceFunctions.class);
- testModelPut(serviceFunctionForwardersBuilder(), ServiceFunctionForwarders.class);
+ testModelPut(serviceFunctionForwardersBuilder(ovsdbNodeRef), ServiceFunctionForwarders.class);
testModelPut(serviceFunctionChainsBuilder(), ServiceFunctionChains.class);
testModelPut(serviceFunctionPathsBuilder(), ServiceFunctionPaths.class);
verifyFlow(nodeInfo.datapathId, flowId, Service.CLASSIFIER);
flowId = FlowNames.getArpResponder(SF1IP);
verifyFlow(nodeInfo.datapathId, flowId, Service.ARP_RESPONDER);
+ // Only verify these flows if NetVirt adds them and not SFC
+ //flowId = FlowNames.getSfEgress(GPEUDPPORT);
+ //verifyFlow(nodeInfo.datapathId, flowId, Service.SFC_CLASSIFIER);
+ //flowId = FlowNames.getSfIngress(GPEUDPPORT, SF1IP);
+ //verifyFlow(nodeInfo.datapathId, flowId, Service.CLASSIFIER.getTable());
+ LOG.info("check for flows!!!!!!!!!!!!!");
+ Thread.sleep(30000);
InstanceIdentifier<Flow> flowIid = createFlowIid(nodeInfo.datapathId, flowId,
pipelineOrchestrator.getTable(Service.CLASSIFIER));
final NotifyingDataChangeListener flowConfigurationListener =
- new NotifyingDataChangeListener(LogicalDatastoreType.CONFIGURATION, flowIid);
- flowConfigurationListener.registerDataChangeListener();
+ new NotifyingDataChangeListener(LogicalDatastoreType.CONFIGURATION, flowIid, waitList);
+ flowConfigurationListener.registerDataChangeListener(dataBroker);
final NotifyingDataChangeListener flowOperationalListener =
- new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, flowIid);
- flowOperationalListener.registerDataChangeListener();
+ new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, flowIid, waitList);
+ flowOperationalListener.registerDataChangeListener(dataBroker);
deleteRsp(RSPNAME);
rspOperationalListener.waitForDeletion();
SouthboundConstants.OVSDB_FAIL_MODE_MAP.inverse().get("secure"), true, null, null,
setControllerEntry, null, "00:00:00:00:00:00:00:01"));
assertTrue("Controller " + SouthboundUtils.connectionInfoToString(connectionInfo)
- + " is not connected", isControllerConnected(connectionInfo));
+ + " is not connected", itUtils.isControllerConnected(connectionInfo));
Node bridgeNode = southbound.getBridgeNode(ovsdbNode, bridgeName);
assertNotNull("bridge " + bridgeName + " was not found", bridgeNode);
}
}
- private boolean isControllerConnected(ConnectionInfo connectionInfo) throws InterruptedException {
- LOG.info("isControllerConnected enter");
- Boolean connected = false;
- ControllerEntry controllerEntry;
- Node ovsdbNode = southboundUtils.getOvsdbNode(connectionInfo);
- assertNotNull("ovsdb node not found", ovsdbNode);
-
- BridgeConfigurationManager bridgeConfigurationManager =
- (BridgeConfigurationManager) ServiceHelper.getGlobalInstance(BridgeConfigurationManager.class, this);
- assertNotNull("Could not find BridgeConfigurationManager Service", bridgeConfigurationManager);
- String controllerTarget = bridgeConfigurationManager.getControllersFromOvsdbNode(ovsdbNode).get(0);
- Assert.assertNotNull("Failed to get controller target", controllerTarget);
-
- for (int i = 0; i < 10; i++) {
- LOG.info("isControllerConnected try {}: looking for controller: {}", i, controllerTarget);
- OvsdbBridgeAugmentation bridge =
- southboundUtils.getBridge(connectionInfo, INTEGRATION_BRIDGE_NAME);
- Assert.assertNotNull(bridge);
- Assert.assertNotNull(bridge.getControllerEntry());
- controllerEntry = bridge.getControllerEntry().iterator().next();
- Assert.assertEquals(controllerTarget, controllerEntry.getTarget().getValue());
- if (controllerEntry.isIsConnected()) {
- Assert.assertTrue("Controller is not connected", controllerEntry.isIsConnected());
- connected = true;
- break;
- }
- Thread.sleep(1000);
- }
- LOG.info("isControllerConnected exit: {} - {}", connected, controllerTarget);
- return connected;
- }
-
private List<NotifyingDataChangeListener> waitList = new ArrayList<>();
private void closeWaitFors() {
try {
listener.close();
} catch (Exception ex) {
- LOG.warn("Failed to close registration {}, iid {}", listener, ex);
+ LOG.warn("Failed to close registration {}", listener, ex);
}
}
LOG.info("waitList size {}", waitList.size());
}
- public class NotifyingDataChangeListener implements AutoCloseable, DataChangeListener {
- private LogicalDatastoreType type;
- private final Set<InstanceIdentifier<?>> createdIids = new HashSet<>();
- private final Set<InstanceIdentifier<?>> removedIids = new HashSet<>();
- private final Set<InstanceIdentifier<?>> updatedIids = new HashSet<>();
- private InstanceIdentifier<?> iid;
- private final int RETRY_WAIT = 100;
- private final int MDSAL_TIMEOUT = 1000;
- private ListenerRegistration<?> listenerRegistration;
-
- private NotifyingDataChangeListener(LogicalDatastoreType type, InstanceIdentifier<?> iid) {
- this.type = type;
- this.iid = iid;
- waitList.add(this);
- }
-
- private void modify(LogicalDatastoreType type, InstanceIdentifier<?> iid) throws Exception {
- this.close();
- this.clear();
- this.type = type;
- this.iid = iid;
- }
-
- @Override
- public void onDataChanged(
- AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> asyncDataChangeEvent) {
- LOG.info("{} DataChanged: created {}", type, asyncDataChangeEvent.getCreatedData().keySet());
- LOG.info("{} DataChanged: updated {}", type, asyncDataChangeEvent.getUpdatedData().keySet());
- LOG.info("{} DataChanged: removed {}", type, asyncDataChangeEvent.getRemovedPaths());
- createdIids.addAll(asyncDataChangeEvent.getCreatedData().keySet());
- removedIids.addAll(asyncDataChangeEvent.getRemovedPaths());
- updatedIids.addAll(asyncDataChangeEvent.getUpdatedData().keySet());
- synchronized(this) {
- notifyAll();
- }
- }
-
- public boolean isCreated(InstanceIdentifier<?> iid) {
- return createdIids.remove(iid);
- }
-
- public boolean isUpdated(InstanceIdentifier<?> iid) {
- return updatedIids.remove(iid);
- }
-
- public boolean isRemoved(InstanceIdentifier<?> iid) {
- return removedIids.remove(iid);
- }
-
- public void clear() {
- createdIids.clear();
- removedIids.clear();
- updatedIids.clear();
- }
-
- public void registerDataChangeListener() {
- listenerRegistration = dataBroker.registerDataChangeListener(type, iid, this,
- AsyncDataBroker.DataChangeScope.SUBTREE);
- }
-
- public void waitForCreation() throws InterruptedException {
- waitForCreation(MDSAL_TIMEOUT);
- }
-
- public void waitForCreation(long timeout) throws InterruptedException {
- synchronized (this) {
- long _start = System.currentTimeMillis();
- LOG.info("Waiting for {} DataChanged creation on {}", type, iid);
- while (!isCreated(iid) && (System.currentTimeMillis() - _start) < timeout) {
- wait(RETRY_WAIT);
- }
- LOG.info("Woke up, waited {}ms for creation of {}", (System.currentTimeMillis() - _start), iid);
- }
- }
-
- public void waitForUpdate() throws InterruptedException {
- waitForUpdate(MDSAL_TIMEOUT);
- }
-
- public void waitForUpdate(long timeout) throws InterruptedException {
- synchronized (this) {
- long _start = System.currentTimeMillis();
- LOG.info("Waiting for {} DataChanged update on {}", type, iid);
- while (!isUpdated(iid) && (System.currentTimeMillis() - _start) < timeout) {
- wait(RETRY_WAIT);
- }
- LOG.info("Woke up, waited {}ms for update of {}", (System.currentTimeMillis() - _start), iid);
- }
- }
-
- public void waitForDeletion() throws InterruptedException {
- waitForDeletion(MDSAL_TIMEOUT);
- }
-
- public void waitForDeletion(long timeout) throws InterruptedException {
- synchronized (this) {
- long _start = System.currentTimeMillis();
- LOG.info("Waiting for {} DataChanged deletion on {}", type, iid);
- while (!isRemoved(iid) && (System.currentTimeMillis() - _start) < timeout) {
- wait(RETRY_WAIT);
- }
- LOG.info("Woke up, waited {}ms for deletion of {}", (System.currentTimeMillis() - _start), iid);
- }
- }
-
- @Override
- public void close() throws Exception {
- if (listenerRegistration != null) {
- try {
- listenerRegistration.close();
- } catch (final Exception ex) {
- LOG.warn("Failed to close registration {}, iid {}", listenerRegistration, iid, ex);
- }
- }
- waitList.remove(this);
- listenerRegistration = null;
- }
- }
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import java.util.List;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.DataPlaneLocatorBuilder;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.MatchesBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.actions.packet.handling.PermitBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.AceIpBuilder;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.matches.ace.type.ace.ip.ace.ip.version.AceIpv4Builder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev150611.acl.transport.header.fields.DestinationPortRangeBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.packet.fields.rev150611.acl.transport.header.fields.SourcePortRangeBuilder;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import java.util.ArrayList;
import java.util.List;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.providers.config.rev160109.NetvirtProvidersConfigBuilder;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.rev150105.SfcBuilder;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.CreateRenderedPathInputBuilder;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import java.util.List;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.ovs.rev140701.SffOvsBridgeAugmentationBuilder;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.ovs.rev140701.SffOvsLocatorOptionsAugmentation;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.ovs.rev140701.SffOvsLocatorOptionsAugmentationBuilder;
+import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.ovs.rev140701.SffOvsNodeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.ovs.rev140701.SffOvsNodeAugmentationBuilder;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.ovs.rev140701.bridge.OvsBridgeBuilder;
+import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.ovs.rev140701.node.OvsNodeBuilder;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.ovs.rev140701.options.OvsOptionsBuilder;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.ServiceFunctionForwardersBuilder;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.SffDataPlaneLocatorBuilder;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocatorBuilder;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.DataPlaneLocatorBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeRef;
public class ServiceFunctionForwarderUtils extends AbstractUtils {
public OvsOptionsBuilder ovsOptionsBuilder(OvsOptionsBuilder ovsOptionsBuilder, int port) {
ServiceFunctionForwarderBuilder serviceFunctionForwarderBuilder,
String sffName, String serviceNodeName, String bridgeName,
List<SffDataPlaneLocator> sffDataPlaneLocatorList,
- List<ServiceFunctionDictionary> serviceFunctionDictionaryList) {
+ List<ServiceFunctionDictionary> serviceFunctionDictionaryList,
+ OvsdbNodeRef ovsdbNodeRef) {
SffOvsBridgeAugmentationBuilder sffOvsBridgeAugmentationBuilder = new SffOvsBridgeAugmentationBuilder();
sffOvsBridgeAugmentationBuilder.setOvsBridge(ovsBridgeBuilder(new OvsBridgeBuilder(), bridgeName).build());
+ SffOvsNodeAugmentationBuilder sffOvsNodeAugmentationBuilder = new SffOvsNodeAugmentationBuilder();
+ OvsNodeBuilder ovsNodeBuilder = new OvsNodeBuilder();
+ ovsNodeBuilder.setNodeId(ovsdbNodeRef);
+ sffOvsNodeAugmentationBuilder.setOvsNode(ovsNodeBuilder.build());
+
return serviceFunctionForwarderBuilder
.setName(new SffName(sffName))
.setServiceNode(new SnName(serviceNodeName))
.setServiceFunctionDictionary(serviceFunctionDictionaryList)
.setSffDataPlaneLocator(sffDataPlaneLocatorList)
+ .addAugmentation(SffOvsNodeAugmentation.class, sffOvsNodeAugmentationBuilder.build())
.addAugmentation(SffOvsBridgeAugmentation.class, sffOvsBridgeAugmentationBuilder.build());
}
public ServiceFunctionForwarderBuilder serviceFunctionForwarderBuilder(
String sffName, String sffIp, int port, String sffDplName,
- String sfIp, String snName, String bridgeName, String sfName, String sfDplName) {
+ String sfIp, String snName, String bridgeName, String sfName, String sfDplName,
+ OvsdbNodeRef ovsdbNodeRef) {
DataPlaneLocatorBuilder dataPlaneLocatorBuilder =
dataPlaneLocatorBuilder(new DataPlaneLocatorBuilder(), sffIp, port);
ServiceFunctionForwarderBuilder serviceFunctionForwarderBuilder =
serviceFunctionForwarderBuilder(
new ServiceFunctionForwarderBuilder(), sffName, snName, bridgeName,
- sffDataPlaneLocatorList, serviceFunctionDictionaryList);
+ sffDataPlaneLocatorList, serviceFunctionDictionaryList, ovsdbNodeRef);
return serviceFunctionForwarderBuilder;
}
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import java.util.List;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfcName;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sf.rev140701.service.functions.ServiceFunction;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sf.rev140701.service.functions.ServiceFunctionBuilder;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sl.rev140701.VxlanGpe;
+import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sf.ovs.rev160107.SfDplOvsAugmentation;
+import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sf.ovs.rev160107.SfDplOvsAugmentationBuilder;
+import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sf.ovs.rev160107.connected.port.OvsPortBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
public class ServiceFunctionUtils extends AbstractUtils {
public SfDataPlaneLocatorBuilder sfDataPlaneLocatorBuilder(SfDataPlaneLocatorBuilder sfDataPlaneLocatorBuilder,
String ip, int port, String dplName, String sffName) {
+ SfDplOvsAugmentationBuilder sfDplOvsAugmentationBuilder = new SfDplOvsAugmentationBuilder();
+ OvsPortBuilder ovsPortBuilder = new OvsPortBuilder().setPortId(dplName);
+ sfDplOvsAugmentationBuilder.setOvsPort(ovsPortBuilder.build());
+
return sfDataPlaneLocatorBuilder
+ .addAugmentation(SfDplOvsAugmentation.class, sfDplOvsAugmentationBuilder.build())
.setLocatorType(ipBuilder(ip, port).build())
- .setName(new SfDataPlaneLocatorName(dplName))
+ .setName(SfDataPlaneLocatorName.getDefaultInstance(dplName))
.setTransport(VxlanGpe.class)
- .setServiceFunctionForwarder(new SffName(sffName));
+ .setServiceFunctionForwarder(SffName.getDefaultInstance(sffName));
}
public ServiceFunctionBuilder serviceFunctionBuilder(ServiceFunctionBuilder serviceFunctionBuilder,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.sfc.it.utils;
+package org.opendaylight.netvirt.openstack.netvirt.sfc.it.utils;
import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.of.renderer.rev151123.SfcOfRendererConfig;
import org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.of.renderer.rev151123.SfcOfRendererConfigBuilder;
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack.net-virt-sfc-karaf</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<artifactId>framework</artifactId>
<type>kar</type>
</dependency>
-
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>openstack.net-virt-sfc-features-test</artifactId>
+ <artifactId>openstack.net-virt-sfc-features</artifactId>
<version>${project.version}</version>
<classifier>features</classifier>
<type>xml</type>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack.net-virt-sfc-aggregator</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
</build>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack.net-virt</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<properties>
<neutron.model.version>0.7.0-SNAPSHOT</neutron.model.version>
- <powermock.version>1.6.4</powermock.version>
+ <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
<sonar.jacoco.itReportPath>../net-virt-it/target/jacoco-it.exec</sonar.jacoco.itReportPath>
</properties>
<dependencies>
- <!-- project specific dependencies -->
<dependency>
- <groupId>${project.groupId}</groupId>
+ <groupId>org.opendaylight.ovsdb</groupId>
<artifactId>southbound-api</artifactId>
- <version>${project.version}</version>
+ <version>${ovsdb.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>utils.neutron-utils</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- neutron dependencies -->
<dependency>
<groupId>org.opendaylight.neutron</groupId>
<artifactId>model</artifactId>
<version>${neutron.model.version}</version>
</dependency>
- <!-- mdsal dependencies -->
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-inet-types</artifactId>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-yang-types</artifactId>
</dependency>
- <!-- external dependencies -->
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
- <!-- testing dependencies -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-support</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-reflect</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<Embed-Dependency>utils.config;type=!pom;inline=false</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Export-Package>
- org.opendaylight.ovsdb.openstack.netvirt.translator,
- org.opendaylight.ovsdb.openstack.netvirt.api,
- org.opendaylight.ovsdb.openstack.netvirt
+ org.opendaylight.netvirt.openstack.netvirt.translator,
+ org.opendaylight.netvirt.openstack.netvirt.api,
+ org.opendaylight.netvirt.openstack.netvirt
</Export-Package>
</instructions>
</configuration>
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
/**
* Abstract class for events used by neutron northbound and southbound events.
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
import com.google.common.base.Preconditions;
import org.slf4j.Logger;
/**
* Enqueue the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
protected void enqueueEvent(AbstractEvent abstractEvent) {
LOG.info("enqueueEvent: evenDispatcher: {} - {}", eventDispatcher, abstractEvent);
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
public abstract void processEvent(AbstractEvent abstractEvent);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
/**
- * Wrapper method to executes delete as a blocking transaction.
+ * Wrapper method to execute delete as a blocking transaction.
*
* @param store {@link LogicalDatastoreType} which should be modified
* @param path {@link InstanceIdentifier} to read from
}
/**
- * Wrapper method to executes merge as a blocking transaction.
+ * Wrapper method to execute merge as a blocking transaction.
*
* @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified
* @param path {@link InstanceIdentifier} for path to read
- * @param data object of type D
+ * @param <D> the data object type
* @return the result of the request
*/
public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean merge(
}
/**
- * Wrapper method to executes put as a blocking transaction.
+ * Wrapper method to execute put as a blocking transaction.
*
* @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified
* @param path {@link InstanceIdentifier} for path to read
- * @param data object of type D
+ * @param <D> the data object type
* @return the result of the request
*/
public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean put(
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.util.ArrayList;
import java.util.Dictionary;
import org.apache.commons.lang3.tuple.Pair;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.IcmpEchoProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.VlanConfigurationCache;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EgressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.GatewayMacResolver;
-import org.opendaylight.ovsdb.openstack.netvirt.api.GatewayMacResolverListener;
-import org.opendaylight.ovsdb.openstack.netvirt.api.InboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.IngressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L3ForwardingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.MultiTenantAwareRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheListener;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OutboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.RoutingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityGroupCacheManger;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.BridgeConfigurationManagerImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.ConfigurationServiceImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.EventDispatcherImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.DistributedArpService;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NodeCacheManagerImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.OpenstackRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.OvsdbInventoryServiceImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.ProviderNetworkManagerImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.SecurityGroupCacheManagerImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.SecurityServicesImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.SouthboundImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.TenantNetworkManagerImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.VlanConfigurationCacheImpl;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronFloatingIPCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronFirewallInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronFirewallPolicyInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronFirewallRuleInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronFloatingIPInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronLoadBalancerHealthMonitorInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronLoadBalancerInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronLoadBalancerListenerInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronLoadBalancerPoolInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronLoadBalancerPoolMemberInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronNetworkInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronPortInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronRouterInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronSecurityGroupInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronSecurityRuleInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl.NeutronSubnetInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronFirewallAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronFirewallPolicyAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronFirewallRuleAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronFloatingIPAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronLoadBalancerAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolMemberAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronNetworkAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronPortAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronRouterAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronSecurityGroupAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronSecurityRuleAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronSubnetAware;
-import org.opendaylight.ovsdb.utils.neutron.utils.NeutronModelsDataStoreHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.ArpProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.BridgeConfigurationManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.EgressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.GatewayMacResolver;
+import org.opendaylight.netvirt.openstack.netvirt.api.GatewayMacResolverListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.IcmpEchoProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.IngressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.L3ForwardingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.MultiTenantAwareRouter;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.OutboundNatProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryService;
+import org.opendaylight.netvirt.openstack.netvirt.api.RoutingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.VlanConfigurationCache;
+import org.opendaylight.netvirt.openstack.netvirt.impl.BridgeConfigurationManagerImpl;
+import org.opendaylight.netvirt.openstack.netvirt.impl.ConfigurationServiceImpl;
+import org.opendaylight.netvirt.openstack.netvirt.impl.DistributedArpService;
+import org.opendaylight.netvirt.openstack.netvirt.impl.EventDispatcherImpl;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NodeCacheManagerImpl;
+import org.opendaylight.netvirt.openstack.netvirt.impl.OpenstackRouter;
+import org.opendaylight.netvirt.openstack.netvirt.impl.OvsdbInventoryServiceImpl;
+import org.opendaylight.netvirt.openstack.netvirt.impl.ProviderNetworkManagerImpl;
+import org.opendaylight.netvirt.openstack.netvirt.impl.SecurityGroupCacheManagerImpl;
+import org.opendaylight.netvirt.openstack.netvirt.impl.SecurityServicesImpl;
+import org.opendaylight.netvirt.openstack.netvirt.impl.SouthboundImpl;
+import org.opendaylight.netvirt.openstack.netvirt.impl.VlanConfigurationCacheImpl;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronFirewallInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronFirewallPolicyInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronFirewallRuleInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronFloatingIPInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronLoadBalancerInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronLoadBalancerListenerInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronLoadBalancerPoolInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronLoadBalancerPoolMemberInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronNetworkInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronPortInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronRouterInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronSecurityGroupInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronSecurityRuleInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronSubnetInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronFirewallAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronFirewallPolicyAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronLoadBalancerAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolMemberAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronNetworkAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronRouterAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronSecurityGroupAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronSecurityRuleAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronSubnetAware;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.InboundNatProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityGroupCacheManger;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.openstack.netvirt.impl.TenantNetworkManagerImpl;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronFloatingIPCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl.NeutronLoadBalancerHealthMonitorInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronFirewallRuleAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronFloatingIPAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronPortAware;
+import org.opendaylight.netvirt.utils.neutron.utils.NeutronModelsDataStoreHelper;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
registerService(context,
new String[]{EventDispatcher.class.getName()}, null, eventDispatcher);
- Dictionary<String, Object> neutronL3AdapterProperties = new Hashtable<>();
- neutronL3AdapterProperties.put(Constants.EVENT_HANDLER_TYPE_PROPERTY,
- AbstractEvent.HandlerType.NEUTRON_L3_ADAPTER);
final NeutronL3Adapter neutronL3Adapter = new NeutronL3Adapter(
new NeutronModelsDataStoreHelper(this.providerContext.getSALService(DataBroker.class)));
- registerService(context,
- new String[]{NeutronL3Adapter.class.getName(), GatewayMacResolverListener.class.getName()},
- neutronL3AdapterProperties, neutronL3Adapter);
+ registerAbstractHandlerService(context, new Class[] {NeutronL3Adapter.class, GatewayMacResolverListener.class},
+ AbstractEvent.HandlerType.NEUTRON_L3_ADAPTER, neutronL3Adapter);
+ // TODO Why is DistributedArpService registered as an event handler without being an AbstractHandlerService?
Dictionary<String, Object> distributedArpServiceProperties = new Hashtable<>();
distributedArpServiceProperties.put(Constants.EVENT_HANDLER_TYPE_PROPERTY,
AbstractEvent.HandlerType.DISTRIBUTED_ARP_SERVICE);
final DistributedArpService distributedArpService = new DistributedArpService();
registerService(context,
- new String[]{DistributedArpService.class.getName()},
+ new String[] {DistributedArpService.class.getName()},
distributedArpServiceProperties, distributedArpService);
OpenstackRouter openstackRouter = new OpenstackRouter();
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import org.osgi.framework.ServiceReference;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.net.HttpURLConnection;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewall;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewallPolicy;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewallRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronFirewallAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronFirewallPolicyAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronFirewallRuleAware;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewall;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronFirewallPolicyAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewallPolicy;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewallRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronFirewallAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronFirewallRuleAware;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Process the event.
*
- * @param abstractEvent new FWaas Event@see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent new FWaas Event@see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.net.HttpURLConnection;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronFloatingIPAware;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFloatingIP;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronFloatingIPAware;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.net.HttpURLConnection;
import java.util.List;
import java.util.Map;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronLoadBalancerAware;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheListener;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronLoadBalancerAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheListener;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.osgi.framework.ServiceReference;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.net.HttpURLConnection;
import java.util.List;
import java.util.Map;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolAware;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.osgi.framework.ServiceReference;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.net.HttpURLConnection;
import java.util.List;
import java.util.Map;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolMemberAware;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolMemberAware;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerProvider;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.osgi.framework.ServiceReference;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import com.google.common.base.Preconditions;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import com.google.common.base.Optional;
import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipState;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
return false;
}
+ public static boolean isMasterElected(){
+ if (entityOwnershipService != null) {
+ Optional<EntityOwnershipState> state = entityOwnershipService.getOwnershipState(ownerInstanceEntity);
+ return state.isPresent() && state.get().hasOwner();
+ }
+ return false;
+ }
+
@Override
public void close() throws Exception {
LOG.info("NetvirtProvider closed");
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.net.HttpURLConnection;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronNetworkAware;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronNetworkAware;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.BridgeConfigurationManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
import java.util.AbstractMap;
import java.util.List;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
/**
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
-
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+package org.opendaylight.netvirt.openstack.netvirt;
+
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFloatingIP;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_Interface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
public class NorthboundEvent extends AbstractEvent {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.net.HttpURLConnection;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronPortAware;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.DistributedArpService;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronPortAware;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.impl.DistributedArpService;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronSecurityGroupAware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronSecurityRuleAware;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronSecurityRuleAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronSecurityGroupAware;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.net.HttpURLConnection;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronRouterAware;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_Interface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronRouterAware;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.api.*;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.DistributedArpService;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.BridgeConfigurationManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryService;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.impl.DistributedArpService;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import java.net.HttpURLConnection;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronSubnetAware;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronSubnetAware;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
/**
* This enumeration represents the type of action being performed
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.net.InetAddress;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import java.util.List;
* For OpenFlow 1.3 the Integration Bridge is required and must have a physical device connected.
* @param bridgeNode the {@link Node} that represents bridge
* @param ovsdbNode the {@link Node} where the bridge is configured
- * @param network the {@link org.opendaylight.ovsdb.openstack.netvirt.translator}
+ * @param network the {@link org.opendaylight.netvirt.openstack.netvirt.translator}
* @return True or False
*/
boolean isNodeVlanReady(Node bridgeNode, Node ovsdbNode, NeutronNetwork network);
* Returns true if the bridges required for the provider network type are created
* If the bridges are not created, this method will attempt to create them
* @param node the {@link Node} to query
- * @param network the {@link org.opendaylight.ovsdb.openstack.netvirt.translator}
+ * @param network the {@link org.opendaylight.netvirt.openstack.netvirt.translator}
* @return True or False
*/
boolean createLocalNetwork(Node node, NeutronNetwork network);
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
/**
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
/**
* A collection of configuration constants
public static final Integer PROTO_DHCP_SERVER_MATCH_PRIORITY = 61006;
public static final Integer PROTO_VM_IP_MAC_MATCH_PRIORITY = 36001;
public static final Integer CT_STATE_UNTRACKED_PRIORITY = 62030;
- public static final Integer CT_STATE_TRACKED_EST_PRIORITY = 62020;
+ public static final Integer CT_STATE_TRACKED_EXIST_PRIORITY = 62020;
public static final Integer CT_STATE_TRACKED_NEW_PRIORITY = 62010;
public static final Integer CT_STATE_NEW_PRIORITY_DROP = 36007;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
import java.util.List;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractHandler;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractHandler;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractEvent;
import org.osgi.framework.ServiceReference;
/**
public interface EventDispatcher {
/**
* Enqueue the event.
- * @param event the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
+ * @param event the {@link AbstractEvent} event to be handled.
*/
void enqueueEvent(AbstractEvent event);
void eventHandlerAdded(final ServiceReference ref, AbstractHandler handler);
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.net.InetAddress;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.net.InetAddress;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
/**
* This interface allows ingress Port Security flows to be written to devices.
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
/**
* This interface allows L2Forwarding flows to be written to devices
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
/**
* This interface allows L2Rewrite flows to be written to devices
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.net.InetAddress;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import com.google.common.collect.Maps;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration.LoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration.LoadBalancerPoolMember;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
/**
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.net.InetAddress;
import java.util.UUID;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.osgi.framework.ServiceReference;
/**
* The NetworkingProvider interface is implemented by Neutron Networking Providers
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.osgi.framework.ServiceReference;
/**
* The NetworkingProviderManager handles the mapping between {@link Node}
- * and registered {@link org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider} implementations
+ * and registered {@link NetworkingProvider} implementations
*/
public interface NetworkingProviderManager {
/**
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.osgi.framework.ServiceReference;
/**
* When this interface is used, instance owner will get callbacks on
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.util.List;
import java.util.Map;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.net.InetAddress;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.yang.binding.DataObject;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
/**
* OvsdbInventoryService is the interface to the southbound for netvirt.
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
public class OvsdbPluginException extends RuntimeException {
public OvsdbPluginException(String message){
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
/**
* Enum for OVSDB tables
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.net.InetAddress;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.net.InetAddress;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
/**
* This interface maintain a mapping between the security group and the ports
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.util.List;
import java.util.Map;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
/**
* The enum which describes the generic error conditions.
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
-
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.NetworkHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbTables;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.utils.config.ConfigProperties;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
+
+import org.opendaylight.netvirt.openstack.netvirt.NetworkHandler;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbTables;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.api.BridgeConfigurationManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.utils.config.ConfigProperties;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathTypeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathTypeNetdev;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathTypeSystem;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntry;
Node ovsdbNode = southbound.readOvsdbNode(bridgeNode);
if (ovsdbNode == null) {
//this should never happen
- LOG.error("createLocalNetwork could not find ovsdbNode from bridge node " + bridgeNode);
+ LOG.error("createLocalNetwork could not find ovsdbNode from bridge node {}", bridgeNode);
return false;
}
if (network.getProviderNetworkType().equalsIgnoreCase(NetworkHandler.NETWORK_TYPE_VLAN)) {
try {
isCreated = createBridges(bridgeNode, ovsdbNode, network);
} catch (Exception e) {
- LOG.error("Error creating internal vlan net network " + bridgeNode, e);
+ LOG.error("Error creating internal vlan net network {}--{}", bridgeNode, network, e);
}
} else {
isCreated = true;
try {
isCreated = createBridges(bridgeNode, ovsdbNode, network);
} catch (Exception e) {
- LOG.error("Error creating internal vxlan/gre net network " + bridgeNode, e);
+ LOG.error("Error creating internal vxlan/gre net network {}--{}", bridgeNode, network, e);
}
} else {
isCreated = true;
return addressString;
}
} catch (UnknownHostException e) {
- LOG.error("Host {} is invalid", addressString);
+ LOG.error("Host {} is invalid", addressString, e);
}
}
return addressString;
}
} catch (UnknownHostException e) {
- LOG.error("Host {} is invalid", addressString);
+ LOG.error("Host {} is invalid", addressString, e);
}
}
openFlowPort = Short.parseShort(portString);
} catch (NumberFormatException e) {
LOG.warn("Invalid port:{}, use default({})", portString,
- openFlowPort);
+ openFlowPort, e);
}
}
return openFlowPort;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import com.google.common.collect.Maps;
import java.net.InetAddress;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbTables;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.utils.config.ConfigProperties;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbTables;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.utils.config.ConfigProperties;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.osgi.framework.ServiceReference;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import java.util.HashMap;
import java.util.List;
import com.google.common.base.Preconditions;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.ArpProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.osgi.framework.ServiceReference;
public class DistributedArpService implements ConfigInterface {
private static final Logger LOG = LoggerFactory.getLogger(DistributedArpService.class);
+ private static final String DHCP_DEVICE_OWNER = "network:dhcp";
+ private static final String ROUTER_INTERFACE_DEVICE_OWNER = "network:router_interface";
// The implementation for each of these services is resolved by the OSGi Service Manager
private volatile ConfigurationService configurationService;
private volatile TenantNetworkManager tenantNetworkManager;
private Southbound southbound;
private Boolean flgDistributedARPEnabled = true;
+ private HashMap<String, List<Neutron_IPs>> dhcpPortIpCache = new HashMap();
+
private void initMembers() {
Preconditions.checkNotNull(configurationService);
if (configurationService.isDistributedArpDisabled()) {
/**
* Process the port event to write Arp rules for neutron ports.
*
- * @param action the {@link org.opendaylight.ovsdb.openstack.netvirt.api.Action} action to be handled.
+ * @param action the {@link Action} action to be handled.
* @param neutronPort An instance of NeutronPort object.
*/
public void handlePortEvent(NeutronPort neutronPort, Action action) {
LOG.debug("neutronPort Event {} action event {} ", neutronPort, action);
if (action == Action.DELETE) {
- this.handleNeutornPortForArp(neutronPort, action);
+ this.handleNeutronPortForArp(neutronPort, action);
} else {
for (NeutronPort neutronPort1 : neutronPortCache.getAllPorts()) {
- this.handleNeutornPortForArp(neutronPort1, action);
+ this.handleNeutronPortForArp(neutronPort1, action);
}
}
}
}
if (status.isSuccess()) {
- LOG.debug("ProgramStaticArp {} for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{}",
+ LOG.debug("programStaticRuleStage2 {} for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{}",
arpProvider == null ? "skipped" : "programmed",
macAddress, address, dpid, segOrOfPort, action);
} else {
- LOG.error("ProgramStaticArp failed for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{} status:{}",
+ LOG.error("programStaticRuleStage2 failed for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{} status:{}",
macAddress, address, dpid, segOrOfPort, action, status);
}
return status;
/**
* Write Arp rules based on event for neutron port.
*
- * @param action the {@link org.opendaylight.ovsdb.openstack.netvirt.api.Action} action to be handled.
+ * @param action the {@link Action} action to be handled.
* @param neutronPort An instance of NeutronPort object.
*/
- private void handleNeutornPortForArp(NeutronPort neutronPort, Action action) {
+ private void handleNeutronPortForArp(NeutronPort neutronPort, Action action) {
+ if (!flgDistributedARPEnabled) {
+ return;
+ }
+
+ //treat UPDATE as ADD
+ final Action actionToPerform = action == Action.DELETE ? Action.DELETE : Action.ADD;
final String networkUUID = neutronPort.getNetworkUUID();
NeutronNetwork neutronNetwork = neutronNetworkCache.getNetwork(networkUUID);
}
final String providerSegmentationId = neutronNetwork != null ?
neutronNetwork.getProviderSegmentationID() : null;
- final String tenantMac = neutronPort.getMacAddress();
+ final String macAddress = neutronPort.getMacAddress();
if (providerSegmentationId == null || providerSegmentationId.isEmpty() ||
- tenantMac == null || tenantMac.isEmpty()) {
+ macAddress == null || macAddress.isEmpty()) {
// done: go no further w/out all the info needed...
return;
}
- final boolean isDelete = action == Action.DELETE;
- final Action action1 = isDelete ? Action.DELETE : Action.ADD;
-
-
List<Node> nodes = nodeCacheManager.getBridgeNodes();
if (nodes.isEmpty()) {
LOG.trace("updateL3ForNeutronPort has no nodes to work with");
+ //Do not exit, we still may need to clean up this entry from the dhcpPortToIpCache
+ }
+
+ //Neutron removes the DHCP port's IP before deleting it. As such,
+ //when it comes time to delete the port, the ARP rule can not
+ //be removed because we simply don't know the IP. To mitigate this,
+ //we cache the dhcp ports IPs (BUG 5408).
+ String owner = neutronPort.getDeviceOwner();
+ boolean isDhcpPort = owner != null && owner.equals(DHCP_DEVICE_OWNER);
+ List<Neutron_IPs> fixedIps = neutronPort.getFixedIPs();
+ if((null == fixedIps || fixedIps.isEmpty())
+ && actionToPerform == Action.DELETE && isDhcpPort){
+ fixedIps = dhcpPortIpCache.get(neutronPort.getPortUUID());
+ if(fixedIps == null) {
+ return;
+ }
}
+
+ List<Neutron_IPs> network_Ips = neutronPort.getFixedIPs();
for (Node node : nodes) {
+ // Arp rule is only needed when segmentation exists in the given node (bug 4752)
+ // or in case the port is a router interface
+ boolean isRouterInterface = owner != null && owner.equals(ROUTER_INTERFACE_DEVICE_OWNER);
+ boolean arpNeeded = isRouterInterface ||
+ tenantNetworkManager.isTenantNetworkPresentInNode(node, providerSegmentationId);
+ final Action actionForNode = arpNeeded ? actionToPerform : Action.DELETE;
final Long dpid = getDatapathIdIntegrationBridge(node);
if (dpid == null) {
continue;
}
- if (neutronPort.getFixedIPs() == null) {
- continue;
- }
- for (Neutron_IPs neutronIP : neutronPort.getFixedIPs()) {
- final String tenantIpStr = neutronIP.getIpAddress();
- if (tenantIpStr.isEmpty()) {
+
+ for (Neutron_IPs neutronIP : fixedIps) {
+ final String ipAddress = neutronIP.getIpAddress();
+ if (ipAddress.isEmpty()) {
continue;
}
- // Configure distributed ARP responder
- if (flgDistributedARPEnabled) {
- // Arp rule is only needed when segmentation exists in the given node (bug 4752).
- boolean arpNeeded = tenantNetworkManager.isTenantNetworkPresentInNode(node, providerSegmentationId);
- final Action actionForNode = arpNeeded ? action1 : Action.DELETE;
- programStaticRuleStage1(dpid, providerSegmentationId, tenantMac, tenantIpStr, actionForNode);
- }
- }
+
+ // Arp rules for dhcp port should be removed from compute node
+ // when delete the last VM instance belongs to the network (bug 5456)
+ if (false == arpNeeded && Action.DELETE == actionForNode && null != network_Ips && !network_Ips.isEmpty()) {
+ for (NeutronPort port : neutronPortCache.getAllPorts()) {
+ if (!port.getDeviceOwner().equalsIgnoreCase(ROUTER_INTERFACE_DEVICE_OWNER)) {
+ final String portMacAddress = port.getMacAddress();
+ if ( null == portMacAddress || portMacAddress.isEmpty()) {
+ continue;
+ }
+ for (Neutron_IPs neutronIPAddr : port.getFixedIPs()) {
+ final String portIPAddress = neutronIPAddr.getIpAddress();
+ if (null == portIPAddress || portIPAddress.isEmpty()) {
+ continue;
+ }
+ programStaticRuleStage1(dpid, providerSegmentationId, portMacAddress, portIPAddress, Action.DELETE);
+ }
+ }
+ }
+ } else {
+ programStaticRuleStage1(dpid, providerSegmentationId, macAddress, ipAddress, actionForNode);
+ }
+ }
+ }
+
+ //use action instead of actionToPerform - only write to the cache when the port is created
+ if(isDhcpPort && action == Action.ADD){
+ dhcpPortIpCache.put(neutronPort.getPortUUID(), fixedIps);
+ } else if (isDhcpPort && action == Action.DELETE) {
+ dhcpPortIpCache.remove(neutronPort.getPortUUID());
}
}
/**
* Check if node is integration bridge, then return its datapathID.
- * @param bridgeNode An instance of Node object.
+ * @param node An instance of Node object.
*/
private Long getDatapathIdIntegrationBridge(Node node) {
if (southbound.getBridge(node, configurationService.getIntegrationBridgeName()) != null) {
* @param bridgeNode An instance of Node object.
* @param intf An {@link org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105
* .OvsdbTerminationPointAugmentation} instance of OvsdbTerminationPointAugmentation object.
- * @param neutronNetwork An {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork} instance of NeutronNetwork
+ * @param neutronNetwork An {@link NeutronNetwork} instance of NeutronNetwork
* object.
- * @param action the {@link org.opendaylight.ovsdb.openstack.netvirt.api.Action} action to be handled.
+ * @param action the {@link Action} action to be handled.
*/
public void processInterfaceEvent(final Node bridgeNode, final OvsdbTerminationPointAugmentation intf,
final NeutronNetwork neutronNetwork, Action action) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractEvent;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractHandler;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
/**
* Enqueue the event.
*
- * @param event the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
+ * @param event the {@link AbstractEvent} event to be handled.
*/
@Override
public void enqueueEvent(AbstractEvent event) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
+
+import static org.opendaylight.netvirt.openstack.netvirt.api.Action.ADD;
+import static org.opendaylight.netvirt.openstack.netvirt.api.Action.DELETE;
+import static org.opendaylight.netvirt.openstack.netvirt.api.Action.UPDATE;
import com.google.common.base.Preconditions;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.NeutronL3AdapterEvent;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.GatewayMacResolver;
-import org.opendaylight.ovsdb.openstack.netvirt.api.GatewayMacResolverListener;
-import org.opendaylight.ovsdb.openstack.netvirt.api.IcmpEchoProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.InboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L3ForwardingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OutboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.RoutingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronFloatingIPCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronIAwareUtil;
-import org.opendaylight.ovsdb.utils.neutron.utils.NeutronModelsDataStoreHelper;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractEvent;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractHandler;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.NeutronL3AdapterEvent;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.ArpProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.GatewayMacResolver;
+import org.opendaylight.netvirt.openstack.netvirt.api.GatewayMacResolverListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.IcmpEchoProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.InboundNatProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.L3ForwardingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.OutboundNatProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.RoutingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFloatingIP;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_Interface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronFloatingIPCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl.NeutronIAwareUtil;
+import org.opendaylight.netvirt.utils.neutron.utils.NeutronModelsDataStoreHelper;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
/**
* Neutron L3 Adapter implements a hub-like adapter for the various Neutron events. Based on
/**
* Process the event.
*
- * @param action the {@link org.opendaylight.ovsdb.openstack.netvirt.api.Action} action to be handled.
+ * @param action the {@link Action} action to be handled.
* @param subnet An instance of NeutronSubnet object.
*/
public void handleNeutronSubnetEvent(final NeutronSubnet subnet, Action action) {
LOG.debug("Neutron subnet {} event : {}", action, subnet.toString());
- if (action == Action.ADD) {
+ if (action == ADD) {
this.storeNetworkInCleanupCache(neutronNetworkCache.getNetwork(subnet.getNetworkUUID()));
}
}
* For a not delete action, since a port is only create when the tennat uses the subnet, it is required to
* verify if all routers across all nodes have the interface for the port's subnet(s) configured.
*
- * @param action the {@link org.opendaylight.ovsdb.openstack.netvirt.api.Action} action to be handled.
+ * @param action the {@link Action} action to be handled.
* @param neutronPort An instance of NeutronPort object.
*/
public void handleNeutronPortEvent(final NeutronPort neutronPort, Action action) {
LOG.debug("Neutron port {} event : {}", action, neutronPort.toString());
- if (action == Action.UPDATE) {
+ if (action == UPDATE) {
// FIXME: Bug 4971 Move cleanup cache to SG Impl
this.updatePortInCleanupCache(neutronPort, neutronPort.getOriginalPort());
this.processSecurityGroupUpdate(neutronPort);
return;
}
- final boolean isDelete = action == Action.DELETE;
+ final boolean isDelete = action == DELETE;
- if (action == Action.DELETE) {
+ if (action == DELETE) {
// Bug 5164: Cleanup Floating IP OpenFlow Rules when port is deleted.
this.cleanupFloatingIPRules(neutronPort);
}
+ else if (action == UPDATE){
+ // Bug 5353: VM restart cause floatingIp flows to be removed
+ this.updateFloatingIPRules(neutronPort);
+ }
if (neutronPort.getDeviceOwner().equalsIgnoreCase(OWNER_ROUTER_GATEWAY)){
if (!isDelete) {
/**
* Process the event.
*
- * @param action the {@link org.opendaylight.ovsdb.openstack.netvirt.api.Action} action to be handled.
+ * @param action the {@link Action} action to be handled.
* @param neutronRouter An instance of NeutronRouter object.
*/
public void handleNeutronRouterEvent(final NeutronRouter neutronRouter, Action action) {
* Process the event enforcing actions and verifying dependencies between all router's interface. For example,
* delete the ports on the same subnet.
*
- * @param action the {@link org.opendaylight.ovsdb.openstack.netvirt.api.Action} action to be handled.
+ * @param action the {@link Action} action to be handled.
* @param neutronRouter An instance of NeutronRouter object.
* @param neutronRouterInterface An instance of NeutronRouter_Interface object.
*/
return;
}
- final boolean isDelete = action == Action.DELETE;
+ final boolean isDelete = action == DELETE;
this.programFlowsForNeutronRouterInterface(neutronRouterInterface, isDelete);
* packets from the floating IP address to the internal fixed ip) rules on OpenFlow Table 30 and SNAT rules (other
* way around) on OpenFlow Table 100.
*
- * @param actionIn the {@link org.opendaylight.ovsdb.openstack.netvirt.api.Action} action to be handled.
- * @param neutronFloatingIP An {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP} instance of NeutronFloatingIP object.
+ * @param actionIn the {@link Action} action to be handled.
+ * @param neutronFloatingIP An {@link NeutronFloatingIP} instance of NeutronFloatingIP object.
*/
public void handleNeutronFloatingIPEvent(final NeutronFloatingIP neutronFloatingIP,
Action actionIn) {
// Consider action to be delete if getFixedIPAddress is null
//
if (neutronFloatingIP.getFixedIPAddress() == null) {
- action = Action.DELETE;
+ action = DELETE;
} else {
action = actionIn;
}
// this.programFlowsForFloatingIP(neutronFloatingIP, action == Action.DELETE);
- if (action != Action.DELETE) {
+ if (action != DELETE) {
// must be first, as it updates floatIpDataMapCache
programFlowsForFloatingIPArpAdd(neutronFloatingIP);
- programFlowsForFloatingIPInbound(neutronFloatingIP, Action.ADD);
- programFlowsForFloatingIPOutbound(neutronFloatingIP, Action.ADD);
+ programFlowsForFloatingIPInbound(neutronFloatingIP, ADD);
+ programFlowsForFloatingIPOutbound(neutronFloatingIP, ADD);
} else {
- programFlowsForFloatingIPOutbound(neutronFloatingIP, Action.DELETE);
- programFlowsForFloatingIPInbound(neutronFloatingIP, Action.DELETE);
+ programFlowsForFloatingIPOutbound(neutronFloatingIP, DELETE);
+ programFlowsForFloatingIPInbound(neutronFloatingIP, DELETE);
// must be last, as it updates floatIpDataMapCache
programFlowsForFloatingIPArpDelete(neutronFloatingIP.getID());
private void flushExistingIpRewrite() {
for (FloatIpData fid : getAllFloatingIPsWithMetadata()) {
- programOutboundIpRewriteStage1(fid, Action.DELETE);
+ programOutboundIpRewriteStage1(fid, DELETE);
}
}
private void rebuildExistingIpRewrite() {
for (FloatIpData fid : getAllFloatingIPsWithMetadata()) {
- programOutboundIpRewriteStage1(fid, Action.ADD);
+ programOutboundIpRewriteStage1(fid, ADD);
}
}
// Respond to ARPs for the floating ip address by default, via the patch port that connects br-int to br-ex
//
if (distributedArpService.programStaticRuleStage1(dpId, encodeExcplicitOFPort(ofPort), floatingIpMac, floatingIpAddress,
- Action.ADD)) {
+ ADD)) {
final FloatIpData floatIpData = new FloatIpData(dpId, ofPort, providerSegmentationId, floatingIpMac,
floatingIpAddress, fixedIpAddress, neutronRouterMac);
floatIpDataMapCache.put(neutronFloatingIP.getID(), floatIpData);
}
if (distributedArpService.programStaticRuleStage1(floatIpData.dpid, encodeExcplicitOFPort(floatIpData.ofPort), floatIpData.macAddress,
- floatIpData.floatingIpAddress, Action.DELETE)) {
+ floatIpData.floatingIpAddress, DELETE)) {
floatIpDataMapCache.remove(neutronFloatingIPUuid);
LOG.info("Floating IP {} un-programmed ARP mac {} on {} dpid {}",
floatIpData.floatingIpAddress, floatIpData.macAddress, floatIpData.ofPort, floatIpData.dpid);
/**
* Process the event.
*
- * @param action the {@link org.opendaylight.ovsdb.openstack.netvirt.api.Action} action to be handled.
- * @param neutronNetwork An {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork} instance of NeutronFloatingIP object.
+ * @param action the {@link Action} action to be handled.
+ * @param neutronNetwork An {@link NeutronNetwork} instance of NeutronFloatingIP object.
*/
public void handleNeutronNetworkEvent(final NeutronNetwork neutronNetwork, Action action) {
LOG.debug("neutronNetwork {}: network: {}", action, neutronNetwork);
- if (action == Action.UPDATE) {
+ if (action == UPDATE) {
this.updateNetworkInCleanupCache(neutronNetwork);
}
}
* @param bridgeNode An instance of Node object.
* @param intf An {@link org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105
* .OvsdbTerminationPointAugmentation} instance of OvsdbTerminationPointAugmentation object.
- * @param neutronNetwork An {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork} instance of NeutronNetwork
+ * @param neutronNetwork An {@link NeutronNetwork} instance of NeutronNetwork
* object.
- * @param action the {@link org.opendaylight.ovsdb.openstack.netvirt.api.Action} action to be handled.
+ * @param action the {@link Action} action to be handled.
*/
public void handleInterfaceEvent(final Node bridgeNode, final OvsdbTerminationPointAugmentation intf,
final NeutronNetwork neutronNetwork, Action action) {
action, bridgeNode.getNodeId().getValue(), intf.getName(), neutronNetwork);
final NeutronPort neutronPort = tenantNetworkManager.getTenantPort(intf);
- if (action != Action.DELETE && neutronPort != null) {
+ if (action != DELETE && neutronPort != null) {
// FIXME: Bug 4971 Move cleanup cache to SG Impl
storePortInCleanupCache(neutronPort);
}
if (neutronPort != null) {
final String neutronPortUuid = neutronPort.getPortUUID();
- if (action != Action.DELETE && dpId != null && interfaceUuid != null) {
+ if (action != DELETE && dpId != null && interfaceUuid != null) {
handleInterfaceEventAdd(neutronPortUuid, dpId, interfaceUuid);
}
handleNeutronPortEvent(neutronPort, action);
}
- if (action == Action.DELETE && interfaceUuid != null) {
+ if (action == DELETE && interfaceUuid != null) {
handleInterfaceEventDelete(intf, dpId);
}
}
return;
}
- final Action action = isDelete ? Action.DELETE : Action.ADD;
+ final Action action = isDelete ? DELETE : ADD;
List<Node> nodes = nodeCacheManager.getBridgeNodes();
if (nodes.isEmpty()) {
LOG.trace("updateL3ForNeutronPort has no nodes to work with");
private void programL3ForwardingStage1(Node node, Long dpid, String providerSegmentationId,
String macAddress, String ipStr,
Action actionForNode) {
- if (actionForNode == Action.DELETE) {
+ if (actionForNode == DELETE) {
LOG.trace("Deleting Flow : programL3ForwardingStage1 for node {} providerId {} mac {} ip {} action {}",
node.getNodeId().getValue(), providerSegmentationId, macAddress, ipStr, actionForNode);
}
- if (actionForNode == Action.ADD) {
+ if (actionForNode == ADD) {
LOG.trace("Adding Flow : programL3ForwardingStage1 for node {} providerId {} mac {} ip {} action {}",
node.getNodeId().getValue(), providerSegmentationId, macAddress, ipStr, actionForNode);
}
return;
}
- final Action actionForNode = isDelete ? Action.DELETE : Action.ADD;
+ final Action actionForNode = isDelete ? DELETE : ADD;
// Keep cache for finding router's mac from network uuid -- add
//
// for the external neutron networks.
//
{
- final Action actionForRewriteExclusion = isExternal ? Action.DELETE : actionForNode;
+ final Action actionForRewriteExclusion = isExternal ? DELETE : actionForNode;
programIpRewriteExclusionStage1(node, dpid, destinationSegmentationId, cidr, actionForRewriteExclusion);
}
}
String destinationSegmentationId,
String macAddress, String ipStr, int mask,
Action actionForNode) {
- if (actionForNode == Action.DELETE) {
+ if (actionForNode == DELETE) {
LOG.trace("Deleting Flow : programRouterInterfaceStage1 for node {} sourceSegId {} destSegId {} mac {} ip {} mask {}" +
" action {}",
node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
macAddress, ipStr, mask, actionForNode);
}
- if (actionForNode == Action.ADD) {
+ if (actionForNode == ADD) {
LOG.trace("Adding Flow : programRouterInterfaceStage1 for node {} sourceSegId {} destSegId {} mac {} ip {} mask {}" +
" action {}",
node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
}
if (status.isSuccess()) {
- LOG.debug("ProgramRouterInterface {} for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{}",
+ LOG.debug("programRouterInterfaceStage2 {} for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{}",
routingProvider == null ? "skipped" : "programmed",
macAddress, address, mask, node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
actionForNode);
} else {
- LOG.error("ProgramRouterInterface failed for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{} status:{}",
+ LOG.error("programRouterInterfaceStage2 failed for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{} status:{}",
macAddress, address, mask, node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
actionForNode, status);
}
private boolean programIcmpEcho(Long dpid, String segOrOfPort,
String macAddress, String ipStr,
Action action) {
- if (action == Action.DELETE ) {
+ if (action == DELETE ) {
LOG.trace("Deleting Flow : programIcmpEcho dpid {} segOrOfPort {} mac {} ip {} action {}",
dpid, segOrOfPort, macAddress, ipStr, action);
}
- if (action == Action.ADD) {
+ if (action == ADD) {
LOG.trace("Adding Flow : programIcmpEcho dpid {} segOrOfPort {} mac {} ip {} action {}",
dpid, segOrOfPort, macAddress, ipStr, action);
}
private boolean programInboundIpRewriteStage1(Long dpid, Long inboundOFPort, String providerSegmentationId,
String matchAddress, String rewriteAddress,
Action action) {
- if (action == Action.DELETE ) {
+ if (action == DELETE ) {
LOG.trace("Deleting Flow : programInboundIpRewriteStage1 dpid {} OFPort {} seg {} matchAddress {} rewriteAddress {}" +
" action {}",
dpid, inboundOFPort, providerSegmentationId, matchAddress, rewriteAddress, action);
}
- if (action == Action.ADD ) {
+ if (action == ADD ) {
LOG.trace("Adding Flow : programInboundIpRewriteStage1 dpid {} OFPort {} seg {} matchAddress {} rewriteAddress {}" +
" action {}",
dpid, inboundOFPort, providerSegmentationId, matchAddress, rewriteAddress, action);
private void programIpRewriteExclusionStage1(Node node, Long dpid, String providerSegmentationId, String cidr,
Action actionForRewriteExclusion) {
- if (actionForRewriteExclusion == Action.DELETE ) {
+ if (actionForRewriteExclusion == DELETE ) {
LOG.trace("Deleting Flow : programIpRewriteExclusionStage1 node {} providerId {} cidr {} action {}",
node.getNodeId().getValue(), providerSegmentationId, cidr, actionForRewriteExclusion);
}
- if (actionForRewriteExclusion == Action.ADD) {
+ if (actionForRewriteExclusion == ADD) {
LOG.trace("Adding Flow : programIpRewriteExclusionStage1 node {} providerId {} cidr {} action {}",
node.getNodeId().getValue(), providerSegmentationId, cidr, actionForRewriteExclusion);
}
private void programOutboundIpRewriteStage1(FloatIpData fid, Action action) {
- if (action == Action.DELETE) {
+ if (action == DELETE) {
LOG.trace("Deleting Flow : programOutboundIpRewriteStage1 dpid {} seg {} fixedIpAddress {} floatIp {} action {} ",
fid.dpid, fid.segId, fid.fixedIpAddress, fid.floatingIpAddress, action);
}
- if (action == Action.ADD) {
+ if (action == ADD) {
LOG.trace("Adding Flow : programOutboundIpRewriteStage1 dpid {} seg {} fixedIpAddress {} floatIp {} action {} " ,
fid.dpid, fid.segId, fid.fixedIpAddress, fid.floatingIpAddress, action);
}
if (neutronFloatingIps != null && !neutronFloatingIps.isEmpty()) {
for (NeutronFloatingIP neutronFloatingIP : neutronFloatingIps) {
if (neutronFloatingIP.getPortUUID().equals(neutronPort.getPortUUID())) {
- handleNeutronFloatingIPEvent(neutronFloatingIP, Action.DELETE);
+ handleNeutronFloatingIPEvent(neutronFloatingIP, DELETE);
+ }
+ }
+ }
+ }
+
+ private void updateFloatingIPRules(final NeutronPort neutronPort) {
+ List<NeutronFloatingIP> neutronFloatingIps = neutronFloatingIpCache.getAllFloatingIPs();
+ if (neutronFloatingIps != null) {
+ for (NeutronFloatingIP neutronFloatingIP : neutronFloatingIps) {
+ if (neutronFloatingIP.getPortUUID().equals(neutronPort.getPortUUID())) {
+ handleNeutronFloatingIPEvent(neutronFloatingIP, UPDATE);
}
}
}
externalSubnet.getIpVersion() == 4 &&
gatewayPort.getFixedIPs() != null) {
LOG.info("Trigger MAC resolution for gateway ip {}", externalSubnet.getGatewayIP());
-
- gatewayMacResolver.resolveMacAddress(
+ Neutron_IPs neutronIP = null;
+ for (Neutron_IPs nIP : gatewayPort.getFixedIPs()) {
+ InetAddress ipAddress;
+ try {
+ ipAddress = InetAddress.getByName(nIP.getIpAddress());
+ } catch (UnknownHostException e) {
+ LOG.warn("unknown host exception {}", e);
+ continue;
+ }
+ if (ipAddress instanceof Inet4Address) {
+ neutronIP = nIP;
+ break;
+ }
+ }
+ if (neutronIP == null) {
+ // TODO IPv6 neighbor discovery
+ LOG.debug("Ignoring gateway ports with IPv6 only fixed ip {}",
+ gatewayPort.getFixedIPs());
+ } else {
+ gatewayMacResolver.resolveMacAddress(
this, /* gatewayMacResolverListener */
null, /* externalNetworkBridgeDpid */
true, /* refreshExternalNetworkBridgeDpidIfNeeded */
new Ipv4Address(externalSubnet.getGatewayIP()),
- new Ipv4Address(gatewayPort.getFixedIPs().get(0).getIpAddress()),
+ new Ipv4Address(neutronIP.getIpAddress()),
new MacAddress(gatewayPort.getMacAddress()),
true /* periodicRefresh */);
+ }
} else {
LOG.warn("No gateway IP address found for external network {}", externalNetwork);
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.NodeCacheManagerEvent;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheListener;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
+import org.opendaylight.netvirt.openstack.netvirt.NodeCacheManagerEvent;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractEvent;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractHandler;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
/**
* Process the event.
*
- * @param abstractEvent the {@link org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent} event to be handled.
- * @see org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher
+ * @param abstractEvent the {@link AbstractEvent} event to be handled.
+ * @see EventDispatcher
*/
@Override
public void processEvent(AbstractEvent abstractEvent) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.api.MultiTenantAwareRouter;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.api.MultiTenantAwareRouter;
import java.net.InetAddress;
import java.util.UUID;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import java.util.Map;
import java.util.Set;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.MdsalHelper;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryListener;
+import org.opendaylight.netvirt.openstack.netvirt.MdsalHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import com.google.common.collect.Sets;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.ClusterAwareMdsalUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronFloatingIPChangeListener;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronNetworkChangeListener;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronPortChangeListener;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronRouterChangeListener;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronSecurityRuleDataChangeListener;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronSubnetChangeListener;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronLoadBalancerPoolChangeListener;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronLoadBalancerPoolMemberChangeListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl.NeutronRouterChangeListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl.NeutronSecurityRuleDataChangeListener;
+import org.opendaylight.netvirt.openstack.netvirt.ClusterAwareMdsalUtils;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.NetvirtProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryService;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl.NeutronFloatingIPChangeListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl.NeutronNetworkChangeListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl.NeutronPortChangeListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl.NeutronSubnetChangeListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl.NeutronLoadBalancerPoolChangeListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl.NeutronLoadBalancerPoolMemberChangeListener;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
public void setDependencies(Object impl) {}
private void initializeNetvirtTopology() {
+ while(!NetvirtProvider.isMasterElected()){
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ LOG.warn("Netvirt thread waiting on Netvirt Ownership Election is interrupted");
+ }
+ }
final TopologyId topologyId = new TopologyId(new Uri(Constants.NETVIRT_TOPOLOGY_ID));
InstanceIdentifier<Topology> path =
InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import java.util.Map;
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryService;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.osgi.framework.ServiceReference;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
-
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityGroupCacheManger;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
+
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityGroupCacheManger;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
-
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EgressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.IngressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
+
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.EgressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.IngressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import java.math.BigInteger;
import java.security.InvalidParameterException;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.ClusterAwareMdsalUtils;
-import org.opendaylight.ovsdb.openstack.netvirt.MdsalHelper;
-import org.opendaylight.ovsdb.openstack.netvirt.NetworkHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbTables;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.NetworkHandler;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbTables;
+import org.opendaylight.netvirt.openstack.netvirt.ClusterAwareMdsalUtils;
+import org.opendaylight.netvirt.openstack.netvirt.MdsalHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.*;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.BridgeExternalIds;
}
return ovsdbBridgeAugmentation;
}
+
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import com.google.common.base.Preconditions;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.VlanConfigurationCache;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.VlanConfigurationCache;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.osgi.framework.ServiceReference;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
-
-import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
-import org.opendaylight.ovsdb.openstack.netvirt.NodeConfiguration;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.VlanConfigurationCache;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
+
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.ConfigInterface;
+import org.opendaylight.netvirt.openstack.netvirt.NodeConfiguration;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.VlanConfigurationCache;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
/**
* This class contains behaviour common to Neutron configuration objects
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
import java.util.List;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
import java.util.HashMap;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
import java.util.ArrayList;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
import java.math.BigInteger;
import java.net.InetAddress;
-import java.net.Inet6Address;
import java.net.UnknownHostException;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import org.apache.commons.net.util.SubnetUtils;
import org.apache.commons.net.util.SubnetUtils.SubnetInfo;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
import java.math.BigInteger;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator;
+package org.opendaylight.netvirt.openstack.netvirt.translator;
import java.io.Serializable;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewall;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewall;
/**
* This interface defines the methods for CRUD of NB OpenStack Firewall objects
*
* @param uuid
* UUID of the Firewall object
- * @return {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewall}
+ * @return {@link NeutronFirewall}
* OpenStackFirewall class
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewallPolicy;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewallPolicy;
/**
* This interface defines the methods for CRUD of NB OpenStack Firewall Policy objects
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewallRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewallRule;
/**
* This interface defines the methods for CRUD of NB OpenStack Firewall Rule objects
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFloatingIP;
/**
* This interface defines the methods for CRUD of NB FloatingIP objects
*
* @param uuid
* UUID of the FloatingIP object
- * @return {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP}
+ * @return {@link NeutronFloatingIP}
* OpenStack FloatingIP class
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer;
/**
* This interface defines the methods for CRUD of NB OpenStack LoadBalancer objects
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerHealthMonitor;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerHealthMonitor;
/**
* This interface defines the methods for CRUD of NB OpenStack LoadBalancerHealthMonitor objects
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerListener;
/**
* This interface defines the methods for CRUD of NB OpenStack LoadBalancerListener objects
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
/**
* This interface defines the methods for CRUD of NB OpenStack LoadBalancerPool objects
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
public interface INeutronLoadBalancerPoolMemberCRUD {
*
* @param uuid
* UUID of the NeutronLoadBalancerPoolMember object
- * @return {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember}
+ * @return {@link NeutronLoadBalancerPoolMember}
* OpenStackNeutronLoadBalancerPoolMember class
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
/**
* This interface defines the methods for CRUD of NB network objects
*
* @param uuid
* UUID of the Network object
- * @return {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork}
+ * @return {@link NeutronNetwork}
* OpenStack Network class
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
/**
* This interface defines the methods for CRUD of NB Port objects
*
* @param uuid
* UUID of the Port object
- * @return {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort}
+ * @return {@link NeutronPort}
* OpenStack Port class
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter;
/**
* This interface defines the methods for CRUD of NB Router objects
*
* @param uuid
* UUID of the Router object
- * @return {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter}
+ * @return {@link NeutronRouter}
* OpenStack Router class
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
/**
* This interface defines the methods for CRUD of NB OpenStack Security Group objects
* Security Group object exists
*
* @param uuid UUID of the Security Group object
- * @return {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup}
+ * @return {@link NeutronSecurityGroup}
* OpenStack Security Group class
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
/**
* This interface defines the methods for CRUD of NB OpenStack Security Rule objects
* Security Rule object exists
*
* @param uuid UUID of the security rule object
- * @return {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule}
+ * @return {@link NeutronSecurityRule}
* OpenStackSecurity Rule class
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
/**
* This interface defines the methods for CRUD of NB Subnet objects
*
* @param uuid
* UUID of the Subnet object
- * @return {@link org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet}
+ * @return {@link NeutronSubnet}
* OpenStack Subnet class
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.lang.reflect.Method;
import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.INeutronObject;
+import org.opendaylight.netvirt.openstack.netvirt.translator.INeutronObject;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.List;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.INeutronObject;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewall;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronFirewallCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewall;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronFirewallCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.INeutronObject;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.BundleContext;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.List;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.INeutronObject;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewallPolicy;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronFirewallPolicyCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronFirewallPolicyCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.INeutronObject;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewallPolicy;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.BundleContext;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.List;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.INeutronObject;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewallRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronFirewallRuleCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewallRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.INeutronObject;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronFirewallRuleCRUD;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.BundleContext;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronFloatingIPCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFloatingIP;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronFloatingIPCRUD;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.floatingips.attributes.Floatingips;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.floatingips.attributes.floatingips.Floatingip;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.List;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerHealthMonitor;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerHealthMonitorCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerHealthMonitor;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerHealthMonitorCRUD;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.lbaasv2.rev150712.lbaas.attributes.Healthmonitors;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.BundleContext;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.concurrent.ConcurrentMap;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.lbaasv2.rev150712.lbaas.attributes.Loadbalancers;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.lbaasv2.rev150712.lbaas.attributes.loadbalancers.Loadbalancer;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.List;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerListener;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerListenerCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerListenerCRUD;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.lbaasv2.rev150712.lbaas.attributes.Listeners;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.BundleContext;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.concurrent.ConcurrentMap;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer_SessionPersistence;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_ID;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_ID;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer_SessionPersistence;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolHttp;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.List;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolMemberCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolMemberCRUD;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.lbaasv2.rev150712.lbaas.attributes.pools.pool.Members;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.BundleContext;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork_Segment;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork_Segment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.ext.rev150712.NetworkL3Extension;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.ext.rev150712.NetworkL3ExtensionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.NetworkTypeBase;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort_AllowedAddressPairs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort_ExtraDHCPOption;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort_VIFDetail;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSecurityGroupCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort_AllowedAddressPairs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort_ExtraDHCPOption;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort_VIFDetail;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSecurityGroupCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.binding.rev150712.PortBindingExtension;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_NetworkReference;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronRouterCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_Interface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronRouterCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_NetworkReference;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.l3.attributes.Routes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.Routers;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSecurityGroupCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSecurityRuleCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSecurityRuleCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSecurityGroupCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.groups.attributes.SecurityGroups;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSecurityGroupCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSecurityRuleCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSecurityRuleCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSecurityGroupCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.DirectionBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.DirectionEgress;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnetIPAllocationPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnetIPAllocationPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.Dhcpv6Base;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.Dhcpv6Off;
result.setNetworkUUID(subnet.getNetworkId().getValue());
result.setIpVersion(IPV_MAP.get(subnet.getIpVersion()));
result.setCidr(subnet.getCidr());
- result.setGatewayIP(String.valueOf(subnet.getGatewayIp().getValue()));
result.setIpV6RaMode(DHCPV6_MAP.get(subnet.getIpv6RaMode()));
result.setIpV6AddressMode(DHCPV6_MAP.get(subnet.getIpv6AddressMode()));
result.setEnableDHCP(subnet.isEnableDhcp());
.fetchINeutronPortCRUD(this);
INeutronPortCRUD portIf = interfaces.getPortInterface();
for (NeutronPort port : portIf.getAllPorts()) {
+ if (port.getDeviceOwner().equalsIgnoreCase("network:router_interface")) {
+ result.setGatewayIP(String.valueOf(subnet.getGatewayIp().getValue()));
+ }
if (port.getFixedIPs() != null) {
for (Neutron_IPs ip : port.getFixedIPs()) {
if (ip.getSubnetUUID().equals(result.getID())) {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewall;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewall;
/**
* This interface defines the methods a service that wishes to be aware of Firewall Rules needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewallPolicy;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewallPolicy;
/**
* This interface defines the methods a service that wishes to be aware of Firewall Policys needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewallRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewallRule;
/**
* This interface defines the methods a service that wishes to be aware of Firewall Rules needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFloatingIP;
/**
* This interface defines the methods a service that wishes to be aware of Neutron FloatingIPs needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer;
/**
* This interface defines the methods a service that wishes to be aware of LoadBalancer Rules needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerHealthMonitor;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerHealthMonitor;
/**
* This interface defines the methods a service that wishes to be aware of LoadBalancerHealthMonitor Rules needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerListener;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerListener;
/**
* This interface defines the methods a service that wishes to be aware of LoadBalancerListener Rules needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
/**
* This interface defines the methods a service that wishes to be aware of LoadBalancerPool Rules needs to implement
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
public interface INeutronLoadBalancerPoolMemberAware {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
/**
* This interface defines the methods a service that wishes to be aware of Neutron Networks needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
/**
* This interface defines the methods a service that wishes to be aware of Neutron Ports needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_Interface;
/**
* This interface defines the methods a service that wishes to be aware of Neutron Routers needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
/**
* This interface defines the methods a service that wishes to be aware of Neutron Security Groups needs to implement
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
/**
* This interface defines the methods required to be aware of Neutron Security Rules
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
/**
* This interface defines the methods a service that wishes to be aware of Neutron Subnets needs to implement
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl;
import java.util.Map.Entry;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronFloatingIPAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFloatingIP;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronFloatingIPAware;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.floatingips.attributes.Floatingips;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.floatingips.attributes.floatingips.Floatingip;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl;
import java.util.ArrayList;
import java.util.List;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.routers.router.Interfaces;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_Interface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port;
import org.osgi.framework.BundleContext;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl;
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer_SessionPersistence;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_ID;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_ID;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer_SessionPersistence;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.ProtocolHttp;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl;
import java.util.Map.Entry;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolMemberAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronLoadBalancerPoolMemberAware;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.lbaasv2.rev150712.lbaas.attributes.Pools;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.lbaasv2.rev150712.lbaas.attributes.pools.Pool;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl;
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork_Segment;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronNetworkAware;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronNetworkAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork_Segment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.ext.rev150712.NetworkL3Extension;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.NetworkTypeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.NetworkTypeFlat;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl;
import java.util.ArrayList;
import java.util.HashMap;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort_AllowedAddressPairs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort_ExtraDHCPOption;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort_VIFDetail;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSecurityGroupCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronPortAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort_AllowedAddressPairs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort_ExtraDHCPOption;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort_VIFDetail;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSecurityGroupCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronPortAware;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.binding.rev150712.PortBindingExtension;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.binding.rev150712.binding.attributes.VifDetails;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl;
import java.util.ArrayList;
import java.util.HashMap;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_NetworkReference;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronRouterAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_Interface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_NetworkReference;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronRouterAware;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.l3.attributes.Routes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.Routers;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.routers.Router;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl;
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSecurityRuleCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronSecurityGroupAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSecurityRuleCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronSecurityGroupAware;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.secgroups.rev150712.security.groups.attributes.SecurityGroups;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl;
import java.util.Map.Entry;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronSecurityRuleAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronSecurityRuleAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.DirectionBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.DirectionEgress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.DirectionIngress;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.iaware.impl;
import java.util.ArrayList;
import java.util.HashSet;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnetIPAllocationPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronSubnetAware;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnetIPAllocationPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.NeutronCRUDInterfaces;
+import org.opendaylight.netvirt.openstack.netvirt.translator.iaware.INeutronSubnetAware;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.Dhcpv6Base;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.Dhcpv6Off;
package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.impl.rev150513;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.ovsdb.openstack.netvirt.NetvirtProvider;
+import org.opendaylight.netvirt.openstack.netvirt.NetvirtProvider;
import org.osgi.framework.BundleContext;
public class NetvirtImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.impl.rev150513.AbstractNetvirtImplModule {
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent.HandlerType;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractEvent.HandlerType;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
/**
* Unit test for {@link AbstractEvent}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+
/**
* Unit test for {@link AbstractHandler}
*/
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.mockito.InjectMocks;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewall;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewallPolicy;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFirewallRule;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewall;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewallPolicy;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFirewallRule;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFloatingIP;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
/**
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Map;
import java.util.Map.Entry;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration.LoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology
.Node;
import org.osgi.framework.ServiceReference;
assertEquals("Error, did not return the correct value", "mac_address", lbConfig.getVmac());
// make sure the load balancer pool member was correctly populated
- LoadBalancerPoolMember member = lbConfig.getMembers().get("pool_memberID");
+ LoadBalancerConfiguration.LoadBalancerPoolMember member = lbConfig.getMembers().get("pool_memberID");
assertEquals("Error, did not return the correct value", "pool_member_address", member.getIP());
assertEquals("Error, did not return the correct value", "mac_address", member.getMAC());
assertEquals("Error, did not return the correct value", LoadBalancerConfiguration.PROTOCOL_TCP, member.getProtocol());
lbaasHandler.setDependencies(mock(ServiceReference.class));
- assertEquals("Error, did not return the correct object", lbaasHandler.eventDispatcher, eventDispatcher);
+ Assert.assertEquals("Error, did not return the correct object", lbaasHandler.eventDispatcher, eventDispatcher);
assertEquals("Error, did not return the correct object", getField("loadBalancerProvider"), loadBalancerProvider);
assertEquals("Error, did not return the correct object", getField("nodeCacheManager"), nodeCacheManager);
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration.LoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration.LoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerProvider;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology
.Node;
import org.osgi.framework.ServiceReference;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerConfiguration.LoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.api.LoadBalancerProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancer;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPool;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancer;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerPoolCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration;
+import org.opendaylight.netvirt.openstack.netvirt.api.LoadBalancerConfiguration.LoadBalancerPoolMember;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronLoadBalancerPool;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronLoadBalancerCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.osgi.framework.ServiceReference;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.BridgeConfigurationManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105
.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import java.util.Map;
import org.junit.Test;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
/**
* Unit test for {@link NeutronCacheUtils}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
/**
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
/**
* Unit test for {@link NodeConfiguration}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.DistributedArpService;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.impl.DistributedArpService;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105
.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import java.lang.reflect.Field;
import java.net.HttpURLConnection;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
/**
@InjectMocks private PortSecurityHandler portSecurityHandler;
private PortSecurityHandler posrtSecurityHandlerSpy;
- @Mock EventDispatcher eventDispatcher;
+ @Mock
+ EventDispatcher eventDispatcher;
@Before
public void setUp() {
portSecurityHandler.setDependencies(mock(ServiceReference.class));
- assertEquals("Error, did not return the correct object", portSecurityHandler.eventDispatcher, eventDispatcher);
+ Assert.assertEquals("Error, did not return the correct object", portSecurityHandler.eventDispatcher, eventDispatcher);
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interface;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_Interface;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
/**
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.SouthboundEvent.Type;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.BridgeConfigurationManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryListener.OvsdbType;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.DistributedArpService;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.BridgeConfigurationManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryService;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.impl.DistributedArpService;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
when(southbound.readOvsdbTopologyNodes()).thenReturn(nodes);
southboundHandlerSpy.triggerUpdates();
- verify(southboundHandlerSpy, times(1)).ovsdbUpdate(any(Node.class), any(DataObject.class), any(OvsdbType.class), any(Action.class));
+ verify(southboundHandlerSpy, times(1)).ovsdbUpdate(any(Node.class), any(DataObject.class), any(OvsdbInventoryListener.OvsdbType.class), any(Action.class));
}
// NODE
when(ev.getNode()).thenReturn(node);
when(ev.getAugmentationData()).thenReturn(mock(OvsdbNodeAugmentation.class));
- when(ev.getType()).thenReturn(Type.NODE);
+ when(ev.getType()).thenReturn(SouthboundEvent.Type.NODE);
when(ev.getAction()).thenReturn(Action.ADD);
southboundHandler.processEvent(ev);
// BRIDGE
when(ev.getNode()).thenReturn(node);
when(ev.getAugmentationData()).thenReturn(mock(OvsdbBridgeAugmentation.class));
- when(ev.getType()).thenReturn(Type.BRIDGE);
+ when(ev.getType()).thenReturn(SouthboundEvent.Type.BRIDGE);
when(southbound.getDatapathId(any(OvsdbBridgeAugmentation.class))).thenReturn("45");
// when(ovsdbTerminationPointAugmentation.getInterfaceType()).thenReturn(n);
when(ev.getNode()).thenReturn(node);
when(ev.getAugmentationData()).thenReturn(ovsdbTerminationPointAugmentation);
- when(ev.getType()).thenReturn(Type.PORT);
+ when(ev.getType()).thenReturn(SouthboundEvent.Type.PORT);
NetworkingProvider networkingProvider = mock(NetworkingProvider.class);
NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
// OPENVSWITCH
when(ev.getNode()).thenReturn(node);
when(ev.getAugmentationData()).thenReturn(ovsdbTerminationPointAugmentation);
- when(ev.getType()).thenReturn(Type.OPENVSWITCH);
+ when(ev.getType()).thenReturn(SouthboundEvent.Type.OPENVSWITCH);
when(ovsdbTerminationPointAugmentation.getName()).thenReturn("network");
List<TerminationPoint> terminationPoints = new ArrayList<>();
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt;
+package org.opendaylight.netvirt.openstack.netvirt;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.impl.NeutronL3Adapter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.osgi.framework.ServiceReference;
/**
*
* Authors : Marcus Koontz
*/
-package org.opendaylight.ovsdb.openstack.netvirt.api;
+package org.opendaylight.netvirt.openstack.netvirt.api;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
+import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbTables;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbTables;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathTypeSystem;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105
@Test
public void testGetPhysicalInterfaceName() throws Exception {
- when(southbound.getOtherConfig(any(Node.class), eq(OvsdbTables.OPENVSWITCH), anyString()))
+ when(southbound.getOtherConfig(any(Node.class), Matchers.eq(OvsdbTables.OPENVSWITCH), anyString()))
.thenReturn(null)
.thenReturn(null)
.thenReturn(PROVIDER_MAPPINGS);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbTables;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.utils.config.ConfigProperties;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbTables;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.utils.config.ConfigProperties;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology
.Node;
--- /dev/null
+/*
+ * Copyright (c) 2016 NEC Corporation and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.openstack.netvirt.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.when;
+
+import java.lang.reflect.Field;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.ArpProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+
+import org.osgi.framework.ServiceReference;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.api.support.membermodification.MemberMatcher;
+import org.powermock.api.support.membermodification.MemberModifier;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.reflect.Whitebox;
+
+/**
+ * Unit test for {@link DistributedArpService}
+ */
+@PrepareForTest({ServiceHelper.class, InetAddress.class, DistributedArpService.class})
+@RunWith(PowerMockRunner.class)
+public class DistributedArpServiceTest {
+
+ @Mock private DistributedArpService distributedArpService;
+ /**
+ * ID used for testing different scenarios.
+ */
+ private static final String ID = "45";
+ /**
+ * IP used for testing different scenarios.
+ */
+ private static final String IP = "127.0.0.1";
+ /**
+ * MALFORM_IP used for testing different scenarios.
+ */
+ private static final String MALFORM_IP = "127.0.0.1.5";
+ /**
+ * INTF_NAME used for testing different scenarios.
+ */
+ private static final String INTF_NAME = "br-int";
+ /**
+ * UUID used for testing different scenarios.
+ */
+ private static final String UUID = "7da709ff-397f-4778-a0e8-994811272fdb";
+ /**
+ * FIXED_IP_ADDRESS used for testing different scenarios.
+ */
+ private static final String FIXED_IP_ADDRESS = "192.168.1.0";
+ /**
+ * MAC_ADDRESS used for testing different scenarios.
+ */
+ private static final String MAC_ADDRESS = "00:00:5E:00:02:01";
+ /**
+ * MAC_ADDRESS_2 used for testing different scenarios.
+ */
+ private static final String MAC_ADDRESS_2 = "00:00:5E:00:02:02";
+ /**
+ * PORT_INT used for testing different scenarios.
+ */
+ private static final String PORT_INT = "port_int";
+
+ @Before
+ public void setUp() throws Exception{
+ distributedArpService = PowerMockito.spy(new DistributedArpService());
+ }
+
+ /**
+ * Test that checks if @{DistributedArpService#handlePortEvent} is called
+ * and then checks that the port event process to write arp rules for neutron ports based on action.
+ */
+ @Test
+ public void testHandlePortEvent() throws Exception {
+ NeutronPort neutronPortOne = PowerMockito.mock(NeutronPort.class);
+ NeutronPort neutronPortTwo = PowerMockito.mock(NeutronPort.class);
+ List<NeutronPort> list_neutronPort = new ArrayList<>();
+ list_neutronPort.add(neutronPortOne);
+ list_neutronPort.add(neutronPortTwo);
+ INeutronPortCRUD neutronPortCache = PowerMockito.mock(INeutronPortCRUD.class);
+ MemberModifier.field(DistributedArpService.class, "neutronPortCache").set(distributedArpService, neutronPortCache);
+ PowerMockito.when(neutronPortCache, "getAllPorts").thenReturn(list_neutronPort);
+
+ // Suppress the called to these functions.
+ MemberModifier.suppress(MemberMatcher.method(DistributedArpService.class, "handleNeutronPortForArp", NeutronPort.class, Action.class));
+
+ //Case 1: Delete Action.
+ Whitebox.invokeMethod(distributedArpService, "handlePortEvent", neutronPortOne, Action.DELETE);
+ PowerMockito.verifyPrivate(distributedArpService, times(1)).invoke("handleNeutronPortForArp", any(NeutronPort.class), eq(Action.DELETE));
+
+ //Case 2: Add Action.
+ Whitebox.invokeMethod(distributedArpService, "handlePortEvent", neutronPortOne, Action.ADD);
+ PowerMockito.verifyPrivate(distributedArpService, times(2)).invoke("handleNeutronPortForArp", any(NeutronPort.class), eq(Action.ADD));
+ }
+
+ /**
+ * Test that checks if @{DistributedArpService#programStaticRuleStage1} is called
+ * and then checks that the arp rules are added/removed based on neutron port event.
+ */
+ @Test
+ public void testProgramStaticRuleStage1() throws Exception {
+ MemberModifier.suppress(MemberMatcher.method(DistributedArpService.class, "programStaticRuleStage2", Long.class, String.class, String.class, String.class, Action.class));
+ PowerMockito.when(distributedArpService, "programStaticRuleStage2", anyLong(), anyString(), anyString(), anyString(), any(Action.class)).thenReturn(new Status(StatusCode.SUCCESS));
+
+ //Case 1: Add Action.
+ Whitebox.invokeMethod(distributedArpService, "programStaticRuleStage1", Long.valueOf(12), PORT_INT, MAC_ADDRESS, IP, Action.ADD);
+ PowerMockito.verifyPrivate(distributedArpService, times(1)).invoke("programStaticRuleStage2", anyLong(), anyString(), anyString(), anyString(), eq(Action.ADD));
+
+ //Case 2: Delete Action.
+ Whitebox.invokeMethod(distributedArpService, "programStaticRuleStage1", Long.valueOf(12), PORT_INT, MAC_ADDRESS, IP, Action.DELETE);
+ PowerMockito.verifyPrivate(distributedArpService, times(1)).invoke("programStaticRuleStage2", anyLong(), anyString(), anyString(), anyString(), eq(Action.DELETE));
+ }
+
+ /**
+ * Test that checks if @{DistributedArpService#programStaticRuleStage2} is called
+ * and then checks that the arp rules are programmed by invoke arpProvider.
+ */
+ @Test
+ public void testProgramStaticRuleStage2() throws Exception {
+ //Case 1: StatusCode BADREQUEST.
+ assertEquals("Error, this not return the correct status code", new Status(StatusCode.BADREQUEST), Whitebox.invokeMethod(distributedArpService, "programStaticRuleStage2", Long.valueOf(45), PORT_INT, MAC_ADDRESS, MALFORM_IP, Action.ADD));
+ PowerMockito.mockStatic(InetAddress.class);
+ InetAddress inetAddress = mock(InetAddress.class);
+ PowerMockito.when(InetAddress.getByName(anyString())).thenReturn(inetAddress);
+
+ //Case 2: StatusCode SUCCESS.
+ assertEquals("Error, this not return the correct status code", new Status(StatusCode.SUCCESS), Whitebox.invokeMethod(distributedArpService, "programStaticRuleStage2", Long.valueOf(45), PORT_INT, MAC_ADDRESS, IP, Action.DELETE));
+ }
+
+ /**
+ * Test that checks if @{DistributedArpService#handleNeutornPortForArp} is called
+ * and then checks that the arp rules are written based on event for neutron port.
+ */
+ @Test
+ public void testHandleNeutornPortForArp() throws Exception {
+ Neutron_IPs neutronIp = mock(Neutron_IPs.class);
+ when(neutronIp.getIpAddress()).thenReturn(FIXED_IP_ADDRESS);
+ List<Neutron_IPs> neutronIps = new ArrayList<>();
+ neutronIps.add(neutronIp);
+ NeutronPort neutronPort = mock(NeutronPort.class);
+ when(neutronPort.getNetworkUUID()).thenReturn(UUID);
+ when(neutronPort.getMacAddress()).thenReturn(MAC_ADDRESS_2);
+ when(neutronPort.getFixedIPs()).thenReturn(neutronIps);
+ NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
+ when(neutronNetwork.getProviderSegmentationID()).thenReturn(ID);
+ List<Node> nodes = new ArrayList<>();
+ nodes.add(mock(Node.class));
+ TenantNetworkManager tenantNetworkManager = mock(TenantNetworkManager.class);
+ MemberModifier.field(DistributedArpService.class, "tenantNetworkManager").set(distributedArpService, tenantNetworkManager);
+ when(tenantNetworkManager.isTenantNetworkPresentInNode(any(Node.class), eq(ID))).thenReturn(true);
+ PowerMockito.doReturn(15L).when(distributedArpService, "getDatapathIdIntegrationBridge", any(Node.class));
+ INeutronNetworkCRUD neutronNetworkCache = mock(INeutronNetworkCRUD.class);
+ when(neutronNetworkCache.getNetwork(anyString())).thenReturn(neutronNetwork);
+ MemberModifier.field(DistributedArpService.class, "neutronNetworkCache").set(distributedArpService, neutronNetworkCache);
+ NodeCacheManager nodeCacheManager = mock(NodeCacheManager.class);
+ when(nodeCacheManager.getBridgeNodes()).thenReturn(nodes);
+ MemberModifier.field(DistributedArpService.class, "nodeCacheManager").set(distributedArpService, nodeCacheManager);
+ MemberModifier.field(DistributedArpService.class, "flgDistributedARPEnabled").set(distributedArpService, true);
+
+ // Suppress the called to these functions.
+ MemberModifier.suppress(MemberMatcher.method(DistributedArpService.class, "programStaticRuleStage1", Long.class, String.class, String.class, String.class, Action.class));
+
+ //Case 1: Add Action.
+ Whitebox.invokeMethod(distributedArpService, "handleNeutronPortForArp", neutronPort, Action.ADD);
+ PowerMockito.verifyPrivate(distributedArpService, times(1)).invoke("getDatapathIdIntegrationBridge", any(Node.class));
+ Mockito.verify(distributedArpService, times(1)).programStaticRuleStage1(anyLong(), anyString(), anyString(), anyString(), eq(Action.ADD));
+
+ //Case 2: Delete Action.
+ Whitebox.invokeMethod(distributedArpService, "handleNeutronPortForArp", neutronPort, Action.DELETE);
+ PowerMockito.verifyPrivate(distributedArpService, times(2)).invoke("getDatapathIdIntegrationBridge", any(Node.class));
+ Mockito.verify(distributedArpService, times(1)).programStaticRuleStage1(anyLong(), anyString(), anyString(), anyString(), eq(Action.DELETE));
+ }
+
+ /**
+ * Test that checks if @{DistributedArpService#getDatapathIdIntegrationBridge} is called
+ * and then checks the node integration bridge, then return its datapathID.
+ */
+ @Test
+ public void testGetDatapathIdIntegrationBridge() throws Exception {
+ Southbound southbound = mock(Southbound.class);
+ ConfigurationService configurationService = mock(ConfigurationService.class);
+
+ MemberModifier.field(DistributedArpService.class, "southbound").set(distributedArpService, southbound);
+ MemberModifier.field(DistributedArpService.class, "configurationService").set(distributedArpService, configurationService);
+
+ PowerMockito.when(southbound.getBridge(any(Node.class), anyString())).thenReturn(mock(OvsdbBridgeAugmentation.class));
+ PowerMockito.when(configurationService.getIntegrationBridgeName()).thenReturn("");
+ PowerMockito.when(southbound.getDataPathId(any(Node.class))).thenReturn(45L);
+
+ //Assert check for correct Dp Id.
+ assertEquals("Error, did not return the correct Dpid", 45, (long)Whitebox.invokeMethod(distributedArpService, "getDatapathIdIntegrationBridge", mock(Node.class)));
+ }
+
+ /**
+ * Test that checks if @{DistributedArpService#processInterfaceEvent} is called
+ * and then checks that the event is processing.
+ */
+ @Test
+ public void testProcessInterfaceEvent() throws Exception {
+ NeutronPort neutronPort = mock(NeutronPort.class);
+ NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
+ PowerMockito.doNothing().when(distributedArpService).handlePortEvent(any(NeutronPort.class), any(Action.class));
+ // init instance variables.
+ TenantNetworkManager tenantNetworkManager = mock(TenantNetworkManager.class);
+ MemberModifier.field(DistributedArpService.class, "tenantNetworkManager").set(distributedArpService , tenantNetworkManager);
+
+ // Mock variables
+ NodeId nodeId = mock(NodeId.class);
+ when(nodeId.getValue()).thenReturn(ID);
+ Node node = mock(Node.class);
+ when(node.getNodeId()).thenReturn(nodeId);
+
+ OvsdbTerminationPointAugmentation intf = mock(OvsdbTerminationPointAugmentation.class);
+ when(intf.getName()).thenReturn(INTF_NAME);
+
+ when(tenantNetworkManager.getTenantPort(intf)).thenReturn(neutronPort);
+
+ //Case 1: Add Action.
+ distributedArpService.processInterfaceEvent(node, intf, neutronNetwork, Action.ADD);
+ Mockito.verify(distributedArpService, times(1)).handlePortEvent(neutronPort, Action.ADD);
+
+ //Case 2: Delete Action.
+ distributedArpService.processInterfaceEvent(node, intf, neutronNetwork, Action.DELETE);
+ Mockito.verify(distributedArpService, times(1)).handlePortEvent(neutronPort, Action.DELETE);
+ }
+
+ /**
+ * Test that checks if @{DistributedArpService#setDependencies} is called
+ * and then checks the object instances.
+ */
+ @Test
+ public void testSetDependencies() throws Exception {
+ TenantNetworkManager tenantNetworkManager = mock(TenantNetworkManager.class);
+ ConfigurationService configurationService = mock(ConfigurationService.class);
+ ArpProvider arpProvider = mock(ArpProvider.class);
+ NodeCacheManager nodeCacheManager = mock(NodeCacheManager.class);
+ Southbound southbound = mock(Southbound.class);
+
+ ServiceHelper.overrideGlobalInstance(TenantNetworkManager.class, tenantNetworkManager);
+ ServiceHelper.overrideGlobalInstance(ConfigurationService.class, configurationService);
+ ServiceHelper.overrideGlobalInstance(ArpProvider.class, arpProvider);
+ ServiceHelper.overrideGlobalInstance(NodeCacheManager.class, nodeCacheManager);
+ ServiceHelper.overrideGlobalInstance(Southbound.class, southbound);
+
+ distributedArpService.setDependencies(mock(ServiceReference.class));
+
+ assertEquals("Error, did not return the correct object", getField("tenantNetworkManager"), tenantNetworkManager);
+ assertEquals("Error, did not return the correct object", getField("configurationService"), configurationService);
+ assertEquals("Error, did not return the correct object", getField("arpProvider"), arpProvider);
+ assertEquals("Error, did not return the correct object", getField("nodeCacheManager"), nodeCacheManager);
+ assertEquals("Error, did not return the correct object", getField("southbound"), southbound);
+ }
+
+ /**
+ * Test that checks if @{DistributedArpService#setDependencies} is called
+ * and then checks the object instances.
+ */
+ @Test
+ public void testSetDependenciesObject() throws Exception{
+ INeutronNetworkCRUD iNeutronNetworkCRUD = mock(INeutronNetworkCRUD.class);
+ distributedArpService.setDependencies(iNeutronNetworkCRUD);
+ assertEquals("Error, did not return the correct object", getField("neutronNetworkCache"), iNeutronNetworkCRUD);
+
+ INeutronPortCRUD iNeutronPortCRUD = mock(INeutronPortCRUD.class);
+ distributedArpService.setDependencies(iNeutronPortCRUD);
+ assertEquals("Error, did not return the correct object", getField("neutronPortCache"), iNeutronPortCRUD);
+
+ ArpProvider arpProvider = mock(ArpProvider.class);
+ distributedArpService.setDependencies(arpProvider);
+ assertEquals("Error, did not return the correct object", getField("arpProvider"), arpProvider);
+ }
+
+ private Object getField(String fieldName) throws Exception {
+ Field field = DistributedArpService.class.getDeclaredField(fieldName);
+ field.setAccessible(true);
+ return field.get(distributedArpService);
+ }
+}
\ No newline at end of file
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import org.junit.Before;
import org.junit.Test;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractEvent;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractHandler;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractEvent;
+import org.opendaylight.netvirt.openstack.netvirt.api.Constants;
import org.osgi.framework.ServiceReference;
/**
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.apache.commons.lang3.tuple.Pair;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronRouter_Interface;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronFloatingIPCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.AbstractHandler;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.InboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L3ForwardingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OutboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.RoutingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Status;
-import org.opendaylight.ovsdb.openstack.netvirt.api.StatusCode;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFloatingIP;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronRouter_Interface;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronFloatingIPCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.AbstractHandler;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.ArpProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.InboundNatProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.L3ForwardingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.OutboundNatProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.RoutingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.Status;
+import org.opendaylight.netvirt.openstack.netvirt.api.StatusCode;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.NodeCacheManagerEvent;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheListener;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.NodeCacheManagerEvent;
+import org.opendaylight.netvirt.openstack.netvirt.api.Action;
+import org.opendaylight.netvirt.openstack.netvirt.api.EventDispatcher;
+import org.opendaylight.netvirt.openstack.netvirt.api.NodeCacheListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import org.mockito.InjectMocks;
import org.mockito.runners.MockitoJUnitRunner;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryListener;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryListener;
/**
* Unit test for {@link NodeCacheManagerImpl}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryService;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.OvsdbInventoryService;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology
.Node;
import org.osgi.framework.ServiceReference;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.times;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSecurityGroupCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.api.SecurityServicesManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSecurityGroupCRUD;
/**
* Unit test fort {@link SecurityGroupCacheManagerImpl}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.EgressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.IngressAclProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityRule;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSubnet;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.api.ConfigurationService;
+import org.opendaylight.netvirt.openstack.netvirt.api.EgressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.IngressAclProvider;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityGroup;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSecurityRule;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronSubnet;
+import org.opendaylight.netvirt.openstack.netvirt.translator.Neutron_IPs;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronSubnetCRUD;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105
.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology
public class SecurityServicesImplTest {
@InjectMocks private SecurityServicesImpl securityServicesImpl;
- @Mock INeutronNetworkCRUD neutronNetworkCache;
+ @Mock
+ INeutronNetworkCRUD neutronNetworkCache;
@Mock private INeutronPortCRUD neutronPortCache;
@Mock private INeutronSubnetCRUD subNetCache;
@Mock private Southbound southbound;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.VlanConfigurationCache;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.crud.INeutronPortCRUD;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronNetworkCRUD;
+import org.opendaylight.netvirt.openstack.netvirt.api.NetworkingProviderManager;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.VlanConfigurationCache;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.netvirt.openstack.netvirt.translator.crud.INeutronPortCRUD;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105
.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.impl;
+package org.opendaylight.netvirt.openstack.netvirt.impl;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronNetwork;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
+import org.opendaylight.netvirt.openstack.netvirt.api.Southbound;
+import org.opendaylight.netvirt.openstack.netvirt.api.TenantNetworkManager;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronNetwork;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105
.OvsdbTerminationPointAugmentation;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.openstack.netvirt.translator.crud.impl;
+package org.opendaylight.netvirt.openstack.netvirt.translator.crud.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronFloatingIP;
+import org.opendaylight.netvirt.openstack.netvirt.translator.NeutronFloatingIP;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.floatingips.attributes.floatingips.Floatingip;
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>openstack</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>ovsdb-ui-bundle</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
</license>
</licenses>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<version>${dlux.version}</version>
</dependency>
<dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>ovsdb-ui-module</artifactId>
<version>${project.version}</version>
</dependency>
<configuration>
<artifactItems>
<artifactItem>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>ovsdb-ui-module</artifactId>
<version>${project.version}</version>
<overWrite>true</overWrite>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>ovsdb-ui-module</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>jar</packaging>
</license>
</licenses>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>ovsdb-ui</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>ovsdb-ui</name>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>ovsdb</artifactId>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>netvirt</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name> <!-- Used by Sonar to set project name -->
<packaging>pom</packaging>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
</prerequisites>
<modules>
- <!-- Parent POM files -->
<module>commons</module>
-
- <module>library</module>
- <!-- Aggregations -->
<module>features</module>
<module>karaf</module>
- <!-- OVSDB Components -->
- <module>southbound</module>
+ <module>netvirt</module>
<module>openstack</module>
- <module>ovsdb-artifacts</module>
- <module>schemas</module>
- <module>utils</module>
+ <module>netvirt-artifacts</module>
<module>ovsdb-ui</module>
<module>routemgr</module>
- <module>hwvtepsouthbound</module>
- <module>netvirt</module>
+ <module>utils</module>
</modules>
<!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
- Qos-and-Queue-Collection-Environment-Variables.postman_environment : Postman environment file that defines variables used by the Qos-and-Queue-Collection.json.postman_collection
- Qos-and-Queue-Collection.json.postman_collection - Collection of Postman Restconf commands for doing CRUD operations on Qos and Queue entries.
+
+- readable_flows.py : script for formatting ovs-ofctl dump-flows output into a more readable format. Run w/ -h for help
+
+- pplogs.py : script for reformatting serialized nested objects in OpenDaylight log lines. Run w/ -h for help
--- /dev/null
+#!/usr/bin/python
+
+import string
+from sys import stdout,stdin,argv,exit
+
+if len(argv) > 1 and argv[1] in ['-h', '-?', '--h', '--help']:
+ print 'pplog.py pretty prints Open Daylight log lines, useful for lines containing large nested objects'
+ print 'Usage: Simply pipe the lines you are interested through this script'
+ exit(0)
+
+line_num = 0
+def nl():
+ global line_num
+ line_num += 1
+ stdout.write('\n' + i)
+
+for l in stdin:
+ if '|' not in l: continue
+
+ (t, level, component, cat, art, msg) = string.split(l, '|', maxsplit=5)
+
+ I = ' '
+ opener = '[{<'
+ closer = ']}>'
+ i = ''
+
+ in_ws = 1
+ is_empty_list = 0
+ last_char = ''
+ title = ''
+ title_stack = []
+
+ for c in msg:
+ if in_ws and c in ' \t': continue
+ in_ws = 0
+
+ if c in closer:
+ i = i[:-2]
+ if not is_empty_list and last_char not in closer: nl()
+ in_ws = 1
+ is_empty_list = 0
+ title = ''
+ elif is_empty_list:
+ is_empty_list = 0
+ nl()
+
+ if last_char in closer and c != ',': nl()
+
+ stdout.write(c)
+ if not c in opener: title += c
+ last_char = c
+
+ if c in closer:
+ if len(title_stack):
+ (t,ln) = title_stack.pop()
+ if (line_num - ln) > 5: stdout.write(' /* ' + t.strip() + ' */')
+
+ if c in opener:
+ i += I
+ in_ws = 1
+ is_empty_list = 1
+ if title:
+ title_stack.append((title, line_num))
+ title = ''
+
+ if c == ',':
+ nl()
+ in_ws = 1
+ title = ''
--- /dev/null
+#!/usr/bin/python
+
+import subprocess
+import sys
+import re
+from collections import defaultdict
+
+help ='''## readable_flows.py:
+
+This script pretty prints ovs flows created by ovsdb. Features include:
+
+1. Where possible, MACs are followed by their corresponding IP (in parenthases) and vice-versa
+2. Tunnel ids are followed by the decimal representation used by Open Daylight
+3. Counters and stats are removed so that meaningful diffs may be generated
+4. Table numbers are given together with descriptive names
+5. Flows are grouped together by priority in decending order
+
+### Usage:
+This script must be run on the OpenStack controller since it uses the
+neutron command to map MACs and IPs.
+> sudo ovs-ofctl -OOpenFlow13 dump-flows br-int | python readable_flows.py
+'''
+
+if len(sys.argv) > 1 and sys.argv[1] in ['-h', '-?', '--h', '--help']:
+ print help
+ sys.exit(0)
+
+DEFAULT_PRIO=32768
+
+TABLE_NAME = { \
+0: 'CLASSIFIER',\
+20: 'GATEWAY_RESOLVER',\
+10: 'DIRECTOR',\
+10: 'SFC_CLASSIFIER',\
+20: 'ARP_RESPONDER',\
+30: 'INBOUND_NAT',\
+40: 'EGRESS_ACL',\
+50: 'LOAD_BALANCER',\
+60: 'ROUTING',\
+70: 'ICMP_ECHO',\
+70: 'L3_FORWARDING',\
+80: 'L2_REWRITE',\
+90: 'INGRESS_ACL',\
+100: 'OUTBOUND_NAT',\
+110: 'L2_FORWARDING'}
+
+PORT_LIST_CMD = 'neutron port-list -c mac_address -c fixed_ips'.split(' ')
+
+LINE_PATTERN = '.*(?P<table>table=\d*), (?P<counters>n_packets=\d*, n_bytes=\d*), (?P<prio>priority=\d*)?,?(?P<rule>.*)'
+MAX_LINE = 30
+
+def print_rules(table, rules_by_prio):
+ print ''
+ cut = table.find('=')
+ print table.upper() + ' (' + TABLE_NAME[int(table[cut+1:])] + ')'
+
+ prios = rules_by_prio.keys()
+ prios.sort()
+ prios.reverse()
+ for prio in prios:
+ print ' priority=%i' % prio,
+ if DEFAULT_PRIO == prio: print '(DEFAULT_PRIO)'
+ else: print ''
+ for rule in rules_by_prio[prio]:
+ print_flow(' ', re.sub('actions=', 'ACTIONS=', rule))
+
+def tun_match_to_decimal(m):
+ s = m.group('num')
+ return 'tun_id=0x%s(%i)' % (s, int(s, 16))
+def tun_set_to_decimal(m):
+ s = m.group('num')
+ return '0x%s(%i)->tun_id' % (s, int(s, 16))
+
+def print_flow(indent, f):
+ print indent + f
+# WIP
+# flow = indent + f
+# if len(flow) <= MAX_LINE:
+# print flow
+# return
+#
+# cut = flow.find('ACTIONS')
+# match = flow[0:cut - 1]
+# action = indent + indent + flow[cut:]
+# print match
+# while action:
+# if len(action) <= MAX_LINE:
+# print action
+# break
+# cut = action.rfind(',', 0, MAX_LINE)
+# if cut < 2:
+# print action
+# break
+# print action[0:cut + 1]
+# action = indent + indent + (' ' * len('ACTIONS=')) + action[cut +1:]
+
+port_list_out = subprocess.check_output(PORT_LIST_CMD)
+
+addresses = []
+for line in port_list_out.split('\n')[2:]:
+ if re.match('^$', line): continue
+ if '----' in line: continue
+ line = re.sub('^\| ', '', line)
+ line = re.sub(' *\|$', '', line)
+ (mac, fixed_ip) = line.split(' | ')
+ ip = eval(fixed_ip)['ip_address']
+ addresses.append((mac, ip))
+
+table = ''
+rules_by_prio = defaultdict(list)
+for line in sys.stdin:
+ for (mac, ip) in addresses:
+ line = re.sub(mac, '%s(%s)' % (mac, ip), line)
+ line = re.sub('=%s(\D)' % ip, '=%s(%s)\\1' % (ip, mac), line)
+ line = re.sub('tun_id=0x(?P<num>[0-9a-fA-F]*)', tun_match_to_decimal, line)
+ line = re.sub('0x(?P<num>[0-9a-fA-F]*)->tun_id', tun_set_to_decimal, line)
+ match = re.match(LINE_PATTERN, line)
+ if not match:
+ print '[Not a flow line?]: ' + line,
+ continue
+
+ if match.group('table') != table:
+ if table:
+ print_rules(table, rules_by_prio)
+ rules_by_prio = defaultdict(list)
+ table = match.group('table')
+
+ prio = DEFAULT_PRIO
+ prio_str = match.group('prio')
+ if None != prio_str: prio = int(prio_str[9:])
+ rules_by_prio[prio].append(match.group('rule'))
+
+print_rules(table, rules_by_prio)
+
'dkms',
'fakeroot',
'graphviz',
+ 'libssl-dev',
'linux-headers-generic',
'python-all',
'python-qt4',
and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL\r
-->\r
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
- <groupId>org.opendaylight.ovsdb</groupId>\r
+ <groupId>org.opendaylight.netvirt</groupId>\r
<parent>\r
<groupId>org.opendaylight.odlparent</groupId>\r
<artifactId>odlparent-lite</artifactId>\r
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>routemgr-api</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>routemgr-artifacts</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<version>0.5.0-SNAPSHOT</version>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>routemgr-config</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>jar</packaging>
<version>1.7.0-SNAPSHOT</version>
<relativePath></relativePath>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>routemgr-features</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>routemgr-impl</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<configuration>
<instructions>
<Export-Package>
- org.opendaylight.ovsdb.routemgr,
- org.opendaylight.ovsdb.routemgr.*,
+ org.opendaylight.netvirt.routemgr,
+ org.opendaylight.netvirt.routemgr.*,
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.routemgr.impl.rev141210.*</Export-Package>
</instructions>
</configuration>
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.net;
+package org.opendaylight.netvirt.routemgr.net;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActions;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
-import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import java.math.BigInteger;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.net;
+package org.opendaylight.netvirt.routemgr.net;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.net;
+package org.opendaylight.netvirt.routemgr.net;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.net;
+package org.opendaylight.netvirt.routemgr.net;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.net;
+package org.opendaylight.netvirt.routemgr.net;
+import org.opendaylight.netvirt.routemgr.utils.BitBufferHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived;
-import org.opendaylight.ovsdb.routemgr.utils.BitBufferHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.net;
+package org.opendaylight.netvirt.routemgr.net;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.net;
+package org.opendaylight.netvirt.routemgr.net;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.net;
+package org.opendaylight.netvirt.routemgr.net;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.utils;
+package org.opendaylight.netvirt.routemgr.utils;
import org.slf4j.Logger;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.utils;
+package org.opendaylight.netvirt.routemgr.utils;
/**
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.routemgr.utils;
+package org.opendaylight.netvirt.routemgr.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.ovsdb.routemgr.net.OvsdbDataListener;
+import org.opendaylight.netvirt.routemgr.net.OvsdbDataListener;
import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.opendaylight.ovsdb.routemgr.net.PktHandler;
-import org.opendaylight.ovsdb.routemgr.net.NetDataListener;
-import org.opendaylight.ovsdb.routemgr.net.IPv6RtrFlow;
+import org.opendaylight.netvirt.routemgr.net.PktHandler;
+import org.opendaylight.netvirt.routemgr.net.NetDataListener;
+import org.opendaylight.netvirt.routemgr.net.IPv6RtrFlow;
public class RoutemgrImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.routemgr.impl.rev141210.AbstractRoutemgrImplModule {
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>routemgr-karaf</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>utils.config</artifactId>
<name>${project.artifactId}</name>
<version>1.3.0-SNAPSHOT</version>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
- <properties>
- <powermock.version>1.6.4</powermock.version>
- </properties>
-
<dependencies>
<!-- testing dependencies -->
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<scope>test</scope>
- <version>${powermock.version}</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
- <version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
- <version>${powermock.version}</version>
</dependency>
</dependencies>
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.utils.config;
+package org.opendaylight.netvirt.utils.config;
import java.util.HashMap;
import java.util.Map;
*
* Authors : Flavio Fernandes
*/
-package org.opendaylight.ovsdb.utils.config;
+package org.opendaylight.netvirt.utils.config;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-parent</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- <relativePath/>
- </parent>
-
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>utils.hwvtepsouthbound-utils</artifactId>
- <version>1.3.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
-
- <dependencies>
- <!-- project specific dependencies -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>hwvtepsouthbound-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>hwvtepsouthbound-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>utils.mdsal-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <!-- testing dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.ovsdb.utils.hwvtepsouthbound.utils;
-
-import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepSouthboundConstants;
-import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepSouthboundMapper;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ConnectionInfo;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class HwvtepSouthboundUtils {
- private static final Logger LOG = LoggerFactory.getLogger(HwvtepSouthboundUtils.class);
- private static final int HWVTEP_UPDATE_TIMEOUT = 1000;
- private final MdsalUtils mdsalUtils;
-
- public HwvtepSouthboundUtils(MdsalUtils mdsalUtils) {
- this.mdsalUtils = mdsalUtils;
- }
-
- public static NodeId createNodeId(IpAddress ip, PortNumber port) {
- String uriString = HwvtepSouthboundConstants.HWVTEP_URI_PREFIX + "://"
- + String.valueOf(ip.getValue()) + ":" + port.getValue();
- Uri uri = new Uri(uriString);
- return new NodeId(uri);
- }
-
- public static Node createNode(ConnectionInfo key) {
- NodeBuilder nodeBuilder = new NodeBuilder();
- nodeBuilder.setNodeId(createNodeId(key.getRemoteIp(), key.getRemotePort()));
- nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, createHwvtepAugmentation(key));
- return nodeBuilder.build();
- }
-
- public static HwvtepGlobalAugmentation createHwvtepAugmentation(ConnectionInfo key) {
- HwvtepGlobalAugmentationBuilder hwvtepGlobalBuilder = new HwvtepGlobalAugmentationBuilder();
- hwvtepGlobalBuilder.setConnectionInfo(key);
- return hwvtepGlobalBuilder.build();
- }
-
- public static InstanceIdentifier<Node> createInstanceIdentifier(ConnectionInfo key) {
- return createInstanceIdentifier(key.getRemoteIp(), key.getRemotePort());
- }
-
- public static InstanceIdentifier<Node> createInstanceIdentifier(IpAddress ip, PortNumber port) {
- InstanceIdentifier<Node> path = InstanceIdentifier
- .create(NetworkTopology.class)
- .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID))
- .child(Node.class,createNodeKey(ip,port));
- LOG.debug("Created hwvtep path: {}",path);
- return path;
- }
-
- public static InstanceIdentifier<Node> createInstanceIdentifier(ConnectionInfo key, HwvtepNodeName name) {
- return HwvtepSouthboundMapper.createInstanceIdentifier(
- createManagedNodeId(key, name));
- }
-
- private static NodeId createManagedNodeId(ConnectionInfo key, HwvtepNodeName nodeName) {
- return createManagedNodeId(key.getRemoteIp(), key.getRemotePort(), nodeName);
- }
-
- private static NodeId createManagedNodeId(IpAddress remoteIp, PortNumber remotePort, HwvtepNodeName nodeName) {
- //This assumes that HwvtepNode can only be Physical switch
- return new NodeId(createNodeId(remoteIp,remotePort).getValue()
- + "/" + HwvtepSouthboundConstants.PSWITCH_URI_PREFIX + "/" + nodeName.getValue());
- }
-
- public static NodeKey createNodeKey(IpAddress ip, PortNumber port) {
- return new NodeKey(createNodeId(ip, port));
- }
-
- public static Object connectionInfoToString(ConnectionInfo connectionInfo) {
- return String.valueOf(
- connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
- }
-
-}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (C) 2016 Red Hat, Inc. and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-parent</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>utils.it-utils</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <scm>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
+ <tag>HEAD</tag>
+ <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
+ </scm>
+
+ <properties>
+ <ovsdb.version>1.3.0-SNAPSHOT</ovsdb.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>utils.mdsal-utils</artifactId>
+ <version>${ovsdb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>southbound-api</artifactId>
+ <version>${ovsdb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.ovsdb</groupId>
+ <artifactId>utils.southbound-utils</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+/*
+ * Copyright (c) 2015 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netvirt.utils.it.utils;
+
+/**
+ * Constants for SouthboundIT
+ */
+public final class ItConstants {
+ private ItConstants() {
+ throw new AssertionError("This class should not be instantiated.");
+ }
+
+ public static final String ORG_OPS4J_PAX_LOGGING_CFG = "etc/org.ops4j.pax.logging.cfg";
+ public static final String CUSTOM_PROPERTIES = "etc/custom.properties";
+ public static final String SERVER_IPADDRESS = "ovsdbserver.ipaddress";
+ public static final String SERVER_PORT = "ovsdbserver.port";
+ public static final String CONTROLLER_IPADDRESS = "ovsdb.controller.address";
+ public static final String USERSPACE_ENABLED = "ovsdb.userspace.enabled";
+ public static final String SERVER_EXTRAS = "ovsdbserver.extras";
+ public static final String CONNECTION_TYPE = "ovsdbserver.connection";
+ public static final String CONNECTION_TYPE_ACTIVE = "active";
+ public static final String CONNECTION_TYPE_PASSIVE = "passive";
+ public static final int CONNECTION_INIT_TIMEOUT = 10000;
+ public static final String DEFAULT_SERVER_IPADDRESS = "127.0.0.1";
+ public static final String DEFAULT_SERVER_PORT = "6640";
+ public static final String DEFAULT_OPENFLOW_PORT = "6653";
+ public static final String DEFAULT_SERVER_EXTRAS = "false";
+ public static final String BRIDGE_NAME = "brtest";
+ public static final String PORT_NAME = "porttest";
+ public static final String INTEGRATION_BRIDGE_NAME = "br-int";
+ public static final String OPENFLOW_CONNECTION_PROTOCOL = "tcp";
+ public static final String NETVIRT_TOPOLOGY_ID = "netvirt:1";
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.utils.it.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.List;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener;
+import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class contains various utility methods used in OVSDB integration tests (IT).
+ */
+public class ItUtils {
+ private static final Logger LOG = LoggerFactory.getLogger(ItUtils.class);
+ MdsalUtils mdsalUtils;
+ SouthboundUtils southboundUtils;
+ DataBroker dataBroker;
+
+ /**
+ * Create a new ItUtils instance
+ * @param dataBroker md-sal data broker
+ */
+ public ItUtils(DataBroker dataBroker) {
+ this.dataBroker = dataBroker;
+ mdsalUtils = new MdsalUtils(dataBroker);
+ southboundUtils = new SouthboundUtils(mdsalUtils);
+ }
+
+ /**
+ * Get a NodeInfo instance initialized with this ItUtil's DataBroker
+ * @param connectionInfo ConnectionInfo for the OVSDB server
+ * @param waitList For tracking outstanding md-sal events notifications
+ * @return
+ */
+ public NodeInfo createNodeInfo(ConnectionInfo connectionInfo, List<NotifyingDataChangeListener> waitList) {
+ return new NodeInfo(connectionInfo, this, waitList);
+ }
+
+ /**
+ * Checks whether the OVSDB controller is connected. This method will retry 10 times and will through an
+ * AssertionError for any number of unexpected states.
+ * @param connectionInfo
+ * @return true if connected
+ * @throws InterruptedException
+ */
+ public boolean isControllerConnected(ConnectionInfo connectionInfo) throws InterruptedException {
+ LOG.info("isControllerConnected enter");
+ ControllerEntry controllerEntry;
+ Node ovsdbNode = southboundUtils.getOvsdbNode(connectionInfo);
+ assertNotNull("ovsdb node not found", ovsdbNode);
+
+ String controllerTarget = southboundUtils.getControllersFromOvsdbNode(ovsdbNode).get(0);
+ assertNotNull("Failed to get controller target", controllerTarget);
+
+ for (int i = 0; i < 10; i++) {
+ LOG.info("isControllerConnected try {}: looking for controller: {}", i, controllerTarget);
+ OvsdbBridgeAugmentation bridge =
+ southboundUtils.getBridge(connectionInfo, "br-int");
+ if (bridge != null && bridge.getControllerEntry() != null) {
+ controllerEntry = bridge.getControllerEntry().iterator().next();
+ assertEquals(controllerTarget, controllerEntry.getTarget().getValue());
+ if (controllerEntry.isIsConnected()) {
+ LOG.info("isControllerConnected exit: true {}", controllerTarget);
+ return true;
+ }
+ }
+ Thread.sleep(1000);
+ }
+ LOG.info("isControllerConnected exit: false {}", controllerTarget);
+ return false;
+ }
+
+ public static DataBroker getDatabroker(BindingAwareBroker.ProviderContext providerContext) {
+ DataBroker dataBroker = providerContext.getSALService(DataBroker.class);
+ assertNotNull("dataBroker should not be null", dataBroker);
+ return dataBroker;
+ }
+
+ public Boolean getNetvirtTopology() {
+ LOG.info("getNetvirtTopology: looking for {}...", ItConstants.NETVIRT_TOPOLOGY_ID);
+ Boolean found = false;
+ final TopologyId topologyId = new TopologyId(new Uri(ItConstants.NETVIRT_TOPOLOGY_ID));
+ InstanceIdentifier<Topology> path =
+ InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
+ for (int i = 0; i < 60; i++) {
+ Topology topology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, path);
+ if (topology != null) {
+ LOG.info("getNetvirtTopology: found {}...", ItConstants.NETVIRT_TOPOLOGY_ID);
+ found = true;
+ break;
+ } else {
+ LOG.info("getNetvirtTopology: still looking (try {})...", i);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ LOG.warn("Interrupted while waiting for {}", ItConstants.NETVIRT_TOPOLOGY_ID, e);
+ }
+ }
+ }
+ return found;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.utils.it.utils;
+
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener;
+import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Utility class for connections to an OVSDB node. Contains various info for the node
+ * as public data members.
+ */
+public class NodeInfo {
+ private static final Logger LOG = LoggerFactory.getLogger(NodeInfo.class);
+ public static final String INTEGRATION_BRIDGE_NAME = "br-int";
+
+ private ConnectionInfo connectionInfo;
+ private InstanceIdentifier<Node> ovsdbIid;
+ InstanceIdentifier<Node> bridgeIid;
+ public long datapathId;
+ public Node ovsdbNode;
+ public Node bridgeNode;
+ NotifyingDataChangeListener ovsdbWaiter;
+ NotifyingDataChangeListener bridgeWaiter;
+ List<NotifyingDataChangeListener> waitList;
+ ItUtils itUtils;
+
+ /**
+ * Create a new NodeInfo object
+ * @param connectionInfo of the OVSDB node
+ * @param itUtils ItUtils instance
+ * @param waitList for tracking outstanding md-sal events
+ */
+ NodeInfo(ConnectionInfo connectionInfo, ItUtils itUtils, List<NotifyingDataChangeListener> waitList) {
+ this.connectionInfo = connectionInfo;
+ this.itUtils = itUtils;
+ this.waitList = waitList;
+ ovsdbIid = SouthboundUtils.createInstanceIdentifier(connectionInfo);
+ bridgeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo, INTEGRATION_BRIDGE_NAME);
+ }
+
+ /**
+ * Connect to the OVSDB node, wait for the connection to be established and for the integration bridge
+ * to be successfully created. Contains assertions for unexpected states
+ * @throws InterruptedException
+ */
+ public void connect() throws InterruptedException {
+ ovsdbWaiter = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, ovsdbIid, waitList);
+ ovsdbWaiter.registerDataChangeListener(itUtils.dataBroker);
+ bridgeWaiter = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, bridgeIid, waitList);
+ bridgeWaiter.registerDataChangeListener(itUtils.dataBroker);
+
+ assertNotNull("connection failed", itUtils.southboundUtils.addOvsdbNode(connectionInfo, 0));
+
+ ovsdbWaiter.waitForCreation();
+ ovsdbNode = itUtils.southboundUtils.getOvsdbNode(connectionInfo);
+ assertNotNull("node is not connected", ovsdbNode);
+
+ bridgeWaiter.waitForCreation();
+ assertTrue("Controller " + SouthboundUtils.connectionInfoToString(connectionInfo)
+ + " is not connected", itUtils.isControllerConnected(connectionInfo));
+
+ bridgeNode = itUtils.southboundUtils.getBridgeNode(ovsdbNode, INTEGRATION_BRIDGE_NAME);
+ assertNotNull("bridge " + INTEGRATION_BRIDGE_NAME + " was not found", bridgeNode);
+ datapathId = itUtils.southboundUtils.getDataPathId(bridgeNode);
+ String datapathIdString = itUtils.southboundUtils.getDatapathId(bridgeNode);
+ LOG.info("testNetVirt: bridgeNode: {}, datapathId: {} - {}", bridgeNode, datapathIdString, datapathId);
+ assertNotEquals("datapathId was not found", datapathId, 0);
+ }
+
+ /**
+ * Remove integration bridge and teardown connection. Contains assertions for unexpected states.
+ * @throws InterruptedException
+ */
+ public void disconnect() throws InterruptedException {
+ assertTrue(itUtils.southboundUtils.deleteBridge(connectionInfo, INTEGRATION_BRIDGE_NAME, 0));
+ itUtils.southboundUtils.deleteBridge(connectionInfo, INTEGRATION_BRIDGE_NAME, 0);
+ bridgeWaiter.waitForDeletion();
+ Node bridgeNode = itUtils.mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, bridgeIid);
+ assertNull("Bridge should not be found", bridgeNode);
+ assertTrue(itUtils.southboundUtils.disconnectOvsdbNode(connectionInfo, 0));
+ itUtils.southboundUtils.disconnectOvsdbNode(connectionInfo, 0);
+ ovsdbWaiter.waitForDeletion();
+ Node ovsdbNode = itUtils.mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, ovsdbIid);
+ assertNull("Ovsdb node should not be found", ovsdbNode);
+ }
+
+}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (C) 2014 Red Hat, Inc. and others. All rights reserved.
-
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-parent</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- <relativePath/>
- </parent>
-
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>utils.mdsal-node</artifactId>
- <name>${project.artifactId}</name>
- <version>1.3.0-SNAPSHOT</version>
- <packaging>jar</packaging>
- <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
- <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
- <licenses>
- <license>
- <name>Eclipse Public License v1.0</name>
- <url>http://www.eclipse.org/legal/epl-v10.html</url>
- </license>
- </licenses>
- <developers>
- <developer>
- <name>Sam Hague</name>
- <email>shague@gmail.com</email>
- <url>https://github.com/shague</url>
- </developer>
- </developers>
- <scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
- <tag>HEAD</tag>
- <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
- </scm>
-
- <dependencies>
- <!-- controller dependencies -->
- <dependency>
- <groupId>org.opendaylight.controller.model</groupId>
- <artifactId>model-inventory</artifactId>
- </dependency>
- <!-- testing dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
+++ /dev/null
-/*
- * Copyright (c) 2015 Red Hat, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.ovsdb.utils.mdsal.node;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-
-public class NodeUtils {
-
- public static String getId (String identifier) {
- String id = identifier;
-
- String[] pair = identifier.split("\\|");
- if ((pair.length > 1) && (pair[0].equals("OVS"))) {
- id = pair[1];
- }
- return id;
- }
-
- public static Node getOpenFlowNode (String identifier) {
- NodeId nodeId = new NodeId(identifier);
- NodeKey nodeKey = new NodeKey(nodeId);
-
- return new NodeBuilder()
- .setId(nodeId)
- .setKey(nodeKey)
- .build();
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.ovsdb.utils.mdsal.node;
-
-import java.math.BigInteger;
-
-public class StringConvertor{
-
- public static long dpidStringToLong(String values) {
- return new BigInteger(values.replaceAll(":", ""), 16).longValue();
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2015 Red Hat, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Authors : Sam Hague
- */
-package org.opendaylight.ovsdb.utils.mdsal.node;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.Test;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-public class NodeUtilsTest {
- private static final String OVS = "OVS";
- private static final String IDENTIFIER = "192.168.120.31:45001";
- private static final String OVS_IDENTIFIER = OVS + "|" + IDENTIFIER;
- private static final String BAD_IDENTIFIER = "BAD" + "|" + IDENTIFIER;
-
- @Test
- public void testGetId () {
- String identifier = NodeUtils.getId(OVS_IDENTIFIER);
- assertEquals("getId(" + OVS_IDENTIFIER + ") should return " + IDENTIFIER,
- identifier, IDENTIFIER);
-
- identifier = NodeUtils.getId(OVS);
- assertEquals("getId(" + OVS + ") should return " + OVS,
- identifier, OVS);
-
- identifier = NodeUtils.getId(BAD_IDENTIFIER);
- assertEquals("getId(" + BAD_IDENTIFIER + ") should return " + BAD_IDENTIFIER,
- identifier, BAD_IDENTIFIER);
- }
-
- @Test
- public void testGetOpenFlowNode () {
- Node node = NodeUtils.getOpenFlowNode(OVS_IDENTIFIER);
- assertNotNull("node should not be null", node);
- assertEquals("id should be " + OVS_IDENTIFIER,
- node.getId().getValue(), OVS_IDENTIFIER);
- }
-}
-
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>utils.mdsal-openflow</artifactId>
<name>${project.artifactId}</name>
<version>1.3.0-SNAPSHOT</version>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<configuration>
<instructions>
<Export-Package>
- org.opendaylight.ovsdb.utils.mdsal.openflow
+ org.opendaylight.netvirt.utils.mdsal.openflow
</Export-Package>
</instructions>
</configuration>
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.utils.mdsal.openflow;
+package org.opendaylight.netvirt.utils.mdsal.openflow;
+import com.google.common.collect.Lists;
import com.google.common.net.InetAddresses;
+
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.dst.action._case.SetNwDstActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.src.action._case.SetNwSrcActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.TunnelBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.src.choice.grouping.src.choice.SrcOfIpSrcCaseBuilder;
import java.math.BigInteger;
+import java.util.List;
public final class ActionUtils {
public static Action dropAction() {
return new NxActionMultipathNodesNodeTableFlowApplyActionsCaseBuilder().setNxMultipath(r).build();
}
+ /**
+ * Builds the conntrack action.
+ * @param flags the flags for the action
+ * @param zoneSrc the zoneSrc
+ * @param conntrackZone the conntrackZone
+ * @param recircTable the recirc table if it is a recirc action
+ * @return the conntrack action.
+ */
public static Action nxConntrackAction(Integer flags, Long zoneSrc,
Integer conntrackZone, Short recircTable) {
NxConntrack r = new NxConntrackBuilder()
return new NxActionConntrackNodesNodeTableFlowApplyActionsCaseBuilder().setNxConntrack(r).build();
}
+ /**
+ * Builds the apply action builder for the action
+ * @param action the conntrack action.
+ * @return the apply action builder.
+ */
+ public static ApplyActionsBuilder conntrackActionBuilder(Action action) {
+ ActionBuilder ab = new ActionBuilder();
+ ab.setAction(action);
+ ab.setOrder(0);
+ ab.setKey(new ActionKey(0));
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actionList =
+ Lists.newArrayList();
+ actionList.add(ab.build());
+ ApplyActionsBuilder aab = new ApplyActionsBuilder();
+ aab.setAction(actionList);
+ return aab;
+ }
/**
* Accepts a MAC address and returns the corresponding long, where the
* MAC bytes are set on the lower order bytes of the long.
/*
- * Copyright (c) 2015 Red Hat, Inc. and others. All rights reserved.
+ * Copyright (c) 2015 - 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.utils.mdsal.openflow;
+package org.opendaylight.netvirt.utils.mdsal.openflow;
import com.google.common.base.Optional;
+
import java.util.concurrent.ExecutionException;
+
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
return data.get();
}
} catch (InterruptedException|ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Failed to get flow {}", flowBuilder.getFlowName(), e);
}
LOG.info("Cannot find data for Flow {} in {}", flowBuilder.getFlowName(), store);
.setPriority(0);
}
+ /**
+ * Creates a flowBuilder.
+ * @param flowName the flow name
+ * @param priority the priority
+ * @param matchBuilder the match builder
+ * @param tableNo the table no to which flow needs to be inserted.
+ * @return the created flow builder.
+ */
+ public static FlowBuilder createFlowBuilder(String flowName,Integer priority,
+ MatchBuilder matchBuilder, short tableNo) {
+ FlowBuilder flowBuilder = new FlowBuilder();
+ flowBuilder.setMatch(matchBuilder.build());
+ initFlowBuilder(flowBuilder, flowName, tableNo).setPriority(priority);
+ return flowBuilder;
+ }
/**
* Sets up common defaults for the given flow builder: a flow identifier and key based on the given flow name,
* strict, no barrier, the given table identifier, no hard timeout and no idle timeout.
/*
- * Copyright (c) 2013, 2015 Red Hat, Inc. and others. All rights reserved.
+ * Copyright (c) 2013 - 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.utils.mdsal.openflow;
+package org.opendaylight.netvirt.utils.mdsal.openflow;
-import static org.opendaylight.ovsdb.utils.mdsal.openflow.ActionUtils.dropAction;
+import static org.opendaylight.netvirt.utils.mdsal.openflow.ActionUtils.dropAction;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
public class InstructionUtils {
private static final Logger LOG = LoggerFactory.getLogger(InstructionUtils.class);
private static final int IPV4 = 0x8100;
/**
* Get a list of Instructions containing Nicira extensions that can have
* additional OF/OXM instructions added to the returned Instruction list
- *
* @param instructions org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instructions
* @return instruction list that additional
*/
}
return ins;
}
+
+ /**
+ * Create InstructionBuilder with apply action.
+ *
+ * @param aab the apply action Builder.
+ * @param order the position of the instruction in the instruction list.
+ * @param drop indicates whether it is a drop instruction.
+ * @return the instruction builder.
+ */
+ public static InstructionBuilder createInstructionBuilder(ApplyActionsBuilder aab, int order, boolean drop) {
+ InstructionBuilder ib = new InstructionBuilder();
+ ib.setOrder(order);
+ ib.setKey(new InstructionKey(order));
+ ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
+ if (drop) {
+ InstructionUtils.createDropInstructions(ib);
+ }
+ return ib;
+ }
}
/*
- * Copyright (c) 2013, 2015 Red Hat, Inc. and others. All rights reserved.
+ * Copyright (c) 2013 - 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.utils.mdsal.openflow;
+package org.opendaylight.netvirt.utils.mdsal.openflow;
import java.math.BigInteger;
import java.util.ArrayList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpSourceHardwareAddressBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg4;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg5;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmOfEthDst;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.ExtensionKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nsp.grouping.NxmNxNspBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNsiKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.nsi.grouping.NxmNxNsiBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.eth.dst.grouping.NxmOfEthDstBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.tcp.src.grouping.NxmOfTcpSrcBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.tcp.dst.grouping.NxmOfTcpDstBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.udp.dst.grouping.NxmOfUdpDstBuilder;
public static final short ALL_ICMP = -1;
public static final long ETHERTYPE_IPV4 = 0x0800;
public static final long ETHERTYPE_IPV6 = 0x86dd;
+ public static final long ETHERTYPE_ARP = 0x0806L;
public static final int UNTRACKED_CT_STATE = 0x00;
public static final int UNTRACKED_CT_STATE_MASK = 0x20;
public static final int TRACKED_EST_CT_STATE = 0x22;
- public static final int TRACKED_EST_CT_STATE_MASK = 0x22;
+ public static final int TRACKED_REL_CT_STATE = 0x24;
public static final int TRACKED_NEW_CT_STATE = 0x21;
+ public static final int TRACKED_INV_CT_STATE = 0x30;
+ public static final int TRACKED_INV_CT_STATE_MASK = 0x30;
+ public static final int TRACKED_CT_STATE_MASK = 0x37;
public static final int TRACKED_NEW_CT_STATE_MASK = 0x21;
- public static final int NEW_CT_STATE = 0x01;
- public static final int NEW_CT_STATE_MASK = 0x01;
/**
* Create Ingress Port Match dpidLong, inPort
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
if (srcMac != null) {
EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
- ethSourceBuilder.setAddress(new MacAddress(srcMac));
+ ethSourceBuilder.setAddress(srcMac);
ethernetMatch.setEthernetSource(ethSourceBuilder.build());
}
if (dstMac != null) {
EthernetDestinationBuilder ethDestinationBuild = new EthernetDestinationBuilder();
- ethDestinationBuild.setAddress(new MacAddress(dstMac));
+ ethDestinationBuild.setAddress(dstMac);
ethernetMatch.setEthernetDestination(ethDestinationBuild.build());
}
if (matchBuilder.getEthernetMatch() != null && matchBuilder.getEthernetMatch().getEthernetType() != null) {
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
- ethSourceBuilder.setAddress(new MacAddress(sMacAddr));
+ ethSourceBuilder.setAddress(sMacAddr);
ethernetMatch.setEthernetSource(ethSourceBuilder.build());
matchBuilder.setEthernetMatch(ethernetMatch.build());
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetDestinationBuilder ethDestinationBuilder = new EthernetDestinationBuilder();
- ethDestinationBuilder.setAddress(new MacAddress(dMacAddr));
+ ethDestinationBuilder.setAddress(dMacAddr);
if (mask != null) {
ethDestinationBuilder.setMask(mask);
}
return matchBuilder;
}
+ /**
+ * Builds the arp match with src and destintion mac address.
+ * @param matchBuilder the match builder
+ * @param srcMac the src mac address , will not be added to match if null.
+ * @param dstMac the destination mac address, will not be added to match if null.
+ * @return the match builder with the matches
+ */
+ public static MatchBuilder addArpMacMatch(MatchBuilder matchBuilder, String srcMac, String dstMac) {
+ ArpMatchBuilder arpMatch = new ArpMatchBuilder();
+ if (null != srcMac) {
+ ArpSourceHardwareAddressBuilder arpSrc = new ArpSourceHardwareAddressBuilder();
+ arpSrc.setAddress(new MacAddress(srcMac));
+ arpMatch.setArpSourceHardwareAddress(arpSrc.build());
+ }
+ if (null != dstMac) {
+ ArpTargetHardwareAddressBuilder arpDst = new ArpTargetHardwareAddressBuilder();
+ arpDst.setAddress(new MacAddress(dstMac));
+ arpMatch.setArpTargetHardwareAddress(arpDst.build());
+ }
+ matchBuilder.setLayer3Match(arpMatch.build());
+ return matchBuilder;
+ }
+
/**
* @param matchBuilder MatchBuilder Object without a match yet
* @param srcip String containing an IPv4 prefix
ethernetMatch.setEthernetType(ethTypeBuilder.build());
EthernetDestinationBuilder ethDestinationBuilder = new EthernetDestinationBuilder();
- ethDestinationBuilder.setAddress(new MacAddress(attachedMac));
+ ethDestinationBuilder.setAddress(attachedMac);
ethernetMatch.setEthernetDestination(ethDestinationBuilder.build());
matchBuilder.setEthernetMatch(ethernetMatch.build());
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetDestinationBuilder ethDestBuilder = new EthernetDestinationBuilder();
- ethDestBuilder.setAddress(new MacAddress(dMacAddr));
+ ethDestBuilder.setAddress(dMacAddr);
if (mask != null) {
ethDestBuilder.setMask(mask);
}
ethernetMatch.setEthernetType(ethTypeBuilder.build());
EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
- ethSourceBuilder.setAddress(new MacAddress(attachedMac));
+ ethSourceBuilder.setAddress(attachedMac);
ethernetMatch.setEthernetSource(ethSourceBuilder.build());
matchBuilder.setEthernetMatch(ethernetMatch.build());
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetSourceBuilder ethSrcBuilder = new EthernetSourceBuilder();
- ethSrcBuilder.setAddress(new MacAddress(dMacAddr));
+ ethSrcBuilder.setAddress(dMacAddr);
if (mask != null) {
ethSrcBuilder.setMask(mask);
}
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetDestinationBuilder ethDestinationBuilder = new EthernetDestinationBuilder();
- ethDestinationBuilder.setAddress(new MacAddress(dMacAddr));
+ ethDestinationBuilder.setAddress(dMacAddr);
if (mask != null) {
ethDestinationBuilder.setMask(mask);
}
public static MatchBuilder createSrcL3Ipv4MatchWithMac(MatchBuilder matchBuilder, Ipv4Prefix srcip, MacAddress srcMac) {
Ipv4MatchBuilder ipv4MatchBuilder = new Ipv4MatchBuilder();
- ipv4MatchBuilder.setIpv4Source(new Ipv4Prefix(srcip));
+ ipv4MatchBuilder.setIpv4Source(srcip);
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
EthernetMatchBuilder eth = new EthernetMatchBuilder();
public static MatchBuilder createSrcL3Ipv6MatchWithMac(MatchBuilder matchBuilder, Ipv6Prefix srcip, MacAddress srcMac) {
Ipv6MatchBuilder ipv6MatchBuilder = new Ipv6MatchBuilder();
- ipv6MatchBuilder.setIpv6Source(new Ipv6Prefix(srcip));
+ ipv6MatchBuilder.setIpv6Source(srcip);
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x86DDL));
EthernetMatchBuilder eth = new EthernetMatchBuilder();
* @param dstMac The destination mac address
* @return matchBuilder Map Object with a match
*/
- public static MatchBuilder createV4EtherMatchWithType(MatchBuilder matchBuilder,String srcMac, String dstMac)
+ public static MatchBuilder createV4EtherMatchWithType(MatchBuilder matchBuilder,String srcMac, String dstMac, Long type)
{
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
- ethTypeBuilder.setType(new EtherType(0x0800L));
+ ethTypeBuilder.setType(new EtherType(type));
EthernetMatchBuilder eth = new EthernetMatchBuilder();
eth.setEthernetType(ethTypeBuilder.build());
if (null != srcMac) {
*
* Authors : Sam Hague
*/
-package org.opendaylight.ovsdb.utils.mdsal.openflow;
+package org.opendaylight.netvirt.utils.mdsal.openflow;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>utils.mdsal-utils</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<dependencies>
- <!-- testing dependencies -->
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<configuration>
<instructions>
<Export-Package>
- org.opendaylight.ovsdb.utils.mdsal.utils
+ org.opendaylight.netvirt.utils.mdsal.utils
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.utils.mdsal.utils;
+package org.opendaylight.netvirt.utils.mdsal.utils;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
--- /dev/null
+/*
+ * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netvirt.utils.mdsal.utils;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * This class provides methods for checking or waiting for various md-sal operations to complete.
+ * Once an instance is created one must invoke the registerDataChangeListener method
+ * with a DataBroker.
+ */
+public class NotifyingDataChangeListener implements AutoCloseable, DataChangeListener {
+ private static final Logger LOG = LoggerFactory.getLogger(NotifyingDataChangeListener.class);
+ private LogicalDatastoreType type;
+ private final Set<InstanceIdentifier<?>> createdIids = new HashSet<>();
+ private final Set<InstanceIdentifier<?>> removedIids = new HashSet<>();
+ private final Set<InstanceIdentifier<?>> updatedIids = new HashSet<>();
+ private InstanceIdentifier<?> iid;
+ private final int RETRY_WAIT = 100;
+ private final int MDSAL_TIMEOUT = 1000;
+ private ListenerRegistration<?> listenerRegistration;
+ private List<NotifyingDataChangeListener> waitList = null;
+
+ /**
+ * Create a new NotifyingDataChangeListener
+ * @param type
+ * @param iid of the md-sal object we're waiting for
+ * @param waitList for tracking outstanding changes
+ */
+ public NotifyingDataChangeListener(LogicalDatastoreType type,
+ InstanceIdentifier<?> iid, List<NotifyingDataChangeListener> waitList) {
+ this.type = type;
+ this.iid = iid;
+ this.waitList = waitList;
+ if(this.waitList != null) {
+ this.waitList.add(this);
+ }
+ }
+
+ /**
+ * Completely reset the state of this NotifyingDataChangeListener.
+ * @param type
+ * @param iid of the md-sal object we're waiting for
+ * @throws Exception
+ */
+ private void modify(LogicalDatastoreType type, InstanceIdentifier<?> iid) throws Exception {
+ this.close();
+ this.clear();
+ this.type = type;
+ this.iid = iid;
+ }
+
+ @Override
+ public void onDataChanged(
+ AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> asyncDataChangeEvent) {
+ LOG.info("{} DataChanged: created {}", type, asyncDataChangeEvent.getCreatedData().keySet());
+ LOG.info("{} DataChanged: updated {}", type, asyncDataChangeEvent.getUpdatedData().keySet());
+ LOG.info("{} DataChanged: removed {}", type, asyncDataChangeEvent.getRemovedPaths());
+ createdIids.addAll(asyncDataChangeEvent.getCreatedData().keySet());
+ removedIids.addAll(asyncDataChangeEvent.getRemovedPaths());
+ updatedIids.addAll(asyncDataChangeEvent.getUpdatedData().keySet());
+ synchronized (this) {
+ notifyAll();
+ }
+ }
+
+ public boolean isCreated(InstanceIdentifier<?> iid) {
+ return createdIids.remove(iid);
+ }
+
+ public boolean isUpdated(InstanceIdentifier<?> iid) {
+ return updatedIids.remove(iid);
+ }
+
+ public boolean isRemoved(InstanceIdentifier<?> iid) {
+ return removedIids.remove(iid);
+ }
+
+ public void clear() {
+ createdIids.clear();
+ removedIids.clear();
+ updatedIids.clear();
+ }
+
+ public void registerDataChangeListener(DataBroker dataBroker) {
+ listenerRegistration = dataBroker.registerDataChangeListener(type, iid, this,
+ AsyncDataBroker.DataChangeScope.SUBTREE);
+ }
+
+ public void waitForCreation() throws InterruptedException {
+ waitForCreation(MDSAL_TIMEOUT);
+ }
+
+ public void waitForCreation(long timeout) throws InterruptedException {
+ synchronized (this) {
+ long _start = System.currentTimeMillis();
+ LOG.info("Waiting for {} DataChanged creation on {}", type, iid);
+ while (!isCreated(iid) && (System.currentTimeMillis() - _start) < timeout) {
+ wait(RETRY_WAIT);
+ }
+ LOG.info("Woke up, waited {}ms for creation of {}", (System.currentTimeMillis() - _start), iid);
+ }
+ }
+
+ public void waitForUpdate() throws InterruptedException {
+ waitForUpdate(MDSAL_TIMEOUT);
+ }
+
+ public void waitForUpdate(long timeout) throws InterruptedException {
+ synchronized (this) {
+ long _start = System.currentTimeMillis();
+ LOG.info("Waiting for {} DataChanged update on {}", type, iid);
+ while (!isUpdated(iid) && (System.currentTimeMillis() - _start) < timeout) {
+ wait(RETRY_WAIT);
+ }
+ LOG.info("Woke up, waited {}ms for update of {}", (System.currentTimeMillis() - _start), iid);
+ }
+ }
+
+ public void waitForDeletion() throws InterruptedException {
+ waitForDeletion(MDSAL_TIMEOUT);
+ }
+
+ public void waitForDeletion(long timeout) throws InterruptedException {
+ synchronized (this) {
+ long _start = System.currentTimeMillis();
+ LOG.info("Waiting for {} DataChanged deletion on {}", type, iid);
+ while (!isRemoved(iid) && (System.currentTimeMillis() - _start) < timeout) {
+ wait(RETRY_WAIT);
+ }
+ LOG.info("Woke up, waited {}ms for deletion of {}", (System.currentTimeMillis() - _start), iid);
+ }
+ }
+
+ @Override
+ public void close() throws Exception {
+ if (listenerRegistration != null) {
+ try {
+ listenerRegistration.close();
+ } catch (final Exception ex) {
+ LOG.warn("Failed to close registration {}, iid {}", listenerRegistration, iid, ex);
+ }
+ }
+ if (waitList != null) {
+ waitList.remove(this);
+ }
+ listenerRegistration = null;
+ }
+}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.utils.mdsal.utils;
+package org.opendaylight.netvirt.utils.mdsal.utils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
<?xml version="1.0" encoding="UTF-8"?>
<!--
- ~ Copyright © 2015 Red Hat, Inc. and others. All rights reserved.
- ~
- ~ This program and the accompanying materials are made available under the
- ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
- ~ and is available at http://www.eclipse.org/legal/epl-v10.html
- -->
+Copyright (C) 2015 Red Hat, Inc. and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>utils.neutron-utils</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
+ <properties>
+ <neutron.version>0.7.0-SNAPSHOT</neutron.version>
+ </properties>
+
<dependencies>
<!-- project specific dependencies -->
<dependency>
<artifactId>utils.mdsal-utils</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.servicehelper</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!-- neutron dependencies -->
<dependency>
<groupId>org.opendaylight.neutron</groupId>
<artifactId>model</artifactId>
<version>0.7.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.neutron</groupId>
+ <artifactId>neutron-spi</artifactId>
+ <version>${neutron.version}</version>
+ </dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.utils.neutron.utils;
+package org.opendaylight.netvirt.utils.neutron.utils;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
+import org.opendaylight.netvirt.utils.mdsal.utils.MdsalUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.Routers;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.Networks;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.NetworkKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.Ports;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.PortKey;
return mdsalPort;
}
- private InstanceIdentifier<Routers> getNeutrounRoutersPath() {
+ public InstanceIdentifier<Routers> getNeutrounRoutersPath() {
return InstanceIdentifier
.create(Neutron.class)
.child(Routers.class);
}
- private InstanceIdentifier<Ports> getNeutrounPortsPath() {
+ public InstanceIdentifier<Ports> getNeutrounPortsPath() {
return InstanceIdentifier
.create(Neutron.class)
.child(Ports.class);
}
- private InstanceIdentifier<Port> getNeutronPortPath(Uuid portId) {
+ public InstanceIdentifier<Port> getNeutronPortPath(Uuid portId) {
return InstanceIdentifier
.create(Neutron.class)
.child(Ports.class)
.child(Port.class,new PortKey(portId));
}
+
+ public InstanceIdentifier<Network> getNeutronNetworkPath(Uuid networkId) {
+ return InstanceIdentifier
+ .create(Neutron.class)
+ .child(Networks.class)
+ .child(Network.class,new NetworkKey(networkId));
+ }
}
--- /dev/null
+/*
+ * Copyright © 2016 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.netvirt.utils.neutron.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.opendaylight.neutron.spi.INeutronNetworkCRUD;
+import org.opendaylight.neutron.spi.INeutronPortCRUD;
+import org.opendaylight.neutron.spi.INeutronSubnetCRUD;
+import org.opendaylight.neutron.spi.NeutronNetwork;
+import org.opendaylight.neutron.spi.NeutronPort;
+import org.opendaylight.neutron.spi.NeutronSecurityGroup;
+import org.opendaylight.neutron.spi.NeutronSubnet;
+import org.opendaylight.netvirt.utils.servicehelper.ServiceHelper;
+
+public class NeutronUtils {
+ public NeutronPort createNeutronPort(String networkId, String subnetId,
+ String id, String owner, String ipaddr, String mac) {
+ INeutronPortCRUD iNeutronPortCRUD =
+ (INeutronPortCRUD) ServiceHelper.getGlobalInstance(INeutronPortCRUD.class, this);
+ NeutronPort np = new NeutronPort();
+ np.initDefaults();
+ np.setID(id);
+ np.setDeviceOwner(owner);
+ np.setMacAddress(mac);
+ np.setNetworkUUID(networkId);
+ List<org.opendaylight.neutron.spi.Neutron_IPs> srcAddressList =
+ new ArrayList<>();
+ org.opendaylight.neutron.spi.Neutron_IPs nip = new org.opendaylight.neutron.spi.Neutron_IPs();
+ nip.setIpAddress(ipaddr);
+ nip.setSubnetUUID(subnetId);
+ srcAddressList.add(nip);
+ np.setFixedIPs(srcAddressList);
+ List<NeutronSecurityGroup> nsgs = new ArrayList<>();
+ np.setSecurityGroups(nsgs);
+ iNeutronPortCRUD.add(np);
+ return np;
+ }
+
+ public NeutronSubnet createNeutronSubnet(String subnetId, String tenantId,
+ String networkId, String cidr) {
+ INeutronSubnetCRUD iNeutronSubnetCRUD =
+ (INeutronSubnetCRUD) ServiceHelper.getGlobalInstance(INeutronSubnetCRUD.class, this);
+ NeutronSubnet ns = new NeutronSubnet();
+ ns.setID(subnetId);
+ ns.setCidr(cidr);
+ ns.initDefaults();
+ ns.setNetworkUUID(networkId);
+ ns.setTenantID(tenantId);
+ iNeutronSubnetCRUD.add(ns);
+ return ns;
+ }
+
+ public NeutronNetwork createNeutronNetwork(String uuid, String tenantID, String networkTypeVxlan, String segId) {
+ INeutronNetworkCRUD iNeutronNetworkCRUD =
+ (INeutronNetworkCRUD) ServiceHelper.getGlobalInstance(INeutronNetworkCRUD.class, this);
+ NeutronNetwork nn = new NeutronNetwork();
+ nn.setID(uuid);
+ nn.initDefaults();
+ nn.setTenantID(tenantID);
+ nn.setProviderNetworkType(networkTypeVxlan);
+ nn.setProviderSegmentationID(segId);
+ iNeutronNetworkCRUD.addNetwork(nn);
+ return nn;
+ }
+}
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>utils</artifactId>
<version>1.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
</prerequisites>
<modules>
<module>config</module>
- <module>mdsal-node</module>
+ <module>it-utils</module>
<module>mdsal-openflow</module>
<module>mdsal-utils</module>
<module>neutron-utils</module>
<module>servicehelper</module>
- <module>southbound-utils</module>
- <module>hwvtepsouthbound-utils</module>
</modules>
<!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
<relativePath/>
</parent>
- <groupId>org.opendaylight.ovsdb</groupId>
+ <groupId>org.opendaylight.netvirt</groupId>
<artifactId>utils.servicehelper</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
</developer>
</developers>
<scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/netvirt.git</developerConnection>
<tag>HEAD</tag>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
- <properties>
- <powermock.version>1.6.4</powermock.version>
- </properties>
-
<dependencies>
<dependency>
<groupId>junit</groupId>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<scope>test</scope>
- <version>${powermock.version}</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
<scope>test</scope>
- <version>${powermock.version}</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
- <version>${powermock.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.osgi</groupId>
<configuration>
<instructions>
<Export-Package>
- org.opendaylight.ovsdb.utils.servicehelper
+ org.opendaylight.netvirt.utils.servicehelper
</Export-Package>
</instructions>
</configuration>
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.ovsdb.utils.servicehelper;
+package org.opendaylight.netvirt.utils.servicehelper;
import java.util.HashMap;
import java.util.Map;
*
* Authors : Sam Hague
*/
-package org.opendaylight.ovsdb.utils.servicehelper;
+package org.opendaylight.netvirt.utils.servicehelper;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-parent</artifactId>
- <version>0.5.0-SNAPSHOT</version>
- <relativePath/>
- </parent>
-
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>utils.southbound-utils</artifactId>
- <version>1.3.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
-
- <dependencies>
- <!-- project specific dependencies -->
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>southbound-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>southbound-impl</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>utils.mdsal-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <!-- testing dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2015 Red Hat, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.ovsdb.utils.southbound.utils;
-
-import com.google.common.collect.ImmutableBiMap;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-
-import java.util.List;
-import java.util.Map;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.southbound.SouthboundConstants;
-import org.opendaylight.ovsdb.southbound.SouthboundMapper;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.*;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.BridgeExternalIds;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.BridgeOtherConfigs;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntryBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIds;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIdsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIdsKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.Options;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.OptionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.OptionsKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SouthboundUtils {
- private static final Logger LOG = LoggerFactory.getLogger(SouthboundUtils.class);
- private static final int OVSDB_UPDATE_TIMEOUT = 1000;
- public static final TopologyId OVSDB_TOPOLOGY_ID = new TopologyId(new Uri("ovsdb:1"));
- private final MdsalUtils mdsalUtils;
-
- public SouthboundUtils(MdsalUtils mdsalUtils) {
- this.mdsalUtils = mdsalUtils;
- }
-
- public static final ImmutableBiMap<String, Class<? extends InterfaceTypeBase>> OVSDB_INTERFACE_TYPE_MAP
- = new ImmutableBiMap.Builder<String, Class<? extends InterfaceTypeBase>>()
- .put("internal", InterfaceTypeInternal.class)
- .put("vxlan", InterfaceTypeVxlan.class)
- .put("patch", InterfaceTypePatch.class)
- .put("system", InterfaceTypeSystem.class)
- .put("tap", InterfaceTypeTap.class)
- .put("geneve", InterfaceTypeGeneve.class)
- .put("gre", InterfaceTypeGre.class)
- .put("ipsec_gre", InterfaceTypeIpsecGre.class)
- .put("gre64", InterfaceTypeGre64.class)
- .put("ipsec_gre64", InterfaceTypeIpsecGre64.class)
- .put("lisp", InterfaceTypeLisp.class)
- .put("dpdk", InterfaceTypeDpdk.class)
- .put("dpdkr", InterfaceTypeDpdkr.class)
- .put("dpdkvhost", InterfaceTypeDpdkvhost.class)
- .put("dpdkvhostuser", InterfaceTypeDpdkvhostuser.class)
- .build();
-
- public static NodeId createNodeId(IpAddress ip, PortNumber port) {
- String uriString = SouthboundConstants.OVSDB_URI_PREFIX + "://"
- + String.valueOf(ip.getValue()) + ":" + port.getValue();
- Uri uri = new Uri(uriString);
- return new NodeId(uri);
- }
-
- public static Node createNode(ConnectionInfo key) {
- NodeBuilder nodeBuilder = new NodeBuilder();
- nodeBuilder.setNodeId(createNodeId(key.getRemoteIp(), key.getRemotePort()));
- nodeBuilder.addAugmentation(OvsdbNodeAugmentation.class, createOvsdbAugmentation(key));
- return nodeBuilder.build();
- }
-
- public static OvsdbNodeAugmentation createOvsdbAugmentation(ConnectionInfo key) {
- OvsdbNodeAugmentationBuilder ovsdbNodeBuilder = new OvsdbNodeAugmentationBuilder();
- ovsdbNodeBuilder.setConnectionInfo(key);
- return ovsdbNodeBuilder.build();
- }
-
- public static InstanceIdentifier<Node> createInstanceIdentifier(ConnectionInfo key) {
- return createInstanceIdentifier(key.getRemoteIp(), key.getRemotePort());
- }
-
- public static InstanceIdentifier<Node> createInstanceIdentifier(IpAddress ip, PortNumber port) {
- InstanceIdentifier<Node> path = InstanceIdentifier
- .create(NetworkTopology.class)
- .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID))
- .child(Node.class,createNodeKey(ip,port));
- LOG.debug("Created ovsdb path: {}",path);
- return path;
- }
-
- public static InstanceIdentifier<Node> createInstanceIdentifier(ConnectionInfo key,OvsdbBridgeName bridgeName) {
- return SouthboundMapper.createInstanceIdentifier(createManagedNodeId(key, bridgeName));
- }
-
- public static InstanceIdentifier<Node> createInstanceIdentifier(ConnectionInfo key, String bridgeName) {
- return createInstanceIdentifier(key, new OvsdbBridgeName(bridgeName));
- }
-
- public InstanceIdentifier<TerminationPoint> createTerminationPointInstanceIdentifier(Node node, String portName){
-
- InstanceIdentifier<TerminationPoint> terminationPointPath = InstanceIdentifier
- .create(NetworkTopology.class)
- .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID))
- .child(Node.class,node.getKey())
- .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName)));
-
- LOG.debug("Termination point InstanceIdentifier generated : {}",terminationPointPath);
- return terminationPointPath;
- }
-
- public static NodeKey createNodeKey(IpAddress ip, PortNumber port) {
- return new NodeKey(createNodeId(ip, port));
- }
-
- public static NodeId createManagedNodeId(ConnectionInfo key, OvsdbBridgeName bridgeName) {
- return createManagedNodeId(key.getRemoteIp(), key.getRemotePort(), bridgeName);
- }
-
- public static NodeId createManagedNodeId(IpAddress ip, PortNumber port, OvsdbBridgeName bridgeName) {
- return new NodeId(createNodeId(ip,port).getValue()
- + "/" + SouthboundConstants.BRIDGE_URI_PREFIX + "/" + bridgeName.getValue());
- }
-
- public static NodeId createManagedNodeId(InstanceIdentifier<Node> iid) {
- NodeKey nodeKey = iid.firstKeyOf(Node.class);
- return nodeKey.getNodeId();
- }
-
- public static ConnectionInfo getConnectionInfo(final String addressStr, final String portStr) {
- InetAddress inetAddress = null;
- try {
- inetAddress = InetAddress.getByName(addressStr);
- } catch (UnknownHostException e) {
- LOG.warn("Could not allocate InetAddress");
- }
-
- IpAddress address = SouthboundMapper.createIpAddress(inetAddress);
- PortNumber port = new PortNumber(Integer.parseInt(portStr));
-
- LOG.info("connectionInfo: {}", new ConnectionInfoBuilder()
- .setRemoteIp(address)
- .setRemotePort(port)
- .build());
- return new ConnectionInfoBuilder()
- .setRemoteIp(address)
- .setRemotePort(port)
- .build();
- }
-
- public static String connectionInfoToString(final ConnectionInfo connectionInfo) {
- return String.valueOf(
- connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
- }
-
- public boolean addOvsdbNode(final ConnectionInfo connectionInfo) {
- return addOvsdbNode(connectionInfo, OVSDB_UPDATE_TIMEOUT);
- }
-
- public boolean addOvsdbNode(final ConnectionInfo connectionInfo, long timeout) {
- boolean result = mdsalUtils.put(LogicalDatastoreType.CONFIGURATION,
- createInstanceIdentifier(connectionInfo),
- createNode(connectionInfo));
- if (timeout != 0) {
- try {
- Thread.sleep(timeout);
- } catch (InterruptedException e) {
- LOG.warn("Interrupted while waiting after adding OVSDB node {}",
- connectionInfoToString(connectionInfo), e);
- }
- }
- return result;
- }
-
- public Node getOvsdbNode(final ConnectionInfo connectionInfo) {
- return mdsalUtils.read(LogicalDatastoreType.OPERATIONAL,
- createInstanceIdentifier(connectionInfo));
- }
-
- public boolean deleteOvsdbNode(final ConnectionInfo connectionInfo) {
- return deleteOvsdbNode(connectionInfo, OVSDB_UPDATE_TIMEOUT);
- }
-
- public boolean deleteOvsdbNode(final ConnectionInfo connectionInfo, long timeout) {
- boolean result = mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION,
- createInstanceIdentifier(connectionInfo));
- if (timeout != 0) {
- try {
- Thread.sleep(timeout);
- } catch (InterruptedException e) {
- LOG.warn("Interrupted while waiting after deleting OVSDB node {}",
- connectionInfoToString(connectionInfo), e);
- }
- }
- return result;
- }
-
- public Node connectOvsdbNode(final ConnectionInfo connectionInfo) {
- return connectOvsdbNode(connectionInfo, OVSDB_UPDATE_TIMEOUT);
- }
-
- public Node connectOvsdbNode(final ConnectionInfo connectionInfo, long timeout) {
- addOvsdbNode(connectionInfo, timeout);
- Node node = getOvsdbNode(connectionInfo);
- LOG.info("Connected to {}", connectionInfoToString(connectionInfo));
- return node;
- }
-
- public boolean disconnectOvsdbNode(final ConnectionInfo connectionInfo) {
- return disconnectOvsdbNode(connectionInfo, OVSDB_UPDATE_TIMEOUT);
- }
-
- public boolean disconnectOvsdbNode(final ConnectionInfo connectionInfo, long timeout) {
- deleteOvsdbNode(connectionInfo, timeout);
- LOG.info("Disconnected from {}", connectionInfoToString(connectionInfo));
- return true;
- }
-
- public List<ControllerEntry> createControllerEntry(String controllerTarget) {
- List<ControllerEntry> controllerEntriesList = new ArrayList<>();
- controllerEntriesList.add(new ControllerEntryBuilder()
- .setTarget(new Uri(controllerTarget))
- .build());
- return controllerEntriesList;
- }
-
- /**
- * Extract the <code>store</code> type data store contents for the particular bridge identified by
- * <code>bridgeName</code>.
- *
- * @param connectionInfo address for the node
- * @param bridgeName name of the bridge
- * @param store defined by the <code>LogicalDatastoreType</code> enumeration
- * @return <code>store</code> type data store contents
- */
- public OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo, String bridgeName,
- LogicalDatastoreType store) {
- OvsdbBridgeAugmentation ovsdbBridgeAugmentation = null;
- Node bridgeNode = getBridgeNode(connectionInfo, bridgeName, store);
- if (bridgeNode != null) {
- ovsdbBridgeAugmentation = bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
- }
- return ovsdbBridgeAugmentation;
- }
-
- /**
- * extract the <code>LogicalDataStoreType.OPERATIONAL</code> type data store contents for the particular bridge
- * identified by <code>bridgeName</code>
- *
- * @param connectionInfo address for the node
- * @param bridgeName name of the bridge
- * @see <code>NetvirtIT.getBridge(ConnectionInfo, String, LogicalDatastoreType)</code>
- * @return <code>LogicalDatastoreType.OPERATIONAL</code> type data store contents
- */
- public OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo, String bridgeName) {
- return getBridge(connectionInfo, bridgeName, LogicalDatastoreType.OPERATIONAL);
- }
-
- /**
- * Extract the node contents from <code>store</code> type data store for the
- * bridge identified by <code>bridgeName</code>.
- *
- * @param connectionInfo address for the node
- * @param bridgeName name of the bridge
- * @param store defined by the <code>LogicalDatastoreType</code> enumeration
- * @return <code>store</code> type data store contents
- */
- public Node getBridgeNode(ConnectionInfo connectionInfo, String bridgeName, LogicalDatastoreType store) {
- InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName));
- return mdsalUtils.read(store, bridgeIid);
- }
-
- public boolean deleteBridge(final ConnectionInfo connectionInfo, final String bridgeName) {
- return deleteBridge(connectionInfo, bridgeName, OVSDB_UPDATE_TIMEOUT);
- }
-
- public boolean deleteBridge(final ConnectionInfo connectionInfo, final String bridgeName, long timeout) {
- boolean result = mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION,
- createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName)));
- if (timeout != 0) {
- try {
- Thread.sleep(timeout);
- } catch (InterruptedException e) {
- LOG.warn("Interrupted while waiting after deleting bridge {}", bridgeName, e);
- }
- }
- return result;
- }
-
- public List<ProtocolEntry> createMdsalProtocols() {
- List<ProtocolEntry> protocolList = new ArrayList<>();
- ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
- SouthboundConstants.OVSDB_PROTOCOL_MAP.inverse();
- protocolList.add(new ProtocolEntryBuilder().setProtocol(mapper.get("OpenFlow13")).build());
- return protocolList;
- }
-
- public boolean addBridge(final ConnectionInfo connectionInfo, InstanceIdentifier<Node> bridgeIid,
- final String bridgeName, NodeId bridgeNodeId, final boolean setProtocolEntries,
- final Class<? extends OvsdbFailModeBase> failMode, final boolean setManagedBy,
- final Class<? extends DatapathTypeBase> dpType,
- final List<BridgeExternalIds> externalIds,
- final List<ControllerEntry> controllerEntries,
- final List<BridgeOtherConfigs> otherConfigs,
- final String dpid) throws InterruptedException {
- return addBridge(connectionInfo, bridgeIid, bridgeName, bridgeNodeId, setProtocolEntries, failMode,
- setManagedBy, dpType, externalIds, controllerEntries, otherConfigs, dpid);
- }
-
- /*
- * base method for adding test bridges. Other helper methods used to create bridges should utilize this method.
- *
- * @param connectionInfo
- * @param bridgeIid if passed null, one is created
- * @param bridgeName cannot be null
- * @param bridgeNodeId if passed null, one is created based on <code>bridgeIid</code>
- * @param setProtocolEntries toggles whether default protocol entries are set for the bridge
- * @param failMode toggles whether default fail mode is set for the bridge
- * @param setManagedBy toggles whether to setManagedBy for the bridge
- * @param dpType if passed null, this parameter is ignored
- * @param externalIds if passed null, this parameter is ignored
- * @param otherConfig if passed null, this parameter is ignored
- * @return success of bridge addition
- * @throws InterruptedException
- */
- public boolean addBridge(final ConnectionInfo connectionInfo, InstanceIdentifier<Node> bridgeIid,
- final String bridgeName, NodeId bridgeNodeId, final boolean setProtocolEntries,
- final Class<? extends OvsdbFailModeBase> failMode, final boolean setManagedBy,
- final Class<? extends DatapathTypeBase> dpType,
- final List<BridgeExternalIds> externalIds,
- final List<ControllerEntry> controllerEntries,
- final List<BridgeOtherConfigs> otherConfigs,
- final String dpid, long timeout) throws InterruptedException {
-
- NodeBuilder bridgeNodeBuilder = new NodeBuilder();
- if (bridgeIid == null) {
- bridgeIid = createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName));
- }
- if (bridgeNodeId == null) {
- bridgeNodeId = SouthboundMapper.createManagedNodeId(bridgeIid);
- }
- bridgeNodeBuilder.setNodeId(bridgeNodeId);
- OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
- ovsdbBridgeAugmentationBuilder.setBridgeName(new OvsdbBridgeName(bridgeName));
- if (setProtocolEntries) {
- ovsdbBridgeAugmentationBuilder.setProtocolEntry(createMdsalProtocols());
- }
- if (failMode != null) {
- ovsdbBridgeAugmentationBuilder.setFailMode(failMode);
- }
- if (setManagedBy) {
- setManagedBy(ovsdbBridgeAugmentationBuilder, connectionInfo);
- }
- if (dpType != null) {
- ovsdbBridgeAugmentationBuilder.setDatapathType(dpType);
- }
- if (externalIds != null) {
- ovsdbBridgeAugmentationBuilder.setBridgeExternalIds(externalIds);
- }
- if (controllerEntries != null) {
- ovsdbBridgeAugmentationBuilder.setControllerEntry(controllerEntries);
- }
- if (otherConfigs != null) {
- ovsdbBridgeAugmentationBuilder.setBridgeOtherConfigs(otherConfigs);
- }
- if (dpid != null && !dpid.isEmpty()) {
- DatapathId datapathId = new DatapathId(dpid);
- ovsdbBridgeAugmentationBuilder.setDatapathId(datapathId);
- }
- bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
- LOG.debug("Built with the intent to store bridge data {}",
- ovsdbBridgeAugmentationBuilder.toString());
- boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
- bridgeIid, bridgeNodeBuilder.build());
- if (timeout != 0) {
- Thread.sleep(OVSDB_UPDATE_TIMEOUT);
- }
- return result;
- }
-
- private void setManagedBy(final OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder,
- final ConnectionInfo connectionInfo) {
- InstanceIdentifier<Node> connectionNodePath = createInstanceIdentifier(connectionInfo);
- ovsdbBridgeAugmentationBuilder.setManagedBy(new OvsdbNodeRef(connectionNodePath));
- }
-
- public boolean addTerminationPoint(
- Node bridgeNode, String portName, String type, Map<String, String> options,
- Map<String, String> externalIds) {
- return addTerminationPoint(bridgeNode, portName, type, options, externalIds, null);
- }
-
- public boolean addTerminationPoint(
- Node bridgeNode, String portName, String type, Map<String, String> options, Map<String, String> externalIds,
- Long ofPort) {
- InstanceIdentifier<TerminationPoint> tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName);
- OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder();
-
- tpAugmentationBuilder.setName(portName);
- tpAugmentationBuilder.setOfport(ofPort);
- if (type != null) {
- tpAugmentationBuilder.setInterfaceType(OVSDB_INTERFACE_TYPE_MAP.get(type));
- }
-
- if (options != null && options.size() > 0) {
- List<Options> optionsList = new ArrayList<>();
- for (Map.Entry<String, String> entry : options.entrySet()) {
- OptionsBuilder optionsBuilder = new OptionsBuilder();
- optionsBuilder.setKey(new OptionsKey(entry.getKey()));
- optionsBuilder.setOption(entry.getKey());
- optionsBuilder.setValue(entry.getValue());
- optionsList.add(optionsBuilder.build());
- }
- tpAugmentationBuilder.setOptions(optionsList);
- }
-
- if (externalIds != null && externalIds.size() > 0) {
- List<InterfaceExternalIds> externalIdsList = new ArrayList<>();
- for (Map.Entry<String, String> entry : externalIds.entrySet()) {
- InterfaceExternalIdsBuilder interfaceExternalIdsBuilder = new InterfaceExternalIdsBuilder();
- interfaceExternalIdsBuilder.setKey(new InterfaceExternalIdsKey(entry.getKey()));
- interfaceExternalIdsBuilder.setExternalIdKey(entry.getKey());
- interfaceExternalIdsBuilder.setExternalIdValue(entry.getValue());
- externalIdsList.add(interfaceExternalIdsBuilder.build());
- }
- tpAugmentationBuilder.setInterfaceExternalIds(externalIdsList);
- }
-
- TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
- tpBuilder.setKey(InstanceIdentifier.keyOf(tpIid));
- tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
- /* TODO SB_MIGRATION should this be merge or mdsalUtils.put */
- return mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
- }
-
- public Boolean addTerminationPoint(Node bridgeNode, String portName, String type) {
- return addTerminationPoint(bridgeNode, portName, type, null, null);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 Red Hat, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class SouthboundUtilsTest {
- @Test
- public void testDefault() {
- assertTrue(true);
- }
-}