Search in sources :

Example 11 with PacketInMessageBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketInMessageBuilder in project openflowplugin by opendaylight.

the class NodeConnectorRefToPortTranslatorTest method createPacketIn.

private static PacketIn createPacketIn(long portNo) {
    InPortBuilder inPortBuilder = new InPortBuilder().setPortNumber(new PortNumber(portNo));
    InPortCaseBuilder caseBuilder = new InPortCaseBuilder().setInPort(inPortBuilder.build());
    MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder().setOxmClass(OpenflowBasicClass.class).setOxmMatchField(InPort.class).setHasMask(false).setMatchEntryValue(caseBuilder.build());
    MatchBuilder matchBuilder = new MatchBuilder().setMatchEntry(Lists.newArrayList(matchEntryBuilder.build()));
    return new PacketInMessageBuilder().setVersion(OFConstants.OFP_VERSION_1_0).setData(PACKET_DATA.getBytes()).setReason(PacketInReason.OFPRACTION).setMatch(matchBuilder.build()).setVersion(OFConstants.OFP_VERSION_1_3).setCookie(BigInteger.ZERO).setTableId(new TableId(TABLE_ID)).build();
}
Also used : TableId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId) PacketInMessageBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessageBuilder) MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) InPortBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder) InPortCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCaseBuilder) OpenflowBasicClass(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder)

Aggregations

PacketInMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessageBuilder)10 Test (org.junit.Test)6 BigInteger (java.math.BigInteger)4 TableId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.TableId)4 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)4 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder)4 PacketInMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessage)3 ByteBuf (io.netty.buffer.ByteBuf)2 PortNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)2 EchoRequestMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoRequestMessageBuilder)2 ErrorMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessageBuilder)2 ExperimenterMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterMessageBuilder)2 FlowRemovedMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemovedMessageBuilder)2 HelloMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.HelloMessageBuilder)2 MultipartReplyMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessageBuilder)2 PortStatusMessageBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessageBuilder)2 DataObject (org.opendaylight.yangtools.yang.binding.DataObject)2 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 ArrayList (java.util.ArrayList)1 FlowCookie (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie)1