Phaneendra Manda | 8db7d09 | 2016-06-04 00:17:24 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Phaneendra Manda | 8db7d09 | 2016-06-04 00:17:24 +0530 | [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 | |
| 17 | package org.onosproject.driver.extensions; |
| 18 | |
| 19 | import org.onlab.util.KryoNamespace; |
| 20 | import org.onosproject.net.flow.AbstractExtension; |
| 21 | import org.onosproject.net.flow.instructions.ExtensionTreatment; |
| 22 | import org.onosproject.net.flow.instructions.ExtensionTreatmentType; |
| 23 | |
| 24 | /** |
| 25 | * Nicira push nsh extension instruction. |
| 26 | */ |
| 27 | public class NiciraPushNsh extends AbstractExtension implements ExtensionTreatment { |
| 28 | |
| 29 | private final KryoNamespace appKryo = new KryoNamespace.Builder().build(); |
| 30 | |
| 31 | /** |
| 32 | * Creates a new push nsh instruction. |
| 33 | */ |
| 34 | public NiciraPushNsh() { |
| 35 | |
| 36 | } |
| 37 | |
| 38 | @Override |
| 39 | public ExtensionTreatmentType type() { |
| 40 | return ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_PUSH_NSH.type(); |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public void deserialize(byte[] data) { |
| 45 | } |
| 46 | |
| 47 | @Override |
| 48 | public byte[] serialize() { |
| 49 | return appKryo.serialize(0); |
| 50 | } |
| 51 | |
| 52 | @Override |
| 53 | public int hashCode() { |
| 54 | return 1; |
| 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public boolean equals(Object obj) { |
Jian Li | f97f2bc | 2017-03-19 22:37:49 +0900 | [diff] [blame] | 59 | return this == obj || obj instanceof NiciraPushNsh; |
Phaneendra Manda | 8db7d09 | 2016-06-04 00:17:24 +0530 | [diff] [blame] | 60 | } |
| 61 | } |