private void replyInternal(NeighbourMessageContext context, MacAddress targetMac) { switch (context.protocol()) { case ARP: sendTo(ARP.buildArpReply((Ip4Address) context.target(), targetMac, context.packet()), context.inPort()); break; case NDP: sendTo(buildNdpReply((Ip6Address) context.target(), targetMac, context.packet(), context.isRouter()), context.inPort()); break; default: break; } }
Ethernet ethReply = ARP.buildArpReply(targetIp.getIp4Address(), dstMac, ethRequest);