2 * Copyright (c) 2014, 2015 Red Hat, Inc. and others. All rights reserved.
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
9 package org.opendaylight.ovsdb.openstack.netvirt.api;
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;
18 import java.util.List;
21 * Open vSwitch isolates Tenant Networks using VLANs on the Integration Bridge.
22 * This class manages the provisioning of these VLANs
24 public interface SecurityServicesManager {
26 * Is port security ready.
28 * @param intf the intf
31 boolean isPortSecurityReady(OvsdbTerminationPointAugmentation intf);
33 * Gets security group in port.
35 * @param intf the intf
36 * @return the list of security group in port, returns empty list if no group associated.
38 List<NeutronSecurityGroup> getSecurityGroupInPortList(OvsdbTerminationPointAugmentation intf);
40 * Gets the DHCP server port corresponding to a network.
42 * @param intf the intf
43 * @return the dhcp server port
45 NeutronPort getDhcpServerPort(OvsdbTerminationPointAugmentation intf);
48 * Check if the given interface corresponds to a DHCP server port.
50 * @param intf the intf
51 * @return Return the DHCP neutron port
53 NeutronPort getNeutronPortFromDhcpIntf(OvsdbTerminationPointAugmentation intf);
56 * Is the port a compute port.
58 * @param intf the intf
59 * @return whether it is a compute port or not
61 boolean isComputePort(OvsdbTerminationPointAugmentation intf);
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
69 boolean isLastPortinSubnet(Node node, OvsdbTerminationPointAugmentation intf);
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
77 boolean isLastPortinBridge(Node node, OvsdbTerminationPointAugmentation intf);
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
84 List<Neutron_IPs> getIpAddressList(Node node, OvsdbTerminationPointAugmentation intf);
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.
91 List<Neutron_IPs> getVmListForSecurityGroup(String portUuid,
92 String securityGroupUuid);
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.
99 void syncSecurityGroup(NeutronPort port, List<NeutronSecurityGroup> securityGroup, boolean write);
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.
107 void syncSecurityRule(NeutronPort port, NeutronSecurityRule securityRule,Neutron_IPs vmIp, boolean write);