tom | 613d814 | 2014-09-11 15:09:37 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.packet; |
| 2 | |
| 3 | import org.onlab.onos.net.DeviceId; |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 4 | import org.onlab.onos.net.flow.TrafficTreatment; |
tom | 613d814 | 2014-09-11 15:09:37 -0700 | [diff] [blame] | 5 | |
| 6 | import java.nio.ByteBuffer; |
tom | 613d814 | 2014-09-11 15:09:37 -0700 | [diff] [blame] | 7 | |
| 8 | /** |
| 9 | * Represents an outbound data packet that is to be emitted to network via |
| 10 | * an infrastructure device. |
| 11 | */ |
| 12 | public interface OutboundPacket { |
| 13 | |
| 14 | /** |
| 15 | * Returns the identity of a device through which this packet should be |
| 16 | * sent. |
| 17 | * |
| 18 | * @return device identity |
| 19 | */ |
| 20 | DeviceId sendThrough(); |
| 21 | |
| 22 | /** |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 23 | * Returns how the outbound packet should be treated. |
tom | 613d814 | 2014-09-11 15:09:37 -0700 | [diff] [blame] | 24 | * |
| 25 | * @return output treatment |
| 26 | */ |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 27 | TrafficTreatment treatment(); |
tom | 613d814 | 2014-09-11 15:09:37 -0700 | [diff] [blame] | 28 | |
| 29 | /** |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 30 | * Returns immutable view of the raw data to be sent. |
tom | 613d814 | 2014-09-11 15:09:37 -0700 | [diff] [blame] | 31 | * |
| 32 | * @return data to emit |
| 33 | */ |
| 34 | ByteBuffer data(); |
| 35 | |
| 36 | } |