Search in sources :

Example 1 with PortSecurityExtension

use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.portsecurity.rev150712.PortSecurityExtension in project netvirt by opendaylight.

the class NeutronvpnUtils method getPortSecurityEnabled.

/**
 * Returns port_security_enabled status with the port.
 *
 * @param port the port
 * @return port_security_enabled status
 */
protected static boolean getPortSecurityEnabled(Port port) {
    String deviceOwner = port.getDeviceOwner();
    if (deviceOwner != null && deviceOwner.startsWith("network:")) {
        // router interface, dhcp port and floating ip.
        return false;
    }
    PortSecurityExtension portSecurity = port.getAugmentation(PortSecurityExtension.class);
    if (portSecurity != null) {
        return portSecurity.isPortSecurityEnabled();
    }
    return false;
}
Also used : PortSecurityExtension(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.portsecurity.rev150712.PortSecurityExtension)

Aggregations

PortSecurityExtension (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.portsecurity.rev150712.PortSecurityExtension)1