Search in sources :

Example 16 with EthernetSourceBuilder

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;
}
Also used : EthernetSourceBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder) Ipv4MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder)

Example 17 with EthernetSourceBuilder

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");
    }
}
Also used : EthernetMatch(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatch) EthernetSourceBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder)

Example 18 with EthernetSourceBuilder

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);
}
Also used : EthernetSourceBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder) EthSrc(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.eth.src._case.EthSrc) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder)

Example 19 with EthernetSourceBuilder

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;
}
Also used : FlowAndStatisticsMapListBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder) EthernetDestinationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder) FlowCookie(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie) EthernetSourceBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder) EthernetMatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder)

Example 20 with EthernetSourceBuilder

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());
}
Also used : EthernetSourceBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder)

Aggregations

EthernetSourceBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder)20 EthernetMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder)19 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)16 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)15 EthernetDestinationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder)12 Ipv4MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder)11 IpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder)8 EthernetTypeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetTypeBuilder)7 Ipv6MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder)7 EtherType (org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType)6 Icmpv6MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6MatchBuilder)6 Icmpv4MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv4MatchBuilder)5 VlanMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder)5 ArpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder)5 TunnelIpv4MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder)5 TcpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder)5 UdpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder)5 Test (org.junit.Test)4 BigInteger (java.math.BigInteger)3 Ipv4Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix)3