use of net.floodlightcontroller.packet.ARP in project open-kilda by telstra.
the class ConnectedDevicesServiceTest method buildArpPacket.
private ARP buildArpPacket(byte[] data) throws PacketParsingException {
ARP arp = new ARP();
arp.deserialize(data, 0, data.length);
return arp;
}
use of net.floodlightcontroller.packet.ARP in project open-kilda by telstra.
the class ConnectedDevicesService method deserializeArp.
@VisibleForTesting
ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) {
try {
List<Integer> vlans = new ArrayList<>();
IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans);
if (payload instanceof ARP) {
return new ArpPacketData((ARP) payload, vlans);
}
} catch (Exception exception) {
logger.info("Could not deserialize ARP packet {} on switch {}. Cookie {}. Deserialization failure: {}", eth, switchId, Cookie.toString(cookie), exception.getMessage(), exception);
return null;
}
logger.info("Got invalid ARP packet: {} on switch {}. Cookie {}", eth, switchId, cookie);
return null;
}
Aggregations