blob: b164df93587d42a543c60b1f66a5bbcc241fdcab [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;
22import org.onosproject.net.ConnectPoint;
23
24import java.util.Set;
25
26/**
27 * Service for interacting with interfaces.
28 */
Thomas Vachuska4c571ae2015-09-10 16:31:59 -070029@Beta
Jonathan Harteb8c9472015-08-05 07:43:13 -070030public interface InterfaceService {
31
32 /**
33 * Returns the set of all interfaces in the system.
34 *
35 * @return set of interfaces
36 */
37 Set<Interface> getInterfaces();
38
39 /**
40 * Returns the set of interfaces configured on the given port.
41 *
42 * @param port connect point
43 * @return set of interfaces
44 */
45 Set<Interface> getInterfacesByPort(ConnectPoint port);
46
47 /**
48 * Returns the set of interfaces with the given IP address.
49 *
50 * @param ip IP address
51 * @return set of interfaces
52 */
53 Set<Interface> getInterfacesByIp(IpAddress ip);
54
55 /**
56 * Returns the set of interfaces in the given VLAN.
57 *
58 * @param vlan VLAN ID of the interfaces
59 * @return set of interfaces
60 */
61 Set<Interface> getInterfacesByVlan(VlanId vlan);
62
63 /**
64 * Returns an interface that has an address that is in the same subnet as
65 * the given IP address.
66 *
67 * @param ip IP address to find matching subnet interface for
68 * @return interface
69 */
70 Interface getMatchingInterface(IpAddress ip);
71}