use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createToSMatch.
private static MatchBuilder createToSMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
final EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
final EtherType type = new EtherType(0x0800L);
ethmatch.setEthernetType(ethtype.setType(type).build());
match.setEthernetMatch(ethmatch.build());
// ipv4 version
final IpMatchBuilder ipmatch = new IpMatchBuilder();
ipmatch.setIpProtocol((short) 6);
final Dscp dscp = new Dscp((short) 8);
ipmatch.setIpDscp(dscp);
match.setIpMatch(ipmatch.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createMplsMatch.
private static MatchBuilder createMplsMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
final EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
ethTypeBuilder.setType(new EtherType(0x8847L));
eth.setEthernetType(ethTypeBuilder.build());
match.setEthernetMatch(eth.build());
// mpls
final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
// match
protomatch.setMplsLabel((long) 36008);
protomatch.setMplsTc((short) 4);
protomatch.setMplsBos((short) 1);
match.setProtocolMatchFields(protomatch.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction43.
private static InstructionsBuilder createAppyActionInstruction43() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final ActionBuilder ab2 = new ActionBuilder();
final ActionBuilder ab3 = new ActionBuilder();
final ActionBuilder ab4 = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
final SetFieldBuilder setFieldBuilder2 = new SetFieldBuilder();
final SetFieldBuilder setFieldBuilder3 = new SetFieldBuilder();
final SetFieldBuilder setFieldBuilder4 = new SetFieldBuilder();
// setting the values of ARP
final MacAddress macdest = new MacAddress(DEST_MAC_ADDRESS);
final MacAddress macsrc = new MacAddress(SRC_MAC_ADDRESS);
final Ipv4Prefix dstiparp = new Ipv4Prefix("200.71.9.52");
final Ipv4Prefix srciparp = new Ipv4Prefix("100.1.1.1");
// create ARP match action
final ArpMatchBuilder arpmatch = new ArpMatchBuilder();
final ArpMatchBuilder arpmatch1 = new ArpMatchBuilder();
final ArpMatchBuilder arpmatch2 = new ArpMatchBuilder();
final ArpMatchBuilder arpmatch3 = new ArpMatchBuilder();
final ArpMatchBuilder arpmatch4 = new ArpMatchBuilder();
final ArpSourceHardwareAddressBuilder arpsrc = new ArpSourceHardwareAddressBuilder();
arpsrc.setAddress(macsrc);
final ArpTargetHardwareAddressBuilder arpdst = new ArpTargetHardwareAddressBuilder();
arpdst.setAddress(macdest);
arpmatch.setArpOp(2);
arpmatch1.setArpSourceHardwareAddress(arpsrc.build());
arpmatch2.setArpTargetHardwareAddress(arpdst.build());
arpmatch3.setArpSourceTransportAddress(srciparp);
arpmatch4.setArpTargetTransportAddress(dstiparp);
setFieldBuilder.setLayer3Match(arpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer3Match(arpmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
ab1.setKey(new ActionKey(1));
actionList.add(ab1.build());
setFieldBuilder2.setLayer3Match(arpmatch2.build());
ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
ab2.setKey(new ActionKey(2));
actionList.add(ab2.build());
setFieldBuilder3.setLayer3Match(arpmatch3.build());
ab3.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder3.build()).build());
ab3.setKey(new ActionKey(3));
actionList.add(ab3.build());
setFieldBuilder4.setLayer3Match(arpmatch4.build());
ab4.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder4.build()).build());
ab4.setKey(new ActionKey(4));
actionList.add(ab4.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
ib.setKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.Match 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.packet.service.rev130709.packet.received.Match 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;
}
Aggregations