L3: Add eth to br-ex
[netvirt.git] / openstack / net-virt / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / api / SecurityServicesManager.java
1 /*
2  * Copyright (c) 2014, 2015 Red Hat, Inc. and others. All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.ovsdb.openstack.netvirt.api;
10
11 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
12 import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronSecurityGroup;
13 import org.opendaylight.ovsdb.openstack.netvirt.translator.Neutron_IPs;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
15 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
16
17 import java.util.List;
18
19 /**
20  * Open vSwitch isolates Tenant Networks using VLANs on the Integration Bridge.
21  * This class manages the provisioning of these VLANs
22  */
23 public interface SecurityServicesManager {
24     /**
25      * Is port security ready.
26      *
27      * @param intf the intf
28      * @return the boolean
29      */
30     boolean isPortSecurityReady(OvsdbTerminationPointAugmentation intf);
31     /**
32      * Gets security group in port.
33      *
34      * @param intf the intf
35      * @return the list of security group in port, returns empty list if no group associated.
36      */
37     List<NeutronSecurityGroup> getSecurityGroupInPortList(OvsdbTerminationPointAugmentation intf);
38     /**
39      * Gets the DHCP server port corresponding to a network.
40      *
41      * @param intf the intf
42      * @return the dhcp server port
43      */
44     NeutronPort getDhcpServerPort(OvsdbTerminationPointAugmentation intf);
45
46     /**
47       * Check if the given interface corresponds to a DHCP server port.
48       *
49       * @param intf the intf
50       * @return Return the DHCP neutron port
51       */
52     NeutronPort getNeutronPortFromDhcpIntf(OvsdbTerminationPointAugmentation intf);
53
54     /**
55      * Is the port a compute port.
56      *
57      * @param intf the intf
58      * @return  whether it is a compute port or not
59      */
60     boolean isComputePort(OvsdbTerminationPointAugmentation intf);
61
62     /**
63      * Is this the last port in the subnet to which interface belongs to.
64      * @param node The node to which the intf is connected.
65      * @param intf the intf
66      * @return whether last port in the subnet
67      */
68     boolean isLastPortinSubnet(Node node, OvsdbTerminationPointAugmentation intf);
69
70     /**
71      * Is this the last port in the bridge to which interface belongs to.
72      * @param node The node to which the intf is connected.
73      * @param intf the intf
74      * @return whether last port in bridge
75      */
76     boolean isLastPortinBridge(Node node, OvsdbTerminationPointAugmentation intf);
77     /**
78      * Returns the  list of ip address assigned to the interface.
79      * @param node The node to which the intf is connected.
80      * @param intf the intf
81      * @return the list of ip address associated with the vm
82      */
83     List<Neutron_IPs> getIpAddressList(Node node, OvsdbTerminationPointAugmentation intf);
84     /**
85      * Get the list of vm belonging to a security group.
86      * @param srcAddressList the address list of the connected vm.
87      * @param securityGroupUuid the UUID of the remote security group.
88      * @return the list of all vm belonging to the security group UUID passed.
89      */
90     List<Neutron_IPs> getVmListForSecurityGroup(List<Neutron_IPs> srcAddressList,
91                                                 String securityGroupUuid);
92     /**
93      * Add or remove the security groups rules from the port.
94      * @param port the neutron port.
95      * @param securityGroup the security group associated with the port.
96      * @param write whether to add/delete flow.
97      */
98     void syncSecurityGroup(NeutronPort port, List<NeutronSecurityGroup> securityGroup, boolean write);
99 }