2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onosproject.incubator.net.intf;
19 import org.onlab.packet.IpAddress;
20 import org.onlab.packet.VlanId;
21 import org.onosproject.net.ConnectPoint;
26 * Service for interacting with interfaces.
28 public interface InterfaceService {
31 * Returns the set of all interfaces in the system.
33 * @return set of interfaces
35 Set<Interface> getInterfaces();
38 * Returns the set of interfaces configured on the given port.
40 * @param port connect point
41 * @return set of interfaces
43 Set<Interface> getInterfacesByPort(ConnectPoint port);
46 * Returns the set of interfaces with the given IP address.
48 * @param ip IP address
49 * @return set of interfaces
51 Set<Interface> getInterfacesByIp(IpAddress ip);
54 * Returns the set of interfaces in the given VLAN.
56 * @param vlan VLAN ID of the interfaces
57 * @return set of interfaces
59 Set<Interface> getInterfacesByVlan(VlanId vlan);
62 * Returns an interface that has an address that is in the same subnet as
63 * the given IP address.
65 * @param ip IP address to find matching subnet interface for
68 Interface getMatchingInterface(IpAddress ip);