blob: d28d38d5ca3cf612d9e82a7f8b6b7655535b5c78 [file] [log] [blame]
Srikanth Vavilapalli37a461b2015-04-07 15:12:32 -07001/*
Charles Chan72f556a2015-10-05 17:50:33 -07002 * Copyright 2014-2015 Open Networking Laboratory
Srikanth Vavilapalli37a461b2015-04-07 15:12:32 -07003 *
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.segmentrouting.grouphandler;
17
18import java.util.List;
Charles Chan77277672015-10-20 16:24:19 -070019import java.util.Map;
Srikanth Vavilapalli37a461b2015-04-07 15:12:32 -070020
Charles Chan77277672015-10-20 16:24:19 -070021import org.onlab.packet.Ip4Prefix;
Srikanth Vavilapalli37a461b2015-04-07 15:12:32 -070022import org.onlab.packet.MacAddress;
23import org.onosproject.net.DeviceId;
Charles Chan77277672015-10-20 16:24:19 -070024import org.onosproject.net.PortNumber;
Srikanth Vavilapalli37a461b2015-04-07 15:12:32 -070025
26/**
27 * Mechanism through which group handler module retrieves
28 * the device specific attributes such as segment ID,
29 * Mac address...etc from group handler applications.
30 */
31public interface DeviceProperties {
32 /**
33 * Returns the segment id of a device to be used in group creation.
34 *
35 * @param deviceId device identifier
36 * @return segment id of a device
37 */
38 int getSegmentId(DeviceId deviceId);
Charles Chan77277672015-10-20 16:24:19 -070039
Srikanth Vavilapalli37a461b2015-04-07 15:12:32 -070040 /**
41 * Returns the Mac address of a device to be used in group creation.
42 *
43 * @param deviceId device identifier
44 * @return mac address of a device
45 */
46 MacAddress getDeviceMac(DeviceId deviceId);
Charles Chan77277672015-10-20 16:24:19 -070047
Srikanth Vavilapalli37a461b2015-04-07 15:12:32 -070048 /**
49 * Indicates whether a device is edge device or transit/core device.
50 *
51 * @param deviceId device identifier
52 * @return boolean
53 */
54 boolean isEdgeDevice(DeviceId deviceId);
Charles Chan77277672015-10-20 16:24:19 -070055
Srikanth Vavilapalli37a461b2015-04-07 15:12:32 -070056 /**
57 * Returns all segment IDs to be considered in building auto
58 *
59 * created groups.
60 * @return list of segment IDs
61 */
62 List<Integer> getAllDeviceSegmentIds();
Charles Chan77277672015-10-20 16:24:19 -070063
64 /**
65 * Returns subnet-to-ports mapping of given device.
66 *
67 * For each entry of the map
68 * Key: a subnet
69 * Value: a list of ports, which are bound to the subnet
70 *
71 * @param deviceId device identifier
72 * @return a map that contains all subnet-to-ports mapping of given device
73 */
74 Map<Ip4Prefix, List<PortNumber>> getSubnetPortsMap(DeviceId deviceId);
Srikanth Vavilapalli37a461b2015-04-07 15:12:32 -070075}