Search in sources :

Example 11 with PacketReceivedBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceivedBuilder in project genius by opendaylight.

the class ArpUtilTestUtil method createPayload.

public static PacketReceived createPayload(int oc) {
    final short ID = 2;
    byte[] payload = bytePayload(// Destination MAC
    "1F 1F 1F 1F 1F 1F", // Source MAC
    "00 01 02 03 04 05", // Ethernet type
    "08 06", // Hardware type
    "0 1", // Protocol type
    "8 0", // Hardware size
    "6", // Protocol size
    "4", // Opcode
    OP_CODE[oc], // Sender MAC Address
    "00 01 02 03 04 05", // Sender IP Address
    "C0 A8 0 2", // Target MAC Address
    "00 01 02 03 04 05", // Target IP Address
    "C0 A8 0 2");
    return new PacketReceivedBuilder().setPacketInReason(SendToController.class).setTableId(new TableId(ID)).setPayload(payload).setIngress(new NodeConnectorRef(InstanceIdentifier.create(Node.class))).setMatch(new MatchBuilder().setMetadata(new MetadataBuilder().setMetadata(META_DATA).build()).build()).build();
}
Also used : TableId(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId) NodeConnectorRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef) SendToController(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.SendToController) MetadataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.MatchBuilder) PacketReceivedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceivedBuilder)

Aggregations

PacketReceivedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceivedBuilder)11 Test (org.junit.Test)7 TransmitPacketInput (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput)7 NodeConnectorRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef)6 BigInteger (java.math.BigInteger)4 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)4 ArrayList (java.util.ArrayList)3 MetadataBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder)3 PacketReceived (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceived)3 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.MatchBuilder)3 DeviceInfo (org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo)2 Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)2 TranslatorKey (org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey)2 TransactionChainManager (org.opendaylight.openflowplugin.common.txchain.TransactionChainManager)2 AbstractDeviceInitializer (org.opendaylight.openflowplugin.impl.device.initialization.AbstractDeviceInitializer)2 Ipv6Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)2 FlowCapableNodeConnector (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector)2 NodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)2 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)2 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)2