Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.networkgraph; |
| 2 | |
| 3 | import java.net.InetAddress; |
| 4 | |
| 5 | import net.floodlightcontroller.util.MACAddress; |
| 6 | |
| 7 | /** |
| 8 | * The northbound interface to the topology network graph. This interface |
| 9 | * is presented to the rest of ONOS. It is currently read-only, as we want |
| 10 | * only the discovery modules to be allowed to modify the topology. |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 11 | */ |
| 12 | public interface NetworkGraph { |
Pavlin Radoslavov | 06df22a | 2014-02-18 19:16:27 -0800 | [diff] [blame^] | 13 | /** |
| 14 | * Get the switch for a given switch DPID. |
| 15 | * |
| 16 | * @param dpid the switch dpid. |
| 17 | * @return the switch if found, otherwise, null. |
| 18 | */ |
| 19 | public Switch getSwitch(Long dpid); |
Yuta HIGUCHI | c6174df | 2014-02-10 20:44:38 -0800 | [diff] [blame] | 20 | |
Pavlin Radoslavov | 06df22a | 2014-02-18 19:16:27 -0800 | [diff] [blame^] | 21 | /** |
| 22 | * Get all switches in the network. |
| 23 | * |
| 24 | * @return all switches in the network. |
| 25 | */ |
| 26 | public Iterable<Switch> getSwitches(); |
Yuta HIGUCHI | c6174df | 2014-02-10 20:44:38 -0800 | [diff] [blame] | 27 | |
Pavlin Radoslavov | 06df22a | 2014-02-18 19:16:27 -0800 | [diff] [blame^] | 28 | /** |
| 29 | * Get the port on a switch. |
| 30 | * |
| 31 | * @param dpid the switch DPID. |
| 32 | * @param number the switch port number. |
| 33 | * @return the switch port if found, otherwise, null. |
| 34 | */ |
| 35 | public Port getPort(Long dpid, Long number); |
| 36 | |
| 37 | /** |
| 38 | * Get all links in the network. |
| 39 | * |
| 40 | * TODO: Not clear if this method is needed. Remove if not used. |
| 41 | * |
| 42 | * @return all links in the network. |
| 43 | */ |
| 44 | public Iterable<Link> getLinks(); |
| 45 | |
| 46 | /** |
| 47 | * Get all outgoing links for a switch. |
| 48 | * |
| 49 | * TODO: Not clear if this method is needed. Remove if not used. |
| 50 | * E.g, getSwitch(dpid).getOutgoingLinks() is equivalent. |
| 51 | * |
| 52 | * @param dpid the switch DPID. |
| 53 | * @return all outgoing links for a switch. |
| 54 | */ |
| 55 | public Iterable<Link> getOutgoingLinksFromSwitch(Long dpid); |
| 56 | |
| 57 | /** |
| 58 | * Get all incoming links for a switch. |
| 59 | * |
| 60 | * TODO: Not clear if this method is needed. Remove if not used. |
| 61 | * E.g, getSwitch(dpid).getIncomingLinks() is equivalent. |
| 62 | * |
| 63 | * @param dpid the switch DPID. |
| 64 | * @return all incoming links for a switch. |
| 65 | */ |
| 66 | public Iterable<Link> getIncomingLinksFromSwitch(Long dpid); |
| 67 | |
| 68 | /** |
| 69 | * Get the network devices for a given IP address. |
| 70 | * |
| 71 | * @param ipAddress the IP address to use. |
| 72 | * @return the network devices for the IP address. |
| 73 | */ |
| 74 | public Iterable<Device> getDevicesByIp(InetAddress ipAddress); |
| 75 | |
| 76 | /** |
| 77 | * Get the network device for a given MAC address. |
| 78 | * |
| 79 | * @param address the MAC address to use. |
| 80 | * @return the network device for the MAC address if found, otherwise null. |
| 81 | */ |
| 82 | public Device getDeviceByMac(MACAddress address); |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 83 | } |