2 * Copyright (C) 2014 Red Hat, Inc.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 * Authors : Dave Tucker
11 package org.opendaylight.ovsdb.openstack.netvirt.api;
13 import org.opendaylight.neutron.spi.NeutronNetwork;
14 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
16 import java.util.List;
19 * OpenStack Neutron with the Open vSwitch plugin relies on a typical bridge configuration that
20 * consists of br-int (Integration Bridge), br-net (Network bridge), br-ex (External bridge).
22 * This class ensures that the bridges on each {@link Node}
23 * are correctly configured for OpenStack Neutron
26 public interface BridgeConfigurationManager {
29 * A helper function to get the UUID of a given Bridge
30 * @param node the {@link Node} where the bridge is configured
31 * @param bridgeName the name of the bridge
32 * @return the UUID of the bridge
34 public String getBridgeUuid(Node node, String bridgeName);
37 * Checks for the existence of the Integration Bridge on a given Node
38 * @param node the {@link Node} where the bridge should be configured
39 * @return True if the bridge exists, False if it does not
41 public boolean isNodeNeutronReady(Node node);
44 * Checks for the existence of the Network Bridge on a given Node
45 * @param node the {@link Node} where the bridge should be configured
46 * @return True if the bridge exists, False if it does not
48 public boolean isNodeOverlayReady(Node node);
51 * Checks for the existence of the Network Bridge on a given Node
52 * @param node the {@link Node} where the bridge should be configured
53 * @return True if the bridge exists, False if it does not
57 * Checks that a Node is ready for a Tunnel Network Provider
58 * For OpenFlow 1.0 the Integration, Network Bridge and corresponding patch ports are required
59 * For OpenFlow 1.3 only the Integration Bridge is required
60 * @param node the {@link Node} where the bridge is configured
61 * @return True or False
63 public boolean isNodeTunnelReady(Node node);
65 /* Determine if internal network is ready for vlan network types.
66 * - OF 1.0 requires br-int, br-net, a patch connecting them and
67 * physical device added to br-net.
68 * - OF 1.3 requires br-int and physical device added to br-int.
72 * Checks that a Node is ready for a VLAN Network Provider for the given Network
73 * For OpenFlow 1.0 the Integration Bridge, Network Bridge, patch ports and a physical device connected to the
74 * Network Bridge are required.
75 * For OpenFlow 1.3 the Integration Bridge is required and must have a physical device connected.
76 * @param node the {@link Node} where the bridge is configured
77 * @param network the {@link org.opendaylight.neutron.spi.NeutronNetwork}
78 * @return True or False
80 public boolean isNodeVlanReady(Node node, NeutronNetwork network);
83 * A helper function to determine if a port exists on a given bridge
84 * @param node the {@link Node} where the bridge is configured
85 * @param portName the name of the port to search for
86 * @return True if the port exists, otherwise False
88 public boolean isPortOnBridge (Node node, String portName);
92 * Returns true if the bridges required for the provider network type are created
93 * If the bridges are not created, this method will attempt to create them
94 * @param node the {@link Node} to query
95 * @param network the {@link org.opendaylight.neutron.spi.NeutronNetwork}
96 * @return True or False
98 public boolean createLocalNetwork(Node node, NeutronNetwork network);
101 * Prepares the given Node for Neutron Networking by creating the Integration Bridge
102 * @param node the {@link Node} to prepare
104 public void prepareNode(Node node);
107 * Returns the physical interface mapped to the given neutron physical network.
109 * @param physicalNetwork
112 public String getPhysicalInterfaceName (Node node, String physicalNetwork);
114 /** Returns all physical interfaces configured in the bridge mapping
115 * Bridge mappings will be of the following format:
116 * @param node the {@link Node} to query
117 * @return a List in the format {eth1, eth2} given bridge_mappings=physnet1:eth1,physnet2:eth2
119 public List<String> getAllPhysicalInterfaceNames(Node node);