Search in sources :

Example 6 with LLDPTLV

use of net.floodlightcontroller.packet.LLDPTLV in project open-kilda by telstra.

the class PathVerificationPacketInTest method getPacket.

protected IPacket getPacket() {
    UDP udp = new UDP().setDestinationPort(TransportPort.of(PathVerificationService.VERIFICATION_PACKET_UDP_PORT)).setSourcePort(TransportPort.of(PathVerificationService.VERIFICATION_PACKET_UDP_PORT));
    VerificationPacket verificationPacket = new VerificationPacket().setChassisId(new LLDPTLV().setType((byte) 1).setLength((short) 7).setValue(new byte[] { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 })).setPortId(new LLDPTLV().setType((byte) 2).setLength((short) 3).setValue(new byte[] { 0x02, 0x00, 0x01 })).setTtl(new LLDPTLV().setType((byte) 3).setLength((short) 2).setValue(new byte[] { 0x00, 0x78 }));
    udp.setPayload(new Data(verificationPacket.serialize()));
    IPv4 ip = new IPv4().setSourceAddress("192.168.0.1").setDestinationAddress(PathVerificationService.VERIFICATION_PACKET_IP_DST).setProtocol(IpProtocol.UDP);
    Ethernet eth = new Ethernet().setDestinationMACAddress("AA:BB:CC:DD:EE:FF").setSourceMACAddress("11:22:33:44:55:66").setEtherType(EthType.IPv4);
    eth.setPayload(ip);
    ip.setPayload(udp);
    return eth;
}
Also used : UDP(net.floodlightcontroller.packet.UDP) IPv4(net.floodlightcontroller.packet.IPv4) Ethernet(net.floodlightcontroller.packet.Ethernet) Data(net.floodlightcontroller.packet.Data) LLDPTLV(net.floodlightcontroller.packet.LLDPTLV)

Aggregations

LLDPTLV (net.floodlightcontroller.packet.LLDPTLV)6 ByteBuffer (java.nio.ByteBuffer)4 Ethernet (net.floodlightcontroller.packet.Ethernet)3 JWTVerificationException (com.auth0.jwt.exceptions.JWTVerificationException)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 FloodlightModuleException (net.floodlightcontroller.core.module.FloodlightModuleException)2 IPv4 (net.floodlightcontroller.packet.IPv4)2 UDP (net.floodlightcontroller.packet.UDP)2 OFPortDesc (org.projectfloodlight.openflow.protocol.OFPortDesc)2 OFPortDescPropEthernet (org.projectfloodlight.openflow.protocol.OFPortDescPropEthernet)2 DecodedJWT (com.auth0.jwt.interfaces.DecodedJWT)1 InetSocketAddress (java.net.InetSocketAddress)1 IOFSwitch (net.floodlightcontroller.core.IOFSwitch)1 Data (net.floodlightcontroller.packet.Data)1 Message (org.openkilda.messaging.Message)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 IslInfoData (org.openkilda.messaging.info.event.IslInfoData)1 PathNode (org.openkilda.messaging.info.event.PathNode)1 OFMessage (org.projectfloodlight.openflow.protocol.OFMessage)1