use of org.openkilda.messaging.info.event.ArpInfoData in project open-kilda by telstra.
the class PacketServiceTest method testHandleArpDataDifferentPortNumber.
@Test
public void testHandleArpDataDifferentPortNumber() {
ArpInfoData updatedData = createArpInfoData();
updatedData.setPortNumber(PORT_NUMBER_2);
runHandleArpDataWithAddedDevice(updatedData);
}
use of org.openkilda.messaging.info.event.ArpInfoData in project open-kilda by telstra.
the class PacketBolt method handleInput.
@Override
protected void handleInput(Tuple input) throws PipelineException {
if (active) {
Message message = pullValue(input, FIELD_ID_PAYLOAD, Message.class);
if (message instanceof InfoMessage) {
log.debug("Received info message {}", message);
InfoData data = ((InfoMessage) message).getData();
if (data instanceof LldpInfoData) {
packetService.handleLldpData((LldpInfoData) data);
} else if (data instanceof ArpInfoData) {
packetService.handleArpData((ArpInfoData) data);
} else {
unhandledInput(input);
}
} else {
unhandledInput(input);
}
}
}
use of org.openkilda.messaging.info.event.ArpInfoData in project open-kilda by telstra.
the class PacketServiceTest method testHandleArpDataDifferentIpAddress.
@Test
public void testHandleArpDataDifferentIpAddress() {
ArpInfoData updatedData = createArpInfoData();
updatedData.setIpAddress(IP_ADDRESS_2);
runHandleArpDataWithAddedDevice(updatedData);
}
use of org.openkilda.messaging.info.event.ArpInfoData in project open-kilda by telstra.
the class ConnectedDevicesService method handleArp.
private void handleArp(OfInput input, SwitchId switchId, long cookie) {
Ethernet ethernet = input.getPacketInPayload();
ArpPacketData data = deserializeArp(ethernet, switchId, cookie);
if (data == null) {
return;
}
ArpInfoData arpInfoData = new ArpInfoData(switchId, input.getPort().getPortNumber(), data.vlans, cookie, data.arp.getSenderHardwareAddress().toString(), data.arp.getSenderProtocolAddress().toString());
InfoMessage message = new InfoMessage(arpInfoData, System.currentTimeMillis(), CorrelationContext.getId(), region);
producerService.sendMessageAndTrackWithZk(topic, switchId.toString(), message);
}
Aggregations