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);
}
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();
}
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()));
}
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()));
}
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;
}
Aggregations