blob: 608697f2a8728baa54b0efe0258952836f68b940 [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 pop nsh extension instruction.
26 */
27public class NiciraPopNsh extends AbstractExtension implements ExtensionTreatment {
28
29 private final KryoNamespace appKryo = new KryoNamespace.Builder().build();
30
31 /**
32 * Creates a new pop nsh instruction.
33 */
34 public NiciraPopNsh() {
35 }
36
37 @Override
38 public ExtensionTreatmentType type() {
39 return ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_POP_NSH.type();
40 }
41
42 @Override
43 public void deserialize(byte[] data) {
44 }
45
46 @Override
47 public byte[] serialize() {
48 return appKryo.serialize(0);
49 }
50
51 @Override
52 public int hashCode() {
53 return 1;
54 }
55
56 @Override
57 public boolean equals(Object obj) {
Jian Lif97f2bc2017-03-19 22:37:49 +090058 return this == obj || obj instanceof NiciraPopNsh;
Phaneendra Manda8db7d092016-06-04 00:17:24 +053059 }
60}