Search in sources :

Example 21 with Payload

use of org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.payload.Payload 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

NodeConnectorRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef)12 Test (org.junit.Test)11 TransmitPacketInput (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput)11 BigInteger (java.math.BigInteger)8 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)8 TransmitPacketInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInputBuilder)8 NodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)7 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)7 PacketReceivedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketReceivedBuilder)7 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)6 ArrayList (java.util.ArrayList)5 PacketException (org.opendaylight.openflowplugin.libraries.liblldp.PacketException)5 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)5 Ipv6Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)4 UnknownHostException (java.net.UnknownHostException)3 ExecutionException (java.util.concurrent.ExecutionException)3 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)3 NodeConnectorKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey)3 MetadataBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder)3 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.packet.received.MatchBuilder)3