use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder 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.match.EthernetMatchBuilder in project openflowplugin by opendaylight.
the class FlowConvertorTest method createEthernetMatch.
private static EthernetMatch createEthernetMatch() {
EthernetMatchBuilder ethernetMatchBuilder = new EthernetMatchBuilder();
ethernetMatchBuilder.setEthernetType(new EthernetTypeBuilder().setType(new EtherType(33024L)).build());
return ethernetMatchBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder 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.match.EthernetMatchBuilder 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.match.EthernetMatchBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createLLDPMatch.
private static MatchBuilder createLLDPMatch() {
MatchBuilder match = new MatchBuilder();
EthernetMatchBuilder eth = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x88ccL));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
return match;
}
Aggregations