Search in sources :

Example 11 with Feature

use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.extensions.rev160617.service.provider.features.attributes.features.Feature in project openflowplugin by opendaylight.

the class HandshakeManagerImpl method postHandshake.

/**
 * after handshake set features, register to session.
 *
 * @param proposedVersion proposed openflow version
 * @param xid             transaction id
 */
protected void postHandshake(final Short proposedVersion, final Long xid) {
    // set version
    version = proposedVersion;
    LOG.debug("version set: {}", proposedVersion);
    // request features
    GetFeaturesInputBuilder featuresBuilder = new GetFeaturesInputBuilder();
    featuresBuilder.setVersion(version).setXid(xid);
    LOG.debug("sending feature request for version={} and xid={}", version, xid);
    Future<RpcResult<GetFeaturesOutput>> featuresFuture = connectionAdapter.getFeatures(featuresBuilder.build());
    Futures.addCallback(JdkFutureAdapters.listenInPoolThread(featuresFuture), new FutureCallback<RpcResult<GetFeaturesOutput>>() {

        @Override
        public void onSuccess(@Nonnull RpcResult<GetFeaturesOutput> rpcFeatures) {
            LOG.trace("features are back");
            if (rpcFeatures.isSuccessful()) {
                GetFeaturesOutput featureOutput = rpcFeatures.getResult();
                LOG.debug("obtained features: datapathId={}", featureOutput.getDatapathId());
                LOG.debug("obtained features: auxiliaryId={}", featureOutput.getAuxiliaryId());
                LOG.trace("handshake SETTLED: version={}, datapathId={}, auxiliaryId={}", version, featureOutput.getDatapathId(), featureOutput.getAuxiliaryId());
                handshakeListener.onHandshakeSuccessful(featureOutput, proposedVersion);
            } else {
                // handshake failed
                LOG.warn("issuing disconnect during handshake [{}]", connectionAdapter.getRemoteAddress());
                for (RpcError rpcError : rpcFeatures.getErrors()) {
                    LOG.debug("handshake - features failure [{}]: i:{} | m:{} | s:{}", xid, rpcError.getInfo(), rpcError.getMessage(), rpcError.getSeverity(), rpcError.getCause());
                }
                handshakeListener.onHandshakeFailure();
            }
            LOG.debug("postHandshake DONE");
        }

        @Override
        public void onFailure(Throwable throwable) {
            LOG.warn("getting feature failed seriously [{}, addr:{}]: {}", xid, connectionAdapter.getRemoteAddress(), throwable.getMessage());
            LOG.trace("DETAIL of sending of hello failure:", throwable);
        }
    }, MoreExecutors.directExecutor());
    LOG.debug("future features [{}] hooked ..", xid);
}
Also used : GetFeaturesOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput) GetFeaturesInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) RpcError(org.opendaylight.yangtools.yang.common.RpcError)

Example 12 with Feature

use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.extensions.rev160617.service.provider.features.attributes.features.Feature in project openflowplugin by opendaylight.

the class TableFeaturesResponseConvertor method toTableProperties.

private static TableProperties toTableProperties(final List<TableFeatureProperties> ofTablePropertiesList) {
    if (ofTablePropertiesList == null) {
        return new TablePropertiesBuilder().setTableFeatureProperties(Collections.emptyList()).build();
    }
    List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeatureProperties> salTablePropertiesList = new ArrayList<>();
    TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder();
    int index = 0;
    for (TableFeatureProperties property : ofTablePropertiesList) {
        TableFeaturesPropType propType = property.getType();
        ActionExecutor actionExecutor = TABLE_FEATURE_PROPERTY_TYPE_TO_ACTION.get(propType);
        if (actionExecutor != null) {
            actionExecutor.execute(property, propBuilder);
        } else {
            LOG.error("Unsupported table feature property : " + propType);
        }
        propBuilder.setOrder(index);
        salTablePropertiesList.add(propBuilder.build());
        index += 1;
    }
    return new TablePropertiesBuilder().setTableFeatureProperties(salTablePropertiesList).build();
}
Also used : TableFeaturesPropType(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableFeaturesPropType) TableFeatureProperties(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.table.features.properties.grouping.TableFeatureProperties) ArrayList(java.util.ArrayList) TableFeaturePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.table.properties.TableFeaturePropertiesBuilder) TablePropertiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.table.features.TablePropertiesBuilder)

