blob: 2c60da8029deb0202b34458e3ad3719908de5dbd [file] [log] [blame]
Phaneendra Manda8db7d092016-06-04 00:17:24 +05301/*
2 * Copyright 2016-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
17package org.onosproject.driver.extensions;
18
19import org.onlab.util.KryoNamespace;
20import org.onosproject.net.flow.AbstractExtension;
21import org.onosproject.net.flow.instructions.ExtensionTreatment;
22import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
23
24/**
25 * Nicira push nsh extension instruction.
26 */
27public 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 Lif97f2bc2017-03-19 22:37:49 +090059 return this == obj || obj instanceof NiciraPushNsh;
Phaneendra Manda8db7d092016-06-04 00:17:24 +053060 }
61}