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.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;
17 import java.util.List;
20 * Open vSwitch isolates Tenant Networks using VLANs on the Integration Bridge.
21 * This class manages the provisioning of these VLANs
23 public interface SecurityServicesManager {
25 * Is port security ready.
27 * @param intf the intf
30 boolean isPortSecurityReady(OvsdbTerminationPointAugmentation intf);
32 * Gets security group in port.
34 * @param intf the intf
35 * @return the list of security group in port, returns empty list if no group associated.
37 List<NeutronSecurityGroup> getSecurityGroupInPortList(OvsdbTerminationPointAugmentation intf);
39 * Gets the DHCP server port corresponding to a network.
41 * @param intf the intf
42 * @return the dhcp server port
44 NeutronPort getDhcpServerPort(OvsdbTerminationPointAugmentation intf);
47 * Check if the given interface corresponds to a DHCP server port.
49 * @param intf the intf
50 * @return Return the DHCP neutron port
52 NeutronPort getNeutronPortFromDhcpIntf(OvsdbTerminationPointAugmentation intf);
55 * Is the port a compute port.
57 * @param intf the intf
58 * @return whether it is a compute port or not
60 boolean isComputePort(OvsdbTerminationPointAugmentation intf);
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
68 boolean isLastPortinSubnet(Node node, OvsdbTerminationPointAugmentation intf);
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
76 boolean isLastPortinBridge(Node node, OvsdbTerminationPointAugmentation intf);
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
83 List<Neutron_IPs> getIpAddressList(Node node, OvsdbTerminationPointAugmentation intf);
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.
90 List<Neutron_IPs> getVmListForSecurityGroup(List<Neutron_IPs> srcAddressList,
91 String securityGroupUuid);
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.
98 void syncSecurityGroup(NeutronPort port, List<NeutronSecurityGroup> securityGroup, boolean write);