blob: 28d837c25f4703bef63292b238db68e938c5b339 [file] [log] [blame]
Pier Ventreee4a8f22016-10-22 15:45:36 -07001/*
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 com.google.common.base.MoreObjects;
20import org.onlab.util.KryoNamespace;
21import org.onosproject.net.flow.AbstractExtension;
22import org.onosproject.net.flow.instructions.ExtensionTreatment;
23import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
24
25/**
26 * Ofdpa pop l2 header extension instruction.
27 */
28public class Ofdpa3PopL2Header extends AbstractExtension implements ExtensionTreatment {
29
30 private static final KryoNamespace APPKRYO = new KryoNamespace.Builder().build();
31
32 /**
33 * Creates a new pop l2 header instruction.
34 */
35 public Ofdpa3PopL2Header() {
36
37 }
38
39 @Override
40 public ExtensionTreatmentType type() {
41 return ExtensionTreatmentType.ExtensionTreatmentTypes.OFDPA_POP_L2_HEADER.type();
42 }
43
44 @Override
45 public void deserialize(byte[] data) {
46 }
47
48 @Override
49 public byte[] serialize() {
50 return APPKRYO.serialize(true);
51 }
52
53 @Override
54 public int hashCode() {
55 return 1;
56 }
57
58 @Override
59 public boolean equals(Object obj) {
Jian Lif97f2bc2017-03-19 22:37:49 +090060 return this == obj || obj instanceof Ofdpa3PopL2Header;
Pier Ventreee4a8f22016-10-22 15:45:36 -070061 }
62
63 @Override
64 public String toString() {
65 return MoreObjects.toStringHelper(getClass())
66 .toString();
67 }
68}