use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder in project openflowplugin by opendaylight.
the class OfToSalMplsLabelCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull MplsLabelCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final ProtocolMatchFieldsBuilder protocolMatchFieldsBuilder = data.getProtocolMatchFieldsBuilder();
MplsLabel mplsLabel = source.getMplsLabel();
if (mplsLabel != null) {
protocolMatchFieldsBuilder.setMplsLabel(mplsLabel.getMplsLabel());
matchBuilder.setProtocolMatchFields(protocolMatchFieldsBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder in project openflowplugin by opendaylight.
the class OfToSalSctpSrcCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull SctpSrcCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final SctpMatchBuilder sctpMatchBuilder = data.getSctpMatchBuilder();
SctpSrc sctpSrc = source.getSctpSrc();
PortNumber portNumber = sctpSrc.getPort();
if (portNumber != null) {
sctpMatchBuilder.setSctpSourcePort(portNumber);
matchBuilder.setLayer4Match(sctpMatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder in project openflowplugin by opendaylight.
the class OfToSalTunnelIpv4DstCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull Ipv4DstCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final Ipv4MatchBuilder ipv4MatchBuilder = data.getIpv4MatchBuilder();
final TunnelIpv4MatchBuilder tunnelIpv4MatchBuilder = data.getTunnelIpv4MatchBuilder();
Ipv4Dst tunnelIpv4Dst = source.getIpv4Dst();
if (tunnelIpv4Dst != null) {
String ipv4PrefixStr = tunnelIpv4Dst.getIpv4Address().getValue();
byte[] mask = tunnelIpv4Dst.getMask();
ipv4PrefixStr += IpConversionUtil.PREFIX_SEPARATOR + ByteBuffer.wrap(tunnelIpv4Dst.getMask()).getInt();
final Ipv4Prefix ipv4Prefix;
if (mask != null) {
ipv4Prefix = IpConversionUtil.createPrefix(new Ipv4Address(ipv4PrefixStr), mask);
} else {
// Openflow Spec : 1.3.2
// An all-one-bits oxm_mask is equivalent to specifying 0 for oxm_hasmask and omitting oxm_mask.
// So when user specify 32 as a mast, switch omit that mast and we get null as a mask in flow
// statistics response.
ipv4Prefix = IpConversionUtil.createPrefix(new Ipv4Address(ipv4PrefixStr));
}
ipv4MatchBuilder.setIpv4Destination(ipv4Prefix);
matchBuilder.setLayer3Match(tunnelIpv4MatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder in project openflowplugin by opendaylight.
the class OfToSalUdpDstCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull UdpDstCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final UdpMatchBuilder udpMatchBuilder = data.getUdpMatchBuilder();
UdpDst udpDst = source.getUdpDst();
if (udpDst != null) {
udpMatchBuilder.setUdpDestinationPort(udpDst.getPort());
matchBuilder.setLayer4Match(udpMatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder in project openflowplugin by opendaylight.
the class LLDPPacketPuntEnforcer method createFlow.
static Flow createFlow() {
FlowBuilder flowBuilder = new FlowBuilder();
flowBuilder.setMatch(new MatchBuilder().build());
flowBuilder.setInstructions(createSendToControllerInstructions().build());
flowBuilder.setPriority(0);
FlowKey key = new FlowKey(new FlowId(DEFAULT_FLOW_ID));
flowBuilder.setBarrier(Boolean.FALSE);
flowBuilder.setBufferId(OFConstants.OFP_NO_BUFFER);
BigInteger value = BigInteger.valueOf(10L);
flowBuilder.setCookie(new FlowCookie(value));
flowBuilder.setCookieMask(new FlowCookie(value));
flowBuilder.setHardTimeout(0);
flowBuilder.setIdleTimeout(0);
flowBuilder.setInstallHw(false);
flowBuilder.setStrict(false);
flowBuilder.setContainerName(null);
flowBuilder.setFlags(new FlowModFlags(false, false, false, false, true));
flowBuilder.setId(new FlowId("12"));
flowBuilder.setTableId(TABLE_ID);
flowBuilder.setKey(key);
flowBuilder.setFlowName(LLDP_PUNT_WHOLE_PACKET_FLOW);
return flowBuilder.build();
}
Aggregations