Jonathan Hart | ebba1e1 | 2013-10-29 11:37:02 -0700 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.core.config; |
Jonathan Hart | 08ee852 | 2013-09-22 17:34:43 +1200 | [diff] [blame] | 2 | |
| 3 | import java.net.InetAddress; |
| 4 | |
| 5 | import net.floodlightcontroller.util.MACAddress; |
Jonathan Hart | ebba1e1 | 2013-10-29 11:37:02 -0700 | [diff] [blame] | 6 | import net.onrc.onos.ofcontroller.bgproute.Interface; |
Jonathan Hart | a888764 | 2013-10-28 13:46:54 -0700 | [diff] [blame] | 7 | import net.onrc.onos.ofcontroller.core.module.IOnosService; |
Jonathan Hart | 08ee852 | 2013-09-22 17:34:43 +1200 | [diff] [blame] | 8 | |
| 9 | /** |
| 10 | * Provides information about the layer 3 properties of the network. |
| 11 | * This is based on IP addresses configured on ports in the network. |
| 12 | * |
| 13 | */ |
Jonathan Hart | a888764 | 2013-10-28 13:46:54 -0700 | [diff] [blame] | 14 | public interface IConfigInfoService extends IOnosService { |
Jonathan Hart | 08ee852 | 2013-09-22 17:34:43 +1200 | [diff] [blame] | 15 | public boolean isInterfaceAddress(InetAddress address); |
| 16 | public boolean inConnectedNetwork(InetAddress address); |
| 17 | public boolean fromExternalNetwork(long inDpid, short inPort); |
| 18 | |
| 19 | /** |
| 20 | * Retrieves the {@link Interface} object for the interface that packets |
| 21 | * to dstIpAddress will be sent out of. Returns null if dstIpAddress is not |
| 22 | * in a directly connected network, or if no interfaces are configured. |
| 23 | * @param dstIpAddress Destination IP address that we want to match to |
| 24 | * an outgoing interface |
| 25 | * @return The {@link Interface} object if found, null if not |
| 26 | */ |
| 27 | public Interface getOutgoingInterface(InetAddress dstIpAddress); |
| 28 | |
| 29 | /** |
| 30 | * Returns whether this controller has a layer 3 configuration |
| 31 | * (i.e. interfaces and IP addresses) |
| 32 | * @return True if IP addresses are configured, false if not |
| 33 | */ |
| 34 | public boolean hasLayer3Configuration(); |
| 35 | |
| 36 | public MACAddress getRouterMacAddress(); |
Jonathan Hart | a888764 | 2013-10-28 13:46:54 -0700 | [diff] [blame] | 37 | |
| 38 | /** |
| 39 | * We currently have basic vlan support for the situation when the contr |
| 40 | * is running within a single vlan. In this case, packets sent from the |
| 41 | * controller (e.g. ARP) need to be tagged with that vlan. |
| 42 | * @return The vlan id configured in the config file, |
| 43 | * or 0 if no vlan is configured. |
| 44 | */ |
| 45 | public short getVlan(); |
| 46 | |
| 47 | |
Jonathan Hart | 08ee852 | 2013-09-22 17:34:43 +1200 | [diff] [blame] | 48 | } |