blob: 89a2c1714b082d21e27170a7931f006c46e8e17a [file] [log] [blame]
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -07001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
16package org.onosproject.net.edge;
17
Thomas Vachuska42e8cce2015-07-29 19:25:18 -070018import org.onosproject.event.ListenerService;
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -070019import org.onosproject.net.ConnectPoint;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.flow.TrafficTreatment;
22
23import java.nio.ByteBuffer;
24import java.util.Optional;
25
26/**
Thomas Vachuska85021922015-06-29 13:29:42 -070027 * 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 Vachuska41f4d3e2015-06-24 10:57:25 -070030 */
Thomas Vachuska42e8cce2015-07-29 19:25:18 -070031public interface EdgePortService
32 extends ListenerService<EdgePortEvent, EdgePortListener> {
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -070033
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 Kruglikova2b59152015-06-24 14:01:41 -070047 Iterable<ConnectPoint> getEdgePoints();
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -070048
49 /**
50 * Returns a collection of all edge point for the specified device.
51 *
Madan Jampani0dbac7a2015-06-25 10:37:45 -070052 * @param deviceId device identifier
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -070053 * @return iterable collection of all edge points for the device
54 */
Aaron Kruglikova2b59152015-06-24 14:01:41 -070055 Iterable<ConnectPoint> getEdgePoints(DeviceId deviceId);
Thomas Vachuska41f4d3e2015-06-24 10:57:25 -070056
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 Vachuska41f4d3e2015-06-24 10:57:25 -070075}