Carmelo Cascone | f7aa3f9 | 2017-07-06 23:56:50 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present 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 | */ |
| 16 | |
| 17 | package org.onosproject.p4runtime.api; |
| 18 | |
| 19 | import com.google.common.annotations.Beta; |
| 20 | import org.onlab.util.ImmutableByteSequence; |
| 21 | import org.onosproject.net.DeviceId; |
| 22 | |
| 23 | import java.util.List; |
| 24 | |
| 25 | /** |
| 26 | * Information about a packet-in received from a P4Runtime device. |
| 27 | */ |
| 28 | @Beta |
| 29 | public interface P4RuntimePacketIn extends P4RuntimeEventSubject { |
| 30 | |
| 31 | /** |
| 32 | * Returns the identifier of the device that generated this packet-in. |
| 33 | * |
| 34 | * @return device identifier |
| 35 | */ |
| 36 | DeviceId deviceId(); |
| 37 | |
| 38 | /** |
| 39 | * Returns the packet raw data. |
| 40 | * |
| 41 | * @return byte sequence |
| 42 | */ |
| 43 | ImmutableByteSequence data(); |
| 44 | |
| 45 | /** |
| 46 | * Returns the list of metadata associated with this packet-in, to be parsed by a |
| 47 | * {@link org.onosproject.net.pi.model.PiPipelineInterpreter}. |
| 48 | * |
| 49 | * @return list of byte sequences |
| 50 | */ |
| 51 | List<ImmutableByteSequence> metadata(); |
| 52 | } |