blob: 9a172a29b6e29c0c6ff54c880e00569cf7497f34 [file] [log] [blame]
Hyunsun Moon90163ba2016-10-12 13:35:14 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Hyunsun Moon90163ba2016-10-12 13:35:14 -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.ofagent.api;
17
Claudine Chiub211b872017-09-05 17:27:00 -040018import org.onosproject.core.ApplicationId;
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090019import org.onosproject.incubator.net.virtual.NetworkId;
Claudine Chiu5c184e12017-08-08 21:21:38 -040020import org.onosproject.net.ConnectPoint;
Claudine Chiu785ef2d2017-07-04 13:13:28 -040021import org.onosproject.net.DeviceId;
22import org.onosproject.net.Port;
Claudine Chiu5c184e12017-08-08 21:21:38 -040023import org.onosproject.net.PortNumber;
Claudine Chiu2729ffd2017-07-31 21:38:27 -040024import org.onosproject.net.device.PortStatistics;
Claudine Chiuce8ccc62017-08-16 10:06:20 -040025import org.onosproject.net.flow.FlowEntry;
26import org.onosproject.net.flow.TableStatisticsEntry;
27import org.onosproject.net.group.Group;
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090028
Claudine Chiu2729ffd2017-07-31 21:38:27 -040029import java.util.List;
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090030import java.util.Set;
Hyunsun Moon90163ba2016-10-12 13:35:14 -070031
32/**
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090033 * Service for providing virtual OpenFlow switch information.
Hyunsun Moon90163ba2016-10-12 13:35:14 -070034 */
35public interface OFSwitchService {
36
37 /**
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090038 * Returns all openflow switches that OF agent service manages.
Hyunsun Moon90163ba2016-10-12 13:35:14 -070039 *
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090040 * @return set of openflow switches; empty set if no openflow switches exist
Hyunsun Moon90163ba2016-10-12 13:35:14 -070041 */
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090042 Set<OFSwitch> ofSwitches();
Hyunsun Moon90163ba2016-10-12 13:35:14 -070043
44 /**
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090045 * Returns all openflow switches for the specified network.
Hyunsun Moon90163ba2016-10-12 13:35:14 -070046 *
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090047 * @param networkId network id
48 * @return set of openflow switches; empty set if no devices exist on the network
Hyunsun Moon90163ba2016-10-12 13:35:14 -070049 */
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090050 Set<OFSwitch> ofSwitches(NetworkId networkId);
Claudine Chiu785ef2d2017-07-04 13:13:28 -040051
52 /**
Claudine Chiu2729ffd2017-07-31 21:38:27 -040053 * Returns openflow switch for the specified device in the specified network.
54 *
55 * @param networkId network id
56 * @param deviceId device id
57 * @return openflow switch; null if none exists
58 */
59 OFSwitch ofSwitch(NetworkId networkId, DeviceId deviceId);
60
61 /**
Claudine Chiu785ef2d2017-07-04 13:13:28 -040062 * Returns all ports of the specified device in the specified network.
63 *
64 * @param networkId network id
65 * @param deviceId device id
66 * @return set of ports; empty set if no ports exist for the specified device
67 */
68 Set<Port> ports(NetworkId networkId, DeviceId deviceId);
Claudine Chiu2729ffd2017-07-31 21:38:27 -040069
70 /**
71 * Returns all port statistics of the specified device in the specified network.
72 *
73 * @param networkId network id
74 * @param deviceId device id
75 * @return list of port statistics; empty list if none exists for the specified device
76 */
77 List<PortStatistics> getPortStatistics(NetworkId networkId, DeviceId deviceId);
78
Claudine Chiu5c184e12017-08-08 21:21:38 -040079 /**
Claudine Chiuce8ccc62017-08-16 10:06:20 -040080 * Returns all flow entries of the specified device in the specified network.
81 *
82 * @param networkId network id
83 * @param deviceId device id
84 * @return list of flow entries; empty list if none exists for the specified device
85 */
86 List<FlowEntry> getFlowEntries(NetworkId networkId, DeviceId deviceId);
87
88 /**
89 * Returns all flow table statistics of the specified device in the specified network.
90 *
91 * @param networkId network id
92 * @param deviceId device id
93 * @return list of flow table statistics; empty list if none exists for the specified device
94 */
95 List<TableStatisticsEntry> getFlowTableStatistics(NetworkId networkId, DeviceId deviceId);
96
97 /**
98 * Returns all groups associated with the specified device in the specified network.
99 *
100 * @param networkId network id
101 * @param deviceId device id
102 * @return list of groups; empty list if none exists for the specified device
103 */
104 List<Group> getGroups(NetworkId networkId, DeviceId deviceId);
105
106 /**
Claudine Chiu5c184e12017-08-08 21:21:38 -0400107 * Returns neighbour port of the specified port in the specified network.
108 *
109 * @param networkId network id
110 * @param deviceId device id
111 * @param portNumber port number
112 * @return connect point; null if none exists
113 */
114 ConnectPoint neighbour(NetworkId networkId, DeviceId deviceId, PortNumber portNumber);
Claudine Chiub211b872017-09-05 17:27:00 -0400115
116 /**
117 * Returns application id.
118 *
119 * @return application id
120 */
121 ApplicationId appId();
Hyunsun Moon90163ba2016-10-12 13:35:14 -0700122}