blob: cc9d8d0916d689eb6b1f3ede678282a20ce1fd90 [file] [log] [blame]
alshabib86ac11c2014-08-14 16:14:41 -07001// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
2// Copyright (c) 2011, 2012 Open Networking Foundation
3// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
4// This library was generated by the LoxiGen Compiler.
5// See the file LICENSE.txt which should have been included in the source distribution
6
7// Automatically generated by LOXI from template of_virtual_class.java
8// Do not modify
9
10package org.projectfloodlight.openflow.protocol.ver13;
11
12import org.projectfloodlight.openflow.protocol.*;
13import org.projectfloodlight.openflow.protocol.action.*;
14import org.projectfloodlight.openflow.protocol.actionid.*;
15import org.projectfloodlight.openflow.protocol.bsntlv.*;
16import org.projectfloodlight.openflow.protocol.errormsg.*;
17import org.projectfloodlight.openflow.protocol.meterband.*;
18import org.projectfloodlight.openflow.protocol.instruction.*;
19import org.projectfloodlight.openflow.protocol.instructionid.*;
20import org.projectfloodlight.openflow.protocol.match.*;
21import org.projectfloodlight.openflow.protocol.oxm.*;
22import org.projectfloodlight.openflow.protocol.queueprop.*;
23import org.projectfloodlight.openflow.types.*;
24import org.projectfloodlight.openflow.util.*;
25import org.projectfloodlight.openflow.exceptions.*;
26import org.jboss.netty.buffer.ChannelBuffer;
tom29df6f42014-09-05 08:14:14 -070027
28import java.nio.ByteBuffer;
alshabib86ac11c2014-08-14 16:14:41 -070029import java.util.Set;
30
31abstract class OFActionBsnVer13 {
32 // version: 1.3
33 final static byte WIRE_VERSION = 4;
34 final static int MINIMUM_LENGTH = 16;
35
36
37 public final static OFActionBsnVer13.Reader READER = new Reader();
38
39 static class Reader implements OFMessageReader<OFActionBsn> {
40 @Override
tom29df6f42014-09-05 08:14:14 -070041 public OFActionBsn readFrom(ByteBuffer bb) throws OFParseError {
alshabib86ac11c2014-08-14 16:14:41 -070042 if(bb.readableBytes() < MINIMUM_LENGTH)
43 return null;
44 int start = bb.readerIndex();
45 // fixed value property type == 65535
46 short type = bb.readShort();
47 if(type != (short) 0xffff)
48 throw new OFParseError("Wrong type: Expected=OFActionType.EXPERIMENTER(65535), got="+type);
49 int length = U16.f(bb.readShort());
50 if(length < MINIMUM_LENGTH)
51 throw new OFParseError("Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length);
52 // fixed value property experimenter == 0x5c16c7L
53 int experimenter = bb.readInt();
54 if(experimenter != 0x5c16c7)
55 throw new OFParseError("Wrong experimenter: Expected=0x5c16c7L(0x5c16c7L), got="+experimenter);
56 int subtype = bb.readInt();
57 bb.readerIndex(start);
58 switch(subtype) {
59 case 0x4:
60 // discriminator value 0x4L=0x4L for class OFActionBsnChecksumVer13
61 return OFActionBsnChecksumVer13.READER.readFrom(bb);
62 case 0x1:
63 // discriminator value 0x1L=0x1L for class OFActionBsnMirrorVer13
64 return OFActionBsnMirrorVer13.READER.readFrom(bb);
65 case 0x2:
66 // discriminator value 0x2L=0x2L for class OFActionBsnSetTunnelDstVer13
67 return OFActionBsnSetTunnelDstVer13.READER.readFrom(bb);
68 default:
69 throw new OFParseError("Unknown value for discriminator subtype of class OFActionBsnVer13: " + subtype);
70 }
71 }
72 }
73}