blob: 4b126eb3ff81085a6a37c8babc7c420232e9d51d [file] [log] [blame]
Satish Kf6d87cb2015-11-30 19:59:22 +05301/*
2 * Copyright 2014-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 */
16package org.onosproject.iptopology.api.device;
17
18import org.onosproject.event.ListenerService;
19import org.onosproject.iptopology.api.DeviceIntf;
20import org.onosproject.iptopology.api.DevicePrefix;
21import org.onosproject.iptopology.api.InterfaceIdentifier;
22import org.onosproject.iptopology.api.IpDevice;
23import org.onosproject.net.DeviceId;
24import org.onlab.packet.Ip4Address;
25import org.onlab.packet.Ip6Address;
26
27import java.util.List;
28
29/**
30 * Service for interacting with the inventory of ip devices.
31 */
32public interface IpDeviceService
33 extends ListenerService<IpDeviceEvent, IpDeviceListener> {
34
35 /**
36 * Returns the number of ip devices known to the system.
37 *
38 * @return number of infrastructure devices
39 */
40 int getIpDeviceCount();
41
42 /**
43 * Returns a collection of the currently known ip
44 * devices.
45 *
46 * @return collection of devices
47 */
48 Iterable<IpDevice> getIpDevices();
49
50 /**
51 * Returns a collection of the currently known ip
52 * devices by device type.
53 *
54 * @param type device type
55 * @return collection of devices
56 */
57 Iterable<IpDevice> getIpDevices(IpDevice.Type type);
58
59
60 /**
61 * Returns the ip device with the specified identifier.
62 *
63 * @param deviceId device identifier
64 * @return device or null if one with the given identifier is not known
65 */
66 IpDevice getIpDevice(DeviceId deviceId);
67
68 /**
69 * Returns the list of interfaces associated with the device.
70 *
71 * @param deviceId device identifier
72 * @return list of device interfaces
73 */
74 List<DeviceIntf> getInterfaces(DeviceId deviceId);
75
76 /**
77 * Returns the interface with the specified ipv4 address and hosted by the given device.
78 *
79 * @param deviceId device identifier
80 * @param ipv4Address ipv4 address
81 * @return device interface
82 */
83 DeviceIntf getInterface(DeviceId deviceId, Ip4Address ipv4Address);
84
85 /**
86 * Returns the interface with the specified ipv6 address and hosted by the given device.
87 *
88 * @param deviceId device identifier
89 * @param ipv6Address ipv6 address
90 * @return device interface
91 */
92 DeviceIntf getInterface(DeviceId deviceId, Ip6Address ipv6Address);
93
94 /**
95 * Returns the interface with the specified interface id and hosted by the given device.
96 *
97 * @param deviceId device identifier
98 * @param intfId interface id
99 * @return device interface
100 */
101 DeviceIntf getInterface(DeviceId deviceId, InterfaceIdentifier intfId);
102
103 /**
104 * Returns the list of ip prefix associated with the device.
105 *
106 * @param deviceId device identifier
107 * @return list of device prefixes
108 */
109 List<DevicePrefix> getPrefixes(DeviceId deviceId);
110
111}