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