use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder in project netvirt by opendaylight.
the class AclMatches method setEtherType.
private void setEtherType(long etherType) {
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(etherType));
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
ethernetMatch.setEthernetType(ethTypeBuilder.build());
matchBuilder.setEthernetMatch(mergeEthernetMatch(matchBuilder, ethernetMatch));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder in project netvirt by opendaylight.
the class AclMatches method addEthMatch.
private void addEthMatch() {
AceEth aceEth = (AceEth) matches.getAceType();
if (aceEth.getSourceMacAddress() != null) {
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetSourceBuilder ethSourceBuilder = new EthernetSourceBuilder();
ethSourceBuilder.setAddress(new MacAddress(aceEth.getSourceMacAddress()));
ethernetMatch.setEthernetSource(ethSourceBuilder.build());
matchBuilder.setEthernetMatch(mergeEthernetMatch(matchBuilder, ethernetMatch));
}
if (aceEth.getDestinationMacAddress() != null) {
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
EthernetDestinationBuilder ethDestBuilder = new EthernetDestinationBuilder();
ethDestBuilder.setAddress(new MacAddress(aceEth.getDestinationMacAddress()));
ethernetMatch.setEthernetDestination(ethDestBuilder.build());
matchBuilder.setEthernetMatch(mergeEthernetMatch(matchBuilder, ethernetMatch));
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createICMPv6Match.
private static MatchBuilder createICMPv6Match() {
MatchBuilder match = new MatchBuilder();
EthernetMatchBuilder eth = new EthernetMatchBuilder();
EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x86ddL));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
// ipv4 version
IpMatchBuilder ipmatch = new IpMatchBuilder();
ipmatch.setIpProtocol((short) 58);
match.setIpMatch(ipmatch.build());
// icmpv6
Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder();
// match
icmpv6match.setIcmpv6Type((short) 135);
icmpv6match.setIcmpv6Code((short) 1);
match.setIcmpv6Match(icmpv6match.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createMatch1.
private static MatchBuilder createMatch1() {
MatchBuilder match = new MatchBuilder();
Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
ipv4Match.setIpv4Destination(prefix);
Ipv4Match i4m = ipv4Match.build();
match.setLayer3Match(i4m);
EthernetMatchBuilder eth = new EthernetMatchBuilder();
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.model.match.types.rev131026.match.EthernetMatchBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider 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;
}
Aggregations