2 * Copyright 2014-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.
16 package org.onosproject.segmentrouting.grouphandler;
18 import java.util.List;
21 import org.onlab.packet.Ip4Prefix;
22 import org.onlab.packet.MacAddress;
23 import org.onosproject.net.DeviceId;
24 import org.onosproject.net.PortNumber;
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.
31 public interface DeviceProperties {
33 * Returns the segment id of a device to be used in group creation.
35 * @param deviceId device identifier
36 * @return segment id of a device
38 int getSegmentId(DeviceId deviceId);
41 * Returns the Mac address of a device to be used in group creation.
43 * @param deviceId device identifier
44 * @return mac address of a device
46 MacAddress getDeviceMac(DeviceId deviceId);
49 * Indicates whether a device is edge device or transit/core device.
51 * @param deviceId device identifier
54 boolean isEdgeDevice(DeviceId deviceId);
57 * Returns all segment IDs to be considered in building auto
60 * @return list of segment IDs
62 List<Integer> getAllDeviceSegmentIds();
65 * Returns subnet-to-ports mapping of given device.
67 * For each entry of the map
69 * Value: a list of ports, which are bound to the subnet
71 * @param deviceId device identifier
72 * @return a map that contains all subnet-to-ports mapping of given device
74 Map<Ip4Prefix, List<PortNumber>> getSubnetPortsMap(DeviceId deviceId);