use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction22.
private static InstructionsBuilder createAppyActionInstruction22() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
setDlTypeActionBuilder.setDlType(new EtherType(8L));
ab.setAction(new SetDlTypeActionCaseBuilder().setSetDlTypeAction(setDlTypeActionBuilder.build()).build());
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
final InstructionBuilder ib = new InstructionBuilder();
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<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType 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.openflow.common.types.rev130731.EtherType 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.openflow.common.types.rev130731.EtherType 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;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createMatch2.
private static MatchBuilder createMatch2() {
MatchBuilder match = new MatchBuilder();
Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1");
ipv4Match.setIpv4Source(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;
}
Aggregations