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;
}
Aggregations