use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createMatch3.
private static MatchBuilder createMatch3() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
final EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
ethSourceBuilder.setAddress(new MacAddress("00:00:00:00:00:01"));
ethernetMatch.setEthernetSource(ethSourceBuilder.build());
match.setEthernetMatch(ethernetMatch.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createMatch2.
private static MatchBuilder createMatch2() {
final MatchBuilder match = new MatchBuilder();
final Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
final Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1");
ipv4Match.setIpv4Source(prefix);
final Ipv4Match i4m = ipv4Match.build();
match.setLayer3Match(i4m);
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createMetadataMatch.
private static MatchBuilder createMetadataMatch() {
final MatchBuilder match = new MatchBuilder();
final byte[] metamask = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1 };
// metadata match
final MetadataBuilder metadata = new MetadataBuilder();
metadata.setMetadata(BigInteger.valueOf(500L));
metadata.setMetadataMask(new BigInteger(1, metamask));
match.setMetadata(metadata.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class TableFeaturesConvertor method setTableFeatureProperty.
private static void setTableFeatureProperty(final Match propType, final TableFeaturePropertiesBuilder propBuilder) {
MatchSetfield matchSetField = propType.getMatchSetfield();
List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
if (null != matchSetField) {
setFieldMatch = matchSetField.getSetFieldMatch();
}
setSetFieldTableFeatureProperty(propBuilder, TableFeaturesPropType.OFPTFPTMATCH, setFieldMatch == null ? new ArrayList<>() : setFieldMatch);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match in project openflowplugin by opendaylight.
the class DropTestRpcSender method processPacket.
@Override
protected void processPacket(final InstanceIdentifier<Node> node, final Match match, final Instructions instructions) {
final AddFlowInputBuilder fb = BUILDER.get();
// Finally build our flow
fb.setMatch(match);
fb.setInstructions(instructions);
// Construct the flow instance id
fb.setNode(new NodeRef(node));
// Add flow
final AddFlowInput flow = fb.build();
if (LOG.isDebugEnabled()) {
LOG.debug("onPacketReceived - About to write flow (via SalFlowService) {}", flow);
}
ListenableFuture<RpcResult<AddFlowOutput>> result = JdkFutureAdapters.listenInPoolThread(flowService.addFlow(flow));
Futures.addCallback(result, new FutureCallback<RpcResult<AddFlowOutput>>() {
@Override
public void onSuccess(final RpcResult<AddFlowOutput> result) {
countFutureSuccess();
}
@Override
public void onFailure(final Throwable throwable) {
countFutureError();
}
}, MoreExecutors.directExecutor());
}
Aggregations