blob: 38cfdc55004f0f7c16ccaa3614bf6c1545b1c6c1 [file] [log] [blame]
Jonathan Harteb8c9472015-08-05 07:43:13 -07001/*
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
17package org.onosproject.incubator.net.intf;
18
Thomas Vachuska4c571ae2015-09-10 16:31:59 -070019import com.google.common.annotations.Beta;
Jonathan Harteb8c9472015-08-05 07:43:13 -070020import org.onlab.packet.IpAddress;
21import org.onlab.packet.VlanId;
Jonathan Hart4b5c6dc2015-10-13 14:27:48 -070022import org.onosproject.event.ListenerService;
Jonathan Harteb8c9472015-08-05 07:43:13 -070023import org.onosproject.net.ConnectPoint;
24
25import java.util.Set;
26
27/**
28 * Service for interacting with interfaces.
29 */
Thomas Vachuska4c571ae2015-09-10 16:31:59 -070030@Beta
Jonathan Hart4b5c6dc2015-10-13 14:27:48 -070031public interface InterfaceService
32 extends ListenerService<InterfaceEvent, InterfaceListener> {
Jonathan Harteb8c9472015-08-05 07:43:13 -070033
34 /**
35 * Returns the set of all interfaces in the system.
36 *
37 * @return set of interfaces
38 */
39 Set<Interface> getInterfaces();
40
41 /**
42 * Returns the set of interfaces configured on the given port.
43 *
44 * @param port connect point
45 * @return set of interfaces
46 */
47 Set<Interface> getInterfacesByPort(ConnectPoint port);
48
49 /**
50 * Returns the set of interfaces with the given IP address.
51 *
52 * @param ip IP address
53 * @return set of interfaces
54 */
55 Set<Interface> getInterfacesByIp(IpAddress ip);
56
57 /**
58 * Returns the set of interfaces in the given VLAN.
59 *
60 * @param vlan VLAN ID of the interfaces
61 * @return set of interfaces
62 */
63 Set<Interface> getInterfacesByVlan(VlanId vlan);
64
65 /**
66 * Returns an interface that has an address that is in the same subnet as
67 * the given IP address.
68 *
69 * @param ip IP address to find matching subnet interface for
70 * @return interface
71 */
72 Interface getMatchingInterface(IpAddress ip);
73}