Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 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 | package org.onosproject.ofagent.api; |
| 17 | |
Claudine Chiu | b211b87 | 2017-09-05 17:27:00 -0400 | [diff] [blame] | 18 | import org.onosproject.core.ApplicationId; |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 19 | import org.onosproject.incubator.net.virtual.NetworkId; |
Claudine Chiu | 5c184e1 | 2017-08-08 21:21:38 -0400 | [diff] [blame] | 20 | import org.onosproject.net.ConnectPoint; |
Claudine Chiu | 785ef2d | 2017-07-04 13:13:28 -0400 | [diff] [blame] | 21 | import org.onosproject.net.DeviceId; |
| 22 | import org.onosproject.net.Port; |
Claudine Chiu | 5c184e1 | 2017-08-08 21:21:38 -0400 | [diff] [blame] | 23 | import org.onosproject.net.PortNumber; |
Claudine Chiu | 2729ffd | 2017-07-31 21:38:27 -0400 | [diff] [blame] | 24 | import org.onosproject.net.device.PortStatistics; |
Claudine Chiu | ce8ccc6 | 2017-08-16 10:06:20 -0400 | [diff] [blame] | 25 | import org.onosproject.net.flow.FlowEntry; |
| 26 | import org.onosproject.net.flow.TableStatisticsEntry; |
| 27 | import org.onosproject.net.group.Group; |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 28 | |
Claudine Chiu | 2729ffd | 2017-07-31 21:38:27 -0400 | [diff] [blame] | 29 | import java.util.List; |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 30 | import java.util.Set; |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 33 | * Service for providing virtual OpenFlow switch information. |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 34 | */ |
| 35 | public interface OFSwitchService { |
| 36 | |
| 37 | /** |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 38 | * Returns all openflow switches that OF agent service manages. |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 39 | * |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 40 | * @return set of openflow switches; empty set if no openflow switches exist |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 41 | */ |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 42 | Set<OFSwitch> ofSwitches(); |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 43 | |
| 44 | /** |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 45 | * Returns all openflow switches for the specified network. |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 46 | * |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 47 | * @param networkId network id |
| 48 | * @return set of openflow switches; empty set if no devices exist on the network |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 49 | */ |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 50 | Set<OFSwitch> ofSwitches(NetworkId networkId); |
Claudine Chiu | 785ef2d | 2017-07-04 13:13:28 -0400 | [diff] [blame] | 51 | |
| 52 | /** |
Claudine Chiu | 2729ffd | 2017-07-31 21:38:27 -0400 | [diff] [blame] | 53 | * 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 Chiu | 785ef2d | 2017-07-04 13:13:28 -0400 | [diff] [blame] | 62 | * 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 Chiu | 2729ffd | 2017-07-31 21:38:27 -0400 | [diff] [blame] | 69 | |
| 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 Chiu | 5c184e1 | 2017-08-08 21:21:38 -0400 | [diff] [blame] | 79 | /** |
Claudine Chiu | ce8ccc6 | 2017-08-16 10:06:20 -0400 | [diff] [blame] | 80 | * 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 Chiu | 5c184e1 | 2017-08-08 21:21:38 -0400 | [diff] [blame] | 107 | * 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 Chiu | b211b87 | 2017-09-05 17:27:00 -0400 | [diff] [blame] | 115 | |
| 116 | /** |
| 117 | * Returns application id. |
| 118 | * |
| 119 | * @return application id |
| 120 | */ |
| 121 | ApplicationId appId(); |
Hyunsun Moon | 90163ba | 2016-10-12 13:35:14 -0700 | [diff] [blame] | 122 | } |