use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createMatch3.
private static MatchBuilder createMatch3() {
MatchBuilder match = new MatchBuilder();
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
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.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder in project openflowplugin by opendaylight.
the class EthernetSourceEntryDeserializer method deserializeEntry.
@Override
public void deserializeEntry(ByteBuf message, MatchBuilder builder) {
final boolean hasMask = processHeader(message);
final EthernetMatch ethernetMatch = builder.getEthernetMatch();
final EthernetSourceBuilder ethernetSourceBuilder = new EthernetSourceBuilder();
ethernetSourceBuilder.setAddress(OxmDeserializerHelper.convertMacAddress(message));
if (hasMask) {
ethernetSourceBuilder.setMask(OxmDeserializerHelper.convertMacAddress(message));
}
if (Objects.isNull(ethernetMatch)) {
builder.setEthernetMatch(new EthernetMatchBuilder().setEthernetSource(ethernetSourceBuilder.build()).build());
} else if (Objects.isNull(ethernetMatch.getEthernetSource())) {
builder.setEthernetMatch(new EthernetMatchBuilder(ethernetMatch).setEthernetSource(ethernetSourceBuilder.build()).build());
} else {
throwErrorOnMalformed(builder, "ethernetMatch", "ethernetSource");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder in project openflowplugin by opendaylight.
the class OfToSalEthSrcCase method process.
@Override
public Optional<MatchBuilder> process(@Nonnull EthSrcCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
final MatchBuilder matchBuilder = data.getMatchBuilder();
final EthernetMatchBuilder ethMatchBuilder = data.getEthernetMatchBuilder();
final EthSrc ethSrcCase = source.getEthSrc();
if (ethSrcCase != null) {
EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
ethSourceBuilder.setAddress(ethSrcCase.getMacAddress());
byte[] mask = ethSrcCase.getMask();
if (mask != null) {
ethSourceBuilder.setMask(new MacAddress(macAddressToString(mask)));
}
ethMatchBuilder.setEthernetSource(ethSourceBuilder.build());
matchBuilder.setEthernetMatch(ethMatchBuilder.build());
}
return Optional.of(matchBuilder);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder in project openflowplugin by opendaylight.
the class TestFlowHelper method createFlowAndStatisticsMapListBuilder.
/**
* Creates flow and statistics builder.
* @param index data seed
* @return flow stats builder with dummy content
*/
protected static FlowAndStatisticsMapListBuilder createFlowAndStatisticsMapListBuilder(int index) {
FlowAndStatisticsMapListBuilder flowAndStatisticsMapListBuilder = new FlowAndStatisticsMapListBuilder();
flowAndStatisticsMapListBuilder.setPriority(index);
flowAndStatisticsMapListBuilder.setTableId((short) index);
flowAndStatisticsMapListBuilder.setCookie(new FlowCookie(BigInteger.TEN));
EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder();
EthernetSourceBuilder ethernetSourceBuilder = new EthernetSourceBuilder();
MacAddress macAddress = new MacAddress("00:00:00:00:00:0" + index);
ethernetSourceBuilder.setAddress(macAddress);
ethernetMatchBuilder.setEthernetSource(ethernetSourceBuilder.build());
EthernetDestinationBuilder ethernetDestinationBuilder = new EthernetDestinationBuilder();
ethernetDestinationBuilder.setAddress(new MacAddress("00:00:00:0" + index + ":00:00"));
ethernetMatchBuilder.setEthernetDestination(ethernetDestinationBuilder.build());
MatchBuilder matchBuilder = new MatchBuilder();
matchBuilder.setEthernetMatch(ethernetMatchBuilder.build());
flowAndStatisticsMapListBuilder.setMatch(matchBuilder.build());
return flowAndStatisticsMapListBuilder;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder in project genius by opendaylight.
the class MatchEthernetSource method populateBuilder.
@Override
protected void populateBuilder(EthernetMatchBuilder builder) {
EthernetSourceBuilder ethernetSourceBuilder = new EthernetSourceBuilder().setAddress(address);
if (mask != null) {
ethernetSourceBuilder.setMask(mask);
}
builder.setEthernetSource(ethernetSourceBuilder.build());
}
Aggregations