/*
- * Copyright (C) 2014 Red Hat, Inc.
+ * Copyright (c) 2014, 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 : Dave Tucker
*/
package org.opendaylight.ovsdb.openstack.netvirt.api;
-import org.opendaylight.neutron.spi.NeutronNetwork;
-import org.opendaylight.controller.sal.core.Node;
-import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
+import org.opendaylight.ovsdb.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;
* OpenStack Neutron with the Open vSwitch plugin relies on a typical bridge configuration that
* consists of br-int (Integration Bridge), br-net (Network bridge), br-ex (External bridge).
*
- * This class ensures that the bridges on each {@link org.opendaylight.controller.sal.core.Node}
+ * This class ensures that the bridges on each {@link Node}
* are correctly configured for OpenStack Neutron
*
*/
/**
* A helper function to get the UUID of a given Bridge
- * @param node the {@link org.opendaylight.controller.sal.core.Node} where the bridge is configured
+ * @param node the {@link Node} where the bridge is configured
* @param bridgeName the name of the bridge
* @return the UUID of the bridge
*/
- public String getBridgeUuid(Node node, String bridgeName);
+ String getBridgeUuid(Node node, String bridgeName);
/**
* Checks for the existence of the Integration Bridge on a given Node
- * @param node the {@link org.opendaylight.controller.sal.core.Node} where the bridge should be configured
+ * @param node the {@link Node} where the bridge should be configured
* @return True if the bridge exists, False if it does not
*/
- public boolean isNodeNeutronReady(Node node);
+ boolean isNodeNeutronReady(Node node);
/**
* Checks for the existence of the Network Bridge on a given Node
- * @param node the {@link org.opendaylight.controller.sal.core.Node} where the bridge should be configured
+ * @param node the {@link Node} where the bridge should be configured
* @return True if the bridge exists, False if it does not
*/
- public boolean isNodeOverlayReady(Node node);
+ boolean isNodeOverlayReady(Node node);
/**
* Checks for the existence of the Network Bridge on a given Node
- * @param node the {@link org.opendaylight.controller.sal.core.Node} where the bridge should be configured
+ * @param node the {@link Node} where the bridge should be configured
* @return True if the bridge exists, False if it does not
*/
* Checks that a Node is ready for a Tunnel Network Provider
* For OpenFlow 1.0 the Integration, Network Bridge and corresponding patch ports are required
* For OpenFlow 1.3 only the Integration Bridge is required
- * @param node the {@link org.opendaylight.controller.sal.core.Node} where the bridge is configured
+ * @param bridgeNode the {@link Node} that represents bridge
+ * @param ovsdbNode the {@link Node} where the bridge is configured
* @return True or False
*/
- public boolean isNodeTunnelReady(Node node);
+ boolean isNodeTunnelReady(Node bridgeNode, Node ovsdbNode);
/* Determine if internal network is ready for vlan network types.
* - OF 1.0 requires br-int, br-net, a patch connecting them and
* For OpenFlow 1.0 the Integration Bridge, Network Bridge, patch ports and a physical device connected to the
* Network Bridge are required.
* For OpenFlow 1.3 the Integration Bridge is required and must have a physical device connected.
- * @param node the {@link org.opendaylight.controller.sal.core.Node} where the bridge is configured
- * @param network the {@link org.opendaylight.neutron.spi.NeutronNetwork}
+ * @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}
* @return True or False
*/
- public boolean isNodeVlanReady(Node node, NeutronNetwork network);
+ boolean isNodeVlanReady(Node bridgeNode, Node ovsdbNode, NeutronNetwork network);
/**
* A helper function to determine if a port exists on a given bridge
- * @param node the {@link org.opendaylight.controller.sal.core.Node} where the bridge is configured
- * @param bridge the {@link org.opendaylight.ovsdb.schema.openvswitch.Bridge} to query
+ * @param node the {@link Node} where the bridge is configured
* @param portName the name of the port to search for
* @return True if the port exists, otherwise False
*/
- public boolean isPortOnBridge (Node node, Bridge bridge, String portName);
+ boolean isPortOnBridge(Node node, String portName);
/**
* 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 org.opendaylight.controller.sal.core.Node} to query
- * @param network the {@link org.opendaylight.neutron.spi.NeutronNetwork}
+ * @param node the {@link Node} to query
+ * @param network the {@link org.opendaylight.ovsdb.openstack.netvirt.translator}
* @return True or False
*/
- public boolean createLocalNetwork(Node node, NeutronNetwork network);
+ boolean createLocalNetwork(Node node, NeutronNetwork network);
/**
* Prepares the given Node for Neutron Networking by creating the Integration Bridge
- * @param node the {@link org.opendaylight.controller.sal.core.Node} to prepare
+ * @param node the {@link Node} to prepare
*/
- public void prepareNode(Node node);
+ void prepareNode(Node node);
/**
* Returns the physical interface mapped to the given neutron physical network.
- * @param node
- * @param physicalNetwork
- * @return
+ * @param node the {@link Node} to query
+ * @param physicalNetwork neutron physical network
+ * @return name of the physical interface
*/
- public String getPhysicalInterfaceName (Node node, String physicalNetwork);
+ String getPhysicalInterfaceName(Node node, String physicalNetwork);
/** Returns all physical interfaces configured in the bridge mapping
* Bridge mappings will be of the following format:
- * @param node the {@link org.opendaylight.controller.sal.core.Node} to query
+ * @param node the {@link Node} to query
* @return a List in the format {eth1, eth2} given bridge_mappings=physnet1:eth1,physnet2:eth2
*/
- public List<String> getAllPhysicalInterfaceNames(Node node);
-}
\ No newline at end of file
+ List<String> getAllPhysicalInterfaceNames(Node node);
+
+ /*
+ * Return br-ex interface configured in the bridge_mappings.
+ * Return null if br-ex is not configured in bridge_mappings.
+ * @param node the {@link Node} to query
+ * @param externalNetwork
+ * @return the interface as a string like eth3 given bridge_mappings=br-ex:eth3
+ */
+ String getExternalInterfaceName (Node node, String externalNetwork);
+
+}