use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType in project openflowplugin by opendaylight.
the class Test method createMatchBld.
private static MatchBuilder createMatchBld() {
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.openflow.common.types.rev130731.EtherType in project openflowplugin by opendaylight.
the class OF13PushPbbActionDeserializer method deserialize.
@Override
public Action deserialize(ByteBuf input) {
final ActionBuilder builder = new ActionBuilder();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
PushPbbCaseBuilder caseBuilder = new PushPbbCaseBuilder();
PushPbbActionBuilder pbbBuilder = new PushPbbActionBuilder();
pbbBuilder.setEthertype(new EtherType(input.readUnsignedShort()));
caseBuilder.setPushPbbAction(pbbBuilder.build());
builder.setActionChoice(caseBuilder.build());
input.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING);
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType in project openflowplugin by opendaylight.
the class OxmEthTypeDeserializer method addEthTypeValue.
private static void addEthTypeValue(ByteBuf input, MatchEntryBuilder builder) {
EthTypeCaseBuilder caseBuilder = new EthTypeCaseBuilder();
EthTypeBuilder ethBuilder = new EthTypeBuilder();
ethBuilder.setEthType(new EtherType(input.readUnsignedShort()));
caseBuilder.setEthType(ethBuilder.build());
builder.setMatchEntryValue(caseBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType in project openflowplugin by opendaylight.
the class PacketOutInputMessageFactoryTest method createAction.
private List<Action> createAction() {
final List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
PushVlanActionBuilder pushVlanBuilder = new PushVlanActionBuilder();
pushVlanBuilder.setEthertype(new EtherType(new EtherType(25)));
pushVlanCaseBuilder.setPushVlanAction(pushVlanBuilder.build());
actionBuilder.setActionChoice(pushVlanCaseBuilder.build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
actions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
actionBuilder.setActionChoice(new PopVlanCaseBuilder().build());
actions.add(actionBuilder.build());
return actions;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.EtherType in project openflowplugin by opendaylight.
the class EthernetTypeEntrySerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final long ethType = 0xffffL;
final Match match = new MatchBuilder().setEthernetMatch(new EthernetMatchBuilder().setEthernetType(new EthernetTypeBuilder().setType(new EtherType(ethType)).build()).build()).build();
assertMatch(match, false, (out) -> assertEquals(out.readUnsignedShort(), ethType));
}
Aggregations