Jonathan Hart | eb8c947 | 2015-08-05 07:43:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.incubator.net.intf; |
| 18 | |
| 19 | import org.onlab.packet.IpAddress; |
| 20 | import org.onlab.packet.VlanId; |
| 21 | import org.onosproject.net.ConnectPoint; |
| 22 | |
| 23 | import java.util.Set; |
| 24 | |
| 25 | /** |
| 26 | * Service for interacting with interfaces. |
| 27 | */ |
| 28 | public interface InterfaceService { |
| 29 | |
| 30 | /** |
| 31 | * Returns the set of all interfaces in the system. |
| 32 | * |
| 33 | * @return set of interfaces |
| 34 | */ |
| 35 | Set<Interface> getInterfaces(); |
| 36 | |
| 37 | /** |
| 38 | * Returns the set of interfaces configured on the given port. |
| 39 | * |
| 40 | * @param port connect point |
| 41 | * @return set of interfaces |
| 42 | */ |
| 43 | Set<Interface> getInterfacesByPort(ConnectPoint port); |
| 44 | |
| 45 | /** |
| 46 | * Returns the set of interfaces with the given IP address. |
| 47 | * |
| 48 | * @param ip IP address |
| 49 | * @return set of interfaces |
| 50 | */ |
| 51 | Set<Interface> getInterfacesByIp(IpAddress ip); |
| 52 | |
| 53 | /** |
| 54 | * Returns the set of interfaces in the given VLAN. |
| 55 | * |
| 56 | * @param vlan VLAN ID of the interfaces |
| 57 | * @return set of interfaces |
| 58 | */ |
| 59 | Set<Interface> getInterfacesByVlan(VlanId vlan); |
| 60 | |
| 61 | /** |
| 62 | * Returns an interface that has an address that is in the same subnet as |
| 63 | * the given IP address. |
| 64 | * |
| 65 | * @param ip IP address to find matching subnet interface for |
| 66 | * @return interface |
| 67 | */ |
| 68 | Interface getMatchingInterface(IpAddress ip); |
| 69 | } |