@Test public void testForwardFlood() { expect(hostService.getHost(HID2)).andReturn(null); replay(hostService); replay(interfaceService); Ethernet arpRequest = buildArp(ARP.OP_REPLY, VLAN1, MAC1, MAC2, IP1, IP2); proxyArp.forward(arpRequest, getLocation(NUM_DEVICES)); verifyFlood(arpRequest, noConfigCPoints); }
@Override public void forward(Ethernet eth, ConnectPoint inPort) { checkPermission(PACKET_WRITE); checkNotNull(eth, REQUEST_NULL); Host h = hostService.getHost(hostId(eth.getDestinationMAC(), vlanId(eth.getVlanID()))); if (h == null) { flood(eth, inPort); } else { Host subject = hostService.getHost(hostId(eth.getSourceMAC(), vlanId(eth.getVlanID()))); store.forward(h.location(), subject, ByteBuffer.wrap(eth.serialize())); } }
ProxyArpManager implements ProxyArpService { @Override public void forward(Ethernet eth, ConnectPoint inPort) { checkPermission(PACKET_WRITE); checkNotNull(eth, REQUEST_NULL); Host h = hostService.getHost(hostId(eth.getDestinationMAC(), vlanId(eth.getVlanID()))); if (h == null) { flood(eth, inPort); } else { Host subject = hostService.getHost(hostId(eth.getSourceMAC(), vlanId(eth.getVlanID()))); store.forward(h.location(), subject, ByteBuffer.wrap(eth.serialize())); } } }
ProxyArpManager implements ProxyArpService { @Override public void forward(Ethernet eth, ConnectPoint inPort) { checkPermission(PACKET_WRITE); checkNotNull(eth, REQUEST_NULL); Host h = hostService.getHost(hostId(eth.getDestinationMAC(), vlanId(eth.getVlanID()))); if (h == null) { flood(eth, inPort); } else { Host subject = hostService.getHost(hostId(eth.getSourceMAC(), vlanId(eth.getVlanID()))); store.forward(h.location(), subject, ByteBuffer.wrap(eth.serialize())); } }  }
ProxyArpManager implements ProxyArpService { @Override public void forward(Ethernet eth, ConnectPoint inPort) { checkPermission(PACKET_WRITE); checkNotNull(eth, REQUEST_NULL); Host h = hostService.getHost(hostId(eth.getDestinationMAC(), vlanId(eth.getVlanID()))); if (h == null) { flood(eth, inPort); } else { Host subject = hostService.getHost(hostId(eth.getSourceMAC(), vlanId(eth.getVlanID()))); store.forward(h.location(), subject, ByteBuffer.wrap(eth.serialize())); } }  @Activate void activate(); @Deactivate void deactivate(); @Override boolean isKnown(IpAddress addr); @Override void reply(Ethernet eth, ConnectPoint inPort); @Override void forward(Ethernet eth, ConnectPoint inPort); @Override boolean handlePacket(PacketContext context); }
ProxyArpManager implements ProxyArpService { @Override public void forward(Ethernet eth, ConnectPoint inPort) { checkPermission(PACKET_WRITE); checkNotNull(eth, REQUEST_NULL); Host h = hostService.getHost(hostId(eth.getDestinationMAC(), vlanId(eth.getVlanID()))); if (h == null) { flood(eth, inPort); } else { Host subject = hostService.getHost(hostId(eth.getSourceMAC(), vlanId(eth.getVlanID()))); store.forward(h.location(), subject, ByteBuffer.wrap(eth.serialize())); } }  @Activate void activate(); @Deactivate void deactivate(); @Override boolean isKnown(IpAddress addr); @Override void reply(Ethernet eth, ConnectPoint inPort); @Override void forward(Ethernet eth, ConnectPoint inPort); @Override boolean handlePacket(PacketContext context);  }