@Override public void registerNeighbourHandler(Interface intf, NeighbourMessageHandler handler, ApplicationId appId) { register(intf.connectPoint(), new HandlerRegistration(handler, intf, appId)); }
@Override public void unregisterNeighbourHandler(Interface intf, NeighbourMessageHandler handler, ApplicationId appId) { unregister(intf.connectPoint(), new HandlerRegistration(handler, intf, appId)); }
@Override public void add(Interface intf) { InterfaceConfig config = configService.addConfig(intf.connectPoint(), CONFIG_CLASS); config.addInterface(intf); configService.applyConfig(intf.connectPoint(), CONFIG_CLASS, config.node()); }
/** * Sends an ARP or NDP request for the given IP address. * * @param targetIp IP address to send the request for */ private void sendRequest(IpAddress targetIp) { interfaceService.getMatchingInterfaces(targetIp).forEach(intf -> { if (!edgePortService.isEdgePoint(intf.connectPoint())) { log.warn("Aborting attempt to send probe out non-edge port: {}", intf); return; } intf.ipAddressesList().stream() .filter(ia -> ia.subnetAddress().contains(targetIp)) .forEach(ia -> { MacAddress probeMac = intf.mac(); IpAddress probeIp = !probeMac.equals(MacAddress.ONOS) ? ia.ipAddress() : (ia.ipAddress().isIp4() ? Ip4Address.ZERO : Ip6Address.ZERO); sendProbe(intf.connectPoint(), targetIp, probeIp, probeMac, intf.vlan()); // account for use-cases where tagged-vlan config is used if (!intf.vlanTagged().isEmpty()) { intf.vlanTagged().forEach(tag -> { sendProbe(intf.connectPoint(), targetIp, probeIp, probeMac, tag); }); } }); }); }
NO_NAME : intf.name(); print(formatStringBuilder.toString(), name, intf.connectPoint().deviceId(), intf.connectPoint().port());
@Override public void forward(NeighbourMessageContext context, Interface outIntf) { Ethernet packetOut = context.packet().duplicate(); if (outIntf.vlan().equals(VlanId.NONE)) { // The egress interface has no VLAN Id. Send out an untagged // packet packetOut.setVlanID(Ethernet.VLAN_UNTAGGED); } else { // The egress interface has a VLAN set. Send out a tagged packet packetOut.setVlanID(outIntf.vlan().toShort()); } sendTo(packetOut, outIntf.connectPoint()); }