@Test public void testReplyToRequestForUs() { Ip4Address theirIp = Ip4Address.valueOf("10.0.1.254"); Ip4Address ourFirstIp = Ip4Address.valueOf("10.0.1.1"); Ip4Address ourSecondIp = Ip4Address.valueOf("10.0.2.1"); MacAddress firstMac = MacAddress.valueOf(1L); MacAddress secondMac = MacAddress.valueOf(2L); Host requestor = new DefaultHost(PID, HID1, MAC1, VLAN1, LOC1, Collections.singleton(theirIp)); expect(hostService.getHost(HID1)).andReturn(requestor); replay(hostService); replay(interfaceService); Ethernet arpRequest = buildArp(ARP.OP_REQUEST, VLAN1, MAC1, null, theirIp, ourFirstIp); proxyArp.reply(arpRequest, LOC1); assertEquals(1, packetService.packets.size()); Ethernet arpReply = buildArp(ARP.OP_REPLY, VLAN1, firstMac, MAC1, ourFirstIp, theirIp); verifyPacketOut(arpReply, LOC1, packetService.packets.get(0)); packetService.packets.clear(); arpRequest = buildArp(ARP.OP_REQUEST, VLAN1, MAC1, null, theirIp, ourSecondIp); proxyArp.reply(arpRequest, LOC1); assertEquals(1, packetService.packets.size()); arpReply = buildArp(ARP.OP_REPLY, VLAN1, secondMac, MAC1, ourSecondIp, theirIp); verifyPacketOut(arpReply, LOC1, packetService.packets.get(0)); }
@Override public void reply(Ethernet eth, ConnectPoint inPort) { checkPermission(PACKET_WRITE); checkNotNull(eth, REQUEST_NULL); MessageContext context = createContext(eth, inPort); if (context != null) { replyInternal(context); } }
ProxyArpManager implements ProxyArpService { @Override public void reply(Ethernet eth, ConnectPoint inPort) { checkPermission(PACKET_WRITE); checkNotNull(eth, REQUEST_NULL); MessageContext context = createContext(eth, inPort); if (context != null) { replyInternal(context); } } }
ProxyArpManager implements ProxyArpService { @Override public void reply(Ethernet eth, ConnectPoint inPort) { checkPermission(PACKET_WRITE); checkNotNull(eth, REQUEST_NULL); MessageContext context = createContext(eth, inPort); if (context != null) { replyInternal(context); } }  }
ProxyArpManager implements ProxyArpService { @Override public void reply(Ethernet eth, ConnectPoint inPort) { checkPermission(PACKET_WRITE); checkNotNull(eth, REQUEST_NULL); MessageContext context = createContext(eth, inPort); if (context != null) { replyInternal(context); } }  @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 reply(Ethernet eth, ConnectPoint inPort) { checkPermission(PACKET_WRITE); checkNotNull(eth, REQUEST_NULL); MessageContext context = createContext(eth, inPort); if (context != null) { replyInternal(context); } }  @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);  }