Thomas Vachuska | 41f4d3e | 2015-06-24 10:57:25 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Thomas Vachuska | 41f4d3e | 2015-06-24 10:57:25 -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.net.edge; |
| 17 | |
Thomas Vachuska | 42e8cce | 2015-07-29 19:25:18 -0700 | [diff] [blame] | 18 | import org.onosproject.event.ListenerService; |
Thomas Vachuska | 41f4d3e | 2015-06-24 10:57:25 -0700 | [diff] [blame] | 19 | import org.onosproject.net.ConnectPoint; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | import org.onosproject.net.flow.TrafficTreatment; |
| 22 | |
| 23 | import java.nio.ByteBuffer; |
| 24 | import java.util.Optional; |
| 25 | |
| 26 | /** |
Thomas Vachuska | 8502192 | 2015-06-29 13:29:42 -0700 | [diff] [blame] | 27 | * Service for interacting with an inventory of network edge ports. A port |
| 28 | * is considered an edge port if it is an active port and does not have an |
| 29 | * infrastructure link associated with it. |
Thomas Vachuska | 41f4d3e | 2015-06-24 10:57:25 -0700 | [diff] [blame] | 30 | */ |
Thomas Vachuska | 42e8cce | 2015-07-29 19:25:18 -0700 | [diff] [blame] | 31 | public interface EdgePortService |
| 32 | extends ListenerService<EdgePortEvent, EdgePortListener> { |
Thomas Vachuska | 41f4d3e | 2015-06-24 10:57:25 -0700 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * Indicates whether or not the specified connection point is an edge point. |
| 36 | * |
| 37 | * @param point connection point |
| 38 | * @return true if edge point |
| 39 | */ |
| 40 | boolean isEdgePoint(ConnectPoint point); |
| 41 | |
| 42 | /** |
| 43 | * Returns a collection of all edge point within the current topology. |
| 44 | * |
| 45 | * @return iterable collection of all edge points |
| 46 | */ |
Aaron Kruglikov | a2b5915 | 2015-06-24 14:01:41 -0700 | [diff] [blame] | 47 | Iterable<ConnectPoint> getEdgePoints(); |
Thomas Vachuska | 41f4d3e | 2015-06-24 10:57:25 -0700 | [diff] [blame] | 48 | |
| 49 | /** |
| 50 | * Returns a collection of all edge point for the specified device. |
| 51 | * |
Madan Jampani | 0dbac7a | 2015-06-25 10:37:45 -0700 | [diff] [blame] | 52 | * @param deviceId device identifier |
Thomas Vachuska | 41f4d3e | 2015-06-24 10:57:25 -0700 | [diff] [blame] | 53 | * @return iterable collection of all edge points for the device |
| 54 | */ |
Aaron Kruglikov | a2b5915 | 2015-06-24 14:01:41 -0700 | [diff] [blame] | 55 | Iterable<ConnectPoint> getEdgePoints(DeviceId deviceId); |
Thomas Vachuska | 41f4d3e | 2015-06-24 10:57:25 -0700 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * Emits the specified packet, with optional treatment to all edge ports. |
| 59 | * |
| 60 | * @param data packet data |
| 61 | * @param treatment optional traffic treatment to apply to the packet |
| 62 | */ |
| 63 | void emitPacket(ByteBuffer data, Optional<TrafficTreatment> treatment); |
| 64 | |
| 65 | /** |
| 66 | * Emits the specified packet, with optional treatment to all edge ports. |
| 67 | * |
| 68 | * @param deviceId device where to send the packet out |
| 69 | * @param data packet data |
| 70 | * @param treatment optional traffic treatment to apply to the packet |
| 71 | */ |
| 72 | void emitPacket(DeviceId deviceId, ByteBuffer data, |
| 73 | Optional<TrafficTreatment> treatment); |
| 74 | |
Thomas Vachuska | 41f4d3e | 2015-06-24 10:57:25 -0700 | [diff] [blame] | 75 | } |