use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType in project openflowplugin by opendaylight.
the class OpenflowPluginBulkGroupTransactionProvider method createEthernetMatch.
private static MatchBuilder createEthernetMatch() {
// ethernettype
EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
// match
EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
EtherType type = new EtherType(0x0800L);
ethmatch.setEthernetType(ethtype.setType(type).build());
// ethernet
EthernetDestinationBuilder ethdest = new EthernetDestinationBuilder();
// macaddress
// match
MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
ethdest.setAddress(macdest);
// ethdest.setMask(mask1);
ethmatch.setEthernetDestination(ethdest.build());
EthernetSourceBuilder ethsrc = new EthernetSourceBuilder();
MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
ethsrc.setAddress(macsrc);
// ethsrc.setMask(mask2);
ethmatch.setEthernetSource(ethsrc.build());
MatchBuilder match = new MatchBuilder();
match.setEthernetMatch(ethmatch.build());
return match;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType in project openflowplugin by opendaylight.
the class PushMplsActionDeserializerTest method testDeserialize.
@Test
public void testDeserialize() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short ethType = 10;
writeHeader(in);
in.writeShort(ethType);
in.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING);
final Action action = deserializeAction(in);
assertTrue(PushMplsActionCase.class.isInstance(action));
assertEquals(ethType, PushMplsActionCase.class.cast(action).getPushMplsAction().getEthernetType().shortValue());
assertEquals(0, in.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType in project openflowplugin by opendaylight.
the class PopMplsActionSerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final int ethType = 10;
final Action action = new PopMplsActionCaseBuilder().setPopMplsAction(new PopMplsActionBuilder().setEthernetType(ethType).build()).build();
assertAction(action, out -> {
assertEquals(out.readUnsignedShort(), ethType);
out.skipBytes(ActionConstants.ETHERTYPE_ACTION_PADDING);
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType in project openflowplugin by opendaylight.
the class PushPbbActionDeserializerTest method testDeserialize.
@Test
public void testDeserialize() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final short ethType = 10;
writeHeader(in);
in.writeShort(ethType);
in.writeZero(ActionConstants.ETHERTYPE_ACTION_PADDING);
final Action action = deserializeAction(in);
assertTrue(PushPbbActionCase.class.isInstance(action));
assertEquals(ethType, PushPbbActionCase.class.cast(action).getPushPbbAction().getEthernetType().shortValue());
assertEquals(0, in.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType in project openflowplugin by opendaylight.
the class FlowCreatorUtilTest method createMatch.
/**
* Create a flow match that specifies ethernet type.
*
* @param etherType An ethernet type value.
* @return A flow match that specifies the given ethernet type.
*/
private static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match createMatch(final long etherType) {
final EthernetTypeBuilder ethType = new EthernetTypeBuilder().setType(new EtherType(etherType));
final EthernetMatchBuilder ether = new EthernetMatchBuilder().setEthernetType(ethType.build());
return new MatchBuilder().setEthernetMatch(ether.build()).build();
}
Aggregations