use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createVlanMatch.
private static MatchBuilder createVlanMatch() {
final MatchBuilder match = new MatchBuilder();
// vlan match
final VlanMatchBuilder vlanBuilder = new VlanMatchBuilder();
final VlanIdBuilder vlanIdBuilder = new VlanIdBuilder();
final VlanId vlanId = new VlanId(10);
final VlanPcp vpcp = new VlanPcp((short) 3);
vlanBuilder.setVlanPcp(vpcp);
vlanIdBuilder.setVlanId(vlanId);
vlanIdBuilder.setVlanIdPresent(true);
vlanBuilder.setVlanId(vlanIdBuilder.build());
match.setVlanMatch(vlanBuilder.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createL4TCPMatch.
private static MatchBuilder createL4TCPMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x0800L));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
// ipv4 version
final IpMatchBuilder ipmatch = new IpMatchBuilder();
ipmatch.setIpProtocol((short) 6);
match.setIpMatch(ipmatch.build());
final PortNumber srcport = new PortNumber(1213);
final PortNumber dstport = new PortNumber(646);
// tcp match
final TcpMatchBuilder tcpmatch = new TcpMatchBuilder();
tcpmatch.setTcpSourcePort(srcport);
tcpmatch.setTcpDestinationPort(dstport);
match.setLayer4Match(tcpmatch.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createtablemiss.
private FlowBuilder createtablemiss() {
final FlowBuilder flow = new FlowBuilder();
final long id = 456;
final MatchBuilder matchBuilder = new MatchBuilder();
flow.setMatch(matchBuilder.build());
flow.setInstructions(createSentToControllerInstructions().build());
flow.setPriority(0);
flow.setTableId((short) 0);
final FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
flow.setKey(key);
return flow;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder 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.MatchBuilder 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;
}
Aggregations