Search in sources :

Example 16 with OfHeader

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.

the class MultiLayerMeterService method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final I input) throws ServiceException {
    final Optional<MeterModInputBuilder> ofMeterModInput = convertorExecutor.convert(input, data);
    final MeterModInputBuilder meterModInputBuilder = ofMeterModInput.orElse(MeterConvertor.defaultResult(getVersion()));
    meterModInputBuilder.setXid(xid.getValue());
    return meterModInputBuilder.build();
}
Also used : MeterModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MeterModInputBuilder)

Example 17 with OfHeader

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.

the class FlowCapableTransactionServiceImpl method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final SendBarrierInput input) throws ServiceException {
    final BarrierInputBuilder barrierInputOFJavaBuilder = new BarrierInputBuilder();
    barrierInputOFJavaBuilder.setVersion(getVersion());
    barrierInputOFJavaBuilder.setXid(xid.getValue());
    return barrierInputOFJavaBuilder.build();
}
Also used : BarrierInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder)

Example 18 with OfHeader

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.

the class PacketProcessingServiceImpl method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final TransmitPacketInput input) throws ServiceException {
    final PacketOutConvertorData data = new PacketOutConvertorData(getVersion());
    data.setDatapathId(getDatapathId());
    data.setXid(xid.getValue());
    final Optional<PacketOutInput> result = convertorExecutor.convert(input, data);
    return result.orElse(PacketOutConvertor.defaultResult(getVersion()));
}
Also used : PacketOutConvertorData(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.PacketOutConvertorData) PacketOutInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketOutInput)

Example 19 with OfHeader

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.

the class AllFlowsInTableService method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final GetAllFlowStatisticsFromFlowTableInput input) throws ServiceException {
    final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
    mprFlowRequestBuilder.setTableId(input.getTableId().getValue());
    mprFlowRequestBuilder.setOutPort(OFConstants.OFPP_ANY);
    mprFlowRequestBuilder.setOutGroup(OFConstants.OFPG_ANY);
    mprFlowRequestBuilder.setCookie(OFConstants.DEFAULT_COOKIE);
    mprFlowRequestBuilder.setCookieMask(OFConstants.DEFAULT_COOKIE_MASK);
    final short version = getVersion();
    FlowCreatorUtil.setWildcardedFlowMatch(version, mprFlowRequestBuilder);
    final MultipartRequestFlowCaseBuilder multipartRequestFlowCaseBuilder = new MultipartRequestFlowCaseBuilder();
    multipartRequestFlowCaseBuilder.setMultipartRequestFlow(mprFlowRequestBuilder.build());
    final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPFLOW, xid.getValue(), version);
    mprInput.setMultipartRequestBody(multipartRequestFlowCaseBuilder.build());
    return mprInput.build();
}
Also used : MultipartRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder) MultipartRequestFlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.flow._case.MultipartRequestFlowBuilder) MultipartRequestFlowCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestFlowCaseBuilder)

Example 20 with OfHeader

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.

the class NodeConfigServiceImpl method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final SetConfigInput input) throws ServiceException {
    SetConfigInputBuilder builder = new SetConfigInputBuilder();
    SwitchConfigFlag flag = SwitchConfigFlag.valueOf(input.getFlag());
    builder.setXid(xid.getValue());
    builder.setFlags(flag);
    builder.setMissSendLen(input.getMissSearchLength());
    builder.setVersion(getVersion());
    return builder.build();
}
Also used : SwitchConfigFlag(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.SwitchConfigFlag) SetConfigInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInputBuilder)

Aggregations

OfHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader)30 Test (org.junit.Test)23 MultipartRequestInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder)17 Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)10 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)5 ExecutionException (java.util.concurrent.ExecutionException)3 ServiceException (org.opendaylight.openflowplugin.impl.services.util.ServiceException)3 GroupMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupMessage)3 MultipartType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType)3 FutureCallback (com.google.common.util.concurrent.FutureCallback)2 List (java.util.List)2 Future (java.util.concurrent.Future)2 Function (java.util.function.Function)2 OFDeserializer (org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer)2 TypeVersionKey (org.opendaylight.openflowplugin.extension.api.TypeVersionKey)2 ConversionException (org.opendaylight.openflowplugin.extension.api.exception.ConversionException)2 ConverterNotFoundException (org.opendaylight.openflowplugin.extension.api.exception.ConverterNotFoundException)2 ConvertorExecutor (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor)2 PortMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortMessage)2 FlowMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowMessage)2