Example 13 with Feature

use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.extensions.rev160617.service.provider.features.attributes.features.Feature in project openflowplugin by opendaylight.

the class SwitchFeaturesUtilTest method testSwFeaturesCapabilitiesV13.

/**
 * Test method for
 * {@link SwitchFeaturesUtil#buildSwitchFeatures} for OF 1.3 version
 * and switch feature capabilities
 * .
 */
@Test
public void testSwFeaturesCapabilitiesV13() {
    Capabilities capabilities = new Capabilities(true, false, true, false, true, false, true);
    featuresOutputBuilder.setCapabilities(capabilities).setCapabilitiesV10(null).setVersion((short) 4);
    Assert.assertNotNull(swUtil.buildSwitchFeatures(featuresOutputBuilder.build()));
}
Also used : Capabilities(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Capabilities) Test(org.junit.Test)

Example 14 with Feature

use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.extensions.rev160617.service.provider.features.attributes.features.Feature in project openflowplugin by opendaylight.

the class SwitchFeaturesUtilTest method testSwFeaturesCapabilitiesMalformed.

/**
 * Test method for
 * {@link SwitchFeaturesUtil#buildSwitchFeatures} for malformed switch feature capabilities
 * - at least one feature is null
 * .
 */
// @Test TODO:do we need to check if capability is null?
public void testSwFeaturesCapabilitiesMalformed() {
    CapabilitiesV10 capabilities = new CapabilitiesV10(true, false, true, false, true, false, true, null);
    featuresOutputBuilder.setCapabilitiesV10(capabilities).setCapabilities(null).setVersion((short) 1);
    Assert.assertNull(swUtil.buildSwitchFeatures(featuresOutputBuilder.build()));
}
Also used : CapabilitiesV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.CapabilitiesV10)

Example 15 with Feature

use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.extensions.rev160617.service.provider.features.attributes.features.Feature in project genius by opendaylight.

the class ItmTunnelAggregationHelper method initTunnelAggregationConfig.

private void initTunnelAggregationConfig(ItmConfig itmConfig) {
    // Load balancing of VxLAN feature is guarded by a global configuration option in the ITM,
    // only when the feature is enabled, the logical tunnel interfaces should be created.
    boolean tunnelAggregationConfigEnabled = false;
    List<TunnelAggregation> tunnelsConfig = itmConfig != null ? itmConfig.getTunnelAggregation() : null;
    if (tunnelsConfig != null) {
        for (TunnelAggregation tnlCfg : tunnelsConfig) {
            Class<? extends TunnelTypeBase> tunType = ItmUtils.getTunnelType(tnlCfg.getKey().getTunnelType());
            if (tunType.isAssignableFrom(TunnelTypeVxlan.class)) {
                tunnelAggregationConfigEnabled = tnlCfg.isEnabled();
                LOG.info("MULTIPLE_VxLAN_TUNNELS: tunnelAggregationEnabled {}", tunnelAggregationConfigEnabled);
                break;
            }
        }
    }
    tunnelAggregationEnabled = tunnelAggregationConfigEnabled;
}
Also used : TunnelAggregation(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.itm.config.TunnelAggregation)

Aggregations

Test (org.junit.Test)8 ArrayList (java.util.ArrayList)6 TepsInNotHostedTransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZone)4 UnknownVteps (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVteps)4 ByteBuf (io.netty.buffer.ByteBuf)3 BigInteger (java.math.BigInteger)3 CapabilitiesV10 (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.CapabilitiesV10)3 MultipartReplyTableFeatures (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.table.features._case.MultipartReplyTableFeatures)3 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)2 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)2 TepsInNotHostedTransportZoneBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZoneBuilder)2 TepsInNotHostedTransportZoneKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZoneKey)2 UnknownVtepsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVtepsBuilder)2 UnknownVtepsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVtepsKey)2 TransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZone)2 Subnets (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets)2 Vteps (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.subnets.Vteps)2 NextTableIds (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev150225.table.features.properties.container.table.feature.properties.NextTableIds)2 TableConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableConfig)2 MultipartReplyMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage)2