@Test public void createArpMatchTest() { Ipv4Address senderAddress = new Ipv4Address("192.168.0.1"); Ipv4Address targetAddress = new Ipv4Address("192.168.0.2"); MacAddress targetMac = new MacAddress("00:00:00:00:00:01"); ArpMessageAddress target = new ArpMessageAddress(targetMac, targetAddress); ArpMatch match = ArpFlowFactory.createArpMatch(target, senderAddress); Assert.assertTrue(match.getArpTargetTransportAddress().getValue().contains(targetAddress.getValue())); Assert.assertTrue(match.getArpSourceTransportAddress().getValue().contains(senderAddress.getValue())); Assert.assertEquals(ArpOperation.REPLY.intValue(), match.getArpOp().intValue()); }
public static ArpMatch createArpMatch(ArpMessageAddress targetAddress, Ipv4Address senderProtocolAddress) { return new ArpMatchBuilder().setArpOp(ArpOperation.REPLY.intValue()) .setArpTargetTransportAddress(new Ipv4Prefix(targetAddress.getProtocolAddress().getValue() + HOST_MASK)) .setArpSourceTransportAddress(new Ipv4Prefix(senderProtocolAddress.getValue() + HOST_MASK)) .build(); }
ArpFlowFactory { public static ArpMatch createArpMatch(ArpMessageAddress targetAddress, Ipv4Address senderProtocolAddress) { return new ArpMatchBuilder().setArpOp(ArpOperation.REPLY.intValue()) .setArpTargetTransportAddress(new Ipv4Prefix(targetAddress.getProtocolAddress().getValue() + HOST_MASK)) .setArpSourceTransportAddress(new Ipv4Prefix(senderProtocolAddress.getValue() + HOST_MASK)) .build(); } }
ArpFlowFactory { public static ArpMatch createArpMatch(ArpMessageAddress targetAddress, Ipv4Address senderProtocolAddress) { return new ArpMatchBuilder().setArpOp(ArpOperation.REPLY.intValue()) .setArpTargetTransportAddress(new Ipv4Prefix(targetAddress.getProtocolAddress().getValue() + HOST_MASK)) .setArpSourceTransportAddress(new Ipv4Prefix(senderProtocolAddress.getValue() + HOST_MASK)) .build(); }  }
ArpFlowFactory { public static ArpMatch createArpMatch(ArpMessageAddress targetAddress, Ipv4Address senderProtocolAddress) { return new ArpMatchBuilder().setArpOp(ArpOperation.REPLY.intValue()) .setArpTargetTransportAddress(new Ipv4Prefix(targetAddress.getProtocolAddress().getValue() + HOST_MASK)) .setArpSourceTransportAddress(new Ipv4Prefix(senderProtocolAddress.getValue() + HOST_MASK)) .build(); }  static EthernetMatch createEthernetMatch(MacAddress destinationMacAddress); static EthernetMatch createEthernetMatch(); static ArpMatch createArpMatch(ArpMessageAddress targetAddress, Ipv4Address senderProtocolAddress); static Action createSendToControllerAction(int order); }
ArpFlowFactory { public static ArpMatch createArpMatch(ArpMessageAddress targetAddress, Ipv4Address senderProtocolAddress) { return new ArpMatchBuilder().setArpOp(ArpOperation.REPLY.intValue()) .setArpTargetTransportAddress(new Ipv4Prefix(targetAddress.getProtocolAddress().getValue() + HOST_MASK)) .setArpSourceTransportAddress(new Ipv4Prefix(senderProtocolAddress.getValue() + HOST_MASK)) .build(); }  static EthernetMatch createEthernetMatch(MacAddress destinationMacAddress); static EthernetMatch createEthernetMatch(); static ArpMatch createArpMatch(ArpMessageAddress targetAddress, Ipv4Address senderProtocolAddress); static Action createSendToControllerAction(int order);  